diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fb945920e4c..73d477fc18b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -109,10 +109,10 @@ jobs: - name: Run clippy run: | - cargo clippy --all-targets --features unstable-light-client -- -D warnings + cargo clippy --all-targets --features light-client -- -D warnings cargo clippy -p subxt-lightclient --no-default-features --features web -- -D warnings cargo clippy -p subxt --no-default-features --features web -- -D warnings - cargo clippy -p subxt --no-default-features --features web,unstable-light-client -- -D warnings + cargo clippy -p subxt --no-default-features --features web,light-client -- -D warnings - if: "failure()" uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5 @@ -144,7 +144,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: -p subxt --no-default-features --features web,unstable-light-client,jsonrpsee --target wasm32-unknown-unknown -- -D warnings + args: -p subxt --no-default-features --features web,light-client,jsonrpsee --target wasm32-unknown-unknown -- -D warnings - if: "failure()" uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5 @@ -433,7 +433,7 @@ jobs: uses: actions-rs/cargo@v1.0.3 with: command: test - args: --release --package integration-tests --features unstable-light-client + args: --release --package integration-tests --features light-client - if: "failure()" uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5 diff --git a/CHANGELOG.md b/CHANGELOG.md index 97963ec6792..499d43fe408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,423 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [0.50.0] - 2025-12-17 + +This release version is a deliberately large bump up from 0.44.0 to signify the extent of the changes in this release. + +The headline changes are as follows: +- Subxt is no longer _head-of-chain_ only, and can work with historic blocks, all the way back to genesis. **Note:** user-provided type information is required to do this for very old (> ~2year old, ie pre-V14 metadata) blocks. +- The MVP `subxt-historic` crate has been removed, its functionality having been merged into Subxt. +- The `subxt-core` crate has been removed for now to make way for the above. Subxt itself continues to support WASM use cases. + - For truly `no-std` functionality, the `frame-decode` crate now contains much of the underlying logic used throughout Subxt to encode and decode things, and we would like to expand the functionality here. + - We would like feedback from any users of the `subxt-core` crate on how they use it, and will use this feedback to drive future work in this area. +- No more monitoring for runtime updates is needed; Subxt now works across different runtime versions automatically. +- Errors are no longer one big `Error` enum; instead different Subxt APIs return different errors, to limit the number of possible errors in any one place. These all convert into `subxt::Error` so this can continue to be used as a catch-all. +- Storage APIs have been redone, fixing some [issues](https://github.com/paritytech/subxt/issues/1928) and giving much more control over iteration, as well as key and value decoding. + +This changes have results in many breaking changes across APIs, which I will try my best to summarize below. + +A good place to look for a more holistic understanding of what's changes are the examples, both: +- The [smaller single-file examples](https://github.com/paritytech/subxt/tree/master/subxt/examples) +- The [larger project-based examples](https://github.com/paritytech/subxt/tree/master/examples) + +For the smaller examples, start with [the basic transaction submission example](https://github.com/paritytech/subxt/blob/jsdw-subxt-new/subxt/examples/submit_transaction.rs) and then have a look at [the blocks example](https://github.com/paritytech/subxt/blob/jsdw-subxt-new/subxt/examples/blocks.rs) and [the storage example](https://github.com/paritytech/subxt/blob/jsdw-subxt-new/subxt/examples/storage_entries.rs) to give the best broad overview of the changes. Pick and choose others next depending on what suits. + +A breakdown of the significant changes follows, to aid migration efforts: + +### Configuration + +**Before** + +Configuration (`PolkadotConfig` and `SubstrateConfig`) was type-only and didn't exist at the value level, and so you'd provide it to the client like so: + +```rust +use subxt::{OnlineClient, PolkadotConfig}; + +let api = OnlineClient::::new().await?; +``` + +**After** + +Configuration now exists at the value level too. This is because it has been extended with support for historic types and working with historic metadatas and spec versions: + +```rust +use subxt::{OnlineClient, PolkadotConfig}; + +let config = PolkadotConfig::new(); +let api = OnlineClient::new(config).await?; +``` + +The rules for when to use `PolkadotConfig` and `SubstrateConfig` remain the same: +- Use `PolkadotConfig` for the **Polkadot Relay Chain**. +- Use `SubstrateConfig` by default with other chains. +- You may need to modify the configuration to work with some chains, as before. + +See the docs for `PolkadotConfig` and `SubstrateConfig` for more. If you want to work with historic blocks for instance, you'll need to provide historic type information for `SubstrateConfig`. + +### Working at specific blocks + +**Before** + +Previously, you'd be able to select (within a limited range) which block to work at with APIs like so: + +```rust +let api = OnlineClient::::new().await?; + +let constants = api.constants(); + +let storage = api.storage().at(block_hash).await?; +let storage = api.storage().at_latest().await?; + +let events = api.events().at(block_hash).await?; +let events = api.events().at_latest().await?; + +let runtime_apis = api.runtime_api().at(block_hash).await?; +let runtime_apis = api.runtime_api().at_latest().await?; +``` + +**After** + +Now, the block is selected first, like so: + +```rust +let config = PolkadotConfig::new(); +let api = OnlineClient::new(config).await?; + +let constants = api.at_block(block_hash_or_number).await?.constants(); +let constants = api.at_current_block().await?.constants(); + +let storage = api.at_block(block_hash_or_number).await?.storage(); +let storage = api.at_current_block().await?.storage(); + +let events = api.at_block(block_hash_or_number).await?.events(); +let events = api.at_current_block().await?.events(); + +let runtime_apis = api.at_block(block_hash_or_number).await?.runtime_apis(); +let runtime_apis = api.at_current_block().await?.runtime_apis(); +``` + +Notes: +- `at_latest` has been renamed to `at_current_block` and, like before, it fetches the current _finalized_ block at the time of calling. +- `at_current_block` now accepts a block hahs _or_ block number, and returns a client that works in the context of that block. +- Constants were not previously retrieved at a given block; Subxt only knew about a single `Metadata` and so it was unnecessary. Now, constants are retrieved at a specific block like everything else (different blocks may have different `Metadata`s). +- A small thing: `runtime_api()` was renamed to `runtime_apis()` to be consistent with other APIs names. +- `.tx()` is now callable at a specific block, and uses this block for any account nonce and mortality configuration. + +### Working with blocks + +**Before** + +A `.blocks()` method accessed block-specific APIs for fetching and subscribing to blocks. + +```rust +let api = OnlineClient::::new().await?; + +// fetching: +let block = api.blocks().at(block_hash).await?; +let block = api.blocks().at_latest().await?; + +// subscribing: +let mut blocks = api.blocks().subscribe_finalized().await?; +while let Some(block) = blocks_sub.next().await { + let block = block?; + + let extrinsics = block.extrinsics().await?; + for ext in extrinsics.iter() { + // See the blocks example for more. + } +} +``` + +**After** + +Now that APIs are largely block-specific up front, we don't need separate APIs for block fetching, and move streaming blocks up a level. + +```rust +let api = OnlineClient::::new().await?; + +// fetching: +let block = api.at_block(block_hash_or_number).await?; +let block = api.at_current_block().await?; + +// subscribing: +let mut blocks = api.stream_blocks().await?; +while let Some(block) = blocks_sub.next().await { + let block = block?; + + // now, we instantiate a client at a given block, which gives back the + // same thing as api.at_block() and api.at_current_block() does: + let at_block = block.at().await?; + + let extrinsics = at_block.extrinsics().fetch().await?; + for ext in extrinsics.iter() { + // See the blocks example for more. + } +} +``` + +Notes: +- Working with finalized blocks is always the default now, and API names are shortened to make them the easiest/most obvious to use. +- Use `.at()` at a given block to hand back a full client which can do anything at that block. +- `api.blocks().subscribe_finalized()` => `api.stream_blocks()`. +- `api.blocks().subscribe_best()` => `api.stream_best_blocks()`. +- `api.blocks().subscribe_all()` => `api.stream_all_blocks()`. + +### Transactions + +**Before** + +Transactions were implicitly created at the latest block, and the APIs were disconnected from any particular block: + +```rust +let api = OnlineClient::::new().await?; + +// Submit an extrinsic, waiting for success. +let events = api + .tx() + .sign_and_submit_then_watch_default(&balance_transfer_tx, &from) + .await? + .wait_for_finalized_success() + .await?; +``` + +**After** + +Transactions are anchored to a given block but we continue to provide a `.tx()` method on the client as a shorthand for "create transactions at the current block". + +```rust +let config = PolkadotConfig::new(); +let api = OnlineClient::new(config).await?; + +// Work at a specific block: +let at_block = api.at_current_block().await?; + +// Submit the balance transfer extrinsic anchored at this block: +let events = at_block + .tx() + .sign_and_submit_then_watch_default(&balance_transfer_tx, &from) + .await? + .wait_for_finalized_success() + .await?; + +// A shorthand for the above: +let events = api + .tx() + .await? // This is the minimal change from the old APIs. + .sign_and_submit_then_watch_default(&balance_transfer_tx, &from) + .await? + .wait_for_finalized_success() + .await?; +``` + +Notes: +- We now use `transactions` instead of `tx` everywhere to align better with other API names, but continue to provide `tx` as a shorthand. +- The word `partial` is changed to `signable` in transaction APIs. "partial" was always a confusing name, and "signable" makes it much clearer what is being created; something that can be signed. + - `tx().create_partial_offline(..)` => `tx().create_signable_offline(..)` + - `tx().create_v4_partial_offline(..)` => `tx().create_v4_signable_offline(..)` + - `tx().create_v5_partial_offline(..)` => `tx().create_v5_signable_offline(..)` + - `tx().create_partial(..)` => `tx().create_signable(..)` + - `tx().create_v4_partial(..)` => `tx().create_v4_signable(..)` + - `tx().create_v5_partial(..)` => `tx().create_v5_signable(..)` +- `tx().from_bytes(bytes)` is added as an easy way to hand a pre-constructed transaction to Subxt to be submitted, removing the need for an ugly `SubmittableTransaction::from_bytes` method. + +### Storage Entries + +**Before** + +The codegen dealt with the heavy lifting of iterating storage maps at various depths (albeit with a bug), and on fetching an entry you had little control over how you handled the resulting bytes. + +```rust +let api = OnlineClient::::new().await?; + +//// Fetching: +let result = api + .storage() + .at_latest() + .await? + .fetch(&storage_query) + .await?; + +//// Iterating +let mut results = api + .storage() + .at_latest() + .await? + .iter(storage_query) + .await?; +while let Some(Ok(kv)) = results.next().await { + println!("Keys decoded: {:?}", kv.keys); // <- Broken in some cases + println!("Key: 0x{}", hex::encode(&kv.key_bytes)); + println!("Value: {:?}", kv.value); +} +``` + +**After** + +A redesign of the Storage APIs makes everything more unified, and allows working at specific storage entries in a much more flexible way than before, while moving logic out of the codegen, simplifying it, and into Subxt proper. + +```rust +let config = PolkadotConfig::new(); +let api = OnlineClient::new(config).await?; +let at_block = api.at_current_block().await?; + +let account_balances = at_block + .storage() + .entry(storage_query)?; + +//// Fetching: + +// We can fetch multiple values from an entry: +let value1 = account_balances.fetch((account_id1,)).await?; +let value2 = account_balances.fetch((account_id2,)).await?; + +// Entries can be decoded into the static type given by the address: +let result = value1.decode()?; +// Or they can be decoded into any arbitrary shape: +let result = value1.decode_as::()?; +// Or we can "visit" the entry for more control over decoding: +let result = value1.visit(my_visitor)?; +// Or we can just get the bytes out and do what we want: +let result_bytes = value1.bytes(); + + +//// Iterating + +// We can iterate over the same entry we fetched things from: +let mut balances = account_balances.iter(()).await?; +while let Some(Ok(entry)) = all_balances.next().await { + let key = entry.key()?; + let value = entry.value(); + + // Decode the keys that can be decoded: + let keys_tuple = key.decode()?; + // Value is as above: + let value = value.decode()?; + + println!("Keys decoded: {:?}", keys_tuple); + println!("Key: 0x{}", hex::encode(key.bytes())); + println!("Value: {:?}", value); +} +``` + +This is perhaps the largest change to any specific set of APIs in terms of differences. Take a look at the API docs and [the storage example](https://github.com/paritytech/subxt/blob/jsdw-subxt-new/subxt/examples/storage_entries.rs) and [PR](https://github.com/paritytech/subxt/pull/2100) for more on this. + +### Dynamic values + +**Before** + +Dynamic values were always constructed using and returning `scale_value::Value`s, for instance: + +```rust +let constant_query = subxt::dynamic::constant( + "System", + "BlockLength" +); + +let runtime_api_payload = subxt::dynamic::runtime_api_call( + "AccountNonceApi", + "account_nonce", + vec![Value::from_bytes(account)], +); + +let storage_query = subxt::dynamic::storage( + "System", + "Account", + vec![Value::from_bytes(account)] +); +``` + +**After** + +The dynamic methods have been made more generic, allowing more arbitrary types to be used in their construction, and alloowing the return type to be set. This does however mean that types need to be provided sometimes: + +```rust +let constant_query = subxt::dynamic::constant::( + "System", + "BlockLength" +); + +let runtime_api_payload = subxt::dynamic::runtime_api_call::<_, Value>( + "AccountNonceApi", + "account_nonce", + vec![Value::from_bytes(account)], +); +// We can provide more generic input args now, negating the need +// to convert to Values unnecessarily: +let runtime_api_payload = subxt::dynamic::runtime_api_call::<_, Value>( + "AccountNonceApi", + "account_nonce", + (account,), +); + +// We no longer provide the keys up front for storage; we just point +// to the _entry_ we want and provide the key and return types: +let storage_query = subxt::dynamic::storage::, Value>( + "System", + "Account", +); +// This allows us to set better key/value types if we know what to expect. Here +// we know what information we want from account info and the key format: +#[derive(scale_decode::DecodeAsType)] +struct MyAccountInfo { + nonce: u32, + data: MyAccountInfoData +} +#[derive(scale_decode::DecodeAsType)] +struct MyAccountInfoData { + free: u128, + reserved: u128 +} +let storage_query = subxt::dynamic::storage::<(AccountId32,), MyAccountInfo>( + "System", + "Account", +); +``` + +Notes: +- As before when `scale_value::Value` was used everywhere, the _actual_ values provided are always checked at runtime against the API and invalid shapes/values will lead to an error. +- Now, it's possible to provide statically typed values when you know roughly what to expect, or even to just provide your own dynamic value type that isn't `scale_value::Value`. This makes it easier to work against historic blocks where you may not have or want to use the `#[subxt]` codegen, but still want to work with static types as much as possible. + +### Metadata + +Subxt previously exposed `subxt::Metadata`, which was a wrapped version of `subxt_metadata::Metadata`. The wrapping was removed, and now we have only `subxt_metadata::Metadata`, which is exposed as `subxt::Metadata`. This metadata can be cloned but is not cheap to clone, and so we also expose `subxt::ArcMetadata`, which is used in many places and is the `Arc`-wrapped version of it, for cheap cloning. + +`subxt_metadata::Metadata` now exposes helper functions to construct it from various `frame_metadata` versions, to support our historic decoding efforts: +- `Metadata::from_v16(..)` +- `Metadata::from_v15(..)` +- `Metadata::from_v14(..)` +- `Metadata::from_v13(..)` +- `Metadata::from_v12(..)` +- `Metadata::from_v11(..)` +- `Metadata::from_v10(..)` +- `Metadata::from_v9(..)` +- `Metadata::from_v8(..)` + +Where the older versions require type information to be provided in addition to the correpsonding `frame_metadata` version. + +A list of the main change PRs follows: ### Added -- Add `system_chain_type()` RPC method to `LegacyRpcMethods` +- Allow passing $OUT_DIR in the runtime_metadata_path attribute ([#2142](https://github.com/paritytech/subxt/pull/2142)) +- feat: Add `system_chainType` to legacy rpcs ([#2116](https://github.com/paritytech/subxt/pull/2116)) +- Add --at-block option to CLI tool to download metadata at a specific block ([#2079](https://github.com/paritytech/subxt/pull/2079)) + +### Changed + +- [v0.50.0] Implement support for historic blocks in Subxt ([#2131](https://github.com/paritytech/subxt/pull/2131)) +- subxt-historic: 0.0.8 release: expose type resolver that can be used with visitors ([#2140](https://github.com/paritytech/subxt/pull/2140)) +- subxt-historic: 0.0.7 release: expose ClientAtBlock bits ([#2138](https://github.com/paritytech/subxt/pull/2138)) +- subxt-historic: 0.0.6 release: expose metadata at a given block ([#2135](https://github.com/paritytech/subxt/pull/2135)) +- [v0.50.0] Merge preliminary work to master ([#2127](https://github.com/paritytech/subxt/pull/2127)) + - subxt-historic: 0.0.6 release: visit methods ([#2126](https://github.com/paritytech/subxt/pull/2126)) + - Allow visiting extrinsic fields in subxt_historic ([#2124](https://github.com/paritytech/subxt/pull/2124)) + - Convert historic metadata to `subxt::Metadata` ([#2120](https://github.com/paritytech/subxt/pull/2120)) + - Update scale-info-legacy and frame-decode to latest ([#2119](https://github.com/paritytech/subxt/pull/2119)) + - Integrate frame-decode, redo storage APIs and break up Error ([#2100](https://github.com/paritytech/subxt/pull/2100)) +- Bump smoldot / smoldot-light to latest ([#2110](https://github.com/paritytech/subxt/pull/2110)) +- [subxt-historic]: extract call and event types from metadata at a block ([#2095](https://github.com/paritytech/subxt/pull/2095)) +- subxt-historic: add support for returning the default values of storage entries ([#2072](https://github.com/paritytech/subxt/pull/2072)) ## [0.44.0] - 2025-08-28 diff --git a/Cargo.lock b/Cargo.lock index 8d6309a22b5..47faa5ad53c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -464,7 +464,7 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "artifacts" -version = "0.44.0" +version = "0.50.0" dependencies = [ "substrate-runner", ] @@ -1953,9 +1953,9 @@ dependencies = [ [[package]] name = "frame-decode" -version = "0.15.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fb3bfa2988ef40247e0e0eecfb171a01ad6f4e399485503aad4c413a5f236f3" +checksum = "e63257bb5f8d7a707d626aa1b4e464c3b9720edd168b73cee98f48f0dd6386e4" dependencies = [ "frame-metadata 23.0.0", "parity-scale-codec", @@ -2132,7 +2132,7 @@ dependencies = [ [[package]] name = "generate-custom-metadata" -version = "0.44.0" +version = "0.50.0" dependencies = [ "frame-metadata 23.0.0", "parity-scale-codec", @@ -2753,7 +2753,7 @@ dependencies = [ [[package]] name = "integration-tests" -version = "0.44.0" +version = "0.50.0" dependencies = [ "assert_matches", "cfg_aliases", @@ -4410,9 +4410,9 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64901733157f9d25ef86843bd783eda439fac7efb0ad5a615d12d2cf3a29464b" +checksum = "f2a976d73564a59e482b74fd5d95f7518b79ca8c8ca5865398a4d629dd15ee50" dependencies = [ "parity-scale-codec", "primitive-types", @@ -5599,7 +5599,7 @@ dependencies = [ [[package]] name = "substrate-runner" -version = "0.44.0" +version = "0.50.0" [[package]] name = "subtle" @@ -5609,25 +5609,30 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subxt" -version = "0.44.0" +version = "0.50.0" dependencies = [ "assert_matches", "async-trait", "bitvec", "derive-where", "either", + "frame-decode", "frame-metadata 23.0.0", "futures", "hex", "http-body", "hyper", + "impl-serde", "jsonrpsee", + "keccak-hash", "parity-scale-codec", "primitive-types", "scale-bits", "scale-decode", "scale-encode", "scale-info", + "scale-info-legacy", + "scale-type-resolver", "scale-value", "serde", "serde_json", @@ -5635,26 +5640,25 @@ dependencies = [ "sp-crypto-hashing", "sp-keyring", "sp-runtime", - "subxt-core", "subxt-lightclient", "subxt-macro", "subxt-metadata", "subxt-rpcs", "subxt-signer", + "subxt-utils-accountid32", "thiserror 2.0.12", "tokio", "tokio-util", "tower", "tracing", "tracing-subscriber", - "url", "wasm-bindgen-futures", "web-time", ] [[package]] name = "subxt-cli" -version = "0.44.0" +version = "0.50.0" dependencies = [ "clap", "color-eyre", @@ -5688,7 +5692,7 @@ dependencies = [ [[package]] name = "subxt-codegen" -version = "0.44.0" +version = "0.50.0" dependencies = [ "frame-metadata 23.0.0", "getrandom 0.2.16", @@ -5703,65 +5707,9 @@ dependencies = [ "thiserror 2.0.12", ] -[[package]] -name = "subxt-core" -version = "0.44.0" -dependencies = [ - "assert_matches", - "base58", - "bitvec", - "blake2", - "derive-where", - "frame-decode", - "frame-metadata 23.0.0", - "hashbrown 0.14.5", - "hex", - "impl-serde", - "keccak-hash", - "parity-scale-codec", - "primitive-types", - "scale-bits", - "scale-decode", - "scale-encode", - "scale-info", - "scale-value", - "serde", - "serde_json", - "sp-core", - "sp-crypto-hashing", - "sp-keyring", - "subxt-macro", - "subxt-metadata", - "subxt-signer", - "thiserror 2.0.12", - "tracing", -] - -[[package]] -name = "subxt-historic" -version = "0.0.8" -dependencies = [ - "frame-decode", - "frame-metadata 23.0.0", - "futures", - "hex", - "parity-scale-codec", - "primitive-types", - "scale-decode", - "scale-info", - "scale-info-legacy", - "scale-type-resolver", - "scale-value", - "sp-crypto-hashing", - "subxt-rpcs", - "thiserror 2.0.12", - "tokio", - "url", -] - [[package]] name = "subxt-lightclient" -version = "0.44.0" +version = "0.50.0" dependencies = [ "futures", "futures-timer", @@ -5786,7 +5734,7 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.44.0" +version = "0.50.0" dependencies = [ "darling", "parity-scale-codec", @@ -5806,7 +5754,7 @@ dependencies = [ [[package]] name = "subxt-metadata" -version = "0.44.0" +version = "0.50.0" dependencies = [ "bitvec", "criterion", @@ -5825,7 +5773,7 @@ dependencies = [ [[package]] name = "subxt-rpcs" -version = "0.44.0" +version = "0.50.0" dependencies = [ "derive-where", "finito", @@ -5841,7 +5789,6 @@ dependencies = [ "primitive-types", "serde", "serde_json", - "subxt-core", "subxt-lightclient", "thiserror 2.0.12", "tokio", @@ -5854,7 +5801,7 @@ dependencies = [ [[package]] name = "subxt-signer" -version = "0.44.0" +version = "0.50.0" dependencies = [ "base64 0.22.1", "bip32", @@ -5880,22 +5827,39 @@ dependencies = [ "sp-core", "sp-crypto-hashing", "sp-keyring", - "subxt-core", + "subxt", + "subxt-utils-accountid32", "thiserror 2.0.12", "zeroize", ] [[package]] name = "subxt-test-macro" -version = "0.44.0" +version = "0.50.0" dependencies = [ "quote", "syn 2.0.101", ] +[[package]] +name = "subxt-utils-accountid32" +version = "0.50.0" +dependencies = [ + "base58", + "blake2", + "parity-scale-codec", + "scale-decode", + "scale-encode", + "scale-info", + "serde", + "sp-core", + "sp-keyring", + "thiserror 2.0.12", +] + [[package]] name = "subxt-utils-fetchmetadata" -version = "0.44.0" +version = "0.50.0" dependencies = [ "frame-metadata 23.0.0", "hex", @@ -5908,7 +5872,7 @@ dependencies = [ [[package]] name = "subxt-utils-stripmetadata" -version = "0.44.0" +version = "0.50.0" dependencies = [ "either", "frame-metadata 23.0.0", @@ -5991,7 +5955,7 @@ dependencies = [ [[package]] name = "test-runtime" -version = "0.44.0" +version = "0.50.0" dependencies = [ "hex", "impl-serde", @@ -6140,9 +6104,7 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot", "pin-project-lite", - "signal-hook-registry", "socket2", "tokio-macros", "windows-sys 0.52.0", @@ -6419,7 +6381,7 @@ checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "ui-tests" -version = "0.44.0" +version = "0.50.0" dependencies = [ "frame-metadata 23.0.0", "generate-custom-metadata", diff --git a/Cargo.toml b/Cargo.toml index efb0b03d3bf..621474d60a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,9 @@ [workspace] members = [ + "subxt", "cli", "codegen", - "core", "lightclient", - "historic", "testing/substrate-runner", "testing/test-runtime", "testing/integration-tests", @@ -15,10 +14,10 @@ members = [ "metadata", "rpcs", "signer", - "subxt", "scripts/artifacts", "utils/fetch-metadata", "utils/strip-metadata", + "utils/accountid32" ] # We exclude any crates that would depend on non mutually @@ -38,7 +37,7 @@ resolver = "2" [workspace.package] authors = ["Parity Technologies "] edition = "2024" -version = "0.44.0" +version = "0.50.0" rust-version = "1.85.0" license = "Apache-2.0 OR GPL-3.0" repository = "https://github.com/paritytech/subxt" @@ -81,7 +80,7 @@ darling = "0.20.10" derive-where = "1.2.7" either = { version = "1.13.0", default-features = false } finito = { version = "0.1.0", default-features = false } -frame-decode = { version = "0.15.0", default-features = false } +frame-decode = { version = "0.16.1", default-features = false } frame-metadata = { version = "23.0.0", default-features = false } futures = { version = "0.3.31", default-features = false, features = ["std"] } getrandom = { version = "0.2", default-features = false } @@ -101,7 +100,7 @@ scale-info = { version = "2.11.4", default-features = false } scale-value = { version = "0.18.1", default-features = false } scale-bits = { version = "0.7.0", default-features = false } scale-decode = { version = "0.16.2", default-features = false } -scale-encode = { version = "0.10.0", default-features = false } +scale-encode = { version = "0.10.1", default-features = false } scale-type-resolver = { version = "0.2.0" } scale-info-legacy = { version = "0.4.0", default-features = false } scale-typegen = "0.12.0" @@ -156,16 +155,16 @@ sp-state-machine = { version = "0.45.0", default-features = false } sp-runtime = { version = "41.1.0", default-features = false } # Subxt workspace crates: -subxt = { version = "0.44.0", path = "subxt", default-features = false } -subxt-core = { version = "0.44.0", path = "core", default-features = false } -subxt-macro = { version = "0.44.0", path = "macro" } -subxt-metadata = { version = "0.44.0", path = "metadata", default-features = false } -subxt-codegen = { version = "0.44.0", path = "codegen" } -subxt-signer = { version = "0.44.0", path = "signer", default-features = false } -subxt-rpcs = { version = "0.44.0", path = "rpcs", default-features = false } -subxt-lightclient = { version = "0.44.0", path = "lightclient", default-features = false } -subxt-utils-fetchmetadata = { version = "0.44.0", path = "utils/fetch-metadata", default-features = false } -subxt-utils-stripmetadata = { version = "0.44.0", path = "utils/strip-metadata", default-features = false } +subxt = { version = "0.50.0", path = "subxt", default-features = false } +subxt-macro = { version = "0.50.0", path = "macro" } +subxt-metadata = { version = "0.50.0", path = "metadata", default-features = false } +subxt-codegen = { version = "0.50.0", path = "codegen" } +subxt-signer = { version = "0.50.0", path = "signer", default-features = false } +subxt-rpcs = { version = "0.50.0", path = "rpcs", default-features = false } +subxt-lightclient = { version = "0.50.0", path = "lightclient", default-features = false } +subxt-utils-fetchmetadata = { version = "0.50.0", path = "utils/fetch-metadata", default-features = false } +subxt-utils-stripmetadata = { version = "0.50.0", path = "utils/strip-metadata", default-features = false } +subxt-utils-accountid32 = { version = "0.50.0", path = "utils/accountid32", default-features = false } test-runtime = { path = "testing/test-runtime" } substrate-runner = { path = "testing/substrate-runner" } diff --git a/cli/src/commands/explore/mod.rs b/cli/src/commands/explore/mod.rs index a74a49e45fa..8b40a7433cb 100644 --- a/cli/src/commands/explore/mod.rs +++ b/cli/src/commands/explore/mod.rs @@ -144,7 +144,7 @@ pub async fn run(opts: Opts, output: &mut impl std::io::Write) -> color_eyre::Re // get the metadata let file_or_url = opts.file_or_url; let bytes = file_or_url.fetch().await?; - let metadata = Metadata::decode(&mut &bytes[..])?; + let metadata = Metadata::decode(&mut &bytes[..])?.arc(); let pallet_placeholder = "".blue(); let runtime_api_placeholder = "".blue(); @@ -185,7 +185,14 @@ pub async fn run(opts: Opts, output: &mut impl std::io::Write) -> color_eyre::Re .pallets() .find(|e| e.name().eq_ignore_ascii_case(&name)) { - pallets::run(opts.subcommand, pallet, &metadata, file_or_url, output).await + pallets::run( + opts.subcommand, + pallet, + metadata.clone(), + file_or_url, + output, + ) + .await } else { Err(eyre!( "pallet \"{name}\" not found in metadata!\n{}", diff --git a/cli/src/commands/explore/pallets/calls.rs b/cli/src/commands/explore/pallets/calls.rs index 11de1ac4eb4..6f3f64b4219 100644 --- a/cli/src/commands/explore/pallets/calls.rs +++ b/cli/src/commands/explore/pallets/calls.rs @@ -5,14 +5,11 @@ use indoc::{formatdoc, writedoc}; use scale_info::form::PortableForm; use scale_info::{PortableRegistry, Type, TypeDef, TypeDefVariant}; use scale_value::{Composite, ValueDef}; -use std::str::FromStr; - -use subxt::tx; -use subxt::utils::H256; use subxt::{ - OfflineClient, + OfflineClient, OfflineClientAtBlock, config::SubstrateConfig, - metadata::{Metadata, PalletMetadata}, + metadata::{ArcMetadata, PalletMetadata}, + tx, }; use crate::utils::{ @@ -30,7 +27,7 @@ pub struct CallsSubcommand { pub fn explore_calls( command: CallsSubcommand, pallet_metadata: PalletMetadata, - metadata: &Metadata, + metadata: ArcMetadata, output: &mut impl std::io::Write, ) -> color_eyre::Result<()> { let pallet_name = pallet_metadata.name(); @@ -148,18 +145,20 @@ fn get_calls_enum_type<'a>( Ok((calls_enum_type_def, calls_enum_type)) } -/// The specific values used for construction do not matter too much, we just need any OfflineClient to create unsigned extrinsics -fn mocked_offline_client(metadata: Metadata) -> OfflineClient { - let genesis_hash = - H256::from_str("91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3") - .expect("Valid hash; qed"); - - let runtime_version = subxt::client::RuntimeVersion { - spec_version: 9370, - transaction_version: 20, - }; - - OfflineClient::::new(genesis_hash, runtime_version, metadata) +/// We don't care about any specific genesis hash etc; we just need any OfflineClient to create unsigned extrinsics +fn mocked_offline_client(metadata: ArcMetadata) -> OfflineClientAtBlock { + let config = SubstrateConfig::builder() + .set_spec_version_for_block_ranges([subxt::config::substrate::SpecVersionForRange { + block_range: 0..1, + spec_version: 1, + transaction_version: 1, + }]) + .set_metadata_for_spec_versions([(1, metadata)]) + .build(); + + OfflineClient::::new(config) + .at_block(0u64) + .expect("Should not fail since we plugged consistent data into the config") } /// composites stay composites, all other types are converted into a 1-fielded unnamed composite diff --git a/cli/src/commands/explore/pallets/constants.rs b/cli/src/commands/explore/pallets/constants.rs index e91240c02a4..fe271097f18 100644 --- a/cli/src/commands/explore/pallets/constants.rs +++ b/cli/src/commands/explore/pallets/constants.rs @@ -2,7 +2,7 @@ use clap::Args; use color_eyre::eyre::eyre; use indoc::{formatdoc, writedoc}; use scale_typegen_description::type_description; -use subxt::metadata::{Metadata, PalletMetadata}; +use subxt::metadata::{ArcMetadata, PalletMetadata}; use crate::utils::{Indent, SyntaxHighlight, first_paragraph_of_docs, format_scale_value}; @@ -14,7 +14,7 @@ pub struct ConstantsSubcommand { pub fn explore_constants( command: ConstantsSubcommand, pallet_metadata: PalletMetadata, - metadata: &Metadata, + metadata: ArcMetadata, output: &mut impl std::io::Write, ) -> color_eyre::Result<()> { let pallet_name = pallet_metadata.name(); diff --git a/cli/src/commands/explore/pallets/events.rs b/cli/src/commands/explore/pallets/events.rs index 6abb36a8e84..eb941a80d41 100644 --- a/cli/src/commands/explore/pallets/events.rs +++ b/cli/src/commands/explore/pallets/events.rs @@ -2,7 +2,7 @@ use clap::Args; use color_eyre::eyre::eyre; use indoc::{formatdoc, writedoc}; use scale_info::{Variant, form::PortableForm}; -use subxt::metadata::{Metadata, PalletMetadata}; +use subxt::metadata::{ArcMetadata, PalletMetadata}; use crate::utils::{Indent, fields_description, first_paragraph_of_docs}; @@ -14,7 +14,7 @@ pub struct EventsSubcommand { pub fn explore_events( command: EventsSubcommand, pallet_metadata: PalletMetadata, - metadata: &Metadata, + metadata: ArcMetadata, output: &mut impl std::io::Write, ) -> color_eyre::Result<()> { let pallet_name = pallet_metadata.name(); diff --git a/cli/src/commands/explore/pallets/mod.rs b/cli/src/commands/explore/pallets/mod.rs index bbfe8bb243a..4aa8bccded8 100644 --- a/cli/src/commands/explore/pallets/mod.rs +++ b/cli/src/commands/explore/pallets/mod.rs @@ -1,7 +1,7 @@ use clap::Subcommand; use indoc::writedoc; -use subxt::Metadata; +use subxt::ArcMetadata; use subxt_metadata::PalletMetadata; use crate::utils::{FileOrUrl, Indent, first_paragraph_of_docs}; @@ -33,7 +33,7 @@ pub enum PalletSubcommand { pub async fn run<'a>( subcommand: Option, pallet_metadata: PalletMetadata<'a>, - metadata: &'a Metadata, + metadata: ArcMetadata, file_or_url: FileOrUrl, output: &mut impl std::io::Write, ) -> color_eyre::Result<()> { diff --git a/cli/src/commands/explore/pallets/storage.rs b/cli/src/commands/explore/pallets/storage.rs index a62aa159682..7a3709ebc7d 100644 --- a/cli/src/commands/explore/pallets/storage.rs +++ b/cli/src/commands/explore/pallets/storage.rs @@ -5,7 +5,7 @@ use scale_typegen_description::type_description; use scale_value::Value; use std::fmt::Write; use std::write; -use subxt::metadata::{Metadata, PalletMetadata, StorageMetadata}; +use subxt::metadata::{ArcMetadata, PalletMetadata, StorageMetadata}; use crate::utils::{ FileOrUrl, Indent, SyntaxHighlight, create_client, first_paragraph_of_docs, @@ -24,7 +24,7 @@ pub struct StorageSubcommand { pub async fn explore_storage( command: StorageSubcommand, pallet_metadata: PalletMetadata<'_>, - metadata: &Metadata, + metadata: ArcMetadata, file_or_url: FileOrUrl, output: &mut impl std::io::Write, ) -> color_eyre::Result<()> { @@ -197,9 +197,9 @@ pub async fn explore_storage( // Fetch the value: let storage_value = client - .storage() - .at_latest() + .at_current_block() .await? + .storage() .fetch((pallet_name, storage.name()), storage_entry_keys) .await? .decode()?; diff --git a/cli/src/commands/explore/runtime_apis/mod.rs b/cli/src/commands/explore/runtime_apis/mod.rs index 04a609b7b6e..84a5f8dc29d 100644 --- a/cli/src/commands/explore/runtime_apis/mod.rs +++ b/cli/src/commands/explore/runtime_apis/mod.rs @@ -172,9 +172,9 @@ pub async fn run<'a>( subxt::dynamic::runtime_api_call::<_, Value>(api_name, method.name(), args_data); let client = create_client(&file_or_url).await?; let output_value = client - .runtime_api() - .at_latest() + .at_current_block() .await? + .runtime_apis() .call(method_call) .await?; diff --git a/cli/src/utils.rs b/cli/src/utils.rs index 08fb3ab2a98..271a7787a6f 100644 --- a/cli/src/utils.rs +++ b/cli/src/utils.rs @@ -232,9 +232,10 @@ impl Indent for T {} pub async fn create_client( file_or_url: &FileOrUrl, ) -> color_eyre::Result> { + let config = PolkadotConfig::new(); let client = match &file_or_url.url { - Some(url) => OnlineClient::::from_url(url).await?, - None => OnlineClient::::new().await?, + Some(url) => OnlineClient::::from_url(config, url).await?, + None => OnlineClient::::new(config).await?, }; Ok(client) } @@ -326,7 +327,7 @@ pub fn validate_url_security(url: Option<&Url>, allow_insecure: bool) -> color_e let Some(url) = url else { return Ok(()); }; - match subxt::utils::url_is_secure(url.as_str()) { + match subxt::ext::subxt_rpcs::utils::url_is_secure(url.as_str()) { Ok(is_secure) => { if !allow_insecure && !is_secure { bail!( diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index ffb348d2665..fdbc1a95f09 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -36,7 +36,6 @@ frame-metadata = { workspace = true } [package.metadata.docs.rs] features = ["default"] -rustdoc-args = ["--cfg", "docsrs"] [package.metadata.playground] default-features = true diff --git a/codegen/src/api/calls.rs b/codegen/src/api/calls.rs index 25b48ec03e3..3c798f0cd19 100644 --- a/codegen/src/api/calls.rs +++ b/codegen/src/api/calls.rs @@ -17,7 +17,7 @@ use subxt_metadata::PalletMetadata; /// /// - `type_gen` - [`scale_typegen::TypeGenerator`] that contains settings and all types from the runtime metadata. /// - `pallet` - Pallet metadata from which the calls are generated. -/// - `crate_path` - The crate path under which the `subxt-core` crate is located, e.g. `::subxt::ext::subxt_core` when using subxt as a dependency. +/// - `crate_path` - The crate path under which the `subxt` crate is located, e.g. `::subxt` when using subxt as a dependency. pub fn generate_calls( type_gen: &TypeGenerator, pallet: &PalletMetadata, @@ -41,14 +41,14 @@ pub fn generate_calls( CompositeIRKind::Named(named_fields) => named_fields .iter() .map(|(name, field)| { - // Note: fn_arg_type this is relative the type path of the type alias when prefixed with `types::`, e.g. `set_max_code_size::New` + // Note: fn_arg_type this is relative the type path of the type alias when prefixed with `super::`, e.g. `set_max_code_size::New` let fn_arg_type = field.type_path.to_token_stream(type_gen.settings()); let call_arg = if field.is_boxed { quote! { #name: #crate_path::alloc::boxed::Box::new(#name) } } else { quote! { #name } }; - (quote!( #name: types::#fn_arg_type ), call_arg) + (quote!( #name: super::#fn_arg_type ), call_arg) }) .unzip(), CompositeIRKind::NoFields => Default::default(), @@ -81,9 +81,14 @@ pub fn generate_calls( #struct_def #alias_mod - impl #crate_path::blocks::StaticExtrinsic for #struct_name { - const PALLET: &'static str = #pallet_name; - const CALL: &'static str = #call_name; + impl #struct_name { + const PALLET_NAME: &'static str = #pallet_name; + const CALL_NAME: &'static str = #call_name; + } + impl #crate_path::extrinsics::DecodeAsExtrinsic for #struct_name { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } }; @@ -92,11 +97,11 @@ pub fn generate_calls( pub fn #fn_name( &self, #( #call_fn_args, )* - ) -> #crate_path::tx::payload::StaticPayload { - #crate_path::tx::payload::StaticPayload::new_static( + ) -> #crate_path::transactions::StaticPayload { + #crate_path::transactions::StaticPayload::new_static( #pallet_name, #call_name, - types::#struct_name { #( #call_args, )* }, + super::#struct_name { #( #call_args, )* }, [#(#call_hash,)*] ) } @@ -123,18 +128,14 @@ pub fn generate_calls( use super::root_mod; use super::#types_mod_ident; - type DispatchError = #types_mod_ident::sp_runtime::DispatchError; - - pub mod types { - use super::#types_mod_ident; + #( #call_structs )* - #( #call_structs )* - } + pub mod api { + pub struct TransactionApi; - pub struct TransactionApi; - - impl TransactionApi { - #( #call_fns )* + impl TransactionApi { + #( #call_fns )* + } } } }) diff --git a/codegen/src/api/constants.rs b/codegen/src/api/constants.rs index 7bc2b409d61..0fb3c2b4750 100644 --- a/codegen/src/api/constants.rs +++ b/codegen/src/api/constants.rs @@ -32,7 +32,7 @@ use super::CodegenError; /// /// - `type_gen` - [`scale_typegen::TypeGenerator`] that contains settings and all types from the runtime metadata. /// - `pallet` - Pallet metadata from which the constants are generated. -/// - `crate_path` - The crate path under which the `subxt-core` crate is located, e.g. `::subxt::ext::subxt_core` when using subxt as a dependency. +/// - `crate_path` - The crate path under which the `subxt` crate is located, e.g. `::subxt` when using subxt as a dependency. pub fn generate_constants( type_gen: &TypeGenerator, pallet: &PalletMetadata, @@ -68,8 +68,8 @@ pub fn generate_constants( Ok(quote! { #docs - pub fn #fn_name(&self) -> #crate_path::constants::address::StaticAddress<#return_ty> { - #crate_path::constants::address::StaticAddress::new_static( + pub fn #fn_name(&self) -> #crate_path::constants::StaticAddress<#return_ty> { + #crate_path::constants::StaticAddress::new_static( #pallet_name, #constant_name, [#(#constant_hash,)*] diff --git a/codegen/src/api/custom_values.rs b/codegen/src/api/custom_values.rs index 2501bbc145c..986d49c597d 100644 --- a/codegen/src/api/custom_values.rs +++ b/codegen/src/api/custom_values.rs @@ -71,8 +71,8 @@ fn generate_custom_value_fn( }; Some(quote!( - pub fn #fn_name_ident(&self) -> #crate_path::custom_values::address::StaticAddress<#return_ty, #decodable> { - #crate_path::custom_values::address::StaticAddress::new_static(#name, [#(#custom_value_hash,)*]) + pub fn #fn_name_ident(&self) -> #crate_path::custom_values::StaticAddress<#return_ty, #decodable> { + #crate_path::custom_values::StaticAddress::new_static(#name, [#(#custom_value_hash,)*]) } )) } diff --git a/codegen/src/api/events.rs b/codegen/src/api/events.rs index 0fe92307d9f..edb1db7b18a 100644 --- a/codegen/src/api/events.rs +++ b/codegen/src/api/events.rs @@ -37,7 +37,7 @@ use subxt_metadata::PalletMetadata; /// /// - `type_gen` - [`scale_typegen::TypeGenerator`] that contains settings and all types from the runtime metadata. /// - `pallet` - Pallet metadata from which the events are generated. -/// - `crate_path` - The crate path under which the `subxt-core` crate is located, e.g. `::subxt::ext::subxt_core` when using subxt as a dependency. +/// - `crate_path` - The crate path under which the `subxt` crate is located, e.g. `::subxt` when using subxt as a dependency. pub fn generate_events( type_gen: &TypeGenerator, pallet: &PalletMetadata, @@ -63,9 +63,14 @@ pub fn generate_events( #struct_def #alias_mod - impl #crate_path::events::StaticEvent for #event_struct_name { - const PALLET: &'static str = #pallet_name; - const EVENT: &'static str = #event_name; + impl #event_struct_name { + const PALLET_NAME: &'static str = #pallet_name; + const EVENT_NAME: &'static str = #event_name; + } + impl #crate_path::events::DecodeAsEvent for #event_struct_name { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } }); diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 7602f9d3630..280bdcd0cd3 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -83,7 +83,7 @@ impl RuntimeGenerator { Ok(quote! { #( #item_mod_attrs )* - #[allow(dead_code, unused_imports, non_camel_case_types, unreachable_patterns)] + #[allow(dead_code, missing_docs, unused_imports, non_camel_case_types, unreachable_patterns)] #[allow(clippy::all)] #[allow(rustdoc::broken_intra_doc_links)] pub mod #mod_ident { @@ -247,7 +247,7 @@ impl RuntimeGenerator { Ok(quote! { #( #item_mod_attrs )* - #[allow(dead_code, unused_imports, non_camel_case_types, unreachable_patterns)] + #[allow(dead_code, missing_docs, unused_imports, non_camel_case_types, unreachable_patterns)] #[allow(clippy::all)] #[allow(rustdoc::broken_intra_doc_links)] pub mod #mod_ident { @@ -287,11 +287,16 @@ impl RuntimeGenerator { StorageApi } + /// This is an alias to [`Self::transactions()`]. pub fn tx() -> TransactionApi { TransactionApi } - pub fn apis() -> runtime_apis::RuntimeApi { + pub fn transactions() -> TransactionApi { + TransactionApi + } + + pub fn runtime_apis() -> runtime_apis::RuntimeApi { runtime_apis::RuntimeApi } @@ -301,7 +306,7 @@ impl RuntimeGenerator { ViewFunctionsApi } - pub fn custom() -> CustomValuesApi { + pub fn custom_values() -> CustomValuesApi { CustomValuesApi } @@ -328,8 +333,8 @@ impl RuntimeGenerator { pub struct TransactionApi; impl TransactionApi { #( - pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi { - #pallets_with_calls::calls::TransactionApi + pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::api::TransactionApi { + #pallets_with_calls::calls::api::TransactionApi } )* } diff --git a/codegen/src/api/pallet_view_functions.rs b/codegen/src/api/pallet_view_functions.rs index 563a621de3f..696ae3d3ec2 100644 --- a/codegen/src/api/pallet_view_functions.rs +++ b/codegen/src/api/pallet_view_functions.rs @@ -167,11 +167,11 @@ fn generate_pallet_view_function( pub fn #view_function_name_ident( &self, #(#input_args),* - ) -> #crate_path::view_functions::payload::StaticPayload< + ) -> #crate_path::view_functions::StaticPayload< (#(#input_tuple_types,)*), #view_function_name_ident::output::Output > { - #crate_path::view_functions::payload::StaticPayload::new_static( + #crate_path::view_functions::StaticPayload::new_static( #pallet_name, #view_function_name_str, (#(#input_param_names,)*), diff --git a/codegen/src/api/runtime_apis.rs b/codegen/src/api/runtime_apis.rs index 4bfe1bff61e..62e96dec43d 100644 --- a/codegen/src/api/runtime_apis.rs +++ b/codegen/src/api/runtime_apis.rs @@ -183,11 +183,11 @@ fn generate_runtime_api( pub fn #method_name( &self, #(#input_args),* - ) -> #crate_path::runtime_api::payload::StaticPayload< + ) -> #crate_path::runtime_apis::StaticPayload< (#(#input_tuple_types,)*), #method_name::output::Output > { - #crate_path::runtime_api::payload::StaticPayload::new_static( + #crate_path::runtime_apis::StaticPayload::new_static( #trait_name_str, #method_name_str, (#(#input_param_names,)*), diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs index 3ef3cd041a5..294a2831541 100644 --- a/codegen/src/api/storage.rs +++ b/codegen/src/api/storage.rs @@ -19,7 +19,7 @@ use scale_typegen::typegen::ir::ToTokensWithSettings; /// /// - `type_gen` - [`scale_typegen::TypeGenerator`] that contains settings and all types from the runtime metadata. /// - `pallet` - Pallet metadata from which the storage items are generated. -/// - `crate_path` - The crate path under which the `subxt-core` crate is located, e.g. `::subxt::ext::subxt_core` when using subxt as a dependency. +/// - `crate_path` - The crate path under which the `subxt` crate is located, e.g. `::subxt` when using subxt as a dependency. pub fn generate_storage( type_gen: &TypeGenerator, pallet: &PalletMetadata, @@ -114,7 +114,7 @@ fn generate_storage_entry_fns( .iter() .map(|i| { let ty = &i.type_alias; - quote!(#storage_entry_snake_case_ident::#ty) + quote!(#storage_entry_snake_case_ident::input::#ty) }) .collect::>(); @@ -142,23 +142,23 @@ fn generate_storage_entry_fns( use super::root_mod; use super::#types_mod_ident; - #(#storage_key_type_aliases)* - - pub mod output { + pub mod input { use super::#types_mod_ident; - pub type Output = #storage_value_type_path; + #(#storage_key_type_aliases)* } + + pub type Output = #storage_value_type_path; } ); let storage_entry_method = quote!( #docs - pub fn #storage_entry_snake_case_ident(&self) -> #crate_path::storage::address::StaticAddress< + pub fn #storage_entry_snake_case_ident(&self) -> #crate_path::storage::StaticAddress< (#(#storage_key_tuple_types,)*), - #storage_entry_snake_case_ident::output::Output, + #storage_entry_snake_case_ident::Output, #is_plain > { - #crate_path::storage::address::StaticAddress::new_static( + #crate_path::storage::StaticAddress::new_static( #pallet_name, #storage_entry_name_str, [#(#validation_hash,)*], diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index 33161ae850d..9b9a3fbf02e 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -7,7 +7,6 @@ //! be used directly if preferable. #![deny(missing_docs)] -#![cfg_attr(docsrs, feature(doc_cfg))] mod api; pub mod error; @@ -71,7 +70,7 @@ pub struct CodegenBuilder { impl Default for CodegenBuilder { fn default() -> Self { CodegenBuilder { - crate_path: syn::parse_quote!(::subxt::ext::subxt_core), + crate_path: syn::parse_quote!(::subxt), use_default_derives: true, use_default_substitutions: true, generate_docs: true, @@ -216,7 +215,7 @@ impl CodegenBuilder { self.item_mod = item_mod; } - /// Set the path to the `subxt` crate. By default, we expect it to be at `::subxt::ext::subxt_core`. + /// Set the path to the `subxt` crate. By default, we expect it to be at `::subxt`. /// /// # Panics /// @@ -232,9 +231,9 @@ impl CodegenBuilder { self.crate_path = crate_path; } - /// Generate an interface, assuming that the default path to the `subxt` crate is `::subxt::ext::subxt_core`. + /// Generate an interface, assuming that the default path to the `subxt` crate is `::subxt`. /// If the `subxt` crate is not available as a top level dependency, use `generate` and provide - /// a valid path to the `subxt¦ crate. + /// a valid path to the `subxt` crate. pub fn generate(self, metadata: Metadata) -> Result { let crate_path = self.crate_path; @@ -300,7 +299,7 @@ impl CodegenBuilder { /// The default [`scale_typegen::TypeGeneratorSettings`], subxt is using for generating code. /// Useful for emulating subxt's code generation settings from e.g. subxt-explorer. pub fn default_subxt_type_gen_settings() -> TypeGeneratorSettings { - let crate_path: syn::Path = parse_quote!(::subxt::ext::subxt_core); + let crate_path: syn::Path = parse_quote!(::subxt); let derives = default_derives(&crate_path); let substitutes = default_substitutes(&crate_path); subxt_type_gen_settings(derives, substitutes, &crate_path, true) diff --git a/core/Cargo.toml b/core/Cargo.toml deleted file mode 100644 index f41477cc876..00000000000 --- a/core/Cargo.toml +++ /dev/null @@ -1,83 +0,0 @@ -[package] -name = "subxt-core" -version.workspace = true -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -publish = true - -license.workspace = true -readme = "README.md" -repository.workspace = true -documentation.workspace = true -homepage.workspace = true -description = "A no-std compatible subset of Subxt's functionality" -keywords = ["parity", "subxt", "extrinsic", "no-std"] - -[features] -default = ["std"] -std = [ - "codec/std", - "scale-info/std", - "frame-metadata/std", - "subxt-metadata/std", - "hex/std", - "serde/std", - "serde_json/std", - "tracing/std", - "impl-serde/std", - "primitive-types/std", - "sp-core/std", - "sp-keyring/std", - "sp-crypto-hashing/std", -] - -[dependencies] -codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = ["derive"] } -frame-decode = { workspace = true } -scale-info = { workspace = true, default-features = false, features = ["bit-vec"] } -scale-value = { workspace = true, default-features = false } -scale-bits = { workspace = true, default-features = false } -scale-decode = { workspace = true, default-features = false, features = ["derive", "primitive-types"] } -scale-encode = { workspace = true, default-features = false, features = ["derive", "primitive-types", "bits"] } -frame-metadata = { workspace = true, default-features = false } -subxt-metadata = { workspace = true, default-features = false } -derive-where = { workspace = true } -hex = { workspace = true } -serde = { workspace = true, default-features = false, features = ["derive"] } -serde_json = { workspace = true, default-features = false, features = ["raw_value", "alloc"] } -tracing = { workspace = true, default-features = false } -sp-crypto-hashing = { workspace = true } -hashbrown = { workspace = true } -thiserror = { workspace = true, default-features = false } - -# For ss58 encoding AccountId32 to serialize them properly: -base58 = { workspace = true } -blake2 = { workspace = true } - -# Provides some deserialization, types like U256/H256 and hashing impls like twox/blake256: -impl-serde = { workspace = true, default-features = false } -primitive-types = { workspace = true, default-features = false, features = ["codec", "serde_no_std", "scale-info"] } - -# AccountId20 -keccak-hash = { workspace = true} - -[dev-dependencies] -assert_matches = { workspace = true } -bitvec = { workspace = true } -codec = { workspace = true, features = ["derive", "bit-vec"] } -subxt-macro = { workspace = true } -subxt-signer = { workspace = true, features = ["sr25519", "subxt"] } -sp-core = { workspace = true } -sp-keyring = { workspace = true } -hex = { workspace = true } - -[package.metadata.docs.rs] -default-features = true -rustdoc-args = ["--cfg", "docsrs"] - -[package.metadata.playground] -default-features = true - -[lints] -workspace = true diff --git a/core/README.md b/core/README.md deleted file mode 100644 index fb25fabfa7f..00000000000 --- a/core/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Subxt-Core - -This library provides a no-std compatible subset of functionality that `subxt` and `subxt-signer` rely on. \ No newline at end of file diff --git a/core/src/blocks/extrinsic_transaction_extensions.rs b/core/src/blocks/extrinsic_transaction_extensions.rs deleted file mode 100644 index 12ef7fe1560..00000000000 --- a/core/src/blocks/extrinsic_transaction_extensions.rs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::config::TransactionExtension; -use crate::config::transaction_extensions::{ - ChargeAssetTxPayment, ChargeTransactionPayment, CheckNonce, -}; -use crate::dynamic::Value; -use crate::error::ExtrinsicError; -use crate::{Metadata, config::Config}; -use alloc::borrow::ToOwned; -use frame_decode::extrinsics::ExtrinsicExtensions; -use scale_decode::DecodeAsType; - -/// The signed extensions of an extrinsic. -#[derive(Debug, Clone)] -pub struct ExtrinsicTransactionExtensions<'a, T: Config> { - bytes: &'a [u8], - metadata: &'a Metadata, - decoded_info: &'a ExtrinsicExtensions<'static, u32>, - _marker: core::marker::PhantomData, -} - -impl<'a, T: Config> ExtrinsicTransactionExtensions<'a, T> { - pub(crate) fn new( - bytes: &'a [u8], - metadata: &'a Metadata, - decoded_info: &'a ExtrinsicExtensions<'static, u32>, - ) -> Self { - Self { - bytes, - metadata, - decoded_info, - _marker: core::marker::PhantomData, - } - } - - /// Returns an iterator over each of the signed extension details of the extrinsic. - pub fn iter(&self) -> impl Iterator> + use<'a, T> { - self.decoded_info - .iter() - .map(|s| ExtrinsicTransactionExtension { - bytes: &self.bytes[s.range()], - ty_id: *s.ty(), - identifier: s.name(), - metadata: self.metadata, - _marker: core::marker::PhantomData, - }) - } - - /// Searches through all signed extensions to find a specific one. - /// If the Signed Extension is not found `Ok(None)` is returned. - /// If the Signed Extension is found but decoding failed `Err(_)` is returned. - pub fn find>(&self) -> Result, ExtrinsicError> { - for ext in self.iter() { - match ext.as_signed_extension::() { - // We found a match; return it: - Ok(Some(e)) => return Ok(Some(e)), - // No error, but no match either; next! - Ok(None) => continue, - // Error? return it - Err(e) => return Err(e), - } - } - Ok(None) - } - - /// The tip of an extrinsic, extracted from the ChargeTransactionPayment or ChargeAssetTxPayment - /// signed extension, depending on which is present. - /// - /// Returns `None` if `tip` was not found or decoding failed. - pub fn tip(&self) -> Option { - // Note: the overhead of iterating multiple time should be negligible. - self.find::() - .ok() - .flatten() - .map(|e| e.tip()) - .or_else(|| { - self.find::>() - .ok() - .flatten() - .map(|e| e.tip()) - }) - } - - /// The nonce of the account that submitted the extrinsic, extracted from the CheckNonce signed extension. - /// - /// Returns `None` if `nonce` was not found or decoding failed. - pub fn nonce(&self) -> Option { - self.find::().ok()? - } -} - -/// A single signed extension -#[derive(Debug, Clone)] -pub struct ExtrinsicTransactionExtension<'a, T: Config> { - bytes: &'a [u8], - ty_id: u32, - identifier: &'a str, - metadata: &'a Metadata, - _marker: core::marker::PhantomData, -} - -impl<'a, T: Config> ExtrinsicTransactionExtension<'a, T> { - /// The bytes representing this signed extension. - pub fn bytes(&self) -> &'a [u8] { - self.bytes - } - - /// The name of the signed extension. - pub fn name(&self) -> &'a str { - self.identifier - } - - /// The type id of the signed extension. - pub fn type_id(&self) -> u32 { - self.ty_id - } - - /// Signed Extension as a [`scale_value::Value`] - pub fn value(&self) -> Result, ExtrinsicError> { - let value = scale_value::scale::decode_as_type( - &mut &self.bytes[..], - self.ty_id, - self.metadata.types(), - ) - .map_err(|e| ExtrinsicError::CouldNotDecodeTransactionExtension { - name: self.identifier.to_owned(), - error: e.into(), - })?; - Ok(value) - } - - /// Decodes the bytes of this Signed Extension into its associated `Decoded` type. - /// Returns `Ok(None)` if the data we have doesn't match the Signed Extension we're asking to - /// decode with. - pub fn as_signed_extension>( - &self, - ) -> Result, ExtrinsicError> { - if !S::matches(self.identifier, self.ty_id, self.metadata.types()) { - return Ok(None); - } - self.as_type::().map(Some) - } - - fn as_type(&self) -> Result { - let value = E::decode_as_type(&mut &self.bytes[..], self.ty_id, self.metadata.types()) - .map_err(|e| ExtrinsicError::CouldNotDecodeTransactionExtension { - name: self.identifier.to_owned(), - error: e, - })?; - Ok(value) - } -} diff --git a/core/src/blocks/extrinsics.rs b/core/src/blocks/extrinsics.rs deleted file mode 100644 index 94de10ade37..00000000000 --- a/core/src/blocks/extrinsics.rs +++ /dev/null @@ -1,644 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::blocks::extrinsic_transaction_extensions::ExtrinsicTransactionExtensions; -use crate::{ - Metadata, - config::{Config, HashFor, Hasher}, - error::{ExtrinsicDecodeErrorAt, ExtrinsicDecodeErrorAtReason, ExtrinsicError}, -}; -use alloc::sync::Arc; -use alloc::vec::Vec; -use frame_decode::extrinsics::Extrinsic; -use scale_decode::{DecodeAsFields, DecodeAsType}; - -pub use crate::blocks::StaticExtrinsic; - -/// The body of a block. -pub struct Extrinsics { - extrinsics: Vec, Vec)>>, - metadata: Metadata, - hasher: T::Hasher, - _marker: core::marker::PhantomData, -} - -impl Extrinsics { - /// Instantiate a new [`Extrinsics`] object, given a vector containing - /// each extrinsic hash (in the form of bytes) and some metadata that - /// we'll use to decode them. - pub fn decode_from( - extrinsics: Vec>, - metadata: Metadata, - ) -> Result { - let hasher = T::Hasher::new(&metadata); - let extrinsics = extrinsics - .into_iter() - .enumerate() - .map(|(extrinsic_index, bytes)| { - let cursor = &mut &*bytes; - - // Try to decode the extrinsic. - let decoded_info = - frame_decode::extrinsics::decode_extrinsic(cursor, &metadata, metadata.types()) - .map_err(|error| ExtrinsicDecodeErrorAt { - extrinsic_index, - error: ExtrinsicDecodeErrorAtReason::DecodeError(error), - })? - .into_owned(); - - // We didn't consume all bytes, so decoding probably failed. - if !cursor.is_empty() { - return Err(ExtrinsicDecodeErrorAt { - extrinsic_index, - error: ExtrinsicDecodeErrorAtReason::LeftoverBytes(cursor.to_vec()), - }); - } - - Ok(Arc::new((decoded_info, bytes))) - }) - .collect::>()?; - - Ok(Self { - extrinsics, - hasher, - metadata, - _marker: core::marker::PhantomData, - }) - } - - /// The number of extrinsics. - pub fn len(&self) -> usize { - self.extrinsics.len() - } - - /// Are there no extrinsics in this block? - // Note: mainly here to satisfy clippy. - pub fn is_empty(&self) -> bool { - self.extrinsics.is_empty() - } - - /// Returns an iterator over the extrinsics in the block body. - // Dev note: The returned iterator is 'static + Send so that we can box it up and make - // use of it with our `FilterExtrinsic` stuff. - pub fn iter(&self) -> impl Iterator> + Send + Sync + 'static { - let extrinsics = self.extrinsics.clone(); - let num_extrinsics = self.extrinsics.len(); - let hasher = self.hasher; - let metadata = self.metadata.clone(); - - (0..num_extrinsics).map(move |index| { - ExtrinsicDetails::new( - index as u32, - extrinsics[index].clone(), - hasher, - metadata.clone(), - ) - }) - } - - /// Iterate through the extrinsics using metadata to dynamically decode and skip - /// them, and return only those which should decode to the provided `E` type. - /// If an error occurs, all subsequent iterations return `None`. - pub fn find( - &self, - ) -> impl Iterator, ExtrinsicError>> { - self.iter().filter_map(|details| { - match details.as_extrinsic::() { - // Failed to decode extrinsic: - Err(err) => Some(Err(err)), - // Extrinsic for a different pallet / different call (skip): - Ok(None) => None, - Ok(Some(value)) => Some(Ok(FoundExtrinsic { details, value })), - } - }) - } - - /// Iterate through the extrinsics using metadata to dynamically decode and skip - /// them, and return the first extrinsic found which decodes to the provided `E` type. - pub fn find_first( - &self, - ) -> Result>, ExtrinsicError> { - self.find::().next().transpose() - } - - /// Iterate through the extrinsics using metadata to dynamically decode and skip - /// them, and return the last extrinsic found which decodes to the provided `Ev` type. - pub fn find_last( - &self, - ) -> Result>, ExtrinsicError> { - self.find::().last().transpose() - } - - /// Find an extrinsics that decodes to the type provided. Returns true if it was found. - pub fn has(&self) -> Result { - Ok(self.find::().next().transpose()?.is_some()) - } -} - -/// A single extrinsic in a block. -pub struct ExtrinsicDetails { - /// The index of the extrinsic in the block. - index: u32, - /// Extrinsic bytes and decode info. - ext: Arc<(Extrinsic<'static, u32>, Vec)>, - /// Hash the extrinsic if we want. - hasher: T::Hasher, - /// Subxt metadata to fetch the extrinsic metadata. - metadata: Metadata, - _marker: core::marker::PhantomData, -} - -impl ExtrinsicDetails -where - T: Config, -{ - // Attempt to dynamically decode a single extrinsic from the given input. - #[doc(hidden)] - pub fn new( - index: u32, - ext: Arc<(Extrinsic<'static, u32>, Vec)>, - hasher: T::Hasher, - metadata: Metadata, - ) -> ExtrinsicDetails { - ExtrinsicDetails { - index, - ext, - hasher, - metadata, - _marker: core::marker::PhantomData, - } - } - - /// Calculate and return the hash of the extrinsic, based on the configured hasher. - pub fn hash(&self) -> HashFor { - // Use hash(), not hash_of(), because we don't want to double encode the bytes. - self.hasher.hash(self.bytes()) - } - - /// Is the extrinsic signed? - pub fn is_signed(&self) -> bool { - self.decoded_info().is_signed() - } - - /// The index of the extrinsic in the block. - pub fn index(&self) -> u32 { - self.index - } - - /// Return _all_ of the bytes representing this extrinsic, which include, in order: - /// - First byte: abbbbbbb (a = 0 for unsigned, 1 for signed, b = version) - /// - SignatureType (if the payload is signed) - /// - Address - /// - Signature - /// - Extra fields - /// - Extrinsic call bytes - pub fn bytes(&self) -> &[u8] { - &self.ext.1 - } - - /// Return only the bytes representing this extrinsic call: - /// - First byte is the pallet index - /// - Second byte is the variant (call) index - /// - Followed by field bytes. - /// - /// # Note - /// - /// Please use [`Self::bytes`] if you want to get all extrinsic bytes. - pub fn call_bytes(&self) -> &[u8] { - &self.bytes()[self.decoded_info().call_data_range()] - } - - /// Return the bytes representing the fields stored in this extrinsic. - /// - /// # Note - /// - /// This is a subset of [`Self::call_bytes`] that does not include the - /// first two bytes that denote the pallet index and the variant index. - pub fn field_bytes(&self) -> &[u8] { - // Note: this cannot panic because we checked the extrinsic bytes - // to contain at least two bytes. - &self.bytes()[self.decoded_info().call_data_args_range()] - } - - /// Return only the bytes of the address that signed this extrinsic. - /// - /// # Note - /// - /// Returns `None` if the extrinsic is not signed. - pub fn address_bytes(&self) -> Option<&[u8]> { - self.decoded_info() - .signature_payload() - .map(|s| &self.bytes()[s.address_range()]) - } - - /// Returns Some(signature_bytes) if the extrinsic was signed otherwise None is returned. - pub fn signature_bytes(&self) -> Option<&[u8]> { - self.decoded_info() - .signature_payload() - .map(|s| &self.bytes()[s.signature_range()]) - } - - /// Returns the signed extension `extra` bytes of the extrinsic. - /// Each signed extension has an `extra` type (May be zero-sized). - /// These bytes are the scale encoded `extra` fields of each signed extension in order of the signed extensions. - /// They do *not* include the `additional` signed bytes that are used as part of the payload that is signed. - /// - /// Note: Returns `None` if the extrinsic is not signed. - pub fn transaction_extensions_bytes(&self) -> Option<&[u8]> { - self.decoded_info() - .transaction_extension_payload() - .map(|t| &self.bytes()[t.range()]) - } - - /// Returns `None` if the extrinsic is not signed. - pub fn transaction_extensions(&self) -> Option> { - self.decoded_info() - .transaction_extension_payload() - .map(|t| ExtrinsicTransactionExtensions::new(self.bytes(), &self.metadata, t)) - } - - /// The index of the pallet that the extrinsic originated from. - pub fn pallet_index(&self) -> u8 { - self.decoded_info().pallet_index() - } - - /// The index of the extrinsic variant that the extrinsic originated from. - pub fn call_index(&self) -> u8 { - self.decoded_info().call_index() - } - - /// The name of the pallet from whence the extrinsic originated. - pub fn pallet_name(&self) -> &str { - self.decoded_info().pallet_name() - } - - /// The name of the call (ie the name of the variant that it corresponds to). - pub fn call_name(&self) -> &str { - self.decoded_info().call_name() - } - - /// Decode and provide the extrinsic fields back in the form of a [`scale_value::Composite`] - /// type which represents the named or unnamed fields that were present in the extrinsic. - pub fn decode_as_fields(&self) -> Result { - let bytes = &mut self.field_bytes(); - let mut fields = self.decoded_info().call_data().map(|d| { - let name = if d.name().is_empty() { - None - } else { - Some(d.name()) - }; - scale_decode::Field::new(*d.ty(), name) - }); - let decoded = - E::decode_as_fields(bytes, &mut fields, self.metadata.types()).map_err(|e| { - ExtrinsicError::CannotDecodeFields { - extrinsic_index: self.index as usize, - error: e, - } - })?; - - Ok(decoded) - } - - /// Attempt to decode these [`ExtrinsicDetails`] into a type representing the extrinsic fields. - /// Such types are exposed in the codegen as `pallet_name::calls::types::CallName` types. - pub fn as_extrinsic(&self) -> Result, ExtrinsicError> { - if self.decoded_info().pallet_name() == E::PALLET - && self.decoded_info().call_name() == E::CALL - { - let mut fields = self.decoded_info().call_data().map(|d| { - let name = if d.name().is_empty() { - None - } else { - Some(d.name()) - }; - scale_decode::Field::new(*d.ty(), name) - }); - let decoded = - E::decode_as_fields(&mut self.field_bytes(), &mut fields, self.metadata.types()) - .map_err(|e| ExtrinsicError::CannotDecodeFields { - extrinsic_index: self.index as usize, - error: e, - })?; - Ok(Some(decoded)) - } else { - Ok(None) - } - } - - /// Attempt to decode these [`ExtrinsicDetails`] into an outer call enum type (which includes - /// the pallet and extrinsic enum variants as well as the extrinsic fields). A compatible - /// type for this is exposed via static codegen as a root level `Call` type. - pub fn as_root_extrinsic(&self) -> Result { - let decoded = E::decode_as_type( - &mut &self.call_bytes()[..], - self.metadata.outer_enums().call_enum_ty(), - self.metadata.types(), - ) - .map_err(|e| ExtrinsicError::CannotDecodeIntoRootExtrinsic { - extrinsic_index: self.index as usize, - error: e, - })?; - - Ok(decoded) - } - - fn decoded_info(&self) -> &Extrinsic<'static, u32> { - &self.ext.0 - } -} - -/// A Static Extrinsic found in a block coupled with it's details. -pub struct FoundExtrinsic { - /// Details for the extrinsic. - pub details: ExtrinsicDetails, - /// The decoded extrinsic value. - pub value: E, -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::config::SubstrateConfig; - use assert_matches::assert_matches; - use codec::{Decode, Encode}; - use frame_metadata::v15::{CustomMetadata, OuterEnums}; - use frame_metadata::{ - RuntimeMetadataPrefixed, - v15::{ExtrinsicMetadata, PalletCallMetadata, PalletMetadata, RuntimeMetadataV15}, - }; - use scale_info::{TypeInfo, meta_type}; - use scale_value::Value; - - // Extrinsic needs to contain at least the generic type parameter "Call" - // for the metadata to be valid. - // The "Call" type from the metadata is used to decode extrinsics. - #[allow(unused)] - #[derive(TypeInfo)] - struct ExtrinsicType { - pub signature: Option<(Address, Signature, Extra)>, - pub function: Call, - } - - // Because this type is used to decode extrinsics, we expect this to be a TypeDefVariant. - // Each pallet must contain one single variant. - #[allow(unused)] - #[derive( - Encode, - Decode, - TypeInfo, - Clone, - Debug, - PartialEq, - Eq, - scale_encode::EncodeAsType, - scale_decode::DecodeAsType, - )] - enum RuntimeCall { - Test(Pallet), - } - - // The calls of the pallet. - #[allow(unused)] - #[derive( - Encode, - Decode, - TypeInfo, - Clone, - Debug, - PartialEq, - Eq, - scale_encode::EncodeAsType, - scale_decode::DecodeAsType, - )] - enum Pallet { - #[allow(unused)] - #[codec(index = 2)] - TestCall { - value: u128, - signed: bool, - name: String, - }, - } - - #[allow(unused)] - #[derive( - Encode, - Decode, - TypeInfo, - Clone, - Debug, - PartialEq, - Eq, - scale_encode::EncodeAsType, - scale_decode::DecodeAsType, - )] - struct TestCallExtrinsic { - value: u128, - signed: bool, - name: String, - } - - impl StaticExtrinsic for TestCallExtrinsic { - const PALLET: &'static str = "Test"; - const CALL: &'static str = "TestCall"; - } - - /// Build fake metadata consisting the types needed to represent an extrinsic. - fn metadata() -> Metadata { - let pallets = vec![PalletMetadata { - name: "Test", - storage: None, - calls: Some(PalletCallMetadata { - ty: meta_type::(), - }), - event: None, - constants: vec![], - error: None, - index: 0, - docs: vec![], - }]; - - let extrinsic = ExtrinsicMetadata { - version: 4, - signed_extensions: vec![], - address_ty: meta_type::<()>(), - call_ty: meta_type::(), - signature_ty: meta_type::<()>(), - extra_ty: meta_type::<()>(), - }; - - let meta = RuntimeMetadataV15::new( - pallets, - extrinsic, - meta_type::<()>(), - vec![], - OuterEnums { - call_enum_ty: meta_type::(), - event_enum_ty: meta_type::<()>(), - error_enum_ty: meta_type::<()>(), - }, - CustomMetadata { - map: Default::default(), - }, - ); - let runtime_metadata: RuntimeMetadataPrefixed = meta.into(); - let metadata: subxt_metadata::Metadata = runtime_metadata.try_into().unwrap(); - - metadata - } - - #[test] - fn extrinsic_metadata_consistency() { - let metadata = metadata(); - - // Except our metadata to contain the registered types. - let pallet = metadata.pallet_by_call_index(0).expect("pallet exists"); - let extrinsic = pallet - .call_variant_by_index(2) - .expect("metadata contains the RuntimeCall enum with this pallet"); - - assert_eq!(pallet.name(), "Test"); - assert_eq!(&extrinsic.name, "TestCall"); - } - - #[test] - fn insufficient_extrinsic_bytes() { - let metadata = metadata(); - - // Decode with empty bytes. - let result = Extrinsics::::decode_from(vec![vec![]], metadata); - assert_matches!( - result.err(), - Some(crate::error::ExtrinsicDecodeErrorAt { - extrinsic_index: 0, - error: _ - }) - ); - } - - #[test] - fn unsupported_version_extrinsic() { - use frame_decode::extrinsics::ExtrinsicDecodeError; - - let metadata = metadata(); - - // Decode with invalid version. - let result = Extrinsics::::decode_from(vec![vec![3u8].encode()], metadata); - - assert_matches!( - result.err(), - Some(crate::error::ExtrinsicDecodeErrorAt { - extrinsic_index: 0, - error: ExtrinsicDecodeErrorAtReason::DecodeError( - ExtrinsicDecodeError::VersionNotSupported(3) - ), - }) - ); - } - - #[test] - fn tx_hashes_line_up() { - let metadata = metadata(); - let hasher = ::Hasher::new(&metadata); - - let tx = crate::dynamic::tx( - "Test", - "TestCall", - vec![ - Value::u128(10), - Value::bool(true), - Value::string("SomeValue"), - ], - ); - - // Encoded TX ready to submit. - let tx_encoded = crate::tx::create_v4_unsigned::(&tx, &metadata) - .expect("Valid dynamic parameters are provided"); - - // Extrinsic details ready to decode. - let extrinsics = Extrinsics::::decode_from( - vec![tx_encoded.encoded().to_owned()], - metadata, - ) - .expect("Valid extrinsic"); - - let extrinsic = extrinsics.iter().next().unwrap(); - - // Both of these types should produce the same bytes. - assert_eq!(tx_encoded.encoded(), extrinsic.bytes(), "bytes should eq"); - // Both of these types should produce the same hash. - assert_eq!( - tx_encoded.hash_with(hasher), - extrinsic.hash(), - "hashes should eq" - ); - } - - #[test] - fn statically_decode_extrinsic() { - let metadata = metadata(); - - let tx = crate::dynamic::tx( - "Test", - "TestCall", - vec![ - Value::u128(10), - Value::bool(true), - Value::string("SomeValue"), - ], - ); - let tx_encoded = crate::tx::create_v4_unsigned::(&tx, &metadata) - .expect("Valid dynamic parameters are provided"); - - // Note: `create_unsigned` produces the extrinsic bytes by prefixing the extrinsic length. - // The length is handled deserializing `ChainBlockExtrinsic`, therefore the first byte is not needed. - let extrinsics = Extrinsics::::decode_from( - vec![tx_encoded.encoded().to_owned()], - metadata, - ) - .expect("Valid extrinsic"); - - let extrinsic = extrinsics.iter().next().unwrap(); - - assert!(!extrinsic.is_signed()); - - assert_eq!(extrinsic.index(), 0); - - assert_eq!(extrinsic.pallet_index(), 0); - assert_eq!(extrinsic.pallet_name(), "Test"); - - assert_eq!(extrinsic.call_index(), 2); - assert_eq!(extrinsic.call_name(), "TestCall"); - - // Decode the extrinsic to the root enum. - let decoded_extrinsic = extrinsic - .as_root_extrinsic::() - .expect("can decode extrinsic to root enum"); - - assert_eq!( - decoded_extrinsic, - RuntimeCall::Test(Pallet::TestCall { - value: 10, - signed: true, - name: "SomeValue".into(), - }) - ); - - // Decode the extrinsic to the extrinsic variant. - let decoded_extrinsic = extrinsic - .as_extrinsic::() - .expect("can decode extrinsic to extrinsic variant") - .expect("value cannot be None"); - - assert_eq!( - decoded_extrinsic, - TestCallExtrinsic { - value: 10, - signed: true, - name: "SomeValue".into(), - } - ); - } -} diff --git a/core/src/blocks/mod.rs b/core/src/blocks/mod.rs deleted file mode 100644 index 7ac90ff114d..00000000000 --- a/core/src/blocks/mod.rs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Decode and iterate over the extrinsics in block bodies. -//! -//! Use the [`decode_from`] function as an entry point to decoding extrinsics, and then -//! have a look at [`Extrinsics`] and [`ExtrinsicDetails`] to see which methods are available -//! to work with the extrinsics. -//! -//! # Example -//! -//! ```rust -//! extern crate alloc; -//! -//! use subxt_macro::subxt; -//! use subxt_core::blocks; -//! use subxt_core::Metadata; -//! use subxt_core::config::PolkadotConfig; -//! use alloc::vec; -//! -//! // If we generate types without `subxt`, we need to point to `::subxt_core`: -//! #[subxt( -//! crate = "::subxt_core", -//! runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale", -//! )] -//! pub mod polkadot {} -//! -//! // Some metadata we'd like to use to help us decode extrinsics: -//! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); -//! -//! // Some extrinsics we'd like to decode: -//! let ext_bytes = vec![ -//! hex::decode("1004020000").unwrap(), -//! hex::decode("c10184001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c01a27c400241aeafdea1871b32f1f01e92acd272ddfe6b2f8b73b64c606572a530c470a94ef654f7baa5828474754a1fe31b59f91f6bb5c2cd5a07c22d4b8b8387350100000000001448656c6c6f").unwrap(), -//! hex::decode("550284001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0144bb92734447c893ab16d520fae0d455257550efa28ee66bf6dc942cb8b00d5d2799b98bc2865d21812278a9a266acd7352f40742ff11a6ce1f400013961598485010000000400008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a481700505a4f7e9f4eb106").unwrap() -//! ]; -//! -//! // Given some chain config and metadata, we know how to decode the bytes. -//! let exts = blocks::decode_from::(ext_bytes, metadata).unwrap(); -//! -//! // We'll see 3 extrinsics: -//! assert_eq!(exts.len(), 3); -//! -//! // We can iterate over them and decode various details out of them. -//! for ext in exts.iter() { -//! println!("Pallet: {}", ext.pallet_name()); -//! println!("Call: {}", ext.call_name()); -//! } -//! -//! # let ext_details: Vec<_> = exts.iter() -//! # .map(|ext| { -//! # let pallet = ext.pallet_name().to_string(); -//! # let call = ext.call_name().to_string(); -//! # (pallet, call) -//! # }) -//! # .collect(); -//! # -//! # assert_eq!(ext_details, vec![ -//! # ("Timestamp".to_owned(), "set".to_owned()), -//! # ("System".to_owned(), "remark".to_owned()), -//! # ("Balances".to_owned(), "transfer_allow_death".to_owned()), -//! # ]); -//! ``` - -mod extrinsic_transaction_extensions; -mod extrinsics; -mod static_extrinsic; - -use crate::Metadata; -use crate::config::Config; -use crate::error::ExtrinsicDecodeErrorAt; -pub use crate::error::ExtrinsicError; -use alloc::vec::Vec; -pub use extrinsic_transaction_extensions::{ - ExtrinsicTransactionExtension, ExtrinsicTransactionExtensions, -}; -pub use extrinsics::{ExtrinsicDetails, Extrinsics, FoundExtrinsic}; -pub use static_extrinsic::StaticExtrinsic; - -/// Instantiate a new [`Extrinsics`] object, given a vector containing each extrinsic hash (in the -/// form of bytes) and some metadata that we'll use to decode them. -/// -/// This is a shortcut for [`Extrinsics::decode_from`]. -pub fn decode_from( - extrinsics: Vec>, - metadata: Metadata, -) -> Result, ExtrinsicDecodeErrorAt> { - Extrinsics::decode_from(extrinsics, metadata) -} diff --git a/core/src/blocks/static_extrinsic.rs b/core/src/blocks/static_extrinsic.rs deleted file mode 100644 index 263977863df..00000000000 --- a/core/src/blocks/static_extrinsic.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use scale_decode::DecodeAsFields; - -/// Trait to uniquely identify the extrinsic's identity from the runtime metadata. -/// -/// Generated API structures that represent an extrinsic implement this trait. -/// -/// The trait is utilized to decode emitted extrinsics from a block, via obtaining the -/// form of the `Extrinsic` from the metadata. -pub trait StaticExtrinsic: DecodeAsFields { - /// Pallet name. - const PALLET: &'static str; - /// Call name. - const CALL: &'static str; - - /// Returns true if the given pallet and call names match this extrinsic. - fn is_extrinsic(pallet: &str, call: &str) -> bool { - Self::PALLET == pallet && Self::CALL == call - } -} diff --git a/core/src/client.rs b/core/src/client.rs deleted file mode 100644 index cfc8de4fa10..00000000000 --- a/core/src/client.rs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! A couple of client types that we use elsewhere. - -use crate::{ - Metadata, - config::{Config, HashFor}, -}; -use derive_where::derive_where; - -/// This provides access to some relevant client state in transaction extensions, -/// and is just a combination of some of the available properties. -#[derive_where(Clone, Debug)] -pub struct ClientState { - /// Genesis hash. - pub genesis_hash: HashFor, - /// Runtime version. - pub runtime_version: RuntimeVersion, - /// Metadata. - pub metadata: Metadata, -} - -/// Runtime version information needed to submit transactions. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -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, -} diff --git a/core/src/config/mod.rs b/core/src/config/mod.rs deleted file mode 100644 index af3d74af23e..00000000000 --- a/core/src/config/mod.rs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! This module provides a [`Config`] type, which is used to define various -//! types that are important in order to speak to a particular chain. -//! [`SubstrateConfig`] provides a default set of these types suitable for the -//! default Substrate node implementation, and [`PolkadotConfig`] for a -//! Polkadot node. - -mod default_extrinsic_params; -mod extrinsic_params; - -pub mod polkadot; -pub mod substrate; -pub mod transaction_extensions; - -use codec::{Decode, Encode}; -use core::fmt::Debug; -use scale_decode::DecodeAsType; -use scale_encode::EncodeAsType; -use serde::{Serialize, de::DeserializeOwned}; -use subxt_metadata::Metadata; - -pub use default_extrinsic_params::{DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder}; -pub use extrinsic_params::{ExtrinsicParams, ExtrinsicParamsEncoder}; -pub use polkadot::{PolkadotConfig, PolkadotExtrinsicParams, PolkadotExtrinsicParamsBuilder}; -pub use substrate::{SubstrateConfig, SubstrateExtrinsicParams, SubstrateExtrinsicParamsBuilder}; -pub use transaction_extensions::TransactionExtension; - -/// Runtime types. -// Note: the `Send + Sync + 'static` bound isn't strictly required, but currently deriving -// TypeInfo automatically applies a 'static bound to all generic types (including this one), -// And we want the compiler to infer `Send` and `Sync` OK for things which have `T: Config` -// rather than having to `unsafe impl` them ourselves. -pub trait Config: Sized + Send + Sync + 'static { - /// The account ID type. - type AccountId: Debug + Clone + Encode + Decode + Serialize + Send; - - /// The address type. - type Address: Debug + Encode + From; - - /// The signature type. - type Signature: Debug + Clone + Encode + Decode + Send; - - /// The hashing system (algorithm) being used in the runtime (e.g. Blake2). - type Hasher: Debug + Clone + Copy + Hasher + Send + Sync; - - /// The block header. - type Header: Debug + Header + Sync + Send + DeserializeOwned + Clone; - - /// This type defines the extrinsic extra and additional parameters. - type ExtrinsicParams: ExtrinsicParams; - - /// This is used to identify an asset in the `ChargeAssetTxPayment` signed extension. - type AssetId: Debug + Clone + Encode + DecodeAsType + EncodeAsType + Send; -} - -/// Given some [`Config`], this returns the type of hash used. -pub type HashFor = <::Hasher as Hasher>::Output; - -/// given some [`Config`], this return the other params needed for its `ExtrinsicParams`. -pub type ParamsFor = <::ExtrinsicParams as ExtrinsicParams>::Params; - -/// Block hashes must conform to a bunch of things to be used in Subxt. -pub trait Hash: - Debug - + Copy - + Send - + Sync - + Decode - + AsRef<[u8]> - + Serialize - + DeserializeOwned - + Encode - + PartialEq - + Eq - + core::hash::Hash -{ -} -impl Hash for T where - T: Debug - + Copy - + Send - + Sync - + Decode - + AsRef<[u8]> - + Serialize - + DeserializeOwned - + Encode - + PartialEq - + Eq - + core::hash::Hash -{ -} - -/// This represents the hasher used by a node to hash things like block headers -/// and extrinsics. -pub trait Hasher { - /// The type given back from the hash operation - type Output: Hash; - - /// Construct a new hasher. - fn new(metadata: &Metadata) -> Self; - - /// Hash some bytes to the given output type. - fn hash(&self, s: &[u8]) -> Self::Output; - - /// Hash some SCALE encodable type to the given output type. - fn hash_of(&self, s: &S) -> Self::Output { - let out = s.encode(); - self.hash(&out) - } -} - -/// This represents the block header type used by a node. -pub trait Header: Sized + Encode + Decode { - /// The block number type for this header. - type Number: Into; - /// The hasher used to hash this header. - type Hasher: Hasher; - - /// Return the block number of this header. - fn number(&self) -> Self::Number; - - /// Hash this header. - fn hash_with(&self, hasher: Self::Hasher) -> ::Output { - hasher.hash_of(self) - } -} diff --git a/core/src/config/polkadot.rs b/core/src/config/polkadot.rs deleted file mode 100644 index 1996d9b7561..00000000000 --- a/core/src/config/polkadot.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Polkadot specific configuration - -use super::{Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder}; - -use crate::config::SubstrateConfig; -pub use crate::utils::{AccountId32, MultiAddress, MultiSignature}; -pub use primitive_types::{H256, U256}; - -/// Default set of commonly used types by Polkadot nodes. -// Note: The trait implementations exist just to make life easier, -// but shouldn't strictly be necessary since users can't instantiate this type. -#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] -pub enum PolkadotConfig {} - -impl Config for PolkadotConfig { - type AccountId = ::AccountId; - type Signature = ::Signature; - type Hasher = ::Hasher; - type Header = ::Header; - type AssetId = ::AssetId; - - // Address on Polkadot has no account index, whereas it's u32 on - // the default substrate dev node. - type Address = MultiAddress; - - // These are the same as the default substrate node, but redefined - // because we need to pass the PolkadotConfig trait as a param. - type ExtrinsicParams = PolkadotExtrinsicParams; -} - -/// A struct representing the signed extra and additional parameters required -/// to construct a transaction for a polkadot node. -pub type PolkadotExtrinsicParams = DefaultExtrinsicParams; - -/// A builder which leads to [`PolkadotExtrinsicParams`] being constructed. -/// This is what you provide to methods like `sign_and_submit()`. -pub type PolkadotExtrinsicParamsBuilder = DefaultExtrinsicParamsBuilder; diff --git a/core/src/constants/mod.rs b/core/src/constants/mod.rs deleted file mode 100644 index 19ee7b8f106..00000000000 --- a/core/src/constants/mod.rs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Access constants from metadata. -//! -//! Use [`get`] to retrieve a constant from some metadata, or [`validate`] to check that a static -//! constant address lines up with the value seen in the metadata. -//! -//! # Example -//! -//! ```rust -//! use subxt_macro::subxt; -//! use subxt_core::constants; -//! use subxt_core::Metadata; -//! -//! // If we generate types without `subxt`, we need to point to `::subxt_core`: -//! #[subxt( -//! crate = "::subxt_core", -//! runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale", -//! )] -//! pub mod polkadot {} -//! -//! // Some metadata we'd like to access constants in: -//! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); -//! -//! // We can use a static address to obtain some constant: -//! let address = polkadot::constants().balances().existential_deposit(); -//! -//! // This validates that the address given is in line with the metadata -//! // we're trying to access the constant in: -//! constants::validate(&address, &metadata).expect("is valid"); -//! -//! // This acquires the constant (and internally also validates it): -//! let ed = constants::get(&address, &metadata).expect("can decode constant"); -//! -//! assert_eq!(ed, 33_333_333); -//! ``` - -pub mod address; - -use crate::Metadata; -use crate::error::ConstantError; -use address::Address; -use alloc::borrow::ToOwned; -use alloc::string::ToString; -use alloc::vec::Vec; -use frame_decode::constants::ConstantTypeInfo; -use scale_decode::IntoVisitor; - -/// When the provided `address` is statically generated via the `#[subxt]` macro, this validates -/// that the shape of the constant value is the same as the shape expected by the static address. -/// -/// When the provided `address` is dynamic (and thus does not come with any expectation of the -/// shape of the constant value), this just returns `Ok(())` -pub fn validate(address: Addr, metadata: &Metadata) -> Result<(), ConstantError> { - if let Some(actual_hash) = address.validation_hash() { - let expected_hash = metadata - .pallet_by_name(address.pallet_name()) - .ok_or_else(|| ConstantError::PalletNameNotFound(address.pallet_name().to_string()))? - .constant_hash(address.constant_name()) - .ok_or_else(|| ConstantError::ConstantNameNotFound { - pallet_name: address.pallet_name().to_string(), - constant_name: address.constant_name().to_owned(), - })?; - if actual_hash != expected_hash { - return Err(ConstantError::IncompatibleCodegen); - } - } - Ok(()) -} - -/// Fetch a constant out of the metadata given a constant address. If the `address` has been -/// statically generated, this will validate that the constant shape is as expected, too. -pub fn get( - address: Addr, - metadata: &Metadata, -) -> Result { - // 1. Validate constant shape if hash given: - validate(&address, metadata)?; - - // 2. Attempt to decode the constant into the type given: - let constant = frame_decode::constants::decode_constant( - address.pallet_name(), - address.constant_name(), - metadata, - metadata.types(), - Addr::Target::into_visitor(), - ) - .map_err(ConstantError::CouldNotDecodeConstant)?; - - Ok(constant) -} - -/// Access the bytes of a constant by the address it is registered under. -pub fn get_bytes( - address: Addr, - metadata: &Metadata, -) -> Result, ConstantError> { - // 1. Validate custom value shape if hash given: - validate(&address, metadata)?; - - // 2. Return the underlying bytes: - let constant = metadata - .constant_info(address.pallet_name(), address.constant_name()) - .map_err(|e| ConstantError::ConstantInfoError(e.into_owned()))?; - Ok(constant.bytes.to_vec()) -} diff --git a/core/src/custom_values/mod.rs b/core/src/custom_values/mod.rs deleted file mode 100644 index 5130ae64fa8..00000000000 --- a/core/src/custom_values/mod.rs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Access custom values from metadata. -//! -//! Use [`get`] to retrieve a custom value from some metadata, or [`validate`] to check that a -//! static custom value address lines up with the value seen in the metadata. -//! -//! # Example -//! -//! ```rust -//! use subxt_macro::subxt; -//! use subxt_core::custom_values; -//! use subxt_core::Metadata; -//! -//! // If we generate types without `subxt`, we need to point to `::subxt_core`: -//! #[subxt( -//! crate = "::subxt_core", -//! runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale", -//! )] -//! pub mod polkadot {} -//! -//! // Some metadata we'd like to access custom values in: -//! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); -//! -//! // At the moment, we don't expect to see any custom values in the metadata -//! // for Polkadot, so this will return an error: -//! let err = custom_values::get("Foo", &metadata); -//! ``` - -pub mod address; - -use crate::utils::Maybe; -use crate::{Metadata, error::CustomValueError}; -use address::Address; -use alloc::vec::Vec; -use frame_decode::custom_values::CustomValueTypeInfo; -use scale_decode::IntoVisitor; - -/// Run the validation logic against some custom value address you'd like to access. Returns `Ok(())` -/// if the address is valid (or if it's not possible to check since the address has no validation hash). -/// Returns an error if the address was not valid (wrong name, type or raw bytes) -pub fn validate(address: Addr, metadata: &Metadata) -> Result<(), CustomValueError> { - if let Some(actual_hash) = address.validation_hash() { - let custom = metadata.custom(); - let custom_value = custom - .get(address.name()) - .ok_or_else(|| CustomValueError::NotFound(address.name().into()))?; - let expected_hash = custom_value.hash(); - if actual_hash != expected_hash { - return Err(CustomValueError::IncompatibleCodegen); - } - } - Ok(()) -} - -/// Access a custom value by the address it is registered under. This can be just a [str] to get back a dynamic value, -/// or a static address from the generated static interface to get a value of a static type returned. -pub fn get>( - address: Addr, - metadata: &Metadata, -) -> Result { - // 1. Validate custom value shape if hash given: - validate(&address, metadata)?; - - // 2. Attempt to decode custom value: - let value = frame_decode::custom_values::decode_custom_value( - address.name(), - metadata, - metadata.types(), - Addr::Target::into_visitor(), - ) - .map_err(CustomValueError::CouldNotDecodeCustomValue)?; - - Ok(value) -} - -/// Access the bytes of a custom value by the address it is registered under. -pub fn get_bytes( - address: Addr, - metadata: &Metadata, -) -> Result, CustomValueError> { - // 1. Validate custom value shape if hash given: - validate(&address, metadata)?; - - // 2. Return the underlying bytes: - let custom_value = metadata - .custom_value_info(address.name()) - .map_err(|e| CustomValueError::NotFound(e.not_found))?; - Ok(custom_value.bytes.to_vec()) -} - -#[cfg(test)] -mod tests { - use super::*; - - use alloc::collections::BTreeMap; - use codec::Encode; - use scale_decode::DecodeAsType; - use scale_info::TypeInfo; - use scale_info::form::PortableForm; - - use alloc::borrow::ToOwned; - use alloc::string::String; - use alloc::vec; - - use crate::custom_values; - - #[derive(Debug, Clone, PartialEq, Eq, Encode, TypeInfo, DecodeAsType)] - pub struct Person { - age: u16, - name: String, - } - - fn mock_metadata() -> Metadata { - let person_ty = scale_info::MetaType::new::(); - let unit = scale_info::MetaType::new::<()>(); - let mut types = scale_info::Registry::new(); - let person_ty_id = types.register_type(&person_ty); - let unit_id = types.register_type(&unit); - let types: scale_info::PortableRegistry = types.into(); - - let person = Person { - age: 42, - name: "Neo".into(), - }; - - let person_value_metadata: frame_metadata::v15::CustomValueMetadata = - frame_metadata::v15::CustomValueMetadata { - ty: person_ty_id, - value: person.encode(), - }; - - let frame_metadata = frame_metadata::v15::RuntimeMetadataV15 { - types, - pallets: vec![], - extrinsic: frame_metadata::v15::ExtrinsicMetadata { - version: 0, - address_ty: unit_id, - call_ty: unit_id, - signature_ty: unit_id, - extra_ty: unit_id, - signed_extensions: vec![], - }, - ty: unit_id, - apis: vec![], - outer_enums: frame_metadata::v15::OuterEnums { - call_enum_ty: unit_id, - event_enum_ty: unit_id, - error_enum_ty: unit_id, - }, - custom: frame_metadata::v15::CustomMetadata { - map: BTreeMap::from_iter([("Mr. Robot".to_owned(), person_value_metadata)]), - }, - }; - - let metadata: subxt_metadata::Metadata = frame_metadata.try_into().unwrap(); - metadata - } - - #[test] - fn test_decoding() { - let metadata = mock_metadata(); - - assert!(custom_values::get("Invalid Address", &metadata).is_err()); - - let person_addr = custom_values::address::dynamic::("Mr. Robot"); - let person = custom_values::get(&person_addr, &metadata).unwrap(); - assert_eq!( - person, - Person { - age: 42, - name: "Neo".into() - } - ) - } -} diff --git a/core/src/dynamic.rs b/core/src/dynamic.rs deleted file mode 100644 index 27819620f49..00000000000 --- a/core/src/dynamic.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! This module provides the entry points to create dynamic -//! transactions, storage and constant lookups. - -pub use scale_value::{At, Value}; - -// Submit dynamic transactions. -pub use crate::tx::payload::dynamic as tx; - -// Lookup constants dynamically. -pub use crate::constants::address::dynamic as constant; - -// Lookup storage values dynamically. -pub use crate::storage::address::dynamic as storage; - -// Execute runtime API function call dynamically. -pub use crate::runtime_api::payload::dynamic as runtime_api_call; - -// Execute View Function API function call dynamically. -pub use crate::view_functions::payload::dynamic as view_function_call; - -/// Obtain a custom value from the metadata. -pub use crate::custom_values::address::dynamic as custom_value; diff --git a/core/src/error.rs b/core/src/error.rs deleted file mode 100644 index a5b259f176d..00000000000 --- a/core/src/error.rs +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! The errors that can be emitted in this crate. - -use alloc::boxed::Box; -use alloc::string::String; -use alloc::vec::Vec; -use thiserror::Error as DeriveError; - -/// The error emitted when something goes wrong. -#[derive(Debug, DeriveError)] -#[allow(missing_docs)] -pub enum Error { - #[error(transparent)] - StorageError(#[from] StorageError), - #[error(transparent)] - Extrinsic(#[from] ExtrinsicError), - #[error(transparent)] - Constant(#[from] ConstantError), - #[error(transparent)] - CustomValue(#[from] CustomValueError), - #[error(transparent)] - RuntimeApi(#[from] RuntimeApiError), - #[error(transparent)] - ViewFunction(#[from] ViewFunctionError), - #[error(transparent)] - Events(#[from] EventsError), -} - -#[derive(Debug, DeriveError)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum EventsError { - #[error("Can't decode event: can't decode phase: {0}")] - CannotDecodePhase(codec::Error), - #[error("Can't decode event: can't decode pallet index: {0}")] - CannotDecodePalletIndex(codec::Error), - #[error("Can't decode event: can't decode variant index: {0}")] - CannotDecodeVariantIndex(codec::Error), - #[error("Can't decode event: can't find pallet with index {0}")] - CannotFindPalletWithIndex(u8), - #[error( - "Can't decode event: can't find variant with index {variant_index} in pallet {pallet_name}" - )] - CannotFindVariantWithIndex { - pallet_name: String, - variant_index: u8, - }, - #[error("Can't decode field {field_name:?} in event {pallet_name}.{event_name}: {reason}")] - CannotDecodeFieldInEvent { - pallet_name: String, - event_name: String, - field_name: String, - reason: scale_decode::visitor::DecodeError, - }, - #[error("Can't decode event topics: {0}")] - CannotDecodeEventTopics(codec::Error), - #[error("Can't decode the fields of event {pallet_name}.{event_name}: {reason}")] - CannotDecodeEventFields { - pallet_name: String, - event_name: String, - reason: scale_decode::Error, - }, - #[error("Can't decode event {pallet_name}.{event_name} to Event enum: {reason}")] - CannotDecodeEventEnum { - pallet_name: String, - event_name: String, - reason: scale_decode::Error, - }, -} - -#[derive(Debug, DeriveError)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum ViewFunctionError { - #[error("The static View Function address used is not compatible with the live chain")] - IncompatibleCodegen, - #[error("Can't find View Function: pallet {0} not found")] - PalletNotFound(String), - #[error("Can't find View Function {function_name} in pallet {pallet_name}")] - ViewFunctionNotFound { - pallet_name: String, - function_name: String, - }, - #[error("Failed to encode View Function inputs: {0}")] - CouldNotEncodeInputs(frame_decode::view_functions::ViewFunctionInputsEncodeError), - #[error("Failed to decode View Function: {0}")] - CouldNotDecodeResponse(frame_decode::view_functions::ViewFunctionDecodeError), -} - -#[derive(Debug, DeriveError)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum RuntimeApiError { - #[error("The static Runtime API address used is not compatible with the live chain")] - IncompatibleCodegen, - #[error("Runtime API trait not found: {0}")] - TraitNotFound(String), - #[error("Runtime API method {method_name} not found in trait {trait_name}")] - MethodNotFound { - trait_name: String, - method_name: String, - }, - #[error("Failed to encode Runtime API inputs: {0}")] - CouldNotEncodeInputs(frame_decode::runtime_apis::RuntimeApiInputsEncodeError), - #[error("Failed to decode Runtime API: {0}")] - CouldNotDecodeResponse(frame_decode::runtime_apis::RuntimeApiDecodeError), -} - -#[derive(Debug, DeriveError)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum CustomValueError { - #[error("The static custom value address used is not compatible with the live chain")] - IncompatibleCodegen, - #[error("The custom value '{0}' was not found")] - NotFound(String), - #[error("Failed to decode custom value: {0}")] - CouldNotDecodeCustomValue(frame_decode::custom_values::CustomValueDecodeError), -} - -/// Something went wrong working with a constant. -#[derive(Debug, DeriveError)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum ConstantError { - #[error("The static constant address used is not compatible with the live chain")] - IncompatibleCodegen, - #[error("Can't find constant: pallet with name {0} not found")] - PalletNameNotFound(String), - #[error( - "Constant '{constant_name}' not found in pallet {pallet_name} in the live chain metadata" - )] - ConstantNameNotFound { - pallet_name: String, - constant_name: String, - }, - #[error("Failed to decode constant: {0}")] - CouldNotDecodeConstant(frame_decode::constants::ConstantDecodeError), - #[error("Cannot obtain constant information from metadata: {0}")] - ConstantInfoError(frame_decode::constants::ConstantInfoError<'static>), -} - -/// Something went wrong trying to encode or decode a storage address. -#[derive(Debug, DeriveError)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum StorageError { - #[error("The static storage address used is not compatible with the live chain")] - IncompatibleCodegen, - #[error("Can't find storage value: pallet with name {0} not found")] - PalletNameNotFound(String), - #[error( - "Storage entry '{entry_name}' not found in pallet {pallet_name} in the live chain metadata" - )] - StorageEntryNotFound { - pallet_name: String, - entry_name: String, - }, - #[error("Cannot obtain storage information from metadata: {0}")] - StorageInfoError(frame_decode::storage::StorageInfoError<'static>), - #[error("Cannot encode storage key: {0}")] - StorageKeyEncodeError(frame_decode::storage::StorageKeyEncodeError), - #[error("Cannot create a key to iterate over a plain entry")] - CannotIterPlainEntry { - pallet_name: String, - entry_name: String, - }, - #[error( - "Wrong number of key parts provided to iterate a storage address. We expected at most {max_expected} key parts but got {got} key parts" - )] - WrongNumberOfKeyPartsProvidedForIterating { max_expected: usize, got: usize }, - #[error( - "Wrong number of key parts provided to fetch a storage address. We expected {expected} key parts but got {got} key parts" - )] - WrongNumberOfKeyPartsProvidedForFetching { expected: usize, got: usize }, -} - -#[derive(Debug, DeriveError)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum StorageKeyError { - #[error("Can't decode the storage key: {error}")] - StorageKeyDecodeError { - bytes: Vec, - error: frame_decode::storage::StorageKeyDecodeError, - }, - #[error("Can't decode the values from the storage key: {0}")] - CannotDecodeValuesInKey(frame_decode::storage::StorageKeyValueDecodeError), - #[error( - "Cannot decode storage key: there were leftover bytes, indicating that the decoding failed" - )] - LeftoverBytes { bytes: Vec }, - #[error("Can't decode a single value from the storage key part at index {index}: {error}")] - CannotDecodeValueInKey { - index: usize, - error: scale_decode::Error, - }, -} - -#[derive(Debug, DeriveError)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum StorageValueError { - #[error("Cannot decode storage value: {0}")] - CannotDecode(frame_decode::storage::StorageValueDecodeError), - #[error( - "Cannot decode storage value: there were leftover bytes, indicating that the decoding failed" - )] - LeftoverBytes { bytes: Vec }, -} - -/// An error that can be encountered when constructing a transaction. -#[derive(Debug, DeriveError)] -#[allow(missing_docs)] -pub enum ExtrinsicError { - #[error("The extrinsic payload is not compatible with the live chain")] - IncompatibleCodegen, - #[error("Can't find extrinsic: pallet with name {0} not found")] - PalletNameNotFound(String), - #[error("Can't find extrinsic: call name {call_name} doesn't exist in pallet {pallet_name}")] - CallNameNotFound { - pallet_name: String, - call_name: String, - }, - #[error("Can't encode the extrinsic call data: {0}")] - CannotEncodeCallData(scale_encode::Error), - #[error("Subxt does not support the extrinsic versions expected by the chain")] - UnsupportedVersion, - #[error("Cannot construct the required transaction extensions: {0}")] - Params(#[from] ExtrinsicParamsError), - #[error("Cannot decode transaction extension '{name}': {error}")] - CouldNotDecodeTransactionExtension { - /// The extension name. - name: String, - /// The decode error. - error: scale_decode::Error, - }, - #[error( - "After decoding the extrinsic at index {extrinsic_index}, {num_leftover_bytes} bytes were left, suggesting that decoding may have failed" - )] - LeftoverBytes { - /// Index of the extrinsic that failed to decode. - extrinsic_index: usize, - /// Number of bytes leftover after decoding the extrinsic. - num_leftover_bytes: usize, - }, - #[error("{0}")] - ExtrinsicDecodeErrorAt(#[from] ExtrinsicDecodeErrorAt), - #[error("Failed to decode the fields of an extrinsic at index {extrinsic_index}: {error}")] - CannotDecodeFields { - /// Index of the extrinsic whose fields we could not decode - extrinsic_index: usize, - /// The decode error. - error: scale_decode::Error, - }, - #[error("Failed to decode the extrinsic at index {extrinsic_index} to a root enum: {error}")] - CannotDecodeIntoRootExtrinsic { - /// Index of the extrinsic that we failed to decode - extrinsic_index: usize, - /// The decode error. - error: scale_decode::Error, - }, -} - -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -#[allow(missing_docs)] -#[error("Cannot decode extrinsic at index {extrinsic_index}: {error}")] -pub struct ExtrinsicDecodeErrorAt { - pub extrinsic_index: usize, - pub error: ExtrinsicDecodeErrorAtReason, -} - -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum ExtrinsicDecodeErrorAtReason { - #[error("{0}")] - DecodeError(frame_decode::extrinsics::ExtrinsicDecodeError), - #[error("Leftover bytes")] - LeftoverBytes(Vec), -} - -/// An error that can be emitted when trying to construct an instance of [`crate::config::ExtrinsicParams`], -/// encode data from the instance, or match on signed extensions. -#[derive(Debug, DeriveError)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum ExtrinsicParamsError { - #[error("Cannot find type id '{type_id} in the metadata (context: {context})")] - MissingTypeId { - /// Type ID. - type_id: u32, - /// Some arbitrary context to help narrow the source of the error. - context: &'static str, - }, - #[error("The chain expects a signed extension with the name {0}, but we did not provide one")] - UnknownTransactionExtension(String), - #[error("Error constructing extrinsic parameters: {0}")] - Custom(Box), -} - -impl ExtrinsicParamsError { - /// Create a custom [`ExtrinsicParamsError`] from a string. - pub fn custom>(error: S) -> Self { - let error: String = error.into(); - let error: Box = Box::from(error); - ExtrinsicParamsError::Custom(error) - } -} - -impl From for ExtrinsicParamsError { - fn from(value: core::convert::Infallible) -> Self { - match value {} - } -} diff --git a/core/src/events.rs b/core/src/events.rs deleted file mode 100644 index 9d38517910a..00000000000 --- a/core/src/events.rs +++ /dev/null @@ -1,1022 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Decode and work with events. -//! -//! # Example -//! -//! ```rust -//! use subxt_macro::subxt; -//! use subxt_core::config::PolkadotConfig; -//! use subxt_core::events; -//! use subxt_core::Metadata; -//! use subxt_core::dynamic::Value; -//! -//! // If we generate types without `subxt`, we need to point to `::subxt_core`: -//! #[subxt( -//! crate = "::subxt_core", -//! runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", -//! )] -//! pub mod polkadot {} -//! -//! // Some metadata we'll use to work with storage entries: -//! let metadata_bytes = include_bytes!("../../artifacts/polkadot_metadata_full.scale"); -//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); -//! -//! // Some bytes representing events (located in System.Events storage): -//! let event_bytes = hex::decode("1c00000000000000a2e9b53d5517020000000100000000000310c96d901d0102000000020000000408d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dbeea5a030000000000000000000000000000020000000402d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48102700000000000000000000000000000000020000000407be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25fbeea5a030000000000000000000000000000020000002100d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dbeea5a03000000000000000000000000000000000000000000000000000000000000020000000000426df03e00000000").unwrap(); -//! -//! // We can decode these bytes like so: -//! let evs = events::decode_from::(event_bytes, metadata); -//! -//! // And then do things like iterate over them and inspect details: -//! for ev in evs.iter() { -//! let ev = ev.unwrap(); -//! println!("Index: {}", ev.index()); -//! println!("Name: {}.{}", ev.pallet_name(), ev.variant_name()); -//! println!("Fields: {:?}", ev.decode_as_fields::().unwrap()); -//! } -//! ``` - -use alloc::string::ToString; -use alloc::sync::Arc; -use alloc::vec::Vec; -use codec::{Compact, Decode, Encode}; -use derive_where::derive_where; -use scale_decode::{DecodeAsFields, DecodeAsType}; -use subxt_metadata::PalletMetadata; - -use crate::{ - Metadata, - config::{Config, HashFor}, - error::EventsError, -}; - -/// Create a new [`Events`] instance from the given bytes. -/// -/// This is a shortcut for [`Events::decode_from`]. -pub fn decode_from(event_bytes: Vec, metadata: Metadata) -> Events { - Events::decode_from(event_bytes, metadata) -} - -/// Trait to uniquely identify the events's identity from the runtime metadata. -/// -/// Generated API structures that represent an event implement this trait. -/// -/// The trait is utilized to decode emitted events from a block, via obtaining the -/// form of the `Event` from the metadata. -pub trait StaticEvent: DecodeAsFields { - /// Pallet name. - const PALLET: &'static str; - /// Event name. - const EVENT: &'static str; - - /// Returns true if the given pallet and event names match this event. - fn is_event(pallet: &str, event: &str) -> bool { - Self::PALLET == pallet && Self::EVENT == event - } -} - -/// A collection of events obtained from a block, bundled with the necessary -/// information needed to decode and iterate over them. -#[derive_where(Clone)] -pub struct Events { - metadata: Metadata, - // Note; raw event bytes are prefixed with a Compact containing - // the number of events to be decoded. The start_idx reflects that, so - // that we can skip over those bytes when decoding them - event_bytes: Arc<[u8]>, - start_idx: usize, - num_events: u32, - marker: core::marker::PhantomData, -} - -// Ignore the Metadata when debug-logging events; it's big and distracting. -impl core::fmt::Debug for Events { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - f.debug_struct("Events") - .field("event_bytes", &self.event_bytes) - .field("start_idx", &self.start_idx) - .field("num_events", &self.num_events) - .finish() - } -} - -impl Events { - /// Create a new [`Events`] instance from the given bytes. - pub fn decode_from(event_bytes: Vec, metadata: Metadata) -> Self { - // event_bytes is a SCALE encoded vector of events. So, pluck the - // compact encoded length from the front, leaving the remaining bytes - // for our iterating to decode. - // - // Note: if we get no bytes back, avoid an error reading vec length - // and default to 0 events. - let cursor = &mut &*event_bytes; - let num_events = >::decode(cursor).unwrap_or(Compact(0)).0; - - // Start decoding after the compact encoded bytes. - let start_idx = event_bytes.len() - cursor.len(); - - Self { - metadata, - event_bytes: event_bytes.into(), - start_idx, - num_events, - marker: core::marker::PhantomData, - } - } - - /// The number of events. - pub fn len(&self) -> u32 { - self.num_events - } - - /// Are there no events in this block? - // Note: mainly here to satisfy clippy. - pub fn is_empty(&self) -> bool { - self.num_events == 0 - } - - /// Return the bytes representing all of the events. - pub fn bytes(&self) -> &[u8] { - &self.event_bytes - } - - /// Iterate over all of the events, using metadata to dynamically - /// decode them as we go, and returning the raw bytes and other associated - /// details. If an error occurs, all subsequent iterations return `None`. - // Dev note: The returned iterator is 'static + Send so that we can box it up and make - // use of it with our `FilterEvents` stuff. - pub fn iter( - &self, - ) -> impl Iterator, EventsError>> + Send + Sync + 'static { - // The event bytes ignoring the compact encoded length on the front: - let event_bytes = self.event_bytes.clone(); - let metadata = self.metadata.clone(); - let num_events = self.num_events; - - let mut pos = self.start_idx; - let mut index = 0; - core::iter::from_fn(move || { - if event_bytes.len() <= pos || num_events == index { - None - } else { - match EventDetails::decode_from(metadata.clone(), event_bytes.clone(), pos, index) { - Ok(event_details) => { - // Skip over decoded bytes in next iteration: - pos += event_details.bytes().len(); - // Increment the index: - index += 1; - // Return the event details: - Some(Ok(event_details)) - } - Err(e) => { - // By setting the position to the "end" of the event bytes, - // the cursor len will become 0 and the iterator will return `None` - // from now on: - pos = event_bytes.len(); - Some(Err(e)) - } - } - } - }) - } - - /// Iterate through the events using metadata to dynamically decode and skip - /// them, and return only those which should decode to the provided `Ev` type. - /// If an error occurs, all subsequent iterations return `None`. - pub fn find(&self) -> impl Iterator> { - self.iter() - .filter_map(|ev| ev.and_then(|ev| ev.as_event::()).transpose()) - } - - /// Iterate through the events using metadata to dynamically decode and skip - /// them, and return the first event found which decodes to the provided `Ev` type. - pub fn find_first(&self) -> Result, EventsError> { - self.find::().next().transpose() - } - - /// Iterate through the events using metadata to dynamically decode and skip - /// them, and return the last event found which decodes to the provided `Ev` type. - pub fn find_last(&self) -> Result, EventsError> { - self.find::().last().transpose() - } - - /// Find an event that decodes to the type provided. Returns true if it was found. - pub fn has(&self) -> Result { - Ok(self.find::().next().transpose()?.is_some()) - } -} - -/// A phase of a block's execution. -#[derive(Copy, Clone, Debug, Eq, PartialEq, Decode, Encode)] -pub enum Phase { - /// Applying an extrinsic. - ApplyExtrinsic(u32), - /// Finalizing the block. - Finalization, - /// Initializing the block. - Initialization, -} - -/// The event details. -#[derive(Debug, Clone)] -pub struct EventDetails { - phase: Phase, - /// The index of the event in the list of events in a given block. - index: u32, - all_bytes: Arc<[u8]>, - // start of the bytes (phase, pallet/variant index and then fields and then topic to follow). - start_idx: usize, - // start of the event (ie pallet/variant index and then the fields and topic after). - event_start_idx: usize, - // start of the fields (ie after phase and pallet/variant index). - event_fields_start_idx: usize, - // end of the fields. - event_fields_end_idx: usize, - // end of everything (fields + topics) - end_idx: usize, - metadata: Metadata, - topics: Vec>, -} - -impl EventDetails { - /// Attempt to dynamically decode a single event from our events input. - fn decode_from( - metadata: Metadata, - all_bytes: Arc<[u8]>, - start_idx: usize, - index: u32, - ) -> Result, EventsError> { - let input = &mut &all_bytes[start_idx..]; - - let phase = Phase::decode(input).map_err(EventsError::CannotDecodePhase)?; - - let event_start_idx = all_bytes.len() - input.len(); - - let pallet_index = u8::decode(input).map_err(EventsError::CannotDecodePalletIndex)?; - let variant_index = u8::decode(input).map_err(EventsError::CannotDecodeVariantIndex)?; - - let event_fields_start_idx = all_bytes.len() - input.len(); - - // Get metadata for the event: - let event_pallet = metadata - .pallet_by_event_index(pallet_index) - .ok_or_else(|| EventsError::CannotFindPalletWithIndex(pallet_index))?; - let event_variant = event_pallet - .event_variant_by_index(variant_index) - .ok_or_else(|| EventsError::CannotFindVariantWithIndex { - pallet_name: event_pallet.name().to_string(), - variant_index, - })?; - - tracing::debug!( - "Decoding Event '{}::{}'", - event_pallet.name(), - &event_variant.name - ); - - // Skip over the bytes belonging to this event. - for field_metadata in &event_variant.fields { - // Skip over the bytes for this field: - scale_decode::visitor::decode_with_visitor( - input, - field_metadata.ty.id, - metadata.types(), - scale_decode::visitor::IgnoreVisitor::new(), - ) - .map_err(|e| EventsError::CannotDecodeFieldInEvent { - pallet_name: event_pallet.name().to_string(), - event_name: event_variant.name.clone(), - field_name: field_metadata - .name - .clone() - .unwrap_or("".to_string()), - reason: e, - })?; - } - - // the end of the field bytes. - let event_fields_end_idx = all_bytes.len() - input.len(); - - // topics come after the event data in EventRecord. - let topics = - Vec::>::decode(input).map_err(EventsError::CannotDecodeEventTopics)?; - - // what bytes did we skip over in total, including topics. - let end_idx = all_bytes.len() - input.len(); - - Ok(EventDetails { - phase, - index, - start_idx, - event_start_idx, - event_fields_start_idx, - event_fields_end_idx, - end_idx, - all_bytes, - metadata, - topics, - }) - } - - /// When was the event produced? - pub fn phase(&self) -> Phase { - self.phase - } - - /// What index is this event in the stored events for this block. - pub fn index(&self) -> u32 { - self.index - } - - /// The index of the pallet that the event originated from. - pub fn pallet_index(&self) -> u8 { - // Note: never panics; we expect these bytes to exist - // in order that the EventDetails could be created. - self.all_bytes[self.event_fields_start_idx - 2] - } - - /// The index of the event variant that the event originated from. - pub fn variant_index(&self) -> u8 { - // Note: never panics; we expect these bytes to exist - // in order that the EventDetails could be created. - self.all_bytes[self.event_fields_start_idx - 1] - } - - /// The name of the pallet from whence the Event originated. - pub fn pallet_name(&self) -> &str { - self.event_metadata().pallet.name() - } - - /// The name of the event (ie the name of the variant that it corresponds to). - pub fn variant_name(&self) -> &str { - &self.event_metadata().variant.name - } - - /// Fetch details from the metadata for this event. - pub fn event_metadata(&self) -> EventMetadataDetails<'_> { - let pallet = self - .metadata - .pallet_by_event_index(self.pallet_index()) - .expect("event pallet to be found; we did this already during decoding"); - let variant = pallet - .event_variant_by_index(self.variant_index()) - .expect("event variant to be found; we did this already during decoding"); - - EventMetadataDetails { pallet, variant } - } - - /// Return _all_ of the bytes representing this event, which include, in order: - /// - The phase. - /// - Pallet and event index. - /// - Event fields. - /// - Event Topics. - pub fn bytes(&self) -> &[u8] { - &self.all_bytes[self.start_idx..self.end_idx] - } - - /// Return the bytes representing the fields stored in this event. - pub fn field_bytes(&self) -> &[u8] { - &self.all_bytes[self.event_fields_start_idx..self.event_fields_end_idx] - } - - /// Decode and provide the event fields back in the form of a [`scale_value::Composite`] - /// type which represents the named or unnamed fields that were present in the event. - pub fn decode_as_fields(&self) -> Result { - let bytes = &mut self.field_bytes(); - let event_metadata = self.event_metadata(); - - let mut fields = event_metadata - .variant - .fields - .iter() - .map(|f| scale_decode::Field::new(f.ty.id, f.name.as_deref())); - - let decoded = - E::decode_as_fields(bytes, &mut fields, self.metadata.types()).map_err(|e| { - EventsError::CannotDecodeEventFields { - pallet_name: event_metadata.pallet.name().to_string(), - event_name: event_metadata.variant.name.clone(), - reason: e, - } - })?; - - Ok(decoded) - } - - /// Attempt to decode these [`EventDetails`] into a type representing the event fields. - /// Such types are exposed in the codegen as `pallet_name::events::EventName` types. - pub fn as_event(&self) -> Result, EventsError> { - let ev_metadata = self.event_metadata(); - if ev_metadata.pallet.name() == E::PALLET && ev_metadata.variant.name == E::EVENT { - let mut fields = ev_metadata - .variant - .fields - .iter() - .map(|f| scale_decode::Field::new(f.ty.id, f.name.as_deref())); - let decoded = - E::decode_as_fields(&mut self.field_bytes(), &mut fields, self.metadata.types()) - .map_err(|e| EventsError::CannotDecodeEventFields { - pallet_name: E::PALLET.to_string(), - event_name: E::EVENT.to_string(), - reason: e, - })?; - Ok(Some(decoded)) - } else { - Ok(None) - } - } - - /// Attempt to decode these [`EventDetails`] into a root event type (which includes - /// the pallet and event enum variants as well as the event fields). A compatible - /// type for this is exposed via static codegen as a root level `Event` type. - pub fn as_root_event(&self) -> Result { - let bytes = &self.all_bytes[self.event_start_idx..self.event_fields_end_idx]; - - let decoded = E::decode_as_type( - &mut &bytes[..], - self.metadata.outer_enums().event_enum_ty(), - self.metadata.types(), - ) - .map_err(|e| { - let md = self.event_metadata(); - EventsError::CannotDecodeEventEnum { - pallet_name: md.pallet.name().to_string(), - event_name: md.variant.name.clone(), - reason: e, - } - })?; - - Ok(decoded) - } - - /// Return the topics associated with this event. - pub fn topics(&self) -> &[HashFor] { - &self.topics - } -} - -/// Details for the given event plucked from the metadata. -pub struct EventMetadataDetails<'a> { - /// Metadata for the pallet that the event belongs to. - pub pallet: PalletMetadata<'a>, - /// Metadata for the variant which describes the pallet events. - pub variant: &'a scale_info::Variant, -} - -/// Event related test utilities used outside this module. -#[cfg(test)] -pub(crate) mod test_utils { - use super::*; - use crate::config::{HashFor, SubstrateConfig}; - use codec::Encode; - use frame_metadata::{ - RuntimeMetadataPrefixed, - v15::{ - CustomMetadata, ExtrinsicMetadata, OuterEnums, PalletEventMetadata, PalletMetadata, - RuntimeMetadataV15, - }, - }; - use scale_info::{TypeInfo, meta_type}; - - /// An "outer" events enum containing exactly one event. - #[derive( - Encode, - Decode, - TypeInfo, - Clone, - Debug, - PartialEq, - Eq, - scale_encode::EncodeAsType, - scale_decode::DecodeAsType, - )] - pub enum AllEvents { - Test(Ev), - } - - /// This encodes to the same format an event is expected to encode to - /// in node System.Events storage. - #[derive(Encode)] - pub struct EventRecord { - phase: Phase, - event: AllEvents, - topics: Vec>, - } - - impl EventRecord { - /// Create a new event record with the given phase, event, and topics. - pub fn new(phase: Phase, event: E, topics: Vec>) -> Self { - Self { - phase, - event: AllEvents::Test(event), - topics, - } - } - } - - /// Build an EventRecord, which encoded events in the format expected - /// to be handed back from storage queries to System.Events. - pub fn event_record(phase: Phase, event: E) -> EventRecord { - EventRecord::new(phase, event, vec![]) - } - - /// Build fake metadata consisting of a single pallet that knows - /// about the event type provided. - pub fn metadata() -> Metadata { - // Extrinsic needs to contain at least the generic type parameter "Call" - // for the metadata to be valid. - // The "Call" type from the metadata is used to decode extrinsics. - // In reality, the extrinsic type has "Call", "Address", "Extra", "Signature" generic types. - #[allow(unused)] - #[derive(TypeInfo)] - struct ExtrinsicType { - call: Call, - } - // Because this type is used to decode extrinsics, we expect this to be a TypeDefVariant. - // Each pallet must contain one single variant. - #[allow(unused)] - #[derive(TypeInfo)] - enum RuntimeCall { - PalletName(Pallet), - } - // The calls of the pallet. - #[allow(unused)] - #[derive(TypeInfo)] - enum Pallet { - #[allow(unused)] - SomeCall, - } - - let pallets = vec![PalletMetadata { - name: "Test", - storage: None, - calls: None, - event: Some(PalletEventMetadata { - ty: meta_type::(), - }), - constants: vec![], - error: None, - index: 0, - docs: vec![], - }]; - - let extrinsic = ExtrinsicMetadata { - version: 0, - signed_extensions: vec![], - address_ty: meta_type::<()>(), - call_ty: meta_type::(), - signature_ty: meta_type::<()>(), - extra_ty: meta_type::<()>(), - }; - - let meta = RuntimeMetadataV15::new( - pallets, - extrinsic, - meta_type::<()>(), - vec![], - OuterEnums { - call_enum_ty: meta_type::<()>(), - event_enum_ty: meta_type::>(), - error_enum_ty: meta_type::<()>(), - }, - CustomMetadata { - map: Default::default(), - }, - ); - let runtime_metadata: RuntimeMetadataPrefixed = meta.into(); - let metadata: subxt_metadata::Metadata = runtime_metadata.try_into().unwrap(); - - metadata - } - - /// Build an `Events` object for test purposes, based on the details provided, - /// and with a default block hash. - pub fn events( - metadata: Metadata, - event_records: Vec>, - ) -> Events { - let num_events = event_records.len() as u32; - let mut event_bytes = Vec::new(); - for ev in event_records { - ev.encode_to(&mut event_bytes); - } - events_raw(metadata, event_bytes, num_events) - } - - /// Much like [`events`], but takes pre-encoded events and event count, so that we can - /// mess with the bytes in tests if we need to. - pub fn events_raw( - metadata: Metadata, - event_bytes: Vec, - num_events: u32, - ) -> Events { - // Prepend compact encoded length to event bytes: - let mut all_event_bytes = Compact(num_events).encode(); - all_event_bytes.extend(event_bytes); - Events::decode_from(all_event_bytes, metadata) - } -} - -#[cfg(test)] -mod tests { - use super::{ - test_utils::{AllEvents, EventRecord, event_record, events, events_raw}, - *, - }; - use crate::config::SubstrateConfig; - use crate::events::Phase; - use codec::Encode; - use primitive_types::H256; - use scale_info::TypeInfo; - use scale_value::Value; - - /// Build a fake wrapped metadata. - fn metadata() -> Metadata { - test_utils::metadata::() - } - - /// [`RawEventDetails`] can be annoying to test, because it contains - /// type info in the decoded field Values. Strip that here so that - /// we can compare fields more easily. - #[derive(Debug, PartialEq, Eq, Clone)] - pub struct TestRawEventDetails { - pub phase: Phase, - pub index: u32, - pub pallet: String, - pub pallet_index: u8, - pub variant: String, - pub variant_index: u8, - pub fields: Vec, - } - - /// Compare some actual [`RawEventDetails`] with a hand-constructed - /// (probably) [`TestRawEventDetails`]. - pub fn assert_raw_events_match( - actual: EventDetails, - expected: TestRawEventDetails, - ) { - let actual_fields_no_context: Vec<_> = actual - .decode_as_fields::>() - .expect("can decode field values (2)") - .into_values() - .map(|value| value.remove_context()) - .collect(); - - // Check each of the other fields: - assert_eq!(actual.phase(), expected.phase); - assert_eq!(actual.index(), expected.index); - assert_eq!(actual.pallet_name(), expected.pallet); - assert_eq!(actual.pallet_index(), expected.pallet_index); - assert_eq!(actual.variant_name(), expected.variant); - assert_eq!(actual.variant_index(), expected.variant_index); - assert_eq!(actual_fields_no_context, expected.fields); - } - - #[test] - fn statically_decode_single_root_event() { - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo, scale_decode::DecodeAsType)] - enum Event { - A(u8, bool, Vec), - } - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - - // Encode our events in the format we expect back from a node, and - // construct an Events object to iterate them: - let event = Event::A(1, true, vec!["Hi".into()]); - let events = events::( - metadata, - vec![event_record(Phase::ApplyExtrinsic(123), event.clone())], - ); - - let ev = events - .iter() - .next() - .expect("one event expected") - .expect("event should be extracted OK"); - - // This is the line we're testing: - let decoded_event = ev - .as_root_event::>() - .expect("can decode event into root enum again"); - - // It should equal the event we put in: - assert_eq!(decoded_event, AllEvents::Test(event)); - } - - #[test] - fn dynamically_decode_single_event() { - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] - enum Event { - A(u8, bool, Vec), - } - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - - // Encode our events in the format we expect back from a node, and - // construct an Events object to iterate them: - let event = Event::A(1, true, vec!["Hi".into()]); - let events = events::( - metadata, - vec![event_record(Phase::ApplyExtrinsic(123), event)], - ); - - let mut event_details = events.iter(); - assert_raw_events_match( - event_details.next().unwrap().unwrap(), - TestRawEventDetails { - phase: Phase::ApplyExtrinsic(123), - index: 0, - pallet: "Test".to_string(), - pallet_index: 0, - variant: "A".to_string(), - variant_index: 0, - fields: vec![ - Value::u128(1), - Value::bool(true), - Value::unnamed_composite(vec![Value::string("Hi")]), - ], - }, - ); - assert!(event_details.next().is_none()); - } - - #[test] - fn dynamically_decode_multiple_events() { - #[derive(Clone, Copy, Debug, PartialEq, Decode, Encode, TypeInfo)] - enum Event { - A(u8), - B(bool), - } - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - - // Encode our events in the format we expect back from a node, and - // construct an Events object to iterate them: - let event1 = Event::A(1); - let event2 = Event::B(true); - let event3 = Event::A(234); - - let events = events::( - metadata, - vec![ - event_record(Phase::Initialization, event1), - event_record(Phase::ApplyExtrinsic(123), event2), - event_record(Phase::Finalization, event3), - ], - ); - - let mut event_details = events.iter(); - - assert_raw_events_match( - event_details.next().unwrap().unwrap(), - TestRawEventDetails { - index: 0, - phase: Phase::Initialization, - pallet: "Test".to_string(), - pallet_index: 0, - variant: "A".to_string(), - variant_index: 0, - fields: vec![Value::u128(1)], - }, - ); - assert_raw_events_match( - event_details.next().unwrap().unwrap(), - TestRawEventDetails { - index: 1, - phase: Phase::ApplyExtrinsic(123), - pallet: "Test".to_string(), - pallet_index: 0, - variant: "B".to_string(), - variant_index: 1, - fields: vec![Value::bool(true)], - }, - ); - assert_raw_events_match( - event_details.next().unwrap().unwrap(), - TestRawEventDetails { - index: 2, - phase: Phase::Finalization, - pallet: "Test".to_string(), - pallet_index: 0, - variant: "A".to_string(), - variant_index: 0, - fields: vec![Value::u128(234)], - }, - ); - assert!(event_details.next().is_none()); - } - - #[test] - fn dynamically_decode_multiple_events_until_error() { - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] - enum Event { - A(u8), - B(bool), - } - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - - // Encode 2 events: - let mut event_bytes = vec![]; - event_record(Phase::Initialization, Event::A(1)).encode_to(&mut event_bytes); - event_record(Phase::ApplyExtrinsic(123), Event::B(true)).encode_to(&mut event_bytes); - - // Push a few naff bytes to the end (a broken third event): - event_bytes.extend_from_slice(&[3, 127, 45, 0, 2]); - - // Encode our events in the format we expect back from a node, and - // construct an Events object to iterate them: - let events = events_raw( - metadata, - event_bytes, - 3, // 2 "good" events, and then it'll hit the naff bytes. - ); - - let mut events_iter = events.iter(); - assert_raw_events_match( - events_iter.next().unwrap().unwrap(), - TestRawEventDetails { - index: 0, - phase: Phase::Initialization, - pallet: "Test".to_string(), - pallet_index: 0, - variant: "A".to_string(), - variant_index: 0, - fields: vec![Value::u128(1)], - }, - ); - assert_raw_events_match( - events_iter.next().unwrap().unwrap(), - TestRawEventDetails { - index: 1, - phase: Phase::ApplyExtrinsic(123), - pallet: "Test".to_string(), - pallet_index: 0, - variant: "B".to_string(), - variant_index: 1, - fields: vec![Value::bool(true)], - }, - ); - - // We'll hit an error trying to decode the third event: - assert!(events_iter.next().unwrap().is_err()); - // ... and then "None" from then on. - assert!(events_iter.next().is_none()); - assert!(events_iter.next().is_none()); - } - - #[test] - fn compact_event_field() { - #[derive(Clone, Debug, PartialEq, Encode, Decode, TypeInfo)] - enum Event { - A(#[codec(compact)] u32), - } - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - - // Encode our events in the format we expect back from a node, and - // construct an Events object to iterate them: - let events = events::( - metadata, - vec![event_record(Phase::Finalization, Event::A(1))], - ); - - // Dynamically decode: - let mut event_details = events.iter(); - assert_raw_events_match( - event_details.next().unwrap().unwrap(), - TestRawEventDetails { - index: 0, - phase: Phase::Finalization, - pallet: "Test".to_string(), - pallet_index: 0, - variant: "A".to_string(), - variant_index: 0, - fields: vec![Value::u128(1)], - }, - ); - assert!(event_details.next().is_none()); - } - - #[test] - fn compact_wrapper_struct_field() { - #[derive(Clone, Decode, Debug, PartialEq, Encode, TypeInfo)] - enum Event { - A(#[codec(compact)] CompactWrapper), - } - - #[derive(Clone, Decode, Debug, PartialEq, codec::CompactAs, Encode, TypeInfo)] - struct CompactWrapper(u64); - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - - // Encode our events in the format we expect back from a node, and - // construct an Events object to iterate them: - let events = events::( - metadata, - vec![event_record( - Phase::Finalization, - Event::A(CompactWrapper(1)), - )], - ); - - // Dynamically decode: - let mut event_details = events.iter(); - assert_raw_events_match( - event_details.next().unwrap().unwrap(), - TestRawEventDetails { - index: 0, - phase: Phase::Finalization, - pallet: "Test".to_string(), - pallet_index: 0, - variant: "A".to_string(), - variant_index: 0, - fields: vec![Value::unnamed_composite(vec![Value::u128(1)])], - }, - ); - assert!(event_details.next().is_none()); - } - - #[test] - fn event_containing_explicit_index() { - #[derive(Clone, Debug, PartialEq, Eq, Decode, 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, Debug, PartialEq, Decode, Encode, TypeInfo)] - enum Event { - A(MyType), - } - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - - // Encode our events in the format we expect back from a node, and - // construct an Events object to iterate them: - let events = events::( - metadata, - vec![event_record(Phase::Finalization, Event::A(MyType::B))], - ); - - // Dynamically decode: - let mut event_details = events.iter(); - assert_raw_events_match( - event_details.next().unwrap().unwrap(), - TestRawEventDetails { - index: 0, - phase: Phase::Finalization, - pallet: "Test".to_string(), - pallet_index: 0, - variant: "A".to_string(), - variant_index: 0, - fields: vec![Value::unnamed_variant("B", vec![])], - }, - ); - assert!(event_details.next().is_none()); - } - - #[test] - fn topics() { - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo, scale_decode::DecodeAsType)] - enum Event { - A(u8, bool, Vec), - } - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - - // Encode our events in the format we expect back from a node, and - // construct an Events object to iterate them: - let event = Event::A(1, true, vec!["Hi".into()]); - let topics = vec![H256::from_low_u64_le(123), H256::from_low_u64_le(456)]; - let events = events::( - metadata, - vec![EventRecord::new( - Phase::ApplyExtrinsic(123), - event, - topics.clone(), - )], - ); - - let ev = events - .iter() - .next() - .expect("one event expected") - .expect("event should be extracted OK"); - - assert_eq!(topics, ev.topics()); - } -} diff --git a/core/src/lib.rs b/core/src/lib.rs deleted file mode 100644 index 9dcecabf4ad..00000000000 --- a/core/src/lib.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # subxt-core -//! -//! A `#[no_std]` compatible subset of the functionality provided in the `subxt` crate. This -//! contains the core logic for encoding and decoding things, but nothing related to networking. -//! -//! Here's an overview of the main things exposed here: -//! -//! - [`blocks`]: decode and explore block bodies. -//! - [`constants`]: access and validate the constant addresses in some metadata. -//! - [`custom_values`]: access and validate the custom value addresses in some metadata. -//! - [`storage`]: construct storage request payloads and decode the results you'd get back. -//! - [`tx`]: construct and sign transactions (extrinsics). -//! - [`runtime_api`]: construct runtime API request payloads and decode the results you'd get back. -//! - [`events`]: decode and explore events. -//! - -#![deny(missing_docs)] -#![cfg_attr(not(feature = "std"), no_std)] -pub extern crate alloc; - -pub mod blocks; -pub mod client; -pub mod config; -pub mod constants; -pub mod custom_values; -pub mod dynamic; -pub mod error; -pub mod events; -pub mod runtime_api; -pub mod storage; -pub mod tx; -pub mod utils; -pub mod view_functions; - -pub use config::Config; -pub use error::Error; -pub use subxt_metadata::Metadata; - -/// Re-exports of some of the key external crates. -pub mod ext { - pub use codec; - pub use scale_decode; - pub use scale_encode; - pub use scale_value; -} diff --git a/core/src/runtime_api/mod.rs b/core/src/runtime_api/mod.rs deleted file mode 100644 index 81390c2db4d..00000000000 --- a/core/src/runtime_api/mod.rs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Encode runtime API payloads, decode the associated values returned from them, and validate -//! static runtime API payloads. -//! -//! # Example -//! -//! ```rust -//! use subxt_macro::subxt; -//! use subxt_core::runtime_api; -//! use subxt_core::Metadata; -//! -//! // If we generate types without `subxt`, we need to point to `::subxt_core`: -//! #[subxt( -//! crate = "::subxt_core", -//! runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale", -//! )] -//! pub mod polkadot {} -//! -//! // Some metadata we'll use to work with storage entries: -//! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); -//! -//! // Build a storage query to access account information. -//! let payload = polkadot::apis().metadata().metadata_versions(); -//! -//! // We can validate that the payload is compatible with the given metadata. -//! runtime_api::validate(&payload, &metadata).unwrap(); -//! -//! // Encode the payload name and arguments to hand to a node: -//! let _call_name = runtime_api::call_name(&payload); -//! let _call_args = runtime_api::call_args(&payload, &metadata).unwrap(); -//! -//! // If we were to obtain a value back from the node, we could -//! // then decode it using the same payload and metadata like so: -//! let value_bytes = hex::decode("080e0000000f000000").unwrap(); -//! let value = runtime_api::decode_value(&mut &*value_bytes, &payload, &metadata).unwrap(); -//! -//! println!("Available metadata versions: {value:?}"); -//! ``` - -pub mod payload; - -use crate::Metadata; -use crate::error::RuntimeApiError; -use alloc::format; -use alloc::string::{String, ToString}; -use alloc::vec::Vec; -use payload::Payload; -use scale_decode::IntoVisitor; - -/// Run the validation logic against some runtime API payload you'd like to use. Returns `Ok(())` -/// if the payload is valid (or if it's not possible to check since the payload has no validation hash). -/// Return an error if the payload was not valid or something went wrong trying to validate it (ie -/// the runtime API in question do not exist at all) -pub fn validate(payload: P, metadata: &Metadata) -> Result<(), RuntimeApiError> { - let Some(hash) = payload.validation_hash() else { - return Ok(()); - }; - - let trait_name = payload.trait_name(); - let method_name = payload.method_name(); - - let api_trait = metadata - .runtime_api_trait_by_name(trait_name) - .ok_or_else(|| RuntimeApiError::TraitNotFound(trait_name.to_string()))?; - let api_method = - api_trait - .method_by_name(method_name) - .ok_or_else(|| RuntimeApiError::MethodNotFound { - trait_name: trait_name.to_string(), - method_name: method_name.to_string(), - })?; - - if hash != api_method.hash() { - Err(RuntimeApiError::IncompatibleCodegen) - } else { - Ok(()) - } -} - -/// Return the name of the runtime API call from the payload. -pub fn call_name(payload: P) -> String { - format!("{}_{}", payload.trait_name(), payload.method_name()) -} - -/// Return the encoded call args given a runtime API payload. -pub fn call_args(payload: P, metadata: &Metadata) -> Result, RuntimeApiError> { - let value = frame_decode::runtime_apis::encode_runtime_api_inputs( - payload.trait_name(), - payload.method_name(), - payload.args(), - metadata, - metadata.types(), - ) - .map_err(RuntimeApiError::CouldNotEncodeInputs)?; - - Ok(value) -} - -/// Decode the value bytes at the location given by the provided runtime API payload. -pub fn decode_value( - bytes: &mut &[u8], - payload: P, - metadata: &Metadata, -) -> Result { - let value = frame_decode::runtime_apis::decode_runtime_api_response( - payload.trait_name(), - payload.method_name(), - bytes, - metadata, - metadata.types(), - P::ReturnType::into_visitor(), - ) - .map_err(RuntimeApiError::CouldNotDecodeResponse)?; - - Ok(value) -} diff --git a/core/src/storage/mod.rs b/core/src/storage/mod.rs deleted file mode 100644 index c694d113582..00000000000 --- a/core/src/storage/mod.rs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Encode storage keys, decode storage values, and validate static storage addresses. -//! -//! # Example -//! -//! ```rust -//! use subxt_signer::sr25519::dev; -//! use subxt_macro::subxt; -//! use subxt_core::storage; -//! use subxt_core::Metadata; -//! -//! // If we generate types without `subxt`, we need to point to `::subxt_core`: -//! #[subxt( -//! crate = "::subxt_core", -//! runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale", -//! )] -//! pub mod polkadot {} -//! -//! // Some metadata we'll use to work with storage entries: -//! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); -//! -//! // Build a storage query to access account information. -//! let address = polkadot::storage().system().account(); -//! -//! // We can validate that the address is compatible with the given metadata. -//! storage::validate(&address, &metadata).unwrap(); -//! -//! // We can fetch details about the storage entry associated with this address: -//! let entry = storage::entry(address, &metadata).unwrap(); -//! -//! // .. including generating a key to fetch the entry with: -//! let fetch_key = entry.fetch_key((dev::alice().public_key().into(),)).unwrap(); -//! -//! // .. or generating a key to iterate over entries with at a given depth: -//! let iter_key = entry.iter_key(()).unwrap(); -//! -//! // Given a value, we can decode it: -//! let value_bytes = hex::decode("00000000000000000100000000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080").unwrap(); -//! let value = entry.value(value_bytes).decode().unwrap(); -//! -//! println!("Alice's account info: {value:?}"); -//! ``` - -mod prefix_of; -mod storage_entry; -mod storage_key; -mod storage_key_value; -mod storage_value; - -pub mod address; - -use crate::{Metadata, error::StorageError}; -use address::Address; -use alloc::string::ToString; - -pub use prefix_of::{EqualOrPrefixOf, PrefixOf}; -pub use storage_entry::{StorageEntry, entry}; -pub use storage_key::{StorageHasher, StorageKey, StorageKeyPart}; -pub use storage_key_value::StorageKeyValue; -pub use storage_value::StorageValue; - -/// When the provided `address` is statically generated via the `#[subxt]` macro, this validates -/// that the shape of the storage value is the same as the shape expected by the static address. -/// -/// When the provided `address` is dynamic (and thus does not come with any expectation of the -/// shape of the constant value), this just returns `Ok(())` -pub fn validate(address: Addr, metadata: &Metadata) -> Result<(), StorageError> { - let Some(hash) = address.validation_hash() else { - return Ok(()); - }; - - let pallet_name = address.pallet_name(); - let entry_name = address.entry_name(); - - let pallet_metadata = metadata - .pallet_by_name(pallet_name) - .ok_or_else(|| StorageError::PalletNameNotFound(pallet_name.to_string()))?; - let storage_hash = pallet_metadata.storage_hash(entry_name).ok_or_else(|| { - StorageError::StorageEntryNotFound { - pallet_name: pallet_name.to_string(), - entry_name: entry_name.to_string(), - } - })?; - - if storage_hash != hash { - Err(StorageError::IncompatibleCodegen) - } else { - Ok(()) - } -} diff --git a/core/src/storage/storage_entry.rs b/core/src/storage/storage_entry.rs deleted file mode 100644 index 0f7efaf6b58..00000000000 --- a/core/src/storage/storage_entry.rs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use super::{PrefixOf, StorageKeyValue, StorageValue, address::Address}; -use crate::error::StorageError; -use crate::utils::YesMaybe; -use alloc::sync::Arc; -use alloc::vec::Vec; -use frame_decode::storage::{IntoEncodableValues, StorageInfo}; -use scale_info::PortableRegistry; -use subxt_metadata::Metadata; - -/// Create a [`StorageEntry`] to work with a given storage entry. -pub fn entry<'info, Addr: Address>( - address: Addr, - metadata: &'info Metadata, -) -> Result, StorageError> { - super::validate(&address, metadata)?; - - use frame_decode::storage::StorageTypeInfo; - let types = metadata.types(); - let info = metadata - .storage_info(address.pallet_name(), address.entry_name()) - .map_err(|e| StorageError::StorageInfoError(e.into_owned()))?; - - Ok(StorageEntry(Arc::new(StorageEntryInner { - address, - info: Arc::new(info), - types, - }))) -} - -/// This represents a single storage entry (be it a plain value or map). -pub struct StorageEntry<'info, Addr>(Arc>); - -impl<'info, Addr> Clone for StorageEntry<'info, Addr> { - fn clone(&self) -> Self { - Self(self.0.clone()) - } -} - -struct StorageEntryInner<'info, Addr> { - address: Addr, - info: Arc>, - types: &'info PortableRegistry, -} - -impl<'info, Addr: Address> StorageEntry<'info, Addr> { - /// Name of the pallet containing this storage entry. - pub fn pallet_name(&self) -> &str { - self.0.address.pallet_name() - } - - /// Name of the storage entry. - pub fn entry_name(&self) -> &str { - self.0.address.entry_name() - } - - /// Is the storage entry a plain value? - pub fn is_plain(&self) -> bool { - self.0.info.keys.is_empty() - } - - /// Is the storage entry a map? - pub fn is_map(&self) -> bool { - !self.is_plain() - } - - /// Instantiate a [`StorageKeyValue`] for this entry. - /// - /// It is expected that the bytes are obtained by iterating key/value pairs at this address. - pub fn key_value( - &self, - key_bytes: impl Into>, - value_bytes: Vec, - ) -> StorageKeyValue<'info, Addr> { - StorageKeyValue::new( - self.0.info.clone(), - self.0.types, - key_bytes.into(), - value_bytes, - ) - } - - /// Instantiate a [`StorageValue`] for this entry. - /// - /// It is expected that the bytes are obtained by fetching a value at this address. - pub fn value(&self, bytes: Vec) -> StorageValue<'info, Addr::Value> { - StorageValue::new(self.0.info.clone(), self.0.types, bytes) - } - - /// Return the default [`StorageValue`] for this storage entry, if there is one. - pub fn default_value(&self) -> Option> { - self.0.info.default_value.as_deref().map(|default_bytes| { - StorageValue::new(self.0.info.clone(), self.0.types, default_bytes.to_vec()) - }) - } - - /// The keys for plain storage values are always 32 byte hashes. - pub fn key_prefix(&self) -> [u8; 32] { - frame_decode::storage::encode_storage_key_prefix( - self.0.address.pallet_name(), - self.0.address.entry_name(), - ) - } - - // This has a less "strict" type signature and so is just used under the hood. - fn key(&self, key_parts: Keys) -> Result, StorageError> { - let key = frame_decode::storage::encode_storage_key_with_info( - self.0.address.pallet_name(), - self.0.address.entry_name(), - key_parts, - &self.0.info, - self.0.types, - ) - .map_err(StorageError::StorageKeyEncodeError)?; - - Ok(key) - } - - /// This constructs a key suitable for fetching a value at the given map storage address. This will error - /// if we can see that the wrong number of key parts are provided. - pub fn fetch_key(&self, key_parts: Addr::KeyParts) -> Result, StorageError> { - if key_parts.num_encodable_values() != self.0.info.keys.len() { - Err(StorageError::WrongNumberOfKeyPartsProvidedForFetching { - expected: self.0.info.keys.len(), - got: key_parts.num_encodable_values(), - }) - } else { - self.key(key_parts) - } - } - - /// This constructs a key suitable for iterating at the given storage address. This will error - /// if we can see that too many key parts are provided. - pub fn iter_key>( - &self, - key_parts: Keys, - ) -> Result, StorageError> { - if Addr::IsPlain::is_yes() { - Err(StorageError::CannotIterPlainEntry { - pallet_name: self.0.address.pallet_name().into(), - entry_name: self.0.address.entry_name().into(), - }) - } else if key_parts.num_encodable_values() >= self.0.info.keys.len() { - Err(StorageError::WrongNumberOfKeyPartsProvidedForIterating { - max_expected: self.0.info.keys.len() - 1, - got: key_parts.num_encodable_values(), - }) - } else { - self.key(key_parts) - } - } -} diff --git a/core/src/tx/mod.rs b/core/src/tx/mod.rs deleted file mode 100644 index 3eb6a29617b..00000000000 --- a/core/src/tx/mod.rs +++ /dev/null @@ -1,458 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Construct and sign transactions. -//! -//! # Example -//! -//! ```rust -//! use subxt_signer::sr25519::dev; -//! use subxt_macro::subxt; -//! use subxt_core::config::{PolkadotConfig, HashFor}; -//! use subxt_core::config::DefaultExtrinsicParamsBuilder as Params; -//! use subxt_core::tx; -//! use subxt_core::utils::H256; -//! use subxt_core::Metadata; -//! -//! // If we generate types without `subxt`, we need to point to `::subxt_core`: -//! #[subxt( -//! crate = "::subxt_core", -//! runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale", -//! )] -//! pub mod polkadot {} -//! -//! // Gather some other information about the chain that we'll need to construct valid extrinsics: -//! let state = tx::ClientState:: { -//! metadata: { -//! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! Metadata::decode_from(&metadata_bytes[..]).unwrap() -//! }, -//! genesis_hash: { -//! let h = "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"; -//! let bytes = hex::decode(h).unwrap(); -//! H256::from_slice(&bytes) -//! }, -//! runtime_version: tx::RuntimeVersion { -//! spec_version: 9370, -//! transaction_version: 20, -//! } -//! }; -//! -//! // Now we can build a balance transfer extrinsic. -//! let dest = dev::bob().public_key().into(); -//! let call = polkadot::tx().balances().transfer_allow_death(dest, 10_000); -//! let params = Params::new().tip(1_000).nonce(0).build(); -//! -//! // We can validate that this lines up with the given metadata: -//! tx::validate(&call, &state.metadata).unwrap(); -//! -//! // We can build a signed transaction: -//! let signed_call = tx::create_v4_signed(&call, &state, params) -//! .unwrap() -//! .sign(&dev::alice()); -//! -//! // And log it: -//! println!("Tx: 0x{}", hex::encode(signed_call.encoded())); -//! ``` - -pub mod payload; -pub mod signer; - -use crate::Metadata; -use crate::config::{Config, ExtrinsicParams, ExtrinsicParamsEncoder, HashFor, Hasher}; -use crate::error::ExtrinsicError; -use crate::utils::Encoded; -use alloc::borrow::Cow; -use alloc::string::ToString; -use alloc::vec::Vec; -use codec::{Compact, Encode}; -use payload::Payload; -use signer::Signer as SignerT; -use sp_crypto_hashing::blake2_256; - -// Expose these here since we expect them in some calls below. -pub use crate::client::{ClientState, RuntimeVersion}; - -/// Run the validation logic against some extrinsic you'd like to submit. Returns `Ok(())` -/// if the call is valid (or if it's not possible to check since the call has no validation hash). -/// Return an error if the call was not valid or something went wrong trying to validate it (ie -/// the pallet or call in question do not exist at all). -pub fn validate(call: &Call, metadata: &Metadata) -> Result<(), ExtrinsicError> { - let Some(details) = call.validation_details() else { - return Ok(()); - }; - - let pallet_name = details.pallet_name; - let call_name = details.call_name; - - let expected_hash = metadata - .pallet_by_name(pallet_name) - .ok_or_else(|| ExtrinsicError::PalletNameNotFound(pallet_name.to_string()))? - .call_hash(call_name) - .ok_or_else(|| ExtrinsicError::CallNameNotFound { - pallet_name: pallet_name.to_string(), - call_name: call_name.to_string(), - })?; - - if details.hash != expected_hash { - Err(ExtrinsicError::IncompatibleCodegen) - } else { - Ok(()) - } -} - -/// Returns the suggested transaction versions to build for a given chain, or an error -/// if Subxt doesn't support any version expected by the chain. -/// -/// If the result is [`TransactionVersion::V4`], use the `v4` methods in this module. If it's -/// [`TransactionVersion::V5`], use the `v5` ones. -pub fn suggested_version(metadata: &Metadata) -> Result { - let versions = metadata.extrinsic().supported_versions(); - - if versions.contains(&4) { - Ok(TransactionVersion::V4) - } else if versions.contains(&5) { - Ok(TransactionVersion::V5) - } else { - Err(ExtrinsicError::UnsupportedVersion) - } -} - -/// The transaction versions supported by Subxt. -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] -pub enum TransactionVersion { - /// v4 transactions (signed and unsigned transactions) - V4, - /// v5 transactions (bare and general transactions) - V5, -} - -/// Return the SCALE encoded bytes representing the call data of the transaction. -pub fn call_data( - call: &Call, - metadata: &Metadata, -) -> Result, ExtrinsicError> { - let mut bytes = Vec::new(); - call.encode_call_data_to(metadata, &mut bytes)?; - Ok(bytes) -} - -/// Creates a V4 "unsigned" transaction without submitting it. -pub fn create_v4_unsigned( - call: &Call, - metadata: &Metadata, -) -> Result, ExtrinsicError> { - create_unsigned_at_version(call, 4, metadata) -} - -/// Creates a V5 "bare" transaction without submitting it. -pub fn create_v5_bare( - call: &Call, - metadata: &Metadata, -) -> Result, ExtrinsicError> { - create_unsigned_at_version(call, 5, metadata) -} - -// Create a V4 "unsigned" transaction or V5 "bare" transaction. -fn create_unsigned_at_version( - call: &Call, - tx_version: u8, - metadata: &Metadata, -) -> Result, ExtrinsicError> { - // 1. Validate this call against the current node metadata if the call comes - // with a hash allowing us to do so. - validate(call, metadata)?; - - // 2. Encode extrinsic - let extrinsic = { - let mut encoded_inner = Vec::new(); - // encode the transaction version first. - tx_version.encode_to(&mut encoded_inner); - // encode call data after this byte. - call.encode_call_data_to(metadata, &mut encoded_inner)?; - // now, prefix byte length: - let len = Compact( - u32::try_from(encoded_inner.len()).expect("extrinsic size expected to be <4GB"), - ); - let mut encoded = Vec::new(); - len.encode_to(&mut encoded); - encoded.extend(encoded_inner); - encoded - }; - - // Wrap in Encoded to ensure that any more "encode" calls leave it in the right state. - Ok(Transaction::from_bytes(extrinsic)) -} - -/// Construct a v4 extrinsic, ready to be signed. -pub fn create_v4_signed( - call: &Call, - client_state: &ClientState, - params: >::Params, -) -> Result, ExtrinsicError> { - // 1. Validate this call against the current node metadata if the call comes - // with a hash allowing us to do so. - validate(call, &client_state.metadata)?; - - // 2. SCALE encode call data to bytes (pallet u8, call u8, call params). - let call_data = call_data(call, &client_state.metadata)?; - - // 3. Construct our custom additional/extra params. - let additional_and_extra_params = - >::new(client_state, params)?; - - // Return these details, ready to construct a signed extrinsic from. - Ok(PartialTransactionV4 { - call_data, - additional_and_extra_params, - }) -} - -/// Construct a v5 "general" extrinsic, ready to be signed or emitted as is. -pub fn create_v5_general( - call: &Call, - client_state: &ClientState, - params: >::Params, -) -> Result, ExtrinsicError> { - // 1. Validate this call against the current node metadata if the call comes - // with a hash allowing us to do so. - validate(call, &client_state.metadata)?; - - // 2. Work out which TX extension version to target based on metadata. - let tx_extensions_version = client_state - .metadata - .extrinsic() - .transaction_extension_version_to_use_for_encoding(); - - // 3. SCALE encode call data to bytes (pallet u8, call u8, call params). - let call_data = call_data(call, &client_state.metadata)?; - - // 4. Construct our custom additional/extra params. - let additional_and_extra_params = - >::new(client_state, params)?; - - // Return these details, ready to construct a signed extrinsic from. - Ok(PartialTransactionV5 { - call_data, - additional_and_extra_params, - tx_extensions_version, - }) -} - -/// A partially constructed V4 extrinsic, ready to be signed. -pub struct PartialTransactionV4 { - call_data: Vec, - additional_and_extra_params: T::ExtrinsicParams, -} - -impl PartialTransactionV4 { - /// Return the bytes representing the call data for this partially constructed - /// extrinsic. - pub fn call_data(&self) -> &[u8] { - &self.call_data - } - - // Obtain bytes representing the signer payload and run call some function - // with them. This can avoid an allocation in some cases. - fn with_signer_payload(&self, f: F) -> R - where - F: for<'a> FnOnce(Cow<'a, [u8]>) -> R, - { - let mut bytes = self.call_data.clone(); - self.additional_and_extra_params - .encode_signer_payload_value_to(&mut bytes); - self.additional_and_extra_params - .encode_implicit_to(&mut bytes); - - if bytes.len() > 256 { - f(Cow::Borrowed(&blake2_256(&bytes))) - } else { - f(Cow::Owned(bytes)) - } - } - - /// Return the V4 signer payload for this extrinsic. These are the bytes that must - /// be signed in order to produce a valid signature for the extrinsic. - pub fn signer_payload(&self) -> Vec { - self.with_signer_payload(|bytes| bytes.to_vec()) - } - - /// Convert this [`PartialTransactionV4`] into a V4 signed [`Transaction`], ready to submit. - /// The provided `signer` is responsible for providing the "from" address for the transaction, - /// as well as providing a signature to attach to it. - pub fn sign(&self, signer: &Signer) -> Transaction - where - Signer: SignerT, - { - // Given our signer, we can sign the payload representing this extrinsic. - let signature = self.with_signer_payload(|bytes| signer.sign(&bytes)); - // Now, use the signature and "from" address to build the extrinsic. - self.sign_with_account_and_signature(signer.account_id(), &signature) - } - - /// Convert this [`PartialTransactionV4`] into a V4 signed [`Transaction`], ready to submit. - /// The provided `address` and `signature` will be used. - pub fn sign_with_account_and_signature( - &self, - account_id: T::AccountId, - signature: &T::Signature, - ) -> Transaction { - let extrinsic = { - let mut encoded_inner = Vec::new(); - // "is signed" + transaction protocol version (4) - (0b10000000 + 4u8).encode_to(&mut encoded_inner); - // from address for signature - let address: T::Address = account_id.into(); - address.encode_to(&mut encoded_inner); - // the signature - signature.encode_to(&mut encoded_inner); - // attach custom extra params - self.additional_and_extra_params - .encode_value_to(&mut encoded_inner); - // and now, call data (remembering that it's been encoded already and just needs appending) - encoded_inner.extend(&self.call_data); - // now, prefix byte length: - let len = Compact( - u32::try_from(encoded_inner.len()).expect("extrinsic size expected to be <4GB"), - ); - let mut encoded = Vec::new(); - len.encode_to(&mut encoded); - encoded.extend(encoded_inner); - encoded - }; - - // Return an extrinsic ready to be submitted. - Transaction::from_bytes(extrinsic) - } -} - -/// A partially constructed V5 general extrinsic, ready to be signed or emitted as-is. -pub struct PartialTransactionV5 { - call_data: Vec, - additional_and_extra_params: T::ExtrinsicParams, - tx_extensions_version: u8, -} - -impl PartialTransactionV5 { - /// Return the bytes representing the call data for this partially constructed - /// extrinsic. - pub fn call_data(&self) -> &[u8] { - &self.call_data - } - - /// Return the V5 signer payload for this extrinsic. These are the bytes that must - /// be signed in order to produce a valid signature for the extrinsic. - pub fn signer_payload(&self) -> [u8; 32] { - let mut bytes = self.call_data.clone(); - - self.additional_and_extra_params - .encode_signer_payload_value_to(&mut bytes); - self.additional_and_extra_params - .encode_implicit_to(&mut bytes); - - blake2_256(&bytes) - } - - /// Convert this [`PartialTransactionV5`] into a V5 "general" [`Transaction`]. - /// - /// This transaction has not been explicitly signed. Use [`Self::sign`] - /// or [`Self::sign_with_account_and_signature`] if you wish to provide a - /// signature (this is usually a necessary step). - pub fn to_transaction(&self) -> Transaction { - let extrinsic = { - let mut encoded_inner = Vec::new(); - // "is general" + transaction protocol version (5) - (0b01000000 + 5u8).encode_to(&mut encoded_inner); - // Encode versions for the transaction extensions - self.tx_extensions_version.encode_to(&mut encoded_inner); - // Encode the actual transaction extensions values - self.additional_and_extra_params - .encode_value_to(&mut encoded_inner); - // and now, call data (remembering that it's been encoded already and just needs appending) - encoded_inner.extend(&self.call_data); - // now, prefix byte length: - let len = Compact( - u32::try_from(encoded_inner.len()).expect("extrinsic size expected to be <4GB"), - ); - let mut encoded = Vec::new(); - len.encode_to(&mut encoded); - encoded.extend(encoded_inner); - encoded - }; - - // Return an extrinsic ready to be submitted. - Transaction::from_bytes(extrinsic) - } - - /// Convert this [`PartialTransactionV5`] into a V5 "general" [`Transaction`] with a signature. - /// - /// Signing the transaction injects the signature into the transaction extension data, which is why - /// this method borrows self mutably. Signing repeatedly will override the previous signature. - pub fn sign(&mut self, signer: &Signer) -> Transaction - where - Signer: SignerT, - { - // Given our signer, we can sign the payload representing this extrinsic. - let signature = signer.sign(&self.signer_payload()); - // Now, use the signature and "from" account to build the extrinsic. - self.sign_with_account_and_signature(&signer.account_id(), &signature) - } - - /// Convert this [`PartialTransactionV5`] into a V5 "general" [`Transaction`] with a signature. - /// Prefer [`Self::sign`] if you have a [`SignerT`] instance to use. - /// - /// Signing the transaction injects the signature into the transaction extension data, which is why - /// this method borrows self mutably. Signing repeatedly will override the previous signature. - pub fn sign_with_account_and_signature( - &mut self, - account_id: &T::AccountId, - signature: &T::Signature, - ) -> Transaction { - // Inject the signature into the transaction extensions - // before constructing it. - self.additional_and_extra_params - .inject_signature(account_id, signature); - - self.to_transaction() - } -} - -/// This represents a signed transaction that's ready to be submitted. -/// Use [`Transaction::encoded()`] or [`Transaction::into_encoded()`] to -/// get the bytes for it, or [`Transaction::hash_with()`] to hash the transaction -/// given an instance of [`Config::Hasher`]. -pub struct Transaction { - encoded: Encoded, - marker: core::marker::PhantomData, -} - -impl Transaction { - /// Create a [`Transaction`] from some already-signed and prepared - /// extrinsic bytes, - pub fn from_bytes(tx_bytes: Vec) -> Self { - Self { - encoded: Encoded(tx_bytes), - marker: core::marker::PhantomData, - } - } - - /// Calculate and return the hash of the extrinsic, based on the provided hasher. - /// If you don't have a hasher to hand, you can construct one using the metadata - /// with `T::Hasher::new(&metadata)`. This will create a hasher suitable for the - /// current chain where possible. - pub fn hash_with(&self, hasher: T::Hasher) -> HashFor { - hasher.hash_of(&self.encoded) - } - - /// Returns the SCALE encoded extrinsic bytes. - pub fn encoded(&self) -> &[u8] { - &self.encoded.0 - } - - /// Consumes this [`Transaction`] and returns the SCALE encoded - /// extrinsic bytes. - pub fn into_encoded(self) -> Vec { - self.encoded.0 - } -} diff --git a/core/src/view_functions/mod.rs b/core/src/view_functions/mod.rs deleted file mode 100644 index 9238331320f..00000000000 --- a/core/src/view_functions/mod.rs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Encode View Function payloads, decode the associated values returned from them, and validate -//! static View Function payloads. - -pub mod payload; - -use crate::Metadata; -use crate::error::ViewFunctionError; -use alloc::string::ToString; -use alloc::vec::Vec; -use payload::Payload; -use scale_decode::IntoVisitor; - -/// Run the validation logic against some View Function payload you'd like to use. Returns `Ok(())` -/// if the payload is valid (or if it's not possible to check since the payload has no validation hash). -/// Return an error if the payload was not valid or something went wrong trying to validate it (ie -/// the View Function in question do not exist at all) -pub fn validate(payload: P, metadata: &Metadata) -> Result<(), ViewFunctionError> { - let Some(hash) = payload.validation_hash() else { - return Ok(()); - }; - - let pallet_name = payload.pallet_name(); - let function_name = payload.function_name(); - - let view_function = metadata - .pallet_by_name(pallet_name) - .ok_or_else(|| ViewFunctionError::PalletNotFound(pallet_name.to_string()))? - .view_function_by_name(function_name) - .ok_or_else(|| ViewFunctionError::ViewFunctionNotFound { - pallet_name: pallet_name.to_string(), - function_name: function_name.to_string(), - })?; - - if hash != view_function.hash() { - Err(ViewFunctionError::IncompatibleCodegen) - } else { - Ok(()) - } -} - -/// The name of the Runtime API call which can execute -pub const CALL_NAME: &str = "RuntimeViewFunction_execute_view_function"; - -/// Encode the bytes that will be passed to the "execute_view_function" Runtime API call, -/// to execute the View Function represented by the given payload. -pub fn call_args( - payload: P, - metadata: &Metadata, -) -> Result, ViewFunctionError> { - let inputs = frame_decode::view_functions::encode_view_function_inputs( - payload.pallet_name(), - payload.function_name(), - payload.args(), - metadata, - metadata.types(), - ) - .map_err(ViewFunctionError::CouldNotEncodeInputs)?; - - Ok(inputs) -} - -/// Decode the value bytes at the location given by the provided View Function payload. -pub fn decode_value( - bytes: &mut &[u8], - payload: P, - metadata: &Metadata, -) -> Result { - let value = frame_decode::view_functions::decode_view_function_response( - payload.pallet_name(), - payload.function_name(), - bytes, - metadata, - metadata.types(), - P::ReturnType::into_visitor(), - ) - .map_err(ViewFunctionError::CouldNotDecodeResponse)?; - - Ok(value) -} diff --git a/examples/ffi-example/Cargo.lock b/examples/ffi-example/Cargo.lock index af3fd250d26..580621258aa 100644 --- a/examples/ffi-example/Cargo.lock +++ b/examples/ffi-example/Cargo.lock @@ -872,6 +872,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -883,16 +889,18 @@ dependencies = [ [[package]] name = "frame-decode" -version = "0.11.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0acacffe60911b0d57a55c0b323fc08ccd88659dc52056bb39dfeb5cedafb59" +checksum = "e63257bb5f8d7a707d626aa1b4e464c3b9720edd168b73cee98f48f0dd6386e4" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-decode", "scale-encode", "scale-info", + "scale-info-legacy", "scale-type-resolver", + "serde_yaml", "sp-crypto-hashing", "thiserror 2.0.12", ] @@ -1067,8 +1075,21 @@ checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.1.5", + "serde", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", "serde", + "serde_core", ] [[package]] @@ -2196,9 +2217,9 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d78196772d25b90a98046794ce0fe2588b39ebdfbdc1e45b4c6c85dd43bebad" +checksum = "8d6ed61699ad4d54101ab5a817169259b5b0efc08152f8632e61482d8a27ca3d" dependencies = [ "parity-scale-codec", "primitive-types", @@ -2211,9 +2232,9 @@ dependencies = [ [[package]] name = "scale-decode-derive" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4b54a1211260718b92832b661025d1f1a4b6930fbadd6908e00edd265fa5f7" +checksum = "65cb245f7fdb489e7ba43a616cbd34427fe3ba6fe0edc1d0d250085e6c84f3ec" dependencies = [ "darling", "proc-macro2", @@ -2223,9 +2244,9 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64901733157f9d25ef86843bd783eda439fac7efb0ad5a615d12d2cf3a29464b" +checksum = "f2a976d73564a59e482b74fd5d95f7518b79ca8c8ca5865398a4d629dd15ee50" dependencies = [ "parity-scale-codec", "primitive-types", @@ -2238,9 +2259,9 @@ dependencies = [ [[package]] name = "scale-encode-derive" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78a3993a13b4eafa89350604672c8757b7ea84c7c5947d4b3691e3169c96379b" +checksum = "17020f2d59baabf2ddcdc20a4e567f8210baf089b8a8d4785f5fd5e716f92038" dependencies = [ "darling", "proc-macro-crate", @@ -2275,6 +2296,21 @@ dependencies = [ "syn", ] +[[package]] +name = "scale-info-legacy" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afb76e1b2cb589b97278e2f1e2e290c9b7c51d6ac69afab9e1d7d1e136a9276" +dependencies = [ + "hashbrown 0.16.1", + "scale-type-resolver", + "serde", + "smallstr", + "smallvec", + "thiserror 2.0.12", + "yap", +] + [[package]] name = "scale-type-resolver" version = "0.2.0" @@ -2287,9 +2323,9 @@ dependencies = [ [[package]] name = "scale-typegen" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05c61b6b706a3eaad63b506ab50a1d2319f817ae01cf753adcc3f055f9f0fcd6" +checksum = "642d2f13f3fc9a34ea2c1e36142984eba78cd2405a61632492f8b52993e98879" dependencies = [ "proc-macro2", "quote", @@ -2423,10 +2459,11 @@ checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ + "serde_core", "serde_derive", ] @@ -2439,11 +2476,20 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -2462,6 +2508,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sha1" version = "0.10.6" @@ -2540,6 +2599,15 @@ version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" +[[package]] +name = "smallstr" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862077b1e764f04c251fe82a2ef562fd78d7cadaeb072ca7c2bcaf7217b1ff3b" +dependencies = [ + "smallvec", +] + [[package]] name = "smallvec" version = "1.15.1" @@ -2734,42 +2802,46 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subxt" -version = "0.44.0" +version = "0.50.0" dependencies = [ "async-trait", "derive-where", "either", + "frame-decode", "frame-metadata", "futures", "hex", + "impl-serde", "jsonrpsee", + "keccak-hash", "parity-scale-codec", "primitive-types", "scale-bits", "scale-decode", "scale-encode", "scale-info", + "scale-info-legacy", + "scale-type-resolver", "scale-value", "serde", "serde_json", "sp-crypto-hashing", - "subxt-core", "subxt-lightclient", "subxt-macro", "subxt-metadata", "subxt-rpcs", + "subxt-utils-accountid32", "thiserror 2.0.12", "tokio", "tokio-util", "tracing", - "url", "wasm-bindgen-futures", "web-time", ] [[package]] name = "subxt-codegen" -version = "0.44.0" +version = "0.50.0" dependencies = [ "heck", "parity-scale-codec", @@ -2782,34 +2854,6 @@ dependencies = [ "thiserror 2.0.12", ] -[[package]] -name = "subxt-core" -version = "0.44.0" -dependencies = [ - "base58", - "blake2", - "derive-where", - "frame-decode", - "frame-metadata", - "hashbrown 0.14.5", - "hex", - "impl-serde", - "keccak-hash", - "parity-scale-codec", - "primitive-types", - "scale-bits", - "scale-decode", - "scale-encode", - "scale-info", - "scale-value", - "serde", - "serde_json", - "sp-crypto-hashing", - "subxt-metadata", - "thiserror 2.0.12", - "tracing", -] - [[package]] name = "subxt-ffi" version = "0.1.0" @@ -2822,7 +2866,7 @@ dependencies = [ [[package]] name = "subxt-lightclient" -version = "0.44.0" +version = "0.50.0" dependencies = [ "futures", "futures-util", @@ -2837,7 +2881,7 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.44.0" +version = "0.50.0" dependencies = [ "darling", "parity-scale-codec", @@ -2852,20 +2896,22 @@ dependencies = [ [[package]] name = "subxt-metadata" -version = "0.44.0" +version = "0.50.0" dependencies = [ "frame-decode", "frame-metadata", "hashbrown 0.14.5", "parity-scale-codec", "scale-info", + "scale-info-legacy", + "scale-type-resolver", "sp-crypto-hashing", "thiserror 2.0.12", ] [[package]] name = "subxt-rpcs" -version = "0.44.0" +version = "0.50.0" dependencies = [ "derive-where", "frame-metadata", @@ -2877,7 +2923,6 @@ dependencies = [ "primitive-types", "serde", "serde_json", - "subxt-core", "subxt-lightclient", "thiserror 2.0.12", "tokio-util", @@ -2887,7 +2932,7 @@ dependencies = [ [[package]] name = "subxt-signer" -version = "0.44.0" +version = "0.50.0" dependencies = [ "base64", "bip39", @@ -2906,14 +2951,28 @@ dependencies = [ "serde_json", "sha2 0.10.9", "sp-crypto-hashing", - "subxt-core", + "subxt", "thiserror 2.0.12", "zeroize", ] +[[package]] +name = "subxt-utils-accountid32" +version = "0.50.0" +dependencies = [ + "base58", + "blake2", + "parity-scale-codec", + "scale-decode", + "scale-encode", + "scale-info", + "serde", + "thiserror 2.0.12", +] + [[package]] name = "subxt-utils-fetchmetadata" -version = "0.44.0" +version = "0.50.0" dependencies = [ "hex", "parity-scale-codec", @@ -3209,6 +3268,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "untrusted" version = "0.9.0" diff --git a/examples/ffi-example/Cargo.toml b/examples/ffi-example/Cargo.toml index 91f0bc95afa..885e307bd35 100644 --- a/examples/ffi-example/Cargo.toml +++ b/examples/ffi-example/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] hex = "0.4.3" subxt = { path = "../../subxt" } -subxt-signer = { path = "../../signer" } +subxt-signer = { path = "../../signer", features = ["subxt"] } tokio = { version = "1", features = ["full"] } [lib] diff --git a/examples/ffi-example/src/lib.rs b/examples/ffi-example/src/lib.rs index 8c63a42312b..ee92bb255cc 100644 --- a/examples/ffi-example/src/lib.rs +++ b/examples/ffi-example/src/lib.rs @@ -35,7 +35,8 @@ pub extern "C" fn do_transfer(dest_hex: *const c_char, amount: u64) -> i32 { // Spin up (or reuse) our Tokio runtime and connect: let client = tokio_rt().block_on(async { - OnlineClient::::from_url("ws://127.0.0.1:8000") + let config = PolkadotConfig::new(); + OnlineClient::from_url(config, "ws://127.0.0.1:8000") .await .unwrap() }); @@ -54,11 +55,13 @@ pub extern "C" fn do_transfer(dest_hex: *const c_char, amount: u64) -> i32 { // Submit and wait for finalize let res: Result<(), subxt::Error> = tokio_rt().block_on(async { - let progress = client + client .tx() + .await? .sign_and_submit_then_watch_default(&tx, &signer) + .await? + .wait_for_finalized_success() .await?; - progress.wait_for_finalized_success().await?; Ok(()) }); diff --git a/examples/parachain-example/Cargo.lock b/examples/parachain-example/Cargo.lock index d133fde63b1..48dfd9a6e40 100644 --- a/examples/parachain-example/Cargo.lock +++ b/examples/parachain-example/Cargo.lock @@ -928,6 +928,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -939,16 +945,18 @@ dependencies = [ [[package]] name = "frame-decode" -version = "0.11.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0acacffe60911b0d57a55c0b323fc08ccd88659dc52056bb39dfeb5cedafb59" +checksum = "e63257bb5f8d7a707d626aa1b4e464c3b9720edd168b73cee98f48f0dd6386e4" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-decode", "scale-encode", "scale-info", + "scale-info-legacy", "scale-type-resolver", + "serde_yaml", "sp-crypto-hashing", "thiserror 2.0.11", ] @@ -1123,10 +1131,23 @@ checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.1.5", "serde", ] +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", + "serde", + "serde_core", +] + [[package]] name = "heck" version = "0.5.0" @@ -2272,9 +2293,9 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d78196772d25b90a98046794ce0fe2588b39ebdfbdc1e45b4c6c85dd43bebad" +checksum = "8d6ed61699ad4d54101ab5a817169259b5b0efc08152f8632e61482d8a27ca3d" dependencies = [ "parity-scale-codec", "primitive-types", @@ -2287,9 +2308,9 @@ dependencies = [ [[package]] name = "scale-decode-derive" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4b54a1211260718b92832b661025d1f1a4b6930fbadd6908e00edd265fa5f7" +checksum = "65cb245f7fdb489e7ba43a616cbd34427fe3ba6fe0edc1d0d250085e6c84f3ec" dependencies = [ "darling", "proc-macro2", @@ -2299,9 +2320,9 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64901733157f9d25ef86843bd783eda439fac7efb0ad5a615d12d2cf3a29464b" +checksum = "f2a976d73564a59e482b74fd5d95f7518b79ca8c8ca5865398a4d629dd15ee50" dependencies = [ "parity-scale-codec", "primitive-types", @@ -2351,6 +2372,21 @@ dependencies = [ "syn", ] +[[package]] +name = "scale-info-legacy" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afb76e1b2cb589b97278e2f1e2e290c9b7c51d6ac69afab9e1d7d1e136a9276" +dependencies = [ + "hashbrown 0.16.1", + "scale-type-resolver", + "serde", + "smallstr", + "smallvec", + "thiserror 2.0.11", + "yap", +] + [[package]] name = "scale-type-resolver" version = "0.2.0" @@ -2363,9 +2399,9 @@ dependencies = [ [[package]] name = "scale-typegen" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05c61b6b706a3eaad63b506ab50a1d2319f817ae01cf753adcc3f055f9f0fcd6" +checksum = "642d2f13f3fc9a34ea2c1e36142984eba78cd2405a61632492f8b52993e98879" dependencies = [ "proc-macro2", "quote", @@ -2500,10 +2536,11 @@ checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ + "serde_core", "serde_derive", ] @@ -2516,11 +2553,20 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -2539,6 +2585,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sha1" version = "0.10.6" @@ -2620,6 +2679,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "smallstr" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862077b1e764f04c251fe82a2ef562fd78d7cadaeb072ca7c2bcaf7217b1ff3b" +dependencies = [ + "smallvec", +] + [[package]] name = "smallvec" version = "1.13.2" @@ -2814,42 +2882,46 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subxt" -version = "0.44.0" +version = "0.50.0" dependencies = [ "async-trait", "derive-where", "either", + "frame-decode", "frame-metadata", "futures", "hex", + "impl-serde", "jsonrpsee", + "keccak-hash", "parity-scale-codec", "primitive-types", "scale-bits", "scale-decode", "scale-encode", "scale-info", + "scale-info-legacy", + "scale-type-resolver", "scale-value", "serde", "serde_json", "sp-crypto-hashing", - "subxt-core", "subxt-lightclient", "subxt-macro", "subxt-metadata", "subxt-rpcs", + "subxt-utils-accountid32", "thiserror 2.0.11", "tokio", "tokio-util", "tracing", - "url", "wasm-bindgen-futures", "web-time", ] [[package]] name = "subxt-codegen" -version = "0.44.0" +version = "0.50.0" dependencies = [ "heck", "parity-scale-codec", @@ -2862,37 +2934,9 @@ dependencies = [ "thiserror 2.0.11", ] -[[package]] -name = "subxt-core" -version = "0.44.0" -dependencies = [ - "base58", - "blake2", - "derive-where", - "frame-decode", - "frame-metadata", - "hashbrown 0.14.5", - "hex", - "impl-serde", - "keccak-hash", - "parity-scale-codec", - "primitive-types", - "scale-bits", - "scale-decode", - "scale-encode", - "scale-info", - "scale-value", - "serde", - "serde_json", - "sp-crypto-hashing", - "subxt-metadata", - "thiserror 2.0.11", - "tracing", -] - [[package]] name = "subxt-lightclient" -version = "0.44.0" +version = "0.50.0" dependencies = [ "futures", "futures-util", @@ -2907,7 +2951,7 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.44.0" +version = "0.50.0" dependencies = [ "darling", "parity-scale-codec", @@ -2922,20 +2966,22 @@ dependencies = [ [[package]] name = "subxt-metadata" -version = "0.44.0" +version = "0.50.0" dependencies = [ "frame-decode", "frame-metadata", "hashbrown 0.14.5", "parity-scale-codec", "scale-info", + "scale-info-legacy", + "scale-type-resolver", "sp-crypto-hashing", "thiserror 2.0.11", ] [[package]] name = "subxt-rpcs" -version = "0.44.0" +version = "0.50.0" dependencies = [ "derive-where", "frame-metadata", @@ -2947,7 +2993,6 @@ dependencies = [ "primitive-types", "serde", "serde_json", - "subxt-core", "subxt-lightclient", "thiserror 2.0.11", "tokio-util", @@ -2957,7 +3002,7 @@ dependencies = [ [[package]] name = "subxt-signer" -version = "0.44.0" +version = "0.50.0" dependencies = [ "base64 0.22.1", "bip39", @@ -2976,14 +3021,28 @@ dependencies = [ "serde_json", "sha2 0.10.8", "sp-crypto-hashing", - "subxt-core", + "subxt", "thiserror 2.0.11", "zeroize", ] +[[package]] +name = "subxt-utils-accountid32" +version = "0.50.0" +dependencies = [ + "base58", + "blake2", + "parity-scale-codec", + "scale-decode", + "scale-encode", + "scale-info", + "serde", + "thiserror 2.0.11", +] + [[package]] name = "subxt-utils-fetchmetadata" -version = "0.44.0" +version = "0.50.0" dependencies = [ "hex", "parity-scale-codec", @@ -3274,6 +3333,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "untrusted" version = "0.9.0" diff --git a/examples/parachain-example/Cargo.toml b/examples/parachain-example/Cargo.toml index 906692618f0..e78db436ee6 100644 --- a/examples/parachain-example/Cargo.toml +++ b/examples/parachain-example/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [dependencies] subxt = { path = "../../subxt" } -subxt-signer = { path = "../../signer" } +subxt-signer = { path = "../../signer", features = ["subxt"] } tokio = { version = "1.44.2", features = ["macros", "time", "rt-multi-thread"] } diff --git a/examples/parachain-example/src/main.rs b/examples/parachain-example/src/main.rs index ade5d520904..31678f87ddf 100644 --- a/examples/parachain-example/src/main.rs +++ b/examples/parachain-example/src/main.rs @@ -1,7 +1,6 @@ use subxt::{ - PolkadotConfig, utils::{AccountId32, MultiAddress}, - OnlineClient, + OnlineClient, PolkadotConfig, }; use subxt_signer::sr25519::dev::{self}; @@ -21,7 +20,8 @@ pub async fn main() { async fn run() -> Result<(), Box> { // (the port 42069 is specified in the asset-hub-zombienet.toml) - let api = OnlineClient::::from_url("ws://127.0.0.1:42069").await?; + let config = StatemintConfig::new(); + let api = OnlineClient::::from_url(config, "ws://127.0.0.1:42069").await?; println!("Connection with parachain established."); let alice: MultiAddress = dev::alice().public_key().into(); @@ -36,6 +36,7 @@ async fn run() -> Result<(), Box> { .create(COLLECTION_ID, alice.clone()); let _collection_creation_events = api .tx() + .await? .sign_and_submit_then_watch_default(&collection_creation_tx, &alice_pair_signer) .await .map(|e| { @@ -52,6 +53,7 @@ async fn run() -> Result<(), Box> { .mint(COLLECTION_ID, NTF_ID, alice.clone()); let _nft_creation_events = api .tx() + .await? .sign_and_submit_then_watch_default(&nft_creation_tx, &alice_pair_signer) .await .map(|e| { @@ -65,9 +67,9 @@ async fn run() -> Result<(), Box> { // check in storage, that alice is the official owner of the NFT: let nft_owner_storage_query = statemint::storage().uniques().asset(); let nft_storage_details = api - .storage() - .at_latest() + .at_current_block() .await? + .storage() .fetch(nft_owner_storage_query, (COLLECTION_ID, NTF_ID)) .await? .decode()?; diff --git a/examples/wasm-example/Cargo.lock b/examples/wasm-example/Cargo.lock index 93db045d7f0..79a42297235 100644 --- a/examples/wasm-example/Cargo.lock +++ b/examples/wasm-example/Cargo.lock @@ -151,6 +151,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64ct" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e050f626429857a27ddccb31e0aca21356bfa709c04041aefddac081a8f068a" + [[package]] name = "bincode" version = "1.3.3" @@ -336,6 +342,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "const_format" version = "0.2.34" @@ -370,9 +382,9 @@ checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "convert_case" -version = "0.6.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" dependencies = [ "unicode-segmentation", ] @@ -490,6 +502,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "derive-where" version = "1.2.7" @@ -507,7 +530,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ - "derive_more-impl", + "derive_more-impl 1.0.0", +] + +[[package]] +name = "derive_more" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10b768e943bed7bf2cab53df09f4bc34bfd217cdb57d971e769874c9a6710618" +dependencies = [ + "derive_more-impl 2.1.0", ] [[package]] @@ -515,10 +547,22 @@ name = "derive_more-impl" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d286bfdaf75e988b4a78e013ecd79c581e06399ab53fbacd2d916c2f904f30b" dependencies = [ "convert_case", "proc-macro2", "quote", + "rustc_version", "syn 2.0.100", "unicode-xid", ] @@ -566,21 +610,23 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ + "pkcs8", "signature", ] [[package]] name = "ed25519-zebra" -version = "4.0.3" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +checksum = "0017d969298eec91e3db7a2985a8cab4df6341d86e6f3a6f5878b13fb7846bc9" dependencies = [ "curve25519-dalek", "ed25519", - "hashbrown 0.14.5", - "hex", + "hashbrown 0.15.2", + "pkcs8", "rand_core", "sha2 0.10.8", + "subtle", "zeroize", ] @@ -656,6 +702,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -667,16 +719,18 @@ dependencies = [ [[package]] name = "frame-decode" -version = "0.11.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0acacffe60911b0d57a55c0b323fc08ccd88659dc52056bb39dfeb5cedafb59" +checksum = "e63257bb5f8d7a707d626aa1b4e464c3b9720edd168b73cee98f48f0dd6386e4" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-decode", "scale-encode", "scale-info", + "scale-info-legacy", "scale-type-resolver", + "serde_yaml", "sp-crypto-hashing", "thiserror 2.0.12", ] @@ -1073,8 +1127,21 @@ checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.1.5", + "serde", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", "serde", + "serde_core", ] [[package]] @@ -1373,9 +1440,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1583,12 +1650,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.8.8" @@ -1612,12 +1673,11 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "nom" -version = "7.1.3" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" dependencies = [ "memchr", - "minimal-lexical", ] [[package]] @@ -1727,6 +1787,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1776,6 +1845,16 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "poly1305" version = "0.8.0" @@ -1986,9 +2065,9 @@ checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "ruzstd" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad02996bfc73da3e301efe90b1837be9ed8f4a462b6ed410aa35d00381de89f" +checksum = "e5ff0cc5e135c8870a775d3320910cd9b564ec036b4dc0b8741629020be63f01" [[package]] name = "ryu" @@ -2010,9 +2089,9 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d78196772d25b90a98046794ce0fe2588b39ebdfbdc1e45b4c6c85dd43bebad" +checksum = "8d6ed61699ad4d54101ab5a817169259b5b0efc08152f8632e61482d8a27ca3d" dependencies = [ "parity-scale-codec", "primitive-types", @@ -2025,9 +2104,9 @@ dependencies = [ [[package]] name = "scale-decode-derive" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4b54a1211260718b92832b661025d1f1a4b6930fbadd6908e00edd265fa5f7" +checksum = "65cb245f7fdb489e7ba43a616cbd34427fe3ba6fe0edc1d0d250085e6c84f3ec" dependencies = [ "darling", "proc-macro2", @@ -2037,9 +2116,9 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64901733157f9d25ef86843bd783eda439fac7efb0ad5a615d12d2cf3a29464b" +checksum = "f2a976d73564a59e482b74fd5d95f7518b79ca8c8ca5865398a4d629dd15ee50" dependencies = [ "parity-scale-codec", "primitive-types", @@ -2071,7 +2150,7 @@ checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" dependencies = [ "bitvec", "cfg-if", - "derive_more", + "derive_more 1.0.0", "parity-scale-codec", "scale-info-derive", "serde", @@ -2089,6 +2168,21 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "scale-info-legacy" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afb76e1b2cb589b97278e2f1e2e290c9b7c51d6ac69afab9e1d7d1e136a9276" +dependencies = [ + "hashbrown 0.16.1", + "scale-type-resolver", + "serde", + "smallstr", + "smallvec", + "thiserror 2.0.12", + "yap", +] + [[package]] name = "scale-type-resolver" version = "0.2.0" @@ -2101,9 +2195,9 @@ dependencies = [ [[package]] name = "scale-typegen" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05c61b6b706a3eaad63b506ab50a1d2319f817ae01cf753adcc3f055f9f0fcd6" +checksum = "642d2f13f3fc9a34ea2c1e36142984eba78cd2405a61632492f8b52993e98879" dependencies = [ "proc-macro2", "quote", @@ -2170,10 +2264,11 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ + "serde_core", "serde_derive", ] @@ -2197,11 +2292,20 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -2232,6 +2336,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.9.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sha1" version = "0.10.6" @@ -2298,6 +2415,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "smallstr" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862077b1e764f04c251fe82a2ef562fd78d7cadaeb072ca7c2bcaf7217b1ff3b" +dependencies = [ + "smallvec", +] + [[package]] name = "smallvec" version = "1.15.0" @@ -2306,9 +2432,9 @@ checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" [[package]] name = "smoldot" -version = "0.19.3" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6664ea2d3d3c1d77b8f24032aca6462dc0da8378d25c5bdde6130699b6740fe" +checksum = "724ab10d6485cccb4bab080ce436c0b361295274aec7847d7ba84ab1a79a5132" dependencies = [ "arrayvec 0.7.6", "async-lock", @@ -2319,7 +2445,7 @@ dependencies = [ "bs58", "chacha20", "crossbeam-queue", - "derive_more", + "derive_more 2.1.0", "ed25519-zebra", "either", "event-listener", @@ -2360,16 +2486,16 @@ dependencies = [ [[package]] name = "smoldot-light" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad7762a41b43cc95e5253214ca8f85a2308a048f4fe8217927888065bafd30c" +checksum = "e8b4d4971f06f2471f4e57a662dbe8047fa0cc020957764a6211f3fad371f7bd" dependencies = [ "async-channel", "async-lock", "base64", "blake2-rfc", "bs58", - "derive_more", + "derive_more 2.1.0", "either", "event-listener", "fnv", @@ -2426,6 +2552,16 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2452,41 +2588,45 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subxt" -version = "0.44.0" +version = "0.50.0" dependencies = [ "async-trait", "derive-where", "either", + "frame-decode", "frame-metadata", "futures", "hex", + "impl-serde", "jsonrpsee", + "keccak-hash", "parity-scale-codec", "primitive-types", "scale-bits", "scale-decode", "scale-encode", "scale-info", + "scale-info-legacy", + "scale-type-resolver", "scale-value", "serde", "serde_json", "sp-crypto-hashing", - "subxt-core", "subxt-lightclient", "subxt-macro", "subxt-metadata", "subxt-rpcs", + "subxt-utils-accountid32", "thiserror 2.0.12", "tokio", "tracing", - "url", "wasm-bindgen-futures", "web-time", ] [[package]] name = "subxt-codegen" -version = "0.44.0" +version = "0.50.0" dependencies = [ "getrandom", "heck", @@ -2500,37 +2640,9 @@ dependencies = [ "thiserror 2.0.12", ] -[[package]] -name = "subxt-core" -version = "0.44.0" -dependencies = [ - "base58", - "blake2", - "derive-where", - "frame-decode", - "frame-metadata", - "hashbrown 0.14.5", - "hex", - "impl-serde", - "keccak-hash", - "parity-scale-codec", - "primitive-types", - "scale-bits", - "scale-decode", - "scale-encode", - "scale-info", - "scale-value", - "serde", - "serde_json", - "sp-crypto-hashing", - "subxt-metadata", - "thiserror 2.0.12", - "tracing", -] - [[package]] name = "subxt-lightclient" -version = "0.44.0" +version = "0.50.0" dependencies = [ "futures", "futures-timer", @@ -2555,7 +2667,7 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.44.0" +version = "0.50.0" dependencies = [ "darling", "parity-scale-codec", @@ -2570,20 +2682,22 @@ dependencies = [ [[package]] name = "subxt-metadata" -version = "0.44.0" +version = "0.50.0" dependencies = [ "frame-decode", "frame-metadata", "hashbrown 0.14.5", "parity-scale-codec", "scale-info", + "scale-info-legacy", + "scale-type-resolver", "sp-crypto-hashing", "thiserror 2.0.12", ] [[package]] name = "subxt-rpcs" -version = "0.44.0" +version = "0.50.0" dependencies = [ "derive-where", "finito", @@ -2597,7 +2711,6 @@ dependencies = [ "primitive-types", "serde", "serde_json", - "subxt-core", "subxt-lightclient", "thiserror 2.0.12", "tokio-util", @@ -2606,9 +2719,23 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "subxt-utils-accountid32" +version = "0.50.0" +dependencies = [ + "base58", + "blake2", + "parity-scale-codec", + "scale-decode", + "scale-encode", + "scale-info", + "serde", + "thiserror 2.0.12", +] + [[package]] name = "subxt-utils-fetchmetadata" -version = "0.44.0" +version = "0.50.0" dependencies = [ "hex", "parity-scale-codec", @@ -2831,7 +2958,6 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand", "static_assertions", ] @@ -2887,6 +3013,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "url" version = "2.5.4" diff --git a/examples/wasm-example/src/routes/signing.rs b/examples/wasm-example/src/routes/signing.rs index 478f4b14307..ced0655fd15 100644 --- a/examples/wasm-example/src/routes/signing.rs +++ b/examples/wasm-example/src/routes/signing.rs @@ -1,7 +1,7 @@ use anyhow::anyhow; use futures::FutureExt; -use subxt::{OnlineClient, PolkadotConfig}; +use subxt::{client::OnlineClientAtBlockImpl, OnlineClient, OnlineClientAtBlock, PolkadotConfig}; use subxt::config::DefaultExtrinsicParamsBuilder; use subxt::ext::codec::{Decode, Encode}; @@ -16,7 +16,7 @@ use yew::prelude::*; pub struct SigningExamplesComponent { message: String, remark_call_bytes: Vec, - online_client: Option>, + online_client: Option>, stage: SigningStage, } @@ -25,9 +25,9 @@ impl SigningExamplesComponent { /// panics if self.online_client is None. fn set_message(&mut self, message: String) { let remark_call = polkadot::tx().system().remark(message.as_bytes().to_vec()); - let online_client = self.online_client.as_ref().unwrap(); + let online_client_at_block = self.online_client.as_ref().unwrap(); let remark_call_bytes = remark_call - .encode_call_data(&online_client.metadata()) + .encode_call_data(online_client_at_block.metadata_ref()) .unwrap(); self.remark_call_bytes = remark_call_bytes; self.message = message; @@ -51,7 +51,8 @@ pub enum SigningStage { pub enum SubmittingStage { Initial { - signed_extrinsic: SubmittableTransaction>, + signed_extrinsic: + SubmittableTransaction>, }, Submitting, Success { @@ -62,7 +63,7 @@ pub enum SubmittingStage { pub enum Message { Error(anyhow::Error), - OnlineClientCreated(OnlineClient), + OnlineClientCreated(OnlineClientAtBlock), ChangeMessage(String), RequestAccounts, ReceivedAccounts(Vec), @@ -70,7 +71,7 @@ pub enum Message { SignWithAccount(usize), ReceivedSignature( MultiSignature, - SubmittableTransaction>, + SubmittableTransaction>, ), SubmitSigned, ExtrinsicFinalized { @@ -85,12 +86,20 @@ impl Component for SigningExamplesComponent { type Properties = (); fn create(ctx: &Context) -> Self { - ctx.link().send_future(OnlineClient::::new().map(|res| { - match res { - Ok(online_client) => Message::OnlineClientCreated(online_client), - Err(err) => Message::Error(anyhow!("Online Client could not be created. Make sure you have a local node running:\n{err}")), - } - })); + ctx.link().send_future(async { + let conf = PolkadotConfig::new(); + let Ok(client) = OnlineClient::new(conf).await else { + return Message::Error(anyhow!( + "OnlineClient could not be created. Make sure you have a local node running\n" + )); + }; + let Ok(at_block) = client.at_current_block().await else { + return Message::Error(anyhow!( + "OnlineClient could not obtain current block details\n" + )); + }; + Message::OnlineClientCreated(at_block) + }); SigningExamplesComponent { message: "".to_string(), stage: SigningStage::CreatingOnlineClient, @@ -101,8 +110,8 @@ impl Component for SigningExamplesComponent { fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { match msg { - Message::OnlineClientCreated(online_client) => { - self.online_client = Some(online_client); + Message::OnlineClientCreated(online_client_at_block) => { + self.online_client = Some(online_client_at_block); self.stage = SigningStage::EnterMessage; self.set_message("Hello".into()); } @@ -135,20 +144,21 @@ impl Component for SigningExamplesComponent { .system() .remark(self.message.as_bytes().to_vec()); - let api = self.online_client.as_ref().unwrap().clone(); + let at_block = self.online_client.clone().unwrap(); ctx.link().send_future(async move { - let Ok(account_nonce) = api.tx().account_nonce(&account_id).await else { + let Ok(account_nonce) = at_block.tx().account_nonce(&account_id).await + else { return Message::Error(anyhow!("Fetching account nonce failed")); }; - let Ok(call_data) = api.tx().call_data(&remark_call) else { + let Ok(call_data) = at_block.tx().call_data(&remark_call) else { return Message::Error(anyhow!("could not encode call data")); }; let Ok(signature) = extension_signature_for_extrinsic( &call_data, - &api, + &at_block, account_nonce, account_source, account_address, @@ -166,15 +176,15 @@ impl Component for SigningExamplesComponent { let params = DefaultExtrinsicParamsBuilder::new() .nonce(account_nonce) .build(); - let Ok(mut partial_signed) = - api.tx().create_partial_offline(&remark_call, params) + let Ok(mut signable) = + at_block.tx().create_signable_offline(&remark_call, params) else { return Message::Error(anyhow!("PartialTransaction creation failed")); }; // Apply the signature - let signed_extrinsic = partial_signed - .sign_with_account_and_signature(&account_id, &multi_signature); + let signed_extrinsic = + signable.sign_with_account_and_signature(&account_id, &multi_signature); // check the TX validity (to debug in the js console if the extrinsic would work) let dry_res = signed_extrinsic.validate().await; @@ -394,7 +404,7 @@ impl Component for SigningExamplesComponent { } async fn submit_wait_finalized_and_get_extrinsic_success_event( - extrinsic: SubmittableTransaction>, + extrinsic: SubmittableTransaction>, ) -> Result { let events = extrinsic .submit_and_watch() @@ -408,6 +418,9 @@ async fn submit_wait_finalized_and_get_extrinsic_success_event( web_sys::console::log_1(&format!("{:?}", event).into()); } - let success = events.find_first::()?; - success.ok_or(anyhow!("ExtrinsicSuccess not found in events")) + let success = events + .find_first::() + .ok_or(anyhow!("ExtrinsicSuccess not found in events"))??; + + Ok(success) } diff --git a/examples/wasm-example/src/services.rs b/examples/wasm-example/src/services.rs index 6836ee16cff..7f4b978d09c 100644 --- a/examples/wasm-example/src/services.rs +++ b/examples/wasm-example/src/services.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use serde_json::json; use std::fmt::Write; use subxt::ext::codec::{Compact, Encode}; -use subxt::{self, OnlineClient, PolkadotConfig}; +use subxt::{self, OnlineClient, OnlineClientAtBlock, PolkadotConfig}; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::JsFuture; use yew::{AttrValue, Callback}; @@ -13,22 +13,28 @@ use yew::{AttrValue, Callback}; pub mod polkadot {} pub(crate) async fn fetch_constant_block_length() -> Result { - let api = OnlineClient::::new().await?; + let config = PolkadotConfig::new(); + let api = OnlineClient::new(config).await?; let constant_query = polkadot::constants().system().block_length(); - let value = api.constants().at(&constant_query)?; + let value = api + .at_current_block() + .await? + .constants() + .entry(&constant_query)?; Ok(format!("{value:?}")) } pub(crate) async fn fetch_events_dynamically() -> Result, subxt::Error> { - let api = OnlineClient::::new().await?; - let events = api.events().at_latest().await?; + let config = PolkadotConfig::new(); + let api = OnlineClient::new(config).await?; + let events = api.at_current_block().await?.events().fetch().await?; let mut event_strings = Vec::::new(); for event in events.iter() { let event = event?; let pallet = event.pallet_name(); - let variant = event.variant_name(); - let field_values = event.decode_as_fields::()?; + let variant = event.event_name(); + let field_values = event.decode_fields_unchecked_as::()?; event_strings.push(format!("{pallet}::{variant}: {field_values}")); } Ok(event_strings) @@ -38,23 +44,28 @@ pub(crate) async fn fetch_events_dynamically() -> Result, subxt::Err pub(crate) async fn subscribe_to_finalized_blocks( cb: Callback, ) -> Result<(), subxt::Error> { - let api = OnlineClient::::new().await?; + let config = PolkadotConfig::new(); + let api = OnlineClient::new(config).await?; // Subscribe to all finalized blocks: - let mut blocks_sub = api.blocks().subscribe_finalized().await?; + let mut blocks_sub = api.stream_blocks().await?; while let Some(block) = blocks_sub.next().await { let block = block?; let mut output = String::new(); writeln!(output, "Block #{}:", block.header().number).ok(); writeln!(output, " Hash: {}", block.hash()).ok(); writeln!(output, " Extrinsics:").ok(); - let extrinsics = block.extrinsics().await?; + + let at_block = block.at().await?; + let extrinsics = at_block.extrinsics().fetch().await?; for ext in extrinsics.iter() { + let ext = ext?; + let idx = ext.index(); let events = ext.events().await?; let bytes_hex = format!("0x{}", hex::encode(ext.bytes())); // See the API docs for more ways to decode extrinsics: - let decoded_ext = ext.as_root_extrinsic::(); + let decoded_ext = ext.decode_call_data_as::(); writeln!(output, " Extrinsic #{idx}:").ok(); writeln!(output, " Bytes: {bytes_hex}").ok(); @@ -65,8 +76,8 @@ pub(crate) async fn subscribe_to_finalized_blocks( let evt = evt?; let pallet_name = evt.pallet_name(); - let event_name = evt.variant_name(); - let event_values = evt.decode_as_fields::()?; + let event_name = evt.event_name(); + let event_values = evt.decode_fields_unchecked_as::()?; writeln!(output, " {pallet_name}_{event_name}").ok(); writeln!(output, " {}", event_values).ok(); @@ -122,15 +133,18 @@ fn encode_then_hex(input: &E) -> String { /// Some parameters are hard-coded here and not taken from the partial_extrinsic itself (mortality_checkpoint, era, tip). pub async fn extension_signature_for_extrinsic( call_data: &[u8], - api: &OnlineClient, + api: &OnlineClientAtBlock, account_nonce: u64, account_source: String, account_address: String, ) -> Result, anyhow::Error> { - let genesis_hash = encode_then_hex(&api.genesis_hash()); + let genesis_hash = encode_then_hex( + &api.genesis_hash() + .expect("Should always exist via OnlineClient"), + ); // These numbers aren't SCALE encoded; their bytes are just converted to hex: - let spec_version = to_hex(&api.runtime_version().spec_version.to_be_bytes()); - let transaction_version = to_hex(&api.runtime_version().transaction_version.to_be_bytes()); + let spec_version = to_hex(&api.spec_version().to_be_bytes()); + let transaction_version = to_hex(&api.transaction_version().to_be_bytes()); let nonce = to_hex(&account_nonce.to_be_bytes()); // If you construct a mortal transaction, then this block hash needs to correspond // to the block number passed to `Era::mortal()`. @@ -138,7 +152,7 @@ pub async fn extension_signature_for_extrinsic( let era = encode_then_hex(&subxt::utils::Era::Immortal); let method = to_hex(call_data); let signed_extensions: Vec = api - .metadata() + .metadata_ref() .extrinsic() .transaction_extensions_by_version(0) .unwrap() diff --git a/historic/CHANGELOG.md b/historic/CHANGELOG.md deleted file mode 100644 index a7683f28890..00000000000 --- a/historic/CHANGELOG.md +++ /dev/null @@ -1,37 +0,0 @@ -# subxt-historic changelog - -This is separate from the Subxt changelog as subxt-historic is currently releasaed separately. - -Eventually this project will merge with Subxt and no longer exist, but until then it's being maintained and updated where needed. - -## 0.0.8 (2025-12-04) - -Expose `ClientAtBlock::resolver()`. This hands back a type resolver which is capable of resolving type IDs given by the `.visit()` methods on extrinsic fields and storage values. The extrinsics example has been modified to show how this can be used. - -## 0.0.7 (2025-12-03) - -Expose `OfflineClientAtBlock`, `OfflineClientAtBlockT`, `OnlinelientAtBlock`, `OnlineClientAtBlockT`. - -This is so that you can pass the `ClientAtBlock` into functions like so: - -```rust -use subxt_historic::config::Config; -use subxt_historic::client::{ ClientAtBlock, OnlineClientAtBlock, OnlineClientAtBlockT }; - -fn accepts_client_at_block_concrete(client: &ClientAtBlock, T>) { - // ... -} -fn accepts_client_at_block_generic<'conf, T: Config + 'conf, C: OnlineClientAtBlockT<'conf, T>>(client: &ClientAtBlock) { - // ... -} -``` - -## 0.0.6 (2025-12-01) - -- Add `.metadata()` on `ClientAtBlock` to expose the current metadata at some block. - -## 0.0.5 (2025-11-21) - -- Rename some fields for consistency. -- Update versions of underlying libraries being used. -- Add `.visit()` methods to extrinsic fields and storage values, and examples of using this to our examples. diff --git a/historic/Cargo.toml b/historic/Cargo.toml deleted file mode 100644 index 676b9d0f385..00000000000 --- a/historic/Cargo.toml +++ /dev/null @@ -1,63 +0,0 @@ -[package] -name = "subxt-historic" -version = "0.0.8" -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -publish = true - -license.workspace = true -readme = "README.md" -repository.workspace = true -documentation.workspace = true -homepage.workspace = true -description = "Download non head-of-chain blocks and state from Substrate based nodes" -keywords = ["parity", "substrate", "blockchain"] - -[lints] -workspace = true - -[features] -default = ["jsonrpsee", "native"] - -# Enable this for native (ie non web/wasm builds). -# Exactly 1 of "web" and "native" is expected. -native = [ - "subxt-rpcs/native", -] - -# Enable this for web/wasm builds. -# Exactly 1 of "web" and "native" is expected. -web = [ - "subxt-rpcs/web", -] - -# Enable this to use the reconnecting rpc client -reconnecting-rpc-client = ["subxt-rpcs/reconnecting-rpc-client"] - -# Enable this to use jsonrpsee, which enables the jsonrpsee RPC client, and -# a couple of util functions which rely on jsonrpsee. -jsonrpsee = [ - "subxt-rpcs/jsonrpsee", -] - -[dependencies] -subxt-rpcs = { workspace = true } -frame-decode = { workspace = true, features = ["legacy", "legacy-types"] } -frame-metadata = { workspace = true, features = ["std", "legacy"] } -scale-type-resolver = { workspace = true, features = ["scale-info"] } -codec = { workspace = true } -primitive-types = { workspace = true } -scale-info = { workspace = true } -scale-info-legacy = { workspace = true } -scale-decode = { workspace = true } -thiserror = { workspace = true } -sp-crypto-hashing = { workspace = true } -url = { workspace = true } -futures = { workspace = true } - -[dev-dependencies] -tokio = { workspace = true, features = ["full"] } -scale-value = { workspace = true } -scale-decode = { workspace = true, features = ["derive"] } -hex = { workspace = true } diff --git a/historic/README.md b/historic/README.md deleted file mode 100644 index 43c2a9611b4..00000000000 --- a/historic/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# subxt-historic - -**This crate is a work in progress and currently is released only as a preview.** - -While `subxt` is a library for working at the head of a chain (submitting transactions and obtaining the current state), `subxt-historic` is a library for decoding blocks and state that are anywhere in a chain. To broadly summarize the differences: - -| Feature | subxt | subxt-historic | -|-----------------------------------------|------------------------------|-------------------------------| -| Block access | Head of chain | Any block in chain | -| Connection to chain | Light client or RPC node | Archive RPC nodes only | -| Transaction submission | Yes | No | -| Metadata compatibility | V14 and newer | Any version | - -# Examples - -See the [examples](https://github.com/paritytech/subxt/tree/master/historic/examples) folder for examples of how to use `subxt-historic`. diff --git a/historic/examples/storage.rs b/historic/examples/storage.rs deleted file mode 100644 index f61ed9ac02c..00000000000 --- a/historic/examples/storage.rs +++ /dev/null @@ -1,175 +0,0 @@ -#![allow(missing_docs)] -use subxt_historic::{OnlineClient, PolkadotConfig, ext::StreamExt}; - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Configuration for the Polkadot relay chain. - let config = PolkadotConfig::new(); - - // Create an online client for the Polkadot relay chain, pointed at a Polkadot archive node. - let client = OnlineClient::from_url(config, "wss://rpc.polkadot.io").await?; - - // Iterate through some randomly selected blocks to show how to fetch and decode storage. - for block_number in 12345678.. { - println!("=== Block {block_number} ==="); - - // Point the client at a specific block number. By default this will download and cache - // metadata for the required spec version (so it's cheaper to instantiate again), if it - // hasn't already, and borrow the relevant legacy types from the client. - let client_at_block = client.at(block_number).await?; - - // We'll work the account balances at the given block, for this example. - let account_balances = client_at_block.storage().entry("System", "Account")?; - - // We can see the default value for this entry at this block, if one exists. - if let Some(default_value) = account_balances.default_value() { - let default_balance_info = default_value.decode_as::()?; - println!(" Default balance info: {default_balance_info}"); - } - - // We can fetch a specific account balance by its key, like so (here I just picked a random key - // I knew to exist from iterating over storage entries): - let account_id_hex = "9a4d0faa2ba8c3cc5711852960940793acf55bf195b6eecf88fa78e961d0ce4a"; - let account_id: [u8; 32] = hex::decode(account_id_hex).unwrap().try_into().unwrap(); - if let Some(entry) = account_balances.fetch((account_id,)).await? { - // We can decode the value into our generic `scale_value::Value` type, which can - // represent any SCALE-encoded value, like so: - let _balance_info = entry.decode_as::()?; - - // We can visit the value, which is a more advanced use case and allows us to extract more - // data from the type, here the name of it, if it exists: - let tn = entry - .visit(type_name::GetTypeName::new())? - .unwrap_or(""); - - // Or, if we know what shape to expect, we can decode the parts of the value that we care - // about directly into a static type, which is more efficient and allows easy type-safe - // access, like so: - #[derive(scale_decode::DecodeAsType)] - struct BalanceInfo { - data: BalanceInfoData, - } - #[derive(scale_decode::DecodeAsType)] - struct BalanceInfoData { - free: u128, - reserved: u128, - misc_frozen: u128, - fee_frozen: u128, - } - let balance_info = entry.decode_as::()?; - - println!( - " Single balance info from {account_id_hex} => free: {} reserved: {} misc_frozen: {} fee_frozen: {} (type name: {tn})", - balance_info.data.free, - balance_info.data.reserved, - balance_info.data.misc_frozen, - balance_info.data.fee_frozen, - ); - } - - // Or we can iterate over all of the account balances and print them out, like so. Here we provide an - // empty tuple, indicating that we want to iterate over everything and not only things under a certain key - // (in the case of account balances, there is only one key anyway, but other storage entries may map from - // several keys to a value, and for those we can choose which depth we iterate at by providing as many keys - // as we want and leaving the rest). Here I only take the first 10 accounts I find for the sake of the example. - let mut all_balances = account_balances.iter(()).await?.take(10); - while let Some(entry) = all_balances.next().await { - let entry = entry?; - let key = entry.key()?; - - // Decode the account ID from the key (we know here that we're working - // with a map which has one value, an account ID, so we just decode that part: - let account_id = key - .part(0) - .unwrap() - .decode_as::<[u8; 32]>()? - .expect("We expect this key to decode into a 32 byte AccountId"); - - let account_id_hex = hex::encode(account_id); - - // Decode these values into our generic scale_value::Value type. Less efficient than - // defining a static type as above, but easier for the sake of the example. - let balance_info = entry.value().decode_as::()?; - println!(" {account_id_hex} => {balance_info}"); - } - - // We can also chain things together to fetch and decode a value in one go. - let _val = client_at_block - .storage() - .entry("System", "Account")? - .fetch((account_id,)) - .await? - .unwrap() - .decode_as::()?; - - let _vals = client_at_block - .storage() - .entry("System", "Account")? - .iter(()) - .await?; - } - - Ok(()) -} - -/// This module defines an example visitor which retrieves the name of a type. -/// This is a more advanced use case and can typically be avoided. -mod type_name { - use scale_decode::{ - Visitor, - visitor::types::{Composite, Sequence, Variant}, - visitor::{TypeIdFor, Unexpected}, - }; - use scale_type_resolver::TypeResolver; - - /// This is a visitor which obtains type names. - pub struct GetTypeName { - marker: core::marker::PhantomData, - } - - impl GetTypeName { - /// Construct our TypeName visitor. - pub fn new() -> Self { - GetTypeName { - marker: core::marker::PhantomData, - } - } - } - - impl Visitor for GetTypeName { - type Value<'scale, 'resolver> = Option<&'resolver str>; - type Error = scale_decode::Error; - type TypeResolver = R; - - // Look at the path of types that have paths and return the ident from that. - fn visit_composite<'scale, 'resolver>( - self, - value: &mut Composite<'scale, 'resolver, Self::TypeResolver>, - _type_id: TypeIdFor, - ) -> Result, Self::Error> { - Ok(value.path().last()) - } - fn visit_variant<'scale, 'resolver>( - self, - value: &mut Variant<'scale, 'resolver, Self::TypeResolver>, - _type_id: TypeIdFor, - ) -> Result, Self::Error> { - Ok(value.path().last()) - } - fn visit_sequence<'scale, 'resolver>( - self, - value: &mut Sequence<'scale, 'resolver, Self::TypeResolver>, - _type_id: TypeIdFor, - ) -> Result, Self::Error> { - Ok(value.path().last()) - } - - // Else, we return nothing as we can't find a name for the type. - fn visit_unexpected<'scale, 'resolver>( - self, - _unexpected: Unexpected, - ) -> Result, Self::Error> { - Ok(None) - } - } -} diff --git a/historic/src/client.rs b/historic/src/client.rs deleted file mode 100644 index 421e36a28cb..00000000000 --- a/historic/src/client.rs +++ /dev/null @@ -1,73 +0,0 @@ -mod offline_client; -mod online_client; - -use crate::config::Config; -use crate::extrinsics::ExtrinsicsClient; -use crate::storage::StorageClient; -use crate::utils::AnyResolver; -use frame_metadata::RuntimeMetadata; -use std::marker::PhantomData; - -pub use offline_client::{OfflineClient, OfflineClientAtBlock, OfflineClientAtBlockT}; -pub use online_client::{OnlineClient, OnlineClientAtBlock, OnlineClientAtBlockT}; - -/// This represents a client at a specific block number. -pub struct ClientAtBlock { - client: Client, - marker: PhantomData, -} - -impl ClientAtBlock { - /// Construct a new client at some block. - pub(crate) fn new(client: Client) -> Self { - Self { - client, - marker: PhantomData, - } - } -} - -impl<'client, T, Client> ClientAtBlock -where - T: Config + 'client, - Client: OfflineClientAtBlockT<'client, T>, -{ - /// Work with extrinsics. - pub fn extrinsics(&'_ self) -> ExtrinsicsClient<'_, Client, T> { - ExtrinsicsClient::new(&self.client) - } - - /// Work with storage. - pub fn storage(&'_ self) -> StorageClient<'_, Client, T> { - StorageClient::new(&self.client) - } - - /// Return the metadata in use at this block. - pub fn metadata(&self) -> &RuntimeMetadata { - self.client.metadata() - } - - /// Return something which implements [`scale_type_resolver::TypeResolver`] and - /// can be used in conjnction with type IDs in `.visit` methods. - pub fn resolver(&self) -> AnyResolver<'_, 'client> { - match self.client.metadata() { - RuntimeMetadata::V0(_) - | RuntimeMetadata::V1(_) - | RuntimeMetadata::V2(_) - | RuntimeMetadata::V3(_) - | RuntimeMetadata::V4(_) - | RuntimeMetadata::V5(_) - | RuntimeMetadata::V6(_) - | RuntimeMetadata::V7(_) - | RuntimeMetadata::V8(_) - | RuntimeMetadata::V9(_) - | RuntimeMetadata::V10(_) - | RuntimeMetadata::V11(_) - | RuntimeMetadata::V12(_) - | RuntimeMetadata::V13(_) => AnyResolver::B(self.client.legacy_types()), - RuntimeMetadata::V14(m) => AnyResolver::A(&m.types), - RuntimeMetadata::V15(m) => AnyResolver::A(&m.types), - RuntimeMetadata::V16(m) => AnyResolver::A(&m.types), - } - } -} diff --git a/historic/src/client/offline_client.rs b/historic/src/client/offline_client.rs deleted file mode 100644 index 209489b4494..00000000000 --- a/historic/src/client/offline_client.rs +++ /dev/null @@ -1,83 +0,0 @@ -use super::ClientAtBlock; -use crate::config::Config; -use crate::error::OfflineClientAtBlockError; -use frame_metadata::RuntimeMetadata; -use scale_info_legacy::TypeRegistrySet; -use std::sync::Arc; - -/// A client which exposes the means to decode historic data on a chain offline. -#[derive(Clone, Debug)] -pub struct OfflineClient { - /// The configuration for this client. - config: Arc, -} - -impl OfflineClient { - /// Create a new [`OfflineClient`] with the given configuration. - pub fn new(config: T) -> Self { - OfflineClient { - config: Arc::new(config), - } - } - - /// Pick the block height at which to operate. This references data from the - /// [`OfflineClient`] it's called on, and so cannot outlive it. - pub fn at<'this>( - &'this self, - block_number: u64, - ) -> Result, T>, OfflineClientAtBlockError> { - let config = &self.config; - let spec_version = self - .config - .spec_version_for_block_number(block_number) - .ok_or(OfflineClientAtBlockError::SpecVersionNotFound { block_number })?; - - let legacy_types = self.config.legacy_types_for_spec_version(spec_version); - let metadata = self - .config - .metadata_for_spec_version(spec_version) - .ok_or(OfflineClientAtBlockError::MetadataNotFound { spec_version })?; - - Ok(ClientAtBlock::new(OfflineClientAtBlock { - config, - legacy_types, - metadata, - })) - } -} - -/// This represents an offline-only client at a specific block. -pub trait OfflineClientAtBlockT<'client, T: Config + 'client> { - /// Get the configuration for this client. - fn config(&self) -> &'client T; - /// Get the legacy types that work at this block. - fn legacy_types(&'_ self) -> &TypeRegistrySet<'client>; - /// Get the metadata appropriate for this block. - fn metadata(&self) -> &RuntimeMetadata; -} - -// Dev note: this shouldn't need to be exposed unless there is some -// need to explicitly name the ClientAAtBlock type. Rather keep it -// private to allow changes if possible. -pub struct OfflineClientAtBlock<'client, T: Config + 'client> { - /// The configuration for this chain. - config: &'client T, - /// Historic types to use at this block number. - legacy_types: TypeRegistrySet<'client>, - /// Metadata to use at this block number. - metadata: Arc, -} - -impl<'client, T: Config + 'client> OfflineClientAtBlockT<'client, T> - for OfflineClientAtBlock<'client, T> -{ - fn config(&self) -> &'client T { - self.config - } - fn legacy_types(&self) -> &TypeRegistrySet<'client> { - &self.legacy_types - } - fn metadata(&self) -> &RuntimeMetadata { - &self.metadata - } -} diff --git a/historic/src/client/online_client.rs b/historic/src/client/online_client.rs deleted file mode 100644 index 3aab638d2a5..00000000000 --- a/historic/src/client/online_client.rs +++ /dev/null @@ -1,331 +0,0 @@ -use super::ClientAtBlock; -use crate::client::OfflineClientAtBlockT; -use crate::config::Config; -use crate::error::OnlineClientAtBlockError; -use codec::{Compact, Decode, Encode}; -use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed}; -use scale_info_legacy::TypeRegistrySet; -use std::sync::Arc; -use subxt_rpcs::methods::chain_head::ArchiveCallResult; -use subxt_rpcs::{ChainHeadRpcMethods, RpcClient}; - -#[cfg(feature = "jsonrpsee")] -#[cfg_attr(docsrs, doc(cfg(feature = "jsonrpsee")))] -use crate::error::OnlineClientError; - -/// A client which exposes the means to decode historic data on a chain online. -#[derive(Clone, Debug)] -pub struct OnlineClient { - inner: Arc>, -} - -#[derive(Debug)] -struct OnlineClientInner { - /// The configuration for this client. - config: T, - /// The RPC methods used to communicate with the node. - rpc_methods: ChainHeadRpcMethods, -} - -// The default constructors assume Jsonrpsee. -#[cfg(feature = "jsonrpsee")] -#[cfg_attr(docsrs, doc(cfg(feature = "jsonrpsee")))] -impl OnlineClient { - /// Construct a new [`OnlineClient`] using default settings which - /// point to a locally running node on `ws://127.0.0.1:9944`. - /// - /// **Note:** This will only work if the local node is an archive node. - pub async fn new(config: T) -> Result, OnlineClientError> { - let url = "ws://127.0.0.1:9944"; - OnlineClient::from_url(config, url).await - } - - /// Construct a new [`OnlineClient`], providing a URL to connect to. - pub async fn from_url( - config: T, - url: impl AsRef, - ) -> Result, OnlineClientError> { - let url_str = url.as_ref(); - let url = url::Url::parse(url_str).map_err(|_| OnlineClientError::InvalidUrl { - url: url_str.to_string(), - })?; - if !Self::is_url_secure(&url) { - return Err(OnlineClientError::RpcClientError( - subxt_rpcs::Error::InsecureUrl(url_str.to_string()), - )); - } - OnlineClient::from_insecure_url(config, url).await - } - - /// Construct a new [`OnlineClient`], providing a URL to connect to. - /// - /// Allows insecure URLs without SSL encryption, e.g. (http:// and ws:// URLs). - pub async fn from_insecure_url( - config: T, - url: impl AsRef, - ) -> Result, OnlineClientError> { - let rpc_client = RpcClient::from_insecure_url(url).await?; - Ok(OnlineClient::from_rpc_client(config, rpc_client)) - } - - fn is_url_secure(url: &url::Url) -> bool { - let secure_scheme = url.scheme() == "https" || url.scheme() == "wss"; - let is_localhost = url.host().is_some_and(|e| match e { - url::Host::Domain(e) => e == "localhost", - url::Host::Ipv4(e) => e.is_loopback(), - url::Host::Ipv6(e) => e.is_loopback(), - }); - secure_scheme || is_localhost - } -} - -impl OnlineClient { - /// Construct a new [`OnlineClient`] by providing an [`RpcClient`] to drive the connection, - /// and some configuration for the chain we're connecting to. - pub fn from_rpc_client(config: T, rpc_client: impl Into) -> OnlineClient { - let rpc_client = rpc_client.into(); - let rpc_methods = ChainHeadRpcMethods::new(rpc_client); - OnlineClient { - inner: Arc::new(OnlineClientInner { - config, - rpc_methods, - }), - } - } - - /// Pick the block height at which to operate. This references data from the - /// [`OnlineClient`] it's called on, and so cannot outlive it. - pub async fn at( - &'_ self, - block_number: u64, - ) -> Result, T>, OnlineClientAtBlockError> { - let config = &self.inner.config; - let rpc_methods = &self.inner.rpc_methods; - - let block_hash = rpc_methods - .archive_v1_hash_by_height(block_number as usize) - .await - .map_err(|e| OnlineClientAtBlockError::CannotGetBlockHash { - block_number, - reason: e, - })? - .pop() - .ok_or_else(|| OnlineClientAtBlockError::BlockNotFound { block_number })? - .into(); - - // Get our configuration, or fetch from the node if not available. - let spec_version = - if let Some(spec_version) = config.spec_version_for_block_number(block_number) { - spec_version - } else { - // Fetch spec version. Caching this doesn't really make sense, so either - // details are provided offline or we fetch them every time. - get_spec_version(rpc_methods, block_hash).await? - }; - let metadata = if let Some(metadata) = config.metadata_for_spec_version(spec_version) { - metadata - } else { - // Fetch and then give our config the opportunity to cache this metadata. - let metadata = get_metadata(rpc_methods, block_hash).await?; - let metadata = Arc::new(metadata); - config.set_metadata_for_spec_version(spec_version, metadata.clone()); - metadata - }; - - let mut historic_types = config.legacy_types_for_spec_version(spec_version); - // The metadata can be used to construct call and event types instead of us having to hardcode them all for every spec version: - let types_from_metadata = frame_decode::helpers::type_registry_from_metadata_any(&metadata) - .map_err( - |parse_error| OnlineClientAtBlockError::CannotInjectMetadataTypes { parse_error }, - )?; - historic_types.prepend(types_from_metadata); - - Ok(ClientAtBlock::new(OnlineClientAtBlock { - config, - historic_types, - metadata, - rpc_methods, - block_hash, - })) - } -} - -/// This represents an online client at a specific block. -pub trait OnlineClientAtBlockT<'client, T: Config + 'client>: - OfflineClientAtBlockT<'client, T> -{ - /// Return the RPC methods we'll use to interact with the node. - fn rpc_methods(&self) -> &ChainHeadRpcMethods; - /// Return the block hash for the current block. - fn block_hash(&self) -> ::Hash; -} - -// Dev note: this shouldn't need to be exposed unless there is some -// need to explicitly name the ClientAAtBlock type. Rather keep it -// private to allow changes if possible. -pub struct OnlineClientAtBlock<'client, T: Config + 'client> { - /// The configuration for this chain. - config: &'client T, - /// Historic types to use at this block number. - historic_types: TypeRegistrySet<'client>, - /// Metadata to use at this block number. - metadata: Arc, - /// We also need RPC methods for online interactions. - rpc_methods: &'client ChainHeadRpcMethods, - /// The block hash at which this client is operating. - block_hash: ::Hash, -} - -impl<'client, T: Config + 'client> OnlineClientAtBlockT<'client, T> - for OnlineClientAtBlock<'client, T> -{ - fn rpc_methods(&self) -> &ChainHeadRpcMethods { - self.rpc_methods - } - fn block_hash(&self) -> ::Hash { - self.block_hash - } -} - -impl<'client, T: Config + 'client> OfflineClientAtBlockT<'client, T> - for OnlineClientAtBlock<'client, T> -{ - fn config(&self) -> &'client T { - self.config - } - fn legacy_types(&'_ self) -> &TypeRegistrySet<'client> { - &self.historic_types - } - fn metadata(&self) -> &RuntimeMetadata { - &self.metadata - } -} - -async fn get_spec_version( - rpc_methods: &ChainHeadRpcMethods, - block_hash: ::Hash, -) -> Result { - use codec::Decode; - use subxt_rpcs::methods::chain_head::ArchiveCallResult; - - // make a runtime call to get the version information. This is also a constant - // in the metadata and so we could fetch it from there to avoid the call, but it would be a - // bit more effort. - let spec_version_bytes = { - let call_res = rpc_methods - .archive_v1_call(block_hash.into(), "Core_version", &[]) - .await - .map_err(|e| OnlineClientAtBlockError::CannotGetSpecVersion { - block_hash: block_hash.to_string(), - reason: format!("Error calling Core_version: {e}"), - })?; - match call_res { - ArchiveCallResult::Success(bytes) => bytes.0, - ArchiveCallResult::Error(e) => { - return Err(OnlineClientAtBlockError::CannotGetSpecVersion { - block_hash: block_hash.to_string(), - reason: format!("Core_version returned an error: {e}"), - }); - } - } - }; - - // We only care about the spec version, so just decode enough of this version information - // to be able to pluck out what we want, and ignore the rest. - let spec_version = { - #[derive(codec::Decode)] - struct SpecVersionHeader { - _spec_name: String, - _impl_name: String, - _authoring_version: u32, - spec_version: u32, - } - SpecVersionHeader::decode(&mut &spec_version_bytes[..]) - .map_err(|e| OnlineClientAtBlockError::CannotGetSpecVersion { - block_hash: block_hash.to_string(), - reason: format!("Error decoding Core_version response: {e}"), - })? - .spec_version - }; - - Ok(spec_version) -} - -async fn get_metadata( - rpc_methods: &ChainHeadRpcMethods, - block_hash: ::Hash, -) -> Result { - // First, try to use the "modern" metadata APIs to get the most recent version we can. - let version_to_get = rpc_methods - .archive_v1_call(block_hash.into(), "Metadata_metadata_versions", &[]) - .await - .ok() - .and_then(|res| res.as_success()) - .and_then(|res| >::decode(&mut &res[..]).ok()) - .and_then(|versions| { - // We want to filter out the "unstable" version, which is represented by u32::MAX. - versions.into_iter().filter(|v| *v != u32::MAX).max() - }); - - // We had success calling the above API, so we expect the "modern" metadata API to work. - if let Some(version_to_get) = version_to_get { - let version_bytes = version_to_get.encode(); - let rpc_response = rpc_methods - .archive_v1_call( - block_hash.into(), - "Metadata_metadata_at_version", - &version_bytes, - ) - .await - .map_err(|e| OnlineClientAtBlockError::CannotGetMetadata { - block_hash: block_hash.to_string(), - reason: format!("Error calling Metadata_metadata_at_version: {e}"), - }) - .and_then(|res| match res { - ArchiveCallResult::Success(bytes) => Ok(bytes.0), - ArchiveCallResult::Error(e) => Err(OnlineClientAtBlockError::CannotGetMetadata { - block_hash: block_hash.to_string(), - reason: format!("Calling Metadata_metadata_at_version returned an error: {e}"), - }), - })?; - - // Option because we may have asked for a version that doesn't exist. Compact because we get back a Vec - // of the metadata bytes, and the Vec is preceded by it's compact encoded length. The actual bytes are then - // decoded as a `RuntimeMetadataPrefixed`, after this. - let (_, metadata) = , RuntimeMetadataPrefixed)>>::decode(&mut &rpc_response[..]) - .map_err(|e| OnlineClientAtBlockError::CannotGetMetadata { - block_hash: block_hash.to_string(), - reason: format!("Error decoding response for Metadata_metadata_at_version: {e}"), - })? - .ok_or_else(|| OnlineClientAtBlockError::CannotGetMetadata { - block_hash: block_hash.to_string(), - reason: format!("No metadata returned for the latest version from Metadata_metadata_versions ({version_to_get})"), - })?; - - return Ok(metadata.1); - } - - // We didn't get a version from Metadata_metadata_versions, so fall back to the "old" API. - let metadata_bytes = rpc_methods - .archive_v1_call(block_hash.into(), "Metadata_metadata", &[]) - .await - .map_err(|e| OnlineClientAtBlockError::CannotGetMetadata { - block_hash: block_hash.to_string(), - reason: format!("Error calling Metadata_metadata: {e}"), - }) - .and_then(|res| match res { - ArchiveCallResult::Success(bytes) => Ok(bytes.0), - ArchiveCallResult::Error(e) => Err(OnlineClientAtBlockError::CannotGetMetadata { - block_hash: block_hash.to_string(), - reason: format!("Calling Metadata_metadata returned an error: {e}"), - }), - })?; - - let (_, metadata) = <(Compact, RuntimeMetadataPrefixed)>::decode(&mut &metadata_bytes[..]) - .map_err(|e| OnlineClientAtBlockError::CannotGetMetadata { - block_hash: block_hash.to_string(), - reason: format!("Error decoding response for Metadata_metadata: {e}"), - })?; - - Ok(metadata.1) -} diff --git a/historic/src/config.rs b/historic/src/config.rs deleted file mode 100644 index 3e9e9ddba92..00000000000 --- a/historic/src/config.rs +++ /dev/null @@ -1,56 +0,0 @@ -pub mod polkadot; -pub mod substrate; - -use scale_info_legacy::TypeRegistrySet; -use std::fmt::Display; -use std::sync::Arc; -use subxt_rpcs::RpcConfig; - -pub use polkadot::PolkadotConfig; -pub use substrate::SubstrateConfig; - -/// This represents the configuration needed for a specific chain. This includes -/// any hardcoded types we need to know about for that chain, as well as a means to -/// obtain historic types for that chain. -pub trait Config: RpcConfig { - /// The type of hashing used by the runtime. - type Hash: Clone - + Copy - + Display - + Into<::Hash> - + From<::Hash>; - - /// Return the spec version for a given block number, if available. - /// - /// The [`crate::client::OnlineClient`] will look this up on chain if it's not available here, - /// but the [`crate::client::OfflineClient`] will error if this is not available for the required block number. - fn spec_version_for_block_number(&self, block_number: u64) -> Option; - - /// Return the metadata for a given spec version, if available. - /// - /// The [`crate::client::OnlineClient`] will look this up on chain if it's not available here, and then - /// call [`Config::set_metadata_for_spec_version`] to give the configuration the opportunity to cache it. - /// The [`crate::client::OfflineClient`] will error if this is not available for the required spec version. - fn metadata_for_spec_version( - &self, - spec_version: u32, - ) -> Option>; - - /// Set some metadata for a given spec version. the [`crate::client::OnlineClient`] will call this if it has - /// to retrieve metadata from the chain, to give this the opportunity to cache it. The configuration can - /// do nothing if it prefers. - fn set_metadata_for_spec_version( - &self, - spec_version: u32, - metadata: Arc, - ); - - /// Return legacy types (ie types to use with Runtimes that return pre-V14 metadata) for a given spec version. - fn legacy_types_for_spec_version<'this>( - &'this self, - spec_version: u32, - ) -> TypeRegistrySet<'this>; - - /// Hash some bytes, for instance a block header or extrinsic, for this chain. - fn hash(s: &[u8]) -> ::Hash; -} diff --git a/historic/src/config/polkadot.rs b/historic/src/config/polkadot.rs deleted file mode 100644 index b42e5690f6b..00000000000 --- a/historic/src/config/polkadot.rs +++ /dev/null @@ -1,88 +0,0 @@ -use super::Config; -use super::SubstrateConfig; -use scale_info_legacy::{ChainTypeRegistry, TypeRegistrySet}; -use std::sync::Arc; - -/// Configuration that's suitable for the Polkadot Relay Chain -pub struct PolkadotConfig(SubstrateConfig); - -impl PolkadotConfig { - /// Create a new PolkadotConfig. - pub fn new() -> Self { - let config = SubstrateConfig::new() - .set_legacy_types(frame_decode::legacy_types::polkadot::relay_chain()); - - // TODO: Set spec versions as well with known spec version changes, to speed - // up accessing historic blocks within the known ranges. For now, we just let - // the online client look these up on chain. - - Self(config) - } - - /// Set the metadata to be used for decoding blocks at the given spec versions. - pub fn set_metadata_for_spec_versions( - mut self, - ranges: impl Iterator, - ) -> Self { - self = Self(self.0.set_metadata_for_spec_versions(ranges)); - self - } - - /// Given an iterator of block ranges to spec version of the form `(start, end, spec_version)`, add them - /// to this configuration. - pub fn set_spec_version_for_block_ranges( - mut self, - ranges: impl Iterator, - ) -> Self { - self = Self(self.0.set_spec_version_for_block_ranges(ranges)); - self - } -} - -/// This hands back the legacy types for the Polkadot Relay Chain, which is what [`PolkadotConfig`] uses internally. -pub fn legacy_types() -> ChainTypeRegistry { - frame_decode::legacy_types::polkadot::relay_chain() -} - -impl Default for PolkadotConfig { - fn default() -> Self { - Self::new() - } -} - -impl Config for PolkadotConfig { - type Hash = ::Hash; - - fn legacy_types_for_spec_version(&'_ self, spec_version: u32) -> TypeRegistrySet<'_> { - self.0.legacy_types_for_spec_version(spec_version) - } - - fn spec_version_for_block_number(&self, block_number: u64) -> Option { - self.0.spec_version_for_block_number(block_number) - } - - fn metadata_for_spec_version( - &self, - spec_version: u32, - ) -> Option> { - self.0.metadata_for_spec_version(spec_version) - } - - fn set_metadata_for_spec_version( - &self, - spec_version: u32, - metadata: Arc, - ) { - self.0.set_metadata_for_spec_version(spec_version, metadata) - } - - fn hash(s: &[u8]) -> ::Hash { - SubstrateConfig::hash(s) - } -} - -impl subxt_rpcs::RpcConfig for PolkadotConfig { - type Hash = ::Hash; - type Header = ::Header; - type AccountId = ::AccountId; -} diff --git a/historic/src/config/substrate.rs b/historic/src/config/substrate.rs deleted file mode 100644 index 75167740716..00000000000 --- a/historic/src/config/substrate.rs +++ /dev/null @@ -1,129 +0,0 @@ -use super::Config; -use crate::utils::RangeMap; -use primitive_types::H256; -use scale_info_legacy::{ChainTypeRegistry, TypeRegistrySet}; -use std::collections::HashMap; -use std::sync::Arc; -use std::sync::Mutex; - -/// Configuration that's suitable for standard Substrate chains (ie those -/// that have not customized the block hash type). -pub struct SubstrateConfig { - legacy_types: ChainTypeRegistry, - spec_version_for_block_number: RangeMap, - metadata_for_spec_version: Mutex>>, -} - -impl SubstrateConfig { - /// Create a new SubstrateConfig with no legacy types. - /// - /// Without any further configuration, this will only work with - /// the [`crate::client::OnlineClient`] for blocks that were produced by Runtimes - /// that emit metadata V14 or later. - /// - /// To support working at any block with the [`crate::client::OnlineClient`], you - /// must call [`SubstrateConfig::set_legacy_types`] with appropriate legacy type - /// definitions. - /// - /// To support working with the [`crate::client::OfflineClient`] at any block, - /// you must also call: - /// - [`SubstrateConfig::set_metadata_for_spec_versions`] to set the metadata to - /// use at each spec version we might encounter. - /// - [`SubstrateConfig::set_spec_version_for_block_ranges`] to set the spec version - /// to use for each range of blocks we might encounter. - pub fn new() -> Self { - Self { - legacy_types: ChainTypeRegistry::empty(), - spec_version_for_block_number: RangeMap::empty(), - metadata_for_spec_version: Mutex::new(HashMap::new()), - } - } - - /// Set the legacy types to use for this configuration. This enables support for - /// blocks produced by Runtimes that emit metadata older than V14. - pub fn set_legacy_types(mut self, legacy_types: ChainTypeRegistry) -> Self { - self.legacy_types = legacy_types; - self - } - - /// Set the metadata to be used for decoding blocks at the given spec versions. - pub fn set_metadata_for_spec_versions( - self, - ranges: impl Iterator, - ) -> Self { - let mut map = self.metadata_for_spec_version.lock().unwrap(); - for (spec_version, metadata) in ranges { - map.insert(spec_version, Arc::new(metadata)); - } - drop(map); - self - } - - /// Given an iterator of block ranges to spec version of the form `(start, end, spec_version)`, add them - /// to this configuration. - pub fn set_spec_version_for_block_ranges( - mut self, - ranges: impl Iterator, - ) -> Self { - let mut m = RangeMap::builder(); - for (start, end, spec_version) in ranges { - m = m.add_range(start, end, spec_version); - } - self.spec_version_for_block_number = m.build(); - self - } -} - -impl Default for SubstrateConfig { - fn default() -> Self { - Self::new() - } -} - -impl Config for SubstrateConfig { - type Hash = H256; - - fn legacy_types_for_spec_version(&'_ self, spec_version: u32) -> TypeRegistrySet<'_> { - self.legacy_types.for_spec_version(spec_version as u64) - } - - fn spec_version_for_block_number(&self, block_number: u64) -> Option { - self.spec_version_for_block_number - .get(block_number) - .copied() - } - - fn metadata_for_spec_version( - &self, - spec_version: u32, - ) -> Option> { - self.metadata_for_spec_version - .lock() - .unwrap() - .get(&spec_version) - .cloned() - } - - fn set_metadata_for_spec_version( - &self, - spec_version: u32, - metadata: Arc, - ) { - self.metadata_for_spec_version - .lock() - .unwrap() - .insert(spec_version, metadata); - } - - fn hash(s: &[u8]) -> ::Hash { - sp_crypto_hashing::blake2_256(s).into() - } -} - -impl subxt_rpcs::RpcConfig for SubstrateConfig { - type Hash = ::Hash; - // We don't use these types in any of the RPC methods we call, - // so don't bother setting them up: - type Header = (); - type AccountId = (); -} diff --git a/historic/src/error.rs b/historic/src/error.rs deleted file mode 100644 index d84f534ffbb..00000000000 --- a/historic/src/error.rs +++ /dev/null @@ -1,325 +0,0 @@ -/// Any error emitted by this crate can convert into this. -// Dev Note: All errors here are transparent, because in many places -// the inner errors are returned and so need to provide enough context -// as-is, so there shouldn't be anything to add here. -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -pub enum Error { - #[error(transparent)] - OnlineClientError(#[from] OnlineClientError), - #[error(transparent)] - OfflineClientAtBlockError(#[from] OfflineClientAtBlockError), - #[error(transparent)] - OnlineClientAtBlockError(#[from] OnlineClientAtBlockError), - #[error(transparent)] - ExtrinsicsError(#[from] ExtrinsicsError), - #[error(transparent)] - ExtrinsicTransactionExtensionError(#[from] ExtrinsicTransactionExtensionError), - #[error(transparent)] - ExtrinsicCallError(#[from] ExtrinsicCallError), - #[error(transparent)] - StorageError(#[from] StorageError), - #[error(transparent)] - StorageKeyError(#[from] StorageKeyError), - #[error(transparent)] - StorageValueError(#[from] StorageValueError), -} - -/// Errors constructing an online client. -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -pub enum OnlineClientError { - #[error("Cannot construct OnlineClient: The URL provided is invalid: {url}")] - InvalidUrl { - /// The URL that was invalid. - url: String, - }, - #[error("Cannot construct OnlineClient owing to an RPC client error: {0}")] - RpcClientError(#[from] subxt_rpcs::Error), -} - -/// Errors constructing an offline client at a specific block number. -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -pub enum OfflineClientAtBlockError { - #[error( - "Cannot construct OfflineClientAtBlock: spec version not found for block number {block_number}" - )] - SpecVersionNotFound { - /// The block number for which the spec version was not found. - block_number: u64, - }, - #[error( - "Cannot construct OfflineClientAtBlock: metadata not found for spec version {spec_version}" - )] - MetadataNotFound { - /// The spec version for which the metadata was not found. - spec_version: u32, - }, -} - -/// Errors constructing an online client at a specific block number. -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -pub enum OnlineClientAtBlockError { - #[error( - "Cannot construct OnlineClientAtBlock: failed to get block hash from node for block {block_number}: {reason}" - )] - CannotGetBlockHash { - /// Block number we failed to get the hash for. - block_number: u64, - /// The error we encountered. - reason: subxt_rpcs::Error, - }, - #[error("Cannot construct OnlineClientAtBlock: block number {block_number} not found")] - BlockNotFound { - /// The block number for which a block was not found. - block_number: u64, - }, - #[error( - "Cannot construct OnlineClientAtBlock: failed to get spec version for block hash {block_hash}: {reason}" - )] - CannotGetSpecVersion { - /// The block hash for which we failed to get the spec version. - block_hash: String, - /// The error we encountered. - reason: String, - }, - #[error( - "Cannot construct OnlineClientAtBlock: failed to get metadata for block hash {block_hash}: {reason}" - )] - CannotGetMetadata { - /// The block hash for which we failed to get the metadata. - block_hash: String, - /// The error we encountered. - reason: String, - }, - #[error( - "Cannot inject types from metadata: failure to parse a type found in the metadata: {parse_error}" - )] - CannotInjectMetadataTypes { - /// Error parsing a type found in the metadata. - parse_error: scale_info_legacy::lookup_name::ParseError, - }, -} - -/// Errors working with extrinsics. -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -pub enum ExtrinsicsError { - #[error("Could not fetch extrinsics: {reason}")] - FetchError { - /// The error that occurred while fetching the extrinsics. - reason: subxt_rpcs::Error, - }, - #[error("Could not decode extrinsic at index {index}: {reason}")] - DecodeError { - /// The extrinsic index that failed to decode. - index: usize, - /// The error that occurred during decoding. - reason: frame_decode::extrinsics::ExtrinsicDecodeError, - }, - #[error( - "Could not decode extrinsic at index {index}: there were undecoded bytes at the end, which implies that we did not decode it properly" - )] - LeftoverBytes { - /// The extrinsic index that had leftover bytes - index: usize, - /// The bytes that were left over after decoding the extrinsic. - leftover_bytes: Vec, - }, - #[error("Could not decode extrinsics: Unsupported metadata version ({version})")] - UnsupportedMetadataVersion { - /// The metadata version that is not supported. - version: u32, - }, -} - -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -pub enum ExtrinsicTransactionExtensionError { - #[error("Could not decode extrinsic transaction extensions: {reason}")] - AllDecodeError { - /// The error that occurred while decoding the transaction extensions. - reason: scale_decode::Error, - }, - #[error( - "Could not decode extrinsic transaction extensions: there were undecoded bytes at the end, which implies that we did not decode it properly" - )] - AllLeftoverBytes { - /// The bytes that were left over after decoding the transaction extensions. - leftover_bytes: Vec, - }, - #[error("Could not decode extrinsic transaction extension {name}: {reason}")] - DecodeError { - /// The name of the transaction extension that failed to decode. - name: String, - /// The error that occurred during decoding. - reason: scale_decode::Error, - }, - #[error( - "Could not decode extrinsic transaction extension {name}: there were undecoded bytes at the end, which implies that we did not decode it properly" - )] - LeftoverBytes { - /// The name of the transaction extension that had leftover bytes. - name: String, - /// The bytes that were left over after decoding the transaction extension. - leftover_bytes: Vec, - }, -} - -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -pub enum ExtrinsicCallError { - #[error("Could not decode the fields in extrinsic call: {reason}")] - FieldsDecodeError { - /// The error that occurred while decoding the fields of the extrinsic call. - reason: scale_decode::Error, - }, - #[error( - "Could not decode the fields in extrinsic call: there were undecoded bytes at the end, which implies that we did not decode it properly" - )] - FieldsLeftoverBytes { - /// The bytes that were left over after decoding the extrinsic call. - leftover_bytes: Vec, - }, - #[error("Could not decode field {name} in extrinsic call: {reason}")] - FieldDecodeError { - /// The name of the field that failed to decode. - name: String, - /// The error that occurred during decoding. - reason: scale_decode::Error, - }, - #[error( - "Could not decode field {name} in extrinsic call: there were undecoded bytes at the end, which implies that we did not decode it properly" - )] - FieldLeftoverBytes { - /// The name of the field that had leftover bytes. - name: String, - /// The bytes that were left over after decoding the extrinsic call. - leftover_bytes: Vec, - }, -} - -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[error("Storage entry is not a map: pallet {pallet_name}, storage {entry_name}")] -pub struct StorageEntryIsNotAMap { - /// The pallet containing the storage entry that was not found. - pub pallet_name: String, - /// The storage entry that was not found. - pub entry_name: String, -} - -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[error("Storage entry is not a plain value: pallet {pallet_name}, storage {entry_name}")] -pub struct StorageEntryIsNotAPlainValue { - /// The pallet containing the storage entry that was not found. - pub pallet_name: String, - /// The storage entry that was not found. - pub entry_name: String, -} - -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -pub enum StorageError { - #[error("RPC error interacting with storage APIs: {reason}")] - RpcError { - /// The error that occurred while fetching the storage entry. - reason: subxt_rpcs::Error, - }, - #[error("Could not fetch next entry from storage subscription: {reason}")] - StorageEventError { - /// The error that occurred while fetching the next storage entry. - reason: String, - }, - #[error("Could not construct storage key: {reason}")] - KeyEncodeError { - /// The error that occurred while constructing the storage key. - reason: frame_decode::storage::StorageKeyEncodeError, - }, - #[error( - "Wrong number of keys provided to fetch a value: expected {num_keys_expected} keys, but got {num_keys_provided}" - )] - WrongNumberOfKeysProvidedForFetch { - /// The number of keys that were provided. - num_keys_provided: usize, - /// The number of keys expected. - num_keys_expected: usize, - }, - #[error( - "too many keys were provided to iterate over a storage entry: expected at most {max_keys_expected} keys, but got {num_keys_provided}" - )] - TooManyKeysProvidedForIter { - /// The number of keys that were provided. - num_keys_provided: usize, - /// The maximum number of keys that we expect. - max_keys_expected: usize, - }, - #[error( - "Could not extract storage information from metadata: Unsupported metadata version ({version})" - )] - UnsupportedMetadataVersion { - /// The metadata version that is not supported. - version: u32, - }, - #[error("Could not extract storage information from metadata: {reason}")] - ExtractStorageInfoError { - /// The error that occurred while extracting storage information from the metadata. - reason: frame_decode::storage::StorageInfoError<'static>, - }, -} - -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -pub enum StorageKeyError { - #[error("Could not decode the storage key: {reason}")] - DecodeError { - /// The error that occurred while decoding the storage key information. - reason: frame_decode::storage::StorageKeyDecodeError, - }, - #[error( - "Could not decode the storage key: there were undecoded bytes at the end, which implies that we did not decode it properly" - )] - LeftoverBytes { - /// The bytes that were left over after decoding the storage key. - leftover_bytes: Vec, - }, - #[error("Could not decode the part of the storage key at index {index}: {reason}")] - DecodePartError { - index: usize, - reason: scale_decode::Error, - }, - #[error("Could not decode values out of the storage key: {reason}")] - DecodeKeyValueError { - reason: frame_decode::storage::StorageKeyValueDecodeError, - }, -} - -#[allow(missing_docs)] -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -pub enum StorageValueError { - #[error("Could not decode storage value: {reason}")] - DecodeError { - /// The error that occurred while decoding the storage value. - reason: scale_decode::Error, - }, - #[error( - "Could not decode storage value: there were undecoded bytes at the end, which implies that we did not decode it properly" - )] - LeftoverBytes { - /// The bytes that were left over after decoding the storage value. - leftover_bytes: Vec, - }, -} diff --git a/historic/src/extrinsics.rs b/historic/src/extrinsics.rs deleted file mode 100644 index 2bfc0e4a95a..00000000000 --- a/historic/src/extrinsics.rs +++ /dev/null @@ -1,76 +0,0 @@ -use crate::client::{OfflineClientAtBlockT, OnlineClientAtBlockT}; -use crate::config::Config; -use crate::error::ExtrinsicsError; - -mod extrinsic_call; -mod extrinsic_info; -mod extrinsic_transaction_extensions; -mod extrinsics_type; - -pub use extrinsic_transaction_extensions::ExtrinsicTransactionParams; -pub use extrinsics_type::{Extrinsic, Extrinsics}; - -/// Work with extrinsics. -pub struct ExtrinsicsClient<'atblock, Client, T> { - client: &'atblock Client, - marker: std::marker::PhantomData, -} - -impl<'atblock, Client, T> ExtrinsicsClient<'atblock, Client, T> { - /// Work with extrinsics. - pub(crate) fn new(client: &'atblock Client) -> Self { - Self { - client, - marker: std::marker::PhantomData, - } - } -} - -// Things that we can do online with extrinsics. -impl<'atblock, 'client: 'atblock, Client, T> ExtrinsicsClient<'atblock, Client, T> -where - T: Config + 'client, - Client: OnlineClientAtBlockT<'client, T>, -{ - /// Fetch the extrinsics for the current block. This is essentially a - /// combination of [`Self::fetch_bytes`] and [`Self::decode_from`]. - pub async fn fetch(&self) -> Result, ExtrinsicsError> { - let bytes: Vec> = self.fetch_bytes().await?; - - // Small optimization; no need to decode anything if no bytes. - if bytes.is_empty() { - return Ok(Extrinsics::empty()); - } - - self.decode_from(bytes) - } - - /// Fetch the bytes for the extrinsics in the current block. - pub async fn fetch_bytes(&self) -> Result>, ExtrinsicsError> { - let bytes: Vec> = self - .client - .rpc_methods() - .archive_v1_body(self.client.block_hash().into()) - .await - .map_err(|e| ExtrinsicsError::FetchError { reason: e })? - .map(|body| body.into_iter().map(|b| b.0).collect()) - .unwrap_or_default(); - - Ok(bytes) - } -} - -// Things that we can do offline with extrinsics. -impl<'atblock, 'client: 'atblock, Client, T> ExtrinsicsClient<'atblock, Client, T> -where - T: Config + 'client, - Client: OfflineClientAtBlockT<'client, T>, -{ - /// Given some bytes representing the extrinsics in this block, decode them into an [`Extrinsics`] type. - pub fn decode_from( - &self, - bytes: Vec>, - ) -> Result, ExtrinsicsError> { - Extrinsics::new(bytes, self.client) - } -} diff --git a/historic/src/extrinsics/extrinsic_call.rs b/historic/src/extrinsics/extrinsic_call.rs deleted file mode 100644 index 83f346c0b95..00000000000 --- a/historic/src/extrinsics/extrinsic_call.rs +++ /dev/null @@ -1,210 +0,0 @@ -use super::extrinsic_info::{AnyExtrinsicInfo, with_info}; -use crate::error::ExtrinsicCallError; -use crate::utils::Either; -use crate::utils::{AnyResolver, AnyTypeId}; -use scale_info_legacy::{LookupName, TypeRegistrySet}; - -/// This represents the call data in the extrinsic. -pub struct ExtrinsicCall<'extrinsics, 'atblock> { - all_bytes: &'extrinsics [u8], - info: &'extrinsics AnyExtrinsicInfo<'atblock>, -} - -impl<'extrinsics, 'atblock> ExtrinsicCall<'extrinsics, 'atblock> { - pub(crate) fn new( - all_bytes: &'extrinsics [u8], - info: &'extrinsics AnyExtrinsicInfo<'atblock>, - ) -> Self { - Self { all_bytes, info } - } - - /// The index of the pallet that this call is for - pub fn pallet_index(&self) -> u8 { - with_info!(&self.info => info.info.pallet_index()) - } - - /// The name of the pallet that this call is for. - pub fn pallet_name(&self) -> &str { - with_info!(&self.info => info.info.pallet_name()) - } - - /// The index of this call. - pub fn index(&self) -> u8 { - with_info!(&self.info => info.info.call_index()) - } - - /// The name of this call. - pub fn name(&self) -> &str { - with_info!(&self.info => info.info.call_name()) - } - - /// Get the raw bytes for the entire call, which includes the pallet and call index - /// bytes as well as the encoded arguments for each of the fields. - pub fn bytes(&self) -> &'extrinsics [u8] { - with_info!(&self.info => &self.all_bytes[info.info.call_data_range()]) - } - - /// Work with the fields in this call. - pub fn fields(&self) -> ExtrinsicCallFields<'extrinsics, 'atblock> { - ExtrinsicCallFields::new(self.all_bytes, self.info) - } -} - -/// This represents the fields of the call. -pub struct ExtrinsicCallFields<'extrinsics, 'atblock> { - all_bytes: &'extrinsics [u8], - info: &'extrinsics AnyExtrinsicInfo<'atblock>, - resolver: AnyResolver<'atblock, 'atblock>, -} - -impl<'extrinsics, 'atblock> ExtrinsicCallFields<'extrinsics, 'atblock> { - pub(crate) fn new( - all_bytes: &'extrinsics [u8], - info: &'extrinsics AnyExtrinsicInfo<'atblock>, - ) -> Self { - let resolver = match info { - AnyExtrinsicInfo::Legacy(info) => AnyResolver::B(info.resolver), - AnyExtrinsicInfo::Current(info) => AnyResolver::A(info.resolver), - }; - - Self { - all_bytes, - info, - resolver, - } - } - - /// Return the bytes representing the fields stored in this extrinsic. - /// - /// # Note - /// - /// This is a subset of [`ExtrinsicCall::bytes`] that does not include the - /// first two bytes that denote the pallet index and the variant index. - pub fn bytes(&self) -> &'extrinsics [u8] { - with_info!(&self.info => &self.all_bytes[info.info.call_data_args_range()]) - } - - /// Iterate over each of the fields of the extrinsic call data. - pub fn iter(&self) -> impl Iterator> { - match &self.info { - AnyExtrinsicInfo::Legacy(info) => { - Either::A(info.info.call_data().map(|named_arg| ExtrinsicCallField { - field_bytes: &self.all_bytes[named_arg.range()], - resolver: &self.resolver, - info: AnyExtrinsicCallFieldInfo::Legacy(ExtrinsicCallFieldInfo { - info: named_arg, - resolver: info.resolver, - }), - })) - } - AnyExtrinsicInfo::Current(info) => { - Either::B(info.info.call_data().map(|named_arg| ExtrinsicCallField { - field_bytes: &self.all_bytes[named_arg.range()], - resolver: &self.resolver, - info: AnyExtrinsicCallFieldInfo::Current(ExtrinsicCallFieldInfo { - info: named_arg, - resolver: info.resolver, - }), - })) - } - } - } - - /// Attempt to decode the fields into the given type. - pub fn decode_as(&self) -> Result { - with_info!(&self.info => { - let cursor = &mut self.bytes(); - let mut fields = &mut info.info.call_data().map(|named_arg| { - scale_decode::Field::new(named_arg.ty().clone(), Some(named_arg.name())) - }); - - let decoded = T::decode_as_fields(cursor, &mut fields, info.resolver) - .map_err(|e| ExtrinsicCallError::FieldsDecodeError { reason: e })?; - - if !cursor.is_empty() { - return Err(ExtrinsicCallError::FieldsLeftoverBytes { - leftover_bytes: cursor.to_vec(), - }) - } - - Ok(decoded) - }) - } -} - -pub struct ExtrinsicCallField<'fields, 'extrinsics, 'atblock> { - field_bytes: &'extrinsics [u8], - info: AnyExtrinsicCallFieldInfo<'extrinsics, 'atblock>, - resolver: &'fields AnyResolver<'atblock, 'atblock>, -} - -enum AnyExtrinsicCallFieldInfo<'extrinsics, 'atblock> { - Legacy(ExtrinsicCallFieldInfo<'extrinsics, 'atblock, LookupName, TypeRegistrySet<'atblock>>), - Current(ExtrinsicCallFieldInfo<'extrinsics, 'atblock, u32, scale_info::PortableRegistry>), -} - -struct ExtrinsicCallFieldInfo<'extrinsics, 'atblock, TypeId, Resolver> { - info: &'extrinsics frame_decode::extrinsics::NamedArg<'atblock, TypeId>, - resolver: &'atblock Resolver, -} - -macro_rules! with_call_field_info { - (&$self:ident.$info:ident => $fn:expr) => { - #[allow(clippy::clone_on_copy)] - match &$self.$info { - AnyExtrinsicCallFieldInfo::Legacy($info) => $fn, - AnyExtrinsicCallFieldInfo::Current($info) => $fn, - } - }; -} - -impl<'fields, 'extrinsics, 'atblock> ExtrinsicCallField<'fields, 'extrinsics, 'atblock> { - /// Get the raw bytes for this field. - pub fn bytes(&self) -> &'extrinsics [u8] { - self.field_bytes - } - - /// Get the name of this field. - pub fn name(&self) -> &'extrinsics str { - with_call_field_info!(&self.info => info.info.name()) - } - - /// Visit the given field with a [`scale_decode::visitor::Visitor`]. This is like a lower level - /// version of [`ExtrinsicCallField::decode_as`], as the visitor is able to preserve lifetimes - /// and has access to more type information than is available via [`ExtrinsicCallField::decode_as`]. - pub fn visit< - V: scale_decode::visitor::Visitor>, - >( - &self, - visitor: V, - ) -> Result, V::Error> { - let type_id = match &self.info { - AnyExtrinsicCallFieldInfo::Current(info) => AnyTypeId::A(*info.info.ty()), - AnyExtrinsicCallFieldInfo::Legacy(info) => AnyTypeId::B(info.info.ty().clone()), - }; - let cursor = &mut self.bytes(); - - scale_decode::visitor::decode_with_visitor(cursor, type_id, self.resolver, visitor) - } - - /// Attempt to decode the value of this field into the given type. - pub fn decode_as(&self) -> Result { - with_call_field_info!(&self.info => { - let cursor = &mut &*self.field_bytes; - let decoded = T::decode_as_type(cursor, info.info.ty().clone(), info.resolver) - .map_err(|e| ExtrinsicCallError::FieldDecodeError { - name: info.info.name().to_string(), - reason: e, - })?; - - if !cursor.is_empty() { - return Err(ExtrinsicCallError::FieldLeftoverBytes { - name: info.info.name().to_string(), - leftover_bytes: cursor.to_vec(), - }); - } - - Ok(decoded) - }) - } -} diff --git a/historic/src/extrinsics/extrinsic_info.rs b/historic/src/extrinsics/extrinsic_info.rs deleted file mode 100644 index 6207b80ead5..00000000000 --- a/historic/src/extrinsics/extrinsic_info.rs +++ /dev/null @@ -1,109 +0,0 @@ -use crate::error::ExtrinsicsError; -use frame_metadata::RuntimeMetadata; -use scale_info_legacy::{LookupName, TypeRegistrySet}; - -// Extrinsic information for modern or legacy extrinsics. -#[allow(clippy::large_enum_variant)] -pub enum AnyExtrinsicInfo<'atblock> { - Legacy(ExtrinsicInfo<'atblock, LookupName, TypeRegistrySet<'atblock>>), - Current(ExtrinsicInfo<'atblock, u32, scale_info::PortableRegistry>), -} - -impl<'atblock> AnyExtrinsicInfo<'atblock> { - /// For a slice of extrinsics, return a vec of information about each one. - pub fn new( - bytes: &[Vec], - metadata: &'atblock RuntimeMetadata, - legacy_types: &'atblock TypeRegistrySet<'atblock>, - ) -> Result, ExtrinsicsError> { - let infos = match metadata { - RuntimeMetadata::V8(m) => extrinsic_info_inner(bytes, m, legacy_types), - RuntimeMetadata::V9(m) => extrinsic_info_inner(bytes, m, legacy_types), - RuntimeMetadata::V10(m) => extrinsic_info_inner(bytes, m, legacy_types), - RuntimeMetadata::V11(m) => extrinsic_info_inner(bytes, m, legacy_types), - RuntimeMetadata::V12(m) => extrinsic_info_inner(bytes, m, legacy_types), - RuntimeMetadata::V13(m) => extrinsic_info_inner(bytes, m, legacy_types), - RuntimeMetadata::V14(m) => extrinsic_info_inner(bytes, m, &m.types), - RuntimeMetadata::V15(m) => extrinsic_info_inner(bytes, m, &m.types), - RuntimeMetadata::V16(m) => extrinsic_info_inner(bytes, m, &m.types), - unknown => { - return Err(ExtrinsicsError::UnsupportedMetadataVersion { - version: unknown.version(), - }); - } - }?; - - fn extrinsic_info_inner<'atblock, Info, Resolver>( - bytes: &[Vec], - args_info: &'atblock Info, - type_resolver: &'atblock Resolver, - ) -> Result>, ExtrinsicsError> - where - Info: frame_decode::extrinsics::ExtrinsicTypeInfo, - Info::TypeId: Clone + core::fmt::Display + core::fmt::Debug + Send + Sync + 'static, - Resolver: scale_type_resolver::TypeResolver, - AnyExtrinsicInfo<'atblock>: From>, - { - bytes - .iter() - .enumerate() - .map(|(index, bytes)| { - let cursor = &mut &**bytes; - let extrinsic_info = frame_decode::extrinsics::decode_extrinsic( - cursor, - args_info, - type_resolver, - ) - .map_err(|reason| ExtrinsicsError::DecodeError { index, reason })?; - - if !cursor.is_empty() { - return Err(ExtrinsicsError::LeftoverBytes { - index, - leftover_bytes: cursor.to_vec(), - }); - } - - Ok(ExtrinsicInfo { - info: extrinsic_info, - resolver: type_resolver, - } - .into()) - }) - .collect() - } - - Ok(infos) - } -} - -impl<'atblock> From>> - for AnyExtrinsicInfo<'atblock> -{ - fn from(info: ExtrinsicInfo<'atblock, LookupName, TypeRegistrySet<'atblock>>) -> Self { - AnyExtrinsicInfo::Legacy(info) - } -} -impl<'atblock> From> - for AnyExtrinsicInfo<'atblock> -{ - fn from(info: ExtrinsicInfo<'atblock, u32, scale_info::PortableRegistry>) -> Self { - AnyExtrinsicInfo::Current(info) - } -} - -// Extrinsic information for a specific type ID and resolver type. -pub struct ExtrinsicInfo<'atblock, TypeId, Resolver> { - pub info: frame_decode::extrinsics::Extrinsic<'atblock, TypeId>, - pub resolver: &'atblock Resolver, -} - -macro_rules! with_info { - (&$self:ident.$info:ident => $fn:expr) => { - #[allow(clippy::clone_on_copy)] - match &$self.$info { - AnyExtrinsicInfo::Legacy($info) => $fn, - AnyExtrinsicInfo::Current($info) => $fn, - } - }; -} -pub(crate) use with_info; diff --git a/historic/src/extrinsics/extrinsic_transaction_extensions.rs b/historic/src/extrinsics/extrinsic_transaction_extensions.rs deleted file mode 100644 index 3f360102510..00000000000 --- a/historic/src/extrinsics/extrinsic_transaction_extensions.rs +++ /dev/null @@ -1,213 +0,0 @@ -use super::extrinsic_info::AnyExtrinsicInfo; -use crate::error::ExtrinsicTransactionExtensionError; -use crate::utils::Either; -use frame_decode::helpers::scale_decode; -use scale_info_legacy::{LookupName, TypeRegistrySet}; - -// Extrinsic extensions information for modern or legacy extrinsics. -enum AnyExtrinsicExtensionsInfo<'extrinsics, 'atblock> { - Legacy(ExtrinsicExtensionsInfo<'extrinsics, 'atblock, LookupName, TypeRegistrySet<'atblock>>), - Current(ExtrinsicExtensionsInfo<'extrinsics, 'atblock, u32, scale_info::PortableRegistry>), -} - -struct ExtrinsicExtensionsInfo<'extrinsics, 'atblock, TypeId, Resolver> { - info: &'extrinsics frame_decode::extrinsics::ExtrinsicExtensions<'atblock, TypeId>, - resolver: &'atblock Resolver, -} - -/// This represents the transaction extensions of an extrinsic. -pub struct ExtrinsicTransactionParams<'extrinsics, 'atblock> { - all_bytes: &'extrinsics [u8], - info: AnyExtrinsicExtensionsInfo<'extrinsics, 'atblock>, -} - -macro_rules! with_extensions_info { - (&$self:ident.$info:ident => $fn:expr) => { - #[allow(clippy::clone_on_copy)] - match &$self.$info { - AnyExtrinsicExtensionsInfo::Legacy($info) => $fn, - AnyExtrinsicExtensionsInfo::Current($info) => $fn, - } - }; -} - -impl<'extrinsics, 'atblock> ExtrinsicTransactionParams<'extrinsics, 'atblock> { - pub(crate) fn new( - all_bytes: &'extrinsics [u8], - info: &'extrinsics AnyExtrinsicInfo<'atblock>, - ) -> Option { - match info { - AnyExtrinsicInfo::Current(info) => { - let extension_info = info.info.transaction_extension_payload()?; - Some(Self { - all_bytes, - info: AnyExtrinsicExtensionsInfo::Current(ExtrinsicExtensionsInfo { - info: extension_info, - resolver: info.resolver, - }), - }) - } - AnyExtrinsicInfo::Legacy(info) => { - let extension_info = info.info.transaction_extension_payload()?; - Some(Self { - all_bytes, - info: AnyExtrinsicExtensionsInfo::Legacy(ExtrinsicExtensionsInfo { - info: extension_info, - resolver: info.resolver, - }), - }) - } - } - } - - /// Get the raw bytes for all of the transaction extensions. - pub fn bytes(&self) -> &'extrinsics [u8] { - with_extensions_info!(&self.info => &self.all_bytes[info.info.range()]) - } - - /// iterate over each of the transaction extensions in this extrinsic. - pub fn iter( - &self, - ) -> impl Iterator> { - match &self.info { - AnyExtrinsicExtensionsInfo::Legacy(extension_info) => { - let iter = extension_info - .info - .iter() - .map(|s| ExtrinsicTransactionExtension { - bytes: &self.all_bytes[s.range()], - info: ExtrinsicExtensionInfo { - name: s.name(), - type_id: s.ty(), - resolver: extension_info.resolver, - } - .into(), - }); - Either::A(iter) - } - AnyExtrinsicExtensionsInfo::Current(extension_info) => { - let iter = extension_info - .info - .iter() - .map(|s| ExtrinsicTransactionExtension { - bytes: &self.all_bytes[s.range()], - info: ExtrinsicExtensionInfo { - name: s.name(), - type_id: s.ty(), - resolver: extension_info.resolver, - } - .into(), - }); - Either::B(iter) - } - } - } - - /// Attempt to decode the transaction extensions into a type where each field name is the name of the transaction - /// extension and the field value is the decoded extension. - pub fn decode_as( - &self, - ) -> Result { - with_extensions_info!(&self.info => { - let cursor = &mut self.bytes(); - let mut fields = &mut info.info.iter().map(|named_arg| { - scale_decode::Field::new(named_arg.ty().clone(), Some(named_arg.name())) - }); - - let decoded = T::decode_as_fields(cursor, &mut fields, info.resolver) - .map_err(|e| ExtrinsicTransactionExtensionError::AllDecodeError { reason: e })?; - - if !cursor.is_empty() { - return Err(ExtrinsicTransactionExtensionError::AllLeftoverBytes { - leftover_bytes: cursor.to_vec(), - }) - } - - Ok(decoded) - }) - } -} - -// Extrinsic single extension information for modern or legacy extrinsics. -enum AnyExtrinsicExtensionInfo<'extrinsics, 'atblock> { - Legacy(ExtrinsicExtensionInfo<'extrinsics, 'atblock, LookupName, TypeRegistrySet<'atblock>>), - Current(ExtrinsicExtensionInfo<'extrinsics, 'atblock, u32, scale_info::PortableRegistry>), -} - -impl<'extrinsics, 'atblock> - From>> - for AnyExtrinsicExtensionInfo<'extrinsics, 'atblock> -{ - fn from( - info: ExtrinsicExtensionInfo<'extrinsics, 'atblock, LookupName, TypeRegistrySet<'atblock>>, - ) -> Self { - AnyExtrinsicExtensionInfo::Legacy(info) - } -} -impl<'extrinsics, 'atblock> - From> - for AnyExtrinsicExtensionInfo<'extrinsics, 'atblock> -{ - fn from( - info: ExtrinsicExtensionInfo<'extrinsics, 'atblock, u32, scale_info::PortableRegistry>, - ) -> Self { - AnyExtrinsicExtensionInfo::Current(info) - } -} - -struct ExtrinsicExtensionInfo<'extrinsics, 'atblock, TypeId, Resolver> { - name: &'extrinsics str, - type_id: &'extrinsics TypeId, - resolver: &'atblock Resolver, -} - -macro_rules! with_extension_info { - (&$self:ident.$info:ident => $fn:expr) => { - #[allow(clippy::clone_on_copy)] - match &$self.$info { - AnyExtrinsicExtensionInfo::Legacy($info) => $fn, - AnyExtrinsicExtensionInfo::Current($info) => $fn, - } - }; -} - -/// This represents a single transaction extension in an extrinsic. -pub struct ExtrinsicTransactionExtension<'extrinsics, 'atblock> { - bytes: &'extrinsics [u8], - info: AnyExtrinsicExtensionInfo<'extrinsics, 'atblock>, -} - -impl<'extrinsics, 'atblock> ExtrinsicTransactionExtension<'extrinsics, 'atblock> { - /// The bytes for this transaction extension. - pub fn bytes(&self) -> &'extrinsics [u8] { - self.bytes - } - - /// The name/identifier for this transaction extension. - pub fn name(&self) -> &'extrinsics str { - with_extension_info!(&self.info => info.name) - } - - /// Decode the bytes for this transaction extension into a type that implements `scale_decode::DecodeAsType`. - pub fn decode_as( - &self, - ) -> Result { - with_extension_info!(&self.info => { - let cursor = &mut &*self.bytes; - let decoded = T::decode_as_type(cursor, info.type_id.clone(), info.resolver) - .map_err(|reason| ExtrinsicTransactionExtensionError::DecodeError { - name: info.name.to_string(), - reason - })?; - - if !cursor.is_empty() { - return Err(ExtrinsicTransactionExtensionError::LeftoverBytes { - name: info.name.to_string(), - leftover_bytes: cursor.to_vec(), - }); - } - - Ok(decoded) - }) - } -} diff --git a/historic/src/extrinsics/extrinsics_type.rs b/historic/src/extrinsics/extrinsics_type.rs deleted file mode 100644 index 520b3147596..00000000000 --- a/historic/src/extrinsics/extrinsics_type.rs +++ /dev/null @@ -1,112 +0,0 @@ -use super::extrinsic_call::ExtrinsicCall; -use super::extrinsic_info::{AnyExtrinsicInfo, with_info}; -use super::extrinsic_transaction_extensions::ExtrinsicTransactionParams; -use crate::client::OfflineClientAtBlockT; -use crate::config::Config; -use crate::error::ExtrinsicsError; - -/// This represents some extrinsics in a block, and carries everything that we need to decode information out of them. -pub struct Extrinsics<'atblock> { - bytes: Vec>, - // Each index in this vec should line up with one index in the above vec. - infos: Vec>, -} - -impl<'atblock> Extrinsics<'atblock> { - // In here we hide the messy logic needed to decode extrinsics into a consistent output given either current or legacy metadata. - pub(crate) fn new<'client: 'atblock, T, Client>( - bytes: Vec>, - client: &'atblock Client, - ) -> Result - where - T: Config + 'client, - Client: OfflineClientAtBlockT<'client, T>, - { - let infos = AnyExtrinsicInfo::new(&bytes, client.metadata(), client.legacy_types())?; - Ok(Extrinsics { bytes, infos }) - } - - pub(crate) fn empty() -> Self { - Self { - bytes: vec![], - infos: vec![], - } - } - - /// How many extrinsics are in this block? - pub fn len(&self) -> usize { - self.bytes.len() - } - - /// Are there any extrinsics in this block? - pub fn is_empty(&self) -> bool { - self.bytes.is_empty() - } - - /// Iterate over the extrinsics. - pub fn iter(&self) -> impl Iterator> { - self.bytes - .iter() - .zip(self.infos.iter()) - .enumerate() - .map(|(idx, (bytes, info))| Extrinsic { idx, bytes, info }) - } -} - -/// This represents an extrinsic, and carries everything that we need to decode information out of it. -pub struct Extrinsic<'extrinsics, 'atblock> { - idx: usize, - bytes: &'extrinsics [u8], - info: &'extrinsics AnyExtrinsicInfo<'atblock>, -} - -impl<'extrinsics, 'atblock> Extrinsic<'extrinsics, 'atblock> { - /// Get the index of this extrinsic in the block. - pub fn index(&self) -> usize { - self.idx - } - - /// Get the raw bytes of this extrinsic. - pub fn bytes(&self) -> &'extrinsics [u8] { - self.bytes - } - - /// Is this extrinsic signed? - pub fn is_signed(&self) -> bool { - with_info!(&self.info => info.info.is_signed()) - } - - /// Return information about the call that this extrinsic is making. - pub fn call(&self) -> ExtrinsicCall<'extrinsics, 'atblock> { - ExtrinsicCall::new(self.bytes, self.info) - } - - /// Return only the bytes of the address that signed this extrinsic. - /// - /// # Note - /// - /// Returns `None` if the extrinsic is not signed. - pub fn address_bytes(&self) -> Option<&'extrinsics [u8]> { - with_info!(&self.info => { - info.info - .signature_payload() - .map(|s| &self.bytes[s.address_range()]) - }) - } - - /// Returns Some(signature_bytes) if the extrinsic was signed otherwise None is returned. - pub fn signature_bytes(&self) -> Option<&'extrinsics [u8]> { - with_info!(&self.info => { - info.info - .signature_payload() - .map(|s| &self.bytes[s.signature_range()]) - }) - } - - /// Get information about the transaction extensions of this extrinsic. - pub fn transaction_extensions( - &self, - ) -> Option> { - ExtrinsicTransactionParams::new(self.bytes, self.info) - } -} diff --git a/historic/src/lib.rs b/historic/src/lib.rs deleted file mode 100644 index 8c15ab2e6fa..00000000000 --- a/historic/src/lib.rs +++ /dev/null @@ -1,27 +0,0 @@ -//! `subxt-historic` is a library for working with non head-of-chain data on Substrate-based blockchains. - -// TODO: Remove this when we're ready to release, and document everything! -#![allow(missing_docs)] - -mod utils; - -pub mod client; -pub mod config; -pub mod error; -pub mod extrinsics; -pub mod storage; - -pub use client::{OfflineClient, OnlineClient}; -pub use config::polkadot::PolkadotConfig; -pub use config::substrate::SubstrateConfig; -pub use error::Error; - -/// External types and crates that may be useful. -pub mod ext { - pub use futures::stream::{Stream, StreamExt}; -} - -/// Helper types that could be useful. -pub mod helpers { - pub use crate::utils::{AnyResolver, AnyResolverError, AnyTypeId}; -} diff --git a/historic/src/storage.rs b/historic/src/storage.rs deleted file mode 100644 index 2d818b9b4e1..00000000000 --- a/historic/src/storage.rs +++ /dev/null @@ -1,346 +0,0 @@ -mod list_storage_entries_any; -mod storage_entry; -mod storage_info; -mod storage_key; -mod storage_value; - -use crate::client::{OfflineClientAtBlockT, OnlineClientAtBlockT}; -use crate::config::Config; -use crate::error::StorageError; -use crate::storage::storage_info::with_info; -use std::borrow::Cow; -use std::sync::Arc; -use storage_info::AnyStorageInfo; - -pub use storage_entry::StorageEntry; -pub use storage_key::{StorageHasher, StorageKey, StorageKeyPart}; -pub use storage_value::StorageValue; -// We take how storage keys can be passed in from `frame-decode`, so re-export here. -pub use frame_decode::storage::{EncodableValues, IntoEncodableValues}; - -/// Work with storage. -pub struct StorageClient<'atblock, Client, T> { - client: &'atblock Client, - marker: std::marker::PhantomData, -} - -impl<'atblock, Client, T> StorageClient<'atblock, Client, T> { - /// Work with storage. - pub(crate) fn new(client: &'atblock Client) -> Self { - Self { - client, - marker: std::marker::PhantomData, - } - } -} - -// Things that we can do offline with storage. -impl<'atblock, Client, T> StorageClient<'atblock, Client, T> -where - T: Config + 'atblock, - Client: OfflineClientAtBlockT<'atblock, T>, -{ - /// Select the storage entry you'd like to work with. - pub fn entry( - &self, - pallet_name: impl Into, - entry_name: impl Into, - ) -> Result, StorageError> { - let pallet_name = pallet_name.into(); - let entry_name = entry_name.into(); - - let storage_info = AnyStorageInfo::new( - &pallet_name, - &entry_name, - self.client.metadata(), - self.client.legacy_types(), - )?; - - Ok(StorageEntryClient { - client: self.client, - pallet_name, - entry_name, - info: Arc::new(storage_info), - marker: std::marker::PhantomData, - }) - } - - /// Iterate over all of the storage entries listed in the metadata for the current block. This does **not** include well known - /// storage entries like `:code` which are not listed in the metadata. - pub fn entries(&self) -> impl Iterator> { - let client = self.client; - let metadata = client.metadata(); - - let mut pallet_name = Cow::Borrowed(""); - list_storage_entries_any::list_storage_entries_any(metadata).filter_map(move |entry| { - match entry { - frame_decode::storage::StorageEntry::In(name) => { - // Set the pallet name for upcoming entries: - pallet_name = name; - None - } - frame_decode::storage::StorageEntry::Name(entry_name) => { - // Output each entry with the last seen pallet name: - Some(StorageEntriesItem { - pallet_name: pallet_name.clone(), - entry_name, - client: self.client, - marker: std::marker::PhantomData, - }) - } - } - }) - } -} - -/// Working with a specific storage entry. -pub struct StorageEntriesItem<'atblock, Client, T> { - pallet_name: Cow<'atblock, str>, - entry_name: Cow<'atblock, str>, - client: &'atblock Client, - marker: std::marker::PhantomData, -} - -impl<'atblock, Client, T> StorageEntriesItem<'atblock, Client, T> -where - T: Config + 'atblock, - Client: OfflineClientAtBlockT<'atblock, T>, -{ - /// The pallet name. - pub fn pallet_name(&self) -> &str { - &self.pallet_name - } - - /// The storage entry name. - pub fn entry_name(&self) -> &str { - &self.entry_name - } - - /// Extract the relevant storage information so that we can work with this entry. - pub fn entry(&self) -> Result, StorageError> { - StorageClient { - client: self.client, - marker: std::marker::PhantomData, - } - .entry(&*self.pallet_name, &*self.entry_name) - } -} - -/// A client for working with a specific storage entry. -pub struct StorageEntryClient<'atblock, Client, T> { - client: &'atblock Client, - pallet_name: String, - entry_name: String, - info: Arc>, - marker: std::marker::PhantomData, -} - -impl<'atblock, Client, T> StorageEntryClient<'atblock, Client, T> -where - T: Config + 'atblock, - Client: OfflineClientAtBlockT<'atblock, T>, -{ - /// Get the pallet name. - pub fn pallet_name(&self) -> &str { - &self.pallet_name - } - - /// Get the storage entry name. - pub fn entry_name(&self) -> &str { - &self.entry_name - } - - /// The key which points to this storage entry (but not necessarily any values within it). - pub fn key_prefix(&self) -> [u8; 32] { - let pallet_name = &*self.pallet_name; - let entry_name = &*self.entry_name; - - frame_decode::storage::encode_storage_key_prefix(pallet_name, entry_name) - } - - /// Return the default value for this storage entry, if there is one. Returns `None` if there - /// is no default value. - pub fn default_value(&self) -> Option> { - with_info!(info = &*self.info => { - info.info.default_value.as_ref().map(|default_value| { - StorageValue::new(self.info.clone(), default_value.clone()) - }) - }) - } -} - -impl<'atblock, Client, T> StorageEntryClient<'atblock, Client, T> -where - T: Config + 'atblock, - Client: OnlineClientAtBlockT<'atblock, T>, -{ - /// Fetch a specific key in this map. If the number of keys provided is not equal - /// to the number of keys required to fetch a single value from the map, then an error - /// will be emitted. If no value exists but there is a default value for this storage - /// entry, then the default value will be returned. Else, `None` will be returned. - pub async fn fetch( - &self, - keys: Keys, - ) -> Result>, StorageError> { - let expected_num_keys = with_info!(info = &*self.info => { - info.info.keys.len() - }); - - // For fetching, we need exactly as many keys as exist for a storage entry. - if expected_num_keys != keys.num_encodable_values() { - return Err(StorageError::WrongNumberOfKeysProvidedForFetch { - num_keys_provided: keys.num_encodable_values(), - num_keys_expected: expected_num_keys, - }); - } - - let key_bytes = self.key(keys)?; - let info = self.info.clone(); - let value = fetch(self.client, &key_bytes) - .await? - .map(|bytes| StorageValue::new(info, Cow::Owned(bytes))) - .or_else(|| self.default_value()); - - Ok(value) - } - - /// Iterate over the values underneath the provided keys. - pub async fn iter( - &self, - keys: Keys, - ) -> Result< - impl futures::Stream, StorageError>> - + Unpin - + use<'atblock, Client, T, Keys>, - StorageError, - > { - use futures::stream::StreamExt; - use subxt_rpcs::methods::chain_head::{ - ArchiveStorageEvent, StorageQuery, StorageQueryType, - }; - - let expected_num_keys = with_info!(info = &*self.info => { - info.info.keys.len() - }); - - // For iterating, we need at most one less key than the number that exists for a storage entry. - // TODO: The error message will be confusing if == keys are provided! - if keys.num_encodable_values() >= expected_num_keys { - return Err(StorageError::TooManyKeysProvidedForIter { - num_keys_provided: keys.num_encodable_values(), - max_keys_expected: expected_num_keys - 1, - }); - } - - let block_hash = self.client.block_hash(); - let key_bytes = self.key(keys)?; - - let items = std::iter::once(StorageQuery { - key: &*key_bytes, - query_type: StorageQueryType::DescendantsValues, - }); - - let sub = self - .client - .rpc_methods() - .archive_v1_storage(block_hash.into(), items, None) - .await - .map_err(|e| StorageError::RpcError { reason: e })?; - - let info = self.info.clone(); - let sub = sub.filter_map(move |item| { - let info = info.clone(); - async move { - let item = match item { - Ok(ArchiveStorageEvent::Item(item)) => item, - Ok(ArchiveStorageEvent::Error(err)) => { - return Some(Err(StorageError::StorageEventError { reason: err.error })); - } - Ok(ArchiveStorageEvent::Done) => return None, - Err(e) => return Some(Err(StorageError::RpcError { reason: e })), - }; - - item.value - .map(|value| Ok(StorageEntry::new(info, item.key.0, Cow::Owned(value.0)))) - } - }); - - Ok(Box::pin(sub)) - } - - // Encode a storage key for this storage entry to bytes. The key can be a partial key - // (i.e there are still multiple values below it) or a complete key that points to a specific value. - // - // Dev note: We don't have any functions that can take an already-encoded key and fetch an entry from - // it yet, so we don't expose this. If we did expose it, we might want to return some struct that wraps - // the key bytes and some metadata about them. Or maybe just fetch_raw and iter_raw. - fn key(&self, keys: Keys) -> Result, StorageError> { - with_info!(info = &*self.info => { - let key_bytes = frame_decode::storage::encode_storage_key_with_info( - &self.pallet_name, - &self.entry_name, - keys, - &info.info, - info.resolver, - ).map_err(|e| StorageError::KeyEncodeError { reason: e })?; - Ok(key_bytes) - }) - } -} - -// Fetch a single storage value by its key. -async fn fetch<'atblock, Client, T>( - client: &Client, - key_bytes: &[u8], -) -> Result>, StorageError> -where - T: Config + 'atblock, - Client: OnlineClientAtBlockT<'atblock, T>, -{ - use subxt_rpcs::methods::chain_head::{ArchiveStorageEvent, StorageQuery, StorageQueryType}; - - let query = StorageQuery { - key: key_bytes, - query_type: StorageQueryType::Value, - }; - - let mut response_stream = client - .rpc_methods() - .archive_v1_storage(client.block_hash().into(), std::iter::once(query), None) - .await - .map_err(|e| StorageError::RpcError { reason: e })?; - - let value = response_stream - .next() - .await - .transpose() - .map_err(|e| StorageError::RpcError { reason: e })?; - - // No value found. - let Some(value) = value else { - return Ok(None); - }; - - let item = match value { - ArchiveStorageEvent::Item(item) => item, - // if it errors, return the error: - ArchiveStorageEvent::Error(err) => { - return Err(StorageError::StorageEventError { reason: err.error }); - } - // if it's done, it means no value was returned: - ArchiveStorageEvent::Done => return Ok(None), - }; - - // This shouldn't happen, but if it does, the value we wanted wasn't found. - if item.key.0 != key_bytes { - return Ok(None); - } - - // The bytes for the storage value. If this is None, then the API is misbehaving, - // ot no matching value was found. - let Some(value_bytes) = item.value else { - return Ok(None); - }; - - Ok(Some(value_bytes.0)) -} diff --git a/historic/src/storage/list_storage_entries_any.rs b/historic/src/storage/list_storage_entries_any.rs deleted file mode 100644 index e97bafd7480..00000000000 --- a/historic/src/storage/list_storage_entries_any.rs +++ /dev/null @@ -1,35 +0,0 @@ -use frame_decode::storage::StorageEntryInfo; -use frame_metadata::RuntimeMetadata; - -pub use frame_decode::storage::StorageEntry; - -/// Returns an iterator listing the available storage entries in some metadata. -/// -/// This basically calls [`StorageEntryInfo::storage_entries()`] for each metadata version, -/// returning an empty iterator where applicable (ie when passing legacy metadata and the -/// `legacy` features flag is not enabled). -pub fn list_storage_entries_any( - metadata: &RuntimeMetadata, -) -> impl Iterator> { - match metadata { - RuntimeMetadata::V0(_deprecated_metadata) - | RuntimeMetadata::V1(_deprecated_metadata) - | RuntimeMetadata::V2(_deprecated_metadata) - | RuntimeMetadata::V3(_deprecated_metadata) - | RuntimeMetadata::V4(_deprecated_metadata) - | RuntimeMetadata::V5(_deprecated_metadata) - | RuntimeMetadata::V6(_deprecated_metadata) - | RuntimeMetadata::V7(_deprecated_metadata) => { - Box::new(core::iter::empty()) as Box>> - } - RuntimeMetadata::V8(m) => Box::new(m.storage_entries()), - RuntimeMetadata::V9(m) => Box::new(m.storage_entries()), - RuntimeMetadata::V10(m) => Box::new(m.storage_entries()), - RuntimeMetadata::V11(m) => Box::new(m.storage_entries()), - RuntimeMetadata::V12(m) => Box::new(m.storage_entries()), - RuntimeMetadata::V13(m) => Box::new(m.storage_entries()), - RuntimeMetadata::V14(m) => Box::new(m.storage_entries()), - RuntimeMetadata::V15(m) => Box::new(m.storage_entries()), - RuntimeMetadata::V16(m) => Box::new(m.storage_entries()), - } -} diff --git a/historic/src/storage/storage_entry.rs b/historic/src/storage/storage_entry.rs deleted file mode 100644 index 90aa0f68409..00000000000 --- a/historic/src/storage/storage_entry.rs +++ /dev/null @@ -1,48 +0,0 @@ -use super::storage_info::AnyStorageInfo; -use super::storage_key::StorageKey; -use super::storage_value::StorageValue; -use crate::error::StorageKeyError; -use std::borrow::Cow; -use std::sync::Arc; - -/// This represents a storage entry, which is a key-value pair in the storage. -pub struct StorageEntry<'atblock> { - key: Vec, - // This contains the storage information already: - value: StorageValue<'atblock>, -} - -impl<'atblock> StorageEntry<'atblock> { - /// Create a new storage entry. - pub fn new( - info: Arc>, - key: Vec, - value: Cow<'atblock, [u8]>, - ) -> Self { - Self { - key, - value: StorageValue::new(info, value), - } - } - - /// Get the raw bytes for this storage entry's key. - pub fn key_bytes(&self) -> &[u8] { - &self.key - } - - /// Consume this storage entry and return the raw bytes for the key and value. - pub fn into_key_and_value_bytes(self) -> (Vec, Vec) { - (self.key, self.value.into_bytes()) - } - - /// Decode the key for this storage entry. This gives back a type from which we can - /// decode specific parts of the key hash (where applicable). - pub fn key(&'_ self) -> Result, StorageKeyError> { - StorageKey::new(&self.value.info, &self.key) - } - - /// Return the storage value. - pub fn value(&self) -> &StorageValue<'atblock> { - &self.value - } -} diff --git a/historic/src/storage/storage_info.rs b/historic/src/storage/storage_info.rs deleted file mode 100644 index 685a0ff7667..00000000000 --- a/historic/src/storage/storage_info.rs +++ /dev/null @@ -1,102 +0,0 @@ -use crate::error::StorageError; -use frame_decode::storage::StorageTypeInfo; -use frame_metadata::RuntimeMetadata; -use scale_info_legacy::{LookupName, TypeRegistrySet}; - -pub enum AnyStorageInfo<'atblock> { - Legacy(StorageInfo<'atblock, LookupName, TypeRegistrySet<'atblock>>), - Current(StorageInfo<'atblock, u32, scale_info::PortableRegistry>), -} - -impl<'atblock> AnyStorageInfo<'atblock> { - /// For a slice of storage entries, return a vec of information about each one. - pub fn new( - pallet_name: &str, - entry_name: &str, - metadata: &'atblock RuntimeMetadata, - legacy_types: &'atblock TypeRegistrySet<'atblock>, - ) -> Result { - let info = match metadata { - RuntimeMetadata::V8(m) => storage_info_inner(pallet_name, entry_name, m, legacy_types), - RuntimeMetadata::V9(m) => storage_info_inner(pallet_name, entry_name, m, legacy_types), - RuntimeMetadata::V10(m) => storage_info_inner(pallet_name, entry_name, m, legacy_types), - RuntimeMetadata::V11(m) => storage_info_inner(pallet_name, entry_name, m, legacy_types), - RuntimeMetadata::V12(m) => storage_info_inner(pallet_name, entry_name, m, legacy_types), - RuntimeMetadata::V13(m) => storage_info_inner(pallet_name, entry_name, m, legacy_types), - RuntimeMetadata::V14(m) => storage_info_inner(pallet_name, entry_name, m, &m.types), - RuntimeMetadata::V15(m) => storage_info_inner(pallet_name, entry_name, m, &m.types), - RuntimeMetadata::V16(m) => storage_info_inner(pallet_name, entry_name, m, &m.types), - unknown => { - return Err(StorageError::UnsupportedMetadataVersion { - version: unknown.version(), - }); - } - }?; - - fn storage_info_inner<'atblock, Info, Resolver>( - pallet_name: &str, - entry_name: &str, - m: &'atblock Info, - type_resolver: &'atblock Resolver, - ) -> Result, StorageError> - where - Info: StorageTypeInfo, - Resolver: scale_type_resolver::TypeResolver, - AnyStorageInfo<'atblock>: From>, - { - m.storage_info(pallet_name, entry_name) - .map(|frame_storage_info| { - let info = StorageInfo { - info: frame_storage_info, - resolver: type_resolver, - }; - AnyStorageInfo::from(info) - }) - .map_err(|e| StorageError::ExtractStorageInfoError { - reason: e.into_owned(), - }) - } - - Ok(info) - } - - /// Is the storage entry a map (ie something we'd provide extra keys to access a value, or otherwise iterate over)? - pub fn is_map(&self) -> bool { - match self { - AnyStorageInfo::Legacy(info) => !info.info.keys.is_empty(), - AnyStorageInfo::Current(info) => !info.info.keys.is_empty(), - } - } -} - -impl<'atblock> From>> - for AnyStorageInfo<'atblock> -{ - fn from(info: StorageInfo<'atblock, LookupName, TypeRegistrySet<'atblock>>) -> Self { - AnyStorageInfo::Legacy(info) - } -} -impl<'atblock> From> - for AnyStorageInfo<'atblock> -{ - fn from(info: StorageInfo<'atblock, u32, scale_info::PortableRegistry>) -> Self { - AnyStorageInfo::Current(info) - } -} - -pub struct StorageInfo<'atblock, TypeId: Clone, Resolver> { - pub info: frame_decode::storage::StorageInfo<'atblock, TypeId>, - pub resolver: &'atblock Resolver, -} - -macro_rules! with_info { - ($info:ident = $original_info:expr => $fn:expr) => {{ - #[allow(clippy::clone_on_copy)] - let info = match $original_info { - AnyStorageInfo::Legacy($info) => $fn, - AnyStorageInfo::Current($info) => $fn, - }; - info - }}; -} -pub(crate) use with_info; diff --git a/historic/src/storage/storage_key.rs b/historic/src/storage/storage_key.rs deleted file mode 100644 index cbabe0e6a06..00000000000 --- a/historic/src/storage/storage_key.rs +++ /dev/null @@ -1,176 +0,0 @@ -use super::AnyStorageInfo; -use crate::{error::StorageKeyError, storage::storage_info::with_info}; -use scale_info_legacy::{LookupName, TypeRegistrySet}; - -// This is part of our public interface. -pub use frame_decode::storage::{IntoDecodableValues, StorageHasher}; - -enum AnyStorageKeyInfo<'atblock> { - Legacy(StorageKeyInfo<'atblock, LookupName, TypeRegistrySet<'atblock>>), - Current(StorageKeyInfo<'atblock, u32, scale_info::PortableRegistry>), -} - -impl<'atblock> From>> - for AnyStorageKeyInfo<'atblock> -{ - fn from(info: StorageKeyInfo<'atblock, LookupName, TypeRegistrySet<'atblock>>) -> Self { - AnyStorageKeyInfo::Legacy(info) - } -} -impl<'atblock> From> - for AnyStorageKeyInfo<'atblock> -{ - fn from(info: StorageKeyInfo<'atblock, u32, scale_info::PortableRegistry>) -> Self { - AnyStorageKeyInfo::Current(info) - } -} - -struct StorageKeyInfo<'atblock, TypeId, Resolver> { - info: frame_decode::storage::StorageKey, - resolver: &'atblock Resolver, -} - -macro_rules! with_key_info { - ($info:ident = $original_info:expr => $fn:expr) => {{ - #[allow(clippy::clone_on_copy)] - let info = match $original_info { - AnyStorageKeyInfo::Legacy($info) => $fn, - AnyStorageKeyInfo::Current($info) => $fn, - }; - info - }}; -} - -/// This represents the different parts of a storage key. -pub struct StorageKey<'entry, 'atblock> { - info: AnyStorageKeyInfo<'atblock>, - bytes: &'entry [u8], -} - -impl<'entry, 'atblock> StorageKey<'entry, 'atblock> { - pub(crate) fn new( - info: &AnyStorageInfo<'atblock>, - bytes: &'entry [u8], - ) -> Result { - with_info!(info = info => { - let cursor = &mut &*bytes; - let storage_key_info = frame_decode::storage::decode_storage_key_with_info( - cursor, - &info.info, - info.resolver, - ).map_err(|e| { - StorageKeyError::DecodeError { reason: e.map_type_id(|id| id.to_string()) } - })?; - - if !cursor.is_empty() { - return Err(StorageKeyError::LeftoverBytes { - leftover_bytes: cursor.to_vec(), - }); - } - - Ok(StorageKey { - info: StorageKeyInfo { - info: storage_key_info, - resolver: info.resolver, - }.into(), - bytes, - }) - }) - } - - /// Attempt to decode the values contained within this storage key to the `Target` type - /// provided. This type is typically a tuple of types which each implement [`scale_decode::DecodeAsType`] - /// and correspond to each of the key types present, in order. - pub fn decode_as(&self) -> Result { - with_key_info!(info = &self.info => { - let values = frame_decode::storage::decode_storage_key_values( - self.bytes, - &info.info, - info.resolver - ).map_err(|e| { - StorageKeyError::DecodeKeyValueError { reason: e } - })?; - - Ok(values) - }) - } - - /// Iterate over the parts of this storage key. Each part of a storage key corresponds to a - /// single value that has been hashed. - pub fn parts(&'_ self) -> impl ExactSizeIterator> { - let parts_len = with_key_info!(info = &self.info => info.info.parts().len()); - (0..parts_len).map(move |index| StorageKeyPart { - index, - info: &self.info, - bytes: self.bytes, - }) - } - - /// Return the part of the storage key at the provided index, or `None` if the index is out of bounds. - pub fn part(&self, index: usize) -> Option> { - if index < self.parts().len() { - Some(StorageKeyPart { - index, - info: &self.info, - bytes: self.bytes, - }) - } else { - None - } - } -} - -/// This represents a part of a storage key. -pub struct StorageKeyPart<'key, 'entry, 'atblock> { - index: usize, - info: &'key AnyStorageKeyInfo<'atblock>, - bytes: &'entry [u8], -} - -impl<'key, 'entry, 'atblock> StorageKeyPart<'key, 'entry, 'atblock> { - /// Get the raw bytes for this part of the storage key. - pub fn bytes(&self) -> &'entry [u8] { - with_key_info!(info = &self.info => { - let part = &info.info[self.index]; - let hash_range = part.hash_range(); - let value_range = part - .value() - .map(|v| v.range()) - .unwrap_or(std::ops::Range { start: hash_range.end, end: hash_range.end }); - let combined_range = std::ops::Range { - start: hash_range.start, - end: value_range.end, - }; - &self.bytes[combined_range] - }) - } - - /// Get the hasher that was used to construct this part of the storage key. - pub fn hasher(&self) -> StorageHasher { - with_key_info!(info = &self.info => info.info[self.index].hasher()) - } - - /// For keys that were produced using "concat" or "identity" hashers, the value - /// is available as a part of the key hash, allowing us to decode it into anything - /// implementing [`scale_decode::DecodeAsType`]. If the key was produced using a - /// different hasher, this will return `None`. - pub fn decode_as(&self) -> Result, StorageKeyError> { - with_key_info!(info = &self.info => { - let part_info = &info.info[self.index]; - let Some(value_info) = part_info.value() else { - return Ok(None); - }; - - let value_bytes = &self.bytes[value_info.range()]; - let value_ty = value_info.ty().clone(); - - let decoded_key_part = T::decode_as_type( - &mut &*value_bytes, - value_ty, - info.resolver, - ).map_err(|e| StorageKeyError::DecodePartError { index: self.index, reason: e })?; - - Ok(Some(decoded_key_part)) - }) - } -} diff --git a/historic/src/storage/storage_value.rs b/historic/src/storage/storage_value.rs deleted file mode 100644 index 933cf3a2334..00000000000 --- a/historic/src/storage/storage_value.rs +++ /dev/null @@ -1,79 +0,0 @@ -use super::storage_info::AnyStorageInfo; -use super::storage_info::with_info; -use crate::error::StorageValueError; -use crate::utils::{AnyResolver, AnyTypeId}; -use scale_decode::DecodeAsType; -use std::borrow::Cow; -use std::sync::Arc; - -/// This represents a storage value. -pub struct StorageValue<'atblock> { - pub(crate) info: Arc>, - bytes: Cow<'atblock, [u8]>, - resolver: AnyResolver<'atblock, 'atblock>, -} - -impl<'atblock> StorageValue<'atblock> { - /// Create a new storage value. - pub(crate) fn new(info: Arc>, bytes: Cow<'atblock, [u8]>) -> Self { - let resolver = match &*info { - AnyStorageInfo::Current(info) => AnyResolver::A(info.resolver), - AnyStorageInfo::Legacy(info) => AnyResolver::B(info.resolver), - }; - - Self { - info, - bytes, - resolver, - } - } - - /// Get the raw bytes for this storage value. - pub fn bytes(&self) -> &[u8] { - &self.bytes - } - - /// Consume this storage value and return the raw bytes. - pub fn into_bytes(self) -> Vec { - self.bytes.to_vec() - } - - /// Visit the given field with a [`scale_decode::visitor::Visitor`]. This is like a lower level - /// version of [`StorageValue::decode_as`], as the visitor is able to preserve lifetimes - /// and has access to more type information than is available via [`StorageValue::decode_as`]. - pub fn visit< - V: scale_decode::visitor::Visitor>, - >( - &self, - visitor: V, - ) -> Result, V::Error> { - let type_id = match &*self.info { - AnyStorageInfo::Current(info) => AnyTypeId::A(info.info.value_id), - AnyStorageInfo::Legacy(info) => AnyTypeId::B(info.info.value_id.clone()), - }; - let cursor = &mut self.bytes(); - - scale_decode::visitor::decode_with_visitor(cursor, type_id, &self.resolver, visitor) - } - - /// Decode this storage value. - pub fn decode_as(&self) -> Result { - with_info!(info = &*self.info => { - let cursor = &mut &*self.bytes; - - let value = T::decode_as_type( - cursor, - info.info.value_id.clone(), - info.resolver, - ).map_err(|e| StorageValueError::DecodeError { reason: e })?; - - if !cursor.is_empty() { - return Err(StorageValueError::LeftoverBytes { - leftover_bytes: cursor.to_vec(), - }); - } - - Ok(value) - }) - } -} diff --git a/historic/src/utils.rs b/historic/src/utils.rs deleted file mode 100644 index 4a4edf859ba..00000000000 --- a/historic/src/utils.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod any_resolver; -mod either; -mod range_map; - -pub use any_resolver::{AnyResolver, AnyResolverError, AnyTypeId}; -pub use either::Either; -pub use range_map::RangeMap; diff --git a/historic/src/utils/any_resolver.rs b/historic/src/utils/any_resolver.rs deleted file mode 100644 index c65b6a1b46b..00000000000 --- a/historic/src/utils/any_resolver.rs +++ /dev/null @@ -1,186 +0,0 @@ -use super::Either; -use scale_info_legacy::LookupName; -use scale_type_resolver::ResolvedTypeVisitor; - -/// A type resolver which could either be for modern or historic resolving. -pub type AnyResolver<'a, 'b> = - Either<&'a scale_info::PortableRegistry, &'a scale_info_legacy::TypeRegistrySet<'b>>; - -/// A type ID which is either a modern or historic ID. -pub type AnyTypeId = Either; - -impl Default for AnyTypeId { - fn default() -> Self { - // Not a sensible default, but we don't need / can't provide a sensible one. - AnyTypeId::A(u32::MAX) - } -} -impl From for AnyTypeId { - fn from(value: u32) -> Self { - AnyTypeId::A(value) - } -} -impl From for AnyTypeId { - fn from(value: LookupName) -> Self { - AnyTypeId::B(value) - } -} -impl TryFrom for u32 { - type Error = (); - fn try_from(value: AnyTypeId) -> Result { - match value { - AnyTypeId::A(v) => Ok(v), - AnyTypeId::B(_) => Err(()), - } - } -} -impl TryFrom for LookupName { - type Error = (); - fn try_from(value: AnyTypeId) -> Result { - match value { - AnyTypeId::A(_) => Err(()), - AnyTypeId::B(v) => Ok(v), - } - } -} - -/// A resolve error that comes from using [`AnyResolver`] to resolve some [`AnyTypeId`] into a type. -#[derive(Debug, thiserror::Error)] -pub enum AnyResolverError { - #[error("got a {got} type ID but expected a {expected} type ID")] - TypeIdMismatch { - got: &'static str, - expected: &'static str, - }, - #[error("{0}")] - ScaleInfo(scale_type_resolver::portable_registry::Error), - #[error("{0}")] - ScaleInfoLegacy(scale_info_legacy::type_registry::TypeRegistryResolveError), -} - -impl<'a, 'b> scale_type_resolver::TypeResolver for AnyResolver<'a, 'b> { - type TypeId = AnyTypeId; - type Error = AnyResolverError; - - fn resolve_type<'this, V: ResolvedTypeVisitor<'this, TypeId = Self::TypeId>>( - &'this self, - type_id: Self::TypeId, - visitor: V, - ) -> Result { - match (self, type_id) { - (Either::A(resolver), Either::A(id)) => resolver - .resolve_type(id, ModernVisitor(visitor)) - .map_err(AnyResolverError::ScaleInfo), - (Either::B(resolver), Either::B(id)) => resolver - .resolve_type(id, LegacyVisitor(visitor)) - .map_err(AnyResolverError::ScaleInfoLegacy), - (Either::A(_), Either::B(_)) => Err(AnyResolverError::TypeIdMismatch { - got: "LookupName", - expected: "u32", - }), - (Either::B(_), Either::A(_)) => Err(AnyResolverError::TypeIdMismatch { - got: "u32", - expected: "LookupName", - }), - } - } -} - -// We need to have a visitor which understands only modern or legacy types, and can wrap the more generic visitor -// that must be provided to AnyResolver::resolve_type. This then allows us to visit historic _or_ modern types -// using the single visitor provided by the user. -struct LegacyVisitor(V); -struct ModernVisitor(V); - -mod impls { - use super::{AnyTypeId, LegacyVisitor, LookupName, ModernVisitor}; - use scale_type_resolver::*; - - // An ugly implementation which maps from modern or legacy types into our AnyTypeId, - // to make LegacyVisitor and ModernVisitor valid visitors when wrapping a generic "any" visitor. - macro_rules! impl_visitor_mapper { - ($struc:ident, $type_id_ty:ident, $variant:ident) => { - impl<'this, V> ResolvedTypeVisitor<'this> for $struc - where - V: ResolvedTypeVisitor<'this, TypeId = AnyTypeId>, - { - type TypeId = $type_id_ty; - type Value = V::Value; - - fn visit_unhandled(self, kind: UnhandledKind) -> Self::Value { - self.0.visit_unhandled(kind) - } - fn visit_array(self, type_id: Self::TypeId, len: usize) -> Self::Value { - self.0.visit_array(AnyTypeId::$variant(type_id), len) - } - fn visit_not_found(self) -> Self::Value { - self.0.visit_not_found() - } - fn visit_composite(self, path: Path, fields: Fields) -> Self::Value - where - Path: PathIter<'this>, - Fields: FieldIter<'this, Self::TypeId>, - { - self.0.visit_composite( - path, - fields.map(|field| Field { - name: field.name, - id: AnyTypeId::$variant(field.id), - }), - ) - } - fn visit_variant(self, path: Path, variants: Var) -> Self::Value - where - Path: PathIter<'this>, - Fields: FieldIter<'this, Self::TypeId>, - Var: VariantIter<'this, Fields>, - { - self.0.visit_variant( - path, - variants.map(|variant| Variant { - index: variant.index, - name: variant.name, - fields: variant.fields.map(|field| Field { - name: field.name, - id: AnyTypeId::$variant(field.id), - }), - }), - ) - } - fn visit_sequence(self, path: Path, type_id: Self::TypeId) -> Self::Value - where - Path: PathIter<'this>, - { - self.0.visit_sequence(path, AnyTypeId::$variant(type_id)) - } - - fn visit_tuple(self, type_ids: TypeIds) -> Self::Value - where - TypeIds: ExactSizeIterator, - { - self.0 - .visit_tuple(type_ids.map(|id| AnyTypeId::$variant(id))) - } - - fn visit_primitive(self, primitive: Primitive) -> Self::Value { - self.0.visit_primitive(primitive) - } - - fn visit_compact(self, type_id: Self::TypeId) -> Self::Value { - self.0.visit_compact(AnyTypeId::$variant(type_id)) - } - - fn visit_bit_sequence( - self, - store_format: BitsStoreFormat, - order_format: BitsOrderFormat, - ) -> Self::Value { - self.0.visit_bit_sequence(store_format, order_format) - } - } - }; - } - - impl_visitor_mapper!(ModernVisitor, u32, A); - impl_visitor_mapper!(LegacyVisitor, LookupName, B); -} diff --git a/historic/src/utils/either.rs b/historic/src/utils/either.rs deleted file mode 100644 index 081b52e92e2..00000000000 --- a/historic/src/utils/either.rs +++ /dev/null @@ -1,49 +0,0 @@ -macro_rules! either { - ($name:ident( $fst:ident, $($variant:ident),* )) => { - #[derive(Clone, Copy, Debug)] - pub enum $name<$fst, $($variant),*> { - $fst($fst), - $($variant($variant),)* - } - - impl<$fst, $($variant),*> Iterator for $name<$fst, $($variant),*> - where - $fst: Iterator, - $($variant: Iterator,)* - { - type Item = $fst::Item; - - fn next(&mut self) -> Option { - match self { - $name::$fst(inner) => inner.next(), - $( $name::$variant(inner) => inner.next(), )* - } - } - } - - impl <$fst, $($variant),*> futures::stream::Stream for $name<$fst, $($variant),*> - where - $fst: futures::stream::Stream, - $($variant: futures::stream::Stream,)* - { - type Item = $fst::Item; - - fn poll_next( - self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - use std::pin::Pin; - - // SAFETY: This is safe because we never move the inner value out of the Pin. - unsafe { - match self.get_unchecked_mut() { - $name::$fst(inner) => Pin::new_unchecked(inner).poll_next(cx), - $( $name::$variant(inner) => Pin::new_unchecked(inner).poll_next(cx), )* - } - } - } - } - } -} - -either!(Either(A, B)); diff --git a/lightclient/Cargo.toml b/lightclient/Cargo.toml index 7c94b5b2b89..e3445ee01c9 100644 --- a/lightclient/Cargo.toml +++ b/lightclient/Cargo.toml @@ -71,7 +71,6 @@ getrandom = { workspace = true, optional = true } [package.metadata.docs.rs] default-features = true -rustdoc-args = ["--cfg", "docsrs"] [package.metadata.playground] default-features = true diff --git a/lightclient/src/lib.rs b/lightclient/src/lib.rs index 9f6cb1aaced..15013090eff 100644 --- a/lightclient/src/lib.rs +++ b/lightclient/src/lib.rs @@ -6,7 +6,6 @@ //! to Substrate based chains. #![deny(missing_docs)] -#![cfg_attr(docsrs, feature(doc_cfg))] #[cfg(any( all(feature = "web", feature = "native"), diff --git a/metadata/src/lib.rs b/metadata/src/lib.rs index daadc372057..a04ca70faea 100644 --- a/metadata/src/lib.rs +++ b/metadata/src/lib.rs @@ -25,6 +25,7 @@ mod utils; use alloc::borrow::Cow; use alloc::collections::BTreeMap; use alloc::string::{String, ToString}; +use alloc::sync::Arc; use alloc::vec::Vec; use frame_decode::constants::{ConstantEntry, ConstantInfo, ConstantInfoError}; use frame_decode::custom_values::{CustomValue, CustomValueInfo, CustomValueInfoError}; @@ -58,6 +59,9 @@ pub use from::legacy::Error as LegacyFromError; type CustomMetadataInner = frame_metadata::v15::CustomMetadata; +/// Metadata is often passed around wrapped in an [`Arc`] so that it can be cheaply cloned. +pub type ArcMetadata = Arc; + /// Node metadata. This can be constructed by providing some compatible [`frame_metadata`] /// which is then decoded into this. We aim to preserve all of the existing information in /// the incoming metadata while optimizing the format a little for Subxt's use cases. @@ -192,6 +196,7 @@ impl frame_decode::storage::StorageTypeInfo for Metadata { .default_value .as_ref() .map(|def| Cow::Borrowed(&**def)), + use_old_v9_storage_hashers: false, }; Ok(info) @@ -369,6 +374,12 @@ impl frame_decode::custom_values::CustomValueEntryInfo for Metadata { } impl Metadata { + /// Metadata tends to be passed around wrapped in an [`Arc`] so that it can be + /// cheaply cloned. This is a shorthand to return that. + pub fn arc(self) -> ArcMetadata { + Arc::new(self) + } + /// This is essentially an alias for `::decode(&mut bytes)` pub fn decode_from(mut bytes: &[u8]) -> Result { ::decode(&mut bytes) diff --git a/rpcs/Cargo.toml b/rpcs/Cargo.toml index e0d86be376c..3cfc9295295 100644 --- a/rpcs/Cargo.toml +++ b/rpcs/Cargo.toml @@ -16,11 +16,9 @@ keywords = ["parity", "subxt", "rpcs"] [features] default = ["jsonrpsee", "native"] - -subxt = ["dep:subxt-core"] jsonrpsee = ["dep:jsonrpsee", "dep:tokio-util"] -unstable-light-client = [ +light-client = [ "dep:subxt-lightclient" ] @@ -83,9 +81,6 @@ tokio = { workspace = true, optional = true } # Included with the lightclient feature subxt-lightclient = { workspace = true, optional = true, default-features = false } -# Included with the subxt-core feature to impl Config for RpcConfig -subxt-core = { workspace = true, optional = true } - # Included with WASM feature wasm-bindgen-futures = { workspace = true, optional = true } @@ -97,7 +92,6 @@ jsonrpsee = { workspace = true, features = ["server"] } [package.metadata.docs.rs] default-features = true -rustdoc-args = ["--cfg", "docsrs"] [lints] workspace = true diff --git a/rpcs/src/client/mod.rs b/rpcs/src/client/mod.rs index ce9c7fe875f..6964833a25e 100644 --- a/rpcs/src/client/mod.rs +++ b/rpcs/src/client/mod.rs @@ -18,7 +18,7 @@ //! which implement [`RpcClientT`] and can therefore be used to construct [`RpcClient`]s. //! //! - **jsonrpsee**: Enable an RPC client based on `jsonrpsee`. -//! - **unstable-light-client**: Enable an RPC client which uses the Smoldot light client under +//! - **light-client**: Enable an RPC client which uses the Smoldot light client under //! the hood to communicate with the network of choice. //! - **reconnecting-rpc-client**: Enable an RPC client based on `jsonrpsee` which handles //! reconnecting automatically in the event of network issues. diff --git a/rpcs/src/lib.rs b/rpcs/src/lib.rs index dea37552f1e..b8a37d7a7a1 100644 --- a/rpcs/src/lib.rs +++ b/rpcs/src/lib.rs @@ -16,8 +16,6 @@ //! The provided RPC client implementations can be used natively (with the default `native` feature //! flag) or in WASM based web apps (with the `web` feature flag). -#![cfg_attr(docsrs, feature(doc_cfg))] - #[cfg(any( all(feature = "web", feature = "native"), not(any(feature = "web", feature = "native")) @@ -62,23 +60,6 @@ impl Hash for T where T: serde::de::DeserializeOwned + serde::Serialize {} pub trait AccountId: serde::Serialize {} impl AccountId for T where T: serde::Serialize {} -// When the subxt feature is enabled, ensure that any valid `subxt::Config` -// is also a valid `RpcConfig`. -#[cfg(feature = "subxt")] -mod impl_config { - use super::*; - use subxt_core::config::HashFor; - - impl RpcConfig for T - where - T: subxt_core::Config, - { - type Header = T::Header; - type Hash = HashFor; - type AccountId = T::AccountId; - } -} - /// This encapsulates any errors that could be emitted in this crate. #[derive(Debug, thiserror::Error)] #[non_exhaustive] diff --git a/rpcs/src/macros.rs b/rpcs/src/macros.rs index dc6b8fa195b..e42ca57ceb7 100644 --- a/rpcs/src/macros.rs +++ b/rpcs/src/macros.rs @@ -14,7 +14,7 @@ macro_rules! cfg_feature { macro_rules! cfg_unstable_light_client { ($($item:item)*) => { - crate::macros::cfg_feature!("unstable-light-client", $($item)*); + crate::macros::cfg_feature!("light-client", $($item)*); }; } diff --git a/rpcs/src/methods/chain_head.rs b/rpcs/src/methods/chain_head.rs index 4c96ad8bc92..faf7053fffe 100644 --- a/rpcs/src/methods/chain_head.rs +++ b/rpcs/src/methods/chain_head.rs @@ -15,9 +15,9 @@ use serde::{Deserialize, Deserializer, Serialize}; use std::collections::{HashMap, VecDeque}; use std::task::Poll; -/// An interface to call the unstable RPC methods. This interface is instantiated with -/// some `T: Config` trait which determines some of the types that the RPC methods will -/// take or hand back. +/// An interface to call the new ["chainHead" RPC methods](https://paritytech.github.io/json-rpc-interface-spec/). +/// This interface is instantiated with some `T: RpcConfig` trait which determines some of the types that +/// the RPC methods will take or hand back. #[derive_where(Clone, Debug)] pub struct ChainHeadRpcMethods { client: RpcClient, @@ -386,14 +386,15 @@ impl ChainHeadRpcMethods { pub async fn archive_v1_storage( &self, block_hash: T::Hash, - items: impl IntoIterator>, + items: impl IntoIterator>, child_key: Option<&[u8]>, ) -> Result, Error> { - let items: Vec> = items + let items: Vec> = items .into_iter() - .map(|item| StorageQuery { + .map(|item| ArchiveStorageQuery { key: to_hex(item.key), query_type: item.query_type, + pagination_start_key: item.pagination_start_key.map(to_hex), }) .collect(); @@ -408,137 +409,6 @@ impl ChainHeadRpcMethods { Ok(ArchiveStorageSubscription { sub, done: false }) } - - // Dev note: we continue to support the latest "unstable" archive methods because - // they will be around for a while before the stable ones make it into a release. - // The below are just a copy-paste of the v1 methods, above, but calling the - // "unstable" RPCs instead. Eventually we'll remove them. - - /// Fetch the block body (ie the extrinsics in the block) given its hash. - /// - /// Returns an array of the hexadecimal-encoded scale-encoded extrinsics found in the block, - /// or `None` if the block wasn't found. - pub async fn archive_unstable_body( - &self, - block_hash: T::Hash, - ) -> Result>, Error> { - self.client - .request("archive_unstable_body", rpc_params![block_hash]) - .await - } - - /// Call the `archive_unstable_call` method and return the response. - pub async fn archive_unstable_call( - &self, - block_hash: T::Hash, - function: &str, - call_parameters: &[u8], - ) -> Result { - use serde::de::Error as _; - - // We deserialize to this intermediate shape, since - // we can't have a boolean tag to denote variants. - #[derive(Deserialize)] - struct Response { - success: bool, - value: Option, - error: Option, - // This was accidentally used instead of value in Substrate, - // so to support those impls we try it here if needed: - result: Option, - } - - let res: Response = self - .client - .request( - "archive_unstable_call", - rpc_params![block_hash, function, to_hex(call_parameters)], - ) - .await?; - - let value = res.value.or(res.result); - match (res.success, value, res.error) { - (true, Some(value), _) => Ok(ArchiveCallResult::Success(value)), - (false, _, err) => Ok(ArchiveCallResult::Error(err.unwrap_or(String::new()))), - (true, None, _) => { - let m = "archive_unstable_call: 'success: true' response should have `value: 0x1234` alongside it"; - Err(Error::Deserialization(serde_json::Error::custom(m))) - } - } - } - - /// Return the finalized block height of the chain. - pub async fn archive_unstable_finalized_height(&self) -> Result { - self.client - .request("archive_unstable_finalizedHeight", rpc_params![]) - .await - } - - /// Return the genesis hash. - pub async fn archive_unstable_genesis_hash(&self) -> Result { - self.client - .request("archive_unstable_genesisHash", rpc_params![]) - .await - } - - /// Given a block height, return the hashes of the zero or more blocks at that height. - /// For blocks older than the latest finalized block, only one entry will be returned. For blocks - /// newer than the latest finalized block, it's possible to have 0, 1 or multiple blocks at - /// that height given that forks could occur. - pub async fn archive_unstable_hash_by_height( - &self, - height: usize, - ) -> Result, Error> { - self.client - .request("archive_unstable_hashByHeight", rpc_params![height]) - .await - } - - /// Fetch the header for a block with the given hash, or `None` if no block with that hash exists. - pub async fn archive_unstable_header( - &self, - block_hash: T::Hash, - ) -> Result, Error> { - let maybe_encoded_header: Option = self - .client - .request("archive_unstable_header", rpc_params![block_hash]) - .await?; - - let Some(encoded_header) = maybe_encoded_header else { - return Ok(None); - }; - - let header = - ::decode(&mut &*encoded_header.0).map_err(Error::Decode)?; - Ok(Some(header)) - } - - /// Query the node storage and return a subscription which streams corresponding storage events back. - pub async fn archive_unstable_storage( - &self, - block_hash: T::Hash, - items: impl IntoIterator>, - child_key: Option<&[u8]>, - ) -> Result, Error> { - let items: Vec> = items - .into_iter() - .map(|item| StorageQuery { - key: to_hex(item.key), - query_type: item.query_type, - }) - .collect(); - - let sub = self - .client - .subscribe( - "archive_unstable_storage", - rpc_params![block_hash, items, child_key.map(to_hex)], - "archive_unstable_stopStorage", - ) - .await?; - - Ok(ArchiveStorageSubscription { sub, done: false }) - } } /// This represents events generated by the `follow` method. @@ -849,6 +719,24 @@ pub struct StorageQuery { pub query_type: StorageQueryType, } +/// The storage item received as parameter. This is used archive storage queries, and +/// unlike [`StorageQuery`] also contains `paginationStartKey` to define where iteration +/// should begin. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchiveStorageQuery { + /// The provided key. + pub key: Key, + /// The type of the storage query. + #[serde(rename = "type")] + pub query_type: StorageQueryType, + /// This parameter is optional and should be a string containing the hexadecimal-encoded key + /// from which the storage iteration should resume. This parameter is only valid in the context + /// of `descendantsValues` and `descendantsHashes`. + #[serde(skip_serializing_if = "Option::is_none")] + pub pagination_start_key: Option, +} + /// The type of the storage query. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -1104,7 +992,7 @@ impl ArchiveStorageEvent { } } -/// Something went wrong during the [`ChainHeadRpcMethods::archive_unstable_storage()`] subscription. +/// Something went wrong during the [`ChainHeadRpcMethods::archive_v1_storage()`] subscription. #[derive(Debug, Clone, PartialEq, Eq, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ArchiveStorageEventError { @@ -1112,7 +1000,7 @@ pub struct ArchiveStorageEventError { pub error: String, } -/// A storage item returned from the [`ChainHeadRpcMethods::archive_unstable_storage()`] subscription. +/// A storage item returned from the [`ChainHeadRpcMethods::archive_v1_storage()`] subscription. #[derive(Debug, Clone, PartialEq, Eq, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ArchiveStorageEventItem { diff --git a/rpcs/src/methods/legacy.rs b/rpcs/src/methods/legacy.rs index b7844f3ff7d..a672fa5f81a 100644 --- a/rpcs/src/methods/legacy.rs +++ b/rpcs/src/methods/legacy.rs @@ -13,7 +13,7 @@ use primitive_types::U256; use serde::{Deserialize, Serialize}; /// An interface to call the legacy RPC methods. This interface is instantiated with -/// some `T: Config` trait which determines some of the types that the RPC methods will +/// some `T: RpcConfig` trait which determines some of the types that the RPC methods will /// take or hand back. #[derive_where(Clone, Debug)] pub struct LegacyRpcMethods { diff --git a/signer/Cargo.toml b/signer/Cargo.toml index 876d5353a25..7c3dc61cc1b 100644 --- a/signer/Cargo.toml +++ b/signer/Cargo.toml @@ -15,7 +15,7 @@ description = "Sign extrinsics to be submitted by Subxt" keywords = ["parity", "subxt", "extrinsic", "signer"] [features] -default = ["sr25519", "ecdsa", "subxt", "std"] +default = ["sr25519", "ecdsa", "std"] std = [ "regex/std", "pbkdf2/std", @@ -40,18 +40,25 @@ ecdsa = ["secp256k1"] unstable-eth = ["keccak-hash", "ecdsa", "secp256k1", "bip32"] # Enable support for loading key pairs from polkadot-js json. -polkadot-js-compat = ["std", "subxt", "sr25519", "base64", "scrypt", "crypto_secretbox", "serde", "serde_json"] +polkadot-js-compat = [ + "std", + "sr25519", + "base64", + "scrypt", + "crypto_secretbox", + "serde", + "serde_json" +] # Make the keypair algorithms here compatible with Subxt's Signer trait, # so that they can be used to sign transactions for compatible chains. -subxt = ["dep:subxt-core"] +subxt = ["dep:subxt"] # The getrandom package is used via schnorrkel. We need to enable the JS # feature on it if compiling for the web. web = ["getrandom/js"] [dependencies] -subxt-core = { workspace = true, optional = true, default-features = false } secrecy = { workspace = true } regex = { workspace = true, features = ["unicode"] } hex = { workspace = true } @@ -74,12 +81,16 @@ secp256k1 = { workspace = true, optional = true, features = [ keccak-hash = { workspace = true, optional = true } thiserror = { workspace = true, default-features = false } +# Pulled in if the subxt features is enabled. +subxt = { workspace = true, optional = true } + # These are used if the polkadot-js-compat feature is enabled serde = { workspace = true, optional = true } serde_json = { workspace = true, optional = true } base64 = { workspace = true, optional = true, features = ["alloc"] } scrypt = { workspace = true, default-features = false, optional = true } crypto_secretbox = { workspace = true, optional = true, features = ["alloc", "salsa20"] } +subxt-utils-accountid32 = { workspace = true, optional = true } # We only pull this in to enable the JS flag for schnorrkel to use. getrandom = { workspace = true, optional = true } @@ -95,7 +106,6 @@ ignored = ["getrandom"] [package.metadata.docs.rs] default-features = true -rustdoc-args = ["--cfg", "docsrs"] [package.metadata.playground] default-features = true diff --git a/signer/src/ecdsa.rs b/signer/src/ecdsa.rs index fde7ef98282..1186f44365e 100644 --- a/signer/src/ecdsa.rs +++ b/signer/src/ecdsa.rs @@ -297,10 +297,9 @@ pub mod dev { #[cfg(feature = "subxt")] mod subxt_compat { use super::*; - - use subxt_core::config::Config; - use subxt_core::tx::signer::Signer as SignerT; - use subxt_core::utils::{AccountId32, MultiAddress, MultiSignature}; + use subxt::config::Config; + use subxt::transactions::Signer as SignerT; + use subxt::utils::{AccountId32, MultiAddress, MultiSignature}; impl From for MultiSignature { fn from(value: Signature) -> Self { diff --git a/signer/src/eth.rs b/signer/src/eth.rs index 1d31e4cde54..eb0d514ed0d 100644 --- a/signer/src/eth.rs +++ b/signer/src/eth.rs @@ -309,10 +309,10 @@ pub mod dev { #[cfg(feature = "subxt")] mod subxt_compat { use super::*; - use subxt_core::config::Config; - use subxt_core::tx::signer::Signer as SignerT; - use subxt_core::utils::AccountId20; - use subxt_core::utils::MultiAddress; + use subxt::config::Config; + use subxt::transactions::Signer as SignerT; + use subxt::utils::AccountId20; + use subxt::utils::MultiAddress; impl SignerT for Keypair where @@ -365,21 +365,22 @@ mod test { use bip39::Mnemonic; use proptest::prelude::*; use secp256k1::Secp256k1; - use subxt_core::utils::AccountId20; - - use subxt_core::{config::*, tx::signer::Signer as SignerT}; + use subxt::config::{Config, HashFor, substrate}; + use subxt::transactions::Signer as SignerT; + use subxt::utils::AccountId20; use super::*; - enum StubEthRuntimeConfig {} + #[derive(Debug, Clone)] + struct StubEthRuntimeConfig; impl Config for StubEthRuntimeConfig { type AccountId = AccountId20; type Address = AccountId20; type Signature = Signature; type Hasher = substrate::BlakeTwo256; - type Header = substrate::SubstrateHeader; - type ExtrinsicParams = SubstrateExtrinsicParams; + type Header = substrate::SubstrateHeader>; + type ExtrinsicParams = substrate::SubstrateExtrinsicParams; type AssetId = u32; } diff --git a/signer/src/lib.rs b/signer/src/lib.rs index 7ceaf875864..2f2a2c48316 100644 --- a/signer/src/lib.rs +++ b/signer/src/lib.rs @@ -13,7 +13,6 @@ //! Enable the `subxt` feature to enable use of this [`sr25519::Keypair`] in signing //! subxt transactions for chains supporting sr25519 signatures. -#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; @@ -24,22 +23,18 @@ mod crypto; // An sr25519 key pair implementation. #[cfg(feature = "sr25519")] -#[cfg_attr(docsrs, doc(cfg(feature = "sr25519")))] pub mod sr25519; // An ecdsa key pair implementation. #[cfg(feature = "ecdsa")] -#[cfg_attr(docsrs, doc(cfg(feature = "ecdsa")))] pub mod ecdsa; // An ethereum signer implementation. #[cfg(feature = "unstable-eth")] -#[cfg_attr(docsrs, doc(cfg(feature = "unstable-eth")))] pub mod eth; /// A polkadot-js account json loader. #[cfg(feature = "polkadot-js-compat")] -#[cfg_attr(docsrs, doc(cfg(feature = "polkadot-js-compat")))] pub mod polkadot_js_compat; // Re-export useful bits and pieces for generating a Pair from a phrase, diff --git a/signer/src/polkadot_js_compat.rs b/signer/src/polkadot_js_compat.rs index c2acc24e864..80aff519f73 100644 --- a/signer/src/polkadot_js_compat.rs +++ b/signer/src/polkadot_js_compat.rs @@ -76,6 +76,9 @@ struct KeyringPairJson { address: AccountId32, } +// Re-export this type which is used above. +pub use subxt_utils_accountid32::AccountId32; + // This can be removed once split_array is stabilized. fn slice_to_u32(slice: &[u8]) -> u32 { u32::from_le_bytes(slice.try_into().expect("Slice should be 4 bytes.")) diff --git a/signer/src/sr25519.rs b/signer/src/sr25519.rs index d6acef9f3c9..f00c1bde938 100644 --- a/signer/src/sr25519.rs +++ b/signer/src/sr25519.rs @@ -287,15 +287,11 @@ pub mod dev { // Make `Keypair` usable to sign transactions in Subxt. This is optional so that // `subxt-signer` can be used entirely independently of Subxt. #[cfg(feature = "subxt")] -#[cfg_attr(docsrs, doc(cfg(feature = "subxt")))] mod subxt_compat { use super::*; - - use subxt_core::{ - Config, - tx::signer::Signer as SignerT, - utils::{AccountId32, MultiAddress, MultiSignature}, - }; + use subxt::Config; + use subxt::transactions::Signer as SignerT; + use subxt::utils::{AccountId32, MultiAddress, MultiSignature}; impl From for MultiSignature { fn from(value: Signature) -> Self { diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml index 08d7b55eb56..fffdd0ed1f9 100644 --- a/subxt/Cargo.toml +++ b/subxt/Cargo.toml @@ -11,7 +11,7 @@ readme = "../README.md" repository.workspace = true documentation.workspace = true homepage.workspace = true -description = "Submit extrinsics (transactions) to a substrate node via RPC" +description = "Interact with Substrate based chains on the Polkadot Network" keywords = ["parity", "substrate", "blockchain"] [lints] @@ -22,6 +22,14 @@ workspace = true # it's recommended to use `--no-default-features` and then select what you need. default = ["jsonrpsee", "native"] +# Features that we expect to be enabled for documentation. +docs = [ + "default", + "light-client", + "runtime", + "reconnecting-rpc-client", +] + # Enable this for native (ie non web/wasm builds). # Exactly 1 of "web" and "native" is expected. native = [ @@ -68,7 +76,7 @@ unstable-metadata = [] # Activate this to expose the Light Client functionality. # Note that this feature is experimental and things may break or not work as expected. -unstable-light-client = ["subxt-lightclient", "subxt-rpcs/unstable-light-client"] +light-client = ["subxt-lightclient", "subxt-rpcs/light-client"] # Activate this to expose the ability to generate metadata from Wasm runtime files. runtime-wasm-path = ["subxt-macro/runtime-wasm-path"] @@ -78,18 +86,23 @@ async-trait = { workspace = true } codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] } derive-where = { workspace = true } scale-info = { workspace = true, features = ["default"] } +scale-info-legacy = { workspace = true } +scale-type-resolver = { workspace = true } scale-value = { workspace = true, features = ["default"] } scale-bits = { workspace = true, features = ["default"] } scale-decode = { workspace = true, features = ["default"] } scale-encode = { workspace = true, features = ["default"] } futures = { workspace = true } hex = { workspace = true } +impl-serde = { workspace = true, default-features = false } +keccak-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["default", "raw_value"] } sp-crypto-hashing = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true } frame-metadata = { workspace = true } +frame-decode = { workspace = true, features = ["legacy-types"] } either = { workspace = true } web-time = { workspace = true } @@ -101,13 +114,10 @@ jsonrpsee = { workspace = true, optional = true, features = ["jsonrpsee-types"] # Other subxt crates we depend on. subxt-macro = { workspace = true } -subxt-core = { workspace = true, features = ["std"] } -subxt-metadata = { workspace = true, features = ["std"] } +subxt-metadata = { workspace = true, features = ["std", "legacy"] } subxt-lightclient = { workspace = true, optional = true, default-features = false } -subxt-rpcs = { workspace = true, features = ["subxt"] } - -# For parsing urls to disallow insecure schemes -url = { workspace = true } +subxt-rpcs = { workspace = true } +subxt-utils-accountid32 = { workspace = true } # Included if "native" feature is enabled tokio-util = { workspace = true, features = ["compat"], optional = true } @@ -127,8 +137,8 @@ sp-core = { workspace = true, features = ["std"] } sp-keyring = { workspace = true, features = ["std"] } sp-runtime = { workspace = true, features = ["std"] } assert_matches = { workspace = true } -subxt-signer = { path = "../signer", features = ["unstable-eth"] } -subxt-rpcs = { workspace = true, features = ["subxt", "mock-rpc-client"] } +subxt-signer = { workspace = true, features = ["unstable-eth", "subxt", "sr25519"] } +subxt-rpcs = { workspace = true, features = ["mock-rpc-client"] } # Tracing subscriber is useful for light-client examples to ensure that # the `bootNodes` and chain spec are configured correctly. If all is fine, then # the light-client will emit INFO logs with @@ -141,23 +151,17 @@ hyper = { workspace = true } http-body = { workspace = true } [[example]] -name = "light_client_basic" -path = "examples/light_client_basic.rs" -required-features = ["unstable-light-client", "jsonrpsee"] - -[[example]] -name = "light_client_local_node" -path = "examples/light_client_local_node.rs" -required-features = ["unstable-light-client", "jsonrpsee", "native"] +name = "light_client" +path = "examples/light_client.rs" +required-features = ["light-client", "jsonrpsee"] [[example]] -name = "setup_reconnecting_rpc_client" -path = "examples/setup_reconnecting_rpc_client.rs" +name = "rpc_client" +path = "examples/rpc_client.rs" required-features = ["reconnecting-rpc-client"] [package.metadata.docs.rs] -features = ["default", "unstable-light-client"] -rustdoc-args = ["--cfg", "docsrs"] +features = ["docs"] [package.metadata.playground] -features = ["default", "unstable-light-client"] +features = ["default", "light-client"] diff --git a/subxt/build.rs b/subxt/build.rs new file mode 100644 index 00000000000..b21264e2bfa --- /dev/null +++ b/subxt/build.rs @@ -0,0 +1,29 @@ +//! Build + +use std::process::Command; + +fn main() { + // We want to be able to link to examples on GitHub specific to the current version. + // So, output an env var with either the git tag if one points to the current code, or + // the git hash pointing to the current code if no tag, or master if we + // encounter some error and can't be more specific. + if let Ok(tag) = Command::new("git").args(["tag", "--points-at"]).output() + && tag.status.success() + && !tag.stdout.is_empty() + { + write_to_out(&tag.stdout) + } else if let Ok(commit_hash) = Command::new("git").args(["rev-parse", "HEAD"]).output() + && commit_hash.status.success() + && !commit_hash.stdout.is_empty() + { + write_to_out(&commit_hash.stdout) + } else { + write_to_out(b"master") + } +} + +fn write_to_out(v: &[u8]) { + let out = String::from_utf8_lossy(v); + println!("cargo::rustc-env=SUBXT_REF={out}"); + println!("cargo::rerun-if-env-changed=SUBXT_REF"); +} diff --git a/historic/examples/extrinsics.rs b/subxt/examples/advanced_decoding.rs similarity index 64% rename from historic/examples/extrinsics.rs rename to subxt/examples/advanced_decoding.rs index b3f13905c30..b68bb97460b 100644 --- a/historic/examples/extrinsics.rs +++ b/subxt/examples/advanced_decoding.rs @@ -1,97 +1,42 @@ -#![allow(missing_docs)] -use subxt_historic::{OnlineClient, PolkadotConfig}; +//! Use a scale_decode::visitor::Visitor implementation to have more control over decoding. +//! +//! Here we decode extrinsic fields, but anywhere with a `.visit()` method can do the same, +//! for example storage values. +use std::error::Error; +use subxt::{OnlineClient, PolkadotConfig}; #[tokio::main] -async fn main() -> Result<(), Box> { - // Configuration for the Polkadot relay chain. +async fn main() -> Result<(), Box> { + // Create a new API client, configured to talk to Polkadot nodes. let config = PolkadotConfig::new(); - - // Create an online client for the Polkadot relay chain, pointed at a Polkadot archive node. - let client = OnlineClient::from_url(config, "wss://rpc.polkadot.io").await?; - - // Iterate through some randomly selected old blocks to show how to fetch and decode extrinsics. - for block_number in 1234567.. { - println!("=== Block {block_number} ==="); - - // Point the client at a specific block number. By default this will download and cache - // metadata for the required spec version (so it's cheaper to instantiate again), if it - // hasn't already, and borrow the relevant legacy types from the client. - let client_at_block = client.at(block_number).await?; - - // Fetch the extrinsics at that block. - let extrinsics = client_at_block.extrinsics().fetch().await?; - - // Now, we have various operations to work with them. Here we print out various details - // about each extrinsic. - for extrinsic in extrinsics.iter() { - println!( - "{}.{}", - extrinsic.call().pallet_name(), - extrinsic.call().name() - ); - - if let Some(signature) = extrinsic.signature_bytes() { - println!(" Signature: 0x{}", hex::encode(signature)); - } - - println!(" Call Data:"); - - // We can decode each of the fields (in this example we decode everything into a - // scale_value::Value type, which can represent any SCALE encoded data, but if you - // have an idea of the type then you can try to decode into that type instead): - for field in extrinsic.call().fields().iter() { - // We can visit fields, which gives us the ability to inspect and decode information - // from them selectively, returning whatever we like from it. Here we demo our - // type name visitor which is defined below: - let tn = field - .visit(type_name::GetTypeName::new())? - .unwrap_or_default(); - - // When visiting fields we can also decode into a custom shape like so: - let _custom_value = - field.visit(value::GetValue::new(&client_at_block.resolver()))?; - - // We can also obtain and decode things without the complexity of the above: - println!( - " {}: {} {}", - field.name(), - field.decode_as::().unwrap(), - if tn.is_empty() { - String::new() - } else { - format!("(type name: {tn})") - }, - ); - } - - // Or, all of them at once: - println!( - " All: {}", - extrinsic - .call() - .fields() - .decode_as::>() - .unwrap() - ); - - // We can also look at things like the transaction extensions: - if let Some(extensions) = extrinsic.transaction_extensions() { - println!(" Transaction Extensions:"); - - // We can decode each of them: - for extension in extensions.iter() { - println!( - " {}: {}", - extension.name(), - extension.decode_as::().unwrap() - ); - } - - // Or all of them at once: - println!( - " All: {}", - extensions.decode_as::>().unwrap() - ); + let api = OnlineClient::new(config).await?; + + // Stream the finalized blocks. See the OnlineClient docs for how to + // stream best blocks or all new blocks. + let mut blocks = api.stream_blocks().await?; + + while let Some(block) = blocks.next().await { + let block = block?; + let at_block = block.at().await?; + println!("Block #{}", at_block.block_number()); + + // Fetch the block extrinsics to decode: + let extrinsics = at_block.extrinsics().fetch().await?; + for ext in extrinsics.iter() { + let ext = ext?; + + println!(" {}.{}", ext.pallet_name(), ext.call_name()); + for field in ext.iter_call_data_fields() { + // This is a visitor. Here, we pass it type information so that it can internally + // lookup information about types that it's visiting, as an example. + let visitor = value::GetValue::new(at_block.metadata_ref().types()); + + // Use this visitor to decode the extrinsic field into a Value. + // A `visit` method like this is also provided for storage values, allowing for + // the same sort of decoding. + let decoded_value = field.visit(visitor)?; + + println!(" {}: {:?}", field.name(), decoded_value) } } } @@ -99,68 +44,6 @@ async fn main() -> Result<(), Box { - marker: core::marker::PhantomData, - } - - impl GetTypeName { - /// Construct our TypeName visitor. - pub fn new() -> Self { - GetTypeName { - marker: core::marker::PhantomData, - } - } - } - - impl Visitor for GetTypeName { - type Value<'scale, 'resolver> = Option<&'resolver str>; - type Error = scale_decode::Error; - type TypeResolver = R; - - // Look at the path of types that have paths and return the ident from that. - fn visit_composite<'scale, 'resolver>( - self, - value: &mut Composite<'scale, 'resolver, Self::TypeResolver>, - _type_id: TypeIdFor, - ) -> Result, Self::Error> { - Ok(value.path().last()) - } - fn visit_variant<'scale, 'resolver>( - self, - value: &mut Variant<'scale, 'resolver, Self::TypeResolver>, - _type_id: TypeIdFor, - ) -> Result, Self::Error> { - Ok(value.path().last()) - } - fn visit_sequence<'scale, 'resolver>( - self, - value: &mut Sequence<'scale, 'resolver, Self::TypeResolver>, - _type_id: TypeIdFor, - ) -> Result, Self::Error> { - Ok(value.path().last()) - } - - // Else, we return nothing as we can't find a name for the type. - fn visit_unexpected<'scale, 'resolver>( - self, - _unexpected: Unexpected, - ) -> Result, Self::Error> { - Ok(None) - } - } -} - /// This visitor demonstrates how to decode and return a custom Value shape mod value { use scale_decode::{ @@ -168,10 +51,11 @@ mod value { visitor::TypeIdFor, visitor::types::{Array, BitSequence, Composite, Sequence, Str, Tuple, Variant}, }; - use scale_type_resolver::TypeResolver; use std::collections::HashMap; + use subxt::ext::scale_type_resolver::TypeResolver; /// A value type we're decoding into. + #[derive(Debug)] #[allow(dead_code)] pub enum Value { Number(f64), @@ -188,6 +72,7 @@ mod value { VariantWithData(String, VariantFields), } + #[derive(Debug)] pub enum VariantFields { Unnamed(Vec), Named(HashMap), diff --git a/subxt/examples/block_decoding_dynamic.rs b/subxt/examples/block_decoding_dynamic.rs deleted file mode 100644 index 44ba483221c..00000000000 --- a/subxt/examples/block_decoding_dynamic.rs +++ /dev/null @@ -1,43 +0,0 @@ -#![allow(missing_docs)] -use subxt::{OnlineClient, PolkadotConfig}; - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a client that subscribes to blocks of the Polkadot network. - let api = OnlineClient::::from_url("wss://rpc.polkadot.io:443").await?; - - // Subscribe to all finalized blocks: - let mut blocks_sub = api.blocks().subscribe_finalized().await?; - while let Some(block) = blocks_sub.next().await { - let block = block?; - let block_number = block.header().number; - let block_hash = block.hash(); - println!("Block #{block_number} ({block_hash})"); - - // Decode each signed extrinsic in the block dynamically - let extrinsics = block.extrinsics().await?; - for ext in extrinsics.iter() { - let Some(transaction_extensions) = ext.transaction_extensions() else { - continue; // we do not look at inherents in this example - }; - - // Decode the fields into our dynamic Value type to display: - let fields = ext.decode_as_fields::()?; - - println!(" {}/{}", ext.pallet_name(), ext.call_name()); - println!(" Transaction Extensions:"); - for signed_ext in transaction_extensions.iter() { - // We only want to take a look at these 3 signed extensions, because the others all just have unit fields. - if ["CheckMortality", "CheckNonce", "ChargeTransactionPayment"] - .contains(&signed_ext.name()) - { - println!(" {}: {}", signed_ext.name(), signed_ext.value()?); - } - } - println!(" Fields:"); - println!(" {fields}\n"); - } - } - - Ok(()) -} diff --git a/subxt/examples/block_decoding_static.rs b/subxt/examples/block_decoding_static.rs deleted file mode 100644 index 9af696bab42..00000000000 --- a/subxt/examples/block_decoding_static.rs +++ /dev/null @@ -1,64 +0,0 @@ -#![allow(missing_docs)] -use subxt::{ - OnlineClient, PolkadotConfig, - utils::{AccountId32, MultiAddress}, -}; - -use codec::Decode; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -use polkadot::balances::calls::types::TransferKeepAlive; - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a client that subscribes to blocks of the Polkadot network. - let api = OnlineClient::::from_url("wss://rpc.polkadot.io:443").await?; - - // Subscribe to all finalized blocks: - let mut blocks_sub = api.blocks().subscribe_finalized().await?; - - // For each block, print details about the `TransferKeepAlive` transactions we are interested in. - while let Some(block) = blocks_sub.next().await { - let block = block?; - let block_number = block.header().number; - let block_hash = block.hash(); - println!("Block #{block_number} ({block_hash}):"); - - let extrinsics = block.extrinsics().await?; - for transfer in extrinsics.find::() { - let transfer = transfer?; - - let Some(extensions) = transfer.details.transaction_extensions() else { - panic!("TransferKeepAlive should be signed") - }; - - let addr_bytes = transfer - .details - .address_bytes() - .expect("TransferKeepAlive should be signed"); - let sender = MultiAddress::::decode(&mut &addr_bytes[..]) - .expect("Decoding should work"); - let sender = display_address(&sender); - let receiver = display_address(&transfer.value.dest); - let value = transfer.value.value; - let tip = extensions.tip().expect("Should have tip"); - let nonce = extensions.nonce().expect("Should have nonce"); - - println!( - " Transfer of {value} DOT:\n {sender} (Tip: {tip}, Nonce: {nonce}) ---> {receiver}", - ); - } - } - - Ok(()) -} - -fn display_address(addr: &MultiAddress) -> String { - if let MultiAddress::Id(id32) = addr { - format!("{id32}") - } else { - "MultiAddress::...".into() - } -} diff --git a/subxt/examples/blocks.rs b/subxt/examples/blocks.rs new file mode 100644 index 00000000000..f9fde29e635 --- /dev/null +++ b/subxt/examples/blocks.rs @@ -0,0 +1,86 @@ +//! Subscribe to blocks. +use subxt::dynamic::Value; +use subxt::{Error, OnlineClient, PolkadotConfig}; + +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] +mod polkadot {} + +#[tokio::main] +async fn main() -> Result<(), Error> { + // Create a new API client, configured to talk to Polkadot nodes. + let config = PolkadotConfig::new(); + let api = OnlineClient::new(config).await?; + + // Stream the finalized blocks. See the OnlineClient docs for how to + // stream best blocks or all new blocks. + let mut blocks = api.stream_blocks().await?; + + while let Some(block) = blocks.next().await { + let block = block?; + + let block_number = block.number(); + let block_hash = block.hash(); + + println!("Block #{block_number}:"); + println!(" Hash: {block_hash}"); + println!(" Extrinsics:"); + + // Create a client to work at this block. From here you have the + // same interface as `api.block(block.hash()).await`. + let at_block = block.at().await?; + + // Here we'll iterate over the extrinsics and display information about each one: + let extrinsics = at_block.extrinsics().fetch().await?; + for ext in extrinsics.iter() { + let ext = ext?; + + let idx = ext.index(); + let pallet_name = ext.pallet_name(); + let call_name = ext.call_name(); + let bytes_hex = format!("0x{}", hex::encode(ext.bytes())); + let events = ext.events().await?; + + // See the API docs for more ways to decode extrinsics. Here we decode into + // a statically generated type, but any type implementing scale_decode::DecodeAsType + // can be used here, for instance subxt::dynamic::Value. + let decoded_ext = ext.decode_call_data_as::()?; + + println!(" #{idx}: {pallet_name}.{call_name}:"); + println!(" Bytes: {bytes_hex}"); + println!(" Decoded: {decoded_ext:?}"); + + for evt in events.iter() { + println!(" Events:"); + let evt = evt?; + let event_idx = evt.event_index(); + let pallet_name = evt.pallet_name(); + let event_name = evt.event_name(); + let event_values = evt.decode_fields_unchecked_as::()?; + + println!(" #{event_idx}: {pallet_name}.{event_name}"); + println!(" {event_values}"); + } + + if let Some(transaction_extensions) = ext.transaction_extensions() { + println!(" Transaction Extensions:"); + for transaction_extension in transaction_extensions.iter() { + let name = transaction_extension.name(); + let value = transaction_extension.decode_unchecked_as::()?; + println!(" {name}: {value}"); + } + } + } + + // Instead of iterating, we can also use the static interface to search & decode specific + // extrinsics if we know what we are looking for: + if let Some(ext) = extrinsics.find_first::() { + let ext = ext?; + + println!("ParaInherent.Enter"); + println!(" backed_candidated: {:?}", ext.data.backed_candidates); + println!(" disputes: {:?}", ext.data.disputes); + } + } + + Ok(()) +} diff --git a/subxt/examples/blocks_subscribing.rs b/subxt/examples/blocks_subscribing.rs deleted file mode 100644 index f0f0a37d43e..00000000000 --- a/subxt/examples/blocks_subscribing.rs +++ /dev/null @@ -1,63 +0,0 @@ -#![allow(missing_docs)] -use subxt::{OnlineClient, PolkadotConfig}; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a client to use: - let api = OnlineClient::::new().await?; - - // Subscribe to all finalized blocks: - let mut blocks_sub = api.blocks().subscribe_finalized().await?; - - // For each block, print a bunch of information about it: - while let Some(block) = blocks_sub.next().await { - let block = block?; - - let block_number = block.header().number; - let block_hash = block.hash(); - - println!("Block #{block_number}:"); - println!(" Hash: {block_hash}"); - println!(" Extrinsics:"); - - // Log each of the extrinsic with it's associated events: - let extrinsics = block.extrinsics().await?; - for ext in extrinsics.iter() { - let idx = ext.index(); - let events = ext.events().await?; - let bytes_hex = format!("0x{}", hex::encode(ext.bytes())); - - // See the API docs for more ways to decode extrinsics: - let decoded_ext = ext.as_root_extrinsic::(); - - println!(" Extrinsic #{idx}:"); - println!(" Bytes: {bytes_hex}"); - println!(" Decoded: {decoded_ext:?}"); - - println!(" Events:"); - for evt in events.iter() { - let evt = evt?; - let pallet_name = evt.pallet_name(); - let event_name = evt.variant_name(); - let event_values = evt.decode_as_fields::()?; - - println!(" {pallet_name}_{event_name}"); - println!(" {event_values}"); - } - - println!(" Transaction Extensions:"); - if let Some(transaction_extensions) = ext.transaction_extensions() { - for transaction_extension in transaction_extensions.iter() { - let name = transaction_extension.name(); - let value = transaction_extension.value()?.to_string(); - println!(" {name}: {value}"); - } - } - } - } - - Ok(()) -} diff --git a/subxt/examples/constants_dynamic.rs b/subxt/examples/constants_dynamic.rs deleted file mode 100644 index 2d4ed4c5d7e..00000000000 --- a/subxt/examples/constants_dynamic.rs +++ /dev/null @@ -1,26 +0,0 @@ -#![allow(missing_docs)] -use subxt::dynamic::Value; -use subxt::{OnlineClient, PolkadotConfig}; - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a client to use: - let api = OnlineClient::::new().await?; - - // We can query a constant by providing a tuple of the pallet and constant name. The return type - // will be `Value` if we pass this query: - let constant_query = ("System", "BlockLength"); - let _value = api.constants().at(&constant_query)?; - - // Or we can use the library function to query a constant, which allows us to pass a generic type - // that Subxt will attempt to decode the constant into: - let constant_query = subxt::dynamic::constant::("System", "BlockLength"); - let value = api.constants().at(&constant_query)?; - - // Or we can obtain the bytes for the constant, using either form of query. - let bytes = api.constants().bytes_at(&constant_query)?; - - println!("Constant bytes: {:?}", bytes); - println!("Constant value: {}", value); - Ok(()) -} diff --git a/subxt/examples/constants_static.rs b/subxt/examples/constants_static.rs deleted file mode 100644 index 2bb1aecbf6b..00000000000 --- a/subxt/examples/constants_static.rs +++ /dev/null @@ -1,24 +0,0 @@ -#![allow(missing_docs)] -use subxt::{OnlineClient, PolkadotConfig}; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a client to use: - let api = OnlineClient::::new().await?; - - // A query to obtain some constant: - let constant_query = polkadot::constants().system().block_length(); - - // Obtain the value: - let value = api.constants().at(&constant_query)?; - - // Or obtain the bytes: - let bytes = api.constants().bytes_at(&constant_query)?; - - println!("Encoded block length: {bytes:?}"); - println!("Block length: {value:?}"); - Ok(()) -} diff --git a/subxt/examples/events.rs b/subxt/examples/events.rs deleted file mode 100644 index 9861c9238ef..00000000000 --- a/subxt/examples/events.rs +++ /dev/null @@ -1,48 +0,0 @@ -#![allow(missing_docs)] -use subxt::{OnlineClient, PolkadotConfig}; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a client to use: - let api = OnlineClient::::new().await?; - - // Get events for the latest block: - let events = api.events().at_latest().await?; - - // We can dynamically decode events: - println!("Dynamic event details:"); - for event in events.iter() { - let event = event?; - - let pallet = event.pallet_name(); - let variant = event.variant_name(); - let field_values = event.decode_as_fields::()?; - - println!("{pallet}::{variant}: {field_values}"); - } - - // Or we can attempt to statically decode them into the root Event type: - println!("Static event details:"); - for event in events.iter() { - let event = event?; - - if let Ok(ev) = event.as_root_event::() { - println!("{ev:?}"); - } else { - println!(""); - } - } - - // Or we can look for specific events which match our statically defined ones: - let transfer_event = events.find_first::()?; - if let Some(ev) = transfer_event { - println!(" - Balance transfer success: value: {:?}", ev.amount); - } else { - println!(" - No balance transfer event found in this block"); - } - - Ok(()) -} diff --git a/subxt/examples/historic_blocks.rs b/subxt/examples/historic_blocks.rs new file mode 100644 index 00000000000..7c3de62f8f4 --- /dev/null +++ b/subxt/examples/historic_blocks.rs @@ -0,0 +1,55 @@ +//! Working with historic blocks. +use subxt::dynamic::Value; +use subxt::{Error, OnlineClient, PolkadotConfig}; + +#[tokio::main] +async fn main() -> Result<(), Error> { + // Point at an archive node since we want to obtain old blocks. + let config = PolkadotConfig::new(); + let api = OnlineClient::from_url(config, "wss://rpc.polkadot.io").await?; + + for block_number in 1234567u32.. { + let at_block = api.at_block(block_number).await?; + + let block_number = at_block.block_number(); + let block_hash = at_block.block_hash(); + + println!("Block #{block_number}:"); + println!(" Hash: {block_hash}"); + println!(" Extrinsics:"); + + // Here we'll obtain and display the extrinsics: + let extrinsics = at_block.extrinsics().fetch().await?; + for ext in extrinsics.iter() { + let ext = ext?; + + let idx = ext.index(); + let pallet_name = ext.pallet_name(); + let call_name = ext.call_name(); + let bytes_hex = format!("0x{}", hex::encode(ext.bytes())); + let events = ext.events().await?; + + // See the API docs for more ways to decode extrinsics. Here, since we're + // accessing a historic block, we don't use any generated types to help us. + let decoded_ext = ext.decode_call_data_fields_unchecked_as::()?; + + println!(" #{idx}: {pallet_name}.{call_name}:"); + println!(" Bytes: {bytes_hex}"); + println!(" Decoded: {decoded_ext}"); + + for evt in events.iter() { + println!(" Events:"); + let evt = evt?; + let event_idx = evt.event_index(); + let pallet_name = evt.pallet_name(); + let event_name = evt.event_name(); + let event_values = evt.decode_fields_unchecked_as::()?; + + println!(" #{event_idx}: {pallet_name}.{event_name}"); + println!(" {event_values}"); + } + } + } + + Ok(()) +} diff --git a/subxt/examples/light_client.rs b/subxt/examples/light_client.rs new file mode 100644 index 00000000000..4f48d8aabbd --- /dev/null +++ b/subxt/examples/light_client.rs @@ -0,0 +1,65 @@ +//! We can configure Subxt to use a Smoldot based lightclient to connect to a chain. +use futures::StreamExt; +use subxt::{OnlineClient, PolkadotConfig, lightclient::LightClient}; + +// Generate an interface that we can use from the node's metadata. +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] +pub mod polkadot {} + +const POLKADOT_SPEC: &str = include_str!("../../artifacts/demo_chain_specs/polkadot.json"); +const ASSET_HUB_SPEC: &str = + include_str!("../../artifacts/demo_chain_specs/polkadot_asset_hub.json"); + +#[tokio::main] +async fn main() -> Result<(), Box> { + // The lightclient logs are informative: + tracing_subscriber::fmt::init(); + + // (Optional) for dev purposes, we can use a Subxt utility function to fetch a chainspec from + // a locally running node if we like, but in this example we use some pre-baked chainspecs: + let _chain_spec = subxt::utils::fetch_chainspec_from_rpc_node("ws://127.0.0.1:9944").await; + + // Instantiate a light client with the Polkadot relay chain, + // and connect it to Asset Hub, too. + let (lightclient, polkadot_rpc) = LightClient::relay_chain(POLKADOT_SPEC)?; + let asset_hub_rpc = lightclient.parachain(ASSET_HUB_SPEC)?; + + // Create Subxt clients from these Smoldot backed RPC clients. + let config = PolkadotConfig::new(); + let polkadot_api = + OnlineClient::::from_rpc_client(config.clone(), polkadot_rpc).await?; + let asset_hub_api = + OnlineClient::::from_rpc_client(config, asset_hub_rpc).await?; + + // Now we can use them as with any other Subxt instance. Here we fetch finalized blocks + // from both chains and print some detail about the contained extrinsics. + let polkadot_sub = polkadot_api + .stream_blocks() + .await? + .map(|block| ("Polkadot", block)); + let parachain_sub = asset_hub_api + .stream_blocks() + .await? + .map(|block| ("AssetHub", block)); + + let mut stream_combinator = futures::stream::select(polkadot_sub, parachain_sub); + + while let Some((chain, block)) = stream_combinator.next().await { + let block = block?; + + // Print some details about the blocks we fetch via the light client. + println!("Chain {:?} hash={:?}", chain, block.hash()); + let at_block = block.at().await?; + let extrinsics = at_block.extrinsics().fetch().await?; + for ext in extrinsics.iter() { + let ext = ext?; + + let idx = ext.index(); + let pallet_name = ext.pallet_name(); + let call_name = ext.call_name(); + println!(" #{idx}: {pallet_name}.{call_name}"); + } + } + + Ok(()) +} diff --git a/subxt/examples/light_client_basic.rs b/subxt/examples/light_client_basic.rs deleted file mode 100644 index 397de2a2555..00000000000 --- a/subxt/examples/light_client_basic.rs +++ /dev/null @@ -1,47 +0,0 @@ -#![allow(missing_docs)] -use futures::StreamExt; -use subxt::{PolkadotConfig, client::OnlineClient, lightclient::LightClient}; - -// Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -const POLKADOT_SPEC: &str = include_str!("../../artifacts/demo_chain_specs/polkadot.json"); -const ASSET_HUB_SPEC: &str = - include_str!("../../artifacts/demo_chain_specs/polkadot_asset_hub.json"); - -#[tokio::main] -async fn main() -> Result<(), Box> { - // The lightclient logs are informative: - tracing_subscriber::fmt::init(); - - // Instantiate a light client with the Polkadot relay chain, - // and connect it to Asset Hub, too. - let (lightclient, polkadot_rpc) = LightClient::relay_chain(POLKADOT_SPEC)?; - let asset_hub_rpc = lightclient.parachain(ASSET_HUB_SPEC)?; - - // Create Subxt clients from these Smoldot backed RPC clients. - let polkadot_api = OnlineClient::::from_rpc_client(polkadot_rpc).await?; - let asset_hub_api = OnlineClient::::from_rpc_client(asset_hub_rpc).await?; - - // Use them! - let polkadot_sub = polkadot_api - .blocks() - .subscribe_finalized() - .await? - .map(|block| ("Polkadot", block)); - let parachain_sub = asset_hub_api - .blocks() - .subscribe_finalized() - .await? - .map(|block| ("AssetHub", block)); - - let mut stream_combinator = futures::stream::select(polkadot_sub, parachain_sub); - - while let Some((chain, block)) = stream_combinator.next().await { - let block = block?; - println!(" Chain {:?} hash={:?}", chain, block.hash()); - } - - Ok(()) -} diff --git a/subxt/examples/light_client_local_node.rs b/subxt/examples/light_client_local_node.rs deleted file mode 100644 index 68012b85519..00000000000 --- a/subxt/examples/light_client_local_node.rs +++ /dev/null @@ -1,58 +0,0 @@ -#![allow(missing_docs)] -use subxt::utils::fetch_chainspec_from_rpc_node; -use subxt::{ - PolkadotConfig, - client::OnlineClient, - lightclient::{ChainConfig, LightClient}, -}; -use subxt_signer::sr25519::dev; - -// Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // The smoldot logs are informative: - tracing_subscriber::fmt::init(); - - // Use a utility function to obtain a chain spec from a locally running node: - let chain_spec = fetch_chainspec_from_rpc_node("ws://127.0.0.1:9944").await?; - - // Configure the bootnodes of this chain spec. In this case, because we start one - // single node, the bootnodes must be overwritten for the light client to connect - // to the local node. - // - // The `12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp` is the P2P address - // from a local polkadot node starting with - // `--node-key 0000000000000000000000000000000000000000000000000000000000000001` - let chain_config = ChainConfig::chain_spec(chain_spec.get()).set_bootnodes([ - "/ip4/127.0.0.1/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp", - ])?; - - // Start the light client up, establishing a connection to the local node. - let (_light_client, chain_rpc) = LightClient::relay_chain(chain_config)?; - let api = OnlineClient::::from_rpc_client(chain_rpc).await?; - - // Build a balance transfer extrinsic. - let dest = dev::bob().public_key().into(); - let balance_transfer_tx = polkadot::tx().balances().transfer_allow_death(dest, 10_000); - - // Submit the balance transfer extrinsic from Alice, and wait for it to be successful - // and in a finalized block. We get back the extrinsic events if all is well. - let from = dev::alice(); - let events = api - .tx() - .sign_and_submit_then_watch_default(&balance_transfer_tx, &from) - .await? - .wait_for_finalized_success() - .await?; - - // Find a Transfer event and print it. - let transfer_event = events.find_first::()?; - if let Some(event) = transfer_event { - println!("Balance transfer success: {event:?}"); - } - - Ok(()) -} diff --git a/subxt/examples/rpc_client.rs b/subxt/examples/rpc_client.rs new file mode 100644 index 00000000000..b7ae55aff94 --- /dev/null +++ b/subxt/examples/rpc_client.rs @@ -0,0 +1,38 @@ +//! We can provide a custom RPC client to Subxt to use, instead of the default. +use subxt::config::RpcConfigFor; +use subxt::{Error, OnlineClient, PolkadotConfig}; +use subxt_rpcs::client::{ReconnectingRpcClient, RpcClient}; + +#[tokio::main] +async fn main() -> Result<(), Error> { + let config = PolkadotConfig::new(); + + // Configure an RPC client. Here we use the reconnecting one, but several impls are + // available, or you can implement the subxt_rpcs::client::RpcClientT trait yourself + // to bring your own RPC client. + let inner_rpc_client = ReconnectingRpcClient::builder() + .build("wss://rpc.ibp.network/polkadot") + .await + .map_err(Error::other)?; + + let rpc_client = RpcClient::new(inner_rpc_client); + + // Pass it to Subxt to use. + let client = OnlineClient::from_rpc_client(config, rpc_client.clone()).await?; + + // We can use the Subxt client: + let at_block = client.at_current_block().await?; + let header = at_block.block_header().await?; + println!("Current block header via Subxt: {header:?}"); + + // Since we cloned the RPC client above, we can use it ourselves too: + let legacy_rpcs = + subxt_rpcs::methods::LegacyRpcMethods::>::new(rpc_client); + let header = legacy_rpcs + .chain_get_header(Some(at_block.block_hash())) + .await? + .unwrap(); + println!("Current block header via RPC call: {header:?}"); + + Ok(()) +} diff --git a/subxt/examples/rpc_legacy.rs b/subxt/examples/rpc_legacy.rs deleted file mode 100644 index a21afd8f971..00000000000 --- a/subxt/examples/rpc_legacy.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![allow(missing_docs)] -use subxt::backend::{legacy::LegacyRpcMethods, rpc::RpcClient}; -use subxt::config::DefaultExtrinsicParamsBuilder as Params; -use subxt::{OnlineClient, PolkadotConfig}; -use subxt_signer::sr25519::dev; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // First, create a raw RPC client: - let rpc_client = RpcClient::from_url("ws://127.0.0.1:9944").await?; - - // Use this to construct our RPC methods: - let rpc = LegacyRpcMethods::::new(rpc_client.clone()); - - // We can use the same client to drive our full Subxt interface too: - let api = OnlineClient::::from_rpc_client(rpc_client.clone()).await?; - - // Now, we can make some RPC calls using some legacy RPC methods. - println!( - "📛 System Name: {:?}\n🩺 Health: {:?}\n🖫 Properties: {:?}\n🔗 Chain: {:?}\n", - rpc.system_name().await?, - rpc.system_health().await?, - rpc.system_properties().await?, - rpc.system_chain().await? - ); - - // We can also interleave RPC calls and using the full Subxt client, here to submit multiple - // transactions using the legacy `system_account_next_index` RPC call, which returns a nonce - // that is adjusted for any transactions already in the pool: - - let alice = dev::alice(); - let bob = dev::bob(); - - loop { - let current_nonce = rpc - .system_account_next_index(&alice.public_key().into()) - .await?; - - let ext_params = Params::new().mortal(8).nonce(current_nonce).build(); - - let balance_transfer = polkadot::tx() - .balances() - .transfer_allow_death(bob.public_key().into(), 1_000_000); - - let ext_hash = api - .tx() - .create_partial_offline(&balance_transfer, ext_params)? - .sign(&alice) - .submit() - .await?; - - println!("Submitted ext {ext_hash} with nonce {current_nonce}"); - - // Sleep less than block time, but long enough to ensure - // not all transactions end up in the same block. - tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; - } -} diff --git a/subxt/examples/runtime_apis_dynamic.rs b/subxt/examples/runtime_apis_dynamic.rs deleted file mode 100644 index ef9c4ac0714..00000000000 --- a/subxt/examples/runtime_apis_dynamic.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![allow(missing_docs)] -use subxt::utils::AccountId32; -use subxt::{OnlineClient, config::PolkadotConfig}; -use subxt_signer::sr25519::dev; - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a client to use: - let api = OnlineClient::::new().await?; - - // Create a "dynamic" runtime API payload that calls the - // `AccountNonceApi_account_nonce` function. We could use the - // `scale_value::Value` type as output, and a vec of those as inputs, - // but since we know the input + return types we can pass them directly. - // There is one input argument, so the inputs are a tuple of one element. - let account: AccountId32 = dev::alice().public_key().into(); - let runtime_api_call = - subxt::dynamic::runtime_api_call::<_, u64>("AccountNonceApi", "account_nonce", (account,)); - - // Submit the call to get back a result. - let nonce = api - .runtime_api() - .at_latest() - .await? - .call(runtime_api_call) - .await?; - - println!("Account nonce: {:#?}", nonce); - Ok(()) -} diff --git a/subxt/examples/runtime_apis_raw.rs b/subxt/examples/runtime_apis_raw.rs deleted file mode 100644 index 45b5eecc50b..00000000000 --- a/subxt/examples/runtime_apis_raw.rs +++ /dev/null @@ -1,23 +0,0 @@ -#![allow(missing_docs)] -use subxt::ext::codec::{Compact, Decode}; -use subxt::ext::frame_metadata::RuntimeMetadataPrefixed; -use subxt::{OnlineClient, PolkadotConfig}; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a client to use: - let api = OnlineClient::::new().await?; - - // Use runtime APIs at the latest block: - let runtime_apis = api.runtime_api().at_latest().await?; - - // Ask for metadata and decode it: - let result_bytes = runtime_apis.call_raw("Metadata_metadata", None).await?; - let (_, meta): (Compact, RuntimeMetadataPrefixed) = Decode::decode(&mut &*result_bytes)?; - - println!("{meta:?}"); - Ok(()) -} diff --git a/subxt/examples/runtime_apis_static.rs b/subxt/examples/runtime_apis_static.rs deleted file mode 100644 index 95228668e64..00000000000 --- a/subxt/examples/runtime_apis_static.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![allow(missing_docs)] -use subxt::{OnlineClient, config::PolkadotConfig}; -use subxt_signer::sr25519::dev; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a client to use: - let api = OnlineClient::::new().await?; - - // Create a runtime API payload that calls into - // `AccountNonceApi_account_nonce` function. - let account = dev::alice().public_key().into(); - let runtime_api_call = polkadot::apis().account_nonce_api().account_nonce(account); - - // Submit the call and get back a result. - let nonce = api - .runtime_api() - .at_latest() - .await? - .call(runtime_api_call) - .await; - - println!("AccountNonceApi_account_nonce for Alice: {nonce:?}"); - Ok(()) -} diff --git a/subxt/examples/setup_client_custom_rpc.rs b/subxt/examples/setup_client_custom_rpc.rs deleted file mode 100644 index 47580ba32ab..00000000000 --- a/subxt/examples/setup_client_custom_rpc.rs +++ /dev/null @@ -1,86 +0,0 @@ -#![allow(missing_docs)] -use std::{ - fmt::Write, - pin::Pin, - sync::{Arc, Mutex}, -}; -use subxt::{ - OnlineClient, PolkadotConfig, - backend::rpc::{RawRpcFuture, RawRpcSubscription, RawValue, RpcClient, RpcClientT}, -}; - -// A dummy RPC client that doesn't actually handle requests properly -// at all, but instead just logs what requests to it were made. -struct MyLoggingClient { - log: Arc>, -} - -// We have to implement this fairly low level trait to turn [`MyLoggingClient`] -// into an RPC client that we can make use of in Subxt. Here we just log the requests -// made but don't forward them to any real node, and instead just return nonsense. -impl RpcClientT for MyLoggingClient { - fn request_raw<'a>( - &'a self, - method: &'a str, - params: Option>, - ) -> RawRpcFuture<'a, Box> { - writeln!( - self.log.lock().unwrap(), - "{method}({})", - params.as_ref().map(|p| p.get()).unwrap_or("[]") - ) - .unwrap(); - - // We've logged the request; just return garbage. Because a boxed future is returned, - // you're able to run whatever async code you'd need to actually talk to a node. - let res = RawValue::from_string("[]".to_string()).unwrap(); - Box::pin(std::future::ready(Ok(res))) - } - - fn subscribe_raw<'a>( - &'a self, - sub: &'a str, - params: Option>, - unsub: &'a str, - ) -> RawRpcFuture<'a, RawRpcSubscription> { - writeln!( - self.log.lock().unwrap(), - "{sub}({}) (unsub: {unsub})", - params.as_ref().map(|p| p.get()).unwrap_or("[]") - ) - .unwrap(); - - // We've logged the request; just return garbage. Because a boxed future is returned, - // and that will return a boxed Stream impl, you have a bunch of flexibility to build - // and return whatever type of Stream you see fit. - let res = RawValue::from_string("[]".to_string()).unwrap(); - let stream = futures::stream::once(async move { Ok(res) }); - let stream: Pin + Send>> = Box::pin(stream); - // This subscription does not provide an ID. - Box::pin(std::future::ready(Ok(RawRpcSubscription { - stream, - id: None, - }))) - } -} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Instantiate our replacement RPC client. - let log = Arc::default(); - let rpc_client = { - let inner = MyLoggingClient { - log: Arc::clone(&log), - }; - RpcClient::new(inner) - }; - - // Pass this into our OnlineClient to instantiate it. This will lead to some - // RPC calls being made to fetch chain details/metadata, which will immediately - // fail.. - let _ = OnlineClient::::from_rpc_client(rpc_client).await; - - // But, we can see that the calls were made via our custom RPC client: - println!("Log of calls made:\n\n{}", log.lock().unwrap().as_str()); - Ok(()) -} diff --git a/subxt/examples/setup_client_offline.rs b/subxt/examples/setup_client_offline.rs deleted file mode 100644 index ba483f7164a..00000000000 --- a/subxt/examples/setup_client_offline.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![allow(missing_docs)] -use subxt::ext::codec::Decode; -use subxt::metadata::Metadata; -use subxt::utils::H256; -use subxt::{OfflineClient, config::PolkadotConfig}; - -#[tokio::main] -async fn main() -> Result<(), Box> { - // We need to obtain the following details for an OfflineClient to be instantiated: - - // 1. Genesis hash (RPC call: chain_getBlockHash(0)): - let genesis_hash = { - let h = "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"; - let bytes = hex::decode(h).unwrap(); - H256::from_slice(&bytes) - }; - - // 2. A runtime version (system_version constant on a Substrate node has these): - let runtime_version = subxt::client::RuntimeVersion { - spec_version: 9370, - transaction_version: 20, - }; - - // 3. Metadata (I'll load it from the downloaded metadata, but you can use - // `subxt metadata > file.scale` to download it): - let metadata = { - let bytes = std::fs::read("./artifacts/polkadot_metadata_small.scale").unwrap(); - Metadata::decode(&mut &*bytes).unwrap() - }; - - // Create an offline client using the details obtained above: - let _api = OfflineClient::::new(genesis_hash, runtime_version, metadata); - - Ok(()) -} diff --git a/subxt/examples/setup_config_assethub.rs b/subxt/examples/setup_config_assethub.rs deleted file mode 100644 index b39f39a2dd0..00000000000 --- a/subxt/examples/setup_config_assethub.rs +++ /dev/null @@ -1,54 +0,0 @@ -#![allow(missing_docs)] -use subxt::config::{ - Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder, PolkadotConfig, SubstrateConfig, -}; -use subxt_signer::sr25519::dev; - -#[subxt::subxt( - runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", - derive_for_type( - path = "staging_xcm::v3::multilocation::MultiLocation", - derive = "Clone, codec::Encode", - recursive - ) -)] -pub mod runtime {} -use runtime::runtime_types::staging_xcm::v3::multilocation::MultiLocation; -use runtime::runtime_types::xcm::v3::junctions::Junctions; - -// We don't need to construct this at runtime, so an empty enum is appropriate. -pub enum AssetHubConfig {} - -impl Config for AssetHubConfig { - type AccountId = ::AccountId; - type Address = ::Address; - type Signature = ::Signature; - type Hasher = ::Hasher; - type Header = ::Header; - type ExtrinsicParams = DefaultExtrinsicParams; - // Here we use the MultiLocation from the metadata as a part of the config: - // The `ChargeAssetTxPayment` signed extension that is part of the ExtrinsicParams above, now uses the type: - type AssetId = MultiLocation; -} - -#[tokio::main] -async fn main() { - // With the config defined, we can create an extrinsic with subxt: - let client = subxt::OnlineClient::::new().await.unwrap(); - let tx_payload = runtime::tx().system().remark(b"Hello".to_vec()); - - // Build extrinsic params using an asset at this location as a tip: - let location: MultiLocation = MultiLocation { - parents: 3, - interior: Junctions::Here, - }; - let tx_config = DefaultExtrinsicParamsBuilder::::new() - .tip_of(1234, location) - .build(); - - // And provide the extrinsic params including the tip when submitting a transaction: - let _ = client - .tx() - .sign_and_submit_then_watch(&tx_payload, &dev::alice(), tx_config) - .await; -} diff --git a/subxt/examples/setup_config_custom.rs b/subxt/examples/setup_config_custom.rs deleted file mode 100644 index a4732f3f89a..00000000000 --- a/subxt/examples/setup_config_custom.rs +++ /dev/null @@ -1,97 +0,0 @@ -#![allow(missing_docs)] -use codec::Encode; -use subxt::client::ClientState; -use subxt::config::{ - Config, ExtrinsicParams, ExtrinsicParamsEncoder, ExtrinsicParamsError, HashFor, - transaction_extensions::Params, -}; -use subxt_signer::sr25519::dev; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] -pub mod runtime {} - -// We don't need to construct this at runtime, -// so an empty enum is appropriate: -pub enum CustomConfig {} - -impl Config for CustomConfig { - type AccountId = subxt::utils::AccountId32; - type Address = subxt::utils::MultiAddress; - type Signature = subxt::utils::MultiSignature; - type Hasher = subxt::config::substrate::BlakeTwo256; - type Header = subxt::config::substrate::SubstrateHeader; - type ExtrinsicParams = CustomExtrinsicParams; - type AssetId = u32; -} - -// This represents some arbitrary (and nonsensical) custom parameters that -// will be attached to transaction extra and additional payloads: -pub struct CustomExtrinsicParams { - genesis_hash: HashFor, - tip: u128, - foo: bool, -} - -// We can provide a "pretty" interface to allow users to provide these: -#[derive(Default)] -pub struct CustomExtrinsicParamsBuilder { - tip: u128, - foo: bool, -} - -impl CustomExtrinsicParamsBuilder { - pub fn new() -> Self { - Default::default() - } - pub fn tip(mut self, value: u128) -> Self { - self.tip = value; - self - } - pub fn enable_foo(mut self) -> Self { - self.foo = true; - self - } -} - -impl Params for CustomExtrinsicParamsBuilder {} - -// Describe how to fetch and then encode the params: -impl ExtrinsicParams for CustomExtrinsicParams { - type Params = CustomExtrinsicParamsBuilder; - - // Gather together all of the params we will need to encode: - fn new(client: &ClientState, params: Self::Params) -> Result { - Ok(Self { - genesis_hash: client.genesis_hash, - tip: params.tip, - foo: params.foo, - }) - } -} - -// Encode the relevant params when asked: -impl ExtrinsicParamsEncoder for CustomExtrinsicParams { - fn encode_value_to(&self, v: &mut Vec) { - (self.tip, self.foo).encode_to(v); - } - fn encode_implicit_to(&self, v: &mut Vec) { - self.genesis_hash.encode_to(v) - } -} - -#[tokio::main] -async fn main() { - // With the config defined, it can be handed to Subxt as follows: - let client = subxt::OnlineClient::::new().await.unwrap(); - - let tx_payload = runtime::tx().system().remark(b"Hello".to_vec()); - - // Build your custom "Params": - let tx_config = CustomExtrinsicParamsBuilder::new().tip(1234).enable_foo(); - - // And provide them when submitting a transaction: - let _ = client - .tx() - .sign_and_submit_then_watch(&tx_payload, &dev::alice(), tx_config) - .await; -} diff --git a/subxt/examples/setup_config_transaction_extension.rs b/subxt/examples/setup_config_transaction_extension.rs deleted file mode 100644 index f0fcc588944..00000000000 --- a/subxt/examples/setup_config_transaction_extension.rs +++ /dev/null @@ -1,106 +0,0 @@ -#![allow(missing_docs)] -use codec::Encode; -use scale_encode::EncodeAsType; -use scale_info::PortableRegistry; -use subxt::client::ClientState; -use subxt::config::transaction_extensions; -use subxt::config::{ - Config, DefaultExtrinsicParamsBuilder, ExtrinsicParams, ExtrinsicParamsEncoder, - ExtrinsicParamsError, -}; -use subxt_signer::sr25519::dev; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod runtime {} - -// We don't need to construct this at runtime, -// so an empty enum is appropriate: -#[derive(EncodeAsType)] -pub enum CustomConfig {} - -impl Config for CustomConfig { - type AccountId = subxt::utils::AccountId32; - type Address = subxt::utils::MultiAddress; - type Signature = subxt::utils::MultiSignature; - type Hasher = subxt::config::substrate::BlakeTwo256; - type Header = subxt::config::substrate::SubstrateHeader; - type ExtrinsicParams = transaction_extensions::AnyOf< - Self, - ( - // Load in the existing signed extensions we're interested in - // (if the extension isn't actually needed it'll just be ignored): - transaction_extensions::VerifySignature, - transaction_extensions::CheckSpecVersion, - transaction_extensions::CheckTxVersion, - transaction_extensions::CheckNonce, - transaction_extensions::CheckGenesis, - transaction_extensions::CheckMortality, - transaction_extensions::ChargeAssetTxPayment, - transaction_extensions::ChargeTransactionPayment, - transaction_extensions::CheckMetadataHash, - // And add a new one of our own: - CustomTransactionExtension, - ), - >; - type AssetId = u32; -} - -// Our custom signed extension doesn't do much: -pub struct CustomTransactionExtension; - -// Give the extension a name; this allows `AnyOf` to look it -// up in the chain metadata in order to know when and if to use it. -impl transaction_extensions::TransactionExtension for CustomTransactionExtension { - type Decoded = (); - fn matches(identifier: &str, _type_id: u32, _types: &PortableRegistry) -> bool { - identifier == "CustomTransactionExtension" - } -} - -// Gather together any params we need for our signed extension, here none. -impl ExtrinsicParams for CustomTransactionExtension { - type Params = (); - - fn new(_client: &ClientState, _params: Self::Params) -> Result { - Ok(CustomTransactionExtension) - } -} - -// Encode whatever the extension needs to provide when asked: -impl ExtrinsicParamsEncoder for CustomTransactionExtension { - fn encode_value_to(&self, v: &mut Vec) { - "Hello".encode_to(v); - } - fn encode_implicit_to(&self, v: &mut Vec) { - true.encode_to(v) - } -} - -// When composing a tuple of signed extensions, the user parameters we need must -// be able to convert `Into` a tuple of corresponding `Params`. Here, we just -// "hijack" the default param builder, but add the `Params` (`()`) for our -// new signed extension at the end, to make the types line up. IN reality you may wish -// to construct an entirely new interface to provide the relevant `Params`. -pub fn custom( - params: DefaultExtrinsicParamsBuilder, -) -> <::ExtrinsicParams as ExtrinsicParams>::Params { - let (a, b, c, d, e, f, g, h, i) = params.build(); - (a, b, c, d, e, f, g, h, i, ()) -} - -#[tokio::main] -async fn main() { - // With the config defined, it can be handed to Subxt as follows: - let client = subxt::OnlineClient::::new().await.unwrap(); - - let tx_payload = runtime::tx().system().remark(b"Hello".to_vec()); - - // Configure the tx params: - let tx_config = DefaultExtrinsicParamsBuilder::new().tip(1234); - - // And provide them when submitting a transaction: - let _ = client - .tx() - .sign_and_submit_then_watch(&tx_payload, &dev::alice(), custom(tx_config)) - .await; -} diff --git a/subxt/examples/setup_reconnecting_rpc_client.rs b/subxt/examples/setup_reconnecting_rpc_client.rs deleted file mode 100644 index a3763947c78..00000000000 --- a/subxt/examples/setup_reconnecting_rpc_client.rs +++ /dev/null @@ -1,77 +0,0 @@ -//! Example to utilize the `reconnecting rpc client` in subxt -//! which hidden behind behind `--feature reconnecting-rpc-client` -//! -//! To utilize full logs from the RPC client use: -//! `RUST_LOG="jsonrpsee=trace,subxt-reconnecting-rpc-client=trace"` - -#![allow(missing_docs)] - -use std::time::Duration; - -use futures::StreamExt; -use subxt::backend::rpc::reconnecting_rpc_client::{ExponentialBackoff, RpcClient}; -use subxt::{OnlineClient, PolkadotConfig}; - -// Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - tracing_subscriber::fmt::init(); - - // Create a new client with a reconnecting RPC client. - let rpc = RpcClient::builder() - // Reconnect with exponential backoff - // - // This API is "iterator-like" and we use `take` to limit the number of retries. - .retry_policy( - ExponentialBackoff::from_millis(100) - .max_delay(Duration::from_secs(10)) - .take(3), - ) - // There are other configurations as well that can be found at [`reconnecting_rpc_client::ClientBuilder`]. - .build("ws://localhost:9944".to_string()) - .await?; - - // If you want to use the chainhead backend with the reconnecting RPC client, you can do so like this: - // - // ``` - // use subxt::backend::chain_head:ChainHeadBackend; - // use subxt::OnlineClient; - // - // let backend = ChainHeadBackend::builder().build_with_background_task(RpcClient::new(rpc.clone())); - // let api: OnlineClient = OnlineClient::from_backend(Arc::new(backend)).await?; - // ``` - - let api: OnlineClient = OnlineClient::from_rpc_client(rpc.clone()).await?; - - // Run for at most 100 blocks and print a bunch of information about it. - // - // The subscription is automatically re-started when the RPC client has reconnected. - // You can test that by stopping the polkadot node and restarting it. - let mut blocks_sub = api.blocks().subscribe_finalized().await?.take(100); - - while let Some(block) = blocks_sub.next().await { - let block = match block { - Ok(b) => b, - Err(e) => { - // This can only happen on the legacy backend and the unstable backend - // will handle this internally. - if e.is_disconnected_will_reconnect() { - println!("The RPC connection was lost and we may have missed a few blocks"); - continue; - } - - return Err(e.into()); - } - }; - - let block_number = block.number(); - let block_hash = block.hash(); - - println!("Block #{block_number} ({block_hash})"); - } - - Ok(()) -} diff --git a/subxt/examples/setup_rpc_chainhead_backend.rs b/subxt/examples/setup_rpc_chainhead_backend.rs deleted file mode 100644 index 37da5fce195..00000000000 --- a/subxt/examples/setup_rpc_chainhead_backend.rs +++ /dev/null @@ -1,35 +0,0 @@ -//! Example to utilize the ChainHeadBackend rpc backend to subscribe to finalized blocks. - -#![allow(missing_docs)] - -use futures::StreamExt; -use subxt::backend::chain_head::{ChainHeadBackend, ChainHeadBackendBuilder}; -use subxt::backend::rpc::RpcClient; -use subxt::{OnlineClient, PolkadotConfig}; - -// Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - tracing_subscriber::fmt::init(); - - let rpc = RpcClient::from_url("ws://localhost:9944".to_string()).await?; - let backend: ChainHeadBackend = - ChainHeadBackendBuilder::default().build_with_background_driver(rpc.clone()); - let api = OnlineClient::from_backend(std::sync::Arc::new(backend)).await?; - - let mut blocks_sub = api.blocks().subscribe_finalized().await?.take(100); - - while let Some(block) = blocks_sub.next().await { - let block = block?; - - let block_number = block.number(); - let block_hash = block.hash(); - - println!("Block #{block_number} ({block_hash})"); - } - - Ok(()) -} diff --git a/subxt/examples/storage_entries.rs b/subxt/examples/storage_entries.rs new file mode 100644 index 00000000000..ae78062809a --- /dev/null +++ b/subxt/examples/storage_entries.rs @@ -0,0 +1,80 @@ +//! Fetching and iterating over storage entries. +use subxt::dynamic::Value; +use subxt::utils::AccountId32; +use subxt::{Error, OnlineClient, PolkadotConfig}; + +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] +mod polkadot {} + +#[tokio::main] +async fn main() -> Result<(), Error> { + let config = PolkadotConfig::new(); + let api = OnlineClient::new(config).await?; + let at_block = api.at_current_block().await?; + + // Here we use a statically generated address to fetch the storage entry, which + // gives us type information for future actions on it. + let account_balances = at_block + .storage() + .entry(polkadot::storage().system().account())?; + + // We can see the default value for this entry at this block, if one exists. + if let Some(default_value) = account_balances.default_value() { + let default_balance_info = default_value.decode_as::()?; + println!("Default balance info: {default_balance_info}"); + } + + // We can fetch a specific account balance by its key, like so (here I just picked a random key + // I knew to exist from iterating over storage entries): + let account_id = { + let hex = "9a4d0faa2ba8c3cc5711852960940793acf55bf195b6eecf88fa78e961d0ce4a"; + let bytes: [u8; 32] = hex::decode(hex).unwrap().try_into().unwrap(); + AccountId32::from(bytes) + }; + let entry = account_balances.fetch((account_id,)).await?; + + // We can decode the value into any type implementing DecodeAsType: + let _balance_info = entry.decode_as::()?; + // Or we can decode into the type stored by the static code, since we used a static address: + let balance_info = entry.decode()?; + + println!( + "Single balance info from {account_id} => free: {} reserved: {} frozen: {} flags: {:?}", + balance_info.data.free, + balance_info.data.reserved, + balance_info.data.frozen, + balance_info.data.flags, + ); + + // Or we can iterate over all of the account balances and print them out. Here we provide an + // empty tuple, indicating that we want to iterate over everything and not only things under a certain key + // (in the case of account balances, there is only one key anyway, but other storage entries may map from + // several keys to a value, and for those we can choose which depth we iterate at by providing as many keys + // as we want and leaving the rest). + let mut all_balances = account_balances.iter(()).await?; + while let Some(entry) = all_balances.next().await { + let entry = entry?; + let key = entry.key()?; + + // Because we provided a statically typed Address when we originally obtained this + // storage entry (ie `polkadot::storage().system().account()`), we can statically + // decode the key into its well typed constituent parts: + let key_parts = key.decode()?; + println!("Account ID: {}", key_parts.0); + + // Alternately, if we don't have type information available (or just want to decode + // into some different type), we can do something like this instead: + let account_id = key + .part(0) + .unwrap() + .decode_as::()? + .expect("We expect this key to decode into a 32 byte AccountId"); + + // Decode these values into our generic scale_value::Value type. Less efficient than + // defining a static type as above, but easier for the sake of the example. + let balance_info = entry.value().decode_as::()?; + println!(" {account_id} => {balance_info}"); + } + + Ok(()) +} diff --git a/subxt/examples/storage_fetch.rs b/subxt/examples/storage_fetch.rs deleted file mode 100644 index 1fe491898c3..00000000000 --- a/subxt/examples/storage_fetch.rs +++ /dev/null @@ -1,32 +0,0 @@ -#![allow(missing_docs)] -use subxt::{OnlineClient, PolkadotConfig}; -use subxt_signer::sr25519::dev; - -// Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a new API client, configured to talk to Polkadot nodes. - let api = OnlineClient::::new().await?; - let account = dev::alice().public_key().into(); - - // Build a storage query to access account information. - let storage_query = polkadot::storage().system().account(); - - // Use that query to access a storage entry, fetch a result and decode the value. - // The static address knows that fetching requires a tuple of one value, an - // AccountId32. - let client_at = api.storage().at_latest().await?; - let account_info = client_at - .entry(storage_query)? - .fetch((account,)) - .await? - .decode()?; - - // The static address that we got from the subxt macro knows the expected input - // and return types, so it is decoded into a static type for us. - println!("Alice: {account_info:?}"); - Ok(()) -} diff --git a/subxt/examples/storage_fetch_dynamic.rs b/subxt/examples/storage_fetch_dynamic.rs deleted file mode 100644 index 61a81fef98a..00000000000 --- a/subxt/examples/storage_fetch_dynamic.rs +++ /dev/null @@ -1,34 +0,0 @@ -#![allow(missing_docs)] -use subxt::dynamic::{At, Value}; -use subxt::utils::AccountId32; -use subxt::{OnlineClient, PolkadotConfig}; -use subxt_signer::sr25519::dev; - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a new API client, configured to talk to Polkadot nodes. - let api = OnlineClient::::new().await?; - - // Build a dynamic storage query to access account information. - // here, we assume that there is one value to provide at this entry - // to access a value; an AccountId32. In this example we don't know the - // return type and so we set it to `Value`, which anything can decode into. - let account: AccountId32 = dev::alice().public_key().into(); - let storage_query = subxt::dynamic::storage::<(AccountId32,), Value>("System", "Account"); - - // Use that query to access a storage entry, fetch a result and decode the value. - let client_at = api.storage().at_latest().await?; - let account_info = client_at - .entry(storage_query)? - .fetch((account,)) - .await? - .decode()?; - - // With out `Value` type we can dig in to find what we want using the `At` - // trait and `.at()` method that this provides on the Value. - println!( - "Alice has free balance: {}", - account_info.at("data").at("free").unwrap() - ); - Ok(()) -} diff --git a/subxt/examples/storage_iterating.rs b/subxt/examples/storage_iterating.rs deleted file mode 100644 index 3ff74029bd9..00000000000 --- a/subxt/examples/storage_iterating.rs +++ /dev/null @@ -1,42 +0,0 @@ -#![allow(missing_docs)] -use subxt::ext::futures::StreamExt; -use subxt::{OnlineClient, PolkadotConfig}; - -// Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a new API client, configured to talk to Polkadot nodes. - let api = OnlineClient::::new().await?; - - // Build a storage query to access account information. Same as if we were - // fetching a single value from this entry. - let storage_query = polkadot::storage().system().account(); - - // Use that query to access a storage entry, iterate over it and decode values. - let client_at = api.storage().at_latest().await?; - - // We provide an empty tuple when iterating. If the storage entry had been an N map with - // multiple keys, then we could provide any prefix of those keys to iterate over. This is - // statically type checked, so only a valid number/type of keys in the tuple is accepted. - let mut values = client_at.entry(storage_query)?.iter(()).await?; - - while let Some(kv) = values.next().await { - let kv = kv?; - - // The key decodes into the type that the static address knows about, in this case a - // tuple of one entry, because the only part of the key that we can decode is the - // AccountId32 for each user. - let (account_id32,) = kv.key()?.decode()?; - - // The value decodes into a statically generated type which holds account information. - let value = kv.value().decode()?; - - let value_data = value.data; - println!("{account_id32}:\n {value_data:?}"); - } - - Ok(()) -} diff --git a/subxt/examples/storage_iterating_dynamic.rs b/subxt/examples/storage_iterating_dynamic.rs deleted file mode 100644 index 443c977eef2..00000000000 --- a/subxt/examples/storage_iterating_dynamic.rs +++ /dev/null @@ -1,42 +0,0 @@ -#![allow(missing_docs)] -use subxt::ext::futures::StreamExt; -use subxt::utils::AccountId32; -use subxt::{ - OnlineClient, PolkadotConfig, - dynamic::{At, Value}, -}; - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a new API client, configured to talk to Polkadot nodes. - let api = OnlineClient::::new().await?; - - // Build a dynamic storage query to access account information. - // here, we assume that there is one value to provide at this entry - // to access a value; an AccountId32. In this example we don't know the - // return type and so we set it to `Value`, which anything can decode into. - let storage_query = subxt::dynamic::storage::<(AccountId32,), Value>("System", "Account"); - - // Use that query to access a storage entry, iterate over it and decode values. - let client_at = api.storage().at_latest().await?; - let mut values = client_at.entry(storage_query)?.iter(()).await?; - - while let Some(kv) = values.next().await { - let kv = kv?; - - // The key decodes into the first type we provided in the address. Since there's just - // one key, it is a tuple of one entry, an AccountId32. If we didn't know how many - // keys or their type, we could set the key to `Vec` instead. - let (account_id32,) = kv.key()?.decode()?; - - // The value decodes into the second type we provided in the address. In this example, - // we just decode it into our `Value` type and then look at the "data" field in this - // (which implicitly assumes we get a struct shaped thing back with such a field). - let value = kv.value().decode()?; - - let value_data = value.at("data").unwrap(); - println!("{account_id32}:\n {value_data}"); - } - - Ok(()) -} diff --git a/subxt/examples/tx_basic.rs b/subxt/examples/submit_transaction.rs similarity index 55% rename from subxt/examples/tx_basic.rs rename to subxt/examples/submit_transaction.rs index 0c2dc243eb5..2fbcd146904 100644 --- a/subxt/examples/tx_basic.rs +++ b/subxt/examples/submit_transaction.rs @@ -1,33 +1,39 @@ -#![allow(missing_docs)] -use subxt::{OnlineClient, PolkadotConfig}; +//! Construct and submit a transaction. +use subxt::{Error, OnlineClient, PolkadotConfig}; use subxt_signer::sr25519::dev; // Generate an interface that we can use from the node's metadata. #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} +mod polkadot {} #[tokio::main] -async fn main() -> Result<(), Box> { +async fn main() -> Result<(), Error> { // Create a new API client, configured to talk to Polkadot nodes. - let api = OnlineClient::::new().await?; + let config = PolkadotConfig::new(); + let api = OnlineClient::new(config).await?; + + // Almost all actions are performed at an explicit block. Here we use + // the current block at the time of running this. + let at_block = api.at_current_block().await?; // Build a balance transfer extrinsic. let dest = dev::bob().public_key().into(); - let balance_transfer_tx = polkadot::tx().balances().transfer_allow_death(dest, 10_000); + let balance_transfer_tx = polkadot::transactions() + .balances() + .transfer_allow_death(dest, 10_000); // Submit the balance transfer extrinsic from Alice, and wait for it to be successful // and in a finalized block. We get back the extrinsic events if all is well. let from = dev::alice(); - let events = api - .tx() + let events = at_block + .transactions() .sign_and_submit_then_watch_default(&balance_transfer_tx, &from) .await? .wait_for_finalized_success() .await?; // Find a Transfer event and print it. - let transfer_event = events.find_first::()?; - if let Some(event) = transfer_event { + if let Some(event) = events.find_first::() { println!("Balance transfer success: {event:?}"); } diff --git a/subxt/examples/substrate_compat_signer.rs b/subxt/examples/substrate_compat_signer.rs deleted file mode 100644 index 968adffe764..00000000000 --- a/subxt/examples/substrate_compat_signer.rs +++ /dev/null @@ -1,117 +0,0 @@ -//! This example demonstrates how to use to add a custom signer implementation to `subxt` -//! by using the signer implementation from polkadot-sdk. -//! -//! Similar functionality was provided by the `substrate-compat` feature in the original `subxt` crate. -//! which is now removed. - -#![allow(missing_docs, unused)] - -use sp_core::{Pair as _, sr25519}; -use subxt::config::substrate::MultiAddress; -use subxt::{Config, OnlineClient, PolkadotConfig}; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -/// A concrete PairSigner implementation which relies on `sr25519::Pair` for signing -/// and that PolkadotConfig is the runtime configuration. -mod pair_signer { - use super::*; - use sp_runtime::{ - MultiSignature as SpMultiSignature, - traits::{IdentifyAccount, Verify}, - }; - use subxt::{ - config::substrate::{AccountId32, MultiSignature}, - tx::Signer, - }; - - /// A [`Signer`] implementation for [`sp_core::sr25519::Pair`]. - #[derive(Clone)] - pub struct PairSigner { - account_id: ::AccountId, - signer: sr25519::Pair, - } - - impl PairSigner { - /// Creates a new [`Signer`] from an [`sp_core::sr25519::Pair`]. - pub fn new(signer: sr25519::Pair) -> Self { - let account_id = - ::Signer::from(signer.public()).into_account(); - Self { - // Convert `sp_core::AccountId32` to `subxt::config::substrate::AccountId32`. - // - // This is necessary because we use `subxt::config::substrate::AccountId32` and no - // From/Into impls are provided between `sp_core::AccountId32` because `polkadot-sdk` isn't a direct - // dependency in subxt. - // - // This can also be done by provided a wrapper type around `subxt::config::substrate::AccountId32` to implement - // such conversions but that also most likely requires a custom `Config` with a separate `AccountId` type to work - // properly without additional hacks. - account_id: AccountId32(account_id.into()), - signer, - } - } - - /// Returns the [`sp_core::sr25519::Pair`] implementation used to construct this. - pub fn signer(&self) -> &sr25519::Pair { - &self.signer - } - - /// Return the account ID. - pub fn account_id(&self) -> &AccountId32 { - &self.account_id - } - } - - impl Signer for PairSigner { - fn account_id(&self) -> ::AccountId { - self.account_id.clone() - } - - fn sign(&self, signer_payload: &[u8]) -> ::Signature { - let signature = self.signer.sign(signer_payload); - MultiSignature::Sr25519(signature.0) - } - } -} - -#[tokio::main] -async fn main() -> Result<(), Box> { - tracing_subscriber::fmt::init(); - - // Create a new API client, configured to talk to Polkadot nodes. - let api = OnlineClient::::new().await?; - - let signer = { - let acc = sr25519::Pair::from_string("//Alice", None)?; - pair_signer::PairSigner::new(acc) - }; - - let dest = { - let acc = sr25519::Pair::from_string("//Bob", None)?; - MultiAddress::Address32(acc.public().0) - }; - - // Build a balance transfer extrinsic. - let balance_transfer_tx = polkadot::tx() - .balances() - .transfer_allow_death(dest, 100_000); - - // Submit the balance transfer extrinsic from Alice, and wait for it to be successful - // and in a finalized block. We get back the extrinsic events if all is well. - let events = api - .tx() - .sign_and_submit_then_watch_default(&balance_transfer_tx, &signer) - .await? - .wait_for_finalized_success() - .await?; - - // Find a Transfer event and print it. - let transfer_event = events.find_first::()?; - if let Some(event) = transfer_event { - println!("Balance transfer success: {event:?}"); - } - - Ok(()) -} diff --git a/subxt/examples/tx_basic_frontier.rs b/subxt/examples/tx_basic_frontier.rs deleted file mode 100644 index 23b577a0558..00000000000 --- a/subxt/examples/tx_basic_frontier.rs +++ /dev/null @@ -1,56 +0,0 @@ -//! Example to use subxt to talk to substrate-based nodes with ethereum accounts -//! which is not the default for subxt which is why we need to provide a custom config. -//! -//! This example requires to run a local frontier/moonbeam node to work. - -#![allow(missing_docs)] - -use subxt::OnlineClient; -use subxt_core::utils::AccountId20; -use subxt_signer::eth::{Signature, dev}; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/frontier_metadata_small.scale")] -mod eth_runtime {} - -enum EthRuntimeConfig {} - -impl subxt::Config for EthRuntimeConfig { - type AccountId = AccountId20; - type Address = AccountId20; - type Signature = Signature; - type Hasher = subxt::config::substrate::BlakeTwo256; - type Header = - subxt::config::substrate::SubstrateHeader; - type ExtrinsicParams = subxt::config::SubstrateExtrinsicParams; - type AssetId = u32; -} - -#[tokio::main] -async fn main() -> Result<(), Box> { - let api = OnlineClient::::from_insecure_url("ws://127.0.0.1:9944").await?; - - let alith = dev::alith(); - let baltathar = dev::baltathar(); - let dest = baltathar.public_key().to_account_id(); - - println!("baltathar pub: {}", hex::encode(baltathar.public_key().0)); - println!("baltathar addr: {}", hex::encode(dest)); - - let balance_transfer_tx = eth_runtime::tx() - .balances() - .transfer_allow_death(dest, 10_001); - - let events = api - .tx() - .sign_and_submit_then_watch_default(&balance_transfer_tx, &alith) - .await? - .wait_for_finalized_success() - .await?; - - let transfer_event = events.find_first::()?; - if let Some(event) = transfer_event { - println!("Balance transfer success: {event:?}"); - } - - Ok(()) -} diff --git a/subxt/examples/tx_boxed.rs b/subxt/examples/tx_boxed.rs deleted file mode 100644 index 0dd4c4d2e01..00000000000 --- a/subxt/examples/tx_boxed.rs +++ /dev/null @@ -1,43 +0,0 @@ -#![allow(missing_docs)] -use subxt::{OnlineClient, PolkadotConfig}; -use subxt_signer::sr25519::dev; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - let api = OnlineClient::::new().await?; - - // Prepare some extrinsics. These are boxed so that they can live alongside each other. - let txs = [dynamic_remark(), balance_transfer(), remark()]; - - for tx in txs { - let from = dev::alice(); - api.tx() - .sign_and_submit_then_watch_default(&tx, &from) - .await? - .wait_for_finalized_success() - .await?; - - println!("Submitted tx"); - } - - Ok(()) -} - -fn balance_transfer() -> Box { - let dest = dev::bob().public_key().into(); - Box::new(polkadot::tx().balances().transfer_allow_death(dest, 10_000)) -} - -fn remark() -> Box { - Box::new(polkadot::tx().system().remark(vec![1, 2, 3, 4, 5])) -} - -fn dynamic_remark() -> Box { - use subxt::dynamic::{Value, tx}; - let tx_payload = tx("System", "remark", vec![Value::from_bytes("Hello")]); - - Box::new(tx_payload) -} diff --git a/subxt/examples/tx_partial.rs b/subxt/examples/tx_partial.rs deleted file mode 100644 index 0684091de66..00000000000 --- a/subxt/examples/tx_partial.rs +++ /dev/null @@ -1,53 +0,0 @@ -#![allow(missing_docs)] -use subxt::{OnlineClient, PolkadotConfig}; -use subxt_signer::sr25519::dev; - -type BoxedError = Box; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), BoxedError> { - // Spawned tasks require things held across await points to impl Send, - // so we use one to demonstrate that this is possible with `PartialTransaction` - tokio::spawn(signing_example()).await??; - Ok(()) -} - -async fn signing_example() -> Result<(), BoxedError> { - let api = OnlineClient::::new().await?; - - // Build a balance transfer extrinsic. - let dest = dev::bob().public_key().into(); - let balance_transfer_tx = polkadot::tx().balances().transfer_allow_death(dest, 10_000); - - let alice = dev::alice(); - - // Create partial tx, ready to be signed. - let mut partial_tx = api - .tx() - .create_partial( - &balance_transfer_tx, - &alice.public_key().to_account_id(), - Default::default(), - ) - .await?; - - // Simulate taking some time to get a signature back, in part to - // show that the `PartialTransaction` can be held across await points. - tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; - let signature = alice.sign(&partial_tx.signer_payload()); - - // Sign the transaction. - let tx = partial_tx - .sign_with_account_and_signature(&alice.public_key().to_account_id(), &signature.into()); - - // Submit it. - tx.submit_and_watch() - .await? - .wait_for_finalized_success() - .await?; - - Ok(()) -} diff --git a/subxt/examples/tx_status_stream.rs b/subxt/examples/tx_status_stream.rs deleted file mode 100644 index cdd55c4e824..00000000000 --- a/subxt/examples/tx_status_stream.rs +++ /dev/null @@ -1,55 +0,0 @@ -#![allow(missing_docs)] -use subxt::{OnlineClient, PolkadotConfig, tx::TxStatus}; -use subxt_signer::sr25519::dev; - -// Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a new API client, configured to talk to Polkadot nodes. - let api = OnlineClient::::new().await?; - - // Build a balance transfer extrinsic. - let dest = dev::bob().public_key().into(); - let balance_transfer_tx = polkadot::tx().balances().transfer_allow_death(dest, 10_000); - - // Submit the balance transfer extrinsic from Alice, and then monitor the - // progress of it. - let from = dev::alice(); - let mut balance_transfer_progress = api - .tx() - .sign_and_submit_then_watch_default(&balance_transfer_tx, &from) - .await?; - - while let Some(status) = balance_transfer_progress.next().await { - match status? { - // It's finalized in a block! - TxStatus::InFinalizedBlock(in_block) => { - println!( - "Transaction {:?} is finalized in block {:?}", - in_block.extrinsic_hash(), - in_block.block_hash() - ); - - // grab the events and fail if no ExtrinsicSuccess event seen: - let events = in_block.wait_for_success().await?; - // We can look for events (this uses the static interface; we can also iterate - // over them and dynamically decode them): - let transfer_event = events.find_first::()?; - - if let Some(event) = transfer_event { - println!("Balance transfer success: {event:?}"); - } else { - println!("Failed to find Balances::Transfer Event"); - } - } - // Just log any other status we encounter: - other => { - println!("Status: {other:?}"); - } - } - } - Ok(()) -} diff --git a/subxt/examples/tx_with_params.rs b/subxt/examples/tx_with_params.rs deleted file mode 100644 index 00126a7f9fd..00000000000 --- a/subxt/examples/tx_with_params.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![allow(missing_docs)] -use subxt::config::polkadot::PolkadotExtrinsicParamsBuilder as Params; -use subxt::{OnlineClient, PolkadotConfig}; -use subxt_signer::sr25519::dev; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a new API client, configured to talk to Polkadot nodes. - let api = OnlineClient::::new().await?; - - // Build a balance transfer extrinsic. - let dest = dev::bob().public_key().into(); - let tx = polkadot::tx().balances().transfer_allow_death(dest, 10_000); - - // Configure the transaction parameters; we give a small tip and set the - // transaction to live for 32 blocks from the `latest_block` above. - let tx_params = Params::new().tip(1_000).mortal(32).build(); - - // submit the transaction: - let from = dev::alice(); - let hash = api.tx().sign_and_submit(&tx, &from, tx_params).await?; - println!("Balance transfer extrinsic submitted with hash : {hash}"); - - Ok(()) -} diff --git a/subxt/src/backend.rs b/subxt/src/backend.rs new file mode 100644 index 00000000000..f531259fe63 --- /dev/null +++ b/subxt/src/backend.rs @@ -0,0 +1,349 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! This module exposes a backend trait for Subxt which allows us to get and set +//! the necessary information (probably from a JSON-RPC API, but that's up to the +//! implementation). + +mod archive; +mod chain_head; +mod combined; +mod legacy; +mod utils; + +use crate::config::{Config, HashFor}; +use crate::error::BackendError; +use async_trait::async_trait; +use codec::{Decode, Encode}; +use futures::{Stream, StreamExt}; +use std::pin::Pin; +use std::sync::Arc; +use subxt_metadata::Metadata; + +// Expose our various backends. +pub use archive::ArchiveBackend; +pub use chain_head::{ChainHeadBackend, ChainHeadBackendBuilder, ChainHeadBackendDriver}; +pub use combined::{CombinedBackend, CombinedBackendBuilder, CombinedBackendDriver}; +pub use legacy::{LegacyBackend, LegacyBackendBuilder}; + +/// Prevent the backend trait being implemented externally. +#[doc(hidden)] +pub(crate) mod sealed { + pub trait Sealed {} +} + +/// This trait exposes the interface that Subxt will use to communicate with +/// a backend. Its goal is to be as minimal as possible. +#[async_trait] +pub trait Backend: sealed::Sealed + Send + Sync + 'static { + /// Fetch values from storage. + async fn storage_fetch_values( + &self, + keys: Vec>, + at: HashFor, + ) -> Result, BackendError>; + + /// Fetch keys underneath the given key from storage. + async fn storage_fetch_descendant_keys( + &self, + key: Vec, + at: HashFor, + ) -> Result>, BackendError>; + + /// Fetch values underneath the given key from storage. + async fn storage_fetch_descendant_values( + &self, + key: Vec, + at: HashFor, + ) -> Result, BackendError>; + + /// Fetch the genesis hash + async fn genesis_hash(&self) -> Result, BackendError>; + + /// Convert a block number to a hash. This should return `None` in the event that + /// multiple block hashes correspond to the given number (ie if the number is greater + /// than that of the latest finalized block and some forks exist). Nevertheless, it could + /// still return the hash to a block on some fork that is pruned. + async fn block_number_to_hash( + &self, + number: u64, + ) -> Result>>, BackendError>; + + /// Get a block header. + async fn block_header(&self, at: HashFor) -> Result, BackendError>; + + /// Return the extrinsics found in the block. Each extrinsic is represented + /// by a vector of bytes which has _not_ been SCALE decoded (in other words, the + /// first bytes in the vector will decode to the compact encoded length of the extrinsic) + async fn block_body(&self, at: HashFor) -> Result>>, BackendError>; + + /// Get the most recent finalized block hash. + /// Note: needed only in blocks client for finalized block stream; can prolly be removed. + async fn latest_finalized_block_ref(&self) -> Result>, BackendError>; + + /// A stream of all new block headers as they arrive. + async fn stream_all_block_headers( + &self, + hasher: T::Hasher, + ) -> Result>)>, BackendError>; + + /// A stream of best block headers. + async fn stream_best_block_headers( + &self, + hasher: T::Hasher, + ) -> Result>)>, BackendError>; + + /// A stream of finalized block headers. + async fn stream_finalized_block_headers( + &self, + hasher: T::Hasher, + ) -> Result>)>, BackendError>; + + /// Submit a transaction. This will return a stream of events about it. + async fn submit_transaction( + &self, + bytes: &[u8], + ) -> Result>>, BackendError>; + + /// Make a call to some runtime API. + async fn call( + &self, + method: &str, + call_parameters: Option<&[u8]>, + at: HashFor, + ) -> Result, BackendError>; +} + +/// helpful utility methods derived from those provided on [`Backend`] +#[async_trait] +pub trait BackendExt: Backend { + /// Fetch a single value from storage. + async fn storage_fetch_value( + &self, + key: Vec, + at: HashFor, + ) -> Result>, BackendError> { + self.storage_fetch_values(vec![key], at) + .await? + .next() + .await + .transpose() + .map(|o| o.map(|s| s.value)) + } + + /// The same as a [`Backend::call()`], but it will also attempt to decode the + /// result into the given type, which is a fairly common operation. + async fn call_decoding( + &self, + method: &str, + call_parameters: Option<&[u8]>, + at: HashFor, + ) -> Result { + let bytes = self.call(method, call_parameters, at).await?; + let res = + D::decode(&mut &*bytes).map_err(BackendError::CouldNotScaleDecodeRuntimeResponse)?; + Ok(res) + } + + /// Return the metadata at some version. + async fn metadata_at_version( + &self, + version: u32, + at: HashFor, + ) -> Result { + let param = version.encode(); + + let opaque: Option = self + .call_decoding("Metadata_metadata_at_version", Some(¶m), at) + .await?; + let Some(opaque) = opaque else { + return Err(BackendError::MetadataVersionNotFound(version)); + }; + + let metadata: Metadata = + Decode::decode(&mut &opaque.0[..]).map_err(BackendError::CouldNotDecodeMetadata)?; + Ok(metadata) + } + + /// Return V14 metadata from the legacy `Metadata_metadata` call. + async fn legacy_metadata(&self, at: HashFor) -> Result { + let opaque: frame_metadata::OpaqueMetadata = + self.call_decoding("Metadata_metadata", None, at).await?; + let metadata: Metadata = + Decode::decode(&mut &opaque.0[..]).map_err(BackendError::CouldNotDecodeMetadata)?; + Ok(metadata) + } +} + +#[async_trait] +impl + ?Sized, T: Config> BackendExt for B {} + +/// An opaque struct which, while alive, indicates that some references to a block +/// still exist. This gives the backend the opportunity to keep the corresponding block +/// details around for a while if it likes and is able to. No guarantees can be made about +/// how long the corresponding details might be available for, but if no references to a block +/// exist, then the backend is free to discard any details for it. +#[derive(Clone)] +pub struct BlockRef { + hash: H, + // We keep this around so that when it is dropped, it has the + // opportunity to tell the backend. + _pointer: Option>, +} + +impl From for BlockRef { + fn from(value: H) -> Self { + BlockRef::from_hash(value) + } +} + +impl PartialEq for BlockRef { + fn eq(&self, other: &Self) -> bool { + self.hash == other.hash + } +} +impl Eq for BlockRef {} + +// Manual implementation to work around https://github.com/mcarton/rust-derivative/issues/115. +impl PartialOrd for BlockRef { + fn partial_cmp(&self, other: &Self) -> Option { + self.hash.partial_cmp(&other.hash) + } +} + +impl Ord for BlockRef { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.hash.cmp(&other.hash) + } +} + +impl std::fmt::Debug for BlockRef { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_tuple("BlockRef").field(&self.hash).finish() + } +} + +impl std::hash::Hash for BlockRef { + fn hash(&self, state: &mut Hasher) { + self.hash.hash(state); + } +} + +impl BlockRef { + /// A [`BlockRef`] that doesn't reference a given block, but does have an associated hash. + /// This is used in the legacy backend, which has no notion of pinning blocks. + pub fn from_hash(hash: H) -> Self { + Self { + hash, + _pointer: None, + } + } + /// Construct a [`BlockRef`] from an instance of the underlying trait. It's expected + /// that the [`Backend`] implementation will call this if it wants to track which blocks + /// are potentially in use. + pub fn new(hash: H, inner: P) -> Self { + Self { + hash, + _pointer: Some(Arc::new(inner)), + } + } + + /// Return the hash of the referenced block. + pub fn hash(&self) -> H + where + H: Copy, + { + self.hash + } +} + +/// A trait that a [`Backend`] can implement to know when some block +/// can be unpinned: when this is dropped, there are no remaining references +/// to the block that it's associated with. +pub trait BlockRefT: Send + Sync + 'static {} + +/// A stream of some item. +pub struct StreamOf(Pin + Send + 'static>>); + +impl Stream for StreamOf { + type Item = T; + fn poll_next( + mut self: std::pin::Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> std::task::Poll> { + self.0.poll_next_unpin(cx) + } +} + +impl std::fmt::Debug for StreamOf { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_tuple("StreamOf").field(&"").finish() + } +} + +impl StreamOf { + /// Construct a new stream. + pub fn new(inner: Pin + Send + 'static>>) -> Self { + StreamOf(inner) + } + + /// Returns the next item in the stream. This is just a wrapper around + /// [`StreamExt::next()`] so that you can avoid the extra import. + pub async fn next(&mut self) -> Option { + StreamExt::next(self).await + } +} + +/// A stream of [`Result`]. +pub type StreamOfResults = StreamOf>; + +/// The status of the transaction. +/// +/// If the status is [`TransactionStatus::InFinalizedBlock`], [`TransactionStatus::Error`], +/// [`TransactionStatus::Invalid`] or [`TransactionStatus::Dropped`], then no future +/// events will be emitted. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum TransactionStatus { + /// Transaction is part of the future queue. + Validated, + /// The transaction has been broadcast to other nodes. + Broadcasted, + /// Transaction is no longer in a best block. + NoLongerInBestBlock, + /// Transaction has been included in block with given hash. + InBestBlock { + /// Block hash the transaction is in. + hash: BlockRef, + }, + /// Transaction has been finalized by a finality-gadget, e.g GRANDPA + InFinalizedBlock { + /// Block hash the transaction is in. + hash: BlockRef, + }, + /// Something went wrong in the node. + Error { + /// Human readable message; what went wrong. + message: String, + }, + /// Transaction is invalid (bad nonce, signature etc). + Invalid { + /// Human readable message; why was it invalid. + message: String, + }, + /// The transaction was dropped. + Dropped { + /// Human readable message; why was it dropped. + message: String, + }, +} + +/// A response from calls like [`Backend::storage_fetch_values`] or +/// [`Backend::storage_fetch_descendant_values`]. +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, Debug)] +pub struct StorageResponse { + /// The key. + pub key: Vec, + /// The associated value. + pub value: Vec, +} diff --git a/subxt/src/backend/archive.rs b/subxt/src/backend/archive.rs new file mode 100644 index 00000000000..155b8d24bae --- /dev/null +++ b/subxt/src/backend/archive.rs @@ -0,0 +1,235 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! This module exposes a backend implementation based on the new APIs +//! described at . See +//! [`rpc_methods`] for the raw API calls. +//! +//! Specifically, the focus here is on the `archive` methods. These can only be used +//! to interact with archive nodes, but are less restrictive than the `chainHead` methods +//! in terms of the allowed operations. + +mod storage_stream; + +use crate::backend::{ + Backend, BlockRef, StorageResponse, StreamOf, StreamOfResults, TransactionStatus, utils::retry, +}; +use crate::config::{Config, HashFor, RpcConfigFor}; +use crate::error::BackendError; +use async_trait::async_trait; +use futures::StreamExt; +use storage_stream::ArchiveStorageStream; +use subxt_rpcs::RpcClient; +use subxt_rpcs::methods::ChainHeadRpcMethods; +use subxt_rpcs::methods::chain_head::{ArchiveCallResult, ArchiveStorageQuery, StorageQueryType}; + +/// The archive backend. +#[derive(Debug, Clone)] +pub struct ArchiveBackend { + // RPC methods we'll want to call: + methods: ChainHeadRpcMethods>, +} + +impl ArchiveBackend { + /// Configure and construct an [`ArchiveBackend`]. + pub fn new(client: impl Into) -> ArchiveBackend { + let methods = ChainHeadRpcMethods::new(client.into()); + + ArchiveBackend { methods } + } +} + +#[async_trait] +impl Backend for ArchiveBackend { + async fn storage_fetch_values( + &self, + keys: Vec>, + at: HashFor, + ) -> Result, BackendError> { + let queries = keys + .into_iter() + .map(|key| ArchiveStorageQuery { + key, + query_type: StorageQueryType::Value, + pagination_start_key: None, + }) + .collect(); + + let stream = ArchiveStorageStream::new(at, self.methods.clone(), queries) + .map(|item| match item { + Err(e) => Some(Err(e)), + Ok(item) => item.value.map(|val| { + Ok(StorageResponse { + key: item.key.0, + value: val.0, + }) + }), + }) + .filter_map(async |item| item); + + Ok(StreamOf(Box::pin(stream))) + } + + async fn storage_fetch_descendant_keys( + &self, + key: Vec, + at: HashFor, + ) -> Result>, BackendError> { + let queries = std::iter::once(ArchiveStorageQuery { + key, + // Just ask for the hash and then ignore it and return keys + query_type: StorageQueryType::DescendantsHashes, + pagination_start_key: None, + }) + .collect(); + + let stream = + ArchiveStorageStream::new(at, self.methods.clone(), queries).map(|item| match item { + Err(e) => Err(e), + Ok(item) => Ok(item.key.0), + }); + + Ok(StreamOf(Box::pin(stream))) + } + + async fn storage_fetch_descendant_values( + &self, + key: Vec, + at: HashFor, + ) -> Result, BackendError> { + let queries = std::iter::once(ArchiveStorageQuery { + key, + query_type: StorageQueryType::DescendantsValues, + pagination_start_key: None, + }) + .collect(); + + let stream = ArchiveStorageStream::new(at, self.methods.clone(), queries) + .map(|item| match item { + Err(e) => Some(Err(e)), + Ok(item) => item.value.map(|val| { + Ok(StorageResponse { + key: item.key.0, + value: val.0, + }) + }), + }) + .filter_map(async |item| item); + + Ok(StreamOf(Box::pin(stream))) + } + + async fn genesis_hash(&self) -> Result, BackendError> { + retry(|| async { + let hash = self.methods.archive_v1_genesis_hash().await?; + Ok(hash) + }) + .await + } + + async fn block_number_to_hash( + &self, + number: u64, + ) -> Result>>, BackendError> { + retry(|| async { + let mut hashes = self + .methods + .archive_v1_hash_by_height(number as usize) + .await?; + if let (Some(hash), None) = (hashes.pop(), hashes.pop()) { + // One hash; return it. + Ok(Some(BlockRef::from_hash(hash))) + } else { + // More than one; return None. + Ok(None) + } + }) + .await + } + + async fn block_header(&self, at: HashFor) -> Result, BackendError> { + retry(|| async { + let header = self.methods.archive_v1_header(at).await?; + Ok(header) + }) + .await + } + + async fn block_body(&self, at: HashFor) -> Result>>, BackendError> { + retry(|| async { + let Some(exts) = self.methods.archive_v1_body(at).await? else { + return Ok(None); + }; + Ok(Some(exts.into_iter().map(|ext| ext.0).collect())) + }) + .await + } + + async fn latest_finalized_block_ref(&self) -> Result>, BackendError> { + retry(|| async { + let height = self.methods.archive_v1_finalized_height().await?; + let mut hashes = self.methods.archive_v1_hash_by_height(height).await?; + let Some(hash) = hashes.pop() else { + return Err(BackendError::Other( + "Multiple hashes not expected at a finalized height".into(), + )); + }; + Ok(BlockRef::from_hash(hash)) + }) + .await + } + + async fn stream_all_block_headers( + &self, + _hasher: T::Hasher, + ) -> Result>)>, BackendError> { + Err(BackendError::Other( + "The archive backend cannot stream block headers".into(), + )) + } + + async fn stream_best_block_headers( + &self, + _hasher: T::Hasher, + ) -> Result>)>, BackendError> { + Err(BackendError::Other( + "The archive backend cannot stream block headers".into(), + )) + } + + async fn stream_finalized_block_headers( + &self, + _hasher: T::Hasher, + ) -> Result>)>, BackendError> { + Err(BackendError::Other( + "The archive backend cannot stream block headers".into(), + )) + } + + async fn submit_transaction( + &self, + extrinsic: &[u8], + ) -> Result>>, BackendError> { + // This chainHead impl does not use chainHead_follow and so is suitable here too. + super::chain_head::submit_transaction_ignoring_follow_events(extrinsic, &self.methods).await + } + + async fn call( + &self, + method: &str, + call_parameters: Option<&[u8]>, + at: HashFor, + ) -> Result, BackendError> { + let res = self + .methods + .archive_v1_call(at, method, call_parameters.unwrap_or(&[])) + .await?; + match res { + ArchiveCallResult::Success(bytes) => Ok(bytes.0), + ArchiveCallResult::Error(e) => Err(BackendError::other(e)), + } + } +} + +impl crate::backend::sealed::Sealed for ArchiveBackend {} diff --git a/subxt/src/backend/archive/storage_stream.rs b/subxt/src/backend/archive/storage_stream.rs new file mode 100644 index 00000000000..0d3b8c75910 --- /dev/null +++ b/subxt/src/backend/archive/storage_stream.rs @@ -0,0 +1,183 @@ +use crate::config::{Config, HashFor, RpcConfigFor}; +use crate::error::BackendError; +use futures::{FutureExt, Stream, StreamExt}; +use std::collections::VecDeque; +use std::future::Future; +use std::pin::Pin; +use std::task::{Context, Poll}; +use subxt_rpcs::Error as RpcError; +use subxt_rpcs::methods::ChainHeadRpcMethods; +use subxt_rpcs::methods::chain_head::{ + ArchiveStorageEvent, ArchiveStorageEventItem, ArchiveStorageQuery, ArchiveStorageSubscription, +}; + +pub struct ArchiveStorageStream { + at: HashFor, + methods: ChainHeadRpcMethods>, + query_queue: VecDeque>>, + state: Option>, +} + +enum StreamState { + GetSubscription { + current_query: ArchiveStorageQuery>, + sub_fut: Pin< + Box< + dyn Future>, RpcError>> + + Send + + 'static, + >, + >, + }, + RunSubscription { + current_query: ArchiveStorageQuery>, + sub: ArchiveStorageSubscription>, + }, +} + +impl ArchiveStorageStream { + /// Fetch descendant keys. + pub fn new( + at: HashFor, + methods: ChainHeadRpcMethods>, + query_queue: VecDeque>>, + ) -> Self { + Self { + at, + methods, + query_queue, + state: None, + } + } +} + +impl std::marker::Unpin for ArchiveStorageStream {} + +impl Stream for ArchiveStorageStream { + type Item = Result>, BackendError>; + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + let mut this = self.as_mut(); + + loop { + match this.state.take() { + // No state yet so initialise! + None => { + // Nothing left; we're done. + let Some(query) = this.query_queue.pop_front() else { + return Poll::Ready(None); + }; + + let at = this.at; + let methods = this.methods.clone(); + let current_query = query.clone(); + let sub_fut = async move { + let query = std::iter::once(ArchiveStorageQuery { + key: query.key.as_ref(), + query_type: query.query_type, + pagination_start_key: query.pagination_start_key.as_deref(), + }); + + methods.archive_v1_storage(at, query, None).await + }; + + this.state = Some(StreamState::GetSubscription { + current_query, + sub_fut: Box::pin(sub_fut), + }); + } + // We're getting our subscription stream for the current query. + Some(StreamState::GetSubscription { + current_query, + mut sub_fut, + }) => { + match sub_fut.poll_unpin(cx) { + Poll::Ready(Ok(sub)) => { + this.state = Some(StreamState::RunSubscription { current_query, sub }); + } + Poll::Ready(Err(e)) => { + if e.is_disconnected_will_reconnect() { + // Push the query back onto the queue to try again + this.query_queue.push_front(current_query); + continue; + } + + this.state = None; + return Poll::Ready(Some(Err(e.into()))); + } + Poll::Pending => { + this.state = Some(StreamState::GetSubscription { + current_query, + sub_fut, + }); + return Poll::Pending; + } + } + } + // Running the subscription and returning results. + Some(StreamState::RunSubscription { + current_query, + mut sub, + }) => { + match sub.poll_next_unpin(cx) { + Poll::Ready(Some(Ok(val))) => { + match val { + ArchiveStorageEvent::Item(item) => { + this.state = Some(StreamState::RunSubscription { + current_query: ArchiveStorageQuery { + key: current_query.key, + query_type: current_query.query_type, + // In the event of error, we resume from the last seen value. + // At the time of writing, it's not clear if paginationStartKey + // starts from the key itself or the first key after it: + // https://github.com/paritytech/json-rpc-interface-spec/issues/176 + pagination_start_key: Some(item.key.0.clone()), + }, + sub, + }); + + // We treat `paginationStartKey` as being the key we want results to begin _after_. + // So, if we see a value that's <= it, ignore the value. + let ignore_this_value = current_query + .pagination_start_key + .as_ref() + .is_some_and(|k| item.key.0.cmp(k).is_le()); + + if ignore_this_value { + continue; + } + + return Poll::Ready(Some(Ok(item))); + } + ArchiveStorageEvent::Error(e) => { + this.state = None; + return Poll::Ready(Some(Err(BackendError::other(e.error)))); + } + ArchiveStorageEvent::Done => { + this.state = None; + continue; + } + } + } + Poll::Ready(Some(Err(e))) => { + if e.is_disconnected_will_reconnect() { + // Put the current query back into the queue and retry. + // We've been keeping it uptodate as needed. + this.query_queue.push_front(current_query); + this.state = None; + continue; + } + + this.state = None; + return Poll::Ready(Some(Err(e.into()))); + } + Poll::Ready(None) => { + this.state = None; + continue; + } + Poll::Pending => return Poll::Pending, + } + } + } + } + } +} diff --git a/subxt/src/backend/chain_head/mod.rs b/subxt/src/backend/chain_head.rs similarity index 55% rename from subxt/src/backend/chain_head/mod.rs rename to subxt/src/backend/chain_head.rs index 18521ce08ff..d218ab30c04 100644 --- a/subxt/src/backend/chain_head/mod.rs +++ b/subxt/src/backend/chain_head.rs @@ -2,14 +2,11 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! This module will expose a backend implementation based on the new APIs +//! This module exposes a backend implementation based on the new APIs //! described at . See //! [`rpc_methods`] for the raw API calls. //! -//! # Warning -//! -//! Everything in this module is **unstable**, meaning that it could change without -//! warning at any time. +//! Specifically, the focus here is on the `chainHead` methods. mod follow_stream; mod follow_stream_driver; @@ -18,10 +15,10 @@ mod storage_items; use self::follow_stream_driver::FollowStreamFinalizedHeads; use crate::backend::{ - Backend, BlockRef, BlockRefT, RuntimeVersion, StorageResponse, StreamOf, StreamOfResults, - TransactionStatus, utils::retry, + Backend, BlockRef, BlockRefT, StorageResponse, StreamOf, StreamOfResults, TransactionStatus, + utils::retry, }; -use crate::config::{Config, Hash, HashFor}; +use crate::config::{Config, Hash, HashFor, RpcConfigFor}; use crate::error::{BackendError, RpcError}; use async_trait::async_trait; use follow_stream_driver::{FollowStreamDriver, FollowStreamDriverHandle}; @@ -31,18 +28,11 @@ use std::collections::HashMap; use std::task::Poll; use storage_items::StorageItems; use subxt_rpcs::RpcClient; +use subxt_rpcs::methods::ChainHeadRpcMethods; use subxt_rpcs::methods::chain_head::{ - FollowEvent, MethodResponse, RuntimeEvent, StorageQuery, StorageQueryType, StorageResultType, + FollowEvent, MethodResponse, StorageQuery, StorageQueryType, StorageResultType, }; -/// Re-export RPC types and methods from [`subxt_rpcs::methods::chain_head`]. -pub mod rpc_methods { - pub use subxt_rpcs::methods::legacy::*; -} - -// Expose the RPC methods. -pub use subxt_rpcs::methods::chain_head::ChainHeadRpcMethods; - /// Configure and build an [`ChainHeadBackend`]. pub struct ChainHeadBackendBuilder { max_block_life: usize, @@ -159,21 +149,10 @@ impl ChainHeadBackendBuilder { /// - On non-wasm targets, this will spawn the driver on `tokio`. /// - On wasm targets, this will spawn the driver on `wasm-bindgen-futures`. #[cfg(feature = "runtime")] - #[cfg_attr(docsrs, doc(cfg(feature = "runtime")))] pub fn build_with_background_driver(self, client: impl Into) -> ChainHeadBackend { - fn spawn(future: F) { - #[cfg(not(target_family = "wasm"))] - tokio::spawn(async move { - future.await; - }); - #[cfg(all(target_arch = "wasm32", target_os = "unknown"))] - wasm_bindgen_futures::spawn_local(async move { - future.await; - }); - } - let (backend, mut driver) = self.build(client); - spawn(async move { + + super::utils::spawn(async move { // NOTE: we need to poll the driver until it's done i.e returns None // to ensure that the backend is shutdown properly. while let Some(res) = driver.next().await { @@ -210,7 +189,7 @@ impl Stream for ChainHeadBackendDriver { #[derive(Debug, Clone)] pub struct ChainHeadBackend { // RPC methods we'll want to call: - methods: ChainHeadRpcMethods, + methods: ChainHeadRpcMethods>, // A handle to the chainHead_follow subscription: follow_handle: FollowStreamDriverHandle>, // How long to wait until giving up on transactions: @@ -285,7 +264,7 @@ impl From> for BlockRef { impl super::sealed::Sealed for ChainHeadBackend {} #[async_trait] -impl Backend for ChainHeadBackend { +impl Backend for ChainHeadBackend { async fn storage_fetch_values( &self, keys: Vec>, @@ -394,6 +373,15 @@ impl Backend for ChainHeadBackend { .await } + async fn block_number_to_hash( + &self, + _number: u64, + ) -> Result>>, BackendError> { + Err(BackendError::other( + "The ChainHead V1 RPCs do not support obtaining a block hash from a number.", + )) + } + async fn block_header(&self, at: HashFor) -> Result, BackendError> { retry(|| async { let sub_id = get_subscription_id(&self.follow_handle).await?; @@ -452,97 +440,6 @@ impl Backend for ChainHeadBackend { next_ref.ok_or_else(|| RpcError::SubscriptionDropped.into()) } - async fn current_runtime_version(&self) -> Result { - // Just start a stream of version infos, and return the first value we get from it. - let runtime_version = self.stream_runtime_version().await?.next().await; - match runtime_version { - None => Err(BackendError::Rpc(RpcError::SubscriptionDropped)), - Some(Err(e)) => Err(e), - Some(Ok(version)) => Ok(version), - } - } - - async fn stream_runtime_version( - &self, - ) -> Result, BackendError> { - // Keep track of runtime details announced in new blocks, and then when blocks - // are finalized, find the latest of these that has runtime details, and clear the rest. - let mut runtimes = HashMap::new(); - let runtime_stream = self - .follow_handle - .subscribe() - .events() - .filter_map(move |ev| { - let output = match ev { - FollowEvent::Initialized(ev) => { - for finalized_block in ev.finalized_block_hashes { - runtimes.remove(&finalized_block.hash()); - } - ev.finalized_block_runtime - } - FollowEvent::NewBlock(ev) => { - if let Some(runtime) = ev.new_runtime { - runtimes.insert(ev.block_hash.hash(), runtime); - } - None - } - FollowEvent::Finalized(ev) => { - let next_runtime = { - let mut it = ev - .finalized_block_hashes - .iter() - .rev() - .filter_map(|h| runtimes.get(&h.hash()).cloned()) - .peekable(); - - let next = it.next(); - - if it.peek().is_some() { - tracing::warn!( - target: "subxt", - "Several runtime upgrades in the finalized blocks but only the latest runtime upgrade is returned" - ); - } - - next - }; - - // Remove finalized and pruned blocks as valid runtime upgrades. - for block in ev - .finalized_block_hashes - .iter() - .chain(ev.pruned_block_hashes.iter()) - { - runtimes.remove(&block.hash()); - } - - next_runtime - } - _ => None, - }; - - let runtime_event = match output { - None => return std::future::ready(None), - Some(ev) => ev, - }; - - let runtime_details = match runtime_event { - RuntimeEvent::Invalid(err) => { - return std::future::ready(Some(Err(BackendError::Other(format!("Invalid runtime error using chainHead RPCs: {}", err.error))))) - } - RuntimeEvent::Valid(ev) => ev, - }; - - let runtime_version = RuntimeVersion { - spec_version: runtime_details.spec.spec_version, - transaction_version: runtime_details.spec.transaction_version - }; - std::future::ready(Some(Ok(runtime_version))) - }); - - Ok(StreamOf::new(Box::pin(runtime_stream))) - } - async fn stream_all_block_headers( &self, _hasher: T::Hasher, @@ -593,225 +490,6 @@ impl Backend for ChainHeadBackend { &self, extrinsic: &[u8], ) -> Result>>, BackendError> { - // Submit a transaction. This makes no attempt to sync with follow events, - async fn submit_transaction_ignoring_follow_events( - extrinsic: &[u8], - methods: &ChainHeadRpcMethods, - ) -> Result>>, BackendError> { - let tx_progress = methods - .transactionwatch_v1_submit_and_watch(extrinsic) - .await? - .map(|ev| { - ev.map(|tx_status| { - use subxt_rpcs::methods::chain_head::TransactionStatus as RpcTransactionStatus; - match tx_status { - RpcTransactionStatus::Validated => TransactionStatus::Validated, - RpcTransactionStatus::Broadcasted => TransactionStatus::Broadcasted, - RpcTransactionStatus::BestChainBlockIncluded { block: None } => { - TransactionStatus::NoLongerInBestBlock - }, - RpcTransactionStatus::BestChainBlockIncluded { block: Some(block) } => { - TransactionStatus::InBestBlock { hash: BlockRef::from_hash(block.hash) } - }, - RpcTransactionStatus::Finalized { block } => { - TransactionStatus::InFinalizedBlock { hash: BlockRef::from_hash(block.hash) } - }, - RpcTransactionStatus::Error { error } => { - TransactionStatus::Error { message: error } - }, - RpcTransactionStatus::Invalid { error } => { - TransactionStatus::Invalid { message: error } - }, - RpcTransactionStatus::Dropped { error } => { - TransactionStatus::Dropped { message: error } - }, - } - }).map_err(Into::into) - }); - - Ok(StreamOf(Box::pin(tx_progress))) - } - - // Submit a transaction. This synchronizes with chainHead_follow events to ensure - // that block hashes returned are ready to be queried. - async fn submit_transaction_tracking_follow_events( - extrinsic: &[u8], - transaction_timeout_secs: u64, - methods: &ChainHeadRpcMethods, - follow_handle: &FollowStreamDriverHandle>, - ) -> Result>>, BackendError> { - // We care about new and finalized block hashes. - enum SeenBlockMarker { - New, - Finalized, - } - - // First, subscribe to new blocks. - let mut seen_blocks_sub = follow_handle.subscribe().events(); - - // Then, submit the transaction. - let mut tx_progress = methods - .transactionwatch_v1_submit_and_watch(extrinsic) - .await?; - - let mut seen_blocks = HashMap::new(); - let mut done = false; - - // If we see the finalized event, we start waiting until we find a finalized block that - // matches, so we can guarantee to return a pinned block hash and be properly in sync - // with chainHead_follow. - let mut finalized_hash: Option> = None; - - // Record the start time so that we can time out if things appear to take too long. - let start_instant = web_time::Instant::now(); - - // A quick helper to return a generic error. - let err_other = |s: &str| Some(Err(BackendError::Other(s.into()))); - - // Now we can attempt to associate tx events with pinned blocks. - let tx_stream = futures::stream::poll_fn(move |cx| { - loop { - // Bail early if we're finished; nothing else to do. - if done { - return Poll::Ready(None); - } - - // Bail if we exceed 4 mins; something very likely went wrong. - if start_instant.elapsed().as_secs() > transaction_timeout_secs { - return Poll::Ready(err_other( - "Timeout waiting for the transaction to be finalized", - )); - } - - // Poll for a follow event, and error if the stream has unexpectedly ended. - let follow_ev_poll = match seen_blocks_sub.poll_next_unpin(cx) { - Poll::Ready(None) => { - return Poll::Ready(err_other( - "chainHead_follow stream ended unexpectedly", - )); - } - Poll::Ready(Some(follow_ev)) => Poll::Ready(follow_ev), - Poll::Pending => Poll::Pending, - }; - let follow_ev_is_pending = follow_ev_poll.is_pending(); - - // If there was a follow event, then handle it and loop around to see if there are more. - // We want to buffer follow events until we hit Pending, so that we are as up-to-date as possible - // for when we see a BestBlockChanged event, so that we have the best change of already having - // seen the block that it mentions and returning a proper pinned block. - if let Poll::Ready(follow_ev) = follow_ev_poll { - match follow_ev { - FollowEvent::NewBlock(ev) => { - // Optimization: once we have a `finalized_hash`, we only care about finalized - // block refs now and can avoid bothering to save new blocks. - if finalized_hash.is_none() { - seen_blocks.insert( - ev.block_hash.hash(), - (SeenBlockMarker::New, ev.block_hash), - ); - } - } - FollowEvent::Finalized(ev) => { - for block_ref in ev.finalized_block_hashes { - seen_blocks.insert( - block_ref.hash(), - (SeenBlockMarker::Finalized, block_ref), - ); - } - } - FollowEvent::Stop => { - // If we get this event, we'll lose all of our existing pinned blocks and have a gap - // in which we may lose the finalized block that the TX is in. For now, just error if - // this happens, to prevent the case in which we never see a finalized block and wait - // forever. - return Poll::Ready(err_other( - "chainHead_follow emitted 'stop' event during transaction submission", - )); - } - _ => {} - } - continue; - } - - // If we have a finalized hash, we are done looking for tx events and we are just waiting - // for a pinned block with a matching hash (which must appear eventually given it's finalized). - if let Some(hash) = &finalized_hash { - if let Some((SeenBlockMarker::Finalized, block_ref)) = - seen_blocks.remove(hash) - { - // Found it! Hand back the event with a pinned block. We're done. - done = true; - let ev = TransactionStatus::InFinalizedBlock { - hash: block_ref.into(), - }; - return Poll::Ready(Some(Ok(ev))); - } else { - // Not found it! If follow ev is pending, then return pending here and wait for - // a new one to come in, else loop around and see if we get another one immediately. - seen_blocks.clear(); - if follow_ev_is_pending { - return Poll::Pending; - } else { - continue; - } - } - } - - // If we don't have a finalized block yet, we keep polling for tx progress events. - let tx_progress_ev = match tx_progress.poll_next_unpin(cx) { - Poll::Pending => return Poll::Pending, - Poll::Ready(None) => { - return Poll::Ready(err_other( - "No more transaction progress events, but we haven't seen a Finalized one yet", - )); - } - Poll::Ready(Some(Err(e))) => return Poll::Ready(Some(Err(e.into()))), - Poll::Ready(Some(Ok(ev))) => ev, - }; - - // When we get one, map it to the correct format (or for finalized ev, wait for the pinned block): - use subxt_rpcs::methods::chain_head::TransactionStatus as RpcTransactionStatus; - let tx_progress_ev = match tx_progress_ev { - RpcTransactionStatus::Finalized { block } => { - // We'll wait until we have seen this hash, to try to guarantee - // that when we return this event, the corresponding block is - // pinned and accessible. - finalized_hash = Some(block.hash); - continue; - } - RpcTransactionStatus::BestChainBlockIncluded { block: Some(block) } => { - // Look up a pinned block ref if we can, else return a non-pinned - // block that likely isn't accessible. We have no guarantee that a best - // block on the node a tx was sent to will ever be known about on the - // chainHead_follow subscription. - let block_ref = match seen_blocks.get(&block.hash) { - Some((_, block_ref)) => block_ref.clone().into(), - None => BlockRef::from_hash(block.hash), - }; - TransactionStatus::InBestBlock { hash: block_ref } - } - RpcTransactionStatus::BestChainBlockIncluded { block: None } => { - TransactionStatus::NoLongerInBestBlock - } - RpcTransactionStatus::Broadcasted => TransactionStatus::Broadcasted, - RpcTransactionStatus::Dropped { error, .. } => { - TransactionStatus::Dropped { message: error } - } - RpcTransactionStatus::Error { error } => { - TransactionStatus::Error { message: error } - } - RpcTransactionStatus::Invalid { error } => { - TransactionStatus::Invalid { message: error } - } - RpcTransactionStatus::Validated => TransactionStatus::Validated, - }; - return Poll::Ready(Some(Ok(tx_progress_ev))); - } - }); - - Ok(StreamOf(Box::pin(tx_stream))) - } - if self.submit_transactions_ignoring_follow_events { submit_transaction_ignoring_follow_events(extrinsic, &self.methods).await } else { @@ -876,3 +554,222 @@ async fn get_subscription_id( Ok(sub_id) } + +// Submit a transaction. This makes no attempt to sync with follow events, +// This is used in the archive backend too. +pub(crate) async fn submit_transaction_ignoring_follow_events( + extrinsic: &[u8], + methods: &ChainHeadRpcMethods>, +) -> Result>>, BackendError> { + let tx_progress = methods + .transactionwatch_v1_submit_and_watch(extrinsic) + .await? + .map(|ev| { + ev.map(|tx_status| { + use subxt_rpcs::methods::chain_head::TransactionStatus as RpcTransactionStatus; + match tx_status { + RpcTransactionStatus::Validated => TransactionStatus::Validated, + RpcTransactionStatus::Broadcasted => TransactionStatus::Broadcasted, + RpcTransactionStatus::BestChainBlockIncluded { block: None } => { + TransactionStatus::NoLongerInBestBlock + } + RpcTransactionStatus::BestChainBlockIncluded { block: Some(block) } => { + TransactionStatus::InBestBlock { + hash: BlockRef::from_hash(block.hash), + } + } + RpcTransactionStatus::Finalized { block } => { + TransactionStatus::InFinalizedBlock { + hash: BlockRef::from_hash(block.hash), + } + } + RpcTransactionStatus::Error { error } => { + TransactionStatus::Error { message: error } + } + RpcTransactionStatus::Invalid { error } => { + TransactionStatus::Invalid { message: error } + } + RpcTransactionStatus::Dropped { error } => { + TransactionStatus::Dropped { message: error } + } + } + }) + .map_err(Into::into) + }); + + Ok(StreamOf(Box::pin(tx_progress))) +} + +// Submit a transaction. This synchronizes with chainHead_follow events to ensure +// that block hashes returned are ready to be queried. +async fn submit_transaction_tracking_follow_events( + extrinsic: &[u8], + transaction_timeout_secs: u64, + methods: &ChainHeadRpcMethods>, + follow_handle: &FollowStreamDriverHandle>, +) -> Result>>, BackendError> { + // We care about new and finalized block hashes. + enum SeenBlockMarker { + New, + Finalized, + } + + // First, subscribe to new blocks. + let mut seen_blocks_sub = follow_handle.subscribe().events(); + + // Then, submit the transaction. + let mut tx_progress = methods + .transactionwatch_v1_submit_and_watch(extrinsic) + .await?; + + let mut seen_blocks = HashMap::new(); + let mut done = false; + + // If we see the finalized event, we start waiting until we find a finalized block that + // matches, so we can guarantee to return a pinned block hash and be properly in sync + // with chainHead_follow. + let mut finalized_hash: Option> = None; + + // Record the start time so that we can time out if things appear to take too long. + let start_instant = web_time::Instant::now(); + + // A quick helper to return a generic error. + let err_other = |s: &'static str| Some(Err(BackendError::other(s))); + + // Now we can attempt to associate tx events with pinned blocks. + let tx_stream = futures::stream::poll_fn(move |cx| { + loop { + // Bail early if we're finished; nothing else to do. + if done { + return Poll::Ready(None); + } + + // Bail if we exceed 4 mins; something very likely went wrong. + if start_instant.elapsed().as_secs() > transaction_timeout_secs { + return Poll::Ready(err_other( + "Timeout waiting for the transaction to be finalized", + )); + } + + // Poll for a follow event, and error if the stream has unexpectedly ended. + let follow_ev_poll = match seen_blocks_sub.poll_next_unpin(cx) { + Poll::Ready(None) => { + return Poll::Ready(err_other("chainHead_follow stream ended unexpectedly")); + } + Poll::Ready(Some(follow_ev)) => Poll::Ready(follow_ev), + Poll::Pending => Poll::Pending, + }; + let follow_ev_is_pending = follow_ev_poll.is_pending(); + + // If there was a follow event, then handle it and loop around to see if there are more. + // We want to buffer follow events until we hit Pending, so that we are as up-to-date as possible + // for when we see a BestBlockChanged event, so that we have the best change of already having + // seen the block that it mentions and returning a proper pinned block. + if let Poll::Ready(follow_ev) = follow_ev_poll { + match follow_ev { + FollowEvent::NewBlock(ev) => { + // Optimization: once we have a `finalized_hash`, we only care about finalized + // block refs now and can avoid bothering to save new blocks. + if finalized_hash.is_none() { + seen_blocks.insert( + ev.block_hash.hash(), + (SeenBlockMarker::New, ev.block_hash), + ); + } + } + FollowEvent::Finalized(ev) => { + for block_ref in ev.finalized_block_hashes { + seen_blocks + .insert(block_ref.hash(), (SeenBlockMarker::Finalized, block_ref)); + } + } + FollowEvent::Stop => { + // If we get this event, we'll lose all of our existing pinned blocks and have a gap + // in which we may lose the finalized block that the TX is in. For now, just error if + // this happens, to prevent the case in which we never see a finalized block and wait + // forever. + return Poll::Ready(err_other( + "chainHead_follow emitted 'stop' event during transaction submission", + )); + } + _ => {} + } + continue; + } + + // If we have a finalized hash, we are done looking for tx events and we are just waiting + // for a pinned block with a matching hash (which must appear eventually given it's finalized). + if let Some(hash) = &finalized_hash { + if let Some((SeenBlockMarker::Finalized, block_ref)) = seen_blocks.remove(hash) { + // Found it! Hand back the event with a pinned block. We're done. + done = true; + let ev = TransactionStatus::InFinalizedBlock { + hash: block_ref.into(), + }; + return Poll::Ready(Some(Ok(ev))); + } else { + // Not found it! If follow ev is pending, then return pending here and wait for + // a new one to come in, else loop around and see if we get another one immediately. + seen_blocks.clear(); + if follow_ev_is_pending { + return Poll::Pending; + } else { + continue; + } + } + } + + // If we don't have a finalized block yet, we keep polling for tx progress events. + let tx_progress_ev = match tx_progress.poll_next_unpin(cx) { + Poll::Pending => return Poll::Pending, + Poll::Ready(None) => { + return Poll::Ready(err_other( + "No more transaction progress events, but we haven't seen a Finalized one yet", + )); + } + Poll::Ready(Some(Err(e))) => return Poll::Ready(Some(Err(e.into()))), + Poll::Ready(Some(Ok(ev))) => ev, + }; + + // When we get one, map it to the correct format (or for finalized ev, wait for the pinned block): + use subxt_rpcs::methods::chain_head::TransactionStatus as RpcTransactionStatus; + let tx_progress_ev = match tx_progress_ev { + RpcTransactionStatus::Finalized { block } => { + // We'll wait until we have seen this hash, to try to guarantee + // that when we return this event, the corresponding block is + // pinned and accessible. + finalized_hash = Some(block.hash); + continue; + } + RpcTransactionStatus::BestChainBlockIncluded { block: Some(block) } => { + // Look up a pinned block ref if we can, else return a non-pinned + // block that likely isn't accessible. We have no guarantee that a best + // block on the node a tx was sent to will ever be known about on the + // chainHead_follow subscription. + let block_ref = match seen_blocks.get(&block.hash) { + Some((_, block_ref)) => block_ref.clone().into(), + None => BlockRef::from_hash(block.hash), + }; + TransactionStatus::InBestBlock { hash: block_ref } + } + RpcTransactionStatus::BestChainBlockIncluded { block: None } => { + TransactionStatus::NoLongerInBestBlock + } + RpcTransactionStatus::Broadcasted => TransactionStatus::Broadcasted, + RpcTransactionStatus::Dropped { error, .. } => { + TransactionStatus::Dropped { message: error } + } + RpcTransactionStatus::Error { error } => { + TransactionStatus::Error { message: error } + } + RpcTransactionStatus::Invalid { error } => { + TransactionStatus::Invalid { message: error } + } + RpcTransactionStatus::Validated => TransactionStatus::Validated, + }; + return Poll::Ready(Some(Ok(tx_progress_ev))); + } + }); + + Ok(StreamOf(Box::pin(tx_stream))) +} diff --git a/subxt/src/backend/chain_head/follow_stream.rs b/subxt/src/backend/chain_head/follow_stream.rs index f06b5d06776..b763a6270bc 100644 --- a/subxt/src/backend/chain_head/follow_stream.rs +++ b/subxt/src/backend/chain_head/follow_stream.rs @@ -2,7 +2,7 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use crate::config::{Config, HashFor}; +use crate::config::{Config, HashFor, RpcConfigFor}; use crate::error::BackendError; use futures::{FutureExt, Stream, StreamExt, TryStreamExt}; use std::future::Future; @@ -103,7 +103,9 @@ impl FollowStream { } /// Create a new [`FollowStream`] given the RPC methods. - pub fn from_methods(methods: ChainHeadRpcMethods) -> FollowStream> { + pub fn from_methods( + methods: ChainHeadRpcMethods>, + ) -> FollowStream> { FollowStream { stream_getter: Box::new(move || { let methods = methods.clone(); @@ -112,9 +114,8 @@ impl FollowStream { let stream = methods.chainhead_v1_follow(true).await?; // Extract the subscription ID: let Some(sub_id) = stream.subscription_id().map(ToOwned::to_owned) else { - return Err(BackendError::Other( - "Subscription ID expected for chainHead_follow response, but not given" - .to_owned(), + return Err(BackendError::other( + "Subscription ID expected for chainHead_follow response, but not given", )); }; // Map stream errors into the higher level subxt one: @@ -311,7 +312,7 @@ pub mod test { Ok(FollowEvent::Stop), Ok(ev_new_block(1, 2)), // Nothing should be emitted after an error: - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), Ok(ev_new_block(2, 3)), ] }); diff --git a/subxt/src/backend/chain_head/follow_stream_driver.rs b/subxt/src/backend/chain_head/follow_stream_driver.rs index f1ff507729e..0324f5ea35f 100644 --- a/subxt/src/backend/chain_head/follow_stream_driver.rs +++ b/subxt/src/backend/chain_head/follow_stream_driver.rs @@ -537,7 +537,7 @@ mod test { Ok(ev_new_block(0, 1)), Ok(ev_best_block(1)), Ok(ev_finalized([1], [])), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 10, @@ -580,7 +580,7 @@ mod test { Ok(ev_finalized([1], [])), Ok(ev_new_block(1, 2)), Ok(ev_new_block(2, 3)), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 10, @@ -630,7 +630,7 @@ mod test { Ok(ev_new_block(1, 2)), Ok(ev_new_block(2, 3)), Ok(ev_finalized([1], [])), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 10, @@ -668,7 +668,7 @@ mod test { Ok(FollowEvent::Stop), Ok(ev_initialized(1)), Ok(ev_finalized([2], [])), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 10, @@ -714,7 +714,7 @@ mod test { // Emulate that we missed some blocks. Ok(ev_initialized(13)), Ok(ev_finalized([14], [])), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 10, diff --git a/subxt/src/backend/chain_head/follow_stream_unpin.rs b/subxt/src/backend/chain_head/follow_stream_unpin.rs index db0995f5740..b8e9c144f87 100644 --- a/subxt/src/backend/chain_head/follow_stream_unpin.rs +++ b/subxt/src/backend/chain_head/follow_stream_unpin.rs @@ -4,7 +4,7 @@ use super::ChainHeadRpcMethods; use super::follow_stream::FollowStream; -use crate::config::{Config, Hash, HashFor}; +use crate::config::{Config, Hash, HashFor, RpcConfigFor}; use crate::error::BackendError; use futures::stream::{FuturesUnordered, Stream, StreamExt}; use subxt_rpcs::methods::chain_head::{ @@ -275,7 +275,7 @@ impl FollowStreamUnpin { /// Create a new [`FollowStreamUnpin`] given the RPC methods. pub fn from_methods( follow_stream: FollowStream>, - methods: ChainHeadRpcMethods, + methods: ChainHeadRpcMethods>, max_block_life: usize, ) -> FollowStreamUnpin> { let unpin_method = Box::new(move |hash: HashFor, sub_id: Arc| { @@ -567,7 +567,7 @@ mod test { Ok(ev_new_block(0, 1)), Ok(ev_new_block(1, 2)), Ok(ev_new_block(2, 3)), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 10, @@ -593,7 +593,7 @@ mod test { [ Ok(ev_initialized(0)), Ok(ev_finalized([1], [])), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 3, @@ -624,7 +624,7 @@ mod test { Ok(ev_finalized([3], [])), Ok(ev_finalized([4], [])), Ok(ev_finalized([5], [])), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 3, @@ -663,7 +663,7 @@ mod test { Ok(ev_new_block(1, 2)), Ok(ev_finalized([1], [])), Ok(ev_finalized([2], [])), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 10, @@ -711,7 +711,7 @@ mod test { Ok(ev_finalized([1], [])), Ok(ev_finalized([2], [3])), Ok(ev_finalized([4], [])), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 10, @@ -771,7 +771,7 @@ mod test { Ok(ev_best_block(1)), Ok(ev_finalized([1], [])), Ok(ev_finalized([2], [])), - Err(BackendError::Other("ended".to_owned())), + Err(BackendError::other("ended")), ] }, 10, diff --git a/subxt/src/backend/chain_head/storage_items.rs b/subxt/src/backend/chain_head/storage_items.rs index 6519e63a677..31cbea8c092 100644 --- a/subxt/src/backend/chain_head/storage_items.rs +++ b/subxt/src/backend/chain_head/storage_items.rs @@ -4,7 +4,7 @@ use super::follow_stream_driver::FollowStreamDriverHandle; use super::follow_stream_unpin::BlockRef; -use crate::config::{Config, HashFor}; +use crate::config::{Config, HashFor, RpcConfigFor}; use crate::error::{BackendError, RpcError}; use futures::{FutureExt, Stream, StreamExt}; use std::collections::VecDeque; @@ -35,7 +35,7 @@ impl StorageItems { queries: impl Iterator>, at: HashFor, follow_handle: &FollowStreamDriverHandle>, - methods: ChainHeadRpcMethods, + methods: ChainHeadRpcMethods>, ) -> Result { let sub_id = super::get_subscription_id(follow_handle).await?; @@ -157,7 +157,7 @@ impl Stream for StorageItems { FollowEvent::OperationError(err) if err.operation_id == *self.operation_id => { // Something went wrong obtaining storage items; mark as done and return the error. self.done = true; - return Poll::Ready(Some(Err(BackendError::Other(err.error)))); + return Poll::Ready(Some(Err(BackendError::other(err.error)))); } _ => { // We don't care about this event; wait for the next. diff --git a/subxt/src/backend/combined.rs b/subxt/src/backend/combined.rs new file mode 100644 index 00000000000..6930a5710ea --- /dev/null +++ b/subxt/src/backend/combined.rs @@ -0,0 +1,455 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! This module exposes a backend implementation which will lookup the methods available +//! to it from the RPC client and call methods accordingly. + +use crate::backend::chain_head::ChainHeadBackendDriver; +use crate::backend::{ + Backend, BlockRef, StorageResponse, StreamOfResults, TransactionStatus, + archive::ArchiveBackend, chain_head::ChainHeadBackend, legacy::LegacyBackend, +}; +use crate::config::{Config, HashFor}; +use crate::error::{BackendError, CombinedBackendError}; +use async_trait::async_trait; +use futures::Stream; +use futures::StreamExt; +use std::task::Poll; +use subxt_rpcs::RpcClient; + +/// A builder to configure and build a [`CombinedBackend`]. +pub struct CombinedBackendBuilder { + archive: BackendChoice>, + chainhead: BackendChoice>, + legacy: BackendChoice>, +} + +enum BackendChoice { + Use(V), + DontUse, + UseDefault, +} + +impl Default for CombinedBackendBuilder { + fn default() -> Self { + Self::new() + } +} + +impl CombinedBackendBuilder { + /// Create a new [`CombinedBackendBuilder`]. + pub fn new() -> Self { + CombinedBackendBuilder { + archive: BackendChoice::UseDefault, + chainhead: BackendChoice::UseDefault, + legacy: BackendChoice::UseDefault, + } + } + + /// Use the given [`ArchiveBackend`] where applicable. + pub fn with_archive_backend(mut self, backend: ArchiveBackend) -> Self { + self.archive = BackendChoice::Use(backend); + self + } + + /// Use the given [`ChainHeadBackend`] where applicable. + pub fn with_chainhead_backend(mut self, backend: ChainHeadBackend) -> Self { + self.chainhead = BackendChoice::Use(backend); + self + } + + /// Use the given [`LegacyBackend`] where applicable. + pub fn with_legacy_backend(mut self, backend: LegacyBackend) -> Self { + self.legacy = BackendChoice::Use(backend); + self + } + + /// Don't use any default backends; only use what is explicitly configured via + /// [`CombinedBackendBuilder::with_archive_backend`], + /// [`CombinedBackendBuilder::with_chainhead_backend`] and + /// [`CombinedBackendBuilder::with_legacy_backend`]. + pub fn no_default_backends(mut self) -> Self { + if matches!(self.legacy, BackendChoice::UseDefault) { + self.legacy = BackendChoice::DontUse; + } + if matches!(self.archive, BackendChoice::UseDefault) { + self.archive = BackendChoice::DontUse; + } + if matches!(self.chainhead, BackendChoice::UseDefault) { + self.chainhead = BackendChoice::DontUse; + } + self + } + + /// A low-level API to build the backend and driver which requires polling the driver for the backend + /// to make progress. + /// + /// This is useful if you want to manage the driver yourself, for example if you want to run it in on + /// a specific runtime. + /// + /// If you just want to run the driver in the background until completion in on the default runtime, + /// use [`CombinedBackendBuilder::build_with_background_driver`] instead. + pub async fn build( + self, + rpc_client: impl Into, + ) -> Result<(CombinedBackend, CombinedBackendDriver), CombinedBackendError> { + let rpc_client = rpc_client.into(); + + // What does the thing wer're talking to actually know about? + #[derive(serde::Deserialize)] + struct Methods { + methods: Vec, + } + let methods: Methods = rpc_client + .request("rpc_methods", subxt_rpcs::rpc_params![]) + .await + .map_err(CombinedBackendError::CouldNotObtainRpcMethodList)?; + let methods = methods.methods; + + let has_archive_methods = methods.iter().any(|m| m.starts_with("archive_v1_")); + let has_chainhead_methods = methods.iter().any(|m| m.starts_with("chainHead_v1")); + + let mut combined_driver = CombinedBackendDriver { + chainhead_driver: None, + }; + + let archive = if has_archive_methods { + match self.archive { + BackendChoice::Use(b) => Some(b), + BackendChoice::UseDefault => Some(ArchiveBackend::new(rpc_client.clone())), + BackendChoice::DontUse => None, + } + } else { + None + }; + + let chainhead = if has_chainhead_methods { + match self.chainhead { + BackendChoice::Use(b) => Some(b), + BackendChoice::UseDefault => { + let (chainhead, chainhead_driver) = + ChainHeadBackend::builder().build(rpc_client.clone()); + combined_driver.chainhead_driver = Some(chainhead_driver); + Some(chainhead) + } + BackendChoice::DontUse => None, + } + } else { + None + }; + + let legacy = match self.legacy { + BackendChoice::Use(b) => Some(b), + BackendChoice::UseDefault => Some(LegacyBackend::builder().build(rpc_client.clone())), + BackendChoice::DontUse => None, + }; + + let combined = CombinedBackend { + archive, + chainhead, + legacy, + }; + + Ok((combined, combined_driver)) + } + + /// An API to build the backend and driver which will run in the background until completion + /// on the default runtime. + /// + /// - On non-wasm targets, this will spawn the driver on `tokio`. + /// - On wasm targets, this will spawn the driver on `wasm-bindgen-futures`. + #[cfg(feature = "runtime")] + pub async fn build_with_background_driver( + self, + client: impl Into, + ) -> Result, CombinedBackendError> { + let (backend, mut driver) = self.build(client).await?; + + super::utils::spawn(async move { + // NOTE: we need to poll the driver until it's done i.e returns None + // to ensure that the backend is shutdown properly. + while let Some(res) = driver.next().await { + if let Err(err) = res { + tracing::debug!(target: "subxt", "chainHead backend error={err}"); + } + } + + tracing::debug!(target: "subxt", "combined backend was closed"); + }); + + Ok(backend) + } +} + +/// Driver for the [`CombinedBackend`]. This needs to be polled to ensure +/// that the [`CombinedBackend`] can make progress. It does not need polling +/// if [`CombinedBackendDriver::needs_polling`] returns `false`. +pub struct CombinedBackendDriver { + chainhead_driver: Option>, +} + +impl CombinedBackendDriver { + /// this returns true if this [`CombinedBackendDriver`] needs polling in + /// order to drive the [`CombinedBackend`], and false if it does not. + pub fn needs_polling(&self) -> bool { + self.chainhead_driver.is_some() + } +} + +impl Stream for CombinedBackendDriver { + type Item = as Stream>::Item; + fn poll_next( + mut self: std::pin::Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> std::task::Poll> { + match &mut self.chainhead_driver { + Some(driver) => driver.poll_next_unpin(cx), + None => Poll::Ready(None), + } + } +} + +/// A combined backend. This selects which RPC calls to use based on the `rpc_methods` +/// available from the given RPC client we're given. +pub struct CombinedBackend { + archive: Option>, + chainhead: Option>, + legacy: Option>, +} + +impl CombinedBackend { + /// Configure and construct a [`CombinedBackend`]. + pub fn builder() -> CombinedBackendBuilder { + CombinedBackendBuilder::new() + } + + fn archive(&self) -> Option<&dyn Backend> { + self.archive.as_ref().map(|a| { + let a: &dyn Backend = a; + a + }) + } + + fn chainhead(&self) -> Option<&dyn Backend> { + self.chainhead.as_ref().map(|a| { + let a: &dyn Backend = a; + a + }) + } + + fn legacy(&self) -> Option<&dyn Backend> { + self.legacy.as_ref().map(|a| { + let a: &dyn Backend = a; + a + }) + } +} + +impl super::sealed::Sealed for CombinedBackend {} + +// Our default behaviour: +// - Try the archive backend first if it's available. Why? It has all block headers/bodies +// etc so it's mroe likely to succeed than chainHead backend and give back things that won't +// expire. +// - If archive calls aren't available, fall back to the chainHead backend. Blocks given back +// by this are more likely to expire. +// - If neither exists / works, we fall back to the legacy methods. These have some limits on +// what is available (often fewer limits than chainHead though) but tend to do the job. We'd +// rather not use these as they are old and should go away, but until then they are a good +// fallback. +#[async_trait] +impl Backend for CombinedBackend { + async fn storage_fetch_values( + &self, + keys: Vec>, + at: HashFor, + ) -> Result, BackendError> { + try_backends( + &[self.archive(), self.chainhead(), self.legacy()], + async |b: &dyn Backend| b.storage_fetch_values(keys.clone(), at).await, + ) + .await + } + + async fn storage_fetch_descendant_keys( + &self, + key: Vec, + at: HashFor, + ) -> Result>, BackendError> { + try_backends( + &[self.archive(), self.chainhead(), self.legacy()], + async |b: &dyn Backend| b.storage_fetch_descendant_keys(key.clone(), at).await, + ) + .await + } + + async fn storage_fetch_descendant_values( + &self, + key: Vec, + at: HashFor, + ) -> Result, BackendError> { + try_backends( + &[self.archive(), self.chainhead(), self.legacy()], + async |b: &dyn Backend| b.storage_fetch_descendant_values(key.clone(), at).await, + ) + .await + } + + async fn genesis_hash(&self) -> Result, BackendError> { + try_backends( + &[self.archive(), self.chainhead(), self.legacy()], + async |b: &dyn Backend| b.genesis_hash().await, + ) + .await + } + + async fn block_number_to_hash( + &self, + number: u64, + ) -> Result>>, BackendError> { + try_backends( + &[ + self.archive(), + self.legacy(), + // chainHead last as it cannot handle this request and will fail, so it's here + // just to hand back a more relevant error in case the above two backends aren't + // enabled or have some issue. + self.chainhead(), + ], + async |b: &dyn Backend| b.block_number_to_hash(number).await, + ) + .await + } + + async fn block_header(&self, at: HashFor) -> Result, BackendError> { + try_backends( + &[self.archive(), self.chainhead(), self.legacy()], + async |b: &dyn Backend| b.block_header(at).await, + ) + .await + } + + async fn block_body(&self, at: HashFor) -> Result>>, BackendError> { + try_backends( + &[self.archive(), self.chainhead(), self.legacy()], + async |b: &dyn Backend| b.block_body(at).await, + ) + .await + } + + async fn latest_finalized_block_ref(&self) -> Result>, BackendError> { + try_backends( + &[ + // Prioritize chainHead backend since it's streaming these things; save another call. + self.chainhead(), + self.archive(), + self.legacy(), + ], + async |b: &dyn Backend| b.latest_finalized_block_ref().await, + ) + .await + } + + async fn stream_all_block_headers( + &self, + hasher: T::Hasher, + ) -> Result>)>, BackendError> { + try_backends( + &[ + // Ignore archive backend; it doesn't support this. + self.chainhead(), + self.legacy(), + ], + async |b: &dyn Backend| b.stream_all_block_headers(hasher.clone()).await, + ) + .await + } + + async fn stream_best_block_headers( + &self, + hasher: T::Hasher, + ) -> Result>)>, BackendError> { + try_backends( + &[ + // Ignore archive backend; it doesn't support this. + self.chainhead(), + self.legacy(), + ], + async |b: &dyn Backend| b.stream_best_block_headers(hasher.clone()).await, + ) + .await + } + + async fn stream_finalized_block_headers( + &self, + hasher: T::Hasher, + ) -> Result>)>, BackendError> { + try_backends( + &[ + // Ignore archive backend; it doesn't support this. + self.chainhead(), + self.legacy(), + ], + async |b: &dyn Backend| b.stream_finalized_block_headers(hasher.clone()).await, + ) + .await + } + + async fn submit_transaction( + &self, + extrinsic: &[u8], + ) -> Result>>, BackendError> { + try_backends( + &[ + // chainHead first as it does the same as the archive backend, but with better + // guarantees around the block handed back being pinned & ready to access. + self.chainhead(), + self.legacy(), + // archive last just incase chainHead & legacy fail or aren't provided for some + // reason. + self.archive(), + ], + async |b: &dyn Backend| b.submit_transaction(extrinsic).await, + ) + .await + } + + async fn call( + &self, + method: &str, + call_parameters: Option<&[u8]>, + at: HashFor, + ) -> Result, BackendError> { + try_backends( + &[self.archive(), self.chainhead(), self.legacy()], + async |b: &dyn Backend| b.call(method, call_parameters, at).await, + ) + .await + } +} + +/// Call one backend after the other in the list until we get a successful result back. +async fn try_backends<'s, 'b, T, Func, Fut, O>( + backends: &'s [Option<&'b dyn Backend>], + mut f: Func, +) -> Result +where + 'b: 's, + T: Config, + Func: FnMut(&'b dyn Backend) -> Fut, + Fut: Future> + 'b, +{ + static NO_AVAILABLE_BACKEND: &str = + "None of the configured backends are capable of handling this request"; + let mut err = BackendError::other(NO_AVAILABLE_BACKEND); + + for backend in backends.iter().filter_map(|b| *b) { + match f(backend).await { + Ok(res) => return Ok(res), + Err(e) => err = e, + } + } + + Err(err) +} diff --git a/subxt/src/backend/legacy.rs b/subxt/src/backend/legacy.rs index d6edcdbd7d7..86e5e8a6653 100644 --- a/subxt/src/backend/legacy.rs +++ b/subxt/src/backend/legacy.rs @@ -5,29 +5,22 @@ //! This module exposes a legacy backend implementation, which relies //! on the legacy RPC API methods. -use self::rpc_methods::TransactionStatus as RpcTransactionStatus; +mod descendant_streams; + use crate::backend::utils::{retry, retry_stream}; use crate::backend::{ - Backend, BlockRef, RuntimeVersion, StorageResponse, StreamOf, StreamOfResults, - TransactionStatus, + Backend, BlockRef, StorageResponse, StreamOf, StreamOfResults, TransactionStatus, }; -use crate::config::{Config, HashFor, Header}; +use crate::config::{Config, HashFor, Hasher, Header, RpcConfigFor}; use crate::error::BackendError; use async_trait::async_trait; +use codec::Encode; +use descendant_streams::{StorageFetchDescendantKeysStream, StorageFetchDescendantValuesStream}; use futures::TryStreamExt; -use futures::{Future, FutureExt, Stream, StreamExt, future, future::Either, stream}; -use std::collections::VecDeque; -use std::pin::Pin; -use std::task::{Context, Poll}; +use futures::{Future, Stream, StreamExt, future, future::Either, stream}; use subxt_rpcs::RpcClient; - -/// Re-export legacy RPC types and methods from [`subxt_rpcs::methods::legacy`]. -pub mod rpc_methods { - pub use subxt_rpcs::methods::legacy::*; -} - -// Expose the RPC methods. -pub use rpc_methods::LegacyRpcMethods; +use subxt_rpcs::methods::legacy::NumberOrHex; +use subxt_rpcs::methods::legacy::{LegacyRpcMethods, TransactionStatus as RpcTransactionStatus}; /// Configure and build an [`LegacyBackend`]. pub struct LegacyBackendBuilder { @@ -72,7 +65,7 @@ impl LegacyBackendBuilder { #[derive(Debug)] pub struct LegacyBackend { storage_page_size: u32, - methods: LegacyRpcMethods, + methods: LegacyRpcMethods>, } impl Clone for LegacyBackend { @@ -94,7 +87,7 @@ impl LegacyBackend { impl super::sealed::Sealed for LegacyBackend {} #[async_trait] -impl Backend for LegacyBackend { +impl Backend for LegacyBackend { async fn storage_fetch_values( &self, keys: Vec>, @@ -103,7 +96,7 @@ impl Backend for LegacyBackend { fn get_entry( key: Vec, at: HashFor, - methods: LegacyRpcMethods, + methods: LegacyRpcMethods>, ) -> impl Future, BackendError>> { retry(move || { let methods = methods.clone(); @@ -137,15 +130,12 @@ impl Backend for LegacyBackend { key: Vec, at: HashFor, ) -> Result>, BackendError> { - let keys = StorageFetchDescendantKeysStream { - at, + let keys = StorageFetchDescendantKeysStream::new( + self.methods.clone(), key, - storage_page_size: self.storage_page_size, - methods: self.methods.clone(), - done: Default::default(), - keys_fut: Default::default(), - pagination_start_key: None, - }; + at, + self.storage_page_size, + ); let keys = keys.flat_map(|keys| { match keys { @@ -168,21 +158,14 @@ impl Backend for LegacyBackend { key: Vec, at: HashFor, ) -> Result, BackendError> { - let keys_stream = StorageFetchDescendantKeysStream { - at, + let values_stream = StorageFetchDescendantValuesStream::new( + self.methods.clone(), key, - storage_page_size: self.storage_page_size, - methods: self.methods.clone(), - done: Default::default(), - keys_fut: Default::default(), - pagination_start_key: None, - }; + at, + self.storage_page_size, + ); - Ok(StreamOf(Box::pin(StorageFetchDescendantValuesStream { - keys: keys_stream, - results_fut: None, - results: Default::default(), - }))) + Ok(StreamOf(Box::pin(values_stream))) } async fn genesis_hash(&self) -> Result, BackendError> { @@ -193,6 +176,22 @@ impl Backend for LegacyBackend { .await } + async fn block_number_to_hash( + &self, + number: u64, + ) -> Result>>, BackendError> { + retry(|| async { + let number_or_hash = NumberOrHex::Number(number); + let hash = self + .methods + .chain_get_block_hash(Some(number_or_hash)) + .await? + .map(BlockRef::from_hash); + Ok(hash) + }) + .await + } + async fn block_header(&self, at: HashFor) -> Result, BackendError> { retry(|| async { let header = self.methods.chain_get_header(Some(at)).await?; @@ -221,56 +220,6 @@ impl Backend for LegacyBackend { .await } - async fn current_runtime_version(&self) -> Result { - retry(|| async { - let details = self.methods.state_get_runtime_version(None).await?; - Ok(RuntimeVersion { - spec_version: details.spec_version, - transaction_version: details.transaction_version, - }) - }) - .await - } - - async fn stream_runtime_version( - &self, - ) -> Result, BackendError> { - let methods = self.methods.clone(); - - let retry_sub = retry_stream(move || { - let methods = methods.clone(); - - Box::pin(async move { - let sub = methods.state_subscribe_runtime_version().await?; - let sub = sub.map_err(|e| e.into()).map(|r| { - r.map(|v| RuntimeVersion { - spec_version: v.spec_version, - transaction_version: v.transaction_version, - }) - }); - Ok(StreamOf(Box::pin(sub))) - }) - }) - .await?; - - // For runtime version subscriptions we omit the `DisconnectedWillReconnect` error - // because the once it resubscribes it will emit the latest runtime version. - // - // Thus, it's technically possible that a runtime version can be missed if - // two runtime upgrades happen in quick succession, but this is very unlikely. - let stream = retry_sub.filter(|r| { - let mut keep = true; - if let Err(e) = r { - if e.is_disconnected_will_reconnect() { - keep = false; - } - } - async move { keep } - }); - - Ok(StreamOf(Box::pin(stream))) - } - async fn stream_all_block_headers( &self, hasher: T::Hasher, @@ -278,11 +227,12 @@ impl Backend for LegacyBackend { let methods = self.methods.clone(); let retry_sub = retry_stream(move || { let methods = methods.clone(); + let hasher = hasher.clone(); Box::pin(async move { let sub = methods.chain_subscribe_all_heads().await?; let sub = sub.map_err(|e| e.into()).map(move |r| { r.map(|h| { - let hash = h.hash_with(hasher); + let hash = hasher.hash(&h.encode()); (h, BlockRef::from_hash(hash)) }) }); @@ -302,11 +252,12 @@ impl Backend for LegacyBackend { let retry_sub = retry_stream(move || { let methods = methods.clone(); + let hasher = hasher.clone(); Box::pin(async move { let sub = methods.chain_subscribe_new_heads().await?; let sub = sub.map_err(|e| e.into()).map(move |r| { r.map(|h| { - let hash = h.hash_with(hasher); + let hash = hasher.hash(&h.encode()); (h, BlockRef::from_hash(hash)) }) }); @@ -326,6 +277,7 @@ impl Backend for LegacyBackend { let retry_sub = retry_stream(move || { let this = this.clone(); + let hasher = hasher.clone(); Box::pin(async move { let sub = this.methods.chain_subscribe_finalized_heads().await?; @@ -334,7 +286,7 @@ impl Backend for LegacyBackend { let last_finalized_block_num = this .block_header(last_finalized_block_ref.hash()) .await? - .map(|h| h.number().into()); + .map(|h| h.number()); // Fill in any missing blocks, because the backend may not emit every finalized block; just the latest ones which // are finalized each time. @@ -345,7 +297,7 @@ impl Backend for LegacyBackend { ); let sub = sub.map(move |r| { r.map(|h| { - let hash = h.hash_with(hasher); + let hash = hasher.hash(&h.encode()); (h, BlockRef::from_hash(hash)) }) }); @@ -439,7 +391,7 @@ impl Backend for LegacyBackend { /// without notice in a patch release. #[doc(hidden)] pub fn subscribe_to_block_headers_filling_in_gaps( - methods: LegacyRpcMethods, + methods: LegacyRpcMethods>, sub: S, mut last_block_num: Option, ) -> impl Stream> + Send @@ -456,7 +408,7 @@ where }; // We want all previous details up to, but not including this current block num. - let end_block_num = header.number().into(); + let end_block_num = header.number(); // This is one after the last block we returned details for last time. let start_block_num = last_block_num.map(|n| n + 1).unwrap_or(end_block_num); @@ -482,181 +434,3 @@ where Either::Right(previous_headers.chain(stream::once(async { Ok(header) }))) }) } - -/// This provides a stream of values given some prefix `key`. It -/// internally manages pagination and such. -#[allow(clippy::type_complexity)] -pub struct StorageFetchDescendantKeysStream { - methods: LegacyRpcMethods, - key: Vec, - at: HashFor, - // How many entries to ask for each time. - storage_page_size: u32, - // What key do we start paginating from? None = from the beginning. - pagination_start_key: Option>, - // Keys, future and cached: - keys_fut: - Option>, BackendError>> + Send + 'static>>>, - // Set to true when we're done: - done: bool, -} - -impl std::marker::Unpin for StorageFetchDescendantKeysStream {} - -impl Stream for StorageFetchDescendantKeysStream { - type Item = Result>, BackendError>; - fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - let mut this = self.as_mut(); - loop { - // We're already done. - if this.done { - return Poll::Ready(None); - } - - // Poll future to fetch next keys. - if let Some(mut keys_fut) = this.keys_fut.take() { - let Poll::Ready(keys) = keys_fut.poll_unpin(cx) else { - this.keys_fut = Some(keys_fut); - return Poll::Pending; - }; - - match keys { - Ok(mut keys) => { - if this.pagination_start_key.is_some() - && keys.first() == this.pagination_start_key.as_ref() - { - // Currently, Smoldot returns the "start key" as the first key in the input - // (see https://github.com/smol-dot/smoldot/issues/1692), whereas Substrate doesn't. - // We don't expect the start key to be returned either (since it was the last key of prev - // iteration), so remove it if we see it. This `remove()` method isn't very efficient but - // this will be a non issue with the RPC V2 APIs or if Smoldot aligns with Substrate anyway. - keys.remove(0); - } - if keys.is_empty() { - // No keys left; we're done! - this.done = true; - return Poll::Ready(None); - } - // The last key is where we want to paginate from next time. - this.pagination_start_key = keys.last().cloned(); - // return all of the keys from this run. - return Poll::Ready(Some(Ok(keys))); - } - Err(e) => { - if e.is_disconnected_will_reconnect() { - this.keys_fut = Some(keys_fut); - continue; - } - - // Error getting keys? Return it. - return Poll::Ready(Some(Err(e))); - } - } - } - - // Else, we don't have a fut to get keys yet so start one going. - let methods = this.methods.clone(); - let key = this.key.clone(); - let at = this.at; - let storage_page_size = this.storage_page_size; - let pagination_start_key = this.pagination_start_key.clone(); - let keys_fut = async move { - let keys = methods - .state_get_keys_paged( - &key, - storage_page_size, - pagination_start_key.as_deref(), - Some(at), - ) - .await?; - Ok(keys) - }; - this.keys_fut = Some(Box::pin(keys_fut)); - } - } -} - -/// This provides a stream of values given some stream of keys. -#[allow(clippy::type_complexity)] -pub struct StorageFetchDescendantValuesStream { - // Stream of keys. - keys: StorageFetchDescendantKeysStream, - // Then we track the future to get the values back for each key: - results_fut: Option< - Pin< - Box< - dyn Future, Vec)>>, BackendError>> - + Send - + 'static, - >, - >, - >, - // And finally we return each result back one at a time: - results: VecDeque<(Vec, Vec)>, -} - -impl Stream for StorageFetchDescendantValuesStream { - type Item = Result; - fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - let mut this = self.as_mut(); - loop { - // If we have results back, return them one by one - if let Some((key, value)) = this.results.pop_front() { - let res = StorageResponse { key, value }; - return Poll::Ready(Some(Ok(res))); - } - - // If we're waiting on the next results then poll that future: - if let Some(mut results_fut) = this.results_fut.take() { - match results_fut.poll_unpin(cx) { - Poll::Ready(Ok(Some(results))) => { - this.results = results; - continue; - } - Poll::Ready(Ok(None)) => { - // No values back for some keys? Skip. - continue; - } - Poll::Ready(Err(e)) => return Poll::Ready(Some(Err(e))), - Poll::Pending => { - this.results_fut = Some(results_fut); - return Poll::Pending; - } - } - } - - match this.keys.poll_next_unpin(cx) { - Poll::Ready(Some(Ok(keys))) => { - let methods = this.keys.methods.clone(); - let at = this.keys.at; - let results_fut = async move { - let keys = keys.iter().map(|k| &**k); - let values = retry(|| async { - let res = methods - .state_query_storage_at(keys.clone(), Some(at)) - .await?; - Ok(res) - }) - .await?; - let values: VecDeque<_> = values - .into_iter() - .flat_map(|v| { - v.changes.into_iter().filter_map(|(k, v)| { - let v = v?; - Some((k.0, v.0)) - }) - }) - .collect(); - Ok(Some(values)) - }; - - this.results_fut = Some(Box::pin(results_fut)); - continue; - } - Poll::Ready(Some(Err(e))) => return Poll::Ready(Some(Err(e))), - Poll::Ready(None) => return Poll::Ready(None), - Poll::Pending => return Poll::Pending, - } - } - } -} diff --git a/subxt/src/backend/legacy/descendant_streams.rs b/subxt/src/backend/legacy/descendant_streams.rs new file mode 100644 index 00000000000..5c96159e0c5 --- /dev/null +++ b/subxt/src/backend/legacy/descendant_streams.rs @@ -0,0 +1,256 @@ +use super::LegacyRpcMethods; +use crate::backend::StorageResponse; +use crate::backend::utils::retry; +use crate::config::{Config, HashFor, RpcConfigFor}; +use crate::error::BackendError; +use futures::{Future, FutureExt, Stream, StreamExt}; +use std::collections::VecDeque; +use std::pin::Pin; +use std::task::{Context, Poll}; + +/// This provides a stream of values given some prefix `key`. It +/// internally manages pagination and such. +#[allow(clippy::type_complexity)] +pub struct StorageFetchDescendantKeysStream { + methods: LegacyRpcMethods>, + key: Vec, + at: HashFor, + // How many entries to ask for each time. + storage_page_size: u32, + // What key do we start paginating from? None = from the beginning. + pagination_start_key: Option>, + // Keys, future and cached: + keys_fut: + Option>, BackendError>> + Send + 'static>>>, + // Set to true when we're done: + done: bool, +} + +impl StorageFetchDescendantKeysStream { + /// Fetch descendant keys. + pub fn new( + methods: LegacyRpcMethods>, + key: Vec, + at: HashFor, + storage_page_size: u32, + ) -> Self { + StorageFetchDescendantKeysStream { + methods, + key, + at, + storage_page_size, + pagination_start_key: None, + keys_fut: None, + done: false, + } + } +} + +impl std::marker::Unpin for StorageFetchDescendantKeysStream {} + +impl Stream for StorageFetchDescendantKeysStream { + type Item = Result>, BackendError>; + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + let mut this = self.as_mut(); + loop { + // We're already done. + if this.done { + return Poll::Ready(None); + } + + // Poll future to fetch next keys. + if let Some(mut keys_fut) = this.keys_fut.take() { + match keys_fut.poll_unpin(cx) { + Poll::Ready(Ok(mut keys)) => { + if this.pagination_start_key.is_some() + && keys.first() == this.pagination_start_key.as_ref() + { + // Currently, Smoldot returns the "start key" as the first key in the input + // (see https://github.com/smol-dot/smoldot/issues/1692), whereas Substrate doesn't. + // We don't expect the start key to be returned either (since it was the last key of prev + // iteration), so remove it if we see it. This `remove()` method isn't very efficient but + // this will be a non issue with the RPC V2 APIs or if Smoldot aligns with Substrate anyway. + keys.remove(0); + } + if keys.is_empty() { + // No keys left; we're done! + this.done = true; + return Poll::Ready(None); + } + // The last key is where we want to paginate from next time. + this.pagination_start_key = keys.last().cloned(); + // return all of the keys from this run. + return Poll::Ready(Some(Ok(keys))); + } + Poll::Ready(Err(e)) => { + if e.is_disconnected_will_reconnect() { + // Loop around and try again. No more keys_fut as it was taken, + // so we'll ask for the keys again from the last good pagination_start_key. + continue; + } + + // Error getting keys? Return it. + return Poll::Ready(Some(Err(e))); + } + Poll::Pending => { + this.keys_fut = Some(keys_fut); + return Poll::Pending; + } + } + } + + // Else, we don't have a fut to get keys yet so start one going. + let methods = this.methods.clone(); + let key = this.key.clone(); + let at = this.at; + let storage_page_size = this.storage_page_size; + let pagination_start_key = this.pagination_start_key.clone(); + let keys_fut = async move { + let keys = methods + .state_get_keys_paged( + &key, + storage_page_size, + pagination_start_key.as_deref(), + Some(at), + ) + .await?; + Ok(keys) + }; + this.keys_fut = Some(Box::pin(keys_fut)); + } + } +} + +/// This provides a stream of values given some stream of keys. +#[allow(clippy::type_complexity)] +pub struct StorageFetchDescendantValuesStream { + // Stream of keys. + keys_stream: StorageFetchDescendantKeysStream, + // Keys back from the stream which we are currently trying to fetch results for: + keys: Vec>, + // A future which will resolve to the resulting values: + results_fut: Option< + Pin< + Box< + dyn Future, Vec)>>, BackendError>> + + Send + + 'static, + >, + >, + >, + // Once we get values back we put them here and hand them back one by one to the caller. + results: VecDeque<(Vec, Vec)>, +} + +impl StorageFetchDescendantValuesStream { + /// Fetch descendant values. + pub fn new( + methods: LegacyRpcMethods>, + key: Vec, + at: HashFor, + storage_page_size: u32, + ) -> Self { + StorageFetchDescendantValuesStream { + keys_stream: StorageFetchDescendantKeysStream { + methods, + key, + at, + storage_page_size, + pagination_start_key: None, + keys_fut: None, + done: false, + }, + keys: Default::default(), + results_fut: None, + results: Default::default(), + } + } +} + +impl Stream for StorageFetchDescendantValuesStream { + type Item = Result; + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + let mut this = self.as_mut(); + + loop { + // If we have results back, return them one by one + if let Some((key, value)) = this.results.pop_front() { + let res = StorageResponse { key, value }; + return Poll::Ready(Some(Ok(res))); + } + + // If we're waiting on the next results then poll that future: + if let Some(mut results_fut) = this.results_fut.take() { + match results_fut.poll_unpin(cx) { + Poll::Ready(Ok(Some(results))) => { + // Clear keys once result comes back. + this.keys = Vec::new(); + this.results = results; + continue; + } + Poll::Ready(Ok(None)) => { + // Clear keys once result comes back. + this.keys = Vec::new(); + // But no results back for these keys we we just skip them. + continue; + } + Poll::Ready(Err(e)) => { + if e.is_disconnected_will_reconnect() { + // Don't replace the `results_fut` since we got disconnected, and loop around. + // This will cause us to try re-fetching results for the current keys. + continue; + } + + return Poll::Ready(Some(Err(e))); + } + Poll::Pending => { + this.results_fut = Some(results_fut); + return Poll::Pending; + } + } + } + + // If we have keys ready to fetch results for, then line up a results future to get them. + // The keys stream handles disconnections internally for us. + if !this.keys.is_empty() { + let methods = this.keys_stream.methods.clone(); + let at = this.keys_stream.at; + let keys = this.keys.clone(); + let results_fut = async move { + let keys = keys.iter().map(|k| &**k); + let values = retry(|| async { + let res = methods + .state_query_storage_at(keys.clone(), Some(at)) + .await?; + Ok(res) + }) + .await?; + let values: VecDeque<_> = values + .into_iter() + .flat_map(|v| { + v.changes.into_iter().filter_map(|(k, v)| { + let v = v?; + Some((k.0, v.0)) + }) + }) + .collect(); + Ok(Some(values)) + }; + + this.results_fut = Some(Box::pin(results_fut)); + continue; + } + + // We have no keys yet so wait for those first. + match this.keys_stream.poll_next_unpin(cx) { + Poll::Ready(Some(Ok(keys))) => { + this.keys = keys; + continue; + } + Poll::Ready(Some(Err(e))) => return Poll::Ready(Some(Err(e))), + Poll::Ready(None) => return Poll::Ready(None), + Poll::Pending => return Poll::Pending, + } + } + } +} diff --git a/subxt/src/backend/mod.rs b/subxt/src/backend/mod.rs deleted file mode 100644 index 95395a2a297..00000000000 --- a/subxt/src/backend/mod.rs +++ /dev/null @@ -1,1072 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! This module exposes a backend trait for Subxt which allows us to get and set -//! the necessary information (probably from a JSON-RPC API, but that's up to the -//! implementation). - -pub mod chain_head; -pub mod legacy; -pub mod utils; - -use crate::config::{Config, HashFor}; -use crate::error::BackendError; -use async_trait::async_trait; -use codec::{Decode, Encode}; -use futures::{Stream, StreamExt}; -use std::pin::Pin; -use std::sync::Arc; -use subxt_core::client::RuntimeVersion; -use subxt_metadata::Metadata; - -/// Some re-exports from the [`subxt_rpcs`] crate, also accessible in full via [`crate::ext::subxt_rpcs`]. -pub mod rpc { - pub use subxt_rpcs::client::{RawRpcFuture, RawRpcSubscription, RawValue, RpcParams}; - pub use subxt_rpcs::{RpcClient, RpcClientT, rpc_params}; - - crate::macros::cfg_reconnecting_rpc_client! { - /// An RPC client that automatically reconnects. - /// - /// # Example - /// - /// ```rust,no_run,standalone_crate - /// use std::time::Duration; - /// use futures::StreamExt; - /// use subxt::backend::rpc::reconnecting_rpc_client::{RpcClient, ExponentialBackoff}; - /// use subxt::{OnlineClient, PolkadotConfig}; - /// - /// #[tokio::main] - /// async fn main() { - /// let rpc = RpcClient::builder() - /// .retry_policy(ExponentialBackoff::from_millis(100).max_delay(Duration::from_secs(10))) - /// .build("ws://localhost:9944".to_string()) - /// .await - /// .unwrap(); - /// - /// let subxt_client: OnlineClient = OnlineClient::from_rpc_client(rpc.clone()).await.unwrap(); - /// let mut blocks_sub = subxt_client.blocks().subscribe_finalized().await.unwrap(); - /// - /// while let Some(block) = blocks_sub.next().await { - /// let block = match block { - /// Ok(b) => b, - /// Err(e) => { - /// if e.is_disconnected_will_reconnect() { - /// println!("The RPC connection was lost and we may have missed a few blocks"); - /// continue; - /// } else { - /// panic!("Error: {}", e); - /// } - /// } - /// }; - /// println!("Block #{} ({})", block.number(), block.hash()); - /// } - /// } - /// ``` - pub use subxt_rpcs::client::reconnecting_rpc_client; - } -} - -/// Prevent the backend trait being implemented externally. -#[doc(hidden)] -pub(crate) mod sealed { - pub trait Sealed {} -} - -/// This trait exposes the interface that Subxt will use to communicate with -/// a backend. Its goal is to be as minimal as possible. -#[async_trait] -pub trait Backend: sealed::Sealed + Send + Sync + 'static { - /// Fetch values from storage. - async fn storage_fetch_values( - &self, - keys: Vec>, - at: HashFor, - ) -> Result, BackendError>; - - /// Fetch keys underneath the given key from storage. - async fn storage_fetch_descendant_keys( - &self, - key: Vec, - at: HashFor, - ) -> Result>, BackendError>; - - /// Fetch values underneath the given key from storage. - async fn storage_fetch_descendant_values( - &self, - key: Vec, - at: HashFor, - ) -> Result, BackendError>; - - /// Fetch the genesis hash - async fn genesis_hash(&self) -> Result, BackendError>; - - /// Get a block header - async fn block_header(&self, at: HashFor) -> Result, BackendError>; - - /// Return the extrinsics found in the block. Each extrinsic is represented - /// by a vector of bytes which has _not_ been SCALE decoded (in other words, the - /// first bytes in the vector will decode to the compact encoded length of the extrinsic) - async fn block_body(&self, at: HashFor) -> Result>>, BackendError>; - - /// Get the most recent finalized block hash. - /// Note: needed only in blocks client for finalized block stream; can prolly be removed. - async fn latest_finalized_block_ref(&self) -> Result>, BackendError>; - - /// Get information about the current runtime. - async fn current_runtime_version(&self) -> Result; - - /// A stream of all new runtime versions as they occur. - async fn stream_runtime_version(&self) - -> Result, BackendError>; - - /// A stream of all new block headers as they arrive. - async fn stream_all_block_headers( - &self, - hasher: T::Hasher, - ) -> Result>)>, BackendError>; - - /// A stream of best block headers. - async fn stream_best_block_headers( - &self, - hasher: T::Hasher, - ) -> Result>)>, BackendError>; - - /// A stream of finalized block headers. - async fn stream_finalized_block_headers( - &self, - hasher: T::Hasher, - ) -> Result>)>, BackendError>; - - /// Submit a transaction. This will return a stream of events about it. - async fn submit_transaction( - &self, - bytes: &[u8], - ) -> Result>>, BackendError>; - - /// Make a call to some runtime API. - async fn call( - &self, - method: &str, - call_parameters: Option<&[u8]>, - at: HashFor, - ) -> Result, BackendError>; -} - -/// helpful utility methods derived from those provided on [`Backend`] -#[async_trait] -pub trait BackendExt: Backend { - /// Fetch a single value from storage. - async fn storage_fetch_value( - &self, - key: Vec, - at: HashFor, - ) -> Result>, BackendError> { - self.storage_fetch_values(vec![key], at) - .await? - .next() - .await - .transpose() - .map(|o| o.map(|s| s.value)) - } - - /// The same as a [`Backend::call()`], but it will also attempt to decode the - /// result into the given type, which is a fairly common operation. - async fn call_decoding( - &self, - method: &str, - call_parameters: Option<&[u8]>, - at: HashFor, - ) -> Result { - let bytes = self.call(method, call_parameters, at).await?; - let res = - D::decode(&mut &*bytes).map_err(BackendError::CouldNotScaleDecodeRuntimeResponse)?; - Ok(res) - } - - /// Return the metadata at some version. - async fn metadata_at_version( - &self, - version: u32, - at: HashFor, - ) -> Result { - let param = version.encode(); - - let opaque: Option = self - .call_decoding("Metadata_metadata_at_version", Some(¶m), at) - .await?; - let Some(opaque) = opaque else { - return Err(BackendError::MetadataVersionNotFound(version)); - }; - - let metadata: Metadata = - Decode::decode(&mut &opaque.0[..]).map_err(BackendError::CouldNotDecodeMetadata)?; - Ok(metadata) - } - - /// Return V14 metadata from the legacy `Metadata_metadata` call. - async fn legacy_metadata(&self, at: HashFor) -> Result { - let opaque: frame_metadata::OpaqueMetadata = - self.call_decoding("Metadata_metadata", None, at).await?; - let metadata: Metadata = - Decode::decode(&mut &opaque.0[..]).map_err(BackendError::CouldNotDecodeMetadata)?; - Ok(metadata) - } -} - -#[async_trait] -impl + ?Sized, T: Config> BackendExt for B {} - -/// An opaque struct which, while alive, indicates that some references to a block -/// still exist. This gives the backend the opportunity to keep the corresponding block -/// details around for a while if it likes and is able to. No guarantees can be made about -/// how long the corresponding details might be available for, but if no references to a block -/// exist, then the backend is free to discard any details for it. -#[derive(Clone)] -pub struct BlockRef { - hash: H, - // We keep this around so that when it is dropped, it has the - // opportunity to tell the backend. - _pointer: Option>, -} - -impl From for BlockRef { - fn from(value: H) -> Self { - BlockRef::from_hash(value) - } -} - -impl PartialEq for BlockRef { - fn eq(&self, other: &Self) -> bool { - self.hash == other.hash - } -} -impl Eq for BlockRef {} - -// Manual implementation to work around https://github.com/mcarton/rust-derivative/issues/115. -impl PartialOrd for BlockRef { - fn partial_cmp(&self, other: &Self) -> Option { - self.hash.partial_cmp(&other.hash) - } -} - -impl Ord for BlockRef { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.hash.cmp(&other.hash) - } -} - -impl std::fmt::Debug for BlockRef { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_tuple("BlockRef").field(&self.hash).finish() - } -} - -impl std::hash::Hash for BlockRef { - fn hash(&self, state: &mut Hasher) { - self.hash.hash(state); - } -} - -impl BlockRef { - /// A [`BlockRef`] that doesn't reference a given block, but does have an associated hash. - /// This is used in the legacy backend, which has no notion of pinning blocks. - pub fn from_hash(hash: H) -> Self { - Self { - hash, - _pointer: None, - } - } - /// Construct a [`BlockRef`] from an instance of the underlying trait. It's expected - /// that the [`Backend`] implementation will call this if it wants to track which blocks - /// are potentially in use. - pub fn new(hash: H, inner: P) -> Self { - Self { - hash, - _pointer: Some(Arc::new(inner)), - } - } - - /// Return the hash of the referenced block. - pub fn hash(&self) -> H - where - H: Copy, - { - self.hash - } -} - -/// A trait that a [`Backend`] can implement to know when some block -/// can be unpinned: when this is dropped, there are no remaining references -/// to the block that it's associated with. -pub trait BlockRefT: Send + Sync + 'static {} - -/// A stream of some item. -pub struct StreamOf(Pin + Send + 'static>>); - -impl Stream for StreamOf { - type Item = T; - fn poll_next( - mut self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - self.0.poll_next_unpin(cx) - } -} - -impl std::fmt::Debug for StreamOf { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_tuple("StreamOf").field(&"").finish() - } -} - -impl StreamOf { - /// Construct a new stream. - pub fn new(inner: Pin + Send + 'static>>) -> Self { - StreamOf(inner) - } - - /// Returns the next item in the stream. This is just a wrapper around - /// [`StreamExt::next()`] so that you can avoid the extra import. - pub async fn next(&mut self) -> Option { - StreamExt::next(self).await - } -} - -/// A stream of [`Result`]. -pub type StreamOfResults = StreamOf>; - -/// The status of the transaction. -/// -/// If the status is [`TransactionStatus::InFinalizedBlock`], [`TransactionStatus::Error`], -/// [`TransactionStatus::Invalid`] or [`TransactionStatus::Dropped`], then no future -/// events will be emitted. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum TransactionStatus { - /// Transaction is part of the future queue. - Validated, - /// The transaction has been broadcast to other nodes. - Broadcasted, - /// Transaction is no longer in a best block. - NoLongerInBestBlock, - /// Transaction has been included in block with given hash. - InBestBlock { - /// Block hash the transaction is in. - hash: BlockRef, - }, - /// Transaction has been finalized by a finality-gadget, e.g GRANDPA - InFinalizedBlock { - /// Block hash the transaction is in. - hash: BlockRef, - }, - /// Something went wrong in the node. - Error { - /// Human readable message; what went wrong. - message: String, - }, - /// Transaction is invalid (bad nonce, signature etc). - Invalid { - /// Human readable message; why was it invalid. - message: String, - }, - /// The transaction was dropped. - Dropped { - /// Human readable message; why was it dropped. - message: String, - }, -} - -/// A response from calls like [`Backend::storage_fetch_values`] or -/// [`Backend::storage_fetch_descendant_values`]. -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, Debug)] -pub struct StorageResponse { - /// The key. - pub key: Vec, - /// The associated value. - pub value: Vec, -} - -#[cfg(test)] -mod test { - use super::*; - use crate::backend::StorageResponse; - use core::convert::Infallible; - use futures::StreamExt; - use primitive_types::H256; - use rpc::RpcClientT; - use std::collections::{HashMap, VecDeque}; - use subxt_core::{Config, config::DefaultExtrinsicParams}; - use subxt_rpcs::client::{ - MockRpcClient, - mock_rpc_client::{Json, MockRpcClientBuilder}, - }; - - fn random_hash() -> H256 { - H256::random() - } - - fn disconnected_will_reconnect() -> subxt_rpcs::Error { - subxt_rpcs::Error::DisconnectedWillReconnect("..".into()) - } - - fn storage_response>, V: Into>>(key: K, value: V) -> StorageResponse - where - Vec: From, - { - StorageResponse { - key: key.into(), - value: value.into(), - } - } - - // Define dummy config - enum Conf {} - impl Config for Conf { - type AccountId = crate::utils::AccountId32; - type Address = crate::utils::MultiAddress; - type Signature = crate::utils::MultiSignature; - type Hasher = crate::config::substrate::BlakeTwo256; - type Header = crate::config::substrate::SubstrateHeader; - type ExtrinsicParams = DefaultExtrinsicParams; - type AssetId = u32; - } - - mod legacy { - use super::*; - use crate::{ - backend::legacy::{LegacyBackend, rpc_methods::RuntimeVersion}, - error::RpcError, - }; - - use crate::backend::Backend; - - fn client_runtime_version(num: u32) -> crate::client::RuntimeVersion { - crate::client::RuntimeVersion { - spec_version: num, - transaction_version: num, - } - } - - fn runtime_version(num: u32) -> RuntimeVersion { - RuntimeVersion { - spec_version: num, - transaction_version: num, - other: HashMap::new(), - } - } - - #[tokio::test] - async fn storage_fetch_values() { - // Map from storage key to responses, given out in order, when that key is requested. - let mut values: HashMap<&str, VecDeque<_>> = HashMap::from_iter([ - ( - "ID1", - VecDeque::from_iter([ - Err(disconnected_will_reconnect()), - Ok(Json(hex::encode("Data1"))), - ]), - ), - ( - "ID2", - VecDeque::from_iter([ - Err(disconnected_will_reconnect()), - Ok(Json(hex::encode("Data2"))), - ]), - ), - ("ID3", VecDeque::from_iter([Ok(Json(hex::encode("Data3")))])), - ]); - - let rpc_client = MockRpcClient::builder() - .method_handler("state_getStorage", move |params| { - // Decode the storage key as first item from sequence of params: - let params = params.map(|p| p.get().to_string()); - let rpc_params = jsonrpsee::types::Params::new(params.as_deref()); - let key: sp_core::Bytes = rpc_params.sequence().next().unwrap(); - let key = std::str::from_utf8(&key.0).unwrap(); - // Fetch the response to use from our map, popping it from the front. - let values = values.get_mut(key).unwrap(); - let value = values.pop_front().unwrap(); - async move { value } - }) - .build(); - - // Test - let backend: LegacyBackend = LegacyBackend::builder().build(rpc_client); - - let response = backend - .storage_fetch_values( - ["ID1".into(), "ID2".into(), "ID3".into()].into(), - random_hash(), - ) - .await - .unwrap(); - - let response = response - .map(|x| x.unwrap()) - .collect::>() - .await; - - let expected = vec![ - storage_response("ID1", "Data1"), - storage_response("ID2", "Data2"), - storage_response("ID3", "Data3"), - ]; - - assert_eq!(expected, response) - } - - #[tokio::test] - async fn storage_fetch_value() { - let rpc_client = MockRpcClient::builder() - .method_handler_once("state_getStorage", async move |_params| { - // Return "disconnected" error on first call - Err::(disconnected_will_reconnect()) - }) - .method_handler_once("state_getStorage", async move |_param| { - // Return some hex encoded storage value on the next one - Json(hex::encode("Data1")) - }) - .build(); - - // Test - let backend: LegacyBackend = LegacyBackend::builder().build(rpc_client); - let response = backend - .storage_fetch_value("ID1".into(), random_hash()) - .await - .unwrap(); - - let response = response.unwrap(); - assert_eq!("Data1".to_owned(), String::from_utf8(response).unwrap()) - } - - /// This test should cover the logic of the following methods: - /// - `genesis_hash` - /// - `block_header` - /// - `block_body` - /// - `latest_finalized_block` - /// - `current_runtime_version` - /// - `current_runtime_version` - /// - `call` - /// The test covers them because they follow the simple pattern of: - /// ```rust,no_run,standalone_crate - /// async fn THE_THING(&self) -> Result, BackendError> { - /// retry(|| ).await - /// } - /// ``` - #[tokio::test] - async fn simple_fetch() { - let hash = random_hash(); - let rpc_client = MockRpcClient::builder() - .method_handler_once("chain_getBlockHash", async move |_params| { - // Return "disconnected" error on first call - Err::(disconnected_will_reconnect()) - }) - .method_handler_once("chain_getBlockHash", async move |_params| { - // Return the blockhash on next call - Json(hash) - }) - .build(); - - // Test - let backend: LegacyBackend = LegacyBackend::builder().build(rpc_client); - let response = backend.genesis_hash().await.unwrap(); - - assert_eq!(hash, response) - } - - /// This test should cover the logic of the following methods: - /// - `stream_runtime_version` - /// - `stream_all_block_headers` - /// - `stream_best_block_headers` - /// The test covers them because they follow the simple pattern of: - /// ```rust,no_run,standalone_crate - /// async fn stream_the_thing( - /// &self, - /// ) -> Result>)>, BackendError> { - /// let methods = self.methods.clone(); - /// let retry_sub = retry_stream(move || { - /// let methods = methods.clone(); - /// Box::pin(async move { - /// methods.do_the_thing().await? - /// }); - /// Ok(StreamOf(Box::pin(sub))) - /// }) - /// }) - /// .await?; - /// Ok(retry_sub) - /// } - /// ``` - #[tokio::test] - async fn stream_simple() { - // Each time the subscription is called, it will pop the first set - // of values from this and return them one after the other. - let mut data = VecDeque::from_iter([ - vec![ - Ok(Json(runtime_version(0))), - Err(disconnected_will_reconnect()), - Ok(Json(runtime_version(1))), - ], - vec![ - Err(disconnected_will_reconnect()), - Ok(Json(runtime_version(2))), - Ok(Json(runtime_version(3))), - ], - vec![ - Ok(Json(runtime_version(4))), - Ok(Json(runtime_version(5))), - Err(subxt_rpcs::Error::Client("..".into())), - ], - ]); - - let rpc_client = MockRpcClient::builder() - .subscription_handler("state_subscribeRuntimeVersion", move |_params, _unsub| { - let res = data.pop_front().unwrap(); - async move { res } - }) - .build(); - - // Test - let backend: LegacyBackend = LegacyBackend::builder().build(rpc_client); - let mut results = backend.stream_runtime_version().await.unwrap(); - - assert_eq!( - results.next().await.unwrap().unwrap(), - client_runtime_version(0) - ); - assert_eq!( - results.next().await.unwrap().unwrap(), - client_runtime_version(4) - ); - assert_eq!( - results.next().await.unwrap().unwrap(), - client_runtime_version(5) - ); - assert!(matches!( - results.next().await.unwrap(), - Err(BackendError::Rpc(RpcError::ClientError( - subxt_rpcs::Error::Client(_) - ))) - )); - assert!(results.next().await.is_none()); - } - } - - mod unstable_backend { - use subxt_rpcs::methods::chain_head::{ - self, Bytes, Initialized, MethodResponse, MethodResponseStarted, OperationError, - OperationId, OperationStorageItems, RuntimeSpec, RuntimeVersionEvent, - }; - use tokio::select; - - use super::chain_head::*; - use super::*; - - fn build_backend( - rpc_client: impl RpcClientT, - ) -> (ChainHeadBackend, ChainHeadBackendDriver) { - let (backend, driver): (ChainHeadBackend, _) = - ChainHeadBackend::builder().build(rpc_client); - (backend, driver) - } - - fn build_backend_spawn_background(rpc_client: impl RpcClientT) -> ChainHeadBackend { - ChainHeadBackend::builder().build_with_background_driver(rpc_client) - } - - fn runtime_spec() -> RuntimeSpec { - let spec = serde_json::json!({ - "specName": "westend", - "implName": "parity-westend", - "specVersion": 9122, - "implVersion": 0, - "transactionVersion": 7, - "apis": { - "0xdf6acb689907609b": 3, - "0x37e397fc7c91f5e4": 1, - "0x40fe3ad401f8959a": 5, - "0xd2bc9897eed08f15": 3, - "0xf78b278be53f454c": 2, - "0xaf2c0297a23e6d3d": 1, - "0x49eaaf1b548a0cb0": 1, - "0x91d5df18b0d2cf58": 1, - "0xed99c5acb25eedf5": 3, - "0xcbca25e39f142387": 2, - "0x687ad44ad37f03c2": 1, - "0xab3c0572291feb8b": 1, - "0xbc9d89904f5b923f": 1, - "0x37c8bb1350a9a2a8": 1 - } - }); - serde_json::from_value(spec).expect("Mock runtime spec should be the right shape") - } - - type FollowEvent = chain_head::FollowEvent>; - - /// Build a mock client which can handle `chainHead_v1_follow` subscriptions. - /// Messages from the provided receiver are sent to the latest active subscription. - fn mock_client_builder( - recv: tokio::sync::mpsc::UnboundedReceiver, - ) -> MockRpcClientBuilder { - mock_client_builder_with_ids(recv, 0..) - } - - fn mock_client_builder_with_ids( - recv: tokio::sync::mpsc::UnboundedReceiver, - ids: I, - ) -> MockRpcClientBuilder - where - I: IntoIterator + Send, - I::IntoIter: Send + Sync + 'static, - { - use subxt_rpcs::client::mock_rpc_client::AndThen; - use subxt_rpcs::{Error, UserError}; - - let recv = Arc::new(tokio::sync::Mutex::new(recv)); - let mut ids = ids.into_iter(); - - MockRpcClient::builder().subscription_handler( - "chainHead_v1_follow", - move |_params, _unsub| { - let recv = recv.clone(); - let id = ids.next(); - - // For each new follow subscription, we take messages from `recv` and pipe them to the output - // for the subscription (after an Initialized event). if the output is dropped/closed, we stop pulling - // messages from `recv`, waiting for a new chainHEad_v1_follow subscription. - let (tx, rx) = tokio::sync::mpsc::unbounded_channel(); - tokio::spawn(async move { - let mut recv_guard = recv.lock().await; - loop { - select! { - // Channel closed, so stop pulling from `recv`. - _ = tx.closed() => { - break - }, - // Relay messages from `recv` unless some error sending. - Some(msg) = recv_guard.recv() => { - if tx.send(Json(msg)).is_err() { - break - } - } - } - } - }); - - async move { - if let Some(id) = id { - let follow_event = - FollowEvent::Initialized(Initialized::> { - finalized_block_hashes: vec![random_hash()], - finalized_block_runtime: Some(chain_head::RuntimeEvent::Valid( - RuntimeVersionEvent { - spec: runtime_spec(), - }, - )), - }); - - let res = AndThen( - // First send an initialized event with new ID - (vec![Json(follow_event)], subscription_id(id)), - // Next, send any events provided via the recv channel - rx, - ); - - Ok(res) - } else { - // Ran out of subscription IDs; return an error. - Err(Error::User(UserError::method_not_found())) - } - } - }, - ) - } - - fn subscription_id(id: usize) -> String { - format!("chainHeadFollowSubscriptionId{id}") - } - - fn response_started(id: &str) -> MethodResponse { - MethodResponse::Started(MethodResponseStarted { - operation_id: id.to_owned(), - discarded_items: None, - }) - } - - fn operation_error(id: &str) -> FollowEvent { - FollowEvent::OperationError(OperationError { - operation_id: id.to_owned(), - error: "error".to_owned(), - }) - } - - fn limit_reached() -> MethodResponse { - MethodResponse::LimitReached - } - - fn storage_done(id: &str) -> FollowEvent { - FollowEvent::OperationStorageDone(OperationId { - operation_id: id.to_owned(), - }) - } - fn storage_result(key: &str, value: &str) -> chain_head::StorageResult { - chain_head::StorageResult { - key: Bytes(key.to_owned().into()), - result: chain_head::StorageResultType::Value(Bytes(value.to_owned().into())), - } - } - fn storage_items(id: &str, items: &[chain_head::StorageResult]) -> FollowEvent { - FollowEvent::OperationStorageItems(OperationStorageItems { - operation_id: id.to_owned(), - items: VecDeque::from(items.to_owned()), - }) - } - - fn operation_continue(id: &str) -> FollowEvent { - FollowEvent::OperationWaitingForContinue(OperationId { - operation_id: id.to_owned(), - }) - } - - fn follow_event_stop() -> FollowEvent { - FollowEvent::Stop - } - - #[tokio::test] - async fn storage_fetch_values_returns_stream_with_single_error() { - let (tx, rx) = tokio::sync::mpsc::unbounded_channel(); - - let rpc_client = mock_client_builder(rx) - .method_handler_once("chainHead_v1_storage", move |_params| { - tokio::spawn(async move { - // Wait a little and then send an error response on the - // chainHead_follow subscription: - tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; - tx.send(operation_error("Id1")).unwrap(); - }); - - async move { Json(response_started("Id1")) } - }) - .build(); - - let backend = build_backend_spawn_background(rpc_client); - - // Test - // This request should encounter an error. - let mut response = backend - .storage_fetch_values( - ["ID1".into(), "ID2".into(), "ID3".into()].into(), - random_hash(), - ) - .await - .unwrap(); - - assert!( - response - .next() - .await - .unwrap() - .is_err_and(|e| matches!(e, BackendError::Other(e) if e == "error")) - ); - assert!(response.next().await.is_none()); - } - - /// Tests that the method will retry on failed query - #[tokio::test] - async fn storage_fetch_values_retry_query() { - let (tx, rx) = tokio::sync::mpsc::unbounded_channel(); - - let rpc_client = mock_client_builder(rx) - .method_handler_once("chainHead_v1_storage", async move |_params| { - // First call; return DisconnectedWillReconnect - Err::(disconnected_will_reconnect()) - }) - .method_handler_once("chainHead_v1_storage", async move |_params| { - // Otherwise, return that we'll start sending a response, and spawn - // task to send the relevant response via chainHead_follow. - tokio::spawn(async move { - tx.send(storage_items( - "Id1", - &[ - storage_result("ID1", "Data1"), - storage_result("ID2", "Data2"), - storage_result("ID3", "Data3"), - ], - )) - .unwrap(); - - tx.send(storage_done("Id1")).unwrap(); - }); - - Ok(Json(response_started("Id1"))) - }) - .build(); - - // Despite DisconnectedWillReconnect we try again transparently - // and get the data we asked for. - let backend = build_backend_spawn_background(rpc_client); - let response = backend - .storage_fetch_values( - ["ID1".into(), "ID2".into(), "ID3".into()].into(), - random_hash(), - ) - .await - .unwrap(); - - let response = response - .map(|x| x.unwrap()) - .collect::>() - .await; - - assert_eq!( - vec![ - storage_response("ID1", "Data1"), - storage_response("ID2", "Data2"), - storage_response("ID3", "Data3"), - ], - response - ) - } - - #[tokio::test] - async fn storage_fetch_values_retry_chainhead_continue() { - let (tx, rx) = tokio::sync::mpsc::unbounded_channel(); - let tx2 = tx.clone(); - - let rpc_client = mock_client_builder(rx) - .method_handler_once("chainHead_v1_storage", async move |_params| { - // First call; return DisconnectedWillReconnect - Err::(disconnected_will_reconnect()) - }) - .method_handler_once("chainHead_v1_storage", async move |_params| { - // Next call, return a storage item and then a "waiting for continue". - tokio::spawn(async move { - tx.send(storage_items("Id1", &[storage_result("ID1", "Data1")])) - .unwrap(); - tx.send(operation_continue("Id1")).unwrap(); - }); - Ok(Json(response_started("Id1"))) - }) - .method_handler_once("chainHead_v1_continue", async move |_params| { - // First call; return DisconnectedWillReconnect - Err::(disconnected_will_reconnect()) - }) - .method_handler_once("chainHead_v1_continue", async move |_params| { - // Next call; acknowledge the "continue" and return remaining storage items. - tokio::spawn(async move { - tx2.send(storage_items("Id1", &[storage_result("ID2", "Data2")])) - .unwrap(); - tx2.send(storage_items("Id1", &[storage_result("ID3", "Data3")])) - .unwrap(); - tx2.send(storage_done("Id1")).unwrap(); - }); - Ok(Json(())) - }) - .build(); - - let backend = build_backend_spawn_background(rpc_client); - - // We should success, transparently handling `continue`s and `DisconnectWillReconnects`. - let response = backend - .storage_fetch_values( - ["ID1".into(), "ID2".into(), "ID3".into()].into(), - random_hash(), - ) - .await - .unwrap(); - - let response = response - .map(|x| x.unwrap()) - .collect::>() - .await; - - assert_eq!( - vec![ - storage_response("ID1", "Data1"), - storage_response("ID2", "Data2"), - storage_response("ID3", "Data3"), - ], - response - ) - } - - #[tokio::test] - async fn simple_fetch() { - let hash = random_hash(); - let (_tx, rx) = tokio::sync::mpsc::unbounded_channel(); - let rpc_client = mock_client_builder(rx) - .method_handler_once("chainSpec_v1_genesisHash", async move |_params| { - // First call, return disconnected error. - Err::(disconnected_will_reconnect()) - }) - .method_handler_once("chainSpec_v1_genesisHash", async move |_params| { - // Next call, return the hash. - Ok(Json(hash)) - }) - .build(); - - // Test - // This request should encounter an error on `request` and do a retry. - let backend = build_backend_spawn_background(rpc_client); - let response_hash = backend.genesis_hash().await.unwrap(); - - assert_eq!(hash, response_hash) - } - - // Check that the backend will resubscribe on Stop, and handle a change in subscription ID. - // see https://github.com/paritytech/subxt/issues/1567 - #[tokio::test] - async fn stale_subscription_id_failure() { - let (tx, rx) = tokio::sync::mpsc::unbounded_channel(); - let rpc_client = mock_client_builder_with_ids(rx, [1, 2]) - .method_handler("chainHead_v1_storage", move |params| { - // Decode the follow subscription ID which is the first param. - let this_sub_id = { - let params = params.as_ref().map(|p| p.get()); - let rpc_params = jsonrpsee::types::Params::new(params); - rpc_params.sequence().next::().unwrap() - }; - - // While it's equal to `subscription_id(1)`, it means we are seeing the first - // chainHead_follow subscription ID. error until we see an updated ID. - let is_wrong_sub_id = this_sub_id == subscription_id(1); - - async move { - if is_wrong_sub_id { - Json(limit_reached()) - } else { - Json(response_started("some_id")) - } - } - }) - .build(); - - let (backend, mut driver): (ChainHeadBackend, _) = build_backend(rpc_client); - - // Send a "FollowEvent::Stop" via chainhead_follow, and advance the driver just enough - // that this message has been processed. - tx.send(follow_event_stop()).unwrap(); - let _ = driver.next().await.unwrap(); - - // If we make a storage call at this point, we'll still be passing the "old" subscription - // ID, because the driver hasn't advanced enough to start a new chainhead_follow subscription, - // and will therefore fail with a "limit reached" response (to emulate what would happen if - // the chainHead_v1_storage call was made with the wrong subscription ID). - let response = backend - .storage_fetch_values(["ID1".into()].into(), random_hash()) - .await; - assert!(matches!(response, Err(e) if e.is_rpc_limit_reached())); - - // Advance the driver until a new chainHead_follow subscription has been started up. - let _ = driver.next().await.unwrap(); - let _ = driver.next().await.unwrap(); - let _ = driver.next().await.unwrap(); - - // Now, the ChainHeadBackend will use a new subscription ID and work. (If the driver - // advanced in the background automatically, this would happen automatically for us). - let response = backend - .storage_fetch_values(["ID1".into()].into(), random_hash()) - .await; - assert!(response.is_ok()); - } - } -} diff --git a/subxt/src/backend/utils.rs b/subxt/src/backend/utils.rs index 5ead7056f99..d687c734b88 100644 --- a/subxt/src/backend/utils.rs +++ b/subxt/src/backend/utils.rs @@ -1,89 +1,24 @@ -//! RPC utils. +//! Backend utils. use super::{StreamOf, StreamOfResults}; use crate::error::BackendError; -use futures::future::BoxFuture; use futures::{FutureExt, Stream, StreamExt}; use std::{future::Future, pin::Pin, task::Poll}; -/// Resubscribe callback. -type ResubscribeGetter = Box ResubscribeFuture + Send>; - -/// Future that resolves to a subscription stream. -type ResubscribeFuture = - Pin, BackendError>> + Send>>; - -pub(crate) enum PendingOrStream { - Pending(BoxFuture<'static, Result, BackendError>>), - Stream(StreamOfResults), -} - -impl std::fmt::Debug for PendingOrStream { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - PendingOrStream::Pending(_) => write!(f, "Pending"), - PendingOrStream::Stream(_) => write!(f, "Stream"), - } - } -} - -/// Retry subscription. -struct RetrySubscription { - resubscribe: ResubscribeGetter, - state: Option>, -} - -impl std::marker::Unpin for RetrySubscription {} - -impl Stream for RetrySubscription { - type Item = Result; - - fn poll_next( - mut self: Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> Poll> { - loop { - let Some(mut this) = self.state.take() else { - return Poll::Ready(None); - }; - - match this { - PendingOrStream::Stream(ref mut s) => match s.poll_next_unpin(cx) { - Poll::Ready(Some(Err(err))) => { - if err.is_disconnected_will_reconnect() { - self.state = Some(PendingOrStream::Pending((self.resubscribe)())); - } - return Poll::Ready(Some(Err(err))); - } - Poll::Ready(None) => return Poll::Ready(None), - Poll::Ready(Some(Ok(val))) => { - self.state = Some(this); - return Poll::Ready(Some(Ok(val))); - } - Poll::Pending => { - self.state = Some(this); - return Poll::Pending; - } - }, - PendingOrStream::Pending(mut fut) => match fut.poll_unpin(cx) { - Poll::Ready(Ok(stream)) => { - self.state = Some(PendingOrStream::Stream(stream)); - continue; - } - Poll::Ready(Err(err)) => { - if err.is_disconnected_will_reconnect() { - self.state = Some(PendingOrStream::Pending((self.resubscribe)())); - } - return Poll::Ready(Some(Err(err))); - } - Poll::Pending => { - self.state = Some(PendingOrStream::Pending(fut)); - return Poll::Pending; - } - }, - }; - } - } +/// Spawn a task. +/// +/// - On non-wasm targets, this will spawn a task via [`tokio::spawn`]. +/// - On wasm targets, this will spawn a task via [`wasm_bindgen_futures::spawn_local`]. +#[cfg(feature = "runtime")] +pub(crate) fn spawn(future: F) { + #[cfg(not(target_family = "wasm"))] + tokio::spawn(async move { + future.await; + }); + #[cfg(all(target_arch = "wasm32", target_os = "unknown"))] + wasm_bindgen_futures::spawn_local(async move { + future.await; + }); } /// Retry a future until it doesn't return a disconnected error. @@ -164,25 +99,95 @@ where /// }).await; /// } /// ``` -pub async fn retry_stream(sub_stream: F) -> Result, BackendError> +pub async fn retry_stream(get_stream: F) -> Result, BackendError> where - F: FnMut() -> ResubscribeFuture + Send + 'static + Clone, + F: Clone + Send + 'static + FnMut() -> Fut, + Fut: Future, BackendError>> + Send, R: Send + 'static, { - let stream = retry(sub_stream.clone()).await?; - - let resubscribe = Box::new(move || { - let sub_stream = sub_stream.clone(); - async move { retry(sub_stream).await }.boxed() - }); + // This returns the stream. On disconnect this is called again. + let get_stream_with_retry = move || { + let get_stream = get_stream.clone(); + async move { retry(get_stream).await }.boxed() + }; // The extra Box is to encapsulate the retry subscription type Ok(StreamOf::new(Box::pin(RetrySubscription { - state: Some(PendingOrStream::Stream(stream)), - resubscribe, + state: RetrySubscriptionState::Init, + resubscribe: get_stream_with_retry, }))) } +/// Retry subscription. +struct RetrySubscription { + resubscribe: F, + state: RetrySubscriptionState, +} + +enum RetrySubscriptionState { + Init, + Pending(R), + Stream(StreamOfResults), + Done, +} + +impl std::marker::Unpin for RetrySubscription {} + +impl Stream for RetrySubscription +where + F: FnMut() -> R, + R: Future, BackendError>> + Unpin, +{ + type Item = Result; + + fn poll_next( + mut self: Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> Poll> { + loop { + match &mut self.state { + RetrySubscriptionState::Init => { + self.state = RetrySubscriptionState::Pending((self.resubscribe)()); + } + RetrySubscriptionState::Stream(s) => match s.poll_next_unpin(cx) { + Poll::Ready(Some(Err(err))) => { + if err.is_disconnected_will_reconnect() { + self.state = RetrySubscriptionState::Init; + } + return Poll::Ready(Some(Err(err))); + } + Poll::Ready(None) => { + self.state = RetrySubscriptionState::Done; + return Poll::Ready(None); + } + Poll::Ready(Some(Ok(val))) => { + return Poll::Ready(Some(Ok(val))); + } + Poll::Pending => { + return Poll::Pending; + } + }, + RetrySubscriptionState::Pending(fut) => match fut.poll_unpin(cx) { + Poll::Ready(Err(err)) => { + if err.is_disconnected_will_reconnect() { + self.state = RetrySubscriptionState::Init; + } + return Poll::Ready(Some(Err(err))); + } + Poll::Ready(Ok(stream)) => { + self.state = RetrySubscriptionState::Stream(stream); + continue; + } + Poll::Pending => { + return Poll::Pending; + } + }, + RetrySubscriptionState::Done => return Poll::Ready(None), + }; + } + } +} + #[cfg(test)] mod tests { use super::*; @@ -193,7 +198,7 @@ mod tests { } fn custom_err() -> BackendError { - BackendError::Other(String::new()) + BackendError::other("") } #[tokio::test] @@ -233,7 +238,7 @@ mod tests { }); let retry_stream = RetrySubscription { - state: Some(PendingOrStream::Stream(StreamOf::new(Box::pin(stream)))), + state: RetrySubscriptionState::Stream(StreamOf::new(Box::pin(stream))), resubscribe, }; @@ -250,7 +255,7 @@ mod tests { let resubscribe = Box::new(|| async move { Err(custom_err()) }.boxed()); let retry_stream = RetrySubscription { - state: Some(PendingOrStream::Stream(StreamOf::new(Box::pin(stream)))), + state: RetrySubscriptionState::Stream(StreamOf::new(Box::pin(stream))), resubscribe, }; @@ -263,7 +268,7 @@ mod tests { let resubscribe = Box::new(|| async move { Err(custom_err()) }.boxed()); let retry_stream = RetrySubscription { - state: Some(PendingOrStream::Stream(StreamOf::new(Box::pin(stream)))), + state: RetrySubscriptionState::Stream(StreamOf::new(Box::pin(stream))), resubscribe, }; diff --git a/subxt/src/blocks/block_types.rs b/subxt/src/blocks/block_types.rs deleted file mode 100644 index cac88b254a4..00000000000 --- a/subxt/src/blocks/block_types.rs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::{ - backend::BlockRef, - blocks::Extrinsics, - client::{OfflineClientT, OnlineClientT}, - config::{Config, HashFor, Header}, - error::{AccountNonceError, BlockError, EventsError, ExtrinsicError}, - events, - runtime_api::RuntimeApi, - storage::StorageClientAt, -}; - -use codec::{Decode, Encode}; -use futures::lock::Mutex as AsyncMutex; -use std::sync::Arc; - -/// A representation of a block. -pub struct Block { - header: T::Header, - block_ref: BlockRef>, - client: C, - // Since we obtain the same events for every extrinsic, let's - // cache them so that we only ever do that once: - cached_events: CachedEvents, -} - -impl Clone for Block { - fn clone(&self) -> Self { - Self { - header: self.header.clone(), - block_ref: self.block_ref.clone(), - client: self.client.clone(), - cached_events: self.cached_events.clone(), - } - } -} - -// A cache for our events so we don't fetch them more than once when -// iterating over events for extrinsics. -pub(crate) type CachedEvents = Arc>>>; - -impl Block -where - T: Config, - C: OfflineClientT, -{ - pub(crate) fn new(header: T::Header, block_ref: BlockRef>, client: C) -> Self { - Block { - header, - block_ref, - client, - cached_events: Default::default(), - } - } - - /// Return a reference to the given block. While this reference is kept alive, - /// the backend will (if possible) endeavour to keep hold of the block. - pub fn reference(&self) -> BlockRef> { - self.block_ref.clone() - } - - /// Return the block hash. - pub fn hash(&self) -> HashFor { - self.block_ref.hash() - } - - /// Return the block number. - pub fn number(&self) -> ::Number { - self.header().number() - } - - /// Return the entire block header. - pub fn header(&self) -> &T::Header { - &self.header - } -} - -impl Block -where - T: Config, - C: OnlineClientT, -{ - /// Return the events associated with the block, fetching them from the node if necessary. - pub async fn events(&self) -> Result, EventsError> { - get_events(&self.client, self.hash(), &self.cached_events).await - } - - /// Fetch and return the extrinsics in the block body. - pub async fn extrinsics(&self) -> Result, ExtrinsicError> { - let block_hash = self.hash(); - - let extrinsics = self - .client - .backend() - .block_body(block_hash) - .await - .map_err(ExtrinsicError::CannotGetBlockBody)? - .ok_or_else(|| ExtrinsicError::BlockNotFound(block_hash.into()))?; - - let extrinsics = Extrinsics::new( - self.client.clone(), - extrinsics, - self.cached_events.clone(), - block_hash, - )?; - - Ok(extrinsics) - } - - /// Work with storage. - pub fn storage(&self) -> StorageClientAt { - StorageClientAt::new(self.client.clone(), self.block_ref.clone()) - } - - /// Execute a runtime API call at this block. - pub async fn runtime_api(&self) -> RuntimeApi { - RuntimeApi::new(self.client.clone(), self.block_ref.clone()) - } - - /// Get the account nonce for a given account ID at this block. - pub async fn account_nonce(&self, account_id: &T::AccountId) -> Result { - get_account_nonce(&self.client, account_id, self.hash()) - .await - .map_err(|e| BlockError::AccountNonceError { - block_hash: self.hash().into(), - account_id: account_id.encode().into(), - reason: e, - }) - } -} - -// Return Events from the cache, or fetch from the node if needed. -pub(crate) async fn get_events( - client: &C, - block_hash: HashFor, - cached_events: &AsyncMutex>>, -) -> Result, EventsError> -where - T: Config, - C: OnlineClientT, -{ - // Acquire lock on the events cache. We either get back our events or we fetch and set them - // before unlocking, so only one fetch call should ever be made. We do this because the - // same events can be shared across all extrinsics in the block. - let mut lock = cached_events.lock().await; - let events = match &*lock { - Some(events) => events.clone(), - None => { - let events = events::EventsClient::new(client.clone()) - .at(block_hash) - .await?; - lock.replace(events.clone()); - events - } - }; - - Ok(events) -} - -// Return the account nonce at some block hash for an account ID. -pub(crate) async fn get_account_nonce( - client: &C, - account_id: &T::AccountId, - block_hash: HashFor, -) -> Result -where - C: OnlineClientT, - T: Config, -{ - let account_nonce_bytes = client - .backend() - .call( - "AccountNonceApi_account_nonce", - Some(&account_id.encode()), - block_hash, - ) - .await?; - - // custom decoding from a u16/u32/u64 into a u64, based on the number of bytes we got back. - let cursor = &mut &account_nonce_bytes[..]; - let account_nonce: u64 = match account_nonce_bytes.len() { - 2 => u16::decode(cursor)?.into(), - 4 => u32::decode(cursor)?.into(), - 8 => u64::decode(cursor)?, - _ => { - return Err(AccountNonceError::WrongNumberOfBytes( - account_nonce_bytes.len(), - )); - } - }; - Ok(account_nonce) -} diff --git a/subxt/src/blocks/blocks_client.rs b/subxt/src/blocks/blocks_client.rs deleted file mode 100644 index 87e5f556b56..00000000000 --- a/subxt/src/blocks/blocks_client.rs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use super::Block; -use crate::{ - backend::{BlockRef, StreamOfResults}, - client::OnlineClientT, - config::{Config, HashFor}, - error::BlockError, - utils::PhantomDataSendSync, -}; -use derive_where::derive_where; -use futures::StreamExt; -use std::future::Future; - -type BlockStream = StreamOfResults; -type BlockStreamRes = Result, BlockError>; - -/// A client for working with blocks. -#[derive_where(Clone; Client)] -pub struct BlocksClient { - client: Client, - _marker: PhantomDataSendSync, -} - -impl BlocksClient { - /// Create a new [`BlocksClient`]. - pub fn new(client: Client) -> Self { - Self { - client, - _marker: PhantomDataSendSync::new(), - } - } -} - -impl BlocksClient -where - T: Config, - Client: OnlineClientT, -{ - /// Obtain block details given the provided block hash. - /// - /// # Warning - /// - /// This call only supports blocks produced since the most recent - /// runtime upgrade. You can attempt to retrieve older blocks, - /// but may run into errors attempting to work with them. - pub fn at( - &self, - block_ref: impl Into>>, - ) -> impl Future, BlockError>> + Send + 'static { - self.at_or_latest(Some(block_ref.into())) - } - - /// Obtain block details of the latest finalized block. - pub fn at_latest( - &self, - ) -> impl Future, BlockError>> + Send + 'static { - self.at_or_latest(None) - } - - /// Obtain block details given the provided block hash, or the latest block if `None` is - /// provided. - fn at_or_latest( - &self, - block_ref: Option>>, - ) -> impl Future, BlockError>> + Send + 'static { - let client = self.client.clone(); - async move { - // If a block ref isn't provided, we'll get the latest finalized ref to use. - let block_ref = match block_ref { - Some(r) => r, - None => client - .backend() - .latest_finalized_block_ref() - .await - .map_err(BlockError::CouldNotGetLatestBlock)?, - }; - - let maybe_block_header = client - .backend() - .block_header(block_ref.hash()) - .await - .map_err(|e| BlockError::CouldNotGetBlockHeader { - block_hash: block_ref.hash().into(), - reason: e, - })?; - - let block_header = match maybe_block_header { - Some(header) => header, - None => { - return Err(BlockError::BlockNotFound { - block_hash: block_ref.hash().into(), - }); - } - }; - - Ok(Block::new(block_header, block_ref, client)) - } - } - - /// Subscribe to all new blocks imported by the node. - /// - /// **Note:** You probably want to use [`Self::subscribe_finalized()`] most of - /// the time. - pub fn subscribe_all( - &self, - ) -> impl Future>, BlockError>> + Send + 'static - where - Client: Send + Sync + 'static, - { - let client = self.client.clone(); - let hasher = client.hasher(); - header_sub_fut_to_block_sub(self.clone(), async move { - let stream = client - .backend() - .stream_all_block_headers(hasher) - .await - .map_err(BlockError::CouldNotSubscribeToAllBlocks)?; - BlockStreamRes::Ok(stream) - }) - } - - /// Subscribe to all new blocks imported by the node onto the current best fork. - /// - /// **Note:** You probably want to use [`Self::subscribe_finalized()`] most of - /// the time. - pub fn subscribe_best( - &self, - ) -> impl Future>, BlockError>> + Send + 'static - where - Client: Send + Sync + 'static, - { - let client = self.client.clone(); - let hasher = client.hasher(); - header_sub_fut_to_block_sub(self.clone(), async move { - let stream = client - .backend() - .stream_best_block_headers(hasher) - .await - .map_err(BlockError::CouldNotSubscribeToBestBlocks)?; - BlockStreamRes::Ok(stream) - }) - } - - /// Subscribe to finalized blocks. - pub fn subscribe_finalized( - &self, - ) -> impl Future>, BlockError>> + Send + 'static - where - Client: Send + Sync + 'static, - { - let client = self.client.clone(); - let hasher = client.hasher(); - header_sub_fut_to_block_sub(self.clone(), async move { - let stream = client - .backend() - .stream_finalized_block_headers(hasher) - .await - .map_err(BlockError::CouldNotSubscribeToFinalizedBlocks)?; - BlockStreamRes::Ok(stream) - }) - } -} - -/// Take a promise that will return a subscription to some block headers, -/// and return a subscription to some blocks based on this. -async fn header_sub_fut_to_block_sub( - blocks_client: BlocksClient, - sub: S, -) -> Result>, BlockError> -where - T: Config, - S: Future>)>, BlockError>> - + Send - + 'static, - Client: OnlineClientT + Send + Sync + 'static, -{ - let sub = sub.await?.then(move |header_and_ref| { - let client = blocks_client.client.clone(); - async move { - let (header, block_ref) = match header_and_ref { - Ok(header_and_ref) => header_and_ref, - Err(e) => return Err(e), - }; - - Ok(Block::new(header, block_ref, client)) - } - }); - BlockStreamRes::Ok(StreamOfResults::new(Box::pin(sub))) -} diff --git a/subxt/src/blocks/extrinsic_types.rs b/subxt/src/blocks/extrinsic_types.rs deleted file mode 100644 index 3be678ed582..00000000000 --- a/subxt/src/blocks/extrinsic_types.rs +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::{ - blocks::block_types::{CachedEvents, get_events}, - client::{OfflineClientT, OnlineClientT}, - config::{Config, HashFor}, - error::{EventsError, ExtrinsicDecodeErrorAt, ExtrinsicError}, - events, -}; -use derive_where::derive_where; -use scale_decode::{DecodeAsFields, DecodeAsType}; -use subxt_core::blocks::{ExtrinsicDetails as CoreExtrinsicDetails, Extrinsics as CoreExtrinsics}; - -// Re-export anything that's directly returned/used in the APIs below. -pub use subxt_core::blocks::{ - ExtrinsicTransactionExtension, ExtrinsicTransactionExtensions, StaticExtrinsic, -}; - -/// The body of a block. -pub struct Extrinsics { - inner: CoreExtrinsics, - client: C, - cached_events: CachedEvents, - hash: HashFor, -} - -impl Extrinsics -where - T: Config, - C: OfflineClientT, -{ - pub(crate) fn new( - client: C, - extrinsics: Vec>, - cached_events: CachedEvents, - hash: HashFor, - ) -> Result { - let inner = CoreExtrinsics::decode_from(extrinsics, client.metadata())?; - Ok(Self { - inner, - client, - cached_events, - hash, - }) - } - - /// See [`subxt_core::blocks::Extrinsics::len()`]. - pub fn len(&self) -> usize { - self.inner.len() - } - - /// See [`subxt_core::blocks::Extrinsics::is_empty()`]. - pub fn is_empty(&self) -> bool { - self.inner.is_empty() - } - - /// Return the block hash that these extrinsics are from. - pub fn block_hash(&self) -> HashFor { - self.hash - } - - /// Returns an iterator over the extrinsics in the block body. - // Dev note: The returned iterator is 'static + Send so that we can box it up and make - // use of it with our `FilterExtrinsic` stuff. - pub fn iter(&self) -> impl Iterator> + Send + Sync + 'static { - let client = self.client.clone(); - let cached_events = self.cached_events.clone(); - let block_hash = self.hash; - - self.inner.iter().map(move |inner| { - ExtrinsicDetails::new(inner, client.clone(), block_hash, cached_events.clone()) - }) - } - - /// Iterate through the extrinsics using metadata to dynamically decode and skip - /// them, and return only those which should decode to the provided `E` type. - /// If an error occurs, all subsequent iterations return `None`. - pub fn find( - &self, - ) -> impl Iterator, ExtrinsicError>> { - self.inner.find::().map(|res| { - match res { - Err(e) => Err(ExtrinsicError::from(e)), - Ok(ext) => { - // Wrap details from subxt-core into what we want here: - let details = ExtrinsicDetails::new( - ext.details, - self.client.clone(), - self.hash, - self.cached_events.clone(), - ); - - Ok(FoundExtrinsic { - details, - value: ext.value, - }) - } - } - }) - } - - /// Iterate through the extrinsics using metadata to dynamically decode and skip - /// them, and return the first extrinsic found which decodes to the provided `E` type. - pub fn find_first( - &self, - ) -> Result>, ExtrinsicError> { - self.find::().next().transpose() - } - - /// Iterate through the extrinsics using metadata to dynamically decode and skip - /// them, and return the last extrinsic found which decodes to the provided `Ev` type. - pub fn find_last( - &self, - ) -> Result>, ExtrinsicError> { - self.find::().last().transpose() - } - - /// Find an extrinsics that decodes to the type provided. Returns true if it was found. - pub fn has(&self) -> Result { - Ok(self.find::().next().transpose()?.is_some()) - } -} - -/// A single extrinsic in a block. -pub struct ExtrinsicDetails { - inner: CoreExtrinsicDetails, - /// The block hash of this extrinsic (needed to fetch events). - block_hash: HashFor, - /// Subxt client. - client: C, - /// Cached events. - cached_events: CachedEvents, -} - -impl ExtrinsicDetails -where - T: Config, - C: OfflineClientT, -{ - // Attempt to dynamically decode a single extrinsic from the given input. - pub(crate) fn new( - inner: CoreExtrinsicDetails, - client: C, - block_hash: HashFor, - cached_events: CachedEvents, - ) -> ExtrinsicDetails { - ExtrinsicDetails { - inner, - client, - block_hash, - cached_events, - } - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::hash()`]. - pub fn hash(&self) -> HashFor { - self.inner.hash() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::is_signed()`]. - pub fn is_signed(&self) -> bool { - self.inner.is_signed() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::index()`]. - pub fn index(&self) -> u32 { - self.inner.index() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::bytes()`]. - pub fn bytes(&self) -> &[u8] { - self.inner.bytes() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::call_bytes()`]. - pub fn call_bytes(&self) -> &[u8] { - self.inner.call_bytes() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::field_bytes()`]. - pub fn field_bytes(&self) -> &[u8] { - self.inner.field_bytes() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::address_bytes()`]. - pub fn address_bytes(&self) -> Option<&[u8]> { - self.inner.address_bytes() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::signature_bytes()`]. - pub fn signature_bytes(&self) -> Option<&[u8]> { - self.inner.signature_bytes() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::transaction_extensions_bytes()`]. - pub fn transaction_extensions_bytes(&self) -> Option<&[u8]> { - self.inner.transaction_extensions_bytes() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::transaction_extensions()`]. - pub fn transaction_extensions(&self) -> Option> { - self.inner.transaction_extensions() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::pallet_index()`]. - pub fn pallet_index(&self) -> u8 { - self.inner.pallet_index() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::call_index()`]. - pub fn call_index(&self) -> u8 { - self.inner.call_index() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::pallet_name()`]. - pub fn pallet_name(&self) -> &str { - self.inner.pallet_name() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::call_name()`]. - pub fn call_name(&self) -> &str { - self.inner.call_name() - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::decode_as_fields()`]. - pub fn decode_as_fields(&self) -> Result { - self.inner.decode_as_fields().map_err(Into::into) - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::as_extrinsic()`]. - pub fn as_extrinsic(&self) -> Result, ExtrinsicError> { - self.inner.as_extrinsic::().map_err(Into::into) - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::as_root_extrinsic()`]. - pub fn as_root_extrinsic(&self) -> Result { - self.inner.as_root_extrinsic::().map_err(Into::into) - } -} - -impl ExtrinsicDetails -where - T: Config, - C: OnlineClientT, -{ - /// The events associated with the extrinsic. - pub async fn events(&self) -> Result, EventsError> { - let events = get_events(&self.client, self.block_hash, &self.cached_events).await?; - let ext_hash = self.inner.hash(); - Ok(ExtrinsicEvents::new(ext_hash, self.index(), events)) - } -} - -/// A Static Extrinsic found in a block coupled with it's details. -pub struct FoundExtrinsic { - /// Details for the extrinsic. - pub details: ExtrinsicDetails, - /// The decoded extrinsic value. - pub value: E, -} - -/// The events associated with a given extrinsic. -#[derive_where(Debug)] -pub struct ExtrinsicEvents { - // The hash of the extrinsic (handy to expose here because - // this type is returned from TxProgress things in the most - // basic flows, so it's the only place people can access it - // without complicating things for themselves). - ext_hash: HashFor, - // The index of the extrinsic: - idx: u32, - // All of the events in the block: - events: events::Events, -} - -impl ExtrinsicEvents { - /// Creates a new instance of `ExtrinsicEvents`. - #[doc(hidden)] - pub fn new(ext_hash: HashFor, idx: u32, events: events::Events) -> Self { - Self { - ext_hash, - idx, - events, - } - } - - /// The index of the extrinsic that these events are produced from. - pub fn extrinsic_index(&self) -> u32 { - self.idx - } - - /// Return the hash of the extrinsic. - pub fn extrinsic_hash(&self) -> HashFor { - self.ext_hash - } - - /// Return all of the events in the block that the extrinsic is in. - pub fn all_events_in_block(&self) -> &events::Events { - &self.events - } - - /// Iterate over all of the raw events associated with this transaction. - /// - /// This works in the same way that [`events::Events::iter()`] does, with the - /// exception that it filters out events not related to the submitted extrinsic. - pub fn iter(&self) -> impl Iterator, EventsError>> { - self.events.iter().filter(|ev| { - ev.as_ref() - .map(|ev| ev.phase() == events::Phase::ApplyExtrinsic(self.idx)) - .unwrap_or(true) // Keep any errors. - }) - } - - /// Find all of the transaction events matching the event type provided as a generic parameter. - /// - /// This works in the same way that [`events::Events::find()`] does, with the - /// exception that it filters out events not related to the submitted extrinsic. - pub fn find(&self) -> impl Iterator> { - self.iter() - .filter_map(|ev| ev.and_then(|ev| ev.as_event::()).transpose()) - } - - /// Iterate through the transaction events using metadata to dynamically decode and skip - /// them, and return the first event found which decodes to the provided `Ev` type. - /// - /// This works in the same way that [`events::Events::find_first()`] does, with the - /// exception that it ignores events not related to the submitted extrinsic. - pub fn find_first(&self) -> Result, EventsError> { - self.find::().next().transpose() - } - - /// Iterate through the transaction events using metadata to dynamically decode and skip - /// them, and return the last event found which decodes to the provided `Ev` type. - /// - /// This works in the same way that [`events::Events::find_last()`] does, with the - /// exception that it ignores events not related to the submitted extrinsic. - pub fn find_last(&self) -> Result, EventsError> { - self.find::().last().transpose() - } - - /// Find an event in those associated with this transaction. Returns true if it was found. - /// - /// This works in the same way that [`events::Events::has()`] does, with the - /// exception that it ignores events not related to the submitted extrinsic. - pub fn has(&self) -> Result { - Ok(self.find::().next().transpose()?.is_some()) - } -} diff --git a/subxt/src/blocks/mod.rs b/subxt/src/blocks/mod.rs deleted file mode 100644 index a28b2a59198..00000000000 --- a/subxt/src/blocks/mod.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! This module exposes the necessary functionality for working with events. - -mod block_types; -mod blocks_client; -mod extrinsic_types; - -/// A reference to a block. -pub use crate::backend::BlockRef; - -pub use block_types::Block; -pub use blocks_client::BlocksClient; -pub use extrinsic_types::{ - ExtrinsicDetails, ExtrinsicEvents, ExtrinsicTransactionExtension, - ExtrinsicTransactionExtensions, Extrinsics, FoundExtrinsic, StaticExtrinsic, -}; - -// We get account nonce info in tx_client, too, so re-use the logic: -pub(crate) use block_types::get_account_nonce; diff --git a/subxt/src/book.rs b/subxt/src/book.rs new file mode 100644 index 00000000000..6abf916f7fc --- /dev/null +++ b/subxt/src/book.rs @@ -0,0 +1,87 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! # The book +//! +//! Subxt is a library for interacting with Substrate based chains. In the early days, it had a focus on +//! **sub**mitting e**xt**rinsics, hence the name, however it has since evolved into a full featured library for +//! interacting with many aspects of chains across the Polkadot Network. +//! +//! ## The Polkadot Network +//! +//! The Polkadot Network is a collection of interconnected Blockchains. Each chain can accept different +//! transactions and store different data, as well as fundamentally differing in other areas, such as the +//! size and format of account addresses, the data expected to be provided alongside transactions, and +//! even more fundamental properties such at the number of bytes used to represent a block number. +//! +//! Blockchains on the Polkadot network are essentially distributed databases: +//! - To write to a chain, users submit _transactions_. Transactions are packets of data that are submitted to a +//! chain, usually _from_ a specific account. The result of executing these transactions (assuming everything was +//! successful) is that one or more _storage entries_ in the blockchain will be updated. +//! - _Storage Entries_ are sets of values of a given shape. We can read these in order to see what the current +//! state of affairs is. +//! +//! Transactions are appended to the blockchain in batches known as blocks, where each block points to the previous +//! one. Blocks are immutable and cannot be altered once added, and so the blockchain is essentially a big append-only +//! log of all of the transactions every submitted. Storage entries update at each block in response to the transactions +//! in it. Interactions with a blockchain happen _at_ a certain block; transactions are submitted to update the state +//! at a given block, and state can be read at a given block. +//! +//! Chains on the Polkadot network are typically created using the Substrate library. This library provides +//! various primitives and defaults which make it much simpler to build a new blockchain. Substrate based chains group the +//! functionality that they expose to users into _pallets_, where each pallet is a self contained module which contains +//! its own storage entries and accepts its own set of transactions. For example, the _Balances_ pallet would accept +//! transactions related to transferring tokens between users, and expose storage indicating which user has what tokens. +//! +//! Aside from transactions and storage entries, pallets also expose: +//! - _Constants_, which are fixed values at a given runtime version. +//! - _View Functions_, which are read-only functions that can be called and return some result. +//! +//! Outside of pallets, _Runtime APIs_ also exist, which are read-only functions that can be called and return some result. +//! +//! All of this logic lives inside the _runtime_ of a chain. An important aspect of Substrate based chains is that this +//! runtime can be upgraded. Runtime upgrades allow the functionality of a chain to be changed over time. This means +//! that the values that you can read and write from can change from one block to the next. +//! +//! In order to understand what interactions are possible at a specific runtime version, each runtime exposes +//! [_metadata_](https://github.com/paritytech/frame-metadata/). Metadata contains all of the information needed to +//! understand what interactions are possible at this runtime. The shape of metadata itself can also change, which +//! is why metadatas are versioned. Typically, we refer to metadata at version 14 or above as "modern" metadata, and +//! metadata older than this as "historic" or "legacy" metadata. In order to interact with blocks at runtimes which expose +//! historic metadata, additional type information needs to be provided by the user, as it was not present in the +//! metadata. +//! +//! ### TL;DR: +//! - Each chain can be configured differently. +//! - Transactions write to the blockchain, and update storage entries which can be read from. +//! - Reading and writing to a chain happens in the context of a specific block. +//! - Functionality is organized into _pallets_. +//! - This functionality can change over time as Runtime updates occur. +//! - Metadata describes what functionality is available for a given runtime. +//! +//! ## Interacting with the Polkadot Network +//! +//! Subxt is built for interacting with Substrate based chains on the Polkadot. The basic steps for using Subxt are: +//! +//! 0. (Optional) Generate an interface to the chain you wish to interact with. This provides type safe APIs. +//! 1. Create/instantiate some configuration for the chain you wish to interact with. Subxt provides a default +//! [`crate::config::SubstrateConfig`] which works with most chains, or [`crate::config::PolkadotConfig`] which +//! is configured specifically for the Polkadot Relay Chain. +//! 2. Create a _client_ for interacting with the chain, which consumes this configuration. typically, you'll create +//! an [`crate::client::OnlineClient`] which will connect to the chain. It's also possible to create an +//! [`crate::client::OfflineClient`] in the event that you want to avoid any network connection, although in this +//! case you'll obviously have much more limited functionality available to you. +//! 3. Pick a block to work at. To work at the current block at the time of calling, you'd use +//! [`crate::client::OnlineClient::at_current_block()`]. +//! 4. Do things in the context of this block. +//! +//! Behind the scenes, Subxt takes are of things like: +//! - Downloading the metadata at the given blocks where needed. +//! - Ensuring that anything you try to do is actually valid at the given block. +//! - Encoding and decoding the various data sent back and forth. +//! - Translating older metadatas into a useful format +//! +//! See +#![doc = concat!("[the examples](https://github.com/paritytech/subxt/tree/", env!("SUBXT_REF"), "/subxt/examples)")] +//! for more. diff --git a/subxt/src/book/mod.rs b/subxt/src/book/mod.rs deleted file mode 100644 index 60052310efb..00000000000 --- a/subxt/src/book/mod.rs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -// Dev note; I used the following command to normalize and wrap comments: -// rustfmt +nightly --config wrap_comments=true,comment_width=100,normalize_comments=true subxt/src/book/custom_values -// It messed up comments in code blocks though, so be prepared to go and fix those. - -//! # The Subxt Guide -//! -//! Subxt is a library for interacting with Substrate based nodes. It has a focus on **sub**mitting -//! e**xt**rinsics, hence the name, however it's also capable of reading blocks, storage, events and -//! constants from a node. The aim of this guide is to explain key concepts and get you started with -//! using Subxt. -//! -//! 1. [Features](#features-at-a-glance) -//! 2. [Limitations](#limitations) -//! 3. [Quick start](#quick-start) -//! 4. [Usage](#usage) -//! -//! ## Features at a glance -//! -//! Here's a quick overview of the features that Subxt has to offer: -//! -//! - Subxt allows you to generate a static, type safe interface to a node given some metadata; this -//! allows you to catch many errors at compile time rather than runtime. -//! - Subxt also makes heavy use of node metadata to encode/decode the data sent to/from it. This -//! allows it to target almost any node which can output the correct metadata, and allows it some -//! flexibility in encoding and decoding things to account for cross-node differences. -//! - Subxt has a pallet-oriented interface, meaning that code you write to talk to some pallet on -//! one node will often "Just Work" when pointed at different nodes that use the same pallet. -//! - Subxt can work offline; you can generate and sign transactions, access constants from node -//! metadata and more, without a network connection. This is all checked at compile time, so you -//! can be certain it won't try to establish a network connection if you don't want it to. -//! - Subxt can forego the statically generated interface and build transactions, storage queries -//! and constant queries using data provided at runtime, rather than queries constructed -//! statically. -//! - Subxt can be compiled to WASM to run in the browser, allowing it to back Rust based browser -//! apps, or even bind to JS apps. -//! -//! ## Limitations -//! -//! In various places, you can provide a block hash to access data at a particular block, for -//! instance: -//! -//! - [`crate::storage::StorageClient::at`] -//! - [`crate::events::EventsClient::at`] -//! - [`crate::blocks::BlocksClient::at`] -//! - [`crate::runtime_api::RuntimeApiClient::at`] -//! -//! However, Subxt is (by default) only capable of properly working with blocks that were produced -//! after the most recent runtime update. This is because it uses the most recent metadata given -//! back by a node to encode and decode things. It's possible to decode older blocks produced by a -//! runtime that emits compatible (currently, V14) metadata by manually setting the metadata used by -//! the client using [`crate::client::OnlineClient::set_metadata()`]. -//! -//! Subxt does not support working with blocks produced prior to the runtime update that introduces -//! V14 metadata. It may have some success decoding older blocks using newer metadata, but may also -//! completely fail to do so. -//! -//! ## Quick start -//! -//! Here is a simple but complete example of using Subxt to transfer some tokens from the example -//! accounts, Alice to Bob: -//! -//! ```rust,ignore -#![doc = include_str!("../../examples/tx_basic.rs")] -//! ``` -//! -//! This example assumes that a Polkadot node is running locally (Subxt endeavors to support all -//! recent releases). Typically, to use Subxt to talk to some custom Substrate node (for example a -//! parachain node), you'll want to: -//! -//! 1. [Generate an interface](setup::codegen) -//! 2. [Create a config](setup::config) -//! 3. [Use the config to instantiate the client](setup::client) -//! -//! Follow the above links to learn more about each step. -//! -//! ## Usage -//! -//! Once Subxt is configured, the next step is interacting with a node. Follow the links -//! below to learn more about how to use Subxt for each of the following things: -//! -//! - [Transactions](usage::transactions): Subxt can build and submit transactions, wait until they are in -//! blocks, and retrieve the associated events. -//! - [Storage](usage::storage): Subxt can query the node storage. -//! - [Events](usage::events): Subxt can read the events emitted for recent blocks. -//! - [Constants](usage::constants): Subxt can access the constant values stored in a node, which -//! remain the same for a given runtime version. -//! - [Blocks](usage::blocks): Subxt can load recent blocks or subscribe to new/finalized blocks, -//! reading the extrinsics, events and storage at these blocks. -//! - [Runtime APIs](usage::runtime_apis): Subxt can make calls into pallet runtime APIs to retrieve -//! data. -//! - [Custom values](usage::custom_values): Subxt can access "custom values" stored in the metadata. -//! - [Raw RPC calls](usage::rpc): Subxt can be used to make raw RPC requests to compatible nodes. -//! -//! ## Examples -//! -//! Some complete, self contained examples which are not a part of this guide: -//! -//! - [`parachain-example`](https://github.com/paritytech/subxt/tree/master/examples/parachain-example) is an example -//! which uses Zombienet to spawn a parachain locally, and then connects to it using Subxt. -//! - [`wasm-example`](https://github.com/paritytech/subxt/tree/master/examples/wasm-example) is an example of writing -//! a Rust app that contains a Yew based UI, uses Subxt to interact with a chain, and compiles to WASM in order to -//! run entirely in the browser. -pub mod setup; -pub mod usage; diff --git a/subxt/src/book/setup/client.rs b/subxt/src/book/setup/client.rs deleted file mode 100644 index 52d6348e674..00000000000 --- a/subxt/src/book/setup/client.rs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # The Subxt client. -//! -//! The client forms the entry point to all of the Subxt APIs. Every client implements one or -//! both of [`crate::client::OfflineClientT`] and [`crate::client::OnlineClientT`]. -//! -//! Subxt ships with three clients which implement one or both of traits: -//! - An [online client](crate::client::OnlineClient). -//! - An [offline client](crate::client::OfflineClient). -//! - A light client (which is currently still unstable). -//! -//! In theory it's possible for users to implement their own clients, although this isn't generally -//! expected. -//! -//! The provided clients are all generic over the [`crate::config::Config`] that they accept, which -//! determines how they will interact with the chain. -//! -//! In the case of the [`crate::OnlineClient`], we have various ways to instantiate it: -//! -//! - [`crate::OnlineClient::new()`] to connect to a node running locally. This uses the default Subxt -//! backend, and the default RPC client. -//! - [`crate::OnlineClient::from_url()`] to connect to a node at a specific URL. This uses the default Subxt -//! backend, and the default RPC client. -//! - [`crate::OnlineClient::from_rpc_client()`] to instantiate the client with a [`crate::backend::rpc::RpcClient`]. -//! - [`crate::OnlineClient::from_backend()`] to instantiate Subxt using a custom backend. Currently there -//! is just one backend, [`crate::backend::legacy::LegacyBackend`]. This backend can be instantiated from -//! a [`crate::backend::rpc::RpcClient`]. -//! -//! [`crate::backend::rpc::RpcClient`] can itself be instantiated from anything that implements the low level -//! [`crate::backend::rpc::RpcClientT`] trait; this allows you to decide how Subxt will attempt to talk to a node -//! if you'd prefer something other default client. We use this approach under the hood to implement the light client. -//! -//! ## Examples -//! -//! Most of the other examples will instantiate a client. Here are a couple of examples for less common -//! cases. -//! -//! ### Writing a custom [`crate::backend::rpc::RpcClientT`] implementation: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/setup_client_custom_rpc.rs")] -//! ``` -//! -//! ### Creating an [`crate::OfflineClient`]: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/setup_client_offline.rs")] -//! ``` -//! diff --git a/subxt/src/book/setup/codegen.rs b/subxt/src/book/setup/codegen.rs deleted file mode 100644 index bd133b2c1b9..00000000000 --- a/subxt/src/book/setup/codegen.rs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # Generating an interface -//! -//! The simplest way to use Subxt is to generate an interface to a chain that you'd like to interact -//! with. This generated interface allows you to build transactions and construct queries to access -//! data while leveraging the full type safety of the Rust compiler. -//! -//! ## The `#[subxt]` macro -//! -//! The most common way to generate the interface is to use the [`#[subxt]`](crate::subxt) macro. -//! Using this macro looks something like: -//! -//! ```rust,no_run,standalone_crate -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_tiny.scale")] -//! pub mod polkadot {} -//! ``` -//! -//! The macro takes a path to some node metadata, and uses that to generate the interface you'll use -//! to talk to it. [Go here](crate::subxt) to learn more about the options available to the macro. -//! -//! To obtain this metadata you'll need for the above, you can use the `subxt` CLI tool to download it -//! from a node. The tool can be installed via `cargo`: -//! -//! ```shell -//! cargo install subxt-cli -//! ``` -//! -//! And then it can be used to fetch metadata and save it to a file: -//! -//! ```shell -//! # Download and save all of the metadata: -//! subxt metadata > metadata.scale -//! # Download and save only the pallets you want to generate an interface for: -//! subxt metadata --pallets Balances,System > metadata.scale -//! ``` -//! -//! Explicitly specifying pallets will cause the tool to strip out all unnecessary metadata and type -//! information, making the bundle much smaller in the event that you only need to generate an -//! interface for a subset of the available pallets on the node. -//! -//! ## The CLI tool -//! -//! Using the [`#[subxt]`](crate::subxt) macro carries some downsides: -//! -//! - Using it to generate an interface will have a small impact on compile times (though much less of -//! one if you only need a few pallets). -//! - IDE support for autocompletion and documentation when using the macro interface can be poor. -//! - It's impossible to manually look at the generated code to understand and debug things. -//! -//! If these are an issue, you can manually generate the same code that the macro generates under the hood -//! by using the `subxt codegen` command: -//! -//! ```shell -//! # Install the CLI tool if you haven't already: -//! cargo install subxt-cli -//! # Generate and format rust code, saving it to `interface.rs`: -//! subxt codegen | rustfmt > interface.rs -//! ``` -//! -//! Use `subxt codegen --help` for more options; many of the options available via the macro are -//! also available via the CLI tool, such as the ability to substitute generated types for others, -//! or strip out docs from the generated code. -//! diff --git a/subxt/src/book/setup/config.rs b/subxt/src/book/setup/config.rs deleted file mode 100644 index 663a02aa249..00000000000 --- a/subxt/src/book/setup/config.rs +++ /dev/null @@ -1,166 +0,0 @@ -//! # Creating a Config -//! -//! Subxt requires you to provide a type implementing [`crate::config::Config`] in order to connect to a node. -//! The [`crate::config::Config`] trait for the most part mimics the `frame_system::Config` trait. -//! For most use cases, you can just use one of the following Configs shipped with Subxt: -//! -//! - [`PolkadotConfig`](crate::config::PolkadotConfig) for talking to Polkadot nodes, and -//! - [`SubstrateConfig`](crate::config::SubstrateConfig) for talking to generic nodes built with Substrate. -//! -//! # How to create a Config for a custom chain? -//! -//! Some chains may use config that is not compatible with our [`PolkadotConfig`](crate::config::PolkadotConfig) or -//! [`SubstrateConfig`](crate::config::SubstrateConfig). -//! -//! We now walk through creating a custom [`crate::config::Config`] for a parachain, using the -//! ["Statemint"](https://parachains.info/details/statemint) parachain, also known as "Asset Hub", as an example. It -//! is currently (as of 2023-06-26) deployed on Polkadot and [Kusama (as "Statemine")](https://parachains.info/details/statemine). -//! -//! To construct a valid [`crate::config::Config`] implementation, we need to find out which types to use for `AccountId`, `Hasher`, etc. -//! For this, we need to take a look at the source code of Statemint, which is currently a part of the [Cumulus Github repository](https://github.com/paritytech/cumulus). -//! The crate defining the asset hub runtime can be found [here](https://github.com/paritytech/cumulus/tree/master/parachains/runtimes/assets/asset-hub-polkadot). -//! -//! ## `AccountId`, `Hash`, `Hasher` and `Header` -//! -//! For these config types, we need to find out where the parachain runtime implements the `frame_system::Config` trait. -//! Look for a code fragment like `impl frame_system::Config for Runtime { ... }` In the source code. -//! For Statemint it looks like [this](https://github.com/paritytech/cumulus/blob/e2b7ad2061824f490c08df27a922c64f50accd6b/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs#L179) -//! at the time of writing. The `AccountId`, `Hash` and `Header` types of the [frame_system::pallet::Config](https://docs.rs/frame-system/latest/frame_system/pallet/trait.Config.html) -//! correspond to the ones we want to use in our Subxt [crate::Config]. In the Case of Statemint (Asset Hub) they are: -//! -//! - AccountId: `sp_core::crypto::AccountId32` -//! - Hash: `sp_core::H256` -//! - Hasher (type `Hashing` in [frame_system::pallet::Config](https://docs.rs/frame-system/latest/frame_system/pallet/trait.Config.html)): `sp_runtime::traits::BlakeTwo256` -//! - Header: `sp_runtime::generic::Header` -//! -//! Subxt has its own versions of some of these types in order to avoid needing to pull in Substrate dependencies: -//! -//! - `sp_core::crypto::AccountId32` can be swapped with [`crate::utils::AccountId32`]. -//! - `sp_core::H256` is a re-export which subxt also provides as [`crate::config::substrate::H256`]. -//! - `sp_runtime::traits::BlakeTwo256` can be swapped with [`crate::config::substrate::BlakeTwo256`]. -//! - `sp_runtime::generic::Header` can be swapped with [`crate::config::substrate::SubstrateHeader`]. -//! -//! Having a look at how those types are implemented can give some clues as to how to implement other custom types that -//! you may need to use as part of your config. -//! -//! ## `Address`, `Signature` -//! -//! A Substrate runtime is typically constructed by using the [frame_support::construct_runtime](https://docs.rs/frame-support/latest/frame_support/macro.construct_runtime.html) macro. -//! In this macro, we need to specify the type of an `UncheckedExtrinsic`. Most of the time, the `UncheckedExtrinsic` will be of the type -//! `sp_runtime::generic::UncheckedExtrinsic`. -//! The generic parameters `Address` and `Signature` specified when declaring the `UncheckedExtrinsic` type -//! are the types for `Address` and `Signature` we should use with our [crate::Config] implementation. This information can -//! also be obtained from the metadata (see [`frame_metadata::v15::ExtrinsicMetadata`]). In case of Statemint (Polkadot Asset Hub) -//! we see the following types being used in `UncheckedExtrinsic`: -//! -//! - Address: `sp_runtime::MultiAddress` -//! - Signature: `sp_runtime::MultiSignature` -//! -//! As above, Subxt has its own versions of these types that can be used instead to avoid pulling in Substrate dependencies. -//! Using the Subxt versions also makes interacting with generated code (which uses them in some places) a little nicer: -//! -//! - `sp_runtime::MultiAddress` can be swapped with [`crate::utils::MultiAddress`]. -//! - `sp_runtime::MultiSignature` can be swapped with [`crate::utils::MultiSignature`]. -//! -//! ## ExtrinsicParams -//! -//! Chains each have a set of "transaction extensions" (formally called "signed extensions") configured. Transaction extensions provide -//! a means to extend how transactions work. Each transaction extension can potentially encode some "extra" data which is sent along with a transaction, as well as some -//! "additional" data which is included in the transaction signer payload, but not transmitted along with the transaction. On -//! a node, transaction extensions can then perform additional checks on the submitted transactions to ensure their validity. -//! -//! The `ExtrinsicParams` config type expects to be given an implementation of the [`crate::config::ExtrinsicParams`] trait. -//! Implementations of the [`crate::config::ExtrinsicParams`] trait are handed some parameters from Subxt itself, and can -//! accept arbitrary other `Params` from users, and are then expected to provide this "extra" and "additional" data when asked -//! via the required [`crate::config::ExtrinsicParamsEncoder`] impl. -//! -//! **In most cases, the default [crate::config::DefaultExtrinsicParams] type will work**: it understands the "standard" -//! transaction extensions that are in use, and allows the user to provide things like a tip, and set the extrinsic mortality via -//! [`crate::config::DefaultExtrinsicParamsBuilder`]. It will use the chain metadata to decide which transaction extensions to use -//! and in which order. It will return an error if the chain uses a transaction extension which it doesn't know how to handle. -//! -//! If the chain uses novel transaction extensions (or if you just wish to provide a different interface for users to configure -//! transactions), you can either: -//! -//! 1. Implement a new transaction extension and add it to the list. -//! 2. Implement [`crate::config::DefaultExtrinsicParams`] from scratch. -//! -//! See below for examples of each. -//! -//! ### Finding out which transaction extensions a chain is using. -//! -//! In either case, you'll want to find out which transaction extensions a chain is using. This information can be obtained from -//! the `SignedExtra` parameter of the `UncheckedExtrinsic` of your parachain, which will be a tuple of transaction extensions. -//! It can also be obtained from the metadata (see [`frame_metadata::v15::SignedExtensionMetadata`]). -//! -//! For statemint, the transaction extensions look like -//! [this](https://github.com/paritytech/cumulus/blob/d4bb2215bb28ee05159c4c7df1b3435177b5bf4e/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs#L786): -//! -//! ```rust,ignore -//! pub type SignedExtra = ( -//! frame_system::CheckNonZeroSender, -//! frame_system::CheckSpecVersion, -//! frame_system::CheckTxVersion, -//! frame_system::CheckGenesis, -//! frame_system::CheckEra, -//! frame_system::CheckNonce, -//! frame_system::CheckWeight, -//! pallet_asset_tx_payment::ChargeAssetTxPayment, -//! ); -//! ``` -//! -//! Each element of the `SignedExtra` tuple implements [codec::Encode] and `sp_runtime::traits::SignedExtension` -//! which has an associated type `AdditionalSigned` that also implements [codec::Encode]. Let's look at the underlying types -//! for each tuple element. All zero-sized types have been replaced by `()` for simplicity. -//! -//! | tuple element | struct type | `AdditionalSigned` type | -//! | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | -//! | [`frame_system::CheckNonZeroSender`](https://docs.rs/frame-system/latest/frame_system/struct.CheckNonZeroSender.html) | () | () | -//! | [`frame_system::CheckSpecVersion`](https://docs.rs/frame-system/latest/frame_system/struct.CheckSpecVersion.html) | () | [u32] | -//! | [`frame_system::CheckTxVersion`](https://docs.rs/frame-system/latest/frame_system/struct.CheckTxVersion.html) | () | [u32] | -//! | [`frame_system::CheckGenesis`](https://docs.rs/frame-system/latest/frame_system/struct.CheckGenesis.html) | () | `Config::Hash` = `sp_core::H256` | -//! | [`frame_system::CheckMortality`](https://docs.rs/frame-system/latest/frame_system/struct.CheckMortality.html) | `sp_runtime::generic::Era` | `Config::Hash` = `sp_core::H256` | -//! | [`frame_system::CheckNonce`](https://docs.rs/frame-system/latest/frame_system/struct.CheckNonce.html) | `frame_system::pallet::Config::Index` = u32 | () | -//! | [`frame_system::CheckWeight`](https://docs.rs/frame-system/latest/frame_system/struct.CheckWeight.html) | () | () | -//! | [`frame_system::ChargeAssetTxPayment`](https://docs.rs/frame-system/latest/frame_system/struct.ChargeAssetTxPayment.html) | [pallet_asset_tx_payment::ChargeAssetTxPayment](https://docs.rs/pallet-asset-tx-payment/latest/pallet_asset_tx_payment/struct.ChargeAssetTxPayment.html) | () | -//! -//! All types in the `struct type` column make up the "extra" data that we're expected to provide. All types in the -//! `AdditionalSigned` column make up the "additional" data that we're expected to provide. This information will be useful -//! whether we want to implement [`crate::config::TransactionExtension`] for a transaction extension, or implement -//! [`crate::config::ExtrinsicParams`] from scratch. -//! -//! As it happens, all of the transaction extensions in the table are either already exported in [`crate::config::transaction_extensions`], -//! or they hand back no "additional" or "extra" data. In both of these cases, the default `ExtrinsicParams` configuration will -//! work out of the box. -//! -//! ### Implementing and adding new transaction extensions to the config -//! -//! If you do need to implement a novel transaction extension, then you can implement [`crate::config::transaction_extensions::TransactionExtension`] -//! on a custom type and place it into a new set of transaction extensions, like so: -//! -//! ```rust,ignore -#![doc = include_str ! ("../../../examples/setup_config_transaction_extension.rs")] -//! ``` -//! -//! ### Implementing [`crate::config::ExtrinsicParams`] from scratch -//! -//! Alternately, you are free to implement [`crate::config::ExtrinsicParams`] entirely from scratch if you know exactly what "extra" and -//! "additional" data your node needs and would prefer to craft your own interface. -//! -//! Let's see what this looks like (this config won't work on any real node): -//! -//! ```rust,ignore -#![doc = include_str ! ("../../../examples/setup_config_custom.rs")] -//! ``` -//! -//! ### Using a type from the metadata as a config parameter -//! -//! You can also use types that are generated from chain metadata as type parameters of the Config trait. -//! Just make sure all trait bounds are satisfied. This can often be achieved by using custom derives with the subxt macro. -//! For example, the AssetHub Parachain expects tips to include a `MultiLocation`, which is a type we can draw from the metadata. -//! -//! This example shows what using the `MultiLocation` struct as part of your config would look like in subxt: -//! -//! ```rust,ignore -#![doc = include_str ! ("../../../examples/setup_config_assethub.rs")] -//! ``` diff --git a/subxt/src/book/setup/mod.rs b/subxt/src/book/setup/mod.rs deleted file mode 100644 index 3dbcc37fa9a..00000000000 --- a/subxt/src/book/setup/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! This modules contains details on setting up Subxt: -//! -//! - [Codegen](codegen) -//! - [Client](client) -//! -//! Alternately, [go back](super). - -pub mod client; -pub mod codegen; -pub mod config; diff --git a/subxt/src/book/usage/blocks.rs b/subxt/src/book/usage/blocks.rs deleted file mode 100644 index ac690167cb7..00000000000 --- a/subxt/src/book/usage/blocks.rs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # Blocks -//! -//! The [blocks API](crate::blocks::BlocksClient) in Subxt unifies many of the other interfaces, and -//! allows you to: -//! -//! - Access information about specific blocks (see [`crate::blocks::BlocksClient::at()`] and -//! [`crate::blocks::BlocksClient::at_latest()`]). -//! - Subscribe to [all](crate::blocks::BlocksClient::subscribe_all()), -//! [best](crate::blocks::BlocksClient::subscribe_best()) or -//! [finalized](crate::blocks::BlocksClient::subscribe_finalized()) blocks as they are produced. -//! **Prefer to subscribe to finalized blocks unless you know what you're doing.** -//! -//! In either case, you'll end up with [`crate::blocks::Block`]'s, from which you can access various -//! information about the block, such a the [header](crate::blocks::Block::header()), -//! [block number](crate::blocks::Block::number()) and [body (the extrinsics)](crate::blocks::Block::extrinsics()). -//! [`crate::blocks::Block`]'s also provide shortcuts to other Subxt APIs that will operate at the -//! given block: -//! -//! - [storage](crate::blocks::Block::storage()), -//! - [events](crate::blocks::Block::events()) -//! - [runtime APIs](crate::blocks::Block::runtime_api()) -//! -//! Aside from these links to other Subxt APIs, the main thing that we can do here is iterate over and -//! decode the extrinsics in a block body. -//! -//! ## Decoding Extrinsics -//! -//! Given a block, you can [download the block body](crate::blocks::Block::extrinsics()) and -//! [iterate over the extrinsics](crate::blocks::Extrinsics::iter) stored within it. The extrinsics yielded are of type -//! [ExtrinsicDetails](crate::blocks::ExtrinsicDetails), which is just a blob of bytes that also stores which -//! pallet and call in that pallet it belongs to. It also contains information about signed extensions that -//! have been used for submitting this extrinsic. -//! -//! To use the extrinsic, you probably want to decode it into a concrete Rust type. These Rust types representing -//! extrinsics from different pallets can be generated from metadata using the subxt macro or the CLI tool. -//! -//! When decoding the extrinsic into a static type you have two options: -//! -//! ### Statically decode the extrinsics into [the root extrinsic type](crate::blocks::ExtrinsicDetails::as_root_extrinsic()) -//! -//! The root extrinsic type generated by subxt is a Rust enum with one variant for each pallet. Each of these -//! variants has a field that is another enum whose variants cover all calls of the respective pallet. -//! If the extrinsic bytes are valid and your metadata matches the chain's metadata, decoding the bytes of an extrinsic into -//! this root extrinsic type should always succeed. -//! -//! This example shows how to subscribe to blocks and decode the extrinsics in each block into the root extrinsic type. -//! Once we get hold of the [ExtrinsicDetails](crate::blocks::ExtrinsicDetails), we can decode it statically or dynamically. -//! We can also access details about the extrinsic, including the associated events and transaction extensions. -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/blocks_subscribing.rs")] -//! ``` -//! -//! ### Statically decode the extrinsic into [a specific pallet call](crate::blocks::ExtrinsicDetails::as_extrinsic()) -//! -//! This is useful if you are expecting a specific extrinsic to be part of some block. If the extrinsic you try to decode -//! is a different extrinsic, an `Ok(None)` value is returned from [`as_extrinsic::()`](crate::blocks::ExtrinsicDetails::as_extrinsic()); -//! -//! If you are only interested in finding specific extrinsics in a block, you can also [iterate over all of them](crate::blocks::Extrinsics::find), -//! get only [the first one](crate::blocks::Extrinsics::find_first), or [the last one](crate::blocks::Extrinsics::find_last). -//! -//! The following example monitors `TransferKeepAlive` extrinsics on the Polkadot network. -//! We statically decode them and access the [tip](crate::blocks::ExtrinsicTransactionExtensions::tip()) and -//! [account nonce](crate::blocks::ExtrinsicTransactionExtensions::nonce()) transaction extensions. -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/block_decoding_static.rs")] -//! ``` -//! -//! ### Dynamically decode the extrinsic -//! -//! Sometimes you might use subxt with metadata that is not known at compile time. In this case, you do not -//! have access to a statically generated interface module that contains the relevant Rust types. You can -//! [decode ExtrinsicDetails dynamically](crate::blocks::ExtrinsicDetails::decode_as_fields()), which gives -//! you access to it's fields as a [scale value composite](scale_value::Composite). The following example -//! looks for signed extrinsics on the Polkadot network and retrieves their pallet name, variant name, data -//! fields and transaction extensions dynamically. Notice how we do not need to use code generation via the -//! subxt macro. The only fixed component we provide is the [PolkadotConfig](crate::config::PolkadotConfig). -//! Other than that it works in a chain-agnostic way: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/block_decoding_dynamic.rs")] -//! ``` -//! -//! ## Decoding transaction extensions -//! -//! Extrinsics can contain transaction extensions. The transaction extensions can be different across chains. -//! The [Config](crate::Config) implementation for your chain defines which transaction extensions you expect. -//! Once you get hold of the [ExtrinsicDetails](crate::blocks::ExtrinsicDetails) for an extrinsic you are interested in, -//! you can try to [get its transaction extensions](crate::blocks::ExtrinsicDetails::transaction_extensions()). -//! These are only available on V4 signed extrinsics or V5 general extrinsics. You can try to -//! [find a specific transaction extension](crate::blocks::ExtrinsicTransactionExtensions::find), in the returned -//! [transaction extensions](crate::blocks::ExtrinsicTransactionExtensions). -//! -//! Subxt also provides utility functions to get the [tip](crate::blocks::ExtrinsicTransactionExtensions::tip()) and -//! the [account nonce](crate::blocks::ExtrinsicTransactionExtensions::nonce()) associated with an extrinsic, given -//! its transaction extensions. If you prefer to do things dynamically you can get the data of the transaction extension -//! as a [scale value](crate::blocks::ExtrinsicTransactionExtension::value()). -//! diff --git a/subxt/src/book/usage/constants.rs b/subxt/src/book/usage/constants.rs deleted file mode 100644 index 2fade787854..00000000000 --- a/subxt/src/book/usage/constants.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # Constants -//! -//! There are various constants stored in a node; the types and values of these are defined in a -//! runtime, and can only change when the runtime is updated. Much like [`super::storage`], we can -//! query these using Subxt by taking the following steps: -//! -//! 1. [Constructing a constant query](#constructing-a-query). -//! 2. [Submitting the query to get back the associated value](#submitting-it). -//! -//! ## Constructing a constant query -//! -//! We can use the statically generated interface to build constant queries: -//! -//! ```rust,no_run,standalone_crate -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] -//! pub mod polkadot {} -//! -//! let constant_query = polkadot::constants().system().block_length(); -//! ``` -//! -//! Alternately, we can dynamically construct a constant query. A dynamic query needs the return -//! type to be specified, where we can use [`crate::dynamic::Value`] if unsure: -//! -//! ```rust,no_run,standalone_crate -//! use subxt::dynamic::Value; -//! -//! let storage_query = subxt::dynamic::constant::("System", "BlockLength"); -//! ``` -//! -//! ## Submitting it -//! -//! Call [`crate::constants::ConstantsClient::at()`] to return and decode the constant into the -//! type given by the address, or [`crate::constants::ConstantsClient::bytes_at()`] to return the -//! raw bytes for some constant. -//! -//! Constant values are pulled directly out of the node metadata which Subxt has -//! already acquired, and so this function requires no network access and is available from a -//! [`crate::OfflineClient`]. -//! -//! Here's an example using a static query: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/constants_static.rs")] -//! ``` -//! -//! And here's one using a dynamic query: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/constants_dynamic.rs")] -//! ``` -//! diff --git a/subxt/src/book/usage/custom_values.rs b/subxt/src/book/usage/custom_values.rs deleted file mode 100644 index 8f27e9fe7fa..00000000000 --- a/subxt/src/book/usage/custom_values.rs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # Custom Values -//! -//! Substrate-based chains can expose custom values in their metadata. -//! Each of these values: -//! -//! - can be accessed by a unique __name__. -//! - refers to a concrete __type__ stored in the metadata. -//! - contains a scale encoded __value__ of that type. -//! -//! ## Getting a custom value -//! -//! First, you must construct an address to access a custom value. This can be either: -//! - a raw [`str`] which assumes the return type to be the dynamic [`crate::dynamic::Value`] type, -//! - created via [`dynamic`](crate::custom_values::dynamic) function whereby you set the return type -//! that you want back, -//! - created via statically generated addresses as part of the `#[subxt]` macro which define the return type. -//! -//! With an address, use [`at`](crate::custom_values::CustomValuesClient::at) to access and decode specific values, and -//! [`bytes_at`](crate::custom_values::CustomValuesClient::bytes_at) to access the raw bytes. -//! -//! ## Examples -//! -//! Dynamically accessing a custom value using a [`str`] to select which one: -//! -//! ```rust,ignore -//! use subxt::{OnlineClient, PolkadotConfig, ext::scale_decode::DecodeAsType}; -//! use subxt::dynamic::Value; -//! -//! let api = OnlineClient::::new().await?; -//! let custom_value_client = api.custom_values(); -//! let foo: Value = custom_value_client.at("foo")?; -//! ``` -//! -//! Use the [`dynamic`](crate::custom_values::dynamic) function to select the return type: -//! -//! ```rust,ignore -//! use subxt::{OnlineClient, PolkadotConfig, ext::scale_decode::DecodeAsType}; -//! -//! #[derive(Decode, DecodeAsType, Debug)] -//! struct Foo { -//! n: u8, -//! b: bool, -//! } -//! -//! let api = OnlineClient::::new().await?; -//! let custom_value_client = api.custom_values(); -//! let custom_value_addr = subxt::custom_values::dynamic::("foo"); -//! let foo: Foo = custom_value_client.at(&custom_value_addr)?; -//! ``` -//! -//! Alternatively we also provide a statically generated api for custom values: -//! -//! ```rust,ignore -//! #[subxt::subxt(runtime_metadata_path = "some_metadata.scale")] -//! pub mod interface {} -//! -//! let static_address = interface::custom().foo(); -//! -//! let api = OnlineClient::::new().await?; -//! let custom_value_client = api.custom_values(); -//! -//! // Now the `at()` function already decodes the value into the Foo type: -//! let foo = custom_value_client.at(&static_address)?; -//! ``` -//! diff --git a/subxt/src/book/usage/events.rs b/subxt/src/book/usage/events.rs deleted file mode 100644 index e851f38b951..00000000000 --- a/subxt/src/book/usage/events.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # Events -//! -//! In the process of adding extrinsics to a block, they are executed. When extrinsics are executed, -//! they normally produce events describing what's happening (at the very least, an event dictating whether -//! the extrinsic has succeeded or failed). The node may also emit some events of its own as the block is -//! processed. -//! -//! Events live in a single location in node storage which is overwritten at each block. Normal nodes tend to -//! keep a snapshot of the state at a small number of previous blocks, so you can sometimes access -//! older events by using [`crate::events::EventsClient::at()`] and providing an older block hash. -//! -//! When we submit transactions using Subxt, methods like [`crate::tx::TxProgress::wait_for_finalized_success()`] -//! return [`crate::blocks::ExtrinsicEvents`], which can be used to iterate and inspect the events produced -//! by that transaction being executed. We can also access _all_ of the events produced in a single block using one -//! of these two interfaces: -//! -//! ```rust,no_run,standalone_crate -//! # #[tokio::main] -//! # async fn main() -> Result<(), Box> { -//! use subxt::client::OnlineClient; -//! use subxt::config::PolkadotConfig; -//! -//! // Create client: -//! let client = OnlineClient::::new().await?; -//! -//! // Get events from the latest block (use .at() to specify a block hash): -//! let events = client.blocks().at_latest().await?.events().await?; -//! // We can use this shorthand too: -//! let events = client.events().at_latest().await?; -//! # Ok(()) -//! # } -//! ``` -//! -//! Once we've loaded our events, we can iterate all events or search for specific events via -//! methods like [`crate::events::Events::iter()`] and [`crate::events::Events::find()`]. See -//! [`crate::events::Events`] and [`crate::events::EventDetails`] for more information. -//! -//! ## Example -//! -//! Here's an example which puts this all together: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/events.rs")] -//! ``` -//! diff --git a/subxt/src/book/usage/light_client.rs b/subxt/src/book/usage/light_client.rs deleted file mode 100644 index 8dbba244fcc..00000000000 --- a/subxt/src/book/usage/light_client.rs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # Light Client -//! -//! The light client based interface uses _Smoldot_ to connect to a _chain_, rather than an individual -//! node. This means that you don't have to trust a specific node when interacting with some chain. -//! -//! This feature is currently unstable. Use the `unstable-light-client` feature flag to enable it. -//! To use this in WASM environments, enable the `web` feature flag and disable the "native" one. -//! -//! To connect to a blockchain network, the Light Client requires a trusted sync state of the network, -//! known as a _chain spec_. One way to obtain this is by making a `sync_state_genSyncSpec` RPC call to a -//! trusted node belonging to the chain that you wish to interact with. -//! -//! Subxt exposes a utility method to obtain the chain spec: [`crate::utils::fetch_chainspec_from_rpc_node()`]. -//! Alternately, you can manually make an RPC call to `sync_state_genSyncSpec` like do (assuming a node running -//! locally on port 9933): -//! -//! ```bash -//! curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "sync_state_genSyncSpec", "params":[true]}' http://localhost:9933/ | jq .result > chain_spec.json -//! ``` -//! -//! ## Examples -//! -//! ### Basic Example -//! -//! This basic example uses some already-known chain specs to connect to a relay chain and parachain -//! and stream information about their finalized blocks: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/light_client_basic.rs")] -//! ``` -//! -//! ### Connecting to a local node -//! -//! This example connects to a local chain and submits a transaction. To run this, you first need -//! to have a local polkadot node running using the following command: -//! -//! ```text -//! polkadot --dev --node-key 0000000000000000000000000000000000000000000000000000000000000001 -//! ``` -//! -//! Then, the following code will download a chain spec from this local node, alter the bootnodes -//! to point only to the local node, and then submit a transaction through it. -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/light_client_local_node.rs")] -//! ``` -//! diff --git a/subxt/src/book/usage/mod.rs b/subxt/src/book/usage/mod.rs deleted file mode 100644 index 77eaf21dd50..00000000000 --- a/subxt/src/book/usage/mod.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! This modules contains examples of using Subxt; follow the links for more: -//! -//! - [Transactions](transactions) -//! - [Storage](storage) -//! - [Events](events) -//! - [Constants](constants) -//! - [Blocks](blocks) -//! - [Runtime APIs](runtime_apis) -//! - [Unstable Light Client](light_client) -//! - [Custom Values](custom_values) -//! - [RPC calls](rpc) -//! -//! Alternately, [go back](super). - -pub mod blocks; -pub mod constants; -pub mod custom_values; -pub mod events; -pub mod light_client; -pub mod rpc; -pub mod runtime_apis; -pub mod storage; -pub mod transactions; diff --git a/subxt/src/book/usage/rpc.rs b/subxt/src/book/usage/rpc.rs deleted file mode 100644 index b3f6468d6fe..00000000000 --- a/subxt/src/book/usage/rpc.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # RPC calls -//! -//! The RPC interface is provided by the [`subxt_rpcs`] crate but re-exposed here. We have: -//! -//! - [`crate::backend::rpc::RpcClient`] and [`crate::backend::rpc::RpcClientT`]: the underlying type and trait -//! which provides a basic RPC client. -//! - [`crate::backend::legacy::rpc_methods`] and [`crate::backend::chain_head::rpc_methods`]: RPc methods that -//! can be instantiated with an RPC client. -//! -//! See [`subxt_rpcs`] or [`crate::ext::subxt_rpcs`] for more. -//! -//! # Example -//! -//! Here's an example which calls some legacy JSON-RPC methods, and reuses the same connection to run a full Subxt client -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/rpc_legacy.rs")] -//! ``` diff --git a/subxt/src/book/usage/runtime_apis.rs b/subxt/src/book/usage/runtime_apis.rs deleted file mode 100644 index d944e051ac2..00000000000 --- a/subxt/src/book/usage/runtime_apis.rs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # Runtime API interface -//! -//! The Runtime API interface allows Subxt to call runtime APIs exposed by certain pallets in order -//! to obtain information. Much like [`super::storage`] and [`super::transactions`], Making a runtime -//! call to a node and getting the response back takes the following steps: -//! -//! 1. [Constructing a runtime call](#constructing-a-runtime-call) -//! 2. [Submitting it to get back the response](#submitting-it) -//! -//! **Note:** Runtime APIs are only available when using V15 metadata, which is currently unstable. -//! You'll need to use `subxt metadata --version unstable` command to download the unstable V15 metadata, -//! and activate the `unstable-metadata` feature in Subxt for it to also use this metadata from a node. The -//! metadata format is unstable because it may change and break compatibility with Subxt at any moment, so -//! use at your own risk. -//! -//! ## Constructing a runtime call -//! -//! We can use the statically generated interface to build runtime calls: -//! -//! ```rust,no_run,standalone_crate -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -//! pub mod polkadot {} -//! -//! let runtime_call = polkadot::apis().metadata().metadata_versions(); -//! ``` -//! -//! Alternately, we can dynamically construct a runtime call. The input type can be a tuple or -//! vec or valid types implementing [`scale_encode::EncodeAsType`], and the output can be anything -//! implementing [`scale_decode::DecodeAsType`]: -//! -//! ```rust,no_run -//! use subxt::dynamic::Value; -//! -//! let runtime_call = subxt::dynamic::runtime_api_call::<(), Vec>( -//! "Metadata", -//! "metadata_versions", -//! () -//! ); -//! ``` -//! -//! All valid runtime calls implement [`crate::runtime_api::Payload`], a trait which -//! describes how to encode the runtime call arguments and what return type to decode from the -//! response. -//! -//! ## Submitting it -//! -//! Runtime calls can be handed to [`crate::runtime_api::RuntimeApi::call()`], which will submit -//! them and hand back the associated response. -//! -//! ### Making a static Runtime API call -//! -//! The easiest way to make a runtime API call is to use the statically generated interface. -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/runtime_apis_static.rs")] -//! ``` -//! -//! ### Making a dynamic Runtime API call -//! -//! If you'd prefer to construct the call at runtime, you can do this using the -//! [`crate::dynamic::runtime_api_call`] method. -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/runtime_apis_dynamic.rs")] -//! ``` -//! -//! ### Making a raw call -//! -//! This is generally discouraged in favour of one of the above, but may be necessary (especially if -//! the node you're talking to does not yet serve V15 metadata). Here, you must manually encode -//! the argument bytes and manually provide a type for the response bytes to be decoded into. -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/runtime_apis_raw.rs")] -//! ``` -//! diff --git a/subxt/src/book/usage/storage.rs b/subxt/src/book/usage/storage.rs deleted file mode 100644 index eba52250522..00000000000 --- a/subxt/src/book/usage/storage.rs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # Storage -//! -//! A Substrate based chain can be seen as a key/value database which starts off at some initial -//! state, and is modified by the extrinsics in each block. This database is referred to as the -//! node storage. With Subxt, you can query this key/value storage with the following steps: -//! -//! 1. [Constructing a storage query](#constructing-a-storage-query). -//! 2. [Submitting the query to get back the associated entry](#submitting-it). -//! 3. [Fetching](#fetching-storage-entries) or [iterating](#iterating-storage-entries) over that -//! entry to retrieve the value or values within it. -//! -//! ## Constructing a storage query -//! -//! We can use the statically generated interface to build storage queries: -//! -//! ```rust,no_run,standalone_crate -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -//! pub mod polkadot {} -//! -//! let storage_query = polkadot::storage().system().account(); -//! ``` -//! -//! Alternately, we can dynamically construct a storage query. A dynamic query needs the input -//! and return value types to be specified, where we can use [`crate::dynamic::Value`] if unsure. -//! -//! ```rust,no_run,standalone_crate -//! use subxt::dynamic::Value; -//! -//! let storage_query = subxt::dynamic::storage::<(Value,), Value>("System", "Account"); -//! ``` -//! -//! ## Submitting it -//! -//! Storage queries can be handed to various functions in [`crate::storage::StorageClientAt`] in order to -//! obtain the associated values (also referred to as storage entries) back. -//! -//! The core API here is [`crate::storage::StorageClientAt::entry()`], which takes a query and looks up the -//! corresponding storage entry, from which you can then fetch or iterate over the values contained within. -//! [`crate::storage::StorageClientAt::fetch()`] and [`crate::storage::StorageClientAt::iter()`] are shorthand -//! for this. -//! -//! When you wish to manually query some entry, [`crate::storage::StorageClientAt::fetch_raw()`] exists to take -//! in raw bytes pointing at some storage value, and return the value bytes if possible. [`crate::storage::StorageClientAt::storage_version()`] -//! and [`crate::storage::StorageClientAt::runtime_wasm_code()`] use this to retrieve the version of some storage API -//! and the current Runtime WASM blob respectively. -//! -//! ### Fetching storage entries -//! -//! The simplest way to access storage entries is to construct a query and then call either -//! [`crate::storage::StorageClientAt::fetch()`]: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/storage_fetch.rs")] -//! ``` -//! -//! For completeness, below is an example using a dynamic query instead. Dynamic queries can define the types that -//! they wish to accept inputs and decode the return value into ([`crate::dynamic::Value`] can be used here anywhere we -//! are not sure of the specific types). -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/storage_fetch_dynamic.rs")] -//! ``` -//! -//! ### Iterating storage entries -//! -//! Many storage entries are maps of values; as well as fetching individual values, it's possible to -//! iterate over all of the values stored at that location: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/storage_iterating.rs")] -//! ``` -//! -//! Here's the same logic but using dynamically constructed values instead: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/storage_iterating_dynamic.rs")] -//! ``` -//! diff --git a/subxt/src/book/usage/transactions.rs b/subxt/src/book/usage/transactions.rs deleted file mode 100644 index c427acd5def..00000000000 --- a/subxt/src/book/usage/transactions.rs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! # Transactions -//! -//! A transaction is an extrinsic that's signed (ie it originates from a given address). The purpose -//! of extrinsics is to modify the node storage in a deterministic way, and so being able to submit -//! transactions to a node is one of the core features of Subxt. -//! -//! > Note: the documentation tends to use the terms _extrinsic_ and _transaction_ interchangeably; -//! > An extrinsic is some data that can be added to a block, and is either signed (a _transaction_) -//! > or unsigned (an _inherent_). Subxt can construct either, but overwhelmingly you'll need to -//! > sign the payload you'd like to submit. -//! -//! Submitting a transaction to a node consists of the following steps: -//! -//! 1. [Constructing a transaction payload to submit](#constructing-a-transaction-payload). -//! 2. [Signing it](#signing-it). -//! 3. [Submitting it (optionally with some additional parameters)](#submitting-it). -//! -//! We'll look at each of these steps in turn. -//! -//! ## Constructing a transaction payload -//! -//! We can use the statically generated interface to build transaction payloads: -//! -//! ```rust,no_run,standalone_crate -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -//! pub mod polkadot {} -//! -//! let remark = "Hello there".as_bytes().to_vec(); -//! let tx_payload = polkadot::tx().system().remark(remark); -//! ``` -//! -//! > If you're not sure what types to import and use to build a given payload, you can use the -//! > `subxt` CLI tool to generate the interface by using something like `subxt codegen | rustfmt > -//! > interface.rs`, to see what types and things are available (or even just to use directly -//! > instead of the [`#[subxt]`](crate::subxt) macro). -//! -//! Alternately, we can dynamically construct a transaction payload. This will not be type checked or -//! validated until it's submitted: -//! -//! ```rust,no_run,standalone_crate -//! use subxt::dynamic::Value; -//! -//! let tx_payload = subxt::dynamic::tx("System", "remark", vec![ -//! Value::from_bytes("Hello there") -//! ]); -//! ``` -//! -//! The [`crate::dynamic::Value`] type is a dynamic type much like a `serde_json::Value` but instead -//! represents any type of data that can be SCALE encoded or decoded. It can be serialized, -//! deserialized and parsed from/to strings. -//! -//! A valid transaction payload is just something that implements the [`crate::tx::Payload`] trait; -//! you can implement this trait on your own custom types if the built-in ones are not suitable for -//! your needs. -//! -//! ## Signing it -//! -//! You'll normally need to sign an extrinsic to prove that it originated from an account that you -//! control. To do this, you will typically first create a [`crate::tx::Signer`] instance, which tells -//! Subxt who the extrinsic is from, and takes care of signing the relevant details to prove this. -//! -//! There are two main ways to create a compatible signer instance: -//! 1. The `subxt_signer` crate provides a WASM compatible implementation of [`crate::tx::Signer`] -//! for chains which require sr25519 or ecdsa signatures (requires the `subxt` feature to be enabled). -//! 2. Alternately, implement your own [`crate::tx::Signer`] instance by wrapping it in a new type pattern. -//! -//! Going for 1 leads to fewer dependencies being imported and WASM compatibility out of the box via -//! the `web` feature flag. Going for 2 is useful if you're already using the Substrate dependencies or -//! need additional signing algorithms that `subxt_signer` doesn't support, and don't care about WASM -//! compatibility. -//! -//! Because 2 is more complex and require more code, we'll focus on 1 here. -//! For 2, see the example in `subxt/examples/substrate_compat_signer.rs` how -//! you can integrate things like sp_core's signer in subxt. -//! -//! Let's go through how to create a signer using the `subxt_signer` crate: -//! -//! ```rust,standalone_crate -//! use subxt::config::PolkadotConfig; -//! use std::str::FromStr; -//! -//! use subxt_signer::{SecretUri, sr25519}; -//! -//! // Get hold of a `Signer` for a test account: -//! let alice = sr25519::dev::alice(); -//! -//! // Or generate a keypair, here from an SURI: -//! let uri = SecretUri::from_str("vessel ladder alter error federal sibling chat ability sun glass valve picture/0/1///Password") -//! .expect("valid URI"); -//! let keypair = sr25519::Keypair::from_uri(&uri) -//! .expect("valid keypair"); -//!``` -//! -//! After initializing the signer, let's also go through how to create a transaction and sign it: -//! -//! ```rust,no_run,standalone_crate -//! # #[tokio::main] -//! # async fn main() -> Result<(), Box> { -//! use subxt::client::OnlineClient; -//! use subxt::config::PolkadotConfig; -//! use subxt::dynamic::Value; -//! -//! // Create client: -//! let client = OnlineClient::::new().await?; -//! -//! // Create a dummy tx payload to sign: -//! let payload = subxt::dynamic::tx("System", "remark", vec![ -//! Value::from_bytes("Hello there") -//! ]); -//! -//! // Construct the tx but don't sign it. The account nonce here defaults to 0. -//! // You can use `create_partial` to fetch the correct nonce. -//! let mut partial_tx = client.tx().create_partial_offline( -//! &payload, -//! Default::default() -//! )?; -//! -//! // Fetch the payload that needs to be signed: -//! let signer_payload = partial_tx.signer_payload(); -//! -//! // ... At this point, we can hand off the `signer_payload` to be signed externally. -//! // Ultimately we need to be given back a `signature` (or really, anything -//! // that can be SCALE encoded) and an `address`: -//! let signature; -//! let account_id; -//! # use subxt::tx::Signer; -//! # let signer = subxt_signer::sr25519::dev::alice(); -//! # signature = signer.sign(&signer_payload).into(); -//! # account_id = signer.public_key().to_account_id(); -//! -//! // Now we can build an tx, which one can call `submit` or `submit_and_watch` -//! // on to submit to a node and optionally watch the status. -//! let tx = partial_tx.sign_with_account_and_signature( -//! &account_id, -//! &signature -//! ); -//! # Ok(()) -//! # } -//! ``` -//! -//! ## Submitting it -//! -//! Once we have signed the transaction, we need to submit it. -//! -//! ### The high level API -//! -//! The highest level approach to doing this is to call -//! [`crate::tx::TxClient::sign_and_submit_then_watch_default`]. This hands back a -//! [`crate::tx::TxProgress`] struct which will monitor the transaction status. We can then call -//! [`crate::tx::TxProgress::wait_for_finalized_success()`] to wait for this transaction to make it -//! into a finalized block, check for an `ExtrinsicSuccess` event, and then hand back the events for -//! inspection. This looks like: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/tx_basic.rs")] -//! ``` -//! -//! ### Providing transaction parameters -//! -//! If you'd like to provide parameters (such as mortality) to the transaction, you can use -//! [`crate::tx::TxClient::sign_and_submit_then_watch`] instead: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/tx_with_params.rs")] -//! ``` -//! -//! This example doesn't wait for the transaction to be included in a block; it just submits it and -//! hopes for the best! -//! -//! ### Boxing transaction payloads -//! -//! Transaction payloads can be boxed so that they all share a common type and can be stored together. -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/tx_boxed.rs")] -//! ``` -//! -//! ### Custom handling of transaction status updates -//! -//! If you'd like more control or visibility over exactly which status updates are being emitted for -//! the transaction, you can monitor them as they are emitted and react however you choose: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/tx_status_stream.rs")] -//! ``` -//! -//! ### Signing transactions externally -//! -//! Subxt also allows you to get hold of the signer payload and hand that off to something else to be -//! signed. The signature can then be provided back to Subxt to build the final transaction to submit: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/tx_partial.rs")] -//! ``` -//! -//! Take a look at the API docs for [`crate::tx::TxProgress`], [`crate::tx::TxStatus`] and -//! [`crate::tx::TxInBlock`] for more options. -//! diff --git a/subxt/src/client.rs b/subxt/src/client.rs new file mode 100644 index 00000000000..a3b93dfccd0 --- /dev/null +++ b/subxt/src/client.rs @@ -0,0 +1,173 @@ +//! This module exposes the entrypoint to connect and interact with chains. +//! +//! - See [`OnlineClient`] for instantiating a standard client which is connected to +//! a chain and capable of interacting with it. +//! - See [`OfflineClient`] if you have no network connection but want to perform certain +//! actions against some chain. +//! +//! After instantiating a client, you'll typically then select a block to work against +//! via something like [`OnlineClient::at_block`] or [`OfflineClient::at_block`]. +//! These hand back [`OnlineClientAtBlock`] or [`OfflineClientAtBlock`], which expose +//! various methods available online or offline at the given block. + +mod offline_client; +mod online_client; + +use crate::config::{Config, HashFor}; +use crate::constants::ConstantsClient; +use crate::custom_values::CustomValuesClient; +use crate::error::BlockError; +use crate::events::EventsClient; +use crate::extrinsics::ExtrinsicsClient; +use crate::runtime_apis::RuntimeApisClient; +use crate::storage::StorageClient; +use crate::transactions::TransactionsClient; +use crate::view_functions::ViewFunctionsClient; +use core::marker::PhantomData; +use subxt_metadata::Metadata; + +pub use offline_client::{OfflineClient, OfflineClientAtBlockImpl, OfflineClientAtBlockT}; +pub use online_client::{ + BlockNumberOrRef, OnlineClient, OnlineClientAtBlockImpl, OnlineClientAtBlockT, +}; + +/// This represents a client at a specific block number, and is created by calling either +/// [`OnlineClient::at_block`] or [`OfflineClient::at_block`]. +/// +/// This wraps a client implementation, which will either be [`OfflineClientAtBlockImpl`] +/// or [`OnlineClientAtBlockImpl`]. Prefer to use the type aliases [`OfflineClientAtBlock`] +/// and [`OnlineClientAtBlock`] if you need to refer to the concrete instances of this. +#[derive(Clone, Debug)] +pub struct ClientAtBlock { + pub(crate) client: Client, + marker: PhantomData, +} + +impl ClientAtBlock { + /// Construct a new client at some block. + pub(crate) fn new(client: Client) -> Self { + Self { + client, + marker: PhantomData, + } + } +} + +impl ClientAtBlock +where + T: Config, + Client: OfflineClientAtBlockT, +{ + /// Construct and submit transactions. This is a + /// shorthand to [`Self::transactions()`]. + pub fn tx(&self) -> TransactionsClient { + self.transactions() + } + + /// Construct and submit transactions. + pub fn transactions(&self) -> TransactionsClient { + TransactionsClient::new(self.client.clone()) + } + + /// Access storage at this block. + pub fn storage(&self) -> StorageClient<'_, T, Client> { + StorageClient::new(&self.client) + } + + /// Access constants at this block. + pub fn constants(&self) -> ConstantsClient<'_, T, Client> { + ConstantsClient::new(&self.client) + } + + /// Access custom values at this block. + pub fn custom_values(&self) -> CustomValuesClient<'_, T, Client> { + CustomValuesClient::new(&self.client) + } + + /// Work with the extrinsics in this block. + pub fn extrinsics(&self) -> ExtrinsicsClient<'_, T, Client> { + ExtrinsicsClient::new(&self.client) + } + + /// Work with the events at this block. + pub fn events(&self) -> EventsClient<'_, T, Client> { + EventsClient::new(&self.client) + } + + /// Access runtime APIs at this block. + pub fn runtime_apis(&self) -> RuntimeApisClient<'_, T, Client> { + RuntimeApisClient::new(&self.client) + } + + /// Access Pallet View Functions at this block. + pub fn view_functions(&self) -> ViewFunctionsClient<'_, T, Client> { + ViewFunctionsClient::new(&self.client) + } + + /// Obtain a reference to the metadata. + pub fn metadata_ref(&self) -> &Metadata { + self.client.metadata_ref() + } + + /// The current block number. + pub fn block_number(&self) -> u64 { + self.client.block_number() + } + + /// The spec version at this block. + pub fn spec_version(&self) -> u32 { + self.client.spec_version() + } + + /// The transaction version at this block. + /// Note: This is different from the value encoded at the start of extrinsics. + pub fn transaction_version(&self) -> u32 { + self.client.transaction_version() + } + + /// Return the genesis hash, if it is available. if you're using an + /// [`OnlineClientAtBlock`], this will always be present. + pub fn genesis_hash(&self) -> Option> { + self.client.genesis_hash() + } +} + +impl ClientAtBlock +where + T: Config, + Client: OnlineClientAtBlockT, +{ + /// Return the [`OnlineClient`] behind this. + pub fn online_client(&self) -> OnlineClient { + self.client.client() + } + + /// The current block hash. + pub fn block_hash(&self) -> HashFor { + self.client.block_hash() + } + + /// The header for this block. + pub async fn block_header(&self) -> Result { + let block_hash = self.block_hash(); + let header = self + .client + .backend() + .block_header(block_hash) + .await + .map_err(|e| BlockError::CouldNotDownloadBlockHeader { + block_hash: block_hash.into(), + reason: e, + })? + .ok_or_else(|| BlockError::BlockNotFound { + block_hash: block_hash.into(), + })?; + Ok(header) + } +} + +/// An offline client at a specific block. +pub type OfflineClientAtBlock = ClientAtBlock>; + +/// An online client at a specific block. +pub type OnlineClientAtBlock = ClientAtBlock>; diff --git a/subxt/src/client/mod.rs b/subxt/src/client/mod.rs deleted file mode 100644 index 8b9c917eec6..00000000000 --- a/subxt/src/client/mod.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! This module provides two clients that can be used to work with -//! transactions, storage and events. The [`OfflineClient`] works -//! entirely offline and can be passed to any function that doesn't -//! require network access. The [`OnlineClient`] requires network -//! access. - -mod offline_client; -mod online_client; - -pub use offline_client::{OfflineClient, OfflineClientT}; -pub use online_client::{ - ClientRuntimeUpdater, OnlineClient, OnlineClientT, RuntimeUpdaterStream, Update, -}; -pub use subxt_core::client::{ClientState, RuntimeVersion}; diff --git a/subxt/src/client/offline_client.rs b/subxt/src/client/offline_client.rs index adcb413d4d0..af5c45c8e07 100644 --- a/subxt/src/client/offline_client.rs +++ b/subxt/src/client/offline_client.rs @@ -1,203 +1,111 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::custom_values::CustomValuesClient; -use crate::{ - Metadata, - blocks::BlocksClient, - config::{Config, HashFor}, - constants::ConstantsClient, - events::EventsClient, - runtime_api::RuntimeApiClient, - storage::StorageClient, - tx::TxClient, - view_functions::ViewFunctionsClient, -}; - -use derive_where::derive_where; -use std::sync::Arc; -use subxt_core::client::{ClientState, RuntimeVersion}; - -/// A trait representing a client that can perform -/// offline-only actions. -pub trait OfflineClientT: Clone + Send + Sync + 'static { - /// Return the provided [`Metadata`]. - fn metadata(&self) -> Metadata; - - /// Return the provided genesis hash. - fn genesis_hash(&self) -> HashFor; - - /// Return the provided [`RuntimeVersion`]. - fn runtime_version(&self) -> RuntimeVersion; - - /// Return the hasher used on the chain. - fn hasher(&self) -> T::Hasher; - - /// Return the [subxt_core::client::ClientState] (metadata, runtime version and genesis hash). - fn client_state(&self) -> ClientState { - ClientState { - genesis_hash: self.genesis_hash(), - runtime_version: self.runtime_version(), - metadata: self.metadata(), - } - } - - /// Work with transactions. - fn tx(&self) -> TxClient { - TxClient::new(self.clone()) - } - - /// Work with events. - fn events(&self) -> EventsClient { - EventsClient::new(self.clone()) - } - - /// Work with storage. - fn storage(&self) -> StorageClient { - StorageClient::new(self.clone()) - } - - /// Access constants. - fn constants(&self) -> ConstantsClient { - ConstantsClient::new(self.clone()) - } - - /// Work with blocks. - fn blocks(&self) -> BlocksClient { - BlocksClient::new(self.clone()) - } - - /// Work with runtime APIs. - fn runtime_api(&self) -> RuntimeApiClient { - RuntimeApiClient::new(self.clone()) - } - - /// Work with View Functions. - fn view_functions(&self) -> ViewFunctionsClient { - ViewFunctionsClient::new(self.clone()) - } - - /// Work this custom types. - fn custom_values(&self) -> CustomValuesClient { - CustomValuesClient::new(self.clone()) - } -} - -/// A client that is capable of performing offline-only operations. -/// Can be constructed as long as you can populate the required fields. -#[derive_where(Debug, Clone)] +use crate::client::ClientAtBlock; +use crate::config::{Config, HashFor, Hasher}; +use crate::error::OfflineClientAtBlockError; +use crate::metadata::{ArcMetadata, Metadata}; + +/// A client which does not require a connection to a chain, and can perform certain +/// actions which don't require a network connection. +#[derive(Clone, Debug)] pub struct OfflineClient { - inner: Arc>, - hasher: T::Hasher, + /// The configuration for this client. + config: T, } impl OfflineClient { - /// Construct a new [`OfflineClient`], providing - /// the necessary runtime and compile-time arguments. - pub fn new( - genesis_hash: HashFor, - runtime_version: RuntimeVersion, - metadata: impl Into, - ) -> OfflineClient { - let metadata = metadata.into(); - let hasher = ::new(&metadata); - - OfflineClient { + /// Create a new [`OfflineClient`] with the given configuration. + pub fn new(config: T) -> Self { + OfflineClient { config } + } + + /// Pick the block height at which to operate. This references data from the + /// [`OfflineClient`] it's called on, and so cannot outlive it. + pub fn at_block( + &self, + block_number: impl Into, + ) -> Result>, OfflineClientAtBlockError> { + let block_number = block_number.into(); + let (spec_version, transaction_version) = self + .config + .spec_and_transaction_version_for_block_number(block_number) + .ok_or(OfflineClientAtBlockError::SpecVersionNotFound { block_number })?; + + let metadata = self + .config + .metadata_for_spec_version(spec_version) + .ok_or(OfflineClientAtBlockError::MetadataNotFound { spec_version })?; + + let genesis_hash = self.config.genesis_hash(); + + let hasher = ::new(&metadata); + + let offline_client_at_block = OfflineClientAtBlockImpl { + metadata, + block_number, + genesis_hash, + spec_version, hasher, - inner: Arc::new(ClientState { - genesis_hash, - runtime_version, - metadata, - }), - } - } - - /// Return the genesis hash. - pub fn genesis_hash(&self) -> HashFor { - self.inner.genesis_hash - } - - /// Return the runtime version. - pub fn runtime_version(&self) -> RuntimeVersion { - self.inner.runtime_version - } - - /// Return the [`Metadata`] used in this client. - pub fn metadata(&self) -> Metadata { - self.inner.metadata.clone() - } - - /// Return the hasher used for the chain. - pub fn hasher(&self) -> T::Hasher { - self.hasher - } - - // Just a copy of the most important trait methods so that people - // don't need to import the trait for most things: - - /// Work with transactions. - pub fn tx(&self) -> TxClient { - >::tx(self) - } - - /// Work with events. - pub fn events(&self) -> EventsClient { - >::events(self) - } + transaction_version, + }; - /// Work with storage. - pub fn storage(&self) -> StorageClient { - >::storage(self) - } - - /// Access constants. - pub fn constants(&self) -> ConstantsClient { - >::constants(self) + Ok(ClientAtBlock::new(offline_client_at_block)) } +} - /// Work with blocks. - pub fn blocks(&self) -> BlocksClient { - >::blocks(self) - } +/// An implementation of the [`OfflineClientAtBlockT`] trait, which is used in conjunction +/// with [`crate::client::ClientAtBlock`] to provide a working client. You won't tend to need this +/// type and instead should prefer to refer to [`crate::client::OfflineClientAtBlock`]. +#[derive(Clone)] +pub struct OfflineClientAtBlockImpl { + metadata: ArcMetadata, + block_number: u64, + genesis_hash: Option>, + spec_version: u32, + hasher: T::Hasher, + transaction_version: u32, +} - /// Work with runtime APIs. - pub fn runtime_api(&self) -> RuntimeApiClient { - >::runtime_api(self) - } +/// This represents an offline-only client at a specific block. +#[doc(hidden)] +pub trait OfflineClientAtBlockT: Clone { + /// Get a reference to the metadata appropriate for this block. + fn metadata_ref(&self) -> &Metadata; + /// Get a clone of the metadata appropriate for this block. + fn metadata(&self) -> ArcMetadata; + /// The block number we're operating at. + fn block_number(&self) -> u64; + /// Return the genesis hash for the chain if it is known. + fn genesis_hash(&self) -> Option>; + /// The spec version at the current block. + fn spec_version(&self) -> u32; + /// Return a hasher that works at the current block. + fn hasher(&self) -> &T::Hasher; + /// The transaction version at the current block. + /// + /// Note: This is _not_ the same as the transaction version that + /// is encoded at the beginning of transactions (ie 4 or 5). + fn transaction_version(&self) -> u32; +} - /// Work with View Functions. - pub fn view_functions(&self) -> ViewFunctionsClient { - >::view_functions(self) +impl OfflineClientAtBlockT for OfflineClientAtBlockImpl { + fn metadata_ref(&self) -> &Metadata { + &self.metadata } - - /// Access custom types - pub fn custom_values(&self) -> CustomValuesClient { - >::custom_values(self) + fn metadata(&self) -> ArcMetadata { + self.metadata.clone() } -} - -impl OfflineClientT for OfflineClient { - fn genesis_hash(&self) -> HashFor { - self.genesis_hash() + fn block_number(&self) -> u64 { + self.block_number } - fn runtime_version(&self) -> RuntimeVersion { - self.runtime_version() + fn genesis_hash(&self) -> Option> { + self.genesis_hash } - fn metadata(&self) -> Metadata { - self.metadata() + fn spec_version(&self) -> u32 { + self.spec_version } - fn hasher(&self) -> T::Hasher { - self.hasher() + fn transaction_version(&self) -> u32 { + self.transaction_version } -} - -// For ergonomics; cloning a client is deliberately fairly cheap (via Arc), -// so this allows users to pass references to a client rather than explicitly -// cloning. This is partly for consistency with OnlineClient, which can be -// easily converted into an OfflineClient for ergonomics. -impl<'a, T: Config> From<&'a OfflineClient> for OfflineClient { - fn from(c: &'a OfflineClient) -> Self { - c.clone() + fn hasher(&self) -> &T::Hasher { + &self.hasher } } diff --git a/subxt/src/client/online_client.rs b/subxt/src/client/online_client.rs index bdc9b03e69b..1211ad38a86 100644 --- a/subxt/src/client/online_client.rs +++ b/subxt/src/client/online_client.rs @@ -1,580 +1,596 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use super::{OfflineClient, OfflineClientT}; -use crate::custom_values::CustomValuesClient; -use crate::{ - Metadata, - backend::{Backend, BackendExt, StreamOfResults, legacy::LegacyBackend, rpc::RpcClient}, - blocks::{BlockRef, BlocksClient}, - config::{Config, HashFor}, - constants::ConstantsClient, - error::{BackendError, OnlineClientError, RuntimeUpdateeApplyError, RuntimeUpdaterError}, - events::EventsClient, - runtime_api::RuntimeApiClient, - storage::StorageClient, - tx::TxClient, - view_functions::ViewFunctionsClient, -}; -use derive_where::derive_where; -use futures::TryFutureExt; -use futures::future; -use std::sync::{Arc, RwLock}; -use subxt_core::client::{ClientState, RuntimeVersion}; - -/// A trait representing a client that can perform -/// online actions. -pub trait OnlineClientT: OfflineClientT { - /// Return a backend that can be used to communicate with a node. - fn backend(&self) -> &dyn Backend; -} +mod block_number_or_ref; +mod blocks; + +use super::ClientAtBlock; +use super::OfflineClientAtBlockT; +use crate::backend::{Backend, BlockRef, CombinedBackend}; +use crate::config::{Config, HashFor, Hasher, Header}; +use crate::error::{BlocksError, OnlineClientAtBlockError}; +use crate::metadata::{ArcMetadata, Metadata}; +use crate::transactions::TransactionsClient; +use blocks::Blocks; +use codec::{Compact, Decode, Encode}; +use core::marker::PhantomData; +use frame_decode::helpers::ToTypeRegistry; +use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed}; +use scale_info_legacy::TypeRegistrySet; +use std::sync::Arc; +use subxt_rpcs::RpcClient; + +#[cfg(feature = "jsonrpsee")] +use crate::error::OnlineClientError; + +pub use block_number_or_ref::BlockNumberOrRef; -/// A client that can be used to perform API calls (that is, either those -/// requiring an [`OfflineClientT`] or those requiring an [`OnlineClientT`]). -#[derive_where(Clone)] +/// A client which requires a connection to a chain, and allows interacting with it. +#[derive(Clone, Debug)] pub struct OnlineClient { - inner: Arc>>, - backend: Arc>, + inner: Arc>, } -#[derive_where(Debug)] -struct Inner { +struct OnlineClientInner { + /// The configuration for this client. + config: T, + /// Chain genesis hash. Needed to construct transactions, + /// so we obtain it up front on constructing this. genesis_hash: HashFor, - runtime_version: RuntimeVersion, - metadata: Metadata, - hasher: T::Hasher, + /// The RPC methods used to communicate with the node. + backend: Arc>, } -impl std::fmt::Debug for OnlineClient { +impl std::fmt::Debug for OnlineClientInner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("Client") - .field("rpc", &"RpcClient") - .field("inner", &self.inner) + f.debug_struct("OnlineClientInner") + .field("config", &"") + .field("backend", &"Arc") .finish() } } -// The default constructors assume Jsonrpsee. -#[cfg(feature = "jsonrpsee")] -#[cfg_attr(docsrs, doc(cfg(feature = "jsonrpsee")))] impl OnlineClient { /// Construct a new [`OnlineClient`] using default settings which /// point to a locally running node on `ws://127.0.0.1:9944`. - pub async fn new() -> Result, OnlineClientError> { + /// + /// **Note:** This will only work if the local node is an archive node. + #[cfg(all(feature = "jsonrpsee", feature = "runtime"))] + pub async fn new(config: T) -> Result, OnlineClientError> { let url = "ws://127.0.0.1:9944"; - OnlineClient::from_url(url).await + OnlineClient::from_url(config, url).await } /// Construct a new [`OnlineClient`], providing a URL to connect to. - pub async fn from_url(url: impl AsRef) -> Result, OnlineClientError> { - subxt_rpcs::utils::validate_url_is_secure(url.as_ref())?; - OnlineClient::from_insecure_url(url).await + #[cfg(all(feature = "jsonrpsee", feature = "runtime"))] + pub async fn from_url( + config: T, + url: impl AsRef, + ) -> Result, OnlineClientError> { + let url_str = url.as_ref(); + if !subxt_rpcs::utils::url_is_secure(url_str).map_err(OnlineClientError::RpcError)? { + return Err(OnlineClientError::RpcError(subxt_rpcs::Error::InsecureUrl( + url_str.to_string(), + ))); + } + OnlineClient::from_insecure_url(config, url).await } /// Construct a new [`OnlineClient`], providing a URL to connect to. /// /// Allows insecure URLs without SSL encryption, e.g. (http:// and ws:// URLs). + #[cfg(all(feature = "jsonrpsee", feature = "runtime"))] pub async fn from_insecure_url( + config: T, url: impl AsRef, ) -> Result, OnlineClientError> { - let client = RpcClient::from_insecure_url(url).await?; - let backend = LegacyBackend::builder().build(client); - OnlineClient::from_backend(Arc::new(backend)).await + let rpc_client = RpcClient::from_insecure_url(url).await?; + OnlineClient::from_rpc_client(config, rpc_client).await } -} -impl OnlineClient { /// Construct a new [`OnlineClient`] by providing an [`RpcClient`] to drive the connection. /// This will use the current default [`Backend`], which may change in future releases. + #[cfg(all(feature = "jsonrpsee", feature = "runtime"))] pub async fn from_rpc_client( + config: T, rpc_client: impl Into, ) -> Result, OnlineClientError> { let rpc_client = rpc_client.into(); - let backend = Arc::new(LegacyBackend::builder().build(rpc_client)); - OnlineClient::from_backend(backend).await - } - - /// Construct a new [`OnlineClient`] by providing an RPC client along with the other - /// necessary details. This will use the current default [`Backend`], which may change - /// in future releases. - /// - /// # Warning - /// - /// This is considered the most primitive and also error prone way to - /// instantiate a client; the genesis hash, metadata and runtime version provided will - /// entirely determine which node and blocks this client will be able to interact with, - /// and whether it will be able to successfully do things like submit transactions. - /// - /// If you're unsure what you're doing, prefer one of the alternate methods to instantiate - /// a client. - pub fn from_rpc_client_with( - genesis_hash: HashFor, - runtime_version: RuntimeVersion, - metadata: impl Into, - rpc_client: impl Into, - ) -> Result, OnlineClientError> { - let rpc_client = rpc_client.into(); - let backend = Arc::new(LegacyBackend::builder().build(rpc_client)); - OnlineClient::from_backend_with(genesis_hash, runtime_version, metadata, backend) + let backend = CombinedBackend::builder() + .build_with_background_driver(rpc_client) + .await + .map_err(OnlineClientError::CannotBuildCombinedBackend)?; + let backend: Arc> = Arc::new(backend); + OnlineClient::from_backend(config, backend).await } /// Construct a new [`OnlineClient`] by providing an underlying [`Backend`] - /// implementation to power it. Other details will be obtained from the chain. - pub async fn from_backend>( - backend: Arc, + /// implementation to power it. + pub async fn from_backend( + config: T, + backend: impl Into>>, ) -> Result, OnlineClientError> { - let latest_block = backend - .latest_finalized_block_ref() - .await - .map_err(OnlineClientError::CannotGetLatestFinalizedBlock)?; - - let (genesis_hash, runtime_version, metadata) = future::join3( - backend + let backend = backend.into(); + let genesis_hash = match config.genesis_hash() { + Some(hash) => hash, + None => backend .genesis_hash() - .map_err(OnlineClientError::CannotGetGenesisHash), - backend - .current_runtime_version() - .map_err(OnlineClientError::CannotGetCurrentRuntimeVersion), - OnlineClient::fetch_metadata(&*backend, latest_block.hash()) - .map_err(OnlineClientError::CannotFetchMetadata), - ) - .await; - - OnlineClient::from_backend_with(genesis_hash?, runtime_version?, metadata?, backend) - } - - /// Construct a new [`OnlineClient`] by providing all of the underlying details needed - /// to make it work. - /// - /// # Warning - /// - /// This is considered the most primitive and also error prone way to - /// instantiate a client; the genesis hash, metadata and runtime version provided will - /// entirely determine which node and blocks this client will be able to interact with, - /// and whether it will be able to successfully do things like submit transactions. - /// - /// If you're unsure what you're doing, prefer one of the alternate methods to instantiate - /// a client. - pub fn from_backend_with>( - genesis_hash: HashFor, - runtime_version: RuntimeVersion, - metadata: impl Into, - backend: Arc, - ) -> Result, OnlineClientError> { - use subxt_core::config::Hasher; - - let metadata = metadata.into(); - let hasher = T::Hasher::new(&metadata); + .await + .map_err(OnlineClientError::CannotGetGenesisHash)?, + }; Ok(OnlineClient { - inner: Arc::new(RwLock::new(Inner { + inner: Arc::new(OnlineClientInner { + config, genesis_hash, - runtime_version, - metadata, - hasher, - })), - backend, + backend, + }), }) } - /// Fetch the metadata from substrate using the runtime API. - async fn fetch_metadata( - backend: &dyn Backend, - block_hash: HashFor, - ) -> Result { - #[cfg(feature = "unstable-metadata")] - { - /// The unstable metadata version number. - const UNSTABLE_METADATA_VERSION: u32 = u32::MAX; - - // Try to fetch the latest unstable metadata, if that fails fall back to - // fetching the latest stable metadata. - match backend - .metadata_at_version(UNSTABLE_METADATA_VERSION, block_hash) - .await - { - Ok(bytes) => Ok(bytes), - Err(_) => OnlineClient::fetch_latest_stable_metadata(backend, block_hash).await, - } - } - - #[cfg(not(feature = "unstable-metadata"))] - OnlineClient::fetch_latest_stable_metadata(backend, block_hash).await - } - - /// Fetch the latest stable metadata from the node. - async fn fetch_latest_stable_metadata( - backend: &dyn Backend, - block_hash: HashFor, - ) -> Result { - // The metadata versions we support in Subxt, from newest to oldest. - use subxt_metadata::SUPPORTED_METADATA_VERSIONS; - - // Try to fetch each version that we support in order from newest to oldest. - for version in SUPPORTED_METADATA_VERSIONS { - if let Ok(bytes) = backend.metadata_at_version(version, block_hash).await { - return Ok(bytes); - } - } - - // If that fails, fetch the metadata V14 using the old API. - backend.legacy_metadata(block_hash).await - } - - /// Create an object which can be used to keep the runtime up to date - /// in a separate thread. - /// - /// # Example - /// - /// ```rust,no_run,standalone_crate - /// # #[tokio::main] - /// # async fn main() { - /// use subxt::{ OnlineClient, PolkadotConfig }; - /// - /// let client = OnlineClient::::new().await.unwrap(); - /// - /// // high level API. - /// - /// let update_task = client.updater(); - /// tokio::spawn(async move { - /// update_task.perform_runtime_updates().await; - /// }); - /// - /// - /// // low level API. - /// - /// let updater = client.updater(); - /// tokio::spawn(async move { - /// let mut update_stream = updater.runtime_updates().await.unwrap(); - /// - /// while let Ok(update) = update_stream.next().await { - /// let version = update.runtime_version().spec_version; - /// - /// match updater.apply_update(update) { - /// Ok(()) => { - /// println!("Upgrade to version: {} successful", version) - /// } - /// Err(e) => { - /// println!("Upgrade to version {} failed {:?}", version, e); - /// } - /// }; - /// } - /// }); - /// # } - /// ``` - pub fn updater(&self) -> ClientRuntimeUpdater { - ClientRuntimeUpdater(self.clone()) + /// Return the genesis hash of the connected chain. + pub fn genesis_hash(&self) -> HashFor { + self.inner.genesis_hash } - /// Return the hasher configured for hashing blocks and extrinsics. - pub fn hasher(&self) -> T::Hasher { - self.inner.read().expect("shouldn't be poisoned").hasher + /// Construct, sign and submit transactions. This is an alias for `self.at_current_block().await?.transactions()`. + pub async fn transactions( + &self, + ) -> Result>, OnlineClientAtBlockError> { + let at_block = self.at_current_block().await?; + Ok(at_block.transactions()) } - /// Return the [`Metadata`] used in this client. - pub fn metadata(&self) -> Metadata { - let inner = self.inner.read().expect("shouldn't be poisoned"); - inner.metadata.clone() + /// Construct, sign and submit transactions. This is an alias for `self.transactions()`. + pub async fn tx( + &self, + ) -> Result>, OnlineClientAtBlockError> { + self.transactions().await } - /// Change the [`Metadata`] used in this client. - /// - /// # Warning + /// Obtain a stream of all blocks imported by the node. /// - /// Setting custom metadata may leave Subxt unable to work with certain blocks, - /// subscribe to latest blocks or submit valid transactions. - pub fn set_metadata(&self, metadata: impl Into) { - let mut inner = self.inner.write().expect("shouldn't be poisoned"); - inner.metadata = metadata.into(); - } - - /// Return the genesis hash. - pub fn genesis_hash(&self) -> HashFor { - let inner = self.inner.read().expect("shouldn't be poisoned"); - inner.genesis_hash - } + /// **Note:** You probably want to use [`Self::stream_blocks()`] most of + /// the time. Blocks returned here may be pruned at any time and become inaccessible, + /// leading to errors when trying to work with them. + pub async fn stream_all_blocks(&self) -> Result, BlocksError> { + // We need a hasher to know how to hash things. Thus, we need metadata to instantiate + // the hasher, so let's use the current block. + let current_block = self + .at_current_block() + .await + .map_err(BlocksError::CannotGetCurrentBlock)?; + let hasher = current_block.client.hasher.clone(); - /// Change the genesis hash used in this client. - /// - /// # Warning - /// - /// Setting a custom genesis hash may leave Subxt unable to - /// submit valid transactions. - pub fn set_genesis_hash(&self, genesis_hash: HashFor) { - let mut inner = self.inner.write().expect("shouldn't be poisoned"); - inner.genesis_hash = genesis_hash; - } + let stream = self + .inner + .backend + .stream_all_block_headers(hasher) + .await + .map_err(BlocksError::CannotGetBlockHeaderStream)?; - /// Return the runtime version. - pub fn runtime_version(&self) -> RuntimeVersion { - let inner = self.inner.read().expect("shouldn't be poisoned"); - inner.runtime_version + Ok(Blocks::from_headers_stream(self.clone(), stream)) } - /// Change the [`RuntimeVersion`] used in this client. - /// - /// # Warning + /// Obtain a stream of blocks imported by the node onto the current best fork. /// - /// Setting a custom runtime version may leave Subxt unable to - /// submit valid transactions. - pub fn set_runtime_version(&self, runtime_version: RuntimeVersion) { - let mut inner = self.inner.write().expect("shouldn't be poisoned"); - inner.runtime_version = runtime_version; - } + /// **Note:** You probably want to use [`Self::stream_blocks()`] most of + /// the time. Blocks returned here may be pruned at any time and become inaccessible, + /// leading to errors when trying to work with them. + pub async fn stream_best_blocks(&self) -> Result, BlocksError> { + // We need a hasher to know how to hash things. Thus, we need metadata to instantiate + // the hasher, so let's use the current block. + let current_block = self + .at_current_block() + .await + .map_err(BlocksError::CannotGetCurrentBlock)?; + let hasher = current_block.client.hasher.clone(); - /// Return an RPC client to make raw requests with. - pub fn backend(&self) -> &dyn Backend { - &*self.backend - } + let stream = self + .inner + .backend + .stream_best_block_headers(hasher) + .await + .map_err(BlocksError::CannotGetBlockHeaderStream)?; - /// Return an offline client with the same configuration as this. - pub fn offline(&self) -> OfflineClient { - let inner = self.inner.read().expect("shouldn't be poisoned"); - OfflineClient::new( - inner.genesis_hash, - inner.runtime_version, - inner.metadata.clone(), - ) + Ok(Blocks::from_headers_stream(self.clone(), stream)) } - // Just a copy of the most important trait methods so that people - // don't need to import the trait for most things: + /// Obtain a stream of finalized blocks. + pub async fn stream_blocks(&self) -> Result, BlocksError> { + // We need a hasher to know how to hash things. Thus, we need metadata to instantiate + // the hasher, so let's use the current block. + let current_block = self + .at_current_block() + .await + .map_err(BlocksError::CannotGetCurrentBlock)?; + let hasher = current_block.client.hasher.clone(); - /// Work with transactions. - pub fn tx(&self) -> TxClient { - >::tx(self) - } + let stream = self + .inner + .backend + .stream_finalized_block_headers(hasher) + .await + .map_err(BlocksError::CannotGetBlockHeaderStream)?; - /// Work with events. - pub fn events(&self) -> EventsClient { - >::events(self) + Ok(Blocks::from_headers_stream(self.clone(), stream)) } - /// Work with storage. - pub fn storage(&self) -> StorageClient { - >::storage(self) - } + /// Instantiate a client to work at the current finalized block _at the time of instantiation_. + /// This does not track new blocks. + pub async fn at_current_block( + &self, + ) -> Result>, OnlineClientAtBlockError> { + let latest_block = self + .inner + .backend + .latest_finalized_block_ref() + .await + .map_err(|e| OnlineClientAtBlockError::CannotGetCurrentBlock { reason: e })?; + + self.at_block(latest_block).await + } + + /// Instantiate a client for working at a specific block. + pub async fn at_block( + &self, + number_or_hash: impl Into>, + ) -> Result>, OnlineClientAtBlockError> { + let number_or_hash = number_or_hash.into(); + + // We are given either a block hash or number. We need both. + let (block_ref, block_number) = match number_or_hash { + BlockNumberOrRef::BlockRef(block_ref) => { + let block_hash = block_ref.hash(); + let block_header = self + .inner + .backend + .block_header(block_hash) + .await + .map_err(|e| OnlineClientAtBlockError::CannotGetBlockHeader { + block_hash: block_hash.into(), + reason: e, + })? + .ok_or(OnlineClientAtBlockError::BlockHeaderNotFound { + block_hash: block_hash.into(), + })?; + (block_ref, block_header.number()) + } + BlockNumberOrRef::Number(block_number) => { + let block_ref = self + .inner + .backend + .block_number_to_hash(block_number) + .await + .map_err(|e| OnlineClientAtBlockError::CannotGetBlockHash { + block_number, + reason: e, + })? + .ok_or(OnlineClientAtBlockError::BlockNotFound { block_number })?; + (block_ref, block_number) + } + }; - /// Access constants. - pub fn constants(&self) -> ConstantsClient { - >::constants(self) + self.at_block_hash_and_number(block_ref, block_number).await } - /// Work with blocks. - pub fn blocks(&self) -> BlocksClient { - >::blocks(self) - } + /// Instantiate a client for working at a specific block. This takes a block hash/ref _and_ the + /// corresponding block number. When both are available, this saves an RPC call to obtain one from + /// the other. + /// + /// **Warning:** If the block hash and number do not align, then things will go wrong. Prefer to + /// use [`Self::at_block`] if in any doubt. + pub async fn at_block_hash_and_number( + &self, + block_ref: impl Into>>, + block_number: u64, + ) -> Result>, OnlineClientAtBlockError> { + let block_ref = block_ref.into(); + let block_hash = block_ref.hash(); + + // Obtain the spec version so that we know which metadata to use at this block. + // Obtain the transaction version because it's required for constructing extrinsics. + let (spec_version, transaction_version) = match self + .inner + .config + .spec_and_transaction_version_for_block_number(block_number) + { + Some(version) => version, + None => { + let spec_version_bytes = self + .inner + .backend + .call("Core_version", None, block_hash) + .await + .map_err(|e| OnlineClientAtBlockError::CannotGetSpecVersion { + block_hash: block_hash.into(), + reason: e, + })?; + + #[derive(codec::Decode)] + struct SpecVersionHeader { + _spec_name: String, + _impl_name: String, + _authoring_version: u32, + spec_version: u32, + _impl_version: u32, + _apis: Vec<([u8; 8], u32)>, + transaction_version: u32, + } + let version = + SpecVersionHeader::decode(&mut &spec_version_bytes[..]).map_err(|e| { + OnlineClientAtBlockError::CannotDecodeSpecVersion { + block_hash: block_hash.into(), + reason: e, + } + })?; + (version.spec_version, version.transaction_version) + } + }; + + // Obtain the metadata for the block. Allow our config to cache it. + let metadata = match self.inner.config.metadata_for_spec_version(spec_version) { + Some(metadata) => metadata, + None => { + let metadata: Metadata = + match get_metadata(&*self.inner.backend, block_hash).await? { + m @ RuntimeMetadata::V0(_) + | m @ RuntimeMetadata::V1(_) + | m @ RuntimeMetadata::V2(_) + | m @ RuntimeMetadata::V3(_) + | m @ RuntimeMetadata::V4(_) + | m @ RuntimeMetadata::V5(_) + | m @ RuntimeMetadata::V6(_) + | m @ RuntimeMetadata::V7(_) => { + return Err(OnlineClientAtBlockError::UnsupportedMetadataVersion { + block_hash: block_hash.into(), + version: m.version(), + }); + } + RuntimeMetadata::V8(m) => { + let types = get_legacy_types(self, &m, spec_version)?; + Metadata::from_v8(&m, &types).map_err(|e| { + OnlineClientAtBlockError::CannotConvertLegacyMetadata { + block_hash: block_hash.into(), + metadata_version: 8, + reason: e, + } + })? + } + RuntimeMetadata::V9(m) => { + let types = get_legacy_types(self, &m, spec_version)?; + Metadata::from_v9(&m, &types).map_err(|e| { + OnlineClientAtBlockError::CannotConvertLegacyMetadata { + block_hash: block_hash.into(), + metadata_version: 9, + reason: e, + } + })? + } + RuntimeMetadata::V10(m) => { + let types = get_legacy_types(self, &m, spec_version)?; + Metadata::from_v10(&m, &types).map_err(|e| { + OnlineClientAtBlockError::CannotConvertLegacyMetadata { + block_hash: block_hash.into(), + metadata_version: 10, + reason: e, + } + })? + } + RuntimeMetadata::V11(m) => { + let types = get_legacy_types(self, &m, spec_version)?; + Metadata::from_v11(&m, &types).map_err(|e| { + OnlineClientAtBlockError::CannotConvertLegacyMetadata { + block_hash: block_hash.into(), + metadata_version: 11, + reason: e, + } + })? + } + RuntimeMetadata::V12(m) => { + let types = get_legacy_types(self, &m, spec_version)?; + Metadata::from_v12(&m, &types).map_err(|e| { + OnlineClientAtBlockError::CannotConvertLegacyMetadata { + block_hash: block_hash.into(), + metadata_version: 12, + reason: e, + } + })? + } + RuntimeMetadata::V13(m) => { + let types = get_legacy_types(self, &m, spec_version)?; + Metadata::from_v13(&m, &types).map_err(|e| { + OnlineClientAtBlockError::CannotConvertLegacyMetadata { + block_hash: block_hash.into(), + metadata_version: 13, + reason: e, + } + })? + } + RuntimeMetadata::V14(m) => Metadata::from_v14(m).map_err(|e| { + OnlineClientAtBlockError::CannotConvertModernMetadata { + block_hash: block_hash.into(), + metadata_version: 14, + reason: e, + } + })?, + RuntimeMetadata::V15(m) => Metadata::from_v15(m).map_err(|e| { + OnlineClientAtBlockError::CannotConvertModernMetadata { + block_hash: block_hash.into(), + metadata_version: 15, + reason: e, + } + })?, + RuntimeMetadata::V16(m) => Metadata::from_v16(m).map_err(|e| { + OnlineClientAtBlockError::CannotConvertModernMetadata { + block_hash: block_hash.into(), + metadata_version: 16, + reason: e, + } + })?, + }; + let metadata = Arc::new(metadata); + self.inner + .config + .set_metadata_for_spec_version(spec_version, metadata.clone()); + metadata + } + }; - /// Work with runtime API. - pub fn runtime_api(&self) -> RuntimeApiClient { - >::runtime_api(self) + let online_client_at_block = OnlineClientAtBlockImpl { + client: self.clone(), + hasher: ::new(&metadata), + metadata, + block_ref, + block_number, + spec_version, + transaction_version, + }; + + Ok(ClientAtBlock { + client: online_client_at_block, + marker: PhantomData, + }) } +} - /// Work with View Functions. - pub fn view_functions(&self) -> ViewFunctionsClient { - >::view_functions(self) - } +/// This represents an online client at a specific block. +#[doc(hidden)] +pub trait OnlineClientAtBlockT: OfflineClientAtBlockT { + /// Return the RPC methods we'll use to interact with the node. + fn backend(&self) -> &dyn Backend; + /// Return the block hash for the current block. + fn block_hash(&self) -> HashFor; + /// Return the inner [`OnlineClient`]. + fn client(&self) -> OnlineClient; +} - /// Access custom types. - pub fn custom_values(&self) -> CustomValuesClient { - >::custom_values(self) - } +/// An implementation of the [`OnlineClientAtBlockImpl`] trait, which is used in conjunction +/// with [`crate::client::ClientAtBlock`] to provide a working client. You won't tend to need this +/// type and instead should prefer to refer to [`crate::client::OnlineClientAtBlock`]. +#[derive(Clone)] +pub struct OnlineClientAtBlockImpl { + client: OnlineClient, + metadata: ArcMetadata, + hasher: T::Hasher, + block_ref: BlockRef>, + block_number: u64, + spec_version: u32, + transaction_version: u32, } -impl OfflineClientT for OnlineClient { - fn metadata(&self) -> Metadata { - self.metadata() - } - fn genesis_hash(&self) -> HashFor { - self.genesis_hash() - } - fn runtime_version(&self) -> RuntimeVersion { - self.runtime_version() +impl OnlineClientAtBlockT for OnlineClientAtBlockImpl { + fn backend(&self) -> &dyn Backend { + &*self.client.inner.backend } - fn hasher(&self) -> T::Hasher { - self.hasher() + fn block_hash(&self) -> HashFor { + self.block_ref.hash() } - // This is provided by default, but we can optimise here and only lock once: - fn client_state(&self) -> ClientState { - let inner = self.inner.read().expect("shouldn't be poisoned"); - ClientState { - genesis_hash: inner.genesis_hash, - runtime_version: inner.runtime_version, - metadata: inner.metadata.clone(), - } + fn client(&self) -> OnlineClient { + self.client.clone() } } -impl OnlineClientT for OnlineClient { - fn backend(&self) -> &dyn Backend { - &*self.backend +impl OfflineClientAtBlockT for OnlineClientAtBlockImpl { + fn metadata_ref(&self) -> &Metadata { + &self.metadata } -} - -/// Client wrapper for performing runtime updates. See [`OnlineClient::updater()`] -/// for example usage. -pub struct ClientRuntimeUpdater(OnlineClient); - -impl ClientRuntimeUpdater { - fn is_runtime_version_different(&self, new: &RuntimeVersion) -> bool { - let curr = self.0.inner.read().expect("shouldn't be poisoned"); - &curr.runtime_version != new + fn metadata(&self) -> ArcMetadata { + self.metadata.clone() } - - fn do_update(&self, update: Update) { - let mut writable = self.0.inner.write().expect("shouldn't be poisoned"); - writable.metadata = update.metadata; - writable.runtime_version = update.runtime_version; + fn block_number(&self) -> u64 { + self.block_number } - - /// Tries to apply a new update. - pub fn apply_update(&self, update: Update) -> Result<(), RuntimeUpdateeApplyError> { - if !self.is_runtime_version_different(&update.runtime_version) { - return Err(RuntimeUpdateeApplyError::SameVersion); - } - - self.do_update(update); - - Ok(()) + fn genesis_hash(&self) -> Option> { + Some(self.client.inner.genesis_hash) } - - /// Performs runtime updates indefinitely unless encountering an error. - /// - /// *Note:* This will run indefinitely until it errors, so the typical usage - /// would be to run it in a separate background task. - pub async fn perform_runtime_updates(&self) -> Result<(), RuntimeUpdaterError> { - // Obtain an update subscription to further detect changes in the runtime version of the node. - let mut runtime_version_stream = self.runtime_updates().await?; - - loop { - let update = runtime_version_stream.next().await?; - - // This only fails if received the runtime version is the same the current runtime version - // which might occur because that runtime subscriptions in substrate sends out the initial - // value when they created and not only when runtime upgrades occurs. - // Thus, fine to ignore here as it strictly speaking isn't really an error - let _ = self.apply_update(update); - } + fn spec_version(&self) -> u32 { + self.spec_version } - - /// Low-level API to get runtime updates as a stream but it's doesn't check if the - /// runtime version is newer or updates the runtime. - /// - /// Instead that's up to the user of this API to decide when to update and - /// to perform the actual updating. - pub async fn runtime_updates(&self) -> Result, RuntimeUpdaterError> { - let stream = self - .0 - .backend() - .stream_runtime_version() - .await - .map_err(RuntimeUpdaterError::CannotStreamRuntimeVersion)?; - - Ok(RuntimeUpdaterStream { - stream, - client: self.0.clone(), - }) + fn transaction_version(&self) -> u32 { + self.transaction_version } -} - -/// Stream to perform runtime upgrades. -pub struct RuntimeUpdaterStream { - stream: StreamOfResults, - client: OnlineClient, -} - -impl RuntimeUpdaterStream { - /// Wait for the next runtime update. - pub async fn next(&mut self) -> Result { - let runtime_version = self - .stream - .next() - .await - .ok_or(RuntimeUpdaterError::UnexpectedEndOfUpdateStream)? - .map_err(RuntimeUpdaterError::CannotGetNextRuntimeVersion)?; - - let at = wait_runtime_upgrade_in_finalized_block(&self.client, &runtime_version).await?; - - let metadata = OnlineClient::fetch_metadata(self.client.backend(), at.hash()) - .await - .map_err(RuntimeUpdaterError::CannotFetchNewMetadata)?; - - Ok(Update { - metadata, - runtime_version, - }) + fn hasher(&self) -> &T::Hasher { + &self.hasher } } -/// Represents the state when a runtime upgrade occurred. -pub struct Update { - runtime_version: RuntimeVersion, - metadata: Metadata, -} +fn get_legacy_types<'a, T: Config, Md: ToTypeRegistry>( + client: &'a OnlineClient, + metadata: &Md, + spec_version: u32, +) -> Result, OnlineClientAtBlockError> { + let mut types = client + .inner + .config + .legacy_types_for_spec_version(spec_version) + .ok_or(OnlineClientAtBlockError::MissingLegacyTypes)?; -impl Update { - /// Get the runtime version. - pub fn runtime_version(&self) -> &RuntimeVersion { - &self.runtime_version - } + // Extend the types with information from the metadata (ie event/error/call enums): + let additional_types = frame_decode::helpers::type_registry_from_metadata(metadata) + .map_err(|e| OnlineClientAtBlockError::CannotInjectMetadataTypes { parse_error: e })?; + types.prepend(additional_types); - /// Get the metadata. - pub fn metadata(&self) -> &Metadata { - &self.metadata - } + Ok(types) } -/// Helper to wait until the runtime upgrade is applied on at finalized block. -async fn wait_runtime_upgrade_in_finalized_block( - client: &OnlineClient, - runtime_version: &RuntimeVersion, -) -> Result>, RuntimeUpdaterError> { - let hasher = client - .inner - .read() - .expect("Lock shouldn't be poisoned") - .hasher; - - let mut block_sub = client - .backend() - .stream_finalized_block_headers(hasher) +async fn get_metadata( + backend: &dyn Backend, + block_hash: HashFor, +) -> Result { + // First, try to use the "modern" metadata APIs to get the most recent version we can. + let version_to_get = backend + .call("Metadata_metadata_versions", None, block_hash) .await - .map_err(RuntimeUpdaterError::CannotStreamFinalizedBlocks)?; - - let block_ref = loop { - let (_, block_ref) = block_sub - .next() - .await - .ok_or(RuntimeUpdaterError::UnexpectedEndOfBlockStream)? - .map_err(RuntimeUpdaterError::CannotGetNextFinalizedBlock)?; - - let addr = - crate::dynamic::storage::<(), scale_value::Value>("System", "LastRuntimeUpgrade"); - - let client_at = client.storage().at(block_ref.hash()); - let value = client_at - .entry(addr) - // The storage `system::lastRuntimeUpgrade` should always exist. - // - .map_err(|_| RuntimeUpdaterError::CantFindSystemLastRuntimeUpgrade)? - .fetch(()) + .ok() + .and_then(|res| >::decode(&mut &res[..]).ok()) + .and_then(|versions| { + // We want to filter out the "unstable" version, which is represented by u32::MAX. + versions.into_iter().filter(|v| *v != u32::MAX).max() + }); + + // We had success calling the above API, so we expect the "modern" metadata API to work. + if let Some(version_to_get) = version_to_get { + let version_bytes = version_to_get.encode(); + let rpc_response = backend + .call( + "Metadata_metadata_at_version", + Some(&version_bytes), + block_hash, + ) .await - .map_err(RuntimeUpdaterError::CantFetchLastRuntimeUpgrade)? - .decode_as::() - .map_err(RuntimeUpdaterError::CannotDecodeLastRuntimeUpgrade)?; - - #[derive(scale_decode::DecodeAsType)] - struct LastRuntimeUpgrade { - spec_version: u32, - } - - // We are waiting for the chain to have the same spec version - // as sent out via the runtime subscription. - if value.spec_version == runtime_version.spec_version { - break block_ref; - } - }; - - Ok(block_ref) + .map_err(|e| OnlineClientAtBlockError::CannotGetMetadata { + block_hash: block_hash.into(), + reason: format!("Error calling Metadata_metadata_at_version: {e}"), + })?; + + // Option because we may have asked for a version that doesn't exist. Compact because we get back a Vec + // of the metadata bytes, and the Vec is preceded by it's compact encoded length. The actual bytes are then + // decoded as a `RuntimeMetadataPrefixed`, after this. + let (_, metadata) = , RuntimeMetadataPrefixed)>>::decode(&mut &rpc_response[..]) + .map_err(|e| OnlineClientAtBlockError::CannotGetMetadata { + block_hash: block_hash.into(), + reason: format!("Error decoding response for Metadata_metadata_at_version: {e}"), + })? + .ok_or_else(|| OnlineClientAtBlockError::CannotGetMetadata { + block_hash: block_hash.into(), + reason: format!("No metadata returned for the latest version from Metadata_metadata_versions ({version_to_get})"), + })?; + + return Ok(metadata.1); + } + + // We didn't get a version from Metadata_metadata_versions, so fall back to the "old" API. + let metadata_bytes = backend + .call("Metadata_metadata", None, block_hash) + .await + .map_err(|e| OnlineClientAtBlockError::CannotGetMetadata { + block_hash: block_hash.into(), + reason: format!("Error calling Metadata_metadata: {e}"), + })?; + + let (_, metadata) = <(Compact, RuntimeMetadataPrefixed)>::decode(&mut &metadata_bytes[..]) + .map_err(|e| OnlineClientAtBlockError::CannotGetMetadata { + block_hash: block_hash.into(), + reason: format!("Error decoding response for Metadata_metadata: {e}"), + })?; + + Ok(metadata.1) } diff --git a/subxt/src/client/online_client/block_number_or_ref.rs b/subxt/src/client/online_client/block_number_or_ref.rs new file mode 100644 index 00000000000..0f14125a510 --- /dev/null +++ b/subxt/src/client/online_client/block_number_or_ref.rs @@ -0,0 +1,47 @@ +use crate::backend::BlockRef; +use crate::config::{Config, HashFor, Hasher}; + +/// This represents either a block number or a reference +/// to a block, which is essentially a block hash. +pub enum BlockNumberOrRef { + /// A block number. + Number(u64), + /// A block ref / hash. + BlockRef(BlockRef>), +} + +impl From for BlockNumberOrRef { + fn from(value: u32) -> Self { + BlockNumberOrRef::Number(value.into()) + } +} + +impl From for BlockNumberOrRef { + fn from(value: u64) -> Self { + BlockNumberOrRef::Number(value) + } +} + +impl From for BlockNumberOrRef { + fn from(value: usize) -> Self { + BlockNumberOrRef::Number(value as u64) + } +} + +impl From>> for BlockNumberOrRef { + fn from(block_ref: BlockRef>) -> Self { + BlockNumberOrRef::BlockRef(block_ref) + } +} + +// Ideally we'd have `impl From> for BlockNumberOrRef` but since our config +// could set _any_ hash type, this boils down to `impl From for ..` which is too general. +// Thus, we target our current concrete hash type. +impl From for BlockNumberOrRef +where + ::Hash: From, +{ + fn from(hash: crate::config::substrate::H256) -> Self { + BlockNumberOrRef::BlockRef(BlockRef::from_hash(hash.into())) + } +} diff --git a/subxt/src/client/online_client/blocks.rs b/subxt/src/client/online_client/blocks.rs new file mode 100644 index 00000000000..be5de1c574a --- /dev/null +++ b/subxt/src/client/online_client/blocks.rs @@ -0,0 +1,81 @@ +use crate::backend::{BlockRef, StreamOfResults}; +use crate::client::{ClientAtBlock, OnlineClient, OnlineClientAtBlockImpl}; +use crate::config::{Config, HashFor, Header}; +use crate::error::{BlocksError, OnlineClientAtBlockError}; +use futures::{Stream, StreamExt}; +use std::pin::Pin; +use std::task::{Context, Poll}; + +/// A stream of blocks. +pub struct Blocks { + client: OnlineClient, + stream: StreamOfResults<(T::Header, BlockRef>)>, +} + +impl Blocks { + pub(crate) fn from_headers_stream( + client: OnlineClient, + stream: StreamOfResults<(T::Header, BlockRef>)>, + ) -> Self { + Blocks { client, stream } + } + + /// Return the next block in the stream when it is produced. + pub async fn next(&mut self) -> Option, BlocksError>> { + StreamExt::next(self).await + } +} + +impl Stream for Blocks { + type Item = Result, BlocksError>; + + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + let item = match self.stream.poll_next_unpin(cx) { + Poll::Pending => return Poll::Pending, + Poll::Ready(None) => return Poll::Ready(None), + Poll::Ready(Some(item)) => item, + }; + + let res = match item { + Ok((block_header, block_ref)) => Ok(Block { + block_ref, + block_header, + client: self.client.clone(), + }), + Err(e) => Err(BlocksError::CannotGetBlockHeader(e)), + }; + + Poll::Ready(Some(res)) + } +} + +/// A block from the stream of blocks. +pub struct Block { + block_ref: BlockRef>, + block_header: T::Header, + client: OnlineClient, +} + +impl Block { + /// The block hash + pub fn hash(&self) -> HashFor { + self.block_ref.hash() + } + + /// The block number. + pub fn number(&self) -> u64 { + self.block_header.number() + } + + /// The block header. + pub fn header(&self) -> &T::Header { + &self.block_header + } + + /// Instantiate a client at this block. + pub async fn at( + &self, + ) -> Result>, OnlineClientAtBlockError> { + self.client.at_block(self.block_ref.clone()).await + } +} diff --git a/subxt/src/config.rs b/subxt/src/config.rs new file mode 100644 index 00000000000..de8639bb8a4 --- /dev/null +++ b/subxt/src/config.rs @@ -0,0 +1,183 @@ +// Copyright 2019-2024 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! This module provides a [`Config`] type, which provides a way to configure Subxt to work with a +//! specific chain. +//! +//! - A generic [`SubstrateConfig`] implementation is provided that will work against modern +//! blocks with most Substrate based chains automatically, and can be configured to work with +//! historic blocks. +//! - A [`PolkadotConfig`] implementation is provided which is specialized towards the Polkadot +//! Relay Chain, and comes pre-configured to work against historic Polkadot RC blocks. +//! + +mod default_extrinsic_params; + +pub mod extrinsic_params; +pub mod polkadot; +pub mod substrate; +pub mod transaction_extensions; + +use crate::metadata::{ArcMetadata, Metadata}; +use codec::{Decode, Encode}; +use core::fmt::Debug; +use scale_decode::DecodeAsType; +use scale_encode::EncodeAsType; +use scale_info_legacy::TypeRegistrySet; +use serde::{Serialize, de::DeserializeOwned}; +use std::{fmt::Display, marker::PhantomData}; +use subxt_rpcs::RpcConfig; + +pub use default_extrinsic_params::{DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder}; +pub use extrinsic_params::{ClientState, ExtrinsicParams, ExtrinsicParamsEncoder}; +pub use polkadot::{PolkadotConfig, PolkadotExtrinsicParams, PolkadotExtrinsicParamsBuilder}; +pub use substrate::{SubstrateConfig, SubstrateExtrinsicParams, SubstrateExtrinsicParamsBuilder}; +pub use transaction_extensions::TransactionExtension; + +/// Configuration for a given chain and the runtimes within. This consists of the +/// type information needed to work at the head of the chain (namely submitting +/// transactions), as well as functionality which we might wish to customize for a +/// given chain. +pub trait Config: Clone + Debug + Sized + Send + Sync + 'static { + /// The account ID type; required for constructing extrinsics. + type AccountId: Debug + Clone + Encode + Decode + Serialize + Send; + + /// The address type; required for constructing extrinsics. + type Address: Debug + Encode + From; + + /// The signature type. + type Signature: Debug + Clone + Encode + Decode + Send; + + /// The block header. + type Header: Header; + + /// This type defines the extrinsic extra and additional parameters. + type ExtrinsicParams: ExtrinsicParams; + + /// This is used to identify an asset in the `ChargeAssetTxPayment` signed extension. + type AssetId: Debug + Clone + Encode + DecodeAsType + EncodeAsType + Send; + + /// The hashing system (algorithm) being used in the runtime (e.g. Blake2). + /// This is created on demand with the relevant metadata for a given block, and + /// can then be used to hash things at that block. + type Hasher: Hasher; + + /// The starting hash for the chain we're connecting to. This is required for constructing transactions. + /// + /// If not provided by the config implementation, it will be obtained from the chain in the case of the + /// [`crate::client::OnlineClient`]. It must be provided to construct transactions via the + /// [`crate::client::OfflineClient`], else an error will be returned. + fn genesis_hash(&self) -> Option> { + None + } + + /// Return a tuple of the spec version and then transaction version for a given block number, if available. + /// + /// The [`crate::client::OnlineClient`] will look this up on chain if it's not available here, + /// but the [`crate::client::OfflineClient`] will error if this is not available for the required block number. + fn spec_and_transaction_version_for_block_number( + &self, + _block_number: u64, + ) -> Option<(u32, u32)> { + None + } + + /// Return the metadata for a given spec version, if available. + /// + /// The [`crate::client::OnlineClient`] will look this up on chain if it's not available here, and then + /// call [`Config::set_metadata_for_spec_version`] to give the configuration the opportunity to cache it. + /// The [`crate::client::OfflineClient`] will error if this is not available for the required spec version. + fn metadata_for_spec_version(&self, _spec_version: u32) -> Option { + None + } + + /// Set some metadata for a given spec version. the [`crate::client::OnlineClient`] will call this if it has + /// to retrieve metadata from the chain, to give this the opportunity to cache it. The configuration can + /// do nothing if it prefers. + fn set_metadata_for_spec_version(&self, _spec_version: u32, _metadata: ArcMetadata) {} + + /// Return legacy types (ie types to use with Runtimes that return pre-V14 metadata) for a given spec version. + /// If this returns `None`, [`subxt`](crate) will return an error if type definitions are needed to access some older + /// block. + /// + /// This doesn't need to live for long; it will be used to translate any older metadata returned from the node + /// into our [`Metadata`] type, which will then be used. + fn legacy_types_for_spec_version<'this>( + &'this self, + _spec_version: u32, + ) -> Option> { + None + } +} + +/// `RpcConfigFor` can be used anywhere which requires an implementation of [`subxt_rpcs::RpcConfig`]. +/// This is only needed at the type level, and so there is no way to construct this. +pub struct RpcConfigFor { + marker: PhantomData, +} + +impl RpcConfig for RpcConfigFor { + type Hash = HashFor; + type Header = T::Header; + type AccountId = T::AccountId; +} + +/// Given some [`Config`], this returns the type of hash used. +pub type HashFor = <::Hasher as Hasher>::Hash; + +/// given some [`Config`], this return the other params needed for its `ExtrinsicParams`. +pub type ParamsFor = <::ExtrinsicParams as ExtrinsicParams>::Params; + +/// Block hashes must conform to a bunch of things to be used in Subxt. +pub trait Hash: + Debug + + Display + + Copy + + Send + + Sync + + Decode + + AsRef<[u8]> + + Serialize + + DeserializeOwned + + Encode + + PartialEq + + Eq + + core::hash::Hash +{ +} +impl Hash for T where + T: Debug + + Display + + Copy + + Send + + Sync + + Decode + + AsRef<[u8]> + + Serialize + + DeserializeOwned + + Encode + + PartialEq + + Eq + + core::hash::Hash +{ +} + +/// This represents the hasher used by a node to hash things like block headers +/// and extrinsics. +pub trait Hasher: Debug + Clone + Send + Sync + 'static { + /// The type of hash produced by this hasher. + type Hash: Hash; + + /// Construct a new hasher. + fn new(metadata: &Metadata) -> Self; + + /// Hash some bytes to the given output type. + fn hash(&self, s: &[u8]) -> Self::Hash; +} + +/// This represents the block header type used by a node. +pub trait Header: Sized + Encode + Decode + Debug + Sync + Send + DeserializeOwned + Clone { + /// Return the block number of this header. + fn number(&self) -> u64; +} diff --git a/core/src/config/default_extrinsic_params.rs b/subxt/src/config/default_extrinsic_params.rs similarity index 98% rename from core/src/config/default_extrinsic_params.rs rename to subxt/src/config/default_extrinsic_params.rs index 28cef1ec323..b16421b236c 100644 --- a/core/src/config/default_extrinsic_params.rs +++ b/subxt/src/config/default_extrinsic_params.rs @@ -41,7 +41,7 @@ pub struct DefaultExtrinsicParamsBuilder { impl Default for DefaultExtrinsicParamsBuilder { fn default() -> Self { Self { - mortality: CheckMortalityParams::default(), + mortality: CheckMortalityParams::::default(), tip: 0, tip_of: 0, tip_of_asset_id: None, @@ -60,7 +60,7 @@ impl DefaultExtrinsicParamsBuilder { /// Make the transaction immortal, meaning it will never expire. This means that it could, in /// theory, be pending for a long time and only be included many blocks into the future. pub fn immortal(mut self) -> Self { - self.mortality = transaction_extensions::CheckMortalityParams::immortal(); + self.mortality = transaction_extensions::CheckMortalityParams::::immortal(); self } @@ -76,7 +76,7 @@ impl DefaultExtrinsicParamsBuilder { /// the mortality. This provides all of the necessary information which we must otherwise be online /// in order to obtain. pub fn mortal(mut self, for_n_blocks: u64) -> Self { - self.mortality = transaction_extensions::CheckMortalityParams::mortal(for_n_blocks); + self.mortality = transaction_extensions::CheckMortalityParams::::mortal(for_n_blocks); self } diff --git a/core/src/config/extrinsic_params.rs b/subxt/src/config/extrinsic_params.rs similarity index 92% rename from core/src/config/extrinsic_params.rs rename to subxt/src/config/extrinsic_params.rs index bd3168631c5..e20cc1059ad 100644 --- a/core/src/config/extrinsic_params.rs +++ b/subxt/src/config/extrinsic_params.rs @@ -7,14 +7,25 @@ //! [`crate::config::DefaultExtrinsicParams`] provides a general-purpose //! implementation of this that will work in many cases. -use crate::{ - client::ClientState, - config::{Config, HashFor}, - error::ExtrinsicParamsError, -}; -use alloc::vec::Vec; +use crate::config::{Config, HashFor}; +use crate::error::ExtrinsicParamsError; +use crate::metadata::ArcMetadata; use core::any::Any; +/// This provides access to some relevant client state in transaction extensions, +/// and is just a combination of some of the available properties. +#[derive(Clone, Debug)] +pub struct ClientState { + /// Genesis hash. + pub genesis_hash: HashFor, + /// Spec version. + pub spec_version: u32, + /// Transaction version. + pub transaction_version: u32, + /// Metadata. + pub metadata: ArcMetadata, +} + /// This trait allows you to configure the "signed extra" and /// "additional" parameters that are a part of the transaction payload /// or the signer payload respectively. diff --git a/subxt/src/config/polkadot.rs b/subxt/src/config/polkadot.rs new file mode 100644 index 00000000000..3d480ef3dbc --- /dev/null +++ b/subxt/src/config/polkadot.rs @@ -0,0 +1,148 @@ +// Copyright 2019-2024 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! Polkadot specific configuration + +use super::{Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder}; + +use crate::config::substrate::{SubstrateConfig, SubstrateConfigBuilder}; +use crate::metadata::ArcMetadata; +use scale_info_legacy::TypeRegistrySet; + +pub use crate::config::substrate::{SpecVersionForRange, SubstrateHeader}; +pub use crate::utils::{AccountId32, MultiAddress, MultiSignature}; +pub use primitive_types::{H256, U256}; + +/// Construct a [`PolkadotConfig`] using this. +pub struct PolkadotConfigBuilder { + use_historic_types: bool, + inner: SubstrateConfigBuilder, +} + +impl Default for PolkadotConfigBuilder { + fn default() -> Self { + Self::new() + } +} + +impl PolkadotConfigBuilder { + /// Create a new [`PolkadotConfigBuilder`]. + pub fn new() -> Self { + let inner = SubstrateConfigBuilder::new(); + PolkadotConfigBuilder { + use_historic_types: true, + inner, + } + } + + /// Use historic types. These are enabled by default, but can be disabled to avoid + /// loading them in if they are not needed (ie you do not need to access any block + /// using a runtime which has V14 metadata). + pub fn use_historic_types(mut self, b: bool) -> Self { + self.use_historic_types = b; + self + } + + /// Set the metadata to be used for decoding blocks at the given spec versions. + pub fn set_metadata_for_spec_versions( + mut self, + ranges: impl IntoIterator, + ) -> Self { + self.inner = self.inner.set_metadata_for_spec_versions(ranges); + self + } + + /// Given an iterator of block ranges to spec version of the form `(start, end, spec_version)`, add them + /// to this configuration. + pub fn set_spec_version_for_block_ranges( + mut self, + ranges: impl IntoIterator, + ) -> Self { + self.inner = self.inner.set_spec_version_for_block_ranges(ranges); + self + } + + /// Construct the [`PolkadotConfig`] from this builder. + pub fn build(mut self) -> PolkadotConfig { + if self.use_historic_types { + self.inner = self + .inner + .set_legacy_types(frame_decode::legacy_types::polkadot::relay_chain()); + } + + PolkadotConfig(self.inner.build()) + } +} + +/// Configuration for the Polkadot Relay Chain. This should not be used to connect +/// to any other chain; instead use [`crate::config::SubstrateConfig`] and configure +/// that as needed to support the chain you're connecting to. +#[derive(Debug, Clone)] +pub struct PolkadotConfig(SubstrateConfig); + +impl Default for PolkadotConfig { + fn default() -> Self { + Self::new() + } +} + +impl PolkadotConfig { + /// Create a new, default, [`PolkadotConfig`]. + pub fn new() -> Self { + Self::builder().build() + } + + /// Build a new [`PolkadotConfig`]. + pub fn builder() -> PolkadotConfigBuilder { + PolkadotConfigBuilder::new() + } +} + +impl Config for PolkadotConfig { + type AccountId = ::AccountId; + type Signature = ::Signature; + type Hasher = ::Hasher; + type Header = ::Header; + type AssetId = ::AssetId; + + // Address on Polkadot has no account index, whereas it's u32 on + // the default substrate dev node. + type Address = MultiAddress; + + // These are the same as the default substrate node, but redefined + // because we need to pass the PolkadotConfig trait as a param. + type ExtrinsicParams = PolkadotExtrinsicParams; + + fn genesis_hash(&self) -> Option> { + self.0.genesis_hash() + } + + fn legacy_types_for_spec_version(&'_ self, spec_version: u32) -> Option> { + self.0.legacy_types_for_spec_version(spec_version) + } + + fn spec_and_transaction_version_for_block_number( + &self, + block_number: u64, + ) -> Option<(u32, u32)> { + self.0 + .spec_and_transaction_version_for_block_number(block_number) + } + + fn metadata_for_spec_version(&self, spec_version: u32) -> Option { + self.0.metadata_for_spec_version(spec_version) + } + + fn set_metadata_for_spec_version(&self, spec_version: u32, metadata: ArcMetadata) { + self.0.set_metadata_for_spec_version(spec_version, metadata) + } +} + +/// A struct representing the signed extra and additional parameters required +/// to construct a transaction for a polkadot node. +pub type PolkadotExtrinsicParams = DefaultExtrinsicParams; + +/// A builder which leads to [`PolkadotExtrinsicParams`] being constructed. +/// This is what you provide to methods like `sign_and_submit()`. +pub type PolkadotExtrinsicParamsBuilder = DefaultExtrinsicParamsBuilder; diff --git a/core/src/config/substrate.rs b/subxt/src/config/substrate.rs similarity index 64% rename from core/src/config/substrate.rs rename to subxt/src/config/substrate.rs index 4695e973037..68903e52161 100644 --- a/core/src/config/substrate.rs +++ b/subxt/src/config/substrate.rs @@ -5,30 +5,199 @@ //! Substrate specific configuration use super::{Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder, Hasher, Header}; +use crate::config::Hash; +use crate::metadata::{ArcMetadata, Metadata}; +use crate::utils::RangeMap; pub use crate::utils::{AccountId32, MultiAddress, MultiSignature}; -use alloc::format; -use alloc::vec::Vec; use codec::{Decode, Encode}; pub use primitive_types::{H256, U256}; +use scale_info_legacy::{ChainTypeRegistry, TypeRegistrySet}; use serde::{Deserialize, Serialize}; -use subxt_metadata::Metadata; +use std::collections::HashMap; +use std::sync::Arc; +use std::sync::Mutex; + +/// Construct a [`SubstrateConfig`] using this. +pub struct SubstrateConfigBuilder { + legacy_types: Option, + spec_and_transaction_version_for_block_number: RangeMap, + genesis_hash: Option, + metadata_for_spec_version: Mutex>, + use_old_v9_hashers_before_spec_version: u32, +} + +impl Default for SubstrateConfigBuilder { + fn default() -> Self { + Self::new() + } +} + +impl SubstrateConfigBuilder { + /// Create a new builder to construct a [`SubstrateConfig`] from. + pub fn new() -> Self { + SubstrateConfigBuilder { + legacy_types: None, + genesis_hash: None, + spec_and_transaction_version_for_block_number: RangeMap::empty(), + metadata_for_spec_version: Mutex::new(HashMap::new()), + use_old_v9_hashers_before_spec_version: 0, + } + } + + /// Set the genesis hash for this chain. + pub fn set_genesis_hash(mut self, genesis_hash: H256) -> Self { + self.genesis_hash = Some(genesis_hash); + self + } -/// 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. -// The trait implementations exist just to make life easier, -// but shouldn't strictly be necessary since users can't instantiate this type. -#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] -pub enum SubstrateConfig {} + /// Set the legacy types to use for this configuration. This enables support for + /// blocks produced by Runtimes that emit metadata older than V14. + pub fn set_legacy_types(mut self, legacy_types: ChainTypeRegistry) -> Self { + self.legacy_types = Some(legacy_types); + self + } + + /// Set the metadata to be used for decoding blocks at the given spec versions. + pub fn set_metadata_for_spec_versions( + self, + ranges: impl IntoIterator, + ) -> Self { + let mut map = self.metadata_for_spec_version.lock().unwrap(); + for (spec_version, metadata) in ranges.into_iter() { + map.insert(spec_version, metadata); + } + drop(map); + self + } + + /// Given an iterator of block ranges to spec version of the form `(start, end, spec_version)`, add them + /// to this configuration. + pub fn set_spec_version_for_block_ranges( + mut self, + ranges: impl IntoIterator, + ) -> Self { + let mut m = RangeMap::builder(); + for version_for_range in ranges.into_iter() { + let start = version_for_range.block_range.start; + let end = version_for_range.block_range.end; + let spec_version = version_for_range.spec_version; + let transaction_version = version_for_range.transaction_version; + m = m.add_range(start, end, (spec_version, transaction_version)); + } + self.spec_and_transaction_version_for_block_number = m.build(); + self + } + + /// The storage hasher encoding/decoding changed during V9 metadata. By default we support the "new" version + /// of things. We can use this option to support the old version of things prior to a given spec version. + pub fn use_old_v9_hashers_before_spec_version(mut self, spec_version: u32) -> Self { + self.use_old_v9_hashers_before_spec_version = spec_version; + self + } + + /// Construct the [`SubstrateConfig`] from this builder. + pub fn build(self) -> SubstrateConfig { + SubstrateConfig { + inner: Arc::new(SubstrateConfigInner { + legacy_types: self.legacy_types, + spec_and_transaction_version_for_block_number: self + .spec_and_transaction_version_for_block_number, + metadata_for_spec_version: self.metadata_for_spec_version, + }), + } + } +} + +/// Define a spec version for a range of blocks. The new spec version is expected +/// to begin at the first block in the range and end just prior to the last block +/// in the range. +pub struct SpecVersionForRange { + /// The block range that this spec version applies to. Inclusive of the start + /// and exclusive of the enc. + pub block_range: std::ops::Range, + /// The spec version at this block range. + pub spec_version: u32, + /// The transaction version at this block range. + pub transaction_version: u32, +} + +/// Configuration that's suitable for standard Substrate chains (ie those +/// that have not customized the block hash type). +#[derive(Debug, Clone)] +pub struct SubstrateConfig { + inner: Arc, +} + +#[derive(Debug)] +struct SubstrateConfigInner { + legacy_types: Option, + spec_and_transaction_version_for_block_number: RangeMap, + metadata_for_spec_version: Mutex>, +} + +impl Default for SubstrateConfig { + fn default() -> Self { + Self::new() + } +} + +impl SubstrateConfig { + /// Create a new, default, [`SubstrateConfig`]. This does not + /// support working with historic (pre-V14) types. If you want this, + /// then use [`SubstrateConfig::builder()`] and then provide legacy + /// types via [`SubstrateConfigBuilder::set_legacy_types()`]. + pub fn new() -> Self { + Self::builder().build() + } + + /// Build a new [`SubstrateConfig`]. + pub fn builder() -> SubstrateConfigBuilder { + SubstrateConfigBuilder::new() + } +} impl Config for SubstrateConfig { type AccountId = AccountId32; type Address = MultiAddress; type Signature = MultiSignature; type Hasher = DynamicHasher256; - type Header = SubstrateHeader; + type Header = SubstrateHeader<::Hash>; type ExtrinsicParams = SubstrateExtrinsicParams; type AssetId = u32; + + fn legacy_types_for_spec_version(&'_ self, spec_version: u32) -> Option> { + self.inner + .legacy_types + .as_ref() + .map(|types| types.for_spec_version(spec_version as u64)) + } + + fn spec_and_transaction_version_for_block_number( + &self, + block_number: u64, + ) -> Option<(u32, u32)> { + self.inner + .spec_and_transaction_version_for_block_number + .get(block_number) + .copied() + } + + fn metadata_for_spec_version(&self, spec_version: u32) -> Option { + self.inner + .metadata_for_spec_version + .lock() + .unwrap() + .get(&spec_version) + .cloned() + } + + fn set_metadata_for_spec_version(&self, spec_version: u32, metadata: ArcMetadata) { + self.inner + .metadata_for_spec_version + .lock() + .unwrap() + .insert(spec_version, metadata); + } } /// A struct representing the signed extra and additional parameters required @@ -44,13 +213,13 @@ pub type SubstrateExtrinsicParamsBuilder = DefaultExtrinsicParamsBuilder; pub struct BlakeTwo256; impl Hasher for BlakeTwo256 { - type Output = H256; + type Hash = H256; fn new(_metadata: &Metadata) -> Self { Self } - fn hash(&self, s: &[u8]) -> Self::Output { + fn hash(&self, s: &[u8]) -> Self::Hash { sp_crypto_hashing::blake2_256(s).into() } } @@ -73,7 +242,7 @@ enum HashType { } impl Hasher for DynamicHasher256 { - type Output = H256; + type Hash = H256; fn new(metadata: &Metadata) -> Self { // Determine the Hash associated type used for the current chain, if possible. @@ -98,7 +267,7 @@ impl Hasher for DynamicHasher256 { Self(hash_type) } - fn hash(&self, s: &[u8]) -> Self::Output { + fn hash(&self, s: &[u8]) -> Self::Hash { match self.0 { HashType::BlakeTwo256 | HashType::Unknown => sp_crypto_hashing::blake2_256(s).into(), HashType::Keccak256 => sp_crypto_hashing::keccak_256(s).into(), @@ -110,34 +279,30 @@ impl Hasher for DynamicHasher256 { /// The block number and hasher can be configured to adapt this for other nodes. #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SubstrateHeader + TryFrom, H: Hasher> { +pub struct SubstrateHeader { /// The parent hash. - pub parent_hash: H::Output, + pub parent_hash: Hash, /// The block number. #[serde( serialize_with = "serialize_number", deserialize_with = "deserialize_number" )] #[codec(compact)] - pub number: N, + pub number: u64, /// The state trie merkle root - pub state_root: H::Output, + pub state_root: Hash, /// The merkle root of the extrinsics. - pub extrinsics_root: H::Output, + pub extrinsics_root: Hash, /// A chain-specific digest of data useful for light clients or referencing auxiliary data. pub digest: Digest, } -impl Header for SubstrateHeader +impl Header for SubstrateHeader where - N: Copy + Into + Into + TryFrom + Encode, - H: Hasher, - SubstrateHeader: Encode + Decode, + H: Hash, + SubstrateHeader: Encode + Decode, { - type Number = N; - type Hasher = H; - - fn number(&self) -> Self::Number { + fn number(&self) -> u64 { self.number } } @@ -369,7 +534,7 @@ mod test { } "#; - let header: SubstrateHeader = + let header: SubstrateHeader = serde_json::from_str(numeric_block_number_json).expect("valid block header"); assert_eq!(header.number(), 4); } @@ -389,7 +554,7 @@ mod test { } "#; - let header: SubstrateHeader = + let header: SubstrateHeader = serde_json::from_str(numeric_block_number_json).expect("valid block header"); assert_eq!(header.number(), 4); } diff --git a/core/src/config/transaction_extensions.rs b/subxt/src/config/transaction_extensions.rs similarity index 98% rename from core/src/config/transaction_extensions.rs rename to subxt/src/config/transaction_extensions.rs index e59986c6013..a97ca071427 100644 --- a/core/src/config/transaction_extensions.rs +++ b/subxt/src/config/transaction_extensions.rs @@ -7,22 +7,18 @@ //! [`AnyOf`] to configure the set of transaction extensions which are known about //! when interacting with a chain. -use super::extrinsic_params::ExtrinsicParams; -use crate::client::ClientState; +use super::extrinsic_params::{ClientState, ExtrinsicParams}; use crate::config::ExtrinsicParamsEncoder; use crate::config::{Config, HashFor}; use crate::error::ExtrinsicParamsError; use crate::utils::{Era, Static}; -use alloc::borrow::ToOwned; -use alloc::boxed::Box; -use alloc::vec::Vec; use codec::{Compact, Encode}; use core::any::Any; use core::fmt::Debug; use derive_where::derive_where; -use hashbrown::HashMap; use scale_decode::DecodeAsType; use scale_info::PortableRegistry; +use std::collections::HashMap; // Re-export this here; it's a bit generically named to be re-exported from ::config. pub use super::extrinsic_params::Params; @@ -173,7 +169,7 @@ impl ExtrinsicParams for CheckSpecVersion { type Params = (); fn new(client: &ClientState, _params: Self::Params) -> Result { - Ok(CheckSpecVersion(client.runtime_version.spec_version)) + Ok(CheckSpecVersion(client.spec_version)) } } @@ -244,7 +240,7 @@ impl ExtrinsicParams for CheckTxVersion { type Params = (); fn new(client: &ClientState, _params: Self::Params) -> Result { - Ok(CheckTxVersion(client.runtime_version.transaction_version)) + Ok(CheckTxVersion(client.transaction_version)) } } diff --git a/subxt/src/constants.rs b/subxt/src/constants.rs new file mode 100644 index 00000000000..ef28d469d51 --- /dev/null +++ b/subxt/src/constants.rs @@ -0,0 +1,98 @@ +//! This module exposes [`ConstantsClient`], which has methods for working with constants. It's +//! created by calling [`crate::client::ClientAtBlock::constants()`]. +//! +//! ```rust,no_run +//! pub use subxt::{OnlineClient, PolkadotConfig}; +//! +//! let client = OnlineClient::new().await?; +//! let at_block = client.at_current_block().await?; +//! +//! let constants = at_block.constants(); +//! ``` + +mod address; + +use crate::client::OfflineClientAtBlockT; +use crate::config::Config; +use crate::error::ConstantError; +use frame_decode::constants::ConstantTypeInfo; +use scale_decode::IntoVisitor; +use std::marker::PhantomData; + +pub use address::{Address, DynamicAddress, StaticAddress, dynamic}; + +/// A client for working with constants. See [the module docs](crate::constants) for more. +#[derive(Clone)] +pub struct ConstantsClient<'atblock, T, Client> { + client: &'atblock Client, + marker: PhantomData, +} + +impl<'atblock, T, Client> ConstantsClient<'atblock, T, Client> { + pub(crate) fn new(client: &'atblock Client) -> Self { + ConstantsClient { + client, + marker: PhantomData, + } + } +} + +impl<'atblock, T: Config, Client: OfflineClientAtBlockT> ConstantsClient<'atblock, T, Client> { + /// Run the validation logic against some constant address you'd like to access. Returns `Ok(())` + /// if the address is valid (or if it's not possible to check since the address has no validation hash). + /// Return an error if the address was not valid or something went wrong trying to validate it (ie + /// the pallet or constant in question do not exist at all). + pub fn validate(&self, address: Addr) -> Result<(), ConstantError> { + let metadata = self.client.metadata_ref(); + if let Some(actual_hash) = address.validation_hash() { + let expected_hash = metadata + .pallet_by_name(address.pallet_name()) + .ok_or_else(|| { + ConstantError::PalletNameNotFound(address.pallet_name().to_string()) + })? + .constant_hash(address.constant_name()) + .ok_or_else(|| ConstantError::ConstantNameNotFound { + pallet_name: address.pallet_name().to_string(), + constant_name: address.constant_name().to_owned(), + })?; + if actual_hash != expected_hash { + return Err(ConstantError::IncompatibleCodegen); + } + } + Ok(()) + } + + /// Access the constant at the given address, returning the value defined by this address. + pub fn entry(&self, address: Addr) -> Result { + let metadata = self.client.metadata_ref(); + + // 1. Validate constant shape if hash given: + self.validate(&address)?; + + // 2. Attempt to decode the constant into the type given: + let constant = frame_decode::constants::decode_constant( + address.pallet_name(), + address.constant_name(), + metadata, + metadata.types(), + Addr::Target::into_visitor(), + ) + .map_err(ConstantError::CouldNotDecodeConstant)?; + + Ok(constant) + } + + /// Access the bytes of a constant by its address. + pub fn entry_bytes(&self, address: Addr) -> Result, ConstantError> { + // 1. Validate custom value shape if hash given: + self.validate(&address)?; + + // 2. Return the underlying bytes: + let constant = self + .client + .metadata_ref() + .constant_info(address.pallet_name(), address.constant_name()) + .map_err(|e| ConstantError::ConstantInfoError(e.into_owned()))?; + Ok(constant.bytes.to_vec()) + } +} diff --git a/core/src/constants/address.rs b/subxt/src/constants/address.rs similarity index 98% rename from core/src/constants/address.rs rename to subxt/src/constants/address.rs index 42f82dd5041..c54edec8f63 100644 --- a/core/src/constants/address.rs +++ b/subxt/src/constants/address.rs @@ -4,10 +4,9 @@ //! Construct addresses to access constants with. -use alloc::borrow::Cow; -use alloc::string::String; use derive_where::derive_where; use scale_decode::DecodeAsType; +use std::borrow::Cow; /// This represents a constant address. Anything implementing this trait /// can be used to fetch constants. diff --git a/subxt/src/constants/constants_client.rs b/subxt/src/constants/constants_client.rs deleted file mode 100644 index 26baa4ab493..00000000000 --- a/subxt/src/constants/constants_client.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::{Config, client::OfflineClientT, error::ConstantError}; -use derive_where::derive_where; -use subxt_core::constants::address::Address; - -/// A client for accessing constants. -#[derive_where(Clone; Client)] -pub struct ConstantsClient { - client: Client, - _marker: std::marker::PhantomData, -} - -impl ConstantsClient { - /// Create a new [`ConstantsClient`]. - pub fn new(client: Client) -> Self { - Self { - client, - _marker: std::marker::PhantomData, - } - } -} - -impl> ConstantsClient { - /// Run the validation logic against some constant address you'd like to access. Returns `Ok(())` - /// if the address is valid (or if it's not possible to check since the address has no validation hash). - /// Return an error if the address was not valid or something went wrong trying to validate it (ie - /// the pallet or constant in question do not exist at all). - pub fn validate(&self, address: Addr) -> Result<(), ConstantError> { - let metadata = self.client.metadata(); - subxt_core::constants::validate(address, &metadata) - } - - /// Access the constant at the address given, returning the type defined by this address. - /// This is probably used with addresses given from static codegen, although you can manually - /// construct your own, too. - pub fn at(&self, address: Addr) -> Result { - let metadata = self.client.metadata(); - subxt_core::constants::get(address, &metadata) - } - - /// Access the bytes of a constant by the address it is registered under. - pub fn bytes_at(&self, address: Addr) -> Result, ConstantError> { - let metadata = self.client.metadata(); - subxt_core::constants::get_bytes(address, &metadata) - } -} diff --git a/subxt/src/constants/mod.rs b/subxt/src/constants/mod.rs deleted file mode 100644 index b9b3e9380af..00000000000 --- a/subxt/src/constants/mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Types associated with accessing constants. - -mod constants_client; - -pub use constants_client::ConstantsClient; -pub use subxt_core::constants::address::{Address, DynamicAddress, StaticAddress, dynamic}; diff --git a/subxt/src/custom_values.rs b/subxt/src/custom_values.rs new file mode 100644 index 00000000000..76b19244f29 --- /dev/null +++ b/subxt/src/custom_values.rs @@ -0,0 +1,98 @@ +//! This module exposes [`CustomValuesClient`], which has methods for working with custom values. +//! It's created by calling [`crate::client::ClientAtBlock::custom_values()`]. +//! +//! ```rust,no_run +//! pub use subxt::{OnlineClient, PolkadotConfig}; +//! +//! let client = OnlineClient::new().await?; +//! let at_block = client.at_current_block().await?; +//! +//! let custom_values = at_block.custom_values(); +//! ``` + +mod address; + +use crate::client::OfflineClientAtBlockT; +use crate::config::Config; +use crate::error::CustomValueError; +use crate::utils::Maybe; +use derive_where::derive_where; +use frame_decode::custom_values::CustomValueTypeInfo; +use scale_decode::IntoVisitor; + +pub use address::{Address, DynamicAddress, StaticAddress, dynamic}; + +/// A client for working with custom values. See [the module docs](crate::custom_values) for more. +#[derive_where(Clone; Client)] +pub struct CustomValuesClient<'atblock, T, Client> { + client: &'atblock Client, + marker: std::marker::PhantomData, +} + +impl<'atblock, T, Client> CustomValuesClient<'atblock, T, Client> { + /// Create a new [`CustomValuesClient`]. + pub(crate) fn new(client: &'atblock Client) -> Self { + Self { + client, + marker: std::marker::PhantomData, + } + } +} + +impl<'atblock, T: Config, Client: OfflineClientAtBlockT> + CustomValuesClient<'atblock, T, Client> +{ + /// Run the validation logic against some custom value address you'd like to access. Returns `Ok(())` + /// if the address is valid (or if it's not possible to check since the address has no validation hash). + /// Returns an error if the address was not valid (wrong name, type or raw bytes) + pub fn validate(&self, address: Addr) -> Result<(), CustomValueError> { + let metadata = self.client.metadata_ref(); + if let Some(actual_hash) = address.validation_hash() { + let custom = metadata.custom(); + let custom_value = custom + .get(address.name()) + .ok_or_else(|| CustomValueError::NotFound(address.name().into()))?; + let expected_hash = custom_value.hash(); + if actual_hash != expected_hash { + return Err(CustomValueError::IncompatibleCodegen); + } + } + Ok(()) + } + + /// Access a custom value by the address it is registered under. This can be just a [str] to get back a dynamic value, + /// or a static address from the generated static interface to get a value of a static type returned. + pub fn entry>( + &self, + address: Addr, + ) -> Result { + // 1. Validate custom value shape if hash given: + self.validate(&address)?; + + // 2. Attempt to decode custom value: + let metadata = self.client.metadata_ref(); + let value = frame_decode::custom_values::decode_custom_value( + address.name(), + metadata, + metadata.types(), + Addr::Target::into_visitor(), + ) + .map_err(CustomValueError::CouldNotDecodeCustomValue)?; + + Ok(value) + } + + /// Access the bytes of a custom value by the address it is registered under. + pub fn entry_bytes(&self, address: Addr) -> Result, CustomValueError> { + // 1. Validate custom value shape if hash given: + self.validate(&address)?; + + // 2. Return the underlying bytes: + let custom_value = self + .client + .metadata_ref() + .custom_value_info(address.name()) + .map_err(|e| CustomValueError::NotFound(e.not_found))?; + Ok(custom_value.bytes.to_vec()) + } +} diff --git a/core/src/custom_values/address.rs b/subxt/src/custom_values/address.rs similarity index 95% rename from core/src/custom_values/address.rs rename to subxt/src/custom_values/address.rs index 1046b5dc49d..80ea4c7ed29 100644 --- a/core/src/custom_values/address.rs +++ b/subxt/src/custom_values/address.rs @@ -4,13 +4,10 @@ //! Construct addresses to access custom values with. -use alloc::borrow::Cow; -use alloc::string::String; +use crate::utils::{Maybe, NoMaybe}; use derive_where::derive_where; use scale_decode::DecodeAsType; - -/// Use this with [`Address::IsDecodable`]. -pub use crate::utils::{Maybe, No, NoMaybe}; +use std::borrow::Cow; /// This represents the address of a custom value in the metadata. /// Anything that implements it can be used to fetch custom values from the metadata. diff --git a/subxt/src/custom_values/custom_values_client.rs b/subxt/src/custom_values/custom_values_client.rs deleted file mode 100644 index 0414b0a2d1d..00000000000 --- a/subxt/src/custom_values/custom_values_client.rs +++ /dev/null @@ -1,134 +0,0 @@ -use crate::client::OfflineClientT; -use crate::{Config, error::CustomValueError}; -use derive_where::derive_where; - -use subxt_core::custom_values::address::{Address, Maybe}; - -/// A client for accessing custom values stored in the metadata. -#[derive_where(Clone; Client)] -pub struct CustomValuesClient { - client: Client, - _marker: std::marker::PhantomData, -} - -impl CustomValuesClient { - /// Create a new [`CustomValuesClient`]. - pub fn new(client: Client) -> Self { - Self { - client, - _marker: std::marker::PhantomData, - } - } -} - -impl> CustomValuesClient { - /// Access a custom value by the address it is registered under. This can be just a [str] to get back a dynamic value, - /// or a static address from the generated static interface to get a value of a static type returned. - pub fn at>( - &self, - address: Addr, - ) -> Result { - subxt_core::custom_values::get(address, &self.client.metadata()) - } - - /// Access the bytes of a custom value by the address it is registered under. - pub fn bytes_at(&self, address: Addr) -> Result, CustomValueError> { - subxt_core::custom_values::get_bytes(address, &self.client.metadata()) - } - - /// Run the validation logic against some custom value address you'd like to access. Returns `Ok(())` - /// if the address is valid (or if it's not possible to check since the address has no validation hash). - /// Returns an error if the address was not valid (wrong name, type or raw bytes) - pub fn validate(&self, address: Addr) -> Result<(), CustomValueError> { - subxt_core::custom_values::validate(address, &self.client.metadata()) - } -} - -#[cfg(test)] -mod tests { - use crate::custom_values::{self, CustomValuesClient}; - use crate::{Metadata, OfflineClient, SubstrateConfig}; - use codec::Encode; - use scale_decode::DecodeAsType; - use scale_info::TypeInfo; - use scale_info::form::PortableForm; - use std::collections::BTreeMap; - use subxt_core::client::RuntimeVersion; - - #[derive(Debug, Clone, PartialEq, Eq, Encode, TypeInfo, DecodeAsType)] - pub struct Person { - age: u16, - name: String, - } - - fn mock_metadata() -> Metadata { - let person_ty = scale_info::MetaType::new::(); - let unit = scale_info::MetaType::new::<()>(); - let mut types = scale_info::Registry::new(); - let person_ty_id = types.register_type(&person_ty); - let unit_id = types.register_type(&unit); - let types: scale_info::PortableRegistry = types.into(); - - let person = Person { - age: 42, - name: "Neo".into(), - }; - - let person_value_metadata: frame_metadata::v15::CustomValueMetadata = - frame_metadata::v15::CustomValueMetadata { - ty: person_ty_id, - value: person.encode(), - }; - - let frame_metadata = frame_metadata::v15::RuntimeMetadataV15 { - types, - pallets: vec![], - extrinsic: frame_metadata::v15::ExtrinsicMetadata { - version: 0, - address_ty: unit_id, - call_ty: unit_id, - signature_ty: unit_id, - extra_ty: unit_id, - signed_extensions: vec![], - }, - ty: unit_id, - apis: vec![], - outer_enums: frame_metadata::v15::OuterEnums { - call_enum_ty: unit_id, - event_enum_ty: unit_id, - error_enum_ty: unit_id, - }, - custom: frame_metadata::v15::CustomMetadata { - map: BTreeMap::from_iter([("Person".to_string(), person_value_metadata)]), - }, - }; - - let metadata: subxt_metadata::Metadata = frame_metadata.try_into().unwrap(); - metadata - } - - #[test] - fn test_decoding() { - let client = OfflineClient::::new( - Default::default(), - RuntimeVersion { - spec_version: 0, - transaction_version: 0, - }, - mock_metadata(), - ); - - let custom_value_client = CustomValuesClient::new(client); - assert!(custom_value_client.at("No one").is_err()); - - let person_addr = custom_values::dynamic::("Person"); - let person = custom_value_client.at(&person_addr).unwrap(); - assert_eq!( - person, - Person { - age: 42, - name: "Neo".into() - } - ) - } -} diff --git a/subxt/src/custom_values/mod.rs b/subxt/src/custom_values/mod.rs deleted file mode 100644 index e1f5d3a0d06..00000000000 --- a/subxt/src/custom_values/mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Types associated with accessing custom types - -mod custom_values_client; - -pub use custom_values_client::CustomValuesClient; -pub use subxt_core::custom_values::address::{Address, DynamicAddress, StaticAddress, dynamic}; diff --git a/subxt/src/dynamic.rs b/subxt/src/dynamic.rs new file mode 100644 index 00000000000..0c72c2b1200 --- /dev/null +++ b/subxt/src/dynamic.rs @@ -0,0 +1,26 @@ +// Copyright 2019-2024 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! This module ex-exports various helpers for constructing dynamic payloads/queries/addresses. + +pub use scale_value::{At, Value, value}; + +// Submit dynamic transactions. +pub use crate::transactions::dynamic as transaction; +pub use crate::transactions::dynamic as tx; + +// Lookup constants dynamically. +pub use crate::constants::dynamic as constant; + +// Lookup storage values dynamically. +pub use crate::storage::dynamic as storage; + +// Execute runtime API function call dynamically. +pub use crate::runtime_apis::dynamic as runtime_api_call; + +// Execute View Function API function call dynamically. +pub use crate::view_functions::dynamic as view_function_call; + +/// Obtain a custom value from the metadata. +pub use crate::custom_values::dynamic as custom_value; diff --git a/subxt/src/error/mod.rs b/subxt/src/error.rs similarity index 51% rename from subxt/src/error/mod.rs rename to subxt/src/error.rs index 52349f42da2..079b3a82ecf 100644 --- a/subxt/src/error/mod.rs +++ b/subxt/src/error.rs @@ -7,9 +7,11 @@ mod dispatch_error; mod hex; -crate::macros::cfg_unstable_light_client! { - pub use subxt_lightclient::LightClientError; -} +use std::borrow::Cow; +use thiserror::Error as DeriveError; + +#[cfg(feature = "light-client")] +pub use subxt_lightclient::LightClientError; // Re-export dispatch error types: pub use dispatch_error::{ @@ -17,37 +19,29 @@ pub use dispatch_error::{ }; // Re-expose the errors we use from other crates here: -pub use crate::Metadata; pub use hex::Hex; pub use scale_decode::Error as DecodeError; pub use scale_encode::Error as EncodeError; +pub use subxt_metadata::Metadata; pub use subxt_metadata::TryFromError as MetadataTryFromError; -// Re-export core error types we're just reusing. -pub use subxt_core::error::{ - ConstantError, - CustomValueError, - EventsError as CoreEventsError, - // These errors are exposed as-is: - ExtrinsicDecodeErrorAt, - // These errors are wrapped: - ExtrinsicError as CoreExtrinsicError, - RuntimeApiError as CoreRuntimeApiError, - StorageError as CoreStorageError, - StorageKeyError, - StorageValueError, - ViewFunctionError as CoreViewFunctionError, -}; - /// A global error type. Any of the errors exposed here can convert into this /// error via `.into()`, but this error isn't itself exposed from anything. #[derive(Debug, thiserror::Error)] #[non_exhaustive] #[allow(missing_docs)] pub enum Error { + #[error(transparent)] + OnlineClientError(#[from] OnlineClientError), + #[error(transparent)] + OfflineClientAtBlockError(#[from] OfflineClientAtBlockError), + #[error(transparent)] + OnlineClientAtBlockError(#[from] OnlineClientAtBlockError), #[error(transparent)] ExtrinsicDecodeErrorAt(#[from] ExtrinsicDecodeErrorAt), #[error(transparent)] + BlockError(#[from] BlockError), + #[error(transparent)] ConstantError(#[from] ConstantError), #[error(transparent)] CustomValueError(#[from] CustomValueError), @@ -58,16 +52,10 @@ pub enum Error { #[error(transparent)] BackendError(#[from] BackendError), #[error(transparent)] - BlockError(#[from] BlockError), + BlocksError(#[from] BlocksError), #[error(transparent)] AccountNonceError(#[from] AccountNonceError), #[error(transparent)] - OnlineClientError(#[from] OnlineClientError), - #[error(transparent)] - RuntimeUpdaterError(#[from] RuntimeUpdaterError), - #[error(transparent)] - RuntimeUpdateeApplyError(#[from] RuntimeUpdateeApplyError), - #[error(transparent)] RuntimeApiError(#[from] RuntimeApiError), #[error(transparent)] EventsError(#[from] EventsError), @@ -98,10 +86,10 @@ pub enum Error { OtherRpcClientError(#[from] subxt_rpcs::Error), #[error("Other codec error: {0}")] OtherCodecError(#[from] codec::Error), - #[cfg(feature = "unstable-light-client")] + #[cfg(feature = "light-client")] #[error("Other light client error: {0}")] OtherLightClientError(#[from] subxt_lightclient::LightClientError), - #[cfg(feature = "unstable-light-client")] + #[cfg(feature = "light-client")] #[error("Other light client RPC error: {0}")] OtherLightClientRpcError(#[from] subxt_lightclient::LightClientRpcError), // Dev note: Nothing in subxt should ever emit this error. It can instead be used @@ -153,19 +141,273 @@ impl Error { fn backend_error(&self) -> Option<&BackendError> { match self { - Error::BlockError(e) => e.backend_error(), + // Many of these contain no backend error, but keep the checks next to + // the actual error types to make it harder to miss adding any, and be exhaustive + // here so new error variants are not missed as easily. + Error::BlocksError(e) => e.backend_error(), Error::AccountNonceError(e) => e.backend_error(), Error::OnlineClientError(e) => e.backend_error(), - Error::RuntimeUpdaterError(e) => e.backend_error(), Error::RuntimeApiError(e) => e.backend_error(), Error::EventsError(e) => e.backend_error(), + Error::BlockError(e) => e.backend_error(), Error::ExtrinsicError(e) => e.backend_error(), Error::ViewFunctionError(e) => e.backend_error(), Error::TransactionProgressError(e) => e.backend_error(), Error::TransactionEventsError(e) => e.backend_error(), Error::TransactionFinalizedSuccessError(e) => e.backend_error(), Error::StorageError(e) => e.backend_error(), - // Any errors that **don't** return a BackendError anywhere will return None: + Error::OfflineClientAtBlockError(e) => e.backend_error(), + Error::OnlineClientAtBlockError(e) => e.backend_error(), + Error::ExtrinsicDecodeErrorAt(e) => e.backend_error(), + Error::ConstantError(e) => e.backend_error(), + Error::CustomValueError(e) => e.backend_error(), + Error::StorageKeyError(e) => e.backend_error(), + Error::StorageValueError(e) => e.backend_error(), + Error::TransactionStatusError(e) => e.backend_error(), + Error::ModuleErrorDetailsError(e) => e.backend_error(), + Error::ModuleErrorDecodeError(e) => e.backend_error(), + Error::DispatchErrorDecodeError(e) => e.backend_error(), + #[cfg(feature = "light-client")] + Error::OtherLightClientError(_) => None, + #[cfg(feature = "light-client")] + Error::OtherLightClientRpcError(_) => None, + // BackendError is always a BackendError: + Error::BackendError(e) => Some(e), + // Other errors come from different crates so can never contain a BackendError: + Error::OtherRpcClientError(_) => None, + Error::OtherCodecError(_) => None, + Error::Other(_) => None, + } + } +} + +/// Errors constructing an offline client at a specific block number. +#[allow(missing_docs)] +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +pub enum OfflineClientAtBlockError { + #[error( + "Cannot construct OfflineClientAtBlock: spec version not found for block number {block_number}" + )] + SpecVersionNotFound { + /// The block number for which the spec version was not found. + block_number: u64, + }, + #[error( + "Cannot construct OfflineClientAtBlock: metadata not found for spec version {spec_version}" + )] + MetadataNotFound { + /// The spec version for which the metadata was not found. + spec_version: u32, + }, +} + +impl OfflineClientAtBlockError { + fn backend_error(&self) -> Option<&BackendError> { + None + } +} + +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum OnlineClientError { + #[error("Cannot construct OnlineClient: The URL provided is invalid: {url}")] + InvalidUrl { + /// The URL that was invalid. + url: String, + }, + #[error("Cannot construct OnlineClient: {0}")] + RpcError(#[from] subxt_rpcs::Error), + #[error("Could not construct the CombinedBackend: {0}")] + CannotBuildCombinedBackend(CombinedBackendError), + #[error( + "Cannot construct OnlineClient: Cannot fetch latest finalized block to obtain init details from: {0}" + )] + CannotGetLatestFinalizedBlock(BackendError), + #[error("Cannot construct OnlineClient: Cannot fetch genesis hash: {0}")] + CannotGetGenesisHash(BackendError), + #[error("Cannot construct OnlineClient: Cannot fetch current runtime version: {0}")] + CannotGetCurrentRuntimeVersion(BackendError), + #[error("Cannot construct OnlineClient: Cannot fetch metadata: {0}")] + CannotFetchMetadata(BackendError), +} + +impl OnlineClientError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + OnlineClientError::CannotGetLatestFinalizedBlock(e) + | OnlineClientError::CannotGetGenesisHash(e) + | OnlineClientError::CannotGetCurrentRuntimeVersion(e) + | OnlineClientError::CannotFetchMetadata(e) => Some(e), + _ => None, + } + } +} + +/// Errors constructing streams of blocks. +#[allow(missing_docs)] +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +pub enum BlocksError { + #[error("Cannot construct block stream: cannot get the current block: {0}")] + CannotGetCurrentBlock(OnlineClientAtBlockError), + #[error("Cannot construct block stream: cannot get block header stream: {0}")] + CannotGetBlockHeaderStream(BackendError), + #[error("Error streaming blocks: cannot get the next block header: {0}")] + CannotGetBlockHeader(BackendError), +} + +impl BlocksError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + BlocksError::CannotGetCurrentBlock(e) => e.backend_error(), + BlocksError::CannotGetBlockHeaderStream(e) => Some(e), + BlocksError::CannotGetBlockHeader(e) => Some(e), + } + } +} + +/// Errors constructing an online client at a specific block number. +#[allow(missing_docs)] +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +pub enum OnlineClientAtBlockError { + #[error("Cannot construct OnlineClientAtBlock: cannot get the current block: {reason}")] + CannotGetCurrentBlock { + /// The error we encountered. + reason: BackendError, + }, + #[error( + "Cannot construct OnlineClientAtBlock: failed to get block hash from node for block {block_number}: {reason}" + )] + CannotGetBlockHash { + /// Block number we failed to get the hash for. + block_number: u64, + /// The error we encountered. + reason: BackendError, + }, + #[error("Cannot construct OnlineClientAtBlock: block number {block_number} not found")] + BlockNotFound { + /// The block number for which a block was not found. + block_number: u64, + }, + #[error( + "Cannot construct OnlineClientAtBlock: cannot get the block header for block {block_hash}: {reason}" + )] + CannotGetBlockHeader { + /// Block hash that we failed to fetch the header for. + block_hash: Hex, + /// The error we encountered. + reason: BackendError, + }, + #[error( + "Cannot construct OnlineClientAtBlock: cannot find the block header for block {block_hash}" + )] + BlockHeaderNotFound { + /// Block hash that we failed to find the header for. + block_hash: Hex, + }, + #[error( + "Cannot construct OnlineClientAtBlock: failed to obtain spec version for block {block_hash}: {reason}" + )] + CannotGetSpecVersion { + /// The block hash for which we failed to obtain the spec version. + block_hash: Hex, + /// The error we encountered. + reason: BackendError, + }, + #[error( + "Cannot construct OnlineClientAtBlock: failed to decode spec version for block {block_hash}: {reason}" + )] + CannotDecodeSpecVersion { + /// The block hash for which we failed to decode the spec version. + block_hash: Hex, + /// The error we encountered. + reason: codec::Error, + }, + #[error( + "Cannot construct OnlineClientAtBlock: failed to get metadata for block {block_hash}: {reason}" + )] + CannotGetMetadata { + /// The block hash for which we failed to get the metadata. + block_hash: Hex, + /// The error we encountered. + reason: String, + }, + #[error( + "Cannot construct OnlineClientAtBlock: Metadata V{version} (required at block {block_hash} is not supported." + )] + UnsupportedMetadataVersion { + /// The block hash that requires the unsupported version. + block_hash: Hex, + /// The unsupported metadata version. + version: u32, + }, + #[error( + "Cannot construct OnlineClientAtBlock: No legacy types were provided but we're trying to access a block that requires them." + )] + MissingLegacyTypes, + #[error( + "Cannot construct OnlineClientAtBlock: unable to convert legacy metadata (required at block {block_hash}): {reason}" + )] + CannotConvertLegacyMetadata { + /// The block hash that requires legacy types. + block_hash: Hex, + /// The metadata version. + metadata_version: u32, + /// Reason the conversion failed. + reason: subxt_metadata::LegacyFromError, + }, + #[error( + "Cannot construct OnlineClientAtBlock: unable to convert modern metadata (required at block {block_hash}): {reason}" + )] + CannotConvertModernMetadata { + /// The block hash that requires legacy types. + block_hash: Hex, + /// The metadata version. + metadata_version: u32, + /// Reason the conversion failed. + reason: subxt_metadata::TryFromError, + }, + #[error( + "Cannot construct OnlineClientAtBlock: cannot inject types from metadata: failure to parse a type found in the metadata: {parse_error}" + )] + CannotInjectMetadataTypes { + /// Error parsing a type found in the metadata. + parse_error: scale_info_legacy::lookup_name::ParseError, + }, +} + +impl OnlineClientAtBlockError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + OnlineClientAtBlockError::CannotGetCurrentBlock { reason } + | OnlineClientAtBlockError::CannotGetBlockHash { reason, .. } + | OnlineClientAtBlockError::CannotGetBlockHeader { reason, .. } + | OnlineClientAtBlockError::CannotGetSpecVersion { reason, .. } => Some(reason), + _ => None, + } + } +} + +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum BlockError { + #[error("Could not find the block with hash {block_hash}")] + BlockNotFound { block_hash: Hex }, + #[error("Could not download the block header with hash {block_hash}: {reason}")] + CouldNotDownloadBlockHeader { + block_hash: Hex, + reason: BackendError, + }, +} + +impl BlockError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + BlockError::CouldNotDownloadBlockHeader { reason, .. } => Some(reason), _ => None, } } @@ -185,7 +427,7 @@ pub enum BackendError { CouldNotDecodeMetadata(codec::Error), // This is for errors in `Backend` implementations which aren't any of the "pre-defined" set above: #[error("Custom backend error: {0}")] - Other(String), + Other(Cow<'static, str>), } impl BackendError { @@ -203,6 +445,11 @@ impl BackendError { pub fn is_rpc_limit_reached(&self) -> bool { matches!(self, BackendError::Rpc(RpcError::LimitReached)) } + + /// Create a [`BackendError::Other`] given a message. + pub fn other(message: impl Into>) -> Self { + BackendError::Other(message.into()) + } } impl From for BackendError { @@ -211,6 +458,14 @@ impl From for BackendError { } } +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum CombinedBackendError { + #[error("Could not obtain the list of RPC methods to determine which backends can be used")] + CouldNotObtainRpcMethodList(subxt_rpcs::Error), +} + /// An RPC error. Since we are generic over the RPC client that is used, /// the error is boxed and could be casted. #[derive(Debug, thiserror::Error)] @@ -228,49 +483,6 @@ pub enum RpcError { SubscriptionDropped, } -/// Block error -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum BlockError { - #[error( - "Could not find the block body with hash {block_hash} (perhaps it was on a non-finalized fork?)" - )] - BlockNotFound { block_hash: Hex }, - #[error("Could not download the block header with hash {block_hash}: {reason}")] - CouldNotGetBlockHeader { - block_hash: Hex, - reason: BackendError, - }, - #[error("Could not download the latest block header: {0}")] - CouldNotGetLatestBlock(BackendError), - #[error("Could not subscribe to all blocks: {0}")] - CouldNotSubscribeToAllBlocks(BackendError), - #[error("Could not subscribe to best blocks: {0}")] - CouldNotSubscribeToBestBlocks(BackendError), - #[error("Could not subscribe to finalized blocks: {0}")] - CouldNotSubscribeToFinalizedBlocks(BackendError), - #[error("Error getting account nonce at block {block_hash}")] - AccountNonceError { - block_hash: Hex, - account_id: Hex, - reason: AccountNonceError, - }, -} - -impl BlockError { - fn backend_error(&self) -> Option<&BackendError> { - match self { - BlockError::CouldNotGetBlockHeader { reason: e, .. } - | BlockError::CouldNotGetLatestBlock(e) - | BlockError::CouldNotSubscribeToAllBlocks(e) - | BlockError::CouldNotSubscribeToBestBlocks(e) - | BlockError::CouldNotSubscribeToFinalizedBlocks(e) => Some(e), - _ => None, - } - } -} - #[derive(Debug, thiserror::Error)] #[non_exhaustive] #[allow(missing_docs)] @@ -292,95 +504,26 @@ impl AccountNonceError { } } -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum OnlineClientError { - #[error("Cannot construct OnlineClient: {0}")] - RpcError(#[from] subxt_rpcs::Error), - #[error( - "Cannot construct OnlineClient: Cannot fetch latest finalized block to obtain init details from: {0}" - )] - CannotGetLatestFinalizedBlock(BackendError), - #[error("Cannot construct OnlineClient: Cannot fetch genesis hash: {0}")] - CannotGetGenesisHash(BackendError), - #[error("Cannot construct OnlineClient: Cannot fetch current runtime version: {0}")] - CannotGetCurrentRuntimeVersion(BackendError), - #[error("Cannot construct OnlineClient: Cannot fetch metadata: {0}")] - CannotFetchMetadata(BackendError), -} - -impl OnlineClientError { - fn backend_error(&self) -> Option<&BackendError> { - match self { - OnlineClientError::CannotGetLatestFinalizedBlock(e) - | OnlineClientError::CannotGetGenesisHash(e) - | OnlineClientError::CannotGetCurrentRuntimeVersion(e) - | OnlineClientError::CannotFetchMetadata(e) => Some(e), - _ => None, - } - } -} - -#[derive(Debug, thiserror::Error)] -#[non_exhaustive] -#[allow(missing_docs)] -pub enum RuntimeUpdaterError { - #[error("Error subscribing to runtime updates: The update stream ended unexpectedly")] - UnexpectedEndOfUpdateStream, - #[error("Error subscribing to runtime updates: The finalized block stream ended unexpectedly")] - UnexpectedEndOfBlockStream, - #[error("Error subscribing to runtime updates: Can't stream runtime version: {0}")] - CannotStreamRuntimeVersion(BackendError), - #[error("Error subscribing to runtime updates: Can't get next runtime version in stream: {0}")] - CannotGetNextRuntimeVersion(BackendError), - #[error("Error subscribing to runtime updates: Cannot stream finalized blocks: {0}")] - CannotStreamFinalizedBlocks(BackendError), - #[error("Error subscribing to runtime updates: Cannot get next finalized block in stream: {0}")] - CannotGetNextFinalizedBlock(BackendError), - #[error("Cannot fetch new metadata for runtime update: {0}")] - CannotFetchNewMetadata(BackendError), - #[error( - "Error subscribing to runtime updates: Cannot find the System.LastRuntimeUpgrade storage entry" - )] - CantFindSystemLastRuntimeUpgrade, - #[error("Error subscribing to runtime updates: Cannot fetch last runtime upgrade: {0}")] - CantFetchLastRuntimeUpgrade(StorageError), - #[error("Error subscribing to runtime updates: Cannot decode last runtime upgrade: {0}")] - CannotDecodeLastRuntimeUpgrade(StorageValueError), -} - -impl RuntimeUpdaterError { - fn backend_error(&self) -> Option<&BackendError> { - match self { - RuntimeUpdaterError::CannotStreamRuntimeVersion(e) - | RuntimeUpdaterError::CannotGetNextRuntimeVersion(e) - | RuntimeUpdaterError::CannotStreamFinalizedBlocks(e) - | RuntimeUpdaterError::CannotGetNextFinalizedBlock(e) - | RuntimeUpdaterError::CannotFetchNewMetadata(e) => Some(e), - _ => None, - } - } -} - -/// Error that can occur during upgrade. -#[non_exhaustive] -#[derive(Debug, thiserror::Error)] -#[allow(missing_docs)] -pub enum RuntimeUpdateeApplyError { - #[error("The proposed runtime update is the same as the current version")] - SameVersion, -} - /// Error working with Runtime APIs #[non_exhaustive] #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum RuntimeApiError { + #[error("The static Runtime API address used is not compatible with the live chain")] + IncompatibleCodegen, + #[error("Runtime API trait not found: {0}")] + TraitNotFound(String), + #[error("Runtime API method {method_name} not found in trait {trait_name}")] + MethodNotFound { + trait_name: String, + method_name: String, + }, + #[error("Failed to encode Runtime API inputs: {0}")] + CouldNotEncodeInputs(frame_decode::runtime_apis::RuntimeApiInputsEncodeError), + #[error("Failed to decode Runtime API: {0}")] + CouldNotDecodeResponse(frame_decode::runtime_apis::RuntimeApiDecodeError), #[error("Cannot access Runtime APIs at latest block: Cannot fetch latest finalized block: {0}")] CannotGetLatestFinalizedBlock(BackendError), - #[error("{0}")] - OfflineError(#[from] CoreRuntimeApiError), #[error("Cannot call the Runtime API: {0}")] CannotCallApi(BackendError), } @@ -400,8 +543,42 @@ impl RuntimeApiError { #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum EventsError { - #[error("{0}")] - OfflineError(#[from] CoreEventsError), + #[error("Can't decode event: can't decode phase: {0}")] + CannotDecodePhase(codec::Error), + #[error("Can't decode event: can't decode pallet index: {0}")] + CannotDecodePalletIndex(codec::Error), + #[error("Can't decode event: can't decode variant index: {0}")] + CannotDecodeVariantIndex(codec::Error), + #[error("Can't decode event: can't find pallet with index {0}")] + CannotFindPalletWithIndex(u8), + #[error( + "Can't decode event: can't find variant with index {variant_index} in pallet {pallet_name}" + )] + CannotFindVariantWithIndex { + pallet_name: String, + variant_index: u8, + }, + #[error("Can't decode field {field_name:?} in event {pallet_name}.{event_name}: {reason}")] + CannotDecodeFieldInEvent { + pallet_name: String, + event_name: String, + field_name: String, + reason: scale_decode::visitor::DecodeError, + }, + #[error("Can't decode event topics: {0}")] + CannotDecodeEventTopics(codec::Error), + #[error("Can't decode the fields of event {pallet_name}.{event_name}: {reason}")] + CannotDecodeEventFields { + pallet_name: String, + event_name: String, + reason: scale_decode::Error, + }, + #[error("Can't decode event {pallet_name}.{event_name} to Event enum: {reason}")] + CannotDecodeEventEnum { + pallet_name: String, + event_name: String, + reason: scale_decode::Error, + }, #[error("Cannot access events at latest block: Cannot fetch latest finalized block: {0}")] CannotGetLatestFinalizedBlock(BackendError), #[error("Cannot fetch event bytes: {0}")] @@ -423,14 +600,59 @@ impl EventsError { #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum ExtrinsicError { + #[error("The extrinsic payload is not compatible with the live chain")] + IncompatibleCodegen, + #[error("Can't find extrinsic: pallet with name {0} not found")] + PalletNameNotFound(String), + #[error("Can't find extrinsic: call name {call_name} doesn't exist in pallet {pallet_name}")] + CallNameNotFound { + pallet_name: String, + call_name: String, + }, + #[error("Can't encode the extrinsic call data: {0}")] + CannotEncodeCallData(scale_encode::Error), + #[error("Failed to encode an extrinsic: the genesis hash was not provided")] + GenesisHashNotProvided, + #[error("Subxt does not support the extrinsic versions expected by the chain")] + UnsupportedVersion, + #[error("Cannot construct the required transaction extensions: {0}")] + Params(#[from] ExtrinsicParamsError), + #[error("Cannot decode transaction extension '{name}': {error}")] + CouldNotDecodeTransactionExtension { + /// The extension name. + name: String, + /// The decode error. + error: scale_decode::Error, + }, + #[error( + "After decoding the extrinsic at index {extrinsic_index}, {num_leftover_bytes} bytes were left, suggesting that decoding may have failed" + )] + LeftoverBytes { + /// Index of the extrinsic that failed to decode. + extrinsic_index: usize, + /// Number of bytes leftover after decoding the extrinsic. + num_leftover_bytes: usize, + }, #[error("{0}")] - OfflineError(#[from] CoreExtrinsicError), + ExtrinsicDecodeErrorAt(#[from] ExtrinsicDecodeErrorAt), + #[error("Failed to decode the fields of an extrinsic at index {extrinsic_index}: {error}")] + CannotDecodeFields { + /// Index of the extrinsic whose fields we could not decode + extrinsic_index: usize, + /// The decode error. + error: scale_decode::Error, + }, + #[error("Failed to decode the extrinsic at index {extrinsic_index} to a root enum: {error}")] + CannotDecodeIntoRootExtrinsic { + /// Index of the extrinsic that we failed to decode + extrinsic_index: usize, + /// The decode error. + error: scale_decode::Error, + }, #[error("Could not download block body to extract extrinsics from: {0}")] CannotGetBlockBody(BackendError), #[error("Block not found: {0}")] BlockNotFound(Hex), - #[error("{0}")] - CouldNotDecodeExtrinsics(#[from] ExtrinsicDecodeErrorAt), #[error( "Extrinsic submission error: Cannot get latest finalized block to grab account nonce at: {0}" )] @@ -480,13 +702,42 @@ impl ExtrinsicError { } } +#[derive(Debug, DeriveError)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum CustomValueError { + #[error("The static custom value address used is not compatible with the live chain")] + IncompatibleCodegen, + #[error("The custom value '{0}' was not found")] + NotFound(String), + #[error("Failed to decode custom value: {0}")] + CouldNotDecodeCustomValue(frame_decode::custom_values::CustomValueDecodeError), +} + +impl CustomValueError { + fn backend_error(&self) -> Option<&BackendError> { + None + } +} + /// Error working with View Functions. #[non_exhaustive] #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum ViewFunctionError { - #[error("{0}")] - OfflineError(#[from] CoreViewFunctionError), + #[error("The static View Function address used is not compatible with the live chain")] + IncompatibleCodegen, + #[error("Can't find View Function: pallet {0} not found")] + PalletNotFound(String), + #[error("Can't find View Function {function_name} in pallet {pallet_name}")] + ViewFunctionNotFound { + pallet_name: String, + function_name: String, + }, + #[error("Failed to encode View Function inputs: {0}")] + CouldNotEncodeInputs(frame_decode::view_functions::ViewFunctionInputsEncodeError), + #[error("Failed to decode View Function: {0}")] + CouldNotDecodeResponse(frame_decode::view_functions::ViewFunctionDecodeError), #[error( "Cannot access View Functions at latest block: Cannot fetch latest finalized block: {0}" )] @@ -546,6 +797,12 @@ pub enum TransactionStatusError { Dropped(String), } +impl TransactionStatusError { + fn backend_error(&self) -> Option<&BackendError> { + None + } +} + /// Error fetching events for a just-submitted transaction #[derive(Debug, thiserror::Error)] #[non_exhaustive] @@ -575,6 +832,8 @@ pub enum TransactionEventsError { block_hash: Hex, error: EventsError, }, + #[error("Could not instantiate a client at the required block to fetch events: {0}")] + CannotInstantiateClientAtBlock(OnlineClientAtBlockError), #[error("Could not fetch events for the submitted transaction: {error}")] CannotFetchEventsForTransaction { block_hash: Hex, @@ -641,6 +900,12 @@ pub enum ModuleErrorDetailsError { }, } +impl ModuleErrorDetailsError { + fn backend_error(&self) -> Option<&BackendError> { + None + } +} + /// Error decoding the [`ModuleError`] #[derive(Debug, thiserror::Error)] #[non_exhaustive] @@ -648,6 +913,12 @@ pub enum ModuleErrorDetailsError { #[error("Could not decode the DispatchError::Module payload into the given type: {0}")] pub struct ModuleErrorDecodeError(scale_decode::Error); +impl ModuleErrorDecodeError { + fn backend_error(&self) -> Option<&BackendError> { + None + } +} + /// Error decoding the [`DispatchError`] #[derive(Debug, thiserror::Error)] #[non_exhaustive] @@ -666,13 +937,45 @@ pub enum DispatchErrorDecodeError { }, } +impl DispatchErrorDecodeError { + fn backend_error(&self) -> Option<&BackendError> { + None + } +} + /// Error working with storage. #[derive(Debug, thiserror::Error)] #[non_exhaustive] #[allow(missing_docs)] pub enum StorageError { - #[error("{0}")] - Offline(#[from] CoreStorageError), + #[error("The static storage address used is not compatible with the live chain")] + IncompatibleCodegen, + #[error("Can't find storage value: pallet with name {0} not found")] + PalletNameNotFound(String), + #[error( + "Storage entry '{entry_name}' not found in pallet {pallet_name} in the live chain metadata" + )] + StorageEntryNotFound { + pallet_name: String, + entry_name: String, + }, + #[error("Cannot obtain storage information from metadata: {0}")] + StorageInfoError(frame_decode::storage::StorageInfoError<'static>), + #[error("Cannot encode storage key: {0}")] + StorageKeyEncodeError(frame_decode::storage::StorageKeyEncodeError), + #[error("Cannot create a key to iterate over a plain entry")] + CannotIterPlainEntry { + pallet_name: String, + entry_name: String, + }, + #[error( + "Wrong number of key parts provided to iterate a storage address. We expected at most {max_expected} key parts but got {got} key parts" + )] + WrongNumberOfKeyPartsProvidedForIterating { max_expected: usize, got: usize }, + #[error( + "Wrong number of key parts provided to fetch a storage address. We expected {expected} key parts but got {got} key parts" + )] + WrongNumberOfKeyPartsProvidedForFetching { expected: usize, got: usize }, #[error("Cannot access storage at latest block: Cannot fetch latest finalized block: {0}")] CannotGetLatestFinalizedBlock(BackendError), #[error( @@ -700,3 +1003,136 @@ impl StorageError { } } } + +/// Something went wrong working with a constant. +#[derive(Debug, DeriveError)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum ConstantError { + #[error("The static constant address used is not compatible with the live chain")] + IncompatibleCodegen, + #[error("Can't find constant: pallet with name {0} not found")] + PalletNameNotFound(String), + #[error( + "Constant '{constant_name}' not found in pallet {pallet_name} in the live chain metadata" + )] + ConstantNameNotFound { + pallet_name: String, + constant_name: String, + }, + #[error("Failed to decode constant: {0}")] + CouldNotDecodeConstant(frame_decode::constants::ConstantDecodeError), + #[error("Cannot obtain constant information from metadata: {0}")] + ConstantInfoError(frame_decode::constants::ConstantInfoError<'static>), +} + +impl ConstantError { + fn backend_error(&self) -> Option<&BackendError> { + None + } +} + +#[derive(Debug, DeriveError)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum StorageKeyError { + #[error("Can't decode the storage key: {error}")] + StorageKeyDecodeError { + bytes: Vec, + error: frame_decode::storage::StorageKeyDecodeError, + }, + #[error("Can't decode the values from the storage key: {0}")] + CannotDecodeValuesInKey(frame_decode::storage::StorageKeyValueDecodeError), + #[error( + "Cannot decode storage key: there were leftover bytes, indicating that the decoding failed" + )] + LeftoverBytes { bytes: Vec }, + #[error("Can't decode a single value from the storage key part at index {index}: {error}")] + CannotDecodeValueInKey { + index: usize, + error: scale_decode::Error, + }, +} + +impl StorageKeyError { + fn backend_error(&self) -> Option<&BackendError> { + None + } +} + +#[derive(Debug, DeriveError)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum StorageValueError { + #[error("Cannot decode storage value: {0}")] + CannotDecode(frame_decode::storage::StorageValueDecodeError), + #[error( + "Cannot decode storage value: there were leftover bytes, indicating that the decoding failed" + )] + LeftoverBytes { bytes: Vec }, +} + +impl StorageValueError { + fn backend_error(&self) -> Option<&BackendError> { + None + } +} + +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +#[error("Cannot decode extrinsic at index {extrinsic_index}: {error}")] +pub struct ExtrinsicDecodeErrorAt { + pub extrinsic_index: usize, + pub error: ExtrinsicDecodeErrorAtReason, +} + +impl ExtrinsicDecodeErrorAt { + fn backend_error(&self) -> Option<&BackendError> { + None + } +} + +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum ExtrinsicDecodeErrorAtReason { + #[error("{0}")] + DecodeError(frame_decode::extrinsics::ExtrinsicDecodeError), + #[error("Leftover bytes")] + LeftoverBytes(Vec), +} + +/// An error that can be emitted when trying to construct an instance of [`crate::config::ExtrinsicParams`], +/// encode data from the instance, or match on signed extensions. +#[derive(Debug, DeriveError)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum ExtrinsicParamsError { + #[error("Cannot find type id '{type_id} in the metadata (context: {context})")] + MissingTypeId { + /// Type ID. + type_id: u32, + /// Some arbitrary context to help narrow the source of the error. + context: &'static str, + }, + #[error("The chain expects a signed extension with the name {0}, but we did not provide one")] + UnknownTransactionExtension(String), + #[error("Error constructing extrinsic parameters: {0}")] + Custom(Box), +} + +impl ExtrinsicParamsError { + /// Create a custom [`ExtrinsicParamsError`] from a string. + pub fn custom>(error: S) -> Self { + let error: String = error.into(); + let error: Box = Box::from(error); + ExtrinsicParamsError::Custom(error) + } +} + +impl From for ExtrinsicParamsError { + fn from(value: core::convert::Infallible) -> Self { + match value {} + } +} diff --git a/subxt/src/error/dispatch_error.rs b/subxt/src/error/dispatch_error.rs index 4b27e63dfde..18e7ee412a2 100644 --- a/subxt/src/error/dispatch_error.rs +++ b/subxt/src/error/dispatch_error.rs @@ -6,7 +6,7 @@ //! something fails in trying to submit/execute a transaction. use super::{DispatchErrorDecodeError, ModuleErrorDecodeError, ModuleErrorDetailsError}; -use crate::metadata::Metadata; +use crate::metadata::ArcMetadata; use core::fmt::Debug; use scale_decode::{DecodeAsType, TypeResolver, visitor::DecodeAsTypeResult}; use std::{borrow::Cow, marker::PhantomData}; @@ -133,7 +133,7 @@ pub enum TransactionalError { #[derive(Clone, thiserror::Error)] #[non_exhaustive] pub struct ModuleError { - metadata: Metadata, + metadata: ArcMetadata, /// Bytes representation: /// - `bytes[0]`: pallet index /// - `bytes[1]`: error index @@ -242,7 +242,7 @@ impl DispatchError { #[doc(hidden)] pub fn decode_from<'a>( bytes: impl Into>, - metadata: Metadata, + metadata: ArcMetadata, ) -> Result { let bytes = bytes.into(); let dispatch_error_ty_id = metadata diff --git a/subxt/src/events.rs b/subxt/src/events.rs new file mode 100644 index 00000000000..cbe122ae113 --- /dev/null +++ b/subxt/src/events.rs @@ -0,0 +1,454 @@ +//! This module exposes [`EventsClient`], which has methods for working with eventts. +//! It's created by calling [`crate::client::ClientAtBlock::events()`]. +//! +//! ```rust,no_run +//! pub use subxt::{OnlineClient, PolkadotConfig}; +//! +//! let client = OnlineClient::new().await?; +//! let at_block = client.at_current_block().await?; +//! +//! let events = at_block.events(); +//! ``` + +mod decode_as_event; + +use crate::backend::BackendExt; +use crate::client::{OfflineClientAtBlockT, OnlineClientAtBlockT}; +use crate::config::{Config, HashFor}; +use crate::error::EventsError; +use crate::{ArcMetadata, Metadata}; +use codec::{Compact, Decode, Encode}; +use scale_decode::{DecodeAsFields, DecodeAsType}; +use std::marker::PhantomData; +use std::sync::Arc; + +pub use decode_as_event::DecodeAsEvent; + +/// A client for working with events. See [the module docs](crate::events) for more. +pub struct EventsClient<'atblock, T, Client> { + client: &'atblock Client, + marker: PhantomData, +} + +impl<'atblock, T, Client> EventsClient<'atblock, T, Client> { + pub(crate) fn new(client: &'atblock Client) -> Self { + EventsClient { + client, + marker: PhantomData, + } + } +} + +impl<'atblock, T: Config, Client: OfflineClientAtBlockT> EventsClient<'atblock, T, Client> { + /// Work with the block event bytes given. + /// + /// No attempt to validate the provided bytes is made here; if invalid bytes are + /// provided then attempting to iterate and decode them will fail. + pub fn from_bytes(&self, event_bytes: Vec) -> Events { + // event_bytes is a SCALE encoded vector of events. So, pluck the + // compact encoded length from the front, leaving the remaining bytes + // for our iterating to decode. + // + // Note: if we get no bytes back, avoid an error reading vec length + // and default to 0 events. + let cursor = &mut &*event_bytes; + let num_events = >::decode(cursor).unwrap_or(Compact(0)).0; + + // Start decoding after the compact encoded bytes. + let start_idx = event_bytes.len() - cursor.len(); + + Events { + metadata: self.client.metadata(), + event_bytes: event_bytes.into(), + start_idx, + num_events, + marker: PhantomData, + } + } +} + +impl<'atblock, T: Config, Client: OnlineClientAtBlockT> EventsClient<'atblock, T, Client> { + /// Fetch the events at this block. + pub async fn fetch(&self) -> Result, EventsError> { + let client = self.client; + + // Fetch the bytes. Ensure things work if we get 0 bytes back. + let block_hash = client.block_hash(); + let event_bytes = client + .backend() + .storage_fetch_value(system_events_key().to_vec(), block_hash) + .await + .map_err(EventsError::CannotFetchEventBytes)? + .unwrap_or_default(); + + Ok(self.from_bytes(event_bytes)) + } +} + +/// The events at some block. +// Dev note [jsdw]: +// It would be nice if this borrowed &'atblock Metadata, to be +// consistent with many other things and allow longer lifetimes +// on a couple of bits, but we need to construct this from transaction +// things and can't provide lifetimes from there. +#[derive(Debug)] +pub struct Events { + metadata: ArcMetadata, + // Note; raw event bytes are prefixed with a Compact containing + // the number of events to be decoded. The start_idx reflects that, so + // that we can skip over those bytes when decoding them + event_bytes: Arc<[u8]>, + start_idx: usize, + num_events: u32, + marker: core::marker::PhantomData, +} + +impl Events { + /// The number of events. + pub fn len(&self) -> u32 { + self.num_events + } + + /// Are there no events in this block? + // Note: mainly here to satisfy clippy. + pub fn is_empty(&self) -> bool { + self.num_events == 0 + } + + /// Return the bytes representing all of the events. + pub fn bytes(&self) -> &[u8] { + &self.event_bytes + } + + /// Iterate over all of the events, using metadata to dynamically + /// decode them as we go, and returning the raw bytes and other associated + /// details. If an error occurs, all subsequent iterations return `None`. + // Dev note: The returned iterator is 'static + Send so that we can box it up and make + // use of it with our `FilterEvents` stuff. + pub fn iter(&'_ self) -> impl Iterator, EventsError>> + Send + Sync { + // The event bytes ignoring the compact encoded length on the front: + let event_bytes = self.event_bytes.clone(); + let metadata = &*self.metadata; + let num_events = self.num_events; + + let mut pos = self.start_idx; + let mut index = 0; + core::iter::from_fn(move || { + if event_bytes.len() <= pos || num_events == index { + None + } else { + match Event::decode_from(metadata, event_bytes.clone(), pos, index) { + Ok(event_details) => { + // Skip over decoded bytes in next iteration: + pos += event_details.bytes().len(); + // Increment the index: + index += 1; + // Return the event details: + Some(Ok(event_details)) + } + Err(e) => { + // By setting the position to the "end" of the event bytes, + // the cursor len will become 0 and the iterator will return `None` + // from now on: + pos = event_bytes.len(); + Some(Err(e)) + } + } + } + }) + } + + /// Iterate through the events, Decoding and returning any that match the given type. + /// + /// This is a convenience function for calling [`Events::iter`] and then [`Event::decode_fields_as`] + /// on each event that we iterate over, filtering those that don't match. + pub fn find(&self) -> impl Iterator> { + self.iter() + .filter_map(|e| e.ok()) + .filter_map(|e| e.decode_fields_as::()) + } + + /// Find the first event matching the given type, returning `None` if it doesn't exist, + /// and the result of decoding it if it does. + pub fn find_first(&self) -> Option> { + self.find::().next() + } + + /// Find an event matching the given type, returning true if it exists. This function does _not_ + /// try to actually decode the event bytes into the given type. + pub fn has(&self) -> bool { + self.iter().filter_map(|e| e.ok()).any(|e| e.is::()) + } +} + +/// A phase of a block's execution. +#[derive(Copy, Clone, Debug, Eq, PartialEq, Decode, Encode)] +pub enum Phase { + /// Applying an extrinsic. + ApplyExtrinsic(u32), + /// Finalizing the block. + Finalization, + /// Initializing the block. + Initialization, +} + +/// The event details. +#[derive(Debug, Clone)] +pub struct Event<'events, T: Config> { + pallet_name: &'events str, + event_name: &'events str, + metadata: &'events Metadata, + // all of the event bytes (not just this one). + all_bytes: Arc<[u8]>, + // event phase. + phase: Phase, + /// The index of the event in the list of events in a given block. + index: u32, + // start of the bytes (phase, pallet/variant index and then fields and then topic to follow). + start_idx: usize, + // start of the event (ie pallet/variant index and then the fields and topic after). + event_start_idx: usize, + // start of the fields (ie after phase and pallet/variant index). + event_fields_start_idx: usize, + // end of the fields. + event_fields_end_idx: usize, + // end of everything (fields + topics) + end_idx: usize, + // event topics. + topics: Vec>, +} + +impl<'events, T: Config> Event<'events, T> { + /// Attempt to dynamically decode a single event from our events input. + fn decode_from( + metadata: &'events Metadata, + all_bytes: Arc<[u8]>, + start_idx: usize, + index: u32, + ) -> Result, EventsError> { + let input = &mut &all_bytes[start_idx..]; + + let phase = Phase::decode(input).map_err(EventsError::CannotDecodePhase)?; + + let event_start_idx = all_bytes.len() - input.len(); + + let pallet_index = u8::decode(input).map_err(EventsError::CannotDecodePalletIndex)?; + let variant_index = u8::decode(input).map_err(EventsError::CannotDecodeVariantIndex)?; + + let event_fields_start_idx = all_bytes.len() - input.len(); + + // Get metadata for the event: + let event_pallet = metadata + .pallet_by_event_index(pallet_index) + .ok_or_else(|| EventsError::CannotFindPalletWithIndex(pallet_index))?; + let event_variant = event_pallet + .event_variant_by_index(variant_index) + .ok_or_else(|| EventsError::CannotFindVariantWithIndex { + pallet_name: event_pallet.name().to_string(), + variant_index, + })?; + + tracing::debug!( + "Decoding Event '{}::{}'", + event_pallet.name(), + &event_variant.name + ); + + // Skip over the bytes belonging to this event. + for field_metadata in &event_variant.fields { + // Skip over the bytes for this field: + scale_decode::visitor::decode_with_visitor( + input, + field_metadata.ty.id, + metadata.types(), + scale_decode::visitor::IgnoreVisitor::new(), + ) + .map_err(|e| EventsError::CannotDecodeFieldInEvent { + pallet_name: event_pallet.name().to_string(), + event_name: event_variant.name.clone(), + field_name: field_metadata + .name + .clone() + .unwrap_or("".to_string()), + reason: e, + })?; + } + + // the end of the field bytes. + let event_fields_end_idx = all_bytes.len() - input.len(); + + // topics come after the event data in EventRecord. + let topics = + Vec::>::decode(input).map_err(EventsError::CannotDecodeEventTopics)?; + + // what bytes did we skip over in total, including topics. + let end_idx = all_bytes.len() - input.len(); + + Ok(Event { + pallet_name: event_pallet.name(), + event_name: &event_variant.name, + phase, + index, + start_idx, + event_start_idx, + event_fields_start_idx, + event_fields_end_idx, + end_idx, + all_bytes, + metadata, + topics, + }) + } + + /// When was the event produced? + pub fn phase(&self) -> Phase { + self.phase + } + + /// What index is this event in the stored events for this block. + pub fn index(&self) -> u32 { + self.index + } + + /// The index of the pallet that the event originated from. + pub fn pallet_index(&self) -> u8 { + // Note: never panics; we expect these bytes to exist + // in order that the EventDetails could be created. + self.all_bytes[self.event_fields_start_idx - 2] + } + + /// The index of the event variant that the event originated from. + pub fn event_index(&self) -> u8 { + // Note: never panics; we expect these bytes to exist + // in order that the EventDetails could be created. + self.all_bytes[self.event_fields_start_idx - 1] + } + + /// The name of the pallet from whence the Event originated. + pub fn pallet_name(&self) -> &'events str { + self.pallet_name + } + + /// The name of the event (ie the name of the variant that it corresponds to). + pub fn event_name(&self) -> &'events str { + self.event_name + } + + /// Return _all_ of the bytes representing this event, which include, in order: + /// - The phase. + /// - Pallet and event index. + /// - Event fields. + /// - Event Topics. + pub fn bytes(&self) -> &[u8] { + &self.all_bytes[self.start_idx..self.end_idx] + } + + /// Return the bytes representing the fields stored in this event. + pub fn field_bytes(&self) -> &[u8] { + &self.all_bytes[self.event_fields_start_idx..self.event_fields_end_idx] + } + + /// Return the topics associated with this event. + pub fn topics(&self) -> &[HashFor] { + &self.topics + } + + /// Return true if this [`Event`] matches the provided type. + pub fn is(&self) -> bool { + E::is_event(self.pallet_name(), self.event_name()) + } + + /// Attempt to decode this [`Event`] into an outer event enum type (which includes + /// the pallet and event enum variants as well as the event fields). One compatible + /// type for this is exposed via static codegen as a root level `Event` type. + pub fn decode_as(&self) -> Result { + let bytes = &self.all_bytes[self.event_start_idx..self.event_fields_end_idx]; + + let decoded = E::decode_as_type( + &mut &bytes[..], + self.metadata.outer_enums().event_enum_ty(), + self.metadata.types(), + ) + .map_err(|e| { + let md = self.event_metadata(); + EventsError::CannotDecodeEventEnum { + pallet_name: md.pallet.name().to_string(), + event_name: md.variant.name.clone(), + reason: e, + } + })?; + + Ok(decoded) + } + + /// Decode the event fields into some type which implements [`DecodeAsEvent`]. + /// + /// Event types generated via the [`macro@crate::subxt`] macro implement this. + pub fn decode_fields_as(&self) -> Option> { + if self.is::() { + Some(self.decode_fields_unchecked_as::()) + } else { + None + } + } + + /// Decode the event fields into some type which implements [`DecodeAsFields`]. + /// + /// This ignores the pallet and event name information, so you should check those via [`Self::pallet_name()`] + /// and [`Self::event_name()`] to confirm that this event is the one you are intending to decode. + /// + /// Prefer to use [`Self::decode_fields_as`] where possible. + pub fn decode_fields_unchecked_as(&self) -> Result { + let bytes = &mut self.field_bytes(); + let event_metadata = self.event_metadata(); + + let mut fields = event_metadata + .variant + .fields + .iter() + .map(|f| scale_decode::Field::new(f.ty.id, f.name.as_deref())); + + let decoded = + E::decode_as_fields(bytes, &mut fields, self.metadata.types()).map_err(|e| { + EventsError::CannotDecodeEventFields { + pallet_name: event_metadata.pallet.name().to_string(), + event_name: event_metadata.variant.name.clone(), + reason: e, + } + })?; + + Ok(decoded) + } + + /// Fetch details from the metadata for this event. This is used for decoding but + /// we try to avoid using it elsewhere. + fn event_metadata(&self) -> EventMetadataDetails<'_> { + let pallet = self + .metadata + .pallet_by_event_index(self.pallet_index()) + .expect("event pallet to be found; we did this already during decoding"); + let variant = pallet + .event_variant_by_index(self.event_index()) + .expect("event variant to be found; we did this already during decoding"); + + EventMetadataDetails { pallet, variant } + } +} + +// The storage key needed to access events. +fn system_events_key() -> [u8; 32] { + let a = sp_crypto_hashing::twox_128(b"System"); + let b = sp_crypto_hashing::twox_128(b"Events"); + let mut res = [0; 32]; + res[0..16].clone_from_slice(&a); + res[16..32].clone_from_slice(&b); + res +} + +/// Details for the given event plucked from the metadata. +struct EventMetadataDetails<'a> { + /// Metadata for the pallet that the event belongs to. + pub pallet: subxt_metadata::PalletMetadata<'a>, + /// Metadata for the variant which describes the pallet events. + pub variant: &'a scale_info::Variant, +} diff --git a/subxt/src/events/decode_as_event.rs b/subxt/src/events/decode_as_event.rs new file mode 100644 index 00000000000..c890ae95b3d --- /dev/null +++ b/subxt/src/events/decode_as_event.rs @@ -0,0 +1,9 @@ +use scale_decode::DecodeAsFields; + +/// This trait can be implemented for any type which implements [`DecodeAsFields`]. +/// This adds information to the type about which event it is, which enforces that +/// only the correct event can be decoded into it. +pub trait DecodeAsEvent: DecodeAsFields { + /// Returns true if the given pallet and event names match this event. + fn is_event(pallet: &str, event: &str) -> bool; +} diff --git a/subxt/src/events/events_client.rs b/subxt/src/events/events_client.rs deleted file mode 100644 index dc0ee1924c1..00000000000 --- a/subxt/src/events/events_client.rs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::backend::{Backend, BackendExt, BlockRef}; -use crate::{ - client::OnlineClientT, - config::{Config, HashFor}, - error::EventsError, - events::Events, -}; -use derive_where::derive_where; -use std::future::Future; - -/// A client for working with events. -#[derive_where(Clone; Client)] -pub struct EventsClient { - client: Client, - _marker: std::marker::PhantomData, -} - -impl EventsClient { - /// Create a new [`EventsClient`]. - pub fn new(client: Client) -> Self { - Self { - client, - _marker: std::marker::PhantomData, - } - } -} - -impl EventsClient -where - T: Config, - Client: OnlineClientT, -{ - /// Obtain events at some block hash. - /// - /// # Warning - /// - /// This call only supports blocks produced since the most recent - /// runtime upgrade. You can attempt to retrieve events from older blocks, - /// but may run into errors attempting to work with them. - pub fn at( - &self, - block_ref: impl Into>>, - ) -> impl Future, EventsError>> + Send + 'static { - self.at_or_latest(Some(block_ref.into())) - } - - /// Obtain events for the latest finalized block. - pub fn at_latest( - &self, - ) -> impl Future, EventsError>> + Send + 'static { - self.at_or_latest(None) - } - - /// Obtain events at some block hash. - fn at_or_latest( - &self, - block_ref: Option>>, - ) -> impl Future, EventsError>> + Send + 'static { - // Clone and pass the client in like this so that we can explicitly - // return a Future that's Send + 'static, rather than tied to &self. - let client = self.client.clone(); - async move { - // If a block ref isn't provided, we'll get the latest finalized block to use. - let block_ref = match block_ref { - Some(r) => r, - None => client - .backend() - .latest_finalized_block_ref() - .await - .map_err(EventsError::CannotGetLatestFinalizedBlock)?, - }; - - let event_bytes = get_event_bytes(client.backend(), block_ref.hash()).await?; - Ok(Events::decode_from(event_bytes, client.metadata())) - } - } -} - -// The storage key needed to access events. -fn system_events_key() -> [u8; 32] { - let a = sp_crypto_hashing::twox_128(b"System"); - let b = sp_crypto_hashing::twox_128(b"Events"); - let mut res = [0; 32]; - res[0..16].clone_from_slice(&a); - res[16..32].clone_from_slice(&b); - res -} - -// Get the event bytes from the provided client, at the provided block hash. -pub(crate) async fn get_event_bytes( - backend: &dyn Backend, - block_hash: HashFor, -) -> Result, EventsError> { - let bytes = backend - .storage_fetch_value(system_events_key().to_vec(), block_hash) - .await - .map_err(EventsError::CannotFetchEventBytes)? - .unwrap_or_default(); - Ok(bytes) -} diff --git a/subxt/src/events/events_type.rs b/subxt/src/events/events_type.rs deleted file mode 100644 index 04b706656e6..00000000000 --- a/subxt/src/events/events_type.rs +++ /dev/null @@ -1,163 +0,0 @@ -use crate::{ - Metadata, - config::{Config, HashFor}, - error::EventsError, -}; -use derive_where::derive_where; -use scale_decode::{DecodeAsFields, DecodeAsType}; -use subxt_core::events::{EventDetails as CoreEventDetails, Events as CoreEvents}; - -pub use subxt_core::events::{EventMetadataDetails, Phase, StaticEvent}; - -/// A collection of events obtained from a block, bundled with the necessary -/// information needed to decode and iterate over them. -// Dev note: we are just wrapping the subxt_core types here to avoid leaking them -// in Subxt and map any errors into Subxt errors so that we don't have this part of the -// API returning a different error type (ie the subxt_core::Error). -#[derive_where(Clone, Debug)] -pub struct Events { - inner: CoreEvents, -} - -impl Events { - /// Create a new [`Events`] instance from the given bytes. - pub fn decode_from(event_bytes: Vec, metadata: Metadata) -> Self { - Self { - inner: CoreEvents::decode_from(event_bytes, metadata), - } - } - - /// The number of events. - pub fn len(&self) -> u32 { - self.inner.len() - } - - /// Are there no events in this block? - // Note: mainly here to satisfy clippy.. - pub fn is_empty(&self) -> bool { - self.inner.is_empty() - } - - /// Return the bytes representing all of the events. - pub fn bytes(&self) -> &[u8] { - self.inner.bytes() - } - - /// Iterate over all of the events, using metadata to dynamically - /// decode them as we go, and returning the raw bytes and other associated - /// details. If an error occurs, all subsequent iterations return `None`. - // Dev note: The returned iterator is 'static + Send so that we can box it up and make - // use of it with our `FilterEvents` stuff. - pub fn iter( - &self, - ) -> impl Iterator, EventsError>> + Send + Sync + 'static { - self.inner - .iter() - .map(|item| item.map(|e| EventDetails { inner: e }).map_err(Into::into)) - } - - /// Iterate through the events using metadata to dynamically decode and skip - /// them, and return only those which should decode to the provided `Ev` type. - /// If an error occurs, all subsequent iterations return `None`. - pub fn find(&self) -> impl Iterator> { - self.inner.find::().map(|item| item.map_err(Into::into)) - } - - /// Iterate through the events using metadata to dynamically decode and skip - /// them, and return the first event found which decodes to the provided `Ev` type. - pub fn find_first(&self) -> Result, EventsError> { - self.inner.find_first::().map_err(Into::into) - } - - /// Iterate through the events using metadata to dynamically decode and skip - /// them, and return the last event found which decodes to the provided `Ev` type. - pub fn find_last(&self) -> Result, EventsError> { - self.inner.find_last::().map_err(Into::into) - } - - /// Find an event that decodes to the type provided. Returns true if it was found. - pub fn has(&self) -> Result { - self.inner.has::().map_err(Into::into) - } -} - -/// The event details. -#[derive(Debug, Clone)] -pub struct EventDetails { - inner: CoreEventDetails, -} - -impl EventDetails { - /// When was the event produced? - pub fn phase(&self) -> Phase { - self.inner.phase() - } - - /// What index is this event in the stored events for this block. - pub fn index(&self) -> u32 { - self.inner.index() - } - - /// The index of the pallet that the event originated from. - pub fn pallet_index(&self) -> u8 { - self.inner.pallet_index() - } - - /// The index of the event variant that the event originated from. - pub fn variant_index(&self) -> u8 { - self.inner.variant_index() - } - - /// The name of the pallet from whence the Event originated. - pub fn pallet_name(&self) -> &str { - self.inner.pallet_name() - } - - /// The name of the event (ie the name of the variant that it corresponds to). - pub fn variant_name(&self) -> &str { - self.inner.variant_name() - } - - /// Fetch details from the metadata for this event. - pub fn event_metadata(&self) -> EventMetadataDetails<'_> { - self.inner.event_metadata() - } - - /// Return _all_ of the bytes representing this event, which include, in order: - /// - The phase. - /// - Pallet and event index. - /// - Event fields. - /// - Event Topics. - pub fn bytes(&self) -> &[u8] { - self.inner.bytes() - } - - /// Return the bytes representing the fields stored in this event. - pub fn field_bytes(&self) -> &[u8] { - self.inner.field_bytes() - } - - /// Decode and provide the event fields back in the form of a [`scale_value::Composite`] - /// type which represents the named or unnamed fields that were present in the event. - pub fn decode_as_fields(&self) -> Result { - self.inner.decode_as_fields().map_err(Into::into) - } - - /// Attempt to decode these [`EventDetails`] into a type representing the event fields. - /// Such types are exposed in the codegen as `pallet_name::events::EventName` types. - pub fn as_event(&self) -> Result, EventsError> { - self.inner.as_event::().map_err(Into::into) - } - - /// Attempt to decode these [`EventDetails`] into a root event type (which includes - /// the pallet and event enum variants as well as the event fields). A compatible - /// type for this is exposed via static codegen as a root level `Event` type. - pub fn as_root_event(&self) -> Result { - self.inner.as_root_event::().map_err(Into::into) - } - - /// Return the topics associated with this event. - pub fn topics(&self) -> &[HashFor] { - self.inner.topics() - } -} diff --git a/subxt/src/events/mod.rs b/subxt/src/events/mod.rs deleted file mode 100644 index 185cafa2508..00000000000 --- a/subxt/src/events/mod.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! This module exposes the types and such necessary for working with events. -//! The two main entry points into events are [`crate::OnlineClient::events()`] -//! and calls like [crate::tx::TxProgress::wait_for_finalized_success()]. - -mod events_client; -mod events_type; - -use crate::client::OnlineClientT; -use crate::error::EventsError; -use subxt_core::{ - Metadata, - config::{Config, HashFor}, -}; - -pub use events_client::EventsClient; -pub use events_type::{EventDetails, EventMetadataDetails, Events, Phase, StaticEvent}; - -/// Creates a new [`Events`] instance by fetching the corresponding bytes at `block_hash` from the client. -pub async fn new_events_from_client( - metadata: Metadata, - block_hash: HashFor, - client: C, -) -> Result, EventsError> -where - T: Config, - C: OnlineClientT, -{ - let event_bytes = events_client::get_event_bytes(client.backend(), block_hash).await?; - Ok(Events::::decode_from(event_bytes, metadata)) -} diff --git a/subxt/src/extrinsics.rs b/subxt/src/extrinsics.rs new file mode 100644 index 00000000000..c40726e57ee --- /dev/null +++ b/subxt/src/extrinsics.rs @@ -0,0 +1,502 @@ +//! This module exposes [`ExtrinsicsClient`], which has methods for working with extrinsics. +//! It's created by calling [`crate::client::ClientAtBlock::extrinsics()`]. +//! +//! ```rust,no_run +//! pub use subxt::{OnlineClient, PolkadotConfig}; +//! +//! let client = OnlineClient::new().await?; +//! let at_block = client.at_current_block().await?; +//! +//! let extrinsics = at_block.extrinsics(); +//! ``` + +mod decode_as_extrinsic; +mod extrinsic_transaction_extensions; + +use crate::client::{OfflineClientAtBlockT, OnlineClientAtBlockT}; +use crate::config::{Config, HashFor, Hasher}; +use crate::error::{ + EventsError, ExtrinsicDecodeErrorAt, ExtrinsicDecodeErrorAtReason, ExtrinsicError, +}; +use crate::events::{self, DecodeAsEvent}; +use frame_decode::extrinsics::Extrinsic as ExtrinsicInfo; +use scale_decode::{DecodeAsFields, DecodeAsType}; +use scale_info::PortableRegistry; +use std::marker::PhantomData; +use std::sync::Arc; +use subxt_metadata::Metadata; + +pub use decode_as_extrinsic::DecodeAsExtrinsic; +pub use extrinsic_transaction_extensions::{ + ExtrinsicTransactionExtension, ExtrinsicTransactionExtensions, +}; + +/// A client for working with extrinsics. See [the module docs](crate::extrinsics) for more. +pub struct ExtrinsicsClient<'atblock, T, Client> { + client: &'atblock Client, + marker: PhantomData, +} + +impl<'atblock, T, Client> ExtrinsicsClient<'atblock, T, Client> { + pub(crate) fn new(client: &'atblock Client) -> Self { + ExtrinsicsClient { + client, + marker: PhantomData, + } + } +} + +impl<'atblock, T: Config, Client: OfflineClientAtBlockT> ExtrinsicsClient<'atblock, T, Client> { + /// Work with the block body bytes given. + /// + /// No attempt to validate the provided bytes is made here; if invalid bytes are + /// provided then attempting to iterate and decode them will fail. + pub async fn from_bytes(&self, extrinsics: Vec>) -> Extrinsics<'atblock, T, Client> { + Extrinsics { + client: self.client, + extrinsics: Arc::new(extrinsics), + marker: PhantomData, + } + } +} + +impl<'atblock, T: Config, Client: OnlineClientAtBlockT> ExtrinsicsClient<'atblock, T, Client> { + /// Fetch the extrinsics at this block. + pub async fn fetch(&self) -> Result, ExtrinsicError> { + let client = self.client; + let block_hash = client.block_hash(); + let extrinsics = client + .backend() + .block_body(block_hash) + .await + .map_err(ExtrinsicError::CannotGetBlockBody)? + .ok_or_else(|| ExtrinsicError::BlockNotFound(block_hash.into()))?; + + Ok(Extrinsics { + client, + extrinsics: Arc::new(extrinsics), + marker: PhantomData, + }) + } +} + +/// The extrinsics in a block. +#[derive(Debug, Clone)] +pub struct Extrinsics<'atblock, T, C> { + client: &'atblock C, + extrinsics: Arc>>, + marker: PhantomData, +} + +impl<'atblock, T: Config, C: OfflineClientAtBlockT> Extrinsics<'atblock, T, C> { + /// The number of extrinsics. + pub fn len(&self) -> usize { + self.extrinsics.len() + } + + /// Are there no extrinsics in this block? + // Note: mainly here to satisfy clippy. + pub fn is_empty(&self) -> bool { + self.extrinsics.is_empty() + } + + /// Returns an iterator over the extrinsics in the block body. We decode the extrinsics on + /// demand as we iterate, and so if any fail to decode an error will be returned. + pub fn iter( + &self, + ) -> impl Iterator, ExtrinsicDecodeErrorAt>> { + let hasher = self.client.hasher(); + let metadata = self.client.metadata_ref(); + let client = self.client; + let all_extrinsic_bytes = self.extrinsics.clone(); + + self.extrinsics + .iter() + .enumerate() + .map(move |(extrinsic_index, extrinsic_bytes)| { + let cursor = &mut &**extrinsic_bytes; + + // Try to decode the extrinsic. + let info = + frame_decode::extrinsics::decode_extrinsic(cursor, metadata, metadata.types()) + .map_err(|error| ExtrinsicDecodeErrorAt { + extrinsic_index, + error: ExtrinsicDecodeErrorAtReason::DecodeError(error), + })? + .into_owned(); + + // We didn't consume all bytes, so decoding probably failed. + if !cursor.is_empty() { + return Err(ExtrinsicDecodeErrorAt { + extrinsic_index, + error: ExtrinsicDecodeErrorAtReason::LeftoverBytes(cursor.to_vec()), + }); + } + + Ok(Extrinsic { + client, + index: extrinsic_index, + info: Arc::new(info), + extrinsics: Arc::clone(&all_extrinsic_bytes), + hasher, + metadata, + }) + }) + } + + /// Iterate through the extrinsics, Decoding and returning any that match the given type. + /// + /// This is a convenience function for calling [`Self::iter`] and then [`Extrinsic::decode_call_data_fields_as`] + /// on each extrinsic that we iterate over, filtering those that don't match. + pub fn find(&self) -> impl Iterator> { + self.iter() + .filter_map(|e| e.ok()) + .filter_map(|e| e.decode_call_data_fields_as::()) + } + + /// Find the first extrinsic matching the given type, returning `None` if it doesn't exist, + /// and the result of decoding it if it does. + pub fn find_first(&self) -> Option> { + self.find::().next() + } + + /// Find an extrinsic matching the given type, returning true if it exists. This function does _not_ + /// try to actually decode the extrinsic bytes into the given type. + pub fn has(&self) -> bool { + self.iter().filter_map(|e| e.ok()).any(|e| e.is::()) + } +} + +/// A single extrinsic in a block. +pub struct Extrinsic<'atblock, T: Config, C> { + client: &'atblock C, + /// The index of the extrinsic in the block. + index: usize, + /// Information about the extrinsic + info: Arc>, + /// All extrinsic bytes. use the index to select the correct bytes. + extrinsics: Arc>>, + /// Hash the extrinsic if we want. + hasher: &'atblock T::Hasher, + /// Subxt metadata to fetch the extrinsic metadata. + metadata: &'atblock Metadata, +} + +impl<'atblock, T, C> Extrinsic<'atblock, T, C> +where + T: Config, + C: OfflineClientAtBlockT, +{ + /// Calculate and return the hash of the extrinsic, based on the configured hasher. + pub fn hash(&self) -> HashFor { + self.hasher.hash(&self.extrinsics[self.index]) + } + + /// Is the extrinsic signed? + pub fn is_signed(&self) -> bool { + self.info.is_signed() + } + + /// The index of the extrinsic in the block. + pub fn index(&self) -> usize { + self.index + } + + /// The index of the pallet that the extrinsic originated from. + pub fn pallet_index(&self) -> u8 { + self.info.pallet_index() + } + + /// The index of the extrinsic variant that the extrinsic originated from. + pub fn call_index(&self) -> u8 { + self.info.call_index() + } + + /// The name of the pallet from whence the extrinsic originated. + pub fn pallet_name(&self) -> &str { + self.info.pallet_name() + } + + /// The name of the call (ie the name of the variant that it corresponds to). + pub fn call_name(&self) -> &str { + self.info.call_name() + } + + /// Return the extrinsic bytes. + pub fn bytes(&self) -> &[u8] { + &self.extrinsics[self.index] + } + + /// Return only the bytes representing this extrinsic call: + /// - First byte is the pallet index + /// - Second byte is the variant (call) index + /// - Followed by field bytes. + /// + /// # Note + /// + /// Please use [`Self::bytes`] if you want to get all extrinsic bytes. + pub fn call_data_bytes(&self) -> &[u8] { + &self.bytes()[self.info.call_data_range()] + } + + /// Return the bytes representing the fields stored in this extrinsic. + /// + /// # Note + /// + /// This is a subset of [`Self::call_data_bytes`] that does not include the + /// first two bytes that denote the pallet index and the variant index. + pub fn call_data_field_bytes(&self) -> &[u8] { + &self.bytes()[self.info.call_data_args_range()] + } + + /// Return only the bytes of the address that signed this extrinsic. + /// + /// # Note + /// + /// Returns `None` if the extrinsic is not signed. + pub fn address_bytes(&self) -> Option<&[u8]> { + self.info + .signature_payload() + .map(|s| &self.bytes()[s.address_range()]) + } + + /// Returns Some(signature_bytes) if the extrinsic was signed otherwise None is returned. + pub fn signature_bytes(&self) -> Option<&[u8]> { + self.info + .signature_payload() + .map(|s| &self.bytes()[s.signature_range()]) + } + + /// Returns the signed extension `extra` bytes of the extrinsic. + /// Each signed extension has an `extra` type (May be zero-sized). + /// These bytes are the scale encoded `extra` fields of each signed extension in order of the signed extensions. + /// They do *not* include the `additional` signed bytes that are used as part of the payload that is signed. + /// + /// Note: Returns `None` if the extrinsic is not signed. + pub fn transaction_extensions_bytes(&self) -> Option<&[u8]> { + self.info + .transaction_extension_payload() + .map(|t| &self.bytes()[t.range()]) + } + + /// Returns `None` if the extrinsic is not signed. + pub fn transaction_extensions( + &self, + ) -> Option> { + let bytes = self.bytes(); + let metadata = self.metadata; + + self.info + .transaction_extension_payload() + .map(move |t| ExtrinsicTransactionExtensions::new(bytes, metadata, t)) + } + + /// Return true if this [`Extrinsic`] matches the provided type. + pub fn is(&self) -> bool { + E::is_extrinsic(self.pallet_name(), self.call_name()) + } + + /// Attempt to decode this [`Extrinsic`] into an outer call enum type (which includes + /// the pallet and extrinsic enum variants as well as the extrinsic fields). One compatible + /// type for this is exposed via static codegen as a root level `Call` type. + pub fn decode_call_data_as(&self) -> Result { + let decoded = E::decode_as_type( + &mut &self.call_data_bytes()[..], + self.metadata.outer_enums().call_enum_ty(), + self.metadata.types(), + ) + .map_err(|e| ExtrinsicError::CannotDecodeIntoRootExtrinsic { + extrinsic_index: self.index, + error: e, + })?; + + Ok(decoded) + } + + /// Decode the extrinsic call data fields into some type which implements [`DecodeAsExtrinsic`]. + /// + /// Extrinsic types generated via the [`macro@crate::subxt`] macro implement this. + pub fn decode_call_data_fields_as( + &self, + ) -> Option> { + if self.is::() { + Some(self.decode_call_data_fields_unchecked_as::()) + } else { + None + } + } + + /// Decode the extrinsic call data fields into some type which implements [`DecodeAsFields`]. + /// + /// This ignores the pallet and call name information, so you should check those via [`Self::pallet_name()`] + /// and [`Self::call_name()`] to confirm that this extrinsic is the one you are intending to decode. + /// + /// Prefer to use [`Self::decode_call_data_fields_as`] where possible. + pub fn decode_call_data_fields_unchecked_as( + &self, + ) -> Result { + let bytes = &mut self.call_data_field_bytes(); + let mut fields = self.info.call_data().map(|d| { + let name = if d.name().is_empty() { + None + } else { + Some(d.name()) + }; + scale_decode::Field::new(*d.ty(), name) + }); + let decoded = + E::decode_as_fields(bytes, &mut fields, self.metadata.types()).map_err(|e| { + ExtrinsicError::CannotDecodeFields { + extrinsic_index: self.index, + error: e, + } + })?; + + Ok(decoded) + } + + /// Iterate over each of the fields in the call data. + pub fn iter_call_data_fields( + &self, + ) -> impl Iterator> { + let ext_bytes = self.bytes(); + self.info.call_data().map(|field| ExtrinsicCallDataField { + bytes: &ext_bytes[field.range()], + name: field.name(), + type_id: *field.ty(), + metadata: self.metadata, + }) + } +} + +impl<'atblock, T, C> Extrinsic<'atblock, T, C> +where + T: Config, + C: OnlineClientAtBlockT, +{ + /// The events associated with the extrinsic. + pub async fn events(&self) -> Result, EventsError> { + ExtrinsicEvents::fetch(self.client, self.hash(), self.index()).await + } +} + +/// A field in the extrinsic call data. +pub struct ExtrinsicCallDataField<'atblock, 'extrinsic> { + bytes: &'extrinsic [u8], + name: &'extrinsic str, + type_id: u32, + metadata: &'atblock Metadata, +} + +impl<'atblock, 'extrinsic> ExtrinsicCallDataField<'atblock, 'extrinsic> { + /// The bytes for this field. + pub fn bytes(&self) -> &'extrinsic [u8] { + self.bytes + } + + /// Name of this field. + pub fn name(&self) -> &'extrinsic str { + self.name + } + + /// The type ID for this field. + pub fn type_id(&self) -> u32 { + self.type_id + } + + /// Decode this field into the given type. + pub fn decode_as(&self) -> Result { + E::decode_as_type(&mut &*self.bytes, self.type_id, self.metadata.types()) + } + + /// Visit this field with the provided visitor, returning the output from it. + pub fn visit(&self, visitor: V) -> Result, V::Error> + where + V: scale_decode::visitor::Visitor, + { + scale_decode::visitor::decode_with_visitor( + &mut &*self.bytes, + self.type_id, + self.metadata.types(), + visitor, + ) + } +} + +/// The events associated with a given extrinsic. +#[derive(Debug)] +pub struct ExtrinsicEvents { + // The hash of the extrinsic (handy to expose here because + // this type is returned from TxProgress things in the most + // basic flows, so it's the only place people can access it + // without complicating things for themselves). + extrinsic_hash: HashFor, + // The index of the extrinsic: + extrinsic_index: usize, + // All of the events in the block: + events: crate::events::Events, +} + +impl ExtrinsicEvents { + pub(crate) async fn fetch( + client: &impl OnlineClientAtBlockT, + extrinsic_hash: HashFor, + extrinsic_index: usize, + ) -> Result { + let events = crate::events::EventsClient::new(client).fetch().await?; + Ok(ExtrinsicEvents { + extrinsic_hash, + extrinsic_index, + events, + }) + } + + /// The index of the extrinsic that these events are produced from. + pub fn extrinsic_index(&self) -> usize { + self.extrinsic_index + } + + /// Return the hash of the extrinsic. + pub fn extrinsic_hash(&self) -> HashFor { + self.extrinsic_hash + } + + /// Return all of the events in the block that the extrinsic is in. + pub fn all_events_in_block(&self) -> &events::Events { + &self.events + } + + /// Iterate over all of the raw events associated with this extrinsic. + /// + /// This works in the same way that [`events::Events::iter()`] does, with the + /// exception that it filters out events not related to the current extrinsic. + pub fn iter(&'_ self) -> impl Iterator, EventsError>> { + self.events.iter().filter(|ev| { + ev.as_ref() + .map(|ev| ev.phase() == events::Phase::ApplyExtrinsic(self.extrinsic_index as u32)) + .unwrap_or(true) // Keep any errors. + }) + } + + /// Iterate through the extrinsic's events, Decoding and returning any that match the given type. + /// + /// This is a convenience function for calling [`Self::iter`] and then [`events::Event::decode_fields_as`] + /// on each event that we iterate over, filtering those that don't match. + pub fn find(&self) -> impl Iterator> { + self.iter() + .filter_map(|e| e.ok()) + .filter_map(|e| e.decode_fields_as::()) + } + + /// Find the first event matching the given type, returning `None` if it doesn't exist, + /// and the result of decoding it if it does. + pub fn find_first(&self) -> Option> { + self.find::().next() + } + + /// Find an event matching the given type, returning true if it exists. This function does _not_ + /// try to actually decode the event bytes into the given type. + pub fn has(&self) -> bool { + self.iter().filter_map(|e| e.ok()).any(|e| e.is::()) + } +} diff --git a/subxt/src/extrinsics/decode_as_extrinsic.rs b/subxt/src/extrinsics/decode_as_extrinsic.rs new file mode 100644 index 00000000000..02f98977642 --- /dev/null +++ b/subxt/src/extrinsics/decode_as_extrinsic.rs @@ -0,0 +1,9 @@ +use scale_decode::DecodeAsFields; + +/// This trait can be implemented for any type which implements [`DecodeAsFields`]. +/// This adds information to the type about which extrinsic it is, which enforces that +/// only the correct extrinsic can be decoded into it. +pub trait DecodeAsExtrinsic: DecodeAsFields { + /// Returns true if the given pallet and call names match this extrinsic. + fn is_extrinsic(pallet: &str, call: &str) -> bool; +} diff --git a/subxt/src/extrinsics/extrinsic_transaction_extensions.rs b/subxt/src/extrinsics/extrinsic_transaction_extensions.rs new file mode 100644 index 00000000000..169ec5d7312 --- /dev/null +++ b/subxt/src/extrinsics/extrinsic_transaction_extensions.rs @@ -0,0 +1,134 @@ +use crate::config::Config; +use crate::config::TransactionExtension; +use crate::config::transaction_extensions::{ + ChargeAssetTxPayment, ChargeTransactionPayment, CheckNonce, +}; +use crate::error::ExtrinsicError; +use frame_decode::extrinsics::ExtrinsicExtensions as ExtrinsicExtensionsInfo; +use scale_decode::DecodeAsType; +use subxt_metadata::Metadata; + +/// The signed extensions of an extrinsic. +#[derive(Debug, Clone)] +pub struct ExtrinsicTransactionExtensions<'atblock, 'extrinsic, T: Config> { + bytes: &'extrinsic [u8], + metadata: &'atblock Metadata, + decoded_info: &'extrinsic ExtrinsicExtensionsInfo<'atblock, u32>, + marker: core::marker::PhantomData, +} + +impl<'atblock, 'extrinsic, T: Config> ExtrinsicTransactionExtensions<'atblock, 'extrinsic, T> { + pub(crate) fn new( + bytes: &'extrinsic [u8], + metadata: &'atblock Metadata, + decoded_info: &'extrinsic ExtrinsicExtensionsInfo<'atblock, u32>, + ) -> Self { + Self { + bytes, + metadata, + decoded_info, + marker: core::marker::PhantomData, + } + } + + /// Returns an iterator over each of the signed extension details of the extrinsic. + pub fn iter( + &self, + ) -> impl Iterator> { + self.decoded_info + .iter() + .map(move |s| ExtrinsicTransactionExtension { + bytes: &self.bytes[s.range()], + ty_id: *s.ty(), + identifier: s.name(), + metadata: self.metadata, + _marker: core::marker::PhantomData, + }) + } + + /// Searches through all signed extensions to find a specific one. + /// If the Signed Extension is not found `Ok(None)` is returned. + /// If the Signed Extension is found but decoding failed `Err(_)` is returned. + pub fn find>(&self) -> Option> { + for ext in self.iter() { + if let Some(e) = ext.decode_as::() { + return Some(e); + } + } + None + } + + /// The tip of an extrinsic, extracted from the ChargeTransactionPayment or ChargeAssetTxPayment + /// signed extension, depending on which is present. + /// + /// Returns `None` if `tip` was not found or decoding failed. + pub fn tip(&self) -> Option { + // Note: the overhead of iterating multiple time should be negligible. + if let Some(tip) = self.find::() { + return Some(tip.ok()?.tip()); + } + if let Some(tip) = self.find::>() { + return Some(tip.ok()?.tip()); + } + None + } + + /// The nonce of the account that submitted the extrinsic, extracted from the CheckNonce signed extension. + /// + /// Returns `None` if `nonce` was not found or decoding failed. + pub fn nonce(&self) -> Option { + self.find::()?.ok() + } +} + +/// A single signed extension +#[derive(Debug, Clone)] +pub struct ExtrinsicTransactionExtension<'atblock, 'extrinsic, T: Config> { + bytes: &'extrinsic [u8], + ty_id: u32, + identifier: &'extrinsic str, + metadata: &'atblock Metadata, + _marker: core::marker::PhantomData, +} + +impl<'atblock, 'extrinsic, T: Config> ExtrinsicTransactionExtension<'atblock, 'extrinsic, T> { + /// The bytes representing this signed extension. + pub fn bytes(&self) -> &'extrinsic [u8] { + self.bytes + } + + /// The name of the signed extension. + pub fn name(&self) -> &'extrinsic str { + self.identifier + } + + /// The type id of the signed extension. + pub fn type_id(&self) -> u32 { + self.ty_id + } + + /// Decodes this signed extension based on the provided [`TransactionExtension`] type. + pub fn decode_as>( + &self, + ) -> Option> { + if !S::matches(self.identifier, self.ty_id, self.metadata.types()) { + return None; + } + Some(self.decode_unchecked_as::()) + } + + /// Decode the extension into some type which implements [`DecodeAsType`]. + /// + /// This ignores the extension name, so you should first check that this is what you expect + /// via [`Self::name()`]. + /// + /// Prefer to use [`Self::decode_as`] where possible. + pub fn decode_unchecked_as(&self) -> Result { + let value = E::decode_as_type(&mut &self.bytes[..], self.ty_id, self.metadata.types()) + .map_err(|e| ExtrinsicError::CouldNotDecodeTransactionExtension { + name: self.identifier.to_owned(), + error: e, + })?; + Ok(value) + } +} diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index 6434e16b4c3..0f0b9ba85a9 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -2,15 +2,24 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! Subxt is a library for interacting with Substrate based nodes. Using it looks something like this: +//! Subxt is a library for interacting with Substrate based nodes. Here's what it looks like: //! //! ```rust,ignore -#![doc = include_str!("../examples/tx_basic.rs")] +#![doc = include_str!("../examples/submit_transaction.rs")] //! ``` //! -//! Take a look at [the Subxt guide](book) to learn more about how to use Subxt. - -#![cfg_attr(docsrs, feature(doc_cfg))] +//! Take a look at +#![doc = concat!("[the examples](https://github.com/paritytech/subxt/tree/", env!("SUBXT_REF"), "/subxt/examples)")] +//! to get off to a quick start, or check out [the book](book) for a more in depth introduction to Subxt. +//! +//! In addition to the single-file examples above, we have a few self contained project examples to show off specific +//! use cases: +#![doc = concat!("- [The parachain example](https://github.com/paritytech/subxt/tree/", env!("SUBXT_REF"), "/examples/parachain-example)")] +//! is an example which uses Zombienet to spawn a parachain locally, and then connects to it using Subxt. +#![doc = concat!("- [The WASM example](https://github.com/paritytech/subxt/tree/", env!("SUBXT_REF"), "/examples/wasm-example)")] +//! is an example of writing a Rust web application which uses Subxt to interact with a chain entirely in the browser. +#![doc = concat!("- [The WASM example](https://github.com/paritytech/subxt/tree/", env!("SUBXT_REF"), "/examples/ffi-example)")] +//! shows off how Subxt can be called via FFI from Node.JS and Python. #[cfg(any( all(feature = "web", feature = "native"), @@ -18,93 +27,75 @@ ))] compile_error!("subxt: exactly one of the 'web' and 'native' features should be used."); -// Internal helper macros -#[macro_use] -mod macros; - -// The guide is here. -pub mod book; - -// Suppress an unused dependency warning because tokio is -// only used in example code snippets at the time of writing. -#[cfg(test)] -mod only_used_in_docs_or_tests { - use subxt_signer as _; - use tokio as _; -} +// TODO: Do we need this still? +// // Suppress an unused dependency warning because these are +// // only used in example code snippets at the time of writing. +// #[cfg(test)] +// mod only_used_in_docs_or_tests { +// use subxt_signer as _; +// use tokio as _; +// use tracing_subscriber as _; +// } -// Suppress an unused dependency warning because tracing_subscriber is -// only used in example code snippets at the time of writing. -#[cfg(test)] -use tracing_subscriber as _; +// This is exposed so that the code generated by subxt-codegen can avoid +// relying on std things. Given that it relies on subxt, it _must_ use std, +// but this may change if we move things back to a no-std core/common crate. +// that it can point at. +// +// Undocumented and **should not be depended on by anybody else**. +#[doc(hidden)] +pub extern crate alloc; pub mod backend; -pub mod blocks; +pub mod book; pub mod client; +pub mod config; pub mod constants; pub mod custom_values; +pub mod dynamic; pub mod error; pub mod events; -pub mod runtime_api; +pub mod extrinsics; +pub mod runtime_apis; pub mod storage; -pub mod tx; +pub mod transactions; pub mod utils; pub mod view_functions; -/// This module provides a [`Config`] type, which is used to define various -/// types that are important in order to speak to a particular chain. -/// [`SubstrateConfig`] provides a default set of these types suitable for the -/// default Substrate node implementation, and [`PolkadotConfig`] for a -/// Polkadot node. -pub mod config { - pub use subxt_core::config::{ - Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder, ExtrinsicParams, - ExtrinsicParamsEncoder, Hash, HashFor, Hasher, Header, PolkadotConfig, - PolkadotExtrinsicParams, SubstrateConfig, SubstrateExtrinsicParams, TransactionExtension, - polkadot, substrate, transaction_extensions, - }; - pub use subxt_core::error::ExtrinsicParamsError; -} +// Re-export the [`subxt_metadata`] crate. +pub use subxt_metadata as metadata; -/// Types representing the metadata obtained from a node. -pub mod metadata { - pub use subxt_metadata::*; -} - -/// Submit dynamic transactions. -pub mod dynamic { - pub use subxt_core::dynamic::*; -} - -// Expose light client bits -cfg_unstable_light_client! { - pub use subxt_lightclient as lightclient; -} +// A shorthand to match previous versions and the +// tx shorthand in other places. +pub use transactions as tx; // Expose a few of the most common types at root, // but leave most types behind their respective modules. pub use crate::{ - client::{OfflineClient, OnlineClient}, + client::{OfflineClient, OfflineClientAtBlock, OnlineClient, OnlineClientAtBlock}, config::{Config, PolkadotConfig, SubstrateConfig}, error::Error, - metadata::Metadata, + metadata::{ArcMetadata, Metadata}, }; +// Expose light client bits +#[cfg(feature = "light-client")] +pub use subxt_lightclient as lightclient; + /// Re-export external crates that are made use of in the subxt API. pub mod ext { pub use codec; + pub use frame_decode; pub use frame_metadata; - pub use futures; pub use scale_bits; pub use scale_decode; pub use scale_encode; + pub use scale_type_resolver; pub use scale_value; - pub use subxt_core; pub use subxt_rpcs; - cfg_jsonrpsee! { - pub use jsonrpsee; - } + #[cfg(feature = "jsonrpsee")] + pub use jsonrpsee; } /// Generate a strongly typed API for interacting with a Substrate runtime from its metadata of WASM. @@ -146,15 +137,6 @@ pub mod ext { /// mod polkadot {} /// ``` /// -/// You can use the `$OUT_DIR` placeholder in the path to reference metadata generated at build time: -/// -/// ```rust,ignore -/// #[subxt::subxt( -/// runtime_metadata_path = "$OUT_DIR/metadata.scale", -/// )] -/// mod polkadot {} -/// ``` -/// /// ## Using a WASM runtime via `runtime_path = "..."` /// /// This requires the `runtime-wasm-path` feature flag. @@ -168,15 +150,6 @@ pub mod ext { /// mod polkadot {} /// ``` /// -/// You can also use the `$OUT_DIR` placeholder in the path to reference WASM files generated at build time: -/// -/// ```rust,ignore -/// #[subxt::subxt( -/// runtime_path = "$OUT_DIR/runtime.wasm", -/// )] -/// mod polkadot {} -/// ``` -/// /// ## Connecting to a node to download metadata via `runtime_metadata_insecure_url = "..."` /// /// This will, at compile time, connect to the JSON-RPC interface for some node at the URL given, diff --git a/subxt/src/macros.rs b/subxt/src/macros.rs deleted file mode 100644 index 2620dd16085..00000000000 --- a/subxt/src/macros.rs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -macro_rules! cfg_feature { - ($feature:literal, $($item:item)*) => { - $( - #[cfg(feature = $feature)] - #[cfg_attr(docsrs, doc(cfg(feature = $feature)))] - $item - )* - } -} - -macro_rules! cfg_unstable_light_client { - ($($item:item)*) => { - crate::macros::cfg_feature!("unstable-light-client", $($item)*); - }; -} - -macro_rules! cfg_reconnecting_rpc_client { - ($($item:item)*) => { - crate::macros::cfg_feature!("reconnecting-rpc-client", $($item)*); - }; -} - -macro_rules! cfg_jsonrpsee { - ($($item:item)*) => { - crate::macros::cfg_feature!("jsonrpsee", $($item)*); - }; -} - -#[allow(unused)] -macro_rules! cfg_jsonrpsee_native { - ($($item:item)*) => { - $( - #[cfg(all(feature = "jsonrpsee", feature = "native"))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "jsonrpsee", feature = "native"))))] - $item - )* - } -} - -#[allow(unused)] -macro_rules! cfg_jsonrpsee_web { - ($($item:item)*) => { - $( - #[cfg(all(feature = "jsonrpsee", feature = "web"))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "jsonrpsee", feature = "web"))))] - $item - )* - } -} - -pub(crate) use {cfg_feature, cfg_jsonrpsee, cfg_unstable_light_client}; - -// Only used by light-client. -#[allow(unused)] -pub(crate) use {cfg_jsonrpsee_native, cfg_jsonrpsee_web, cfg_reconnecting_rpc_client}; diff --git a/subxt/src/runtime_api/mod.rs b/subxt/src/runtime_api/mod.rs deleted file mode 100644 index f6dafb31cba..00000000000 --- a/subxt/src/runtime_api/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Types associated with executing runtime API calls. - -mod runtime_client; -mod runtime_types; - -pub use runtime_client::RuntimeApiClient; -pub use runtime_types::RuntimeApi; -pub use subxt_core::runtime_api::payload::{DynamicPayload, Payload, StaticPayload, dynamic}; diff --git a/subxt/src/runtime_api/runtime_client.rs b/subxt/src/runtime_api/runtime_client.rs deleted file mode 100644 index 6412468be76..00000000000 --- a/subxt/src/runtime_api/runtime_client.rs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use super::runtime_types::RuntimeApi; - -use crate::{ - backend::BlockRef, - client::OnlineClientT, - config::{Config, HashFor}, - error::RuntimeApiError, -}; -use derive_where::derive_where; -use std::{future::Future, marker::PhantomData}; - -/// Execute runtime API calls. -#[derive_where(Clone; Client)] -pub struct RuntimeApiClient { - client: Client, - _marker: PhantomData, -} - -impl RuntimeApiClient { - /// Create a new [`RuntimeApiClient`] - pub fn new(client: Client) -> Self { - Self { - client, - _marker: PhantomData, - } - } -} - -impl RuntimeApiClient -where - T: Config, - Client: OnlineClientT, -{ - /// Obtain a runtime API interface at some block hash. - pub fn at(&self, block_ref: impl Into>>) -> RuntimeApi { - RuntimeApi::new(self.client.clone(), block_ref.into()) - } - - /// Obtain a runtime API interface at the latest finalized block. - pub fn at_latest( - &self, - ) -> impl Future, RuntimeApiError>> + Send + 'static { - // Clone and pass the client in like this so that we can explicitly - // return a Future that's Send + 'static, rather than tied to &self. - let client = self.client.clone(); - async move { - // get the ref for the latest finalized block and use that. - let block_ref = client - .backend() - .latest_finalized_block_ref() - .await - .map_err(RuntimeApiError::CannotGetLatestFinalizedBlock)?; - - Ok(RuntimeApi::new(client, block_ref)) - } - } -} diff --git a/subxt/src/runtime_api/runtime_types.rs b/subxt/src/runtime_api/runtime_types.rs deleted file mode 100644 index 6b0ee009358..00000000000 --- a/subxt/src/runtime_api/runtime_types.rs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use super::Payload; -use crate::{ - backend::BlockRef, - client::OnlineClientT, - config::{Config, HashFor}, - error::RuntimeApiError, -}; -use derive_where::derive_where; -use std::{future::Future, marker::PhantomData}; - -/// Execute runtime API calls. -#[derive_where(Clone; Client)] -pub struct RuntimeApi { - client: Client, - block_ref: BlockRef>, - _marker: PhantomData, -} - -impl RuntimeApi { - /// Create a new [`RuntimeApi`] - pub(crate) fn new(client: Client, block_ref: BlockRef>) -> Self { - Self { - client, - block_ref, - _marker: PhantomData, - } - } -} - -impl RuntimeApi -where - T: Config, - Client: OnlineClientT, -{ - /// Run the validation logic against some runtime API payload you'd like to use. Returns `Ok(())` - /// if the payload is valid (or if it's not possible to check since the payload has no validation hash). - /// Return an error if the payload was not valid or something went wrong trying to validate it (ie - /// the runtime API in question do not exist at all) - pub fn validate(&self, payload: Call) -> Result<(), RuntimeApiError> { - subxt_core::runtime_api::validate(payload, &self.client.metadata()).map_err(Into::into) - } - - /// Execute a raw runtime API call. This returns the raw bytes representing the result - /// of this call. The caller is responsible for decoding the result. - pub fn call_raw<'a>( - &self, - function: &'a str, - call_parameters: Option<&'a [u8]>, - ) -> impl Future, RuntimeApiError>> + use<'a, Client, T> { - let client = self.client.clone(); - let block_hash = self.block_ref.hash(); - // Ensure that the returned future doesn't have a lifetime tied to api.runtime_api(), - // which is a temporary thing we'll be throwing away quickly: - async move { - let data = client - .backend() - .call(function, call_parameters, block_hash) - .await - .map_err(RuntimeApiError::CannotCallApi)?; - Ok(data) - } - } - - /// Execute a runtime API call. - pub fn call( - &self, - payload: Call, - ) -> impl Future> + use - { - let client = self.client.clone(); - let block_hash = self.block_ref.hash(); - // Ensure that the returned future doesn't have a lifetime tied to api.runtime_api(), - // which is a temporary thing we'll be throwing away quickly: - async move { - let metadata = client.metadata(); - - // Validate the runtime API payload hash against the compile hash from codegen. - subxt_core::runtime_api::validate(&payload, &metadata)?; - - // Encode the arguments of the runtime call. - let call_name = subxt_core::runtime_api::call_name(&payload); - let call_args = subxt_core::runtime_api::call_args(&payload, &metadata)?; - - // Make the call. - let bytes = client - .backend() - .call(&call_name, Some(call_args.as_slice()), block_hash) - .await - .map_err(RuntimeApiError::CannotCallApi)?; - - // Decode the response. - let value = subxt_core::runtime_api::decode_value(&mut &*bytes, &payload, &metadata)?; - Ok(value) - } - } -} diff --git a/subxt/src/runtime_apis.rs b/subxt/src/runtime_apis.rs new file mode 100644 index 00000000000..a9442cad4ab --- /dev/null +++ b/subxt/src/runtime_apis.rs @@ -0,0 +1,158 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! This module exposes [`RuntimeApisClient`], which has methods for calling Runtime APIs. +//! It's created by calling [`crate::client::ClientAtBlock::runtime_apis()`]. +//! +//! ```rust,no_run +//! pub use subxt::{OnlineClient, PolkadotConfig}; +//! +//! let client = OnlineClient::new().await?; +//! let at_block = client.at_current_block().await?; +//! +//! let runtime_apis = at_block.runtime_apis(); +//! ``` + +mod payload; + +use crate::client::{OfflineClientAtBlockT, OnlineClientAtBlockT}; +use crate::config::Config; +use crate::error::RuntimeApiError; +use derive_where::derive_where; +use scale_decode::IntoVisitor; +use std::marker::PhantomData; + +pub use payload::{DynamicPayload, Payload, StaticPayload, dynamic}; + +/// A client for working with Runtime APIs. See [the module docs](crate::runtime_apis) for more. +#[derive_where(Clone; Client)] +pub struct RuntimeApisClient<'atblock, T: Config, Client> { + client: &'atblock Client, + marker: PhantomData, +} + +impl<'atblock, T: Config, Client> RuntimeApisClient<'atblock, T, Client> { + /// Create a new [`RuntimeApi`] + pub(crate) fn new(client: &'atblock Client) -> Self { + Self { + client, + marker: PhantomData, + } + } +} + +impl<'atblock, T, Client> RuntimeApisClient<'atblock, T, Client> +where + T: Config, + Client: OfflineClientAtBlockT, +{ + /// Run the validation logic against some runtime API payload you'd like to use. Returns `Ok(())` + /// if the payload is valid (or if it's not possible to check since the payload has no validation hash). + /// Return an error if the payload was not valid or something went wrong trying to validate it (ie + /// the runtime API in question do not exist at all) + pub fn validate(&self, payload: P) -> Result<(), RuntimeApiError> { + let Some(hash) = payload.validation_hash() else { + return Ok(()); + }; + + let metadata = self.client.metadata_ref(); + let trait_name = payload.trait_name(); + let method_name = payload.method_name(); + + let api_trait = metadata + .runtime_api_trait_by_name(trait_name) + .ok_or_else(|| RuntimeApiError::TraitNotFound(trait_name.to_string()))?; + let api_method = api_trait.method_by_name(method_name).ok_or_else(|| { + RuntimeApiError::MethodNotFound { + trait_name: trait_name.to_string(), + method_name: method_name.to_string(), + } + })?; + + if hash != api_method.hash() { + Err(RuntimeApiError::IncompatibleCodegen) + } else { + Ok(()) + } + } + + /// Return the name of the runtime API call from the payload. + pub fn encode_name(&self, payload: P) -> String { + format!("{}_{}", payload.trait_name(), payload.method_name()) + } + + /// Return the encoded call args from a runtime API payload. + pub fn encode_args(&self, payload: P) -> Result, RuntimeApiError> { + let metadata = self.client.metadata_ref(); + let value = frame_decode::runtime_apis::encode_runtime_api_inputs( + payload.trait_name(), + payload.method_name(), + payload.args(), + metadata, + metadata.types(), + ) + .map_err(RuntimeApiError::CouldNotEncodeInputs)?; + + Ok(value) + } +} + +impl<'atblock, T, Client> RuntimeApisClient<'atblock, T, Client> +where + T: Config, + Client: OnlineClientAtBlockT, +{ + /// Execute a raw runtime API call. This returns the raw bytes representing the result + /// of this call. The caller is responsible for decoding the result. + pub async fn call_raw<'a>( + &self, + function: &'a str, + call_parameters: Option<&'a [u8]>, + ) -> Result, RuntimeApiError> { + let client = &self.client; + let block_hash = client.block_hash(); + let data = client + .backend() + .call(function, call_parameters, block_hash) + .await + .map_err(RuntimeApiError::CannotCallApi)?; + + Ok(data) + } + + /// Execute a runtime API call. + pub async fn call(&self, payload: P) -> Result { + let client = &self.client; + let block_hash = client.block_hash(); + let metadata = client.metadata_ref(); + + // Validate the runtime API payload hash against the compile hash from codegen. + self.validate(&payload)?; + + // Encode the arguments of the runtime call. + let call_name = self.encode_name(&payload); + let call_args = self.encode_args(&payload)?; + + // Make the call. + let bytes = client + .backend() + .call(&call_name, Some(call_args.as_slice()), block_hash) + .await + .map_err(RuntimeApiError::CannotCallApi)?; + + // Decode the response. + let cursor = &mut &*bytes; + let value = frame_decode::runtime_apis::decode_runtime_api_response( + payload.trait_name(), + payload.method_name(), + cursor, + metadata, + metadata.types(), + P::ReturnType::into_visitor(), + ) + .map_err(RuntimeApiError::CouldNotDecodeResponse)?; + + Ok(value) + } +} diff --git a/core/src/runtime_api/payload.rs b/subxt/src/runtime_apis/payload.rs similarity index 98% rename from core/src/runtime_api/payload.rs rename to subxt/src/runtime_apis/payload.rs index 6a64fa5f807..c62da4225bb 100644 --- a/core/src/runtime_api/payload.rs +++ b/subxt/src/runtime_apis/payload.rs @@ -5,12 +5,11 @@ //! This module contains the trait and types used to represent //! runtime API calls that can be made. -use alloc::borrow::Cow; -use alloc::string::String; use core::marker::PhantomData; use derive_where::derive_where; use frame_decode::runtime_apis::IntoEncodableValues; use scale_decode::DecodeAsType; +use std::borrow::Cow; /// This represents a runtime API payload that can be used to call a Runtime API on /// a chain and decode the response. diff --git a/subxt/src/storage.rs b/subxt/src/storage.rs new file mode 100644 index 00000000000..f0b5fbbf31b --- /dev/null +++ b/subxt/src/storage.rs @@ -0,0 +1,217 @@ +//! This module exposes [`StorageClient`], which has methods for fetching and iterating over +//! storage entries. It's created by calling [`crate::client::ClientAtBlock::storage()`]. +//! +//! ```rust,no_run +//! pub use subxt::{OnlineClient, PolkadotConfig}; +//! +//! let client = OnlineClient::new().await?; +//! let at_block = client.at_current_block().await?; +//! +//! let storage = at_block.storage(); +//! ``` + +mod address; +mod prefix_of; +mod storage_entry; +mod storage_key; +mod storage_key_value; +mod storage_value; + +use crate::backend::BackendExt; +use crate::client::{OfflineClientAtBlockT, OnlineClientAtBlockT}; +use crate::config::Config; +use crate::error::StorageError; +use core::marker::PhantomData; +use frame_decode::helpers::Entry; +use frame_decode::storage::StorageEntryInfo; +use std::borrow::Cow; + +pub use address::{Address, DynamicAddress, StaticAddress, dynamic}; +pub use prefix_of::PrefixOf; +pub use storage_entry::StorageEntry; +pub use storage_key::{StorageKey, StorageKeyPart}; +pub use storage_key_value::StorageKeyValue; +pub use storage_value::StorageValue; + +/// A client for working with storage entries. See [the module docs](crate::storage) for more. +#[derive(Clone)] +pub struct StorageClient<'atblock, T, Client> { + client: &'atblock Client, + marker: PhantomData, +} + +impl<'atblock, T, Client> StorageClient<'atblock, T, Client> { + pub(crate) fn new(client: &'atblock Client) -> Self { + StorageClient { + client, + marker: PhantomData, + } + } +} + +impl<'atblock, T: Config, Client: OfflineClientAtBlockT> StorageClient<'atblock, T, Client> { + /// When the provided `address` is statically generated via the `#[subxt]` macro, this validates + /// that the shape of the storage value is the same as the shape expected by the static address. + /// + /// When the provided `address` is dynamic (and thus does not come with any expectation of the + /// shape of the constant value), this just returns `Ok(())` + pub fn validate(&self, address: Addr) -> Result<(), StorageError> { + let Some(hash) = address.validation_hash() else { + return Ok(()); + }; + + let pallet_name = address.pallet_name(); + let entry_name = address.entry_name(); + + let pallet_metadata = self + .client + .metadata_ref() + .pallet_by_name(pallet_name) + .ok_or_else(|| StorageError::PalletNameNotFound(pallet_name.to_string()))?; + let storage_hash = pallet_metadata.storage_hash(entry_name).ok_or_else(|| { + StorageError::StorageEntryNotFound { + pallet_name: pallet_name.to_string(), + entry_name: entry_name.to_string(), + } + })?; + + if storage_hash != hash { + Err(StorageError::IncompatibleCodegen) + } else { + Ok(()) + } + } + + /// This returns a [`StorageEntry`], which allows working with the storage entry at the provided address. + pub fn entry( + &self, + address: Addr, + ) -> Result, StorageError> { + self.validate(&address)?; + StorageEntry::new(self.client, address) + } + + /// Iterate over all of the storage entries listed in the metadata for the current block. This does **not** include well known + /// storage entries like `:code` which are not listed in the metadata. + pub fn entries(&self) -> impl Iterator> { + let metadata = self.client.metadata_ref(); + Entry::tuples_of(metadata.storage_entries()).map(|(pallet_name, entry_name)| { + StorageEntryRef { + pallet_name: pallet_name.clone(), + entry_name, + client: self.client, + marker: std::marker::PhantomData, + } + }) + } +} + +impl<'atblock, T: Config, Client: OnlineClientAtBlockT> StorageClient<'atblock, T, Client> { + /// This is essentially a shorthand for `client.entry(addr)?.fetch(key_parts)`. See [`StorageEntry::fetch()`]. + pub async fn fetch( + &self, + addr: Addr, + key_parts: Addr::KeyParts, + ) -> Result, StorageError> { + let entry = self.entry(addr)?; + entry.fetch(key_parts).await + } + + /// This is essentially a shorthand for `client.entry(addr)?.try_fetch(key_parts)`. See [`StorageEntry::try_fetch()`]. + pub async fn try_fetch( + &self, + addr: Addr, + key_parts: Addr::KeyParts, + ) -> Result>, StorageError> { + let entry = self.entry(addr)?; + entry.try_fetch(key_parts).await + } + + /// This is essentially a shorthand for `client.entry(addr)?.iter(key_parts)`. See [`StorageEntry::iter()`]. + pub async fn iter>( + &self, + addr: Addr, + key_parts: KeyParts, + ) -> Result< + impl futures::Stream, StorageError>> + + use<'_, Addr, Client, T, KeyParts>, + StorageError, + > { + let entry = self.entry(addr)?; + entry.iter(key_parts).await + } + + /// In rare cases, you may wish to fetch a storage value that does not live at a typical address. This method + /// is a fallback for those cases, and allows you to provide the raw storage key bytes corresponding to the + /// entry you wish to obtain. The response will either be the bytes for the value found at that location, or + /// otherwise an error. [`StorageError::NoValueFound`] will be returned in the event that the request was valid + /// but no value lives at the given location). + pub async fn fetch_raw(&self, key_bytes: Vec) -> Result, StorageError> { + let block_hash = self.client.block_hash(); + let value = self + .client + .backend() + .storage_fetch_value(key_bytes, block_hash) + .await + .map_err(StorageError::CannotFetchValue)? + .ok_or(StorageError::NoValueFound)?; + + Ok(value) + } + + /// The storage version of a pallet. + /// The storage version refers to the `frame_support::traits::Metadata::StorageVersion` type. + pub async fn storage_version(&self, pallet_name: impl AsRef) -> Result { + // construct the storage key. This is done similarly in + // `frame_support::traits::metadata::StorageVersion::storage_key()`: + let key_bytes = frame_decode::storage::encode_storage_key_prefix( + pallet_name.as_ref(), + ":__STORAGE_VERSION__:", + ) + .to_vec(); + + // fetch the raw bytes and decode them into the StorageVersion struct: + let storage_version_bytes = self.fetch_raw(key_bytes).await?; + + ::decode(&mut &storage_version_bytes[..]) + .map_err(StorageError::CannotDecodeStorageVersion) + } + + /// Fetch the runtime WASM code. + pub async fn runtime_wasm_code(&self) -> Result, StorageError> { + // note: this should match the `CODE` constant in `sp_core::storage::well_known_keys` + self.fetch_raw(b":code".to_vec()).await + } +} + +/// Working with a specific storage entry. +pub struct StorageEntryRef<'atblock, T, Client> { + pallet_name: Cow<'atblock, str>, + entry_name: Cow<'atblock, str>, + client: &'atblock Client, + marker: std::marker::PhantomData, +} + +impl<'atblock, Client, T> StorageEntryRef<'atblock, T, Client> +where + T: Config, + Client: OfflineClientAtBlockT, +{ + /// The pallet name. + pub fn pallet_name(&self) -> &str { + &self.pallet_name + } + + /// The storage entry name. + pub fn entry_name(&self) -> &str { + &self.entry_name + } + + /// Extract the relevant storage information so that we can work with this entry. + pub fn entry( + &self, + ) -> Result, StorageError> { + let addr = address::dynamic(&*self.pallet_name, &*self.entry_name); + StorageEntry::new(self.client, addr) + } +} diff --git a/core/src/storage/address.rs b/subxt/src/storage/address.rs similarity index 97% rename from core/src/storage/address.rs rename to subxt/src/storage/address.rs index fe91d8321f6..bd6ee0c3f5a 100644 --- a/core/src/storage/address.rs +++ b/subxt/src/storage/address.rs @@ -5,11 +5,9 @@ //! Construct addresses to access storage entries with. use crate::utils::{Maybe, YesMaybe}; -use alloc::borrow::Cow; -use alloc::string::String; -use alloc::vec::Vec; use frame_decode::storage::{IntoDecodableValues, IntoEncodableValues}; use scale_decode::DecodeAsType; +use std::borrow::Cow; /// A storage address. This allows access to a given storage entry, which can then /// be iterated over or fetched from by providing the relevant set of keys, or @@ -17,7 +15,7 @@ use scale_decode::DecodeAsType; pub trait Address { /// All of the keys required to get to an individual value at this address. /// Keys must always impl [`IntoEncodableValues`], and for iteration must - /// also impl [`frame_decode::storage::IntoDecodableValues`]. + /// also impl [`IntoDecodableValues`]. type KeyParts: IntoEncodableValues + IntoDecodableValues; /// Type of the storage value at this location. type Value: DecodeAsType; diff --git a/subxt/src/storage/mod.rs b/subxt/src/storage/mod.rs deleted file mode 100644 index c62718d7099..00000000000 --- a/subxt/src/storage/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Types associated with accessing and working with storage items. - -mod storage_client; -mod storage_client_at; - -pub use storage_client::StorageClient; -pub use storage_client_at::{StorageClientAt, StorageEntryClient, StorageKeyValue, StorageValue}; -pub use subxt_core::storage::address::{Address, DynamicAddress, StaticAddress, dynamic}; diff --git a/core/src/storage/prefix_of.rs b/subxt/src/storage/prefix_of.rs similarity index 61% rename from core/src/storage/prefix_of.rs rename to subxt/src/storage/prefix_of.rs index 170eb6f784b..e6f30abecf5 100644 --- a/core/src/storage/prefix_of.rs +++ b/subxt/src/storage/prefix_of.rs @@ -2,7 +2,6 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use alloc::vec::Vec; use frame_decode::helpers::IntoEncodableValues; use scale_encode::EncodeAsType; @@ -77,46 +76,6 @@ array_impl!(4: 3 2 1 0); array_impl!(5: 4 3 2 1 0); array_impl!(6: 5 4 3 2 1 0); -/// This is much like [`PrefixOf`] except that it also includes `Self` as an allowed type, -/// where `Self` must impl [`IntoEncodableValues`] just as every [`PrefixOf`] does. -pub trait EqualOrPrefixOf: IntoEncodableValues {} - -// Tuples -macro_rules! tuple_impl_eq { - ($($t:ident)+) => { - // Any T that is a PrefixOf impls EqualOrPrefixOf too - impl <$($t,)+ T: PrefixOf<($($t,)+)>> EqualOrPrefixOf<($($t,)+)> for T {} - // Keys impls EqualOrPrefixOf - impl <$($t),+> EqualOrPrefixOf<($($t,)+)> for ($($t,)+) where ($($t,)+): IntoEncodableValues {} - // &'a Keys impls EqualOrPrefixOf - impl <'a, $($t),+> EqualOrPrefixOf<($($t,)+)> for &'a ($($t,)+) where ($($t,)+): IntoEncodableValues {} - } -} - -tuple_impl_eq!(A); -tuple_impl_eq!(A B); -tuple_impl_eq!(A B C); -tuple_impl_eq!(A B C D); -tuple_impl_eq!(A B C D E); -tuple_impl_eq!(A B C D E F); - -// Vec -impl EqualOrPrefixOf> for Vec {} -impl EqualOrPrefixOf> for &Vec {} - -// Arrays -macro_rules! array_impl_eq { - ($($n:literal)+) => { - $( - impl EqualOrPrefixOf<[A; $n]> for [A; $n] {} - impl <'a, A: EncodeAsType> EqualOrPrefixOf<[A; $n]> for &'a [A; $n] {} - )+ - } -} - -impl EqualOrPrefixOf<[A; N]> for T where T: PrefixOf<[A; N]> {} -array_impl_eq!(1 2 3 4 5 6); - #[cfg(test)] mod test { use super::*; @@ -130,9 +89,6 @@ mod test { fn accepts_prefix_of>(&self, keys: P) { let _encoder = keys.into_encodable_values(); } - fn accepts_eq_or_prefix_of>(&self, keys: P) { - let _encoder = keys.into_encodable_values(); - } } #[test] @@ -159,37 +115,4 @@ mod test { t.accepts_prefix_of([0]); t.accepts_prefix_of([]); } - - #[test] - fn test_eq_or_prefix_of() { - // In real life we'd have a struct a bit like this: - let t = Test::<(bool, String, u64)>::new(); - - // And we'd want to be able to call some method like this: - t.accepts_eq_or_prefix_of(&(true, String::from("hi"), 0)); - t.accepts_eq_or_prefix_of(&(true, String::from("hi"))); - t.accepts_eq_or_prefix_of((true,)); - t.accepts_eq_or_prefix_of(()); - - t.accepts_eq_or_prefix_of((true, String::from("hi"), 0)); - t.accepts_eq_or_prefix_of((true, String::from("hi"))); - t.accepts_eq_or_prefix_of((true,)); - t.accepts_eq_or_prefix_of(()); - - let t = Test::<[u64; 5]>::new(); - - t.accepts_eq_or_prefix_of([0, 1, 2, 3, 4]); - t.accepts_eq_or_prefix_of([0, 1, 2, 3]); - t.accepts_eq_or_prefix_of([0, 1, 2]); - t.accepts_eq_or_prefix_of([0, 1]); - t.accepts_eq_or_prefix_of([0]); - t.accepts_eq_or_prefix_of([]); - - t.accepts_eq_or_prefix_of([0, 1, 2, 3, 4]); - t.accepts_eq_or_prefix_of([0, 1, 2, 3]); - t.accepts_eq_or_prefix_of([0, 1, 2]); - t.accepts_eq_or_prefix_of([0, 1]); - t.accepts_eq_or_prefix_of([0]); - t.accepts_eq_or_prefix_of([]); - } } diff --git a/subxt/src/storage/storage_client.rs b/subxt/src/storage/storage_client.rs deleted file mode 100644 index ca6fcffa57a..00000000000 --- a/subxt/src/storage/storage_client.rs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use super::storage_client_at::StorageClientAt; -use crate::{ - backend::BlockRef, - client::{OfflineClientT, OnlineClientT}, - config::{Config, HashFor}, - error::StorageError, -}; -use derive_where::derive_where; -use std::{future::Future, marker::PhantomData}; -use subxt_core::storage::address::Address; - -/// Query the runtime storage. -#[derive_where(Clone; Client)] -pub struct StorageClient { - client: Client, - _marker: PhantomData, -} - -impl StorageClient { - /// Create a new [`StorageClient`] - pub fn new(client: Client) -> Self { - Self { - client, - _marker: PhantomData, - } - } -} - -impl StorageClient -where - T: Config, - Client: OfflineClientT, -{ - /// Run the validation logic against some storage address you'd like to access. Returns `Ok(())` - /// if the address is valid (or if it's not possible to check since the address has no validation hash). - /// Return an error if the address was not valid or something went wrong trying to validate it (ie - /// the pallet or storage entry in question do not exist at all). - pub fn validate(&self, address: &Addr) -> Result<(), StorageError> { - subxt_core::storage::validate(address, &self.client.metadata()).map_err(Into::into) - } -} - -impl StorageClient -where - T: Config, - Client: OnlineClientT, -{ - /// Obtain storage at some block hash. - pub fn at(&self, block_ref: impl Into>>) -> StorageClientAt { - StorageClientAt::new(self.client.clone(), block_ref.into()) - } - - /// Obtain storage at the latest finalized block. - pub fn at_latest( - &self, - ) -> impl Future, StorageError>> + Send + 'static - { - // Clone and pass the client in like this so that we can explicitly - // return a Future that's Send + 'static, rather than tied to &self. - let client = self.client.clone(); - async move { - // get the ref for the latest finalized block and use that. - let block_ref = client - .backend() - .latest_finalized_block_ref() - .await - .map_err(StorageError::CannotGetLatestFinalizedBlock)?; - - Ok(StorageClientAt::new(client, block_ref)) - } - } -} diff --git a/subxt/src/storage/storage_client_at.rs b/subxt/src/storage/storage_client_at.rs deleted file mode 100644 index 605c8e38d55..00000000000 --- a/subxt/src/storage/storage_client_at.rs +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::{ - backend::{BackendExt, BlockRef}, - client::{OfflineClientT, OnlineClientT}, - config::{Config, HashFor}, - error::StorageError, -}; -use derive_where::derive_where; -use futures::StreamExt; -use std::marker::PhantomData; -use subxt_core::Metadata; -use subxt_core::storage::{PrefixOf, address::Address}; -use subxt_core::utils::{Maybe, Yes}; - -pub use subxt_core::storage::{StorageKeyValue, StorageValue}; - -/// Query the runtime storage. -#[derive_where(Clone; Client)] -pub struct StorageClientAt { - client: Client, - metadata: Metadata, - block_ref: BlockRef>, - _marker: PhantomData, -} - -impl StorageClientAt -where - T: Config, - Client: OfflineClientT, -{ - /// Create a new [`StorageClientAt`]. - pub(crate) fn new(client: Client, block_ref: BlockRef>) -> Self { - // Retrieve and store metadata here so that we can borrow it in - // subsequent structs, and thus also borrow storage info and - // things that borrow from metadata. - let metadata = client.metadata(); - - Self { - client, - metadata, - block_ref, - _marker: PhantomData, - } - } -} - -impl StorageClientAt -where - T: Config, - Client: OfflineClientT, -{ - /// This returns a [`StorageEntryClient`], which allows working with the storage entry at the provided address. - pub fn entry( - &self, - address: Addr, - ) -> Result, StorageError> { - let inner = subxt_core::storage::entry(address, &self.metadata)?; - Ok(StorageEntryClient { - inner, - client: self.client.clone(), - block_ref: self.block_ref.clone(), - _marker: core::marker::PhantomData, - }) - } -} - -impl StorageClientAt -where - T: Config, - Client: OnlineClientT, -{ - /// This is essentially a shorthand for `client.entry(addr)?.fetch(key_parts)`. See [`StorageEntryClient::fetch()`]. - pub async fn fetch( - &self, - addr: Addr, - key_parts: Addr::KeyParts, - ) -> Result, StorageError> { - let entry = subxt_core::storage::entry(addr, &self.metadata)?; - fetch(&entry, &self.client, self.block_ref.hash(), key_parts).await - } - - /// This is essentially a shorthand for `client.entry(addr)?.try_fetch(key_parts)`. See [`StorageEntryClient::try_fetch()`]. - pub async fn try_fetch( - &self, - addr: Addr, - key_parts: Addr::KeyParts, - ) -> Result>, StorageError> { - let entry = subxt_core::storage::entry(addr, &self.metadata)?; - try_fetch(&entry, &self.client, self.block_ref.hash(), key_parts).await - } - - /// This is essentially a shorthand for `client.entry(addr)?.iter(key_parts)`. See [`StorageEntryClient::iter()`]. - pub async fn iter>( - &'_ self, - addr: Addr, - key_parts: KeyParts, - ) -> Result< - impl futures::Stream, StorageError>> - + use<'_, Addr, Client, T, KeyParts>, - StorageError, - > { - let entry = subxt_core::storage::entry(addr, &self.metadata)?; - iter(entry, &self.client, self.block_ref.hash(), key_parts).await - } - - /// In rare cases, you may wish to fetch a storage value that does not live at a typical address. This method - /// is a fallback for those cases, and allows you to provide the raw storage key bytes corresponding to the - /// entry you wish to obtain. The response will either be the bytes for the value found at that location, or - /// otherwise an error. [`StorageError::NoValueFound`] will be returned in the event that the request was valid - /// but no value lives at the given location). - pub async fn fetch_raw(&self, key_bytes: Vec) -> Result, StorageError> { - let block_hash = self.block_ref.hash(); - let value = self - .client - .backend() - .storage_fetch_value(key_bytes, block_hash) - .await - .map_err(StorageError::CannotFetchValue)? - .ok_or(StorageError::NoValueFound)?; - - Ok(value) - } - - /// The storage version of a pallet. - /// The storage version refers to the `frame_support::traits::Metadata::StorageVersion` type. - pub async fn storage_version(&self, pallet_name: impl AsRef) -> Result { - // construct the storage key. This is done similarly in - // `frame_support::traits::metadata::StorageVersion::storage_key()`: - let mut key_bytes: Vec = vec![]; - key_bytes.extend(&sp_crypto_hashing::twox_128( - pallet_name.as_ref().as_bytes(), - )); - key_bytes.extend(&sp_crypto_hashing::twox_128(b":__STORAGE_VERSION__:")); - - // fetch the raw bytes and decode them into the StorageVersion struct: - let storage_version_bytes = self.fetch_raw(key_bytes).await?; - - ::decode(&mut &storage_version_bytes[..]) - .map_err(StorageError::CannotDecodeStorageVersion) - } - - /// Fetch the runtime WASM code. - pub async fn runtime_wasm_code(&self) -> Result, StorageError> { - // note: this should match the `CODE` constant in `sp_core::storage::well_known_keys` - self.fetch_raw(b":code".to_vec()).await - } -} - -/// This represents a single storage entry (be it a plain value or map) -/// and the operations that can be performed on it. -pub struct StorageEntryClient<'atblock, T: Config, Client, Addr, IsPlain> { - inner: subxt_core::storage::StorageEntry<'atblock, Addr>, - client: Client, - block_ref: BlockRef>, - _marker: PhantomData<(T, IsPlain)>, -} - -impl<'atblock, T, Client, Addr, IsPlain> StorageEntryClient<'atblock, T, Client, Addr, IsPlain> -where - T: Config, - Addr: Address, -{ - /// Name of the pallet containing this storage entry. - pub fn pallet_name(&self) -> &str { - self.inner.pallet_name() - } - - /// Name of the storage entry. - pub fn entry_name(&self) -> &str { - self.inner.entry_name() - } - - /// Is the storage entry a plain value? - pub fn is_plain(&self) -> bool { - self.inner.is_plain() - } - - /// Is the storage entry a map? - pub fn is_map(&self) -> bool { - self.inner.is_map() - } - - /// Return the default value for this storage entry, if there is one. Returns `None` if there - /// is no default value. - pub fn default_value(&self) -> Option> { - self.inner.default_value() - } -} - -// Plain values get a fetch method with no extra arguments. -impl<'atblock, T, Client, Addr> StorageEntryClient<'atblock, T, Client, Addr, Yes> -where - T: Config, - Addr: Address, - Client: OnlineClientT, -{ - /// Fetch the storage value at this location. If no value is found, the default value will be returned - /// for this entry if one exists. If no value is found and no default value exists, an error will be returned. - pub async fn fetch(&self) -> Result, StorageError> { - let value = self.try_fetch().await?.map_or_else( - || self.inner.default_value().ok_or(StorageError::NoValueFound), - Ok, - )?; - - Ok(value) - } - - /// Fetch the storage value at this location. If no value is found, `None` will be returned. - pub async fn try_fetch( - &self, - ) -> Result>, StorageError> { - let value = self - .client - .backend() - .storage_fetch_value(self.key_prefix().to_vec(), self.block_ref.hash()) - .await - .map_err(StorageError::CannotFetchValue)? - .map(|bytes| self.inner.value(bytes)); - - Ok(value) - } - - /// This is identical to [`StorageEntryClient::key_prefix()`] and is the full - /// key for this storage entry. - pub fn key(&self) -> [u8; 32] { - self.inner.key_prefix() - } - - /// The keys for plain storage values are always 32 byte hashes. - pub fn key_prefix(&self) -> [u8; 32] { - self.inner.key_prefix() - } -} - -// When HasDefaultValue = Yes, we expect there to exist a valid default value and will use that -// if we fetch an entry and get nothing back. -impl<'atblock, T, Client, Addr> StorageEntryClient<'atblock, T, Client, Addr, Maybe> -where - T: Config, - Addr: Address, - Client: OnlineClientT, -{ - /// Fetch a storage value within this storage entry. - /// - /// This entry may be a map, and so you must provide the relevant values for each part of the storage - /// key that is required in order to point to a single value. - /// - /// If no value is found, the default value will be returned for this entry if one exists. If no value is - /// found and no default value exists, an error will be returned. - pub async fn fetch( - &self, - key_parts: Addr::KeyParts, - ) -> Result, StorageError> { - fetch(&self.inner, &self.client, self.block_ref.hash(), key_parts).await - } - - /// Fetch a storage value within this storage entry. - /// - /// This entry may be a map, and so you must provide the relevant values for each part of the storage - /// key that is required in order to point to a single value. - /// - /// If no value is found, `None` will be returned. - pub async fn try_fetch( - &self, - key_parts: Addr::KeyParts, - ) -> Result>, StorageError> { - try_fetch(&self.inner, &self.client, self.block_ref.hash(), key_parts).await - } - - /// Iterate over storage values within this storage entry. - /// - /// You may provide any prefix of the values needed to point to a single value. Normally you will - /// provide `()` to iterate over _everything_, or `(first_key,)` to iterate over everything underneath - /// `first_key` in the map, or `(first_key, second_key)` to iterate over everything underneath `first_key` - /// and `second_key` in the map, and so on, up to the actual depth of the map - 1. - pub async fn iter>( - &self, - key_parts: KeyParts, - ) -> Result< - impl futures::Stream, StorageError>> - + use<'atblock, Addr, Client, T, KeyParts>, - StorageError, - > { - iter( - self.inner.clone(), - &self.client, - self.block_ref.hash(), - key_parts, - ) - .await - } - - /// This returns a full key to a single value in this storage entry. - pub fn key(&self, key_parts: Addr::KeyParts) -> Result, StorageError> { - let key = self.inner.fetch_key(key_parts)?; - Ok(key) - } - - /// This returns valid keys to iterate over the storage entry at the available levels. - pub fn iter_key>( - &self, - key_parts: KeyParts, - ) -> Result, StorageError> { - let key = self.inner.iter_key(key_parts)?; - Ok(key) - } - - /// The first 32 bytes of the storage entry key, which points to the entry but not necessarily - /// a single storage value (unless the entry is a plain value). - pub fn key_prefix(&self) -> [u8; 32] { - self.inner.key_prefix() - } -} - -async fn fetch<'atblock, T: Config, Client: OnlineClientT, Addr: Address>( - entry: &subxt_core::storage::StorageEntry<'atblock, Addr>, - client: &Client, - block_hash: HashFor, - key_parts: Addr::KeyParts, -) -> Result, StorageError> { - let value = try_fetch(entry, client, block_hash, key_parts) - .await? - .or_else(|| entry.default_value()) - .unwrap(); - - Ok(value) -} - -async fn try_fetch<'atblock, T: Config, Client: OnlineClientT, Addr: Address>( - entry: &subxt_core::storage::StorageEntry<'atblock, Addr>, - client: &Client, - block_hash: HashFor, - key_parts: Addr::KeyParts, -) -> Result>, StorageError> { - let key = entry.fetch_key(key_parts)?; - - let value = client - .backend() - .storage_fetch_value(key, block_hash) - .await - .map_err(StorageError::CannotFetchValue)? - .map(|bytes| entry.value(bytes)) - .or_else(|| entry.default_value()); - - Ok(value) -} - -async fn iter< - 'atblock, - T: Config, - Client: OnlineClientT, - Addr: Address, - KeyParts: PrefixOf, ->( - entry: subxt_core::storage::StorageEntry<'atblock, Addr>, - client: &Client, - block_hash: HashFor, - key_parts: KeyParts, -) -> Result< - impl futures::Stream, StorageError>> - + use<'atblock, Addr, Client, T, KeyParts>, - StorageError, -> { - let key_bytes = entry.iter_key(key_parts)?; - - let stream = client - .backend() - .storage_fetch_descendant_values(key_bytes, block_hash) - .await - .map_err(StorageError::CannotIterateValues)? - .map(move |kv| { - let kv = match kv { - Ok(kv) => kv, - Err(e) => return Err(StorageError::StreamFailure(e)), - }; - Ok(entry.key_value(kv.key, kv.value)) - }); - - Ok(Box::pin(stream)) -} diff --git a/subxt/src/storage/storage_entry.rs b/subxt/src/storage/storage_entry.rs new file mode 100644 index 00000000000..fe8ca17f004 --- /dev/null +++ b/subxt/src/storage/storage_entry.rs @@ -0,0 +1,300 @@ +use crate::backend::{BackendExt, StorageResponse, StreamOf}; +use crate::client::{OfflineClientAtBlockT, OnlineClientAtBlockT}; +use crate::config::Config; +use crate::error::{BackendError, StorageError}; +use crate::storage::address::Address; +use crate::storage::{PrefixOf, StorageKeyValue, StorageValue}; +use crate::utils::YesMaybe; +use core::marker::PhantomData; +use frame_decode::storage::{IntoEncodableValues, StorageInfo, StorageTypeInfo}; +use futures::{Stream, StreamExt}; +use scale_info::PortableRegistry; +use std::pin::Pin; +use std::sync::Arc; +use std::task::Poll; + +/// This represents a single storage entry (be it a plain value or map) +/// and the operations that can be performed on it. +#[derive(Debug)] +pub struct StorageEntry<'atblock, T: Config, Client, Addr> { + inner: Arc>, + marker: PhantomData, +} + +impl<'atblock, T: Config, Client, Addr> Clone for StorageEntry<'atblock, T, Client, Addr> { + fn clone(&self) -> Self { + Self { + inner: self.inner.clone(), + marker: self.marker, + } + } +} + +#[derive(Debug)] +struct StorageEntryInner<'atblock, Addr, Client> { + address: Addr, + info: Arc>, + client: &'atblock Client, +} + +impl<'atblock, T, Client, Addr> StorageEntry<'atblock, T, Client, Addr> +where + T: Config, + Addr: Address, + Client: OfflineClientAtBlockT, +{ + pub(crate) fn new(client: &'atblock Client, address: Addr) -> Result { + let info = client + .metadata_ref() + .storage_info(address.pallet_name(), address.entry_name()) + .map_err(|e| StorageError::StorageInfoError(e.into_owned()))?; + + let inner = StorageEntryInner { + address, + info: Arc::new(info), + client, + }; + + Ok(Self { + inner: Arc::new(inner), + marker: PhantomData, + }) + } + + /// Name of the pallet containing this storage entry. + pub fn pallet_name(&self) -> &str { + self.inner.address.pallet_name() + } + + /// Name of the storage entry. + pub fn entry_name(&self) -> &str { + self.inner.address.entry_name() + } + + /// Is the storage entry a plain value? + pub fn is_plain(&self) -> bool { + self.inner.info.keys.is_empty() + } + + /// Is the storage entry a map? + pub fn is_map(&self) -> bool { + !self.is_plain() + } + + /// Return the default value for this storage entry, if there is one. Returns `None` if there + /// is no default value. + pub fn default_value(&self) -> Option> { + let info = &self.inner.info; + let client = self.inner.client; + info.default_value.as_ref().map(|default_value| { + StorageValue::new( + info.clone(), + client.metadata_ref().types(), + default_value.to_vec(), + ) + }) + } + + /// The keys for plain storage values are always 32 byte hashes. + pub fn key_prefix(&self) -> [u8; 32] { + frame_decode::storage::encode_storage_key_prefix(self.pallet_name(), self.entry_name()) + } + + /// This returns a full key to a single value in this storage entry. + pub fn fetch_key(&self, key_parts: Addr::KeyParts) -> Result, StorageError> { + let num_keys = self.inner.info.keys.len(); + if key_parts.num_encodable_values() != num_keys { + return Err(StorageError::WrongNumberOfKeyPartsProvidedForFetching { + expected: num_keys, + got: key_parts.num_encodable_values(), + }); + } + + self.key_from_any_parts(key_parts) + } + + /// This returns a valid key suitable for iterating over the values in this storage entry. + pub fn iter_key>( + &self, + key_parts: KeyParts, + ) -> Result, StorageError> { + let num_keys = self.inner.info.keys.len(); + if Addr::IsPlain::is_yes() { + Err(StorageError::CannotIterPlainEntry { + pallet_name: self.pallet_name().into(), + entry_name: self.entry_name().into(), + }) + } else if key_parts.num_encodable_values() >= num_keys { + Err(StorageError::WrongNumberOfKeyPartsProvidedForIterating { + max_expected: num_keys - 1, + got: key_parts.num_encodable_values(), + }) + } else { + self.key_from_any_parts(key_parts) + } + } + + // This has a more lax type signature than `.key` and so can be used in a couple of places internally. + fn key_from_any_parts( + &self, + key_parts: impl IntoEncodableValues, + ) -> Result, StorageError> { + frame_decode::storage::encode_storage_key_with_info( + self.pallet_name(), + self.entry_name(), + key_parts, + &self.inner.info, + self.inner.client.metadata_ref().types(), + ) + .map_err(StorageError::StorageKeyEncodeError) + } +} + +impl<'atblock, T, Client, Addr> StorageEntry<'atblock, T, Client, Addr> +where + T: Config, + Addr: Address, + Client: OnlineClientAtBlockT, +{ + /// Fetch a storage value within this storage entry. + /// + /// If the entry is a map, you'll need to provide the relevant values for each part of the storage + /// key. If the entry is a plain value, you must provide an empty list of key parts, ie `()`. + /// + /// The type of these key parts is determined by the [`Address`] of this storage entry. If the address + /// is generated via the `#[subxt]` macro then it will ensure you provide a valid type. + /// + /// If no value is found, the default value will be returned for this entry if one exists. If no value is + /// found and no default value exists, an error will be returned. + pub async fn fetch( + &self, + key_parts: Addr::KeyParts, + ) -> Result, StorageError> { + let value = self + .try_fetch(key_parts) + .await? + .or_else(|| self.default_value()) + .ok_or(StorageError::NoValueFound)?; + + Ok(value) + } + + /// Fetch a storage value within this storage entry. + /// + /// If the entry is a map, you'll need to provide the relevant values for each part of the storage + /// key. If the entry is a plain value, you must provide an empty list of key parts, ie `()`. + /// + /// The type of these key parts is determined by the [`Address`] of this storage entry. If the address + /// is generated via the `#[subxt]` macro then it will ensure you provide a valid type. + /// + /// If no value is found, `None` will be returned. + pub async fn try_fetch( + &self, + key_parts: Addr::KeyParts, + ) -> Result>, StorageError> { + let key = self.fetch_key(key_parts)?; + let block_hash = self.inner.client.block_hash(); + + let value = self + .inner + .client + .backend() + .storage_fetch_value(key, block_hash) + .await + .map_err(StorageError::CannotFetchValue)? + .map(|bytes| { + StorageValue::new( + self.inner.info.clone(), + self.inner.client.metadata_ref().types(), + bytes, + ) + }) + .or_else(|| self.default_value()); + + Ok(value) + } + + /// Iterate over storage values within this storage entry. + /// + /// You'll need to provide a prefix of the key parts required to point to a single value in the map. + /// Normally you will provide `()` to iterate over _everything_, `(first_key,)` to iterate over everything underneath + /// `first_key` in the map, `(first_key, second_key)` to iterate over everything underneath `first_key` + /// and `second_key` in the map, and so on, up to the actual depth of the map - 1. + /// + /// The possible types of these key parts is determined by the [`Address`] of this storage entry. + /// If the address is generated via the `#[subxt]` macro then it will ensure you provide a valid type. + /// + /// For plain values, there is no valid type, since they cannot be iterated over. + pub async fn iter>( + &self, + key_parts: KeyParts, + ) -> Result, StorageError> { + let num_keys = self.inner.info.keys.len(); + if key_parts.num_encodable_values() >= num_keys { + return Err(StorageError::WrongNumberOfKeyPartsProvidedForIterating { + max_expected: num_keys - 1, + got: key_parts.num_encodable_values(), + }); + } + + let info = self.inner.info.clone(); + let types = self.inner.client.metadata_ref().types(); + let key_bytes = self.key_from_any_parts(key_parts)?; + let block_hash = self.inner.client.block_hash(); + + let stream = self + .inner + .client + .backend() + .storage_fetch_descendant_values(key_bytes, block_hash) + .await + .map_err(StorageError::CannotIterateValues)?; + + Ok(StorageEntries { + info, + stream, + types, + marker: PhantomData, + }) + } +} + +/// A stream of storage entries. +pub struct StorageEntries<'atblock, Addr> { + // The raw underlying stream: + stream: StreamOf>, + // things we need to convert this into what we want: + info: Arc>, + types: &'atblock PortableRegistry, + marker: PhantomData, +} + +impl<'atblock, Addr: Address> StorageEntries<'atblock, Addr> { + /// Get the next storage entry. This is an alias for `futures::StreamExt::next(self)`. + pub async fn next(&mut self) -> Option, StorageError>> { + StreamExt::next(self).await + } +} + +impl<'atblock, Addr> std::marker::Unpin for StorageEntries<'atblock, Addr> {} +impl<'atblock, Addr: Address> Stream for StorageEntries<'atblock, Addr> { + type Item = Result, StorageError>; + + fn poll_next( + mut self: Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> Poll> { + let val = match futures::ready!(self.stream.poll_next_unpin(cx)) { + Some(Ok(val)) => val, + Some(Err(e)) => return Poll::Ready(Some(Err(StorageError::StreamFailure(e)))), + None => return Poll::Ready(None), + }; + + Poll::Ready(Some(Ok(StorageKeyValue::new( + self.info.clone(), + self.types, + val.key.into(), + val.value, + )))) + } +} diff --git a/core/src/storage/storage_key.rs b/subxt/src/storage/storage_key.rs similarity index 99% rename from core/src/storage/storage_key.rs rename to subxt/src/storage/storage_key.rs index 1880bef6184..871419d97db 100644 --- a/core/src/storage/storage_key.rs +++ b/subxt/src/storage/storage_key.rs @@ -3,10 +3,10 @@ // see LICENSE for license details. use crate::error::StorageKeyError; -use alloc::sync::Arc; use core::marker::PhantomData; use frame_decode::storage::{IntoDecodableValues, StorageInfo, StorageKey as StorageKeyPartInfo}; use scale_info::PortableRegistry; +use std::sync::Arc; pub use frame_decode::storage::StorageHasher; diff --git a/core/src/storage/storage_key_value.rs b/subxt/src/storage/storage_key_value.rs similarity index 92% rename from core/src/storage/storage_key_value.rs rename to subxt/src/storage/storage_key_value.rs index 74d81b1f1f3..9060bb06b8c 100644 --- a/core/src/storage/storage_key_value.rs +++ b/subxt/src/storage/storage_key_value.rs @@ -2,12 +2,13 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use super::{Address, StorageKey, StorageValue}; +use super::address::Address; +use super::storage_key::StorageKey; +use super::storage_value::StorageValue; use crate::error::StorageKeyError; -use alloc::sync::Arc; -use alloc::vec::Vec; use frame_decode::storage::StorageInfo; use scale_info::PortableRegistry; +use std::sync::Arc; /// This represents a storage key/value pair, which is typically returned from /// iterating over values in some storage map. diff --git a/core/src/storage/storage_value.rs b/subxt/src/storage/storage_value.rs similarity index 77% rename from core/src/storage/storage_value.rs rename to subxt/src/storage/storage_value.rs index 8cd50238a7d..cbbdaf7d3ef 100644 --- a/core/src/storage/storage_value.rs +++ b/subxt/src/storage/storage_value.rs @@ -3,12 +3,11 @@ // see LICENSE for license details. use crate::error::StorageValueError; -use alloc::sync::Arc; -use alloc::vec::Vec; use core::marker::PhantomData; use frame_decode::storage::StorageInfo; use scale_decode::DecodeAsType; use scale_info::PortableRegistry; +use std::sync::Arc; /// This represents a storage value. #[derive(Debug)] @@ -38,6 +37,11 @@ impl<'info, Value: DecodeAsType> StorageValue<'info, Value> { &self.bytes } + /// The type ID for this storage value. + pub fn type_id(&self) -> u32 { + self.info.value_id + } + /// Consume this storage value and return the raw bytes. pub fn into_bytes(self) -> Vec { self.bytes.to_vec() @@ -68,4 +72,17 @@ impl<'info, Value: DecodeAsType> StorageValue<'info, Value> { Ok(value) } + + /// Visit this storage value with the provided visitor, returning the output from it. + pub fn visit(&self, visitor: V) -> Result, V::Error> + where + V: scale_decode::visitor::Visitor, + { + scale_decode::visitor::decode_with_visitor( + &mut &*self.bytes, + self.type_id(), + self.types, + visitor, + ) + } } diff --git a/subxt/src/transactions.rs b/subxt/src/transactions.rs new file mode 100644 index 00000000000..f099ad28f8d --- /dev/null +++ b/subxt/src/transactions.rs @@ -0,0 +1,797 @@ +//! This module exposes [`TransactionsClient`], which has methods for constructing and submitting +//! transactions. It's created by calling [`crate::client::ClientAtBlock::transactions()`], or +//! [`crate::client::ClientAtBlock::tx()`] for short. +//! +//! ```rust,no_run +//! pub use subxt::{OnlineClient, PolkadotConfig}; +//! +//! let client = OnlineClient::new().await?; +//! let at_block = client.at_current_block().await?; +//! +//! let transactions = at_block.transactions(); +//! ``` + +mod account_nonce; +mod default_params; +mod payload; +mod signer; +mod transaction_progress; +mod validation_result; + +use crate::backend::{BackendExt, TransactionStatus as BackendTransactionStatus}; +use crate::client::{OfflineClientAtBlockT, OnlineClientAtBlockT}; +use crate::config::extrinsic_params::Params; +use crate::config::{ + ClientState, Config, ExtrinsicParams, ExtrinsicParamsEncoder, HashFor, Hasher, Header, +}; +use crate::error::{ExtrinsicError, TransactionStatusError}; +use codec::{Compact, Encode}; +use core::marker::PhantomData; +use futures::{TryFutureExt, future::try_join}; +use sp_crypto_hashing::blake2_256; +use std::borrow::Cow; + +pub use default_params::DefaultParams; +pub use payload::{DynamicPayload, Payload, StaticPayload, dynamic}; +pub use signer::Signer; +pub use transaction_progress::{TransactionInBlock, TransactionProgress, TransactionStatus}; +pub use validation_result::{ + TransactionInvalid, TransactionUnknown, TransactionValid, ValidationResult, +}; + +/// A client for working with transactions. See [the module docs](crate::transactions) for more. +#[derive(Clone)] +pub struct TransactionsClient { + client: Client, + marker: PhantomData, +} + +impl TransactionsClient { + pub(crate) fn new(client: Client) -> Self { + TransactionsClient { + client, + marker: PhantomData, + } + } +} + +impl> TransactionsClient { + /// Run the validation logic against some transaction you'd like to submit. Returns `Ok(())` + /// if the call is valid (or if it's not possible to check since the call has no validation hash). + /// Return an error if the call was not valid or something went wrong trying to validate it (ie + /// the pallet or call in question do not exist at all). + pub fn validate(&self, call: &Call) -> Result<(), ExtrinsicError> + where + Call: Payload, + { + let Some(details) = call.validation_details() else { + return Ok(()); + }; + + let pallet_name = details.pallet_name; + let call_name = details.call_name; + + let expected_hash = self + .client + .metadata_ref() + .pallet_by_name(pallet_name) + .ok_or_else(|| ExtrinsicError::PalletNameNotFound(pallet_name.to_string()))? + .call_hash(call_name) + .ok_or_else(|| ExtrinsicError::CallNameNotFound { + pallet_name: pallet_name.to_string(), + call_name: call_name.to_string(), + })?; + + if details.hash != expected_hash { + Err(ExtrinsicError::IncompatibleCodegen) + } else { + Ok(()) + } + } + + /// Create a [`SubmittableTransaction`] from some already-signed and prepared + /// transaction bytes, and some client (anything implementing [`OfflineClientAtBlockT`] + /// or [`OnlineClientAtBlockT`]). + pub fn from_bytes(&self, tx_bytes: Vec) -> SubmittableTransaction { + SubmittableTransaction { + client: self.client.clone(), + encoded: tx_bytes, + marker: PhantomData, + } + } + + /// Return the SCALE encoded bytes representing the call data of the transaction. + pub fn call_data(&self, call: &Call) -> Result, ExtrinsicError> + where + Call: Payload, + { + let mut bytes = Vec::new(); + let metadata = self.client.metadata_ref(); + call.encode_call_data_to(metadata, &mut bytes)?; + Ok(bytes) + } + + /// Creates an unsigned transaction without submitting it. Depending on the metadata, we might end + /// up constructing either a v4 or v5 transaction. See [`Self::create_v4_unsigned`] or + /// [`Self::create_v5_unsigned`] if you'd like to explicitly create an unsigned transaction of a certain version. + pub fn create_unsigned( + &self, + call: &Call, + ) -> Result, ExtrinsicError> + where + Call: Payload, + { + let tx = match self.default_transaction_version()? { + SupportedTransactionVersion::V4 => self.create_v4_unsigned(call), + SupportedTransactionVersion::V5 => self.create_v5_unsigned(call), + }?; + + Ok(tx) + } + + /// Creates a V4 "unsigned" transaction without submitting it. + pub fn create_v4_unsigned( + &self, + call: &Call, + ) -> Result, ExtrinsicError> + where + Call: Payload, + { + self.create_unsigned_at_version(call, SupportedTransactionVersion::V4) + } + + /// Creates a V5 "bare" transaction without submitting it. + pub fn create_v5_unsigned( + &self, + call: &Call, + ) -> Result, ExtrinsicError> + where + Call: Payload, + { + self.create_unsigned_at_version(call, SupportedTransactionVersion::V5) + } + + /// Create a signable transaction. Depending on the metadata, we might end up constructing either a v4 or + /// v5 transaction. Use [`Self::create_v4_signable_offline`] or [`Self::create_v5_signable_offline`] if you'd + /// like to manually use a specific version. + /// + /// Note: if not provided, the default account nonce will be set to 0 and the default mortality will be _immortal_. + /// This is because this method runs offline, and so is unable to fetch the data needed for more appropriate values. + pub fn create_signable_offline( + &self, + call: &Call, + params: >::Params, + ) -> Result, ExtrinsicError> + where + Call: Payload, + { + match self.default_transaction_version()? { + SupportedTransactionVersion::V4 => self.create_v4_signable_offline(call, params), + SupportedTransactionVersion::V5 => self.create_v5_signable_offline(call, params), + } + } + + /// Create a v4 partial transaction, ready to sign. + /// + /// Note: if not provided, the default account nonce will be set to 0 and the default mortality will be _immortal_. + /// This is because this method runs offline, and so is unable to fetch the data needed for more appropriate values. + /// + /// Prefer [`Self::create_signable_offline()`] if you don't know which version to create; this will pick the + /// most suitable one for the given chain. + pub fn create_v4_signable_offline( + &self, + call: &Call, + params: >::Params, + ) -> Result, ExtrinsicError> + where + Call: Payload, + { + self.create_signable_at_version(call, params, SupportedTransactionVersion::V4) + } + + /// Create a v5 partial transaction, ready to sign. + /// + /// Note: if not provided, the default account nonce will be set to 0 and the default mortality will be _immortal_. + /// This is because this method runs offline, and so is unable to fetch the data needed for more appropriate values. + /// + /// Prefer [`Self::create_signable_offline()`] if you don't know which version to create; this will pick the + /// most suitable one for the given chain. + pub fn create_v5_signable_offline( + &self, + call: &Call, + params: >::Params, + ) -> Result, ExtrinsicError> + where + Call: Payload, + { + self.create_signable_at_version(call, params, SupportedTransactionVersion::V5) + } + + /// Returns the suggested transaction versions to build for a given chain, or an error + /// if Subxt doesn't support any version expected by the chain. + /// + /// When using methods like [`Self::create_signable_offline`] and [`Self::create_unsigned`], + /// this will be used internally to decide which transaction version to construct. + pub fn default_transaction_version( + &self, + ) -> Result { + let metadata = self.client.metadata_ref(); + let versions = metadata.extrinsic().supported_versions(); + + if versions.contains(&4) { + Ok(SupportedTransactionVersion::V4) + } else if versions.contains(&5) { + Ok(SupportedTransactionVersion::V5) + } else { + Err(ExtrinsicError::UnsupportedVersion) + } + } + + // Create a V4 "unsigned" transaction or V5 "bare" transaction. + fn create_unsigned_at_version( + &self, + call: &Call, + tx_version: SupportedTransactionVersion, + ) -> Result, ExtrinsicError> { + let metadata = self.client.metadata_ref(); + + // 1. Validate this call against the current node metadata if the call comes + // with a hash allowing us to do so. + self.validate(call)?; + + // 2. Encode extrinsic + let extrinsic = { + let mut encoded_inner = Vec::new(); + // encode the transaction version first. + (tx_version as u8).encode_to(&mut encoded_inner); + // encode call data after this byte. + call.encode_call_data_to(metadata, &mut encoded_inner)?; + // now, prefix byte length: + let len = Compact( + u32::try_from(encoded_inner.len()).expect("extrinsic size expected to be <4GB"), + ); + let mut encoded = Vec::new(); + len.encode_to(&mut encoded); + encoded.extend(encoded_inner); + encoded + }; + + // Wrap in Encoded to ensure that any more "encode" calls leave it in the right state. + Ok(SubmittableTransaction { + client: self.client.clone(), + encoded: extrinsic, + marker: PhantomData, + }) + } + + // Create a V4 "signed" or a V5 "general" transaction. + fn create_signable_at_version( + &self, + call: &Call, + params: >::Params, + tx_version: SupportedTransactionVersion, + ) -> Result, ExtrinsicError> + where + Call: Payload, + { + // 1. Validate this call against the current node metadata if the call comes + // with a hash allowing us to do so. + self.validate(call)?; + + // 2. Work out which TX extension version to target based on metadata. + let tx_extension_version = match tx_version { + SupportedTransactionVersion::V4 => None, + SupportedTransactionVersion::V5 => { + let v = self + .client + .metadata_ref() + .extrinsic() + .transaction_extension_version_to_use_for_encoding(); + Some(v) + } + }; + + // 3. SCALE encode call data to bytes (pallet u8, call u8, call params). + let call_data = self.call_data(call)?; + + // 4. Construct our custom additional/extra params. + let client_state = ClientState { + genesis_hash: self + .client + .genesis_hash() + .ok_or(ExtrinsicError::GenesisHashNotProvided)?, + spec_version: self.client.spec_version(), + transaction_version: self.client.transaction_version(), + metadata: self.client.metadata(), + }; + let additional_and_extra_params = + >::new(&client_state, params)?; + + // Return these details, ready to construct a signed extrinsic from. + Ok(SignableTransaction { + client: self.client.clone(), + call_data, + additional_and_extra_params, + tx_extension_version, + }) + } +} + +impl> TransactionsClient { + /// Get the account nonce for a given account ID. + pub async fn account_nonce(&self, account_id: &T::AccountId) -> Result { + account_nonce::get_account_nonce(&self.client, account_id) + .await + .map_err(|e| ExtrinsicError::AccountNonceError { + block_hash: self.client.block_hash().into(), + account_id: account_id.clone().encode().into(), + reason: e, + }) + } + + /// Creates a signable transaction. This can then be signed and submitted. + pub async fn create_signable( + &self, + call: &Call, + account_id: &T::AccountId, + mut params: >::Params, + ) -> Result, ExtrinsicError> + where + Call: Payload, + { + self.inject_account_nonce_and_block(account_id, &mut params) + .await?; + self.create_signable_offline(call, params) + } + + /// Creates a signable V4 transaction, without submitting it. This can then be signed and submitted. + /// + /// Prefer [`Self::create_signable()`] if you don't know which version to create; this will pick the + /// most suitable one for the given chain. + pub async fn create_v4_signable( + &self, + call: &Call, + account_id: &T::AccountId, + mut params: >::Params, + ) -> Result, ExtrinsicError> + where + Call: Payload, + { + self.inject_account_nonce_and_block(account_id, &mut params) + .await?; + self.create_v4_signable_offline(call, params) + } + + /// Creates a signable V5 transaction, without submitting it. This can then be signed and submitted. + /// + /// Prefer [`Self::create_signable()`] if you don't know which version to create; this will pick the + /// most suitable one for the given chain. + pub async fn create_v5_signable( + &self, + call: &Call, + account_id: &T::AccountId, + mut params: >::Params, + ) -> Result, ExtrinsicError> + where + Call: Payload, + { + self.inject_account_nonce_and_block(account_id, &mut params) + .await?; + self.create_v5_signable_offline(call, params) + } + + /// Creates a signed transaction, without submitting it. + pub async fn create_signed( + &mut self, + call: &Call, + signer: &S, + params: >::Params, + ) -> Result, ExtrinsicError> + where + Call: Payload, + S: Signer, + { + let mut signable = self + .create_signable(call, &signer.account_id(), params) + .await?; + + Ok(signable.sign(signer)) + } + + /// Creates and signs an transaction and submits it to the chain. Passes default parameters + /// to construct the "signed extra" and "additional" payloads needed by the transaction. + /// + /// Returns a [`TransactionProgress`], which can be used to track the status of the transaction + /// and obtain details about it, once it has made it into a block. + pub async fn sign_and_submit_then_watch_default( + &mut self, + call: &Call, + signer: &S, + ) -> Result, ExtrinsicError> + where + Call: Payload, + S: Signer, + >::Params: DefaultParams, + { + self.sign_and_submit_then_watch(call, signer, DefaultParams::default_params()) + .await + } + + /// Creates and signs an transaction and submits it to the chain. + /// + /// Returns a [`TransactionProgress`], which can be used to track the status of the transaction + /// and obtain details about it, once it has made it into a block. + pub async fn sign_and_submit_then_watch( + &mut self, + call: &Call, + signer: &S, + params: >::Params, + ) -> Result, ExtrinsicError> + where + Call: Payload, + S: Signer, + { + self.create_signed(call, signer, params) + .await? + .submit_and_watch() + .await + } + + /// Creates and signs an transaction and submits to the chain for block inclusion. Passes + /// default parameters to construct the "signed extra" and "additional" payloads needed + /// by the transaction. + /// + /// Returns `Ok` with the transaction hash if it is valid transaction. + /// + /// # Note + /// + /// Success does not mean the transaction has been included in the block, just that it is valid + /// and has been included in the transaction pool. + pub async fn sign_and_submit_default( + &mut self, + call: &Call, + signer: &S, + ) -> Result, ExtrinsicError> + where + Call: Payload, + S: Signer, + >::Params: DefaultParams, + { + self.sign_and_submit(call, signer, DefaultParams::default_params()) + .await + } + + /// Creates and signs an transaction and submits to the chain for block inclusion. + /// + /// Returns `Ok` with the transaction hash if it is valid transaction. + /// + /// # Note + /// + /// Success does not mean the transaction has been included in the block, just that it is valid + /// and has been included in the transaction pool. + pub async fn sign_and_submit( + &mut self, + call: &Call, + signer: &S, + params: >::Params, + ) -> Result, ExtrinsicError> + where + Call: Payload, + S: Signer, + { + self.create_signed(call, signer, params) + .await? + .submit() + .await + } + + /// Fetch the latest block header and account nonce from the backend and use them to refine [`ExtrinsicParams::Params`]. + async fn inject_account_nonce_and_block( + &self, + account_id: &T::AccountId, + params: &mut >::Params, + ) -> Result<(), ExtrinsicError> { + let block_ref = self + .client + .backend() + .latest_finalized_block_ref() + .await + .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock)?; + + let (block_header, account_nonce) = try_join( + self.client + .backend() + .block_header(block_ref.hash()) + .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock), + self.account_nonce(account_id), + ) + .await?; + + let block_header = block_header.ok_or_else(|| ExtrinsicError::CannotFindBlockHeader { + block_hash: block_ref.hash().into(), + })?; + + params.inject_account_nonce(account_nonce); + params.inject_block(block_header.number(), block_ref.hash()); + + Ok(()) + } +} + +/// The transaction versions supported by Subxt. +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] +#[repr(u8)] +pub enum SupportedTransactionVersion { + /// v4 transactions (signed and unsigned transactions) + V4 = 4u8, + /// v5 transactions (bare and general transactions) + V5 = 5u8, +} + +/// This is a transaction that requires signing before it can be submitted. +pub struct SignableTransaction { + client: Client, + call_data: Vec, + additional_and_extra_params: ::ExtrinsicParams, + // For V4 transactions this doesn't exist, and for V5 it does. + tx_extension_version: Option, +} + +impl> SignableTransaction { + /// Return the bytes representing the call data for this partially constructed + /// transaction. + pub fn call_data(&self) -> &[u8] { + &self.call_data + } + + /// Return the signer payload for this transaction. These are the bytes that must + /// be signed in order to produce a valid signature for the transaction. + pub fn signer_payload(&self) -> Vec { + self.with_signer_payload(|bytes| bytes.to_vec()) + } + + /// Convert this [`SignableTransaction`] into a [`SubmittableTransaction`], ready to submit. + /// The provided `signer` is responsible for providing the "from" address for the transaction, + /// as well as providing a signature to attach to it. + pub fn sign>(&mut self, signer: &S) -> SubmittableTransaction { + // Given our signer, we can sign the payload representing this extrinsic. + let signature = signer.sign(&self.signer_payload()); + // Now, use the signature and "from" account to build the extrinsic. + self.sign_with_account_and_signature(&signer.account_id(), &signature) + } + + /// Convert this [`SignableTransaction`] into a [`SubmittableTransaction`], ready to submit. + /// An address, and something representing a signature that can be SCALE encoded, are both + /// needed in order to construct it. If you have a `Signer` to hand, you can use + /// [`SignableTransaction::sign()`] instead. + pub fn sign_with_account_and_signature( + &mut self, + account_id: &T::AccountId, + signature: &T::Signature, + ) -> SubmittableTransaction { + let encoded = if let Some(tx_extensions_version) = self.tx_extension_version { + let mut encoded_inner = Vec::new(); + // Pass account and signature to extensions to be added. + self.additional_and_extra_params + .inject_signature(account_id, signature); + // "is general" + transaction protocol version (5) + (0b01000000 + 5u8).encode_to(&mut encoded_inner); + // Encode versions for the transaction extensions + tx_extensions_version.encode_to(&mut encoded_inner); + // Encode the actual transaction extensions values + self.additional_and_extra_params + .encode_value_to(&mut encoded_inner); + // and now, call data (remembering that it's been encoded already and just needs appending) + encoded_inner.extend(&self.call_data); + // now, prefix byte length: + let len = Compact( + u32::try_from(encoded_inner.len()).expect("extrinsic size expected to be <4GB"), + ); + let mut encoded = Vec::new(); + len.encode_to(&mut encoded); + encoded.extend(encoded_inner); + encoded + } else { + let mut encoded_inner = Vec::new(); + // "is signed" + transaction protocol version (4) + (0b10000000 + 4u8).encode_to(&mut encoded_inner); + // from address for signature + let address: T::Address = account_id.clone().into(); + address.encode_to(&mut encoded_inner); + // the signature + signature.encode_to(&mut encoded_inner); + // attach custom extra params + self.additional_and_extra_params + .encode_value_to(&mut encoded_inner); + // and now, call data (remembering that it's been encoded already and just needs appending) + encoded_inner.extend(&self.call_data); + // now, prefix byte length: + let len = Compact( + u32::try_from(encoded_inner.len()).expect("extrinsic size expected to be <4GB"), + ); + let mut encoded = Vec::new(); + len.encode_to(&mut encoded); + encoded.extend(encoded_inner); + encoded + }; + + SubmittableTransaction { + client: self.client.clone(), + encoded, + marker: PhantomData, + } + } + + // Obtain bytes representing the signer payload and run call some function + // with them. This can avoid an allocation in some cases. + fn with_signer_payload(&self, f: F) -> R + where + F: for<'a> FnOnce(Cow<'a, [u8]>) -> R, + { + let mut bytes = self.call_data.clone(); + self.additional_and_extra_params + .encode_signer_payload_value_to(&mut bytes); + self.additional_and_extra_params + .encode_implicit_to(&mut bytes); + + // For V5 transactions we _always_ blake2 hash. For V4 we only + // hash if more than 256 bytes in the payload. + if self.is_v5() || bytes.len() > 256 { + f(Cow::Borrowed(&blake2_256(&bytes))) + } else { + f(Cow::Owned(bytes)) + } + } + + // Are we working with a V5 transaction? This is handled a bit differently. + fn is_v5(&self) -> bool { + self.tx_extension_version.is_some() + } +} + +/// This is a transaction that is ready to submit. +#[derive(Debug, Clone)] +pub struct SubmittableTransaction { + client: Client, + encoded: Vec, + marker: PhantomData, +} + +impl SubmittableTransaction +where + T: Config, + Client: OfflineClientAtBlockT, +{ + /// Calculate and return the hash of the transaction, based on the configured hasher. + pub fn hash(&self) -> HashFor { + self.client.hasher().hash(&self.encoded) + } + + /// Returns the SCALE encoded transaction bytes. + pub fn encoded(&self) -> &[u8] { + &self.encoded + } + + /// Consumes [`SubmittableTransaction`] and returns the SCALE encoded + /// transaction bytes. + pub fn into_encoded(self) -> Vec { + self.encoded.clone() + } +} + +impl> SubmittableTransaction { + /// Submits the transaction to the chain. + /// + /// Returns a [`TransactionProgress`], which can be used to track the status of the transaction + /// and obtain details about it, once it has made it into a block. + pub async fn submit_and_watch(&self) -> Result, ExtrinsicError> { + // Get a hash of the transaction (we'll need this later). + let ext_hash = self.hash(); + + // Submit and watch for transaction progress. + let sub = self + .client + .backend() + .submit_transaction(self.encoded()) + .await + .map_err(ExtrinsicError::ErrorSubmittingTransaction)?; + + Ok(TransactionProgress::new(sub, self.client.clone(), ext_hash)) + } + + /// Submits the transaction to the chain for block inclusion. + /// + /// It's usually better to call `submit_and_watch` to get an idea of the progress of the + /// submission and whether it's eventually successful or not. This call does not guarantee + /// success, and is just sending the transaction to the chain. + pub async fn submit(&self) -> Result, ExtrinsicError> { + let ext_hash = self.hash(); + let mut sub = self + .client + .backend() + .submit_transaction(self.encoded()) + .await + .map_err(ExtrinsicError::ErrorSubmittingTransaction)?; + + // If we get a bad status or error back straight away then error, else return the hash. + match sub.next().await { + Some(Ok(status)) => match status { + BackendTransactionStatus::Validated + | BackendTransactionStatus::Broadcasted + | BackendTransactionStatus::InBestBlock { .. } + | BackendTransactionStatus::NoLongerInBestBlock + | BackendTransactionStatus::InFinalizedBlock { .. } => Ok(ext_hash), + BackendTransactionStatus::Error { message } => Err( + ExtrinsicError::TransactionStatusError(TransactionStatusError::Error(message)), + ), + BackendTransactionStatus::Invalid { message } => { + Err(ExtrinsicError::TransactionStatusError( + TransactionStatusError::Invalid(message), + )) + } + BackendTransactionStatus::Dropped { message } => { + Err(ExtrinsicError::TransactionStatusError( + TransactionStatusError::Dropped(message), + )) + } + }, + Some(Err(e)) => Err(ExtrinsicError::TransactionStatusStreamError(e)), + None => Err(ExtrinsicError::UnexpectedEndOfTransactionStatusStream), + } + } + + /// Validate a transaction by submitting it to the relevant Runtime API. A transaction that is + /// valid can be added to a block, but may still end up in an error state. + /// + /// Returns `Ok` with a [`ValidationResult`], which is the result of attempting to dry run the transaction. + pub async fn validate(&self) -> Result { + let block_hash = self.client.block_hash(); + + // Approach taken from https://github.com/paritytech/json-rpc-interface-spec/issues/55. + let mut params = Vec::with_capacity(8 + self.encoded().len() + 8); + 2u8.encode_to(&mut params); + params.extend(self.encoded().iter()); + block_hash.encode_to(&mut params); + + let res: Vec = self + .client + .backend() + .call( + "TaggedTransactionQueue_validate_transaction", + Some(¶ms), + block_hash, + ) + .await + .map_err(ExtrinsicError::CannotGetValidationInfo)?; + + ValidationResult::try_from_bytes(res) + } + + /// This returns an estimate for what the transaction is expected to cost to execute, less any tips. + /// The actual amount paid can vary from block to block based on node traffic and other factors. + pub async fn partial_fee_estimate(&self) -> Result { + let mut params = self.encoded().to_vec(); + (self.encoded().len() as u32).encode_to(&mut params); + let latest_block_ref = self + .client + .backend() + .latest_finalized_block_ref() + .await + .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock)?; + + // destructuring RuntimeDispatchInfo, see type information + // data layout: {weight_ref_time: Compact, weight_proof_size: Compact, class: u8, partial_fee: u128} + let (_, _, _, partial_fee) = self + .client + .backend() + .call_decoding::<(Compact, Compact, u8, u128)>( + "TransactionPaymentApi_query_info", + Some(¶ms), + latest_block_ref.hash(), + ) + .await + .map_err(ExtrinsicError::CannotGetFeeInfo)?; + + Ok(partial_fee) + } +} diff --git a/subxt/src/transactions/account_nonce.rs b/subxt/src/transactions/account_nonce.rs new file mode 100644 index 00000000000..60de00836fb --- /dev/null +++ b/subxt/src/transactions/account_nonce.rs @@ -0,0 +1,38 @@ +use crate::client::OnlineClientAtBlockT; +use crate::config::Config; +use crate::error::AccountNonceError; +use codec::{Decode, Encode}; + +/// Return the account nonce at some block hash for an account ID. +pub async fn get_account_nonce( + client: &C, + account_id: &T::AccountId, +) -> Result +where + T: Config, + C: OnlineClientAtBlockT, +{ + let block_hash = client.block_hash(); + let account_nonce_bytes = client + .backend() + .call( + "AccountNonceApi_account_nonce", + Some(&account_id.encode()), + block_hash, + ) + .await?; + + // custom decoding from a u16/u32/u64 into a u64, based on the number of bytes we got back. + let cursor = &mut &account_nonce_bytes[..]; + let account_nonce: u64 = match account_nonce_bytes.len() { + 2 => u16::decode(cursor)?.into(), + 4 => u32::decode(cursor)?.into(), + 8 => u64::decode(cursor)?, + _ => { + return Err(AccountNonceError::WrongNumberOfBytes( + account_nonce_bytes.len(), + )); + } + }; + Ok(account_nonce) +} diff --git a/subxt/src/transactions/default_params.rs b/subxt/src/transactions/default_params.rs new file mode 100644 index 00000000000..797d945d833 --- /dev/null +++ b/subxt/src/transactions/default_params.rs @@ -0,0 +1,61 @@ +/// This trait is used to create default values for extrinsic params. We use this instead of +/// [`Default`] because we want to be able to support params which are tuples of more than 12 +/// entries (which is the maximum tuple size Rust currently implements [`Default`] for on tuples), +/// given that we aren't far off having more than 12 transaction extensions already. +/// +/// If you have params which are _not_ a tuple and which you'd like to be instantiated automatically +/// when calling [`crate::transactions::TransactionsClient::sign_and_submit_default()`] or +/// [`crate::transactions::TransactionsClient::sign_and_submit_then_watch_default()`], then you'll +/// need to implement this trait for them. +pub trait DefaultParams: Sized { + /// Instantiate a default instance of the parameters. + fn default_params() -> Self; +} + +impl DefaultParams for [P; N] { + fn default_params() -> Self { + core::array::from_fn(|_| P::default()) + } +} + +macro_rules! impl_default_params_for_tuple { + ($($ident:ident),+) => { + impl <$($ident : Default),+> DefaultParams for ($($ident,)+){ + fn default_params() -> Self { + ( + $($ident::default(),)+ + ) + } + } + } +} + +#[rustfmt::skip] +const _: () = { + impl_default_params_for_tuple!(A); + impl_default_params_for_tuple!(A, B); + impl_default_params_for_tuple!(A, B, C); + impl_default_params_for_tuple!(A, B, C, D); + impl_default_params_for_tuple!(A, B, C, D, E); + impl_default_params_for_tuple!(A, B, C, D, E, F); + impl_default_params_for_tuple!(A, B, C, D, E, F, G); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y); + impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z); +}; diff --git a/core/src/tx/payload.rs b/subxt/src/transactions/payload.rs similarity index 86% rename from core/src/tx/payload.rs rename to subxt/src/transactions/payload.rs index e87c38a98f1..3ce32b661cc 100644 --- a/core/src/tx/payload.rs +++ b/subxt/src/transactions/payload.rs @@ -5,16 +5,12 @@ //! This module contains the trait and types used to represent //! transactions that can be submitted. -use crate::Metadata; use crate::error::ExtrinsicError; -use alloc::borrow::Cow; -use alloc::boxed::Box; -use alloc::string::{String, ToString}; - -use alloc::vec::Vec; use codec::Encode; use scale_encode::EncodeAsFields; use scale_value::{Composite, Value, ValueDef, Variant}; +use std::borrow::Cow; +use subxt_metadata::Metadata; /// This represents a transaction payload that can be submitted /// to a node. @@ -63,9 +59,7 @@ macro_rules! boxed_payload { } boxed_payload!(Box); -#[cfg(feature = "std")] boxed_payload!(std::sync::Arc); -#[cfg(feature = "std")] boxed_payload!(std::rc::Rc); /// Details required to validate the shape of a transaction payload against some metadata. @@ -81,26 +75,24 @@ pub struct ValidationDetails<'a> { /// A transaction payload containing some generic `CallData`. #[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] -pub struct DefaultPayload { +pub struct StaticPayload { pallet_name: Cow<'static, str>, call_name: Cow<'static, str>, call_data: CallData, validation_hash: Option<[u8; 32]>, } -/// The payload type used by static codegen. -pub type StaticPayload = DefaultPayload; /// The type of a payload typically used for dynamic transaction payloads. -pub type DynamicPayload = DefaultPayload>; +pub type DynamicPayload = StaticPayload; -impl DefaultPayload { - /// Create a new [`DefaultPayload`]. +impl StaticPayload { + /// Create a new [`StaticPayload`]. pub fn new( pallet_name: impl Into, call_name: impl Into, call_data: CallData, ) -> Self { - DefaultPayload { + StaticPayload { pallet_name: Cow::Owned(pallet_name.into()), call_name: Cow::Owned(call_name.into()), call_data, @@ -108,7 +100,7 @@ impl DefaultPayload { } } - /// Create a new [`DefaultPayload`] using static strings for the pallet and call name. + /// Create a new [`StaticPayload`] using static strings for the pallet and call name. /// This is only expected to be used from codegen. #[doc(hidden)] pub fn new_static( @@ -117,7 +109,7 @@ impl DefaultPayload { call_data: CallData, validation_hash: [u8; 32], ) -> Self { - DefaultPayload { + StaticPayload { pallet_name: Cow::Borrowed(pallet_name), call_name: Cow::Borrowed(call_name), call_data, @@ -149,8 +141,8 @@ impl DefaultPayload { } } -impl DefaultPayload> { - /// Convert the dynamic `Composite` payload into a [`Value`]. +impl StaticPayload> { + /// Convert the `Composite` payload into a [`Value`]. /// This is useful if you want to use this as an argument for a /// larger dynamic call that wants to use this as a nested call. pub fn into_value(self) -> Value<()> { @@ -166,7 +158,7 @@ impl DefaultPayload> { } } -impl Payload for DefaultPayload { +impl Payload for StaticPayload { fn encode_call_data_to( &self, metadata: &Metadata, @@ -208,20 +200,18 @@ impl Payload for DefaultPayload { } } -/// Construct a transaction at runtime; essentially an alias to [`DefaultPayload::new()`] -/// which provides a [`Composite`] value for the call data. -pub fn dynamic( +/// Construct a transaction at runtime; essentially an alias to [`DynamicPayload::new()`]. +pub fn dynamic( pallet_name: impl Into, call_name: impl Into, - call_data: impl Into>, -) -> DynamicPayload { - DefaultPayload::new(pallet_name, call_name, call_data.into()) + call_data: CallData, +) -> DynamicPayload { + StaticPayload::new(pallet_name, call_name, call_data) } #[cfg(test)] mod tests { use super::*; - use crate::Metadata; use codec::Decode; use scale_value::Composite; @@ -239,7 +229,7 @@ mod tests { ("value", scale_value::Value::string("not_a_number")), // String instead of u128 ]); - let payload = DefaultPayload::new("Balances", "transfer_allow_death", incompatible_data); + let payload = StaticPayload::new("Balances", "transfer_allow_death", incompatible_data); let mut out = Vec::new(); let result = payload.encode_call_data_to(&metadata, &mut out); @@ -264,7 +254,7 @@ mod tests { ("value", scale_value::Value::u128(1000)), ]); - let payload = DefaultPayload::new("Balances", "transfer_allow_death", valid_data); + let payload = StaticPayload::new("Balances", "transfer_allow_death", valid_data); // This should succeed let mut out = Vec::new(); diff --git a/core/src/tx/signer.rs b/subxt/src/transactions/signer.rs similarity index 67% rename from core/src/tx/signer.rs rename to subxt/src/transactions/signer.rs index 82dca378d16..0eddd8718c5 100644 --- a/core/src/tx/signer.rs +++ b/subxt/src/transactions/signer.rs @@ -1,11 +1,4 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! A library to **sub**mit e**xt**rinsics to a -//! [substrate](https://github.com/paritytech/substrate) node via RPC. - -use crate::Config; +use crate::config::Config; /// Signing transactions requires a [`Signer`]. This is responsible for /// providing the "from" account that the transaction is being signed by, diff --git a/subxt/src/transactions/transaction_progress.rs b/subxt/src/transactions/transaction_progress.rs new file mode 100644 index 00000000000..1a4deb0e0a8 --- /dev/null +++ b/subxt/src/transactions/transaction_progress.rs @@ -0,0 +1,346 @@ +use crate::backend::BlockRef; +use crate::backend::{StreamOfResults, TransactionStatus as BackendTransactionStatus}; +use crate::client::{BlockNumberOrRef, OfflineClientAtBlockT, OnlineClientAtBlockT}; +use crate::config::{Config, HashFor}; +use crate::error::{ + DispatchError, TransactionEventsError, TransactionFinalizedSuccessError, + TransactionProgressError, TransactionStatusError, +}; +use crate::extrinsics::ExtrinsicEvents; +use futures::{Stream, StreamExt}; +use std::pin::Pin; +use std::task::{Context, Poll}; + +/// A stream representing the progress of some transaction. Events can be +/// streamed and acted on using [`TransactionProgress::next()`], or the helper +/// functions [`TransactionProgress::wait_for_finalized`] and +/// [`TransactionProgress::wait_for_finalized_success`] can be used to wait +/// for completion. +#[derive(Debug)] +pub struct TransactionProgress { + sub: Option>>>, + ext_hash: HashFor, + client: C, +} + +// 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 Unpin for TransactionProgress {} + +impl TransactionProgress { + /// Instantiate a new [`TransactionProgress`] from a custom subscription. + pub(crate) fn new( + sub: StreamOfResults>>, + client: C, + ext_hash: HashFor, + ) -> Self { + Self { + sub: Some(sub), + client, + ext_hash, + } + } + + /// Return the hash of the extrinsic. + pub fn extrinsic_hash(&self) -> HashFor { + self.ext_hash + } +} + +impl TransactionProgress +where + T: Config, + C: OnlineClientAtBlockT, +{ + /// Return the next transaction status when it's emitted. This just delegates to the + /// [`futures::Stream`] implementation for [`TransactionProgress`], but allows you to + /// avoid importing that trait if you don't otherwise need it. + pub async fn next( + &mut self, + ) -> Option, TransactionProgressError>> { + StreamExt::next(self).await + } + + /// Wait for the transaction to be finalized, and return a [`TransactionInBlock`] + /// instance when it is, or an error if there was a problem waiting for finalization. + /// + /// **Note:** consumes `self`. If you'd like to perform multiple actions as the state of the + /// transaction progresses, use [`TransactionProgress::next()`] instead. + /// + /// **Note:** transaction statuses like `Invalid`/`Usurped`/`Dropped` indicate with some + /// probability that the transaction will not make it into a block but there is no guarantee + /// that this is true. In those cases the stream is closed however, so you currently have no way to find + /// out if they finally made it into a block or not. + pub async fn wait_for_finalized( + mut self, + ) -> Result, TransactionProgressError> { + while let Some(status) = self.next().await { + match status? { + // Finalized! Return. + TransactionStatus::InFinalizedBlock(s) => return Ok(s), + // Error scenarios; return the error. + TransactionStatus::Error { message } => { + return Err(TransactionStatusError::Error(message).into()); + } + TransactionStatus::Invalid { message } => { + return Err(TransactionStatusError::Invalid(message).into()); + } + TransactionStatus::Dropped { message } => { + return Err(TransactionStatusError::Dropped(message).into()); + } + // Ignore and wait for next status event: + _ => continue, + } + } + Err(TransactionProgressError::UnexpectedEndOfTransactionStatusStream) + } + + /// Wait for the transaction to be finalized, and for the transaction events to indicate + /// that the transaction was successful. Returns the events associated with the transaction, + /// as well as a couple of other details (block hash and extrinsic hash). + /// + /// **Note:** consumes self. If you'd like to perform multiple actions as progress is made, + /// use [`TransactionProgress::next()`] instead. + /// + /// **Note:** transaction statuses like `Invalid`/`Usurped`/`Dropped` indicate with some + /// probability that the transaction will not make it into a block but there is no guarantee + /// that this is true. In those cases the stream is closed however, so you currently have no way to find + /// out if they finally made it into a block or not. + pub async fn wait_for_finalized_success( + self, + ) -> Result, TransactionFinalizedSuccessError> { + let evs = self.wait_for_finalized().await?.wait_for_success().await?; + Ok(evs) + } +} + +// TransactionProgress is a stream of transaction events +impl Stream for TransactionProgress { + type Item = Result, TransactionProgressError>; + + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + let sub = match self.sub.as_mut() { + Some(sub) => sub, + None => return Poll::Ready(None), + }; + + sub.poll_next_unpin(cx) + .map_err(TransactionProgressError::CannotGetNextProgressUpdate) + .map_ok(|status| { + match status { + BackendTransactionStatus::Validated => TransactionStatus::Validated, + BackendTransactionStatus::Broadcasted => TransactionStatus::Broadcasted, + BackendTransactionStatus::NoLongerInBestBlock => { + TransactionStatus::NoLongerInBestBlock + } + BackendTransactionStatus::InBestBlock { hash } => { + TransactionStatus::InBestBlock(TransactionInBlock::new( + hash, + self.ext_hash, + self.client.clone(), + )) + } + // These stream events mean that nothing further will be sent: + BackendTransactionStatus::InFinalizedBlock { hash } => { + self.sub = None; + TransactionStatus::InFinalizedBlock(TransactionInBlock::new( + hash, + self.ext_hash, + self.client.clone(), + )) + } + BackendTransactionStatus::Error { message } => { + self.sub = None; + TransactionStatus::Error { message } + } + BackendTransactionStatus::Invalid { message } => { + self.sub = None; + TransactionStatus::Invalid { message } + } + BackendTransactionStatus::Dropped { message } => { + self.sub = None; + TransactionStatus::Dropped { message } + } + } + }) + } +} + +/// Possible transaction statuses returned from our [`TransactionProgress::next()`] call. +#[derive(Debug)] +pub enum TransactionStatus { + /// Transaction is part of the future queue. + Validated, + /// The transaction has been broadcast to other nodes. + Broadcasted, + /// Transaction is no longer in a best block. + NoLongerInBestBlock, + /// Transaction has been included in block with given hash. + InBestBlock(TransactionInBlock), + /// Transaction has been finalized by a finality-gadget, e.g GRANDPA + InFinalizedBlock(TransactionInBlock), + /// Something went wrong in the node. + Error { + /// Human readable message; what went wrong. + message: String, + }, + /// Transaction is invalid (bad nonce, signature etc). + Invalid { + /// Human readable message; why was it invalid. + message: String, + }, + /// The transaction was dropped. + Dropped { + /// Human readable message; why was it dropped. + message: String, + }, +} + +impl TransactionStatus { + /// A convenience method to return the finalized details. Returns + /// [`None`] if the enum variant is not [`TransactionStatus::InFinalizedBlock`]. + pub fn as_finalized(&self) -> Option<&TransactionInBlock> { + match self { + Self::InFinalizedBlock(val) => Some(val), + _ => None, + } + } + + /// A convenience method to return the best block details. Returns + /// [`None`] if the enum variant is not [`TransactionStatus::InBestBlock`]. + pub fn as_in_block(&self) -> Option<&TransactionInBlock> { + match self { + Self::InBestBlock(val) => Some(val), + _ => None, + } + } +} + +/// This struct represents a transaction that has made it into a block. +#[derive(Debug)] +pub struct TransactionInBlock { + block_ref: BlockRef>, + ext_hash: HashFor, + client: C, +} + +impl TransactionInBlock { + pub(crate) fn new(block_ref: BlockRef>, ext_hash: HashFor, client: C) -> Self { + Self { + block_ref, + ext_hash, + client, + } + } + + /// Return the hash of the block that the transaction has made it into. + pub fn block_hash(&self) -> HashFor { + self.block_ref.hash() + } + + /// Return the hash of the extrinsic that was submitted. + pub fn extrinsic_hash(&self) -> HashFor { + self.ext_hash + } +} + +impl> TransactionInBlock { + /// Fetch the events associated with this transaction. If the transaction + /// was successful (ie no `ExtrinsicFailed`) events were found, then we return + /// the events associated with it. If the transaction was not successful, or + /// something else went wrong, we return an error. + /// + /// **Note:** If multiple `ExtrinsicFailed` errors are returned (for instance + /// because a pallet chooses to emit one as an event, which is considered + /// abnormal behaviour), it is not specified which of the errors is returned here. + /// You can use [`TransactionInBlock::fetch_events`] instead if you'd like to + /// work with multiple "error" events. + /// + /// **Note:** This has to download block details from the node and decode events + /// from them. + pub async fn wait_for_success(&self) -> Result, TransactionEventsError> { + let events = self.fetch_events().await?; + + // Try to find any errors; return the first one we encounter. + for (ev_idx, ev) in events.iter().enumerate() { + let ev = ev.map_err(|e| TransactionEventsError::CannotDecodeEventInBlock { + event_index: ev_idx, + block_hash: self.block_hash().into(), + error: e, + })?; + + if ev.pallet_name() == "System" && ev.event_name() == "ExtrinsicFailed" { + let dispatch_error = + DispatchError::decode_from(ev.field_bytes(), self.client.metadata()).map_err( + |e| TransactionEventsError::CannotDecodeDispatchError { + error: e, + bytes: ev.field_bytes().to_vec(), + }, + )?; + return Err(dispatch_error.into()); + } + } + + Ok(events) + } + + /// Fetch all of the events associated with this transaction. This succeeds whether + /// the transaction was a success or not; it's up to you to handle the error and + /// success events however you prefer. + /// + /// **Note:** This has to download block details from the node and decode events + /// from them. + pub async fn fetch_events(&self) -> Result, TransactionEventsError> { + // Create a client at the block the TX made it into: + let tx_block_ref = BlockNumberOrRef::BlockRef(self.block_ref.clone()); + let at_tx_block = self + .client + .client() + .at_block(tx_block_ref) + .await + .map_err(TransactionEventsError::CannotInstantiateClientAtBlock)?; + + let hasher = at_tx_block.client.hasher(); + + let block_body = at_tx_block + .client + .backend() + .block_body(self.block_ref.hash()) + .await + .map_err(|e| TransactionEventsError::CannotFetchBlockBody { + block_hash: self.block_hash().into(), + error: e, + })? + .ok_or_else(|| TransactionEventsError::BlockNotFound { + block_hash: self.block_hash().into(), + })?; + + let extrinsic_index = block_body + .iter() + .position(|ext| { + use crate::config::Hasher; + let hash = hasher.hash(ext); + hash == self.ext_hash + }) + // If we successfully obtain the block hash we think contains our + // extrinsic, the extrinsic should be in there somewhere.. + .ok_or_else(|| TransactionEventsError::CannotFindTransactionInBlock { + block_hash: self.block_hash().into(), + transaction_hash: self.ext_hash.into(), + })?; + + let events = + ExtrinsicEvents::fetch(&at_tx_block.client, self.extrinsic_hash(), extrinsic_index) + .await + .map_err( + |e| TransactionEventsError::CannotFetchEventsForTransaction { + block_hash: self.block_hash().into(), + transaction_hash: self.ext_hash.into(), + error: e, + }, + )?; + + Ok(events) + } +} diff --git a/subxt/src/transactions/validation_result.rs b/subxt/src/transactions/validation_result.rs new file mode 100644 index 00000000000..86defd01cd0 --- /dev/null +++ b/subxt/src/transactions/validation_result.rs @@ -0,0 +1,139 @@ +use crate::error::ExtrinsicError; +use codec::Decode; + +/// The result of performing [`crate::transactions::SubmittableTransaction::validate()`]. +#[derive(Clone, Debug, PartialEq)] +pub enum ValidationResult { + /// The transaction is valid + Valid(TransactionValid), + /// The transaction is invalid + Invalid(TransactionInvalid), + /// Unable to validate the transaction + Unknown(TransactionUnknown), +} + +impl ValidationResult { + /// Is the transaction valid. + pub fn is_valid(&self) -> bool { + matches!(self, ValidationResult::Valid(_)) + } + + #[allow(clippy::get_first)] + pub(crate) fn try_from_bytes(bytes: Vec) -> Result { + // TaggedTransactionQueue_validate_transaction returns this: + // https://github.com/paritytech/substrate/blob/0cdf7029017b70b7c83c21a4dc0aa1020e7914f6/primitives/runtime/src/transaction_validity.rs#L210 + // We copy some of the inner types and put the three states (valid, invalid, unknown) into one enum, + // because from our perspective, the call was successful regardless. + if bytes.get(0) == Some(&0) { + // ok: valid. Decode but, for now we discard most of the information + let res = TransactionValid::decode(&mut &bytes[1..]) + .map_err(ExtrinsicError::CannotDecodeValidationResult)?; + Ok(ValidationResult::Valid(res)) + } else if bytes.get(0) == Some(&1) && bytes.get(1) == Some(&0) { + // error: invalid + let res = TransactionInvalid::decode(&mut &bytes[2..]) + .map_err(ExtrinsicError::CannotDecodeValidationResult)?; + Ok(ValidationResult::Invalid(res)) + } else if bytes.get(0) == Some(&1) && bytes.get(1) == Some(&1) { + // error: unknown + let res = TransactionUnknown::decode(&mut &bytes[2..]) + .map_err(ExtrinsicError::CannotDecodeValidationResult)?; + Ok(ValidationResult::Unknown(res)) + } else { + // unable to decode the bytes; they aren't what we expect. + Err(ExtrinsicError::UnexpectedValidationResultBytes(bytes)) + } + } +} + +/// Transaction is valid; here is some more information about it. +#[derive(Decode, Clone, Debug, PartialEq)] +pub struct TransactionValid { + /// Priority of the transaction. + /// + /// Priority determines the ordering of two transactions that have all + /// their dependencies (required tags) satisfied. + pub priority: u64, + /// Transaction dependencies + /// + /// A non-empty list signifies that some other transactions which provide + /// given tags are required to be included before that one. + pub requires: Vec>, + /// Provided tags + /// + /// A list of tags this transaction provides. Successfully importing the transaction + /// will enable other transactions that depend on (require) those tags to be included as well. + /// Provided and required tags allow Substrate to build a dependency graph of transactions + /// and import them in the right (linear) order. + pub provides: Vec>, + /// Transaction longevity + /// + /// Longevity describes minimum number of blocks the validity is correct. + /// After this period transaction should be removed from the pool or revalidated. + pub longevity: u64, + /// A flag indicating if the transaction should be propagated to other peers. + /// + /// By setting `false` here the transaction will still be considered for + /// including in blocks that are authored on the current node, but will + /// never be sent to other peers. + pub propagate: bool, +} + +/// The runtime was unable to validate the transaction. +#[derive(Decode, Clone, Debug, PartialEq)] +pub enum TransactionUnknown { + /// Could not lookup some information that is required to validate the transaction. + CannotLookup, + /// No validator found for the given unsigned transaction. + NoUnsignedValidator, + /// Any other custom unknown validity that is not covered by this enum. + Custom(u8), +} + +/// The transaction is invalid. +#[derive(Decode, Clone, Debug, PartialEq)] +pub enum TransactionInvalid { + /// The call of the transaction is not expected. + Call, + /// General error to do with the inability to pay some fees (e.g. account balance too low). + Payment, + /// General error to do with the transaction not yet being valid (e.g. nonce too high). + Future, + /// General error to do with the transaction being outdated (e.g. nonce too low). + Stale, + /// General error to do with the transaction's proofs (e.g. signature). + /// + /// # Possible causes + /// + /// When using a signed extension that provides additional data for signing, it is required + /// that the signing and the verifying side use the same additional data. Additional + /// data will only be used to generate the signature, but will not be part of the transaction + /// itself. As the verifying side does not know which additional data was used while signing + /// it will only be able to assume a bad signature and cannot express a more meaningful error. + BadProof, + /// The transaction birth block is ancient. + /// + /// # Possible causes + /// + /// For `FRAME`-based runtimes this would be caused by `current block number` + /// - Era::birth block number > BlockHashCount`. (e.g. in Polkadot `BlockHashCount` = 2400, so + /// a transaction with birth block number 1337 would be valid up until block number 1337 + 2400, + /// after which point the transaction would be considered to have an ancient birth block.) + AncientBirthBlock, + /// The transaction would exhaust the resources of current block. + /// + /// The transaction might be valid, but there are not enough resources + /// left in the current block. + ExhaustsResources, + /// Any other custom invalid validity that is not covered by this enum. + Custom(u8), + /// An transaction with a Mandatory dispatch resulted in Error. This is indicative of either a + /// malicious validator or a buggy `provide_inherent`. In any case, it can result in + /// dangerously overweight blocks and therefore if found, invalidates the block. + BadMandatory, + /// An transaction with a mandatory dispatch tried to be validated. + /// This is invalid; only inherent transactions are allowed to have mandatory dispatches. + MandatoryValidation, + /// The sending address is disabled or known to be invalid. + BadSigner, +} diff --git a/subxt/src/tx/mod.rs b/subxt/src/tx/mod.rs deleted file mode 100644 index f15a027f99f..00000000000 --- a/subxt/src/tx/mod.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Create and submit extrinsics. -//! -//! An extrinsic is submitted with an "signed extra" and "additional" parameters, which can be -//! different for each chain. The trait [`crate::config::ExtrinsicParams`] determines exactly which -//! additional and signed extra parameters are used when constructing an extrinsic, and is a part -//! of the chain configuration (see [`crate::config::Config`]). - -mod tx_client; -mod tx_progress; - -pub use subxt_core::tx::payload::{DefaultPayload, DynamicPayload, Payload, dynamic}; -pub use subxt_core::tx::signer::{self, Signer}; -pub use tx_client::{ - DefaultParams, PartialTransaction, SubmittableTransaction, TransactionInvalid, - TransactionUnknown, TxClient, ValidationResult, -}; -pub use tx_progress::{TxInBlock, TxProgress, TxStatus}; diff --git a/subxt/src/tx/tx_client.rs b/subxt/src/tx/tx_client.rs deleted file mode 100644 index 030846a9986..00000000000 --- a/subxt/src/tx/tx_client.rs +++ /dev/null @@ -1,997 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::{ - backend::{BackendExt, BlockRef, TransactionStatus}, - client::{OfflineClientT, OnlineClientT}, - config::{Config, ExtrinsicParams, HashFor, Header}, - error::{ExtrinsicError, TransactionStatusError}, - tx::{Payload, Signer as SignerT, TxProgress}, - utils::PhantomDataSendSync, -}; -use codec::{Compact, Decode, Encode}; -use derive_where::derive_where; -use futures::future::{TryFutureExt, try_join}; -use subxt_core::tx::TransactionVersion; - -/// A client for working with transactions. -#[derive_where(Clone; Client)] -pub struct TxClient { - client: Client, - _marker: PhantomDataSendSync, -} - -impl TxClient { - /// Create a new [`TxClient`] - pub fn new(client: Client) -> Self { - Self { - client, - _marker: PhantomDataSendSync::new(), - } - } -} - -impl> TxClient { - /// Run the validation logic against some transaction you'd like to submit. Returns `Ok(())` - /// if the call is valid (or if it's not possible to check since the call has no validation hash). - /// Return an error if the call was not valid or something went wrong trying to validate it (ie - /// the pallet or call in question do not exist at all). - pub fn validate(&self, call: &Call) -> Result<(), ExtrinsicError> - where - Call: Payload, - { - subxt_core::tx::validate(call, &self.client.metadata()).map_err(Into::into) - } - - /// Return the SCALE encoded bytes representing the call data of the transaction. - pub fn call_data(&self, call: &Call) -> Result, ExtrinsicError> - where - Call: Payload, - { - subxt_core::tx::call_data(call, &self.client.metadata()).map_err(Into::into) - } - - /// Creates an unsigned transaction without submitting it. Depending on the metadata, we might end - /// up constructing either a v4 or v5 transaction. See [`Self::create_v4_unsigned`] or - /// [`Self::create_v5_bare`] if you'd like to explicitly create an unsigned transaction of a certain version. - pub fn create_unsigned( - &self, - call: &Call, - ) -> Result, ExtrinsicError> - where - Call: Payload, - { - let metadata = self.client.metadata(); - let tx = match subxt_core::tx::suggested_version(&metadata)? { - TransactionVersion::V4 => subxt_core::tx::create_v4_unsigned(call, &metadata), - TransactionVersion::V5 => subxt_core::tx::create_v5_bare(call, &metadata), - }?; - - Ok(SubmittableTransaction { - client: self.client.clone(), - inner: tx, - }) - } - - /// Creates a v4 unsigned (no signature or transaction extensions) transaction without submitting it. - /// - /// Prefer [`Self::create_unsigned()`] if you don't know which version to create; this will pick the - /// most suitable one for the given chain. - pub fn create_v4_unsigned( - &self, - call: &Call, - ) -> Result, ExtrinsicError> - where - Call: Payload, - { - let metadata = self.client.metadata(); - let tx = subxt_core::tx::create_v4_unsigned(call, &metadata)?; - - Ok(SubmittableTransaction { - client: self.client.clone(), - inner: tx, - }) - } - - /// Creates a v5 "bare" (no signature or transaction extensions) transaction without submitting it. - /// - /// Prefer [`Self::create_unsigned()`] if you don't know which version to create; this will pick the - /// most suitable one for the given chain. - pub fn create_v5_bare( - &self, - call: &Call, - ) -> Result, ExtrinsicError> - where - Call: Payload, - { - let metadata = self.client.metadata(); - let tx = subxt_core::tx::create_v5_bare(call, &metadata)?; - - Ok(SubmittableTransaction { - client: self.client.clone(), - inner: tx, - }) - } - - /// Create a partial transaction. Depending on the metadata, we might end up constructing either a v4 or - /// v5 transaction. See [`subxt_core::tx`] if you'd like to manually pick the version to construct - /// - /// Note: if not provided, the default account nonce will be set to 0 and the default mortality will be _immortal_. - /// This is because this method runs offline, and so is unable to fetch the data needed for more appropriate values. - pub fn create_partial_offline( - &self, - call: &Call, - params: >::Params, - ) -> Result, ExtrinsicError> - where - Call: Payload, - { - let metadata = self.client.metadata(); - let tx = match subxt_core::tx::suggested_version(&metadata)? { - TransactionVersion::V4 => PartialTransactionInner::V4( - subxt_core::tx::create_v4_signed(call, &self.client.client_state(), params)?, - ), - TransactionVersion::V5 => PartialTransactionInner::V5( - subxt_core::tx::create_v5_general(call, &self.client.client_state(), params)?, - ), - }; - - Ok(PartialTransaction { - client: self.client.clone(), - inner: tx, - }) - } - - /// Create a v4 partial transaction, ready to sign. - /// - /// Note: if not provided, the default account nonce will be set to 0 and the default mortality will be _immortal_. - /// This is because this method runs offline, and so is unable to fetch the data needed for more appropriate values. - /// - /// Prefer [`Self::create_partial_offline()`] if you don't know which version to create; this will pick the - /// most suitable one for the given chain. - pub fn create_v4_partial_offline( - &self, - call: &Call, - params: >::Params, - ) -> Result, ExtrinsicError> - where - Call: Payload, - { - let tx = PartialTransactionInner::V4(subxt_core::tx::create_v4_signed( - call, - &self.client.client_state(), - params, - )?); - - Ok(PartialTransaction { - client: self.client.clone(), - inner: tx, - }) - } - - /// Create a v5 partial transaction, ready to sign. - /// - /// Note: if not provided, the default account nonce will be set to 0 and the default mortality will be _immortal_. - /// This is because this method runs offline, and so is unable to fetch the data needed for more appropriate values. - /// - /// Prefer [`Self::create_partial_offline()`] if you don't know which version to create; this will pick the - /// most suitable one for the given chain. - pub fn create_v5_partial_offline( - &self, - call: &Call, - params: >::Params, - ) -> Result, ExtrinsicError> - where - Call: Payload, - { - let tx = PartialTransactionInner::V5(subxt_core::tx::create_v5_general( - call, - &self.client.client_state(), - params, - )?); - - Ok(PartialTransaction { - client: self.client.clone(), - inner: tx, - }) - } -} - -impl TxClient -where - T: Config, - C: OnlineClientT, -{ - /// Get the account nonce for a given account ID. - pub async fn account_nonce(&self, account_id: &T::AccountId) -> Result { - let block_ref = self - .client - .backend() - .latest_finalized_block_ref() - .await - .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock)?; - - crate::blocks::get_account_nonce(&self.client, account_id, block_ref.hash()) - .await - .map_err(|e| ExtrinsicError::AccountNonceError { - block_hash: block_ref.hash().into(), - account_id: account_id.encode().into(), - reason: e, - }) - } - - /// Creates a partial transaction, without submitting it. This can then be signed and submitted. - pub async fn create_partial( - &self, - call: &Call, - account_id: &T::AccountId, - mut params: >::Params, - ) -> Result, ExtrinsicError> - where - Call: Payload, - { - inject_account_nonce_and_block(&self.client, account_id, &mut params).await?; - self.create_partial_offline(call, params) - } - - /// Creates a partial V4 transaction, without submitting it. This can then be signed and submitted. - /// - /// Prefer [`Self::create_partial()`] if you don't know which version to create; this will pick the - /// most suitable one for the given chain. - pub async fn create_v4_partial( - &self, - call: &Call, - account_id: &T::AccountId, - mut params: >::Params, - ) -> Result, ExtrinsicError> - where - Call: Payload, - { - inject_account_nonce_and_block(&self.client, account_id, &mut params).await?; - self.create_v4_partial_offline(call, params) - } - - /// Creates a partial V5 transaction, without submitting it. This can then be signed and submitted. - /// - /// Prefer [`Self::create_partial()`] if you don't know which version to create; this will pick the - /// most suitable one for the given chain. - pub async fn create_v5_partial( - &self, - call: &Call, - account_id: &T::AccountId, - mut params: >::Params, - ) -> Result, ExtrinsicError> - where - Call: Payload, - { - inject_account_nonce_and_block(&self.client, account_id, &mut params).await?; - self.create_v5_partial_offline(call, params) - } - - /// Creates a signed transaction, without submitting it. - pub async fn create_signed( - &mut self, - call: &Call, - signer: &Signer, - params: >::Params, - ) -> Result, ExtrinsicError> - where - Call: Payload, - Signer: SignerT, - { - let mut partial = self - .create_partial(call, &signer.account_id(), params) - .await?; - - Ok(partial.sign(signer)) - } - - /// Creates and signs an transaction and submits it to the chain. Passes default parameters - /// to construct the "signed extra" and "additional" payloads needed by the transaction. - /// - /// Returns a [`TxProgress`], which can be used to track the status of the transaction - /// and obtain details about it, once it has made it into a block. - pub async fn sign_and_submit_then_watch_default( - &mut self, - call: &Call, - signer: &Signer, - ) -> Result, ExtrinsicError> - where - Call: Payload, - Signer: SignerT, - >::Params: DefaultParams, - { - self.sign_and_submit_then_watch(call, signer, DefaultParams::default_params()) - .await - } - - /// Creates and signs an transaction and submits it to the chain. - /// - /// Returns a [`TxProgress`], which can be used to track the status of the transaction - /// and obtain details about it, once it has made it into a block. - pub async fn sign_and_submit_then_watch( - &mut self, - call: &Call, - signer: &Signer, - params: >::Params, - ) -> Result, ExtrinsicError> - where - Call: Payload, - Signer: SignerT, - { - self.create_signed(call, signer, params) - .await? - .submit_and_watch() - .await - } - - /// Creates and signs an transaction and submits to the chain for block inclusion. Passes - /// default parameters to construct the "signed extra" and "additional" payloads needed - /// by the transaction. - /// - /// Returns `Ok` with the transaction hash if it is valid transaction. - /// - /// # Note - /// - /// Success does not mean the transaction has been included in the block, just that it is valid - /// and has been included in the transaction pool. - pub async fn sign_and_submit_default( - &mut self, - call: &Call, - signer: &Signer, - ) -> Result, ExtrinsicError> - where - Call: Payload, - Signer: SignerT, - >::Params: DefaultParams, - { - self.sign_and_submit(call, signer, DefaultParams::default_params()) - .await - } - - /// Creates and signs an transaction and submits to the chain for block inclusion. - /// - /// Returns `Ok` with the transaction hash if it is valid transaction. - /// - /// # Note - /// - /// Success does not mean the transaction has been included in the block, just that it is valid - /// and has been included in the transaction pool. - pub async fn sign_and_submit( - &mut self, - call: &Call, - signer: &Signer, - params: >::Params, - ) -> Result, ExtrinsicError> - where - Call: Payload, - Signer: SignerT, - { - self.create_signed(call, signer, params) - .await? - .submit() - .await - } -} - -/// This payload contains the information needed to produce an transaction. -pub struct PartialTransaction { - client: C, - inner: PartialTransactionInner, -} - -enum PartialTransactionInner { - V4(subxt_core::tx::PartialTransactionV4), - V5(subxt_core::tx::PartialTransactionV5), -} - -impl PartialTransaction -where - T: Config, - C: OfflineClientT, -{ - /// Return the signer payload for this transaction. These are the bytes that must - /// be signed in order to produce a valid signature for the transaction. - pub fn signer_payload(&self) -> Vec { - match &self.inner { - PartialTransactionInner::V4(tx) => tx.signer_payload(), - PartialTransactionInner::V5(tx) => tx.signer_payload().to_vec(), - } - } - - /// Return the bytes representing the call data for this partially constructed - /// transaction. - pub fn call_data(&self) -> &[u8] { - match &self.inner { - PartialTransactionInner::V4(tx) => tx.call_data(), - PartialTransactionInner::V5(tx) => tx.call_data(), - } - } - - /// Convert this [`PartialTransaction`] into a [`SubmittableTransaction`], ready to submit. - /// The provided `signer` is responsible for providing the "from" address for the transaction, - /// as well as providing a signature to attach to it. - pub fn sign(&mut self, signer: &Signer) -> SubmittableTransaction - where - Signer: SignerT, - { - let tx = match &mut self.inner { - PartialTransactionInner::V4(tx) => tx.sign(signer), - PartialTransactionInner::V5(tx) => tx.sign(signer), - }; - - SubmittableTransaction { - client: self.client.clone(), - inner: tx, - } - } - - /// Convert this [`PartialTransaction`] into a [`SubmittableTransaction`], ready to submit. - /// An address, and something representing a signature that can be SCALE encoded, are both - /// needed in order to construct it. If you have a `Signer` to hand, you can use - /// [`PartialTransaction::sign()`] instead. - pub fn sign_with_account_and_signature( - &mut self, - account_id: &T::AccountId, - signature: &T::Signature, - ) -> SubmittableTransaction { - let tx = match &mut self.inner { - PartialTransactionInner::V4(tx) => { - tx.sign_with_account_and_signature(account_id.clone(), signature) - } - PartialTransactionInner::V5(tx) => { - tx.sign_with_account_and_signature(account_id, signature) - } - }; - - SubmittableTransaction { - client: self.client.clone(), - inner: tx, - } - } -} - -/// This represents an transaction that has been signed and is ready to submit. -pub struct SubmittableTransaction { - client: C, - inner: subxt_core::tx::Transaction, -} - -impl SubmittableTransaction -where - T: Config, - C: OfflineClientT, -{ - /// Create a [`SubmittableTransaction`] from some already-signed and prepared - /// transaction bytes, and some client (anything implementing [`OfflineClientT`] - /// or [`OnlineClientT`]). - /// - /// Prefer to use [`TxClient`] to create and sign transactions. This is simply - /// exposed in case you want to skip this process and submit something you've - /// already created. - pub fn from_bytes(client: C, tx_bytes: Vec) -> Self { - Self { - client, - inner: subxt_core::tx::Transaction::from_bytes(tx_bytes), - } - } - - /// Calculate and return the hash of the transaction, based on the configured hasher. - pub fn hash(&self) -> HashFor { - self.inner.hash_with(self.client.hasher()) - } - - /// Returns the SCALE encoded transaction bytes. - pub fn encoded(&self) -> &[u8] { - self.inner.encoded() - } - - /// Consumes [`SubmittableTransaction`] and returns the SCALE encoded - /// transaction bytes. - pub fn into_encoded(self) -> Vec { - self.inner.into_encoded() - } -} - -impl SubmittableTransaction -where - T: Config, - C: OnlineClientT, -{ - /// Submits the transaction to the chain. - /// - /// Returns a [`TxProgress`], which can be used to track the status of the transaction - /// and obtain details about it, once it has made it into a block. - pub async fn submit_and_watch(&self) -> Result, ExtrinsicError> { - // Get a hash of the transaction (we'll need this later). - let ext_hash = self.hash(); - - // Submit and watch for transaction progress. - let sub = self - .client - .backend() - .submit_transaction(self.encoded()) - .await - .map_err(ExtrinsicError::ErrorSubmittingTransaction)?; - - Ok(TxProgress::new(sub, self.client.clone(), ext_hash)) - } - - /// Submits the transaction to the chain for block inclusion. - /// - /// It's usually better to call `submit_and_watch` to get an idea of the progress of the - /// submission and whether it's eventually successful or not. This call does not guarantee - /// success, and is just sending the transaction to the chain. - pub async fn submit(&self) -> Result, ExtrinsicError> { - let ext_hash = self.hash(); - let mut sub = self - .client - .backend() - .submit_transaction(self.encoded()) - .await - .map_err(ExtrinsicError::ErrorSubmittingTransaction)?; - - // If we get a bad status or error back straight away then error, else return the hash. - match sub.next().await { - Some(Ok(status)) => match status { - TransactionStatus::Validated - | TransactionStatus::Broadcasted - | TransactionStatus::InBestBlock { .. } - | TransactionStatus::NoLongerInBestBlock - | TransactionStatus::InFinalizedBlock { .. } => Ok(ext_hash), - TransactionStatus::Error { message } => Err( - ExtrinsicError::TransactionStatusError(TransactionStatusError::Error(message)), - ), - TransactionStatus::Invalid { message } => { - Err(ExtrinsicError::TransactionStatusError( - TransactionStatusError::Invalid(message), - )) - } - TransactionStatus::Dropped { message } => { - Err(ExtrinsicError::TransactionStatusError( - TransactionStatusError::Dropped(message), - )) - } - }, - Some(Err(e)) => Err(ExtrinsicError::TransactionStatusStreamError(e)), - None => Err(ExtrinsicError::UnexpectedEndOfTransactionStatusStream), - } - } - - /// Validate a transaction by submitting it to the relevant Runtime API. A transaction that is - /// valid can be added to a block, but may still end up in an error state. - /// - /// Returns `Ok` with a [`ValidationResult`], which is the result of attempting to dry run the transaction. - pub async fn validate(&self) -> Result { - let latest_block_ref = self - .client - .backend() - .latest_finalized_block_ref() - .await - .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock)?; - self.validate_at(latest_block_ref).await - } - - /// Validate a transaction by submitting it to the relevant Runtime API. A transaction that is - /// valid can be added to a block, but may still end up in an error state. - /// - /// Returns `Ok` with a [`ValidationResult`], which is the result of attempting to dry run the transaction. - pub async fn validate_at( - &self, - at: impl Into>>, - ) -> Result { - let block_hash = at.into().hash(); - - // Approach taken from https://github.com/paritytech/json-rpc-interface-spec/issues/55. - let mut params = Vec::with_capacity(8 + self.encoded().len() + 8); - 2u8.encode_to(&mut params); - params.extend(self.encoded().iter()); - block_hash.encode_to(&mut params); - - let res: Vec = self - .client - .backend() - .call( - "TaggedTransactionQueue_validate_transaction", - Some(¶ms), - block_hash, - ) - .await - .map_err(ExtrinsicError::CannotGetValidationInfo)?; - - ValidationResult::try_from_bytes(res) - } - - /// This returns an estimate for what the transaction is expected to cost to execute, less any tips. - /// The actual amount paid can vary from block to block based on node traffic and other factors. - pub async fn partial_fee_estimate(&self) -> Result { - let mut params = self.encoded().to_vec(); - (self.encoded().len() as u32).encode_to(&mut params); - let latest_block_ref = self - .client - .backend() - .latest_finalized_block_ref() - .await - .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock)?; - - // destructuring RuntimeDispatchInfo, see type information - // data layout: {weight_ref_time: Compact, weight_proof_size: Compact, class: u8, partial_fee: u128} - let (_, _, _, partial_fee) = self - .client - .backend() - .call_decoding::<(Compact, Compact, u8, u128)>( - "TransactionPaymentApi_query_info", - Some(¶ms), - latest_block_ref.hash(), - ) - .await - .map_err(ExtrinsicError::CannotGetFeeInfo)?; - - Ok(partial_fee) - } -} - -/// Fetch the latest block header and account nonce from the backend and use them to refine [`ExtrinsicParams::Params`]. -async fn inject_account_nonce_and_block>( - client: &Client, - account_id: &T::AccountId, - params: &mut >::Params, -) -> Result<(), ExtrinsicError> { - use subxt_core::config::transaction_extensions::Params; - - let block_ref = client - .backend() - .latest_finalized_block_ref() - .await - .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock)?; - - let (block_header, account_nonce) = try_join( - client - .backend() - .block_header(block_ref.hash()) - .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock), - crate::blocks::get_account_nonce(client, account_id, block_ref.hash()).map_err(|e| { - ExtrinsicError::AccountNonceError { - block_hash: block_ref.hash().into(), - account_id: account_id.encode().into(), - reason: e, - } - }), - ) - .await?; - - let block_header = block_header.ok_or_else(|| ExtrinsicError::CannotFindBlockHeader { - block_hash: block_ref.hash().into(), - })?; - - params.inject_account_nonce(account_nonce); - params.inject_block(block_header.number().into(), block_ref.hash()); - - Ok(()) -} - -impl ValidationResult { - #[allow(clippy::get_first)] - fn try_from_bytes(bytes: Vec) -> Result { - // TaggedTransactionQueue_validate_transaction returns this: - // https://github.com/paritytech/substrate/blob/0cdf7029017b70b7c83c21a4dc0aa1020e7914f6/primitives/runtime/src/transaction_validity.rs#L210 - // We copy some of the inner types and put the three states (valid, invalid, unknown) into one enum, - // because from our perspective, the call was successful regardless. - if bytes.get(0) == Some(&0) { - // ok: valid. Decode but, for now we discard most of the information - let res = TransactionValid::decode(&mut &bytes[1..]) - .map_err(ExtrinsicError::CannotDecodeValidationResult)?; - Ok(ValidationResult::Valid(res)) - } else if bytes.get(0) == Some(&1) && bytes.get(1) == Some(&0) { - // error: invalid - let res = TransactionInvalid::decode(&mut &bytes[2..]) - .map_err(ExtrinsicError::CannotDecodeValidationResult)?; - Ok(ValidationResult::Invalid(res)) - } else if bytes.get(0) == Some(&1) && bytes.get(1) == Some(&1) { - // error: unknown - let res = TransactionUnknown::decode(&mut &bytes[2..]) - .map_err(ExtrinsicError::CannotDecodeValidationResult)?; - Ok(ValidationResult::Unknown(res)) - } else { - // unable to decode the bytes; they aren't what we expect. - Err(ExtrinsicError::UnexpectedValidationResultBytes(bytes)) - } - } -} - -/// The result of performing [`SubmittableTransaction::validate()`]. -#[derive(Clone, Debug, PartialEq)] -pub enum ValidationResult { - /// The transaction is valid - Valid(TransactionValid), - /// The transaction is invalid - Invalid(TransactionInvalid), - /// Unable to validate the transaction - Unknown(TransactionUnknown), -} - -impl ValidationResult { - /// Is the transaction valid. - pub fn is_valid(&self) -> bool { - matches!(self, ValidationResult::Valid(_)) - } -} - -/// Transaction is valid; here is some more information about it. -#[derive(Decode, Clone, Debug, PartialEq)] -pub struct TransactionValid { - /// Priority of the transaction. - /// - /// Priority determines the ordering of two transactions that have all - /// their dependencies (required tags) satisfied. - pub priority: u64, - /// Transaction dependencies - /// - /// A non-empty list signifies that some other transactions which provide - /// given tags are required to be included before that one. - pub requires: Vec>, - /// Provided tags - /// - /// A list of tags this transaction provides. Successfully importing the transaction - /// will enable other transactions that depend on (require) those tags to be included as well. - /// Provided and required tags allow Substrate to build a dependency graph of transactions - /// and import them in the right (linear) order. - pub provides: Vec>, - /// Transaction longevity - /// - /// Longevity describes minimum number of blocks the validity is correct. - /// After this period transaction should be removed from the pool or revalidated. - pub longevity: u64, - /// A flag indicating if the transaction should be propagated to other peers. - /// - /// By setting `false` here the transaction will still be considered for - /// including in blocks that are authored on the current node, but will - /// never be sent to other peers. - pub propagate: bool, -} - -/// The runtime was unable to validate the transaction. -#[derive(Decode, Clone, Debug, PartialEq)] -pub enum TransactionUnknown { - /// Could not lookup some information that is required to validate the transaction. - CannotLookup, - /// No validator found for the given unsigned transaction. - NoUnsignedValidator, - /// Any other custom unknown validity that is not covered by this enum. - Custom(u8), -} - -/// The transaction is invalid. -#[derive(Decode, Clone, Debug, PartialEq)] -pub enum TransactionInvalid { - /// The call of the transaction is not expected. - Call, - /// General error to do with the inability to pay some fees (e.g. account balance too low). - Payment, - /// General error to do with the transaction not yet being valid (e.g. nonce too high). - Future, - /// General error to do with the transaction being outdated (e.g. nonce too low). - Stale, - /// General error to do with the transaction's proofs (e.g. signature). - /// - /// # Possible causes - /// - /// When using a signed extension that provides additional data for signing, it is required - /// that the signing and the verifying side use the same additional data. Additional - /// data will only be used to generate the signature, but will not be part of the transaction - /// itself. As the verifying side does not know which additional data was used while signing - /// it will only be able to assume a bad signature and cannot express a more meaningful error. - BadProof, - /// The transaction birth block is ancient. - /// - /// # Possible causes - /// - /// For `FRAME`-based runtimes this would be caused by `current block number` - /// - Era::birth block number > BlockHashCount`. (e.g. in Polkadot `BlockHashCount` = 2400, so - /// a transaction with birth block number 1337 would be valid up until block number 1337 + 2400, - /// after which point the transaction would be considered to have an ancient birth block.) - AncientBirthBlock, - /// The transaction would exhaust the resources of current block. - /// - /// The transaction might be valid, but there are not enough resources - /// left in the current block. - ExhaustsResources, - /// Any other custom invalid validity that is not covered by this enum. - Custom(u8), - /// An transaction with a Mandatory dispatch resulted in Error. This is indicative of either a - /// malicious validator or a buggy `provide_inherent`. In any case, it can result in - /// dangerously overweight blocks and therefore if found, invalidates the block. - BadMandatory, - /// An transaction with a mandatory dispatch tried to be validated. - /// This is invalid; only inherent transactions are allowed to have mandatory dispatches. - MandatoryValidation, - /// The sending address is disabled or known to be invalid. - BadSigner, -} - -/// This trait is used to create default values for extrinsic params. We use this instead of -/// [`Default`] because we want to be able to support params which are tuples of more than 12 -/// entries (which is the maximum tuple size Rust currently implements [`Default`] for on tuples), -/// given that we aren't far off having more than 12 transaction extensions already. -/// -/// If you have params which are _not_ a tuple and which you'd like to be instantiated automatically -/// when calling [`TxClient::sign_and_submit_default()`] or [`TxClient::sign_and_submit_then_watch_default()`], -/// then you'll need to implement this trait for them. -pub trait DefaultParams: Sized { - /// Instantiate a default instance of the parameters. - fn default_params() -> Self; -} - -impl DefaultParams for [P; N] { - fn default_params() -> Self { - core::array::from_fn(|_| P::default()) - } -} - -macro_rules! impl_default_params_for_tuple { - ($($ident:ident),+) => { - impl <$($ident : Default),+> DefaultParams for ($($ident,)+){ - fn default_params() -> Self { - ( - $($ident::default(),)+ - ) - } - } - } -} - -#[rustfmt::skip] -const _: () = { - impl_default_params_for_tuple!(A); - impl_default_params_for_tuple!(A, B); - impl_default_params_for_tuple!(A, B, C); - impl_default_params_for_tuple!(A, B, C, D); - impl_default_params_for_tuple!(A, B, C, D, E); - impl_default_params_for_tuple!(A, B, C, D, E, F); - impl_default_params_for_tuple!(A, B, C, D, E, F, G); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y); - impl_default_params_for_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z); -}; - -#[cfg(test)] -mod test { - use super::*; - - #[test] - fn transaction_validity_decoding_empty_bytes() { - // No panic should occur decoding empty bytes. - let decoded = ValidationResult::try_from_bytes(vec![]); - assert!(decoded.is_err()) - } - - #[test] - fn transaction_validity_decoding_is_ok() { - use sp_runtime::transaction_validity as sp; - use sp_runtime::transaction_validity::TransactionValidity as T; - - let pairs = vec![ - ( - T::Ok(sp::ValidTransaction { - ..Default::default() - }), - ValidationResult::Valid(TransactionValid { - // By default, tx is immortal - longevity: u64::MAX, - // Default is true - propagate: true, - priority: 0, - provides: vec![], - requires: vec![], - }), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::BadProof, - )), - ValidationResult::Invalid(TransactionInvalid::BadProof), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::Call, - )), - ValidationResult::Invalid(TransactionInvalid::Call), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::Payment, - )), - ValidationResult::Invalid(TransactionInvalid::Payment), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::Future, - )), - ValidationResult::Invalid(TransactionInvalid::Future), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::Stale, - )), - ValidationResult::Invalid(TransactionInvalid::Stale), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::AncientBirthBlock, - )), - ValidationResult::Invalid(TransactionInvalid::AncientBirthBlock), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::ExhaustsResources, - )), - ValidationResult::Invalid(TransactionInvalid::ExhaustsResources), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::BadMandatory, - )), - ValidationResult::Invalid(TransactionInvalid::BadMandatory), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::MandatoryValidation, - )), - ValidationResult::Invalid(TransactionInvalid::MandatoryValidation), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::BadSigner, - )), - ValidationResult::Invalid(TransactionInvalid::BadSigner), - ), - ( - T::Err(sp::TransactionValidityError::Invalid( - sp::InvalidTransaction::Custom(123), - )), - ValidationResult::Invalid(TransactionInvalid::Custom(123)), - ), - ( - T::Err(sp::TransactionValidityError::Unknown( - sp::UnknownTransaction::CannotLookup, - )), - ValidationResult::Unknown(TransactionUnknown::CannotLookup), - ), - ( - T::Err(sp::TransactionValidityError::Unknown( - sp::UnknownTransaction::NoUnsignedValidator, - )), - ValidationResult::Unknown(TransactionUnknown::NoUnsignedValidator), - ), - ( - T::Err(sp::TransactionValidityError::Unknown( - sp::UnknownTransaction::Custom(123), - )), - ValidationResult::Unknown(TransactionUnknown::Custom(123)), - ), - ]; - - for (sp, validation_result) in pairs { - let encoded = sp.encode(); - let decoded = ValidationResult::try_from_bytes(encoded).expect("should decode OK"); - assert_eq!(decoded, validation_result); - } - } -} diff --git a/subxt/src/tx/tx_progress.rs b/subxt/src/tx/tx_progress.rs deleted file mode 100644 index 83126dcd3e2..00000000000 --- a/subxt/src/tx/tx_progress.rs +++ /dev/null @@ -1,465 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Types representing extrinsics/transactions that have been submitted to a node. - -use std::task::Poll; - -use crate::{ - backend::{BlockRef, StreamOfResults, TransactionStatus as BackendTxStatus}, - client::OnlineClientT, - config::{Config, HashFor}, - error::{ - DispatchError, TransactionEventsError, TransactionFinalizedSuccessError, - TransactionProgressError, TransactionStatusError, - }, - events::EventsClient, - utils::strip_compact_prefix, -}; -use derive_where::derive_where; -use futures::{Stream, StreamExt}; - -/// This struct represents a subscription to the progress of some transaction. -pub struct TxProgress { - sub: Option>>>, - ext_hash: HashFor, - client: C, -} - -impl std::fmt::Debug for TxProgress { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("TxProgress") - .field("sub", &"") - .field("ext_hash", &self.ext_hash) - .field("client", &"") - .finish() - } -} - -// 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 Unpin for TxProgress {} - -impl TxProgress { - /// Instantiate a new [`TxProgress`] from a custom subscription. - pub fn new( - sub: StreamOfResults>>, - client: C, - ext_hash: HashFor, - ) -> Self { - Self { - sub: Some(sub), - client, - ext_hash, - } - } - - /// Return the hash of the extrinsic. - pub fn extrinsic_hash(&self) -> HashFor { - self.ext_hash - } -} - -impl TxProgress -where - T: Config, - C: OnlineClientT, -{ - /// Return the next transaction status when it's emitted. This just delegates to the - /// [`futures::Stream`] implementation for [`TxProgress`], but allows you to - /// avoid importing that trait if you don't otherwise need it. - pub async fn next(&mut self) -> Option, TransactionProgressError>> { - StreamExt::next(self).await - } - - /// Wait for the transaction to be finalized, and return a [`TxInBlock`] - /// instance when it is, or an error if there was a problem waiting for finalization. - /// - /// **Note:** consumes `self`. If you'd like to perform multiple actions as the state of the - /// transaction progresses, use [`TxProgress::next()`] instead. - /// - /// **Note:** transaction statuses like `Invalid`/`Usurped`/`Dropped` indicate with some - /// probability that the transaction will not make it into a block but there is no guarantee - /// that this is true. In those cases the stream is closed however, so you currently have no way to find - /// out if they finally made it into a block or not. - pub async fn wait_for_finalized(mut self) -> Result, TransactionProgressError> { - while let Some(status) = self.next().await { - match status? { - // Finalized! Return. - TxStatus::InFinalizedBlock(s) => return Ok(s), - // Error scenarios; return the error. - TxStatus::Error { message } => { - return Err(TransactionStatusError::Error(message).into()); - } - TxStatus::Invalid { message } => { - return Err(TransactionStatusError::Invalid(message).into()); - } - TxStatus::Dropped { message } => { - return Err(TransactionStatusError::Dropped(message).into()); - } - // Ignore and wait for next status event: - _ => continue, - } - } - Err(TransactionProgressError::UnexpectedEndOfTransactionStatusStream) - } - - /// Wait for the transaction to be finalized, and for the transaction events to indicate - /// that the transaction was successful. Returns the events associated with the transaction, - /// as well as a couple of other details (block hash and extrinsic hash). - /// - /// **Note:** consumes self. If you'd like to perform multiple actions as progress is made, - /// use [`TxProgress::next()`] instead. - /// - /// **Note:** transaction statuses like `Invalid`/`Usurped`/`Dropped` indicate with some - /// probability that the transaction will not make it into a block but there is no guarantee - /// that this is true. In those cases the stream is closed however, so you currently have no way to find - /// out if they finally made it into a block or not. - pub async fn wait_for_finalized_success( - self, - ) -> Result, TransactionFinalizedSuccessError> { - let evs = self.wait_for_finalized().await?.wait_for_success().await?; - Ok(evs) - } -} - -impl Stream for TxProgress { - type Item = Result, TransactionProgressError>; - - fn poll_next( - mut self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - let sub = match self.sub.as_mut() { - Some(sub) => sub, - None => return Poll::Ready(None), - }; - - sub.poll_next_unpin(cx) - .map_err(TransactionProgressError::CannotGetNextProgressUpdate) - .map_ok(|status| { - match status { - BackendTxStatus::Validated => TxStatus::Validated, - BackendTxStatus::Broadcasted => TxStatus::Broadcasted, - BackendTxStatus::NoLongerInBestBlock => TxStatus::NoLongerInBestBlock, - BackendTxStatus::InBestBlock { hash } => TxStatus::InBestBlock(TxInBlock::new( - hash, - self.ext_hash, - self.client.clone(), - )), - // These stream events mean that nothing further will be sent: - BackendTxStatus::InFinalizedBlock { hash } => { - self.sub = None; - TxStatus::InFinalizedBlock(TxInBlock::new( - hash, - self.ext_hash, - self.client.clone(), - )) - } - BackendTxStatus::Error { message } => { - self.sub = None; - TxStatus::Error { message } - } - BackendTxStatus::Invalid { message } => { - self.sub = None; - TxStatus::Invalid { message } - } - BackendTxStatus::Dropped { message } => { - self.sub = None; - TxStatus::Dropped { message } - } - } - }) - } -} - -/// Possible transaction statuses returned from our [`TxProgress::next()`] call. -#[derive_where(Debug; C)] -pub enum TxStatus { - /// Transaction is part of the future queue. - Validated, - /// The transaction has been broadcast to other nodes. - Broadcasted, - /// Transaction is no longer in a best block. - NoLongerInBestBlock, - /// Transaction has been included in block with given hash. - InBestBlock(TxInBlock), - /// Transaction has been finalized by a finality-gadget, e.g GRANDPA - InFinalizedBlock(TxInBlock), - /// Something went wrong in the node. - Error { - /// Human readable message; what went wrong. - message: String, - }, - /// Transaction is invalid (bad nonce, signature etc). - Invalid { - /// Human readable message; why was it invalid. - message: String, - }, - /// The transaction was dropped. - Dropped { - /// Human readable message; why was it dropped. - message: String, - }, -} - -impl TxStatus { - /// A convenience method to return the finalized details. Returns - /// [`None`] if the enum variant is not [`TxStatus::InFinalizedBlock`]. - pub fn as_finalized(&self) -> Option<&TxInBlock> { - match self { - Self::InFinalizedBlock(val) => Some(val), - _ => None, - } - } - - /// A convenience method to return the best block details. Returns - /// [`None`] if the enum variant is not [`TxStatus::InBestBlock`]. - pub fn as_in_block(&self) -> Option<&TxInBlock> { - match self { - Self::InBestBlock(val) => Some(val), - _ => None, - } - } -} - -/// This struct represents a transaction that has made it into a block. -#[derive_where(Debug; C)] -pub struct TxInBlock { - block_ref: BlockRef>, - ext_hash: HashFor, - client: C, -} - -impl TxInBlock { - pub(crate) fn new(block_ref: BlockRef>, ext_hash: HashFor, client: C) -> Self { - Self { - block_ref, - ext_hash, - client, - } - } - - /// Return the hash of the block that the transaction has made it into. - pub fn block_hash(&self) -> HashFor { - self.block_ref.hash() - } - - /// Return the hash of the extrinsic that was submitted. - pub fn extrinsic_hash(&self) -> HashFor { - self.ext_hash - } -} - -impl> TxInBlock { - /// Fetch the events associated with this transaction. If the transaction - /// was successful (ie no `ExtrinsicFailed`) events were found, then we return - /// the events associated with it. If the transaction was not successful, or - /// something else went wrong, we return an error. - /// - /// **Note:** If multiple `ExtrinsicFailed` errors are returned (for instance - /// because a pallet chooses to emit one as an event, which is considered - /// abnormal behaviour), it is not specified which of the errors is returned here. - /// You can use [`TxInBlock::fetch_events`] instead if you'd like to - /// work with multiple "error" events. - /// - /// **Note:** This has to download block details from the node and decode events - /// from them. - pub async fn wait_for_success( - &self, - ) -> Result, TransactionEventsError> { - let events = self.fetch_events().await?; - - // Try to find any errors; return the first one we encounter. - for (ev_idx, ev) in events.iter().enumerate() { - let ev = ev.map_err(|e| TransactionEventsError::CannotDecodeEventInBlock { - event_index: ev_idx, - block_hash: self.block_hash().into(), - error: e, - })?; - - if ev.pallet_name() == "System" && ev.variant_name() == "ExtrinsicFailed" { - let dispatch_error = - DispatchError::decode_from(ev.field_bytes(), self.client.metadata()).map_err( - |e| TransactionEventsError::CannotDecodeDispatchError { - error: e, - bytes: ev.field_bytes().to_vec(), - }, - )?; - return Err(dispatch_error.into()); - } - } - - Ok(events) - } - - /// Fetch all of the events associated with this transaction. This succeeds whether - /// the transaction was a success or not; it's up to you to handle the error and - /// success events however you prefer. - /// - /// **Note:** This has to download block details from the node and decode events - /// from them. - pub async fn fetch_events( - &self, - ) -> Result, TransactionEventsError> { - let hasher = self.client.hasher(); - - let block_body = self - .client - .backend() - .block_body(self.block_ref.hash()) - .await - .map_err(|e| TransactionEventsError::CannotFetchBlockBody { - block_hash: self.block_hash().into(), - error: e, - })? - .ok_or_else(|| TransactionEventsError::BlockNotFound { - block_hash: self.block_hash().into(), - })?; - - let extrinsic_idx = block_body - .iter() - .position(|ext| { - use crate::config::Hasher; - let Ok((_, stripped)) = strip_compact_prefix(ext) else { - return false; - }; - let hash = hasher.hash_of(&stripped); - hash == self.ext_hash - }) - // If we successfully obtain the block hash we think contains our - // extrinsic, the extrinsic should be in there somewhere.. - .ok_or_else(|| TransactionEventsError::CannotFindTransactionInBlock { - block_hash: self.block_hash().into(), - transaction_hash: self.ext_hash.into(), - })?; - - let events = EventsClient::new(self.client.clone()) - .at(self.block_ref.clone()) - .await - .map_err( - |e| TransactionEventsError::CannotFetchEventsForTransaction { - block_hash: self.block_hash().into(), - transaction_hash: self.ext_hash.into(), - error: e, - }, - )?; - - Ok(crate::blocks::ExtrinsicEvents::new( - self.ext_hash, - extrinsic_idx as u32, - events, - )) - } -} - -#[cfg(test)] -mod test { - use super::*; - use subxt_core::client::RuntimeVersion; - - use crate::{ - SubstrateConfig, - backend::{StreamOfResults, TransactionStatus}, - client::{OfflineClientT, OnlineClientT}, - config::{Config, HashFor}, - tx::TxProgress, - }; - - type MockTxProgress = TxProgress; - type MockHash = HashFor; - type MockSubstrateTxStatus = TransactionStatus; - - /// a mock client to satisfy trait bounds in tests - #[derive(Clone, Debug)] - struct MockClient; - - impl OfflineClientT for MockClient { - fn metadata(&self) -> crate::Metadata { - unimplemented!("just a mock impl to satisfy trait bounds") - } - - fn genesis_hash(&self) -> MockHash { - unimplemented!("just a mock impl to satisfy trait bounds") - } - - fn runtime_version(&self) -> RuntimeVersion { - unimplemented!("just a mock impl to satisfy trait bounds") - } - - fn hasher(&self) -> ::Hasher { - unimplemented!("just a mock impl to satisfy trait bounds") - } - - fn client_state(&self) -> subxt_core::client::ClientState { - unimplemented!("just a mock impl to satisfy trait bounds") - } - } - - impl OnlineClientT for MockClient { - fn backend(&self) -> &dyn crate::backend::Backend { - unimplemented!("just a mock impl to satisfy trait bounds") - } - } - - #[tokio::test] - async fn wait_for_finalized_returns_err_when_error() { - let tx_progress = mock_tx_progress(vec![ - MockSubstrateTxStatus::Broadcasted, - MockSubstrateTxStatus::Error { - message: "err".into(), - }, - ]); - let finalized_result = tx_progress.wait_for_finalized().await; - assert!(matches!( - finalized_result, - Err(TransactionProgressError::TransactionStatusError(TransactionStatusError::Error(e))) if e == "err" - )); - } - - #[tokio::test] - async fn wait_for_finalized_returns_err_when_invalid() { - let tx_progress = mock_tx_progress(vec![ - MockSubstrateTxStatus::Broadcasted, - MockSubstrateTxStatus::Invalid { - message: "err".into(), - }, - ]); - let finalized_result = tx_progress.wait_for_finalized().await; - assert!(matches!( - finalized_result, - Err(TransactionProgressError::TransactionStatusError(TransactionStatusError::Invalid(e))) if e == "err" - )); - } - - #[tokio::test] - async fn wait_for_finalized_returns_err_when_dropped() { - let tx_progress = mock_tx_progress(vec![ - MockSubstrateTxStatus::Broadcasted, - MockSubstrateTxStatus::Dropped { - message: "err".into(), - }, - ]); - let finalized_result = tx_progress.wait_for_finalized().await; - assert!(matches!( - finalized_result, - Err(TransactionProgressError::TransactionStatusError(TransactionStatusError::Dropped(e))) if e == "err" - )); - } - - fn mock_tx_progress(statuses: Vec) -> MockTxProgress { - let sub = create_substrate_tx_status_subscription(statuses); - TxProgress::new(sub, MockClient, Default::default()) - } - - fn create_substrate_tx_status_subscription( - elements: Vec, - ) -> StreamOfResults { - let results = elements.into_iter().map(Ok); - let stream = Box::pin(futures::stream::iter(results)); - let sub: StreamOfResults = StreamOfResults::new(stream); - sub - } -} diff --git a/core/src/utils/mod.rs b/subxt/src/utils.rs similarity index 87% rename from core/src/utils/mod.rs rename to subxt/src/utils.rs index e739f9f6c0f..6194e7df4d0 100644 --- a/core/src/utils/mod.rs +++ b/subxt/src/utils.rs @@ -4,35 +4,40 @@ //! Miscellaneous utility helpers. -mod account_id; mod account_id20; -pub mod bits; mod era; +#[cfg(feature = "jsonrpsee")] +mod fetch_chain_spec; mod multi_address; mod multi_signature; +mod range_map; mod static_type; mod unchecked_extrinsic; mod wrapper_opaque; mod yesnomaybe; -use alloc::borrow::ToOwned; -use alloc::format; -use alloc::string::String; -use alloc::vec::Vec; +pub mod bits; + use codec::{Compact, Decode, Encode}; use derive_where::derive_where; -pub use account_id::AccountId32; pub use account_id20::AccountId20; pub use era::Era; pub use multi_address::MultiAddress; pub use multi_signature::MultiSignature; pub use primitive_types::{H160, H256, H512}; +pub use range_map::{RangeMap, RangeMapBuilder, RangeMapError}; pub use static_type::Static; pub use unchecked_extrinsic::UncheckedExtrinsic; pub use wrapper_opaque::WrapperKeepOpaque; pub use yesnomaybe::{Maybe, No, NoMaybe, Yes, YesMaybe, YesNo}; +pub use subxt_utils_accountid32::AccountId32; + +// Lightclient helper to fetch chain spec from a running node. +#[cfg(feature = "jsonrpsee")] +pub use fetch_chain_spec::{FetchChainspecError, fetch_chainspec_from_rpc_node}; + /// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of /// the transaction payload #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] diff --git a/core/src/utils/account_id20.rs b/subxt/src/utils/account_id20.rs similarity index 98% rename from core/src/utils/account_id20.rs rename to subxt/src/utils/account_id20.rs index 136e217a519..997a1d6a750 100644 --- a/core/src/utils/account_id20.rs +++ b/subxt/src/utils/account_id20.rs @@ -4,16 +4,14 @@ //! `AccountId20` is a representation of Ethereum address derived from hashing the public key. -use alloc::format; -use alloc::string::String; use codec::{Decode, Encode}; use keccak_hash::keccak; use serde::{Deserialize, Serialize}; use thiserror::Error as DeriveError; #[derive( - Copy, Clone, + Copy, Eq, PartialEq, Ord, diff --git a/core/src/utils/bits.rs b/subxt/src/utils/bits.rs similarity index 99% rename from core/src/utils/bits.rs rename to subxt/src/utils/bits.rs index 93ba0f4af3d..5b5ba9226c0 100644 --- a/core/src/utils/bits.rs +++ b/subxt/src/utils/bits.rs @@ -4,8 +4,6 @@ //! Generic `scale_bits` over `bitvec`-like `BitOrder` and `BitFormat` types. -use alloc::vec; -use alloc::vec::Vec; use codec::{Compact, Input}; use core::marker::PhantomData; use scale_bits::{ diff --git a/core/src/utils/era.rs b/subxt/src/utils/era.rs similarity index 99% rename from core/src/utils/era.rs rename to subxt/src/utils/era.rs index 43875fcdab8..a6e92edbb89 100644 --- a/core/src/utils/era.rs +++ b/subxt/src/utils/era.rs @@ -2,7 +2,6 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use alloc::{format, vec::Vec}; use codec::{Decode, Encode}; use scale_decode::{ IntoVisitor, TypeResolver, Visitor, diff --git a/subxt/src/utils/fetch_chain_spec.rs b/subxt/src/utils/fetch_chain_spec.rs index b2881276c36..488e324b38c 100644 --- a/subxt/src/utils/fetch_chain_spec.rs +++ b/subxt/src/utils/fetch_chain_spec.rs @@ -2,7 +2,6 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use crate::macros::{cfg_jsonrpsee_native, cfg_jsonrpsee_web}; use serde_json::value::RawValue; /// Possible errors encountered trying to fetch a chain spec from an RPC node. @@ -54,60 +53,58 @@ pub async fn fetch_chainspec_from_rpc_node( Ok(result) } -cfg_jsonrpsee_native! { - mod jsonrpsee_helpers { - use super::FetchChainspecError; - use tokio_util::compat::Compat; +#[cfg(all(feature = "jsonrpsee", feature = "native"))] +mod jsonrpsee_helpers { + use super::FetchChainspecError; + use tokio_util::compat::Compat; - pub use jsonrpsee::{ - client_transport::ws::{self, EitherStream, Url, WsTransportClientBuilder}, - core::client::Client, - }; + pub use jsonrpsee::{ + client_transport::ws::{self, EitherStream, Url, WsTransportClientBuilder}, + core::client::Client, + }; - pub type Sender = ws::Sender>; - pub type Receiver = ws::Receiver>; + pub type Sender = ws::Sender>; + pub type Receiver = ws::Receiver>; - /// Build WS RPC client from URL - pub async fn client(url: &str) -> Result { - let url = Url::parse(url).map_err(|_| FetchChainspecError::InvalidUrl)?; + /// Build WS RPC client from URL + pub async fn client(url: &str) -> Result { + let url = Url::parse(url).map_err(|_| FetchChainspecError::InvalidUrl)?; - if url.scheme() != "ws" && url.scheme() != "wss" { - return Err(FetchChainspecError::InvalidScheme); - } + if url.scheme() != "ws" && url.scheme() != "wss" { + return Err(FetchChainspecError::InvalidScheme); + } - let (sender, receiver) = ws_transport(url).await?; + let (sender, receiver) = ws_transport(url).await?; - Ok(Client::builder() - .max_buffer_capacity_per_subscription(4096) - .build_with_tokio(sender, receiver)) - } + Ok(Client::builder() + .max_buffer_capacity_per_subscription(4096) + .build_with_tokio(sender, receiver)) + } - async fn ws_transport(url: Url) -> Result<(Sender, Receiver), FetchChainspecError> { - WsTransportClientBuilder::default() - .build(url) - .await - .map_err(|_| FetchChainspecError::HandshakeError) - } - } + async fn ws_transport(url: Url) -> Result<(Sender, Receiver), FetchChainspecError> { + WsTransportClientBuilder::default() + .build(url) + .await + .map_err(|_| FetchChainspecError::HandshakeError) + } } -cfg_jsonrpsee_web! { - mod jsonrpsee_helpers { - use super::FetchChainspecError; - pub use jsonrpsee::{ - client_transport::web, - core::client::{Client, ClientBuilder}, - }; - - /// Build web RPC client from URL - pub async fn client(url: &str) -> Result { - let (sender, receiver) = web::connect(url) - .await - .map_err(|_| FetchChainspecError::HandshakeError)?; - - Ok(ClientBuilder::default() - .max_buffer_capacity_per_subscription(4096) - .build_with_wasm(sender, receiver)) - } +#[cfg(all(feature = "jsonrpsee", feature = "web"))] +mod jsonrpsee_helpers { + use super::FetchChainspecError; + pub use jsonrpsee::{ + client_transport::web, + core::client::{Client, ClientBuilder}, + }; + + /// Build web RPC client from URL + pub async fn client(url: &str) -> Result { + let (sender, receiver) = web::connect(url) + .await + .map_err(|_| FetchChainspecError::HandshakeError)?; + + Ok(ClientBuilder::default() + .max_buffer_capacity_per_subscription(4096) + .build_with_wasm(sender, receiver)) } } diff --git a/subxt/src/utils/mod.rs b/subxt/src/utils/mod.rs deleted file mode 100644 index 8d8893361db..00000000000 --- a/subxt/src/utils/mod.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Miscellaneous utility helpers. - -use crate::macros::cfg_jsonrpsee; - -pub use subxt_core::utils::{ - AccountId32, Encoded, Era, H160, H256, H512, KeyedVec, MultiAddress, MultiSignature, - PhantomDataSendSync, Static, UncheckedExtrinsic, WrapperKeepOpaque, Yes, bits, - strip_compact_prefix, to_hex, -}; - -pub use subxt_rpcs::utils::url_is_secure; - -cfg_jsonrpsee! { - mod fetch_chain_spec; - pub use fetch_chain_spec::{fetch_chainspec_from_rpc_node, FetchChainspecError}; -} diff --git a/core/src/utils/multi_address.rs b/subxt/src/utils/multi_address.rs similarity index 98% rename from core/src/utils/multi_address.rs rename to subxt/src/utils/multi_address.rs index 95506bc4830..9fb8a575edb 100644 --- a/core/src/utils/multi_address.rs +++ b/subxt/src/utils/multi_address.rs @@ -6,7 +6,6 @@ //! This doesn't contain much functionality itself, but is easy to convert to/from an `sp_runtime::MultiAddress` //! for instance, to gain functionality without forcing a dependency on Substrate crates here. -use alloc::vec::Vec; use codec::{Decode, Encode}; /// A multi-format address wrapper for on-chain accounts. This is a simplified version of Substrate's diff --git a/core/src/utils/multi_signature.rs b/subxt/src/utils/multi_signature.rs similarity index 100% rename from core/src/utils/multi_signature.rs rename to subxt/src/utils/multi_signature.rs diff --git a/historic/src/utils/range_map.rs b/subxt/src/utils/range_map.rs similarity index 96% rename from historic/src/utils/range_map.rs rename to subxt/src/utils/range_map.rs index 269a2c5bcdc..2bb800c75fb 100644 --- a/historic/src/utils/range_map.rs +++ b/subxt/src/utils/range_map.rs @@ -106,7 +106,12 @@ pub enum RangeMapError { EmptyRange(K), /// An error indicating that the proposed block range overlaps with an existing one. #[error("Overlapping block ranges are not allowed: proposed range is {}..{}, but we already have {}..{}", proposed.0, proposed.1, existing.0, existing.1)] - OverlappingRanges { proposed: (K, K), existing: (K, K) }, + OverlappingRanges { + /// The range being proposed / added. + proposed: (K, K), + /// The existing range which overlaps. + existing: (K, K), + }, } #[cfg(test)] diff --git a/core/src/utils/static_type.rs b/subxt/src/utils/static_type.rs similarity index 99% rename from core/src/utils/static_type.rs rename to subxt/src/utils/static_type.rs index e27b9c5bc0b..0969c8f85f4 100644 --- a/core/src/utils/static_type.rs +++ b/subxt/src/utils/static_type.rs @@ -6,8 +6,6 @@ use codec::{Decode, Encode}; use scale_decode::{IntoVisitor, TypeResolver, Visitor, visitor::DecodeAsTypeResult}; use scale_encode::EncodeAsType; -use alloc::vec::Vec; - /// If the type inside this implements [`Encode`], this will implement [`scale_encode::EncodeAsType`]. /// If the type inside this implements [`Decode`], this will implement [`scale_decode::DecodeAsType`]. /// diff --git a/core/src/utils/unchecked_extrinsic.rs b/subxt/src/utils/unchecked_extrinsic.rs similarity index 99% rename from core/src/utils/unchecked_extrinsic.rs rename to subxt/src/utils/unchecked_extrinsic.rs index caafe207509..eef9803c7a3 100644 --- a/core/src/utils/unchecked_extrinsic.rs +++ b/subxt/src/utils/unchecked_extrinsic.rs @@ -9,14 +9,11 @@ //! runtime APIs. Deriving `EncodeAsType` would lead to the inner //! bytes to be re-encoded (length prefixed). -use core::marker::PhantomData; - +use super::{Encoded, Static}; use codec::{Decode, Encode}; +use core::marker::PhantomData; use scale_decode::{DecodeAsType, IntoVisitor, TypeResolver, Visitor, visitor::DecodeAsTypeResult}; -use super::{Encoded, Static}; -use alloc::vec::Vec; - /// The unchecked extrinsic from substrate. #[derive(Clone, Debug, Eq, PartialEq, Encode)] pub struct UncheckedExtrinsic( @@ -116,8 +113,6 @@ impl IntoVisitor pub mod tests { use super::*; - use alloc::vec; - #[test] fn unchecked_extrinsic_encoding() { // A tx is basically some bytes with a compact length prefix; ie an encoded vec: diff --git a/core/src/utils/wrapper_opaque.rs b/subxt/src/utils/wrapper_opaque.rs similarity index 99% rename from core/src/utils/wrapper_opaque.rs rename to subxt/src/utils/wrapper_opaque.rs index 3cb6781fcf1..3e885149ac9 100644 --- a/core/src/utils/wrapper_opaque.rs +++ b/subxt/src/utils/wrapper_opaque.rs @@ -8,9 +8,6 @@ use derive_where::derive_where; use scale_decode::{IntoVisitor, TypeResolver, Visitor, ext::scale_type_resolver::visitor}; use scale_encode::EncodeAsType; -use alloc::format; -use alloc::vec::Vec; - /// A wrapper for any type `T` which implement encode/decode in a way compatible with `Vec`. /// [`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. @@ -158,8 +155,6 @@ impl IntoVisitor for WrapperKeepOpaque { mod test { use scale_decode::DecodeAsType; - use alloc::vec; - use super::*; // Copied from https://github.com/paritytech/substrate/blob/master/frame/support/src/traits/misc.rs diff --git a/core/src/utils/yesnomaybe.rs b/subxt/src/utils/yesnomaybe.rs similarity index 100% rename from core/src/utils/yesnomaybe.rs rename to subxt/src/utils/yesnomaybe.rs diff --git a/subxt/src/view_functions.rs b/subxt/src/view_functions.rs new file mode 100644 index 00000000000..9def3409aca --- /dev/null +++ b/subxt/src/view_functions.rs @@ -0,0 +1,155 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! This module exposes [`ViewFunctionsClient`], which has methods for calling View Functions. +//! It's created by calling [`crate::client::ClientAtBlock::view_functions()`]. +//! +//! ```rust,no_run +//! pub use subxt::{OnlineClient, PolkadotConfig}; +//! +//! let client = OnlineClient::new().await?; +//! let at_block = client.at_current_block().await?; +//! +//! let view_functions = at_block.view_functions(); +//! ``` + +mod payload; + +use crate::client::{OfflineClientAtBlockT, OnlineClientAtBlockT}; +use crate::config::Config; +use crate::error::ViewFunctionError; +use derive_where::derive_where; +use scale_decode::IntoVisitor; +use std::marker::PhantomData; + +pub use payload::{DynamicPayload, Payload, StaticPayload, dynamic}; + +/// The name of the Runtime API call which can execute +const CALL_NAME: &str = "RuntimeViewFunction_execute_view_function"; + +/// A client for working with View Functions. See [the module docs](crate::view_functions) for more. +#[derive_where(Clone; Client)] +pub struct ViewFunctionsClient<'atblock, T: Config, Client> { + client: &'atblock Client, + marker: PhantomData, +} + +impl<'atblock, T: Config, Client> ViewFunctionsClient<'atblock, T, Client> { + /// Create a new [`ViewFunctionsClient`] + pub(crate) fn new(client: &'atblock Client) -> Self { + Self { + client, + marker: PhantomData, + } + } +} + +impl<'atblock, T, Client> ViewFunctionsClient<'atblock, T, Client> +where + T: Config, + Client: OfflineClientAtBlockT, +{ + /// Run the validation logic against some View Function payload you'd like to use. Returns `Ok(())` + /// if the payload is valid (or if it's not possible to check since the payload has no validation hash). + /// Return an error if the payload was not valid or something went wrong trying to validate it (ie + /// the View Function in question do not exist at all) + pub fn validate(&self, payload: Call) -> Result<(), ViewFunctionError> { + let Some(hash) = payload.validation_hash() else { + return Ok(()); + }; + + let metadata = self.client.metadata_ref(); + let pallet_name = payload.pallet_name(); + let function_name = payload.function_name(); + + let view_function = metadata + .pallet_by_name(pallet_name) + .ok_or_else(|| ViewFunctionError::PalletNotFound(pallet_name.to_string()))? + .view_function_by_name(function_name) + .ok_or_else(|| ViewFunctionError::ViewFunctionNotFound { + pallet_name: pallet_name.to_string(), + function_name: function_name.to_string(), + })?; + + if hash != view_function.hash() { + Err(ViewFunctionError::IncompatibleCodegen) + } else { + Ok(()) + } + } + + /// Encode the bytes that will be passed to the "execute_view_function" Runtime API call, + /// to execute the View Function represented by the given payload. + pub fn encode_args(&self, payload: P) -> Result, ViewFunctionError> { + let metadata = self.client.metadata_ref(); + let inputs = frame_decode::view_functions::encode_view_function_inputs( + payload.pallet_name(), + payload.function_name(), + payload.args(), + metadata, + metadata.types(), + ) + .map_err(ViewFunctionError::CouldNotEncodeInputs)?; + + Ok(inputs) + } +} + +impl<'atblock, T, Client> ViewFunctionsClient<'atblock, T, Client> +where + T: Config, + Client: OnlineClientAtBlockT, +{ + /// Execute a raw View function API call. This returns the raw bytes representing the result + /// of this call. The caller is responsible for decoding the result. + pub async fn call_raw( + &self, + call_parameters: Option<&[u8]>, + ) -> Result, ViewFunctionError> { + let client = &self.client; + let block_hash = client.block_hash(); + let data = client + .backend() + .call(CALL_NAME, call_parameters, block_hash) + .await + .map_err(ViewFunctionError::CannotCallApi)?; + + Ok(data) + } + + /// Execute a View Function call. + pub async fn call(&self, payload: P) -> Result { + let client = &self.client; + let metadata = client.metadata_ref(); + let block_hash = client.block_hash(); + + // Validate the View Function payload hash against the compile hash from codegen. + self.validate(&payload)?; + + // Assemble the data to call the "execute_view_function" runtime API, which + // then calls the relevant view function. + let call_args = self.encode_args(&payload)?; + + // Make the call. + let bytes = client + .backend() + .call(CALL_NAME, Some(call_args.as_slice()), block_hash) + .await + .map_err(ViewFunctionError::CannotCallApi)?; + + // Decode the response. + let cursor = &mut &*bytes; + let value = frame_decode::view_functions::decode_view_function_response( + payload.pallet_name(), + payload.function_name(), + cursor, + metadata, + metadata.types(), + P::ReturnType::into_visitor(), + ) + .map_err(ViewFunctionError::CouldNotDecodeResponse)?; + + Ok(value) + } +} diff --git a/subxt/src/view_functions/mod.rs b/subxt/src/view_functions/mod.rs deleted file mode 100644 index df095bfb093..00000000000 --- a/subxt/src/view_functions/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Types associated with executing View Function calls. - -mod view_function_types; -mod view_functions_client; - -pub use subxt_core::view_functions::payload::{DynamicPayload, Payload, StaticPayload, dynamic}; -pub use view_function_types::ViewFunctionsApi; -pub use view_functions_client::ViewFunctionsClient; diff --git a/core/src/view_functions/payload.rs b/subxt/src/view_functions/payload.rs similarity index 98% rename from core/src/view_functions/payload.rs rename to subxt/src/view_functions/payload.rs index dba753dca2b..48ed0a43ca9 100644 --- a/core/src/view_functions/payload.rs +++ b/subxt/src/view_functions/payload.rs @@ -5,12 +5,11 @@ //! This module contains the trait and types used to represent //! View Function calls that can be made. -use alloc::borrow::Cow; -use alloc::string::String; use core::marker::PhantomData; use derive_where::derive_where; use frame_decode::view_functions::IntoEncodableValues; use scale_decode::DecodeAsType; +use std::borrow::Cow; /// This represents a View Function payload that can call into the runtime of node. /// diff --git a/subxt/src/view_functions/view_function_types.rs b/subxt/src/view_functions/view_function_types.rs deleted file mode 100644 index 9860dca78ee..00000000000 --- a/subxt/src/view_functions/view_function_types.rs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use super::Payload; -use crate::{ - backend::BlockRef, - client::OnlineClientT, - config::{Config, HashFor}, - error::ViewFunctionError, -}; -use derive_where::derive_where; -use std::{future::Future, marker::PhantomData}; - -/// Execute View Function calls. -#[derive_where(Clone; Client)] -pub struct ViewFunctionsApi { - client: Client, - block_ref: BlockRef>, - _marker: PhantomData, -} - -impl ViewFunctionsApi { - /// Create a new [`ViewFunctionsApi`] - pub(crate) fn new(client: Client, block_ref: BlockRef>) -> Self { - Self { - client, - block_ref, - _marker: PhantomData, - } - } -} - -impl ViewFunctionsApi -where - T: Config, - Client: OnlineClientT, -{ - /// Run the validation logic against some View Function payload you'd like to use. Returns `Ok(())` - /// if the payload is valid (or if it's not possible to check since the payload has no validation hash). - /// Return an error if the payload was not valid or something went wrong trying to validate it (ie - /// the View Function in question do not exist at all) - pub fn validate(&self, payload: Call) -> Result<(), ViewFunctionError> { - subxt_core::view_functions::validate(payload, &self.client.metadata()).map_err(Into::into) - } - - /// Execute a View Function call. - pub fn call( - &self, - payload: Call, - ) -> impl Future> + use - { - let client = self.client.clone(); - let block_hash = self.block_ref.hash(); - // Ensure that the returned future doesn't have a lifetime tied to api.view_functions(), - // which is a temporary thing we'll be throwing away quickly: - async move { - let metadata = client.metadata(); - - // Validate the View Function payload hash against the compile hash from codegen. - subxt_core::view_functions::validate(&payload, &metadata)?; - - // Assemble the data to call the "execute_view_function" runtime API, which - // then calls the relevant view function. - let call_name = subxt_core::view_functions::CALL_NAME; - let call_args = subxt_core::view_functions::call_args(&payload, &metadata)?; - - // Make the call. - let bytes = client - .backend() - .call(call_name, Some(call_args.as_slice()), block_hash) - .await - .map_err(ViewFunctionError::CannotCallApi)?; - - // Decode the response. - let value = - subxt_core::view_functions::decode_value(&mut &*bytes, &payload, &metadata)?; - Ok(value) - } - } -} diff --git a/subxt/src/view_functions/view_functions_client.rs b/subxt/src/view_functions/view_functions_client.rs deleted file mode 100644 index cdd0efe5c47..00000000000 --- a/subxt/src/view_functions/view_functions_client.rs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use super::view_function_types::ViewFunctionsApi; - -use crate::{ - backend::BlockRef, - client::OnlineClientT, - config::{Config, HashFor}, - error::ViewFunctionError, -}; -use derive_where::derive_where; -use std::{future::Future, marker::PhantomData}; - -/// Make View Function calls at some block. -#[derive_where(Clone; Client)] -pub struct ViewFunctionsClient { - client: Client, - _marker: PhantomData, -} - -impl ViewFunctionsClient { - /// Create a new [`ViewFunctionsClient`] - pub fn new(client: Client) -> Self { - Self { - client, - _marker: PhantomData, - } - } -} - -impl ViewFunctionsClient -where - T: Config, - Client: OnlineClientT, -{ - /// Obtain an interface to call View Functions at some block hash. - pub fn at(&self, block_ref: impl Into>>) -> ViewFunctionsApi { - ViewFunctionsApi::new(self.client.clone(), block_ref.into()) - } - - /// Obtain an interface to call View Functions at the latest finalized block. - pub fn at_latest( - &self, - ) -> impl Future, ViewFunctionError>> + Send + 'static - { - // Clone and pass the client in like this so that we can explicitly - // return a Future that's Send + 'static, rather than tied to &self. - let client = self.client.clone(); - async move { - // get the ref for the latest finalized block and use that. - let block_ref = client - .backend() - .latest_finalized_block_ref() - .await - .map_err(ViewFunctionError::CannotGetLatestFinalizedBlock)?; - - Ok(ViewFunctionsApi::new(client, block_ref)) - } - } -} diff --git a/testing/integration-tests/Cargo.toml b/testing/integration-tests/Cargo.toml index 780f9bd2d8f..8dc8c040d1e 100644 --- a/testing/integration-tests/Cargo.toml +++ b/testing/integration-tests/Cargo.toml @@ -16,10 +16,10 @@ description = "Subxt integration tests that rely on the Substrate binary" default = [] # Enable to run the tests with Light Client support. -unstable-light-client = ["subxt/unstable-light-client"] +light-client = ["subxt/light-client"] # Enable to run the full-client tests with Light Client support. -unstable-light-client-long-running = ["subxt/unstable-light-client"] +light-client-long-running = ["subxt/light-client"] # Enable this to use the chainhead backend in tests _instead of_ # the default one which relies on the "old" RPC methods. diff --git a/testing/integration-tests/build.rs b/testing/integration-tests/build.rs index bce3d4dcb26..559863b1234 100644 --- a/testing/integration-tests/build.rs +++ b/testing/integration-tests/build.rs @@ -3,8 +3,8 @@ use cfg_aliases::cfg_aliases; fn main() { // Setup cfg aliases cfg_aliases! { - lightclient: { any(feature = "unstable-light-client", feature = "unstable-light-client-long-running") }, - fullclient: { all(not(feature = "unstable-light-client"), not(feature = "unstable-light-client-long-running")) }, + lightclient: { any(feature = "light-client", feature = "light-client-long-running") }, + fullclient: { all(not(feature = "light-client"), not(feature = "light-client-long-running")) }, legacy_backend: { not(feature = "chainhead-backend") }, chainhead_backend: { feature = "chainhead-backend" }, } diff --git a/testing/integration-tests/src/full_client/codegen/polkadot.rs b/testing/integration-tests/src/full_client/codegen/polkadot.rs index 5cb5f23e5a2..a39084cd0a9 100644 --- a/testing/integration-tests/src/full_client/codegen/polkadot.rs +++ b/testing/integration-tests/src/full_client/codegen/polkadot.rs @@ -1,4 +1,10 @@ -#[allow(dead_code, unused_imports, non_camel_case_types, unreachable_patterns)] +#[allow( + dead_code, + missing_docs, + unused_imports, + non_camel_case_types, + unreachable_patterns +)] #[allow(clippy::all)] #[allow(rustdoc::broken_intra_doc_links)] pub mod api { @@ -112,16 +118,20 @@ pub mod api { pub fn storage() -> StorageApi { StorageApi } + #[doc = r" This is an alias to [`Self::transactions()`]."] pub fn tx() -> TransactionApi { TransactionApi } - pub fn apis() -> runtime_apis::RuntimeApi { + pub fn transactions() -> TransactionApi { + TransactionApi + } + pub fn runtime_apis() -> runtime_apis::RuntimeApi { runtime_apis::RuntimeApi } pub mod runtime_apis { use super::root_mod; use super::runtime_types; - use subxt::ext::subxt_core::ext::codec::Encode; + use subxt::ext::codec::Encode; pub struct RuntimeApi; impl RuntimeApi { pub fn core(&self) -> core::Core { @@ -200,11 +210,9 @@ pub mod api { #[doc = " Returns the version of the runtime."] pub fn version( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - version::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), version::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "Core", "version", (), @@ -219,11 +227,11 @@ pub mod api { pub fn execute_block( &self, block: execute_block::Block, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (execute_block::Block,), execute_block::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "Core", "execute_block", (block,), @@ -238,11 +246,11 @@ pub mod api { pub fn initialize_block( &self, header: initialize_block::Header, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (initialize_block::Header,), initialize_block::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "Core", "initialize_block", (header,), @@ -265,7 +273,7 @@ pub mod api { pub mod execute_block { use super::root_mod; use super::runtime_types; - pub type Block = runtime_types :: sp_runtime :: generic :: block :: LazyBlock < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; + pub type Block = runtime_types :: sp_runtime :: generic :: block :: LazyBlock < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: utils :: UncheckedExtrinsic < :: subxt :: utils :: MultiAddress < :: subxt :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; pub mod output { use super::runtime_types; pub type Output = (); @@ -306,11 +314,11 @@ pub mod api { pub fn query_acceptable_payment_assets( &self, xcm_version: query_acceptable_payment_assets::XcmVersion, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (query_acceptable_payment_assets::XcmVersion,), query_acceptable_payment_assets::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "XcmPaymentApi", "query_acceptable_payment_assets", (xcm_version,), @@ -329,11 +337,11 @@ pub mod api { pub fn query_xcm_weight( &self, message: query_xcm_weight::Message, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (query_xcm_weight::Message,), query_xcm_weight::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "XcmPaymentApi", "query_xcm_weight", (message,), @@ -355,14 +363,14 @@ pub mod api { &self, weight: query_weight_to_asset_fee::Weight, asset: query_weight_to_asset_fee::Asset, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( query_weight_to_asset_fee::Weight, query_weight_to_asset_fee::Asset, ), query_weight_to_asset_fee::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "XcmPaymentApi", "query_weight_to_asset_fee", (weight, asset), @@ -388,7 +396,7 @@ pub mod api { destination: query_delivery_fees::Destination, message: query_delivery_fees::Message, asset_id: query_delivery_fees::AssetId, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( query_delivery_fees::Destination, query_delivery_fees::Message, @@ -396,7 +404,7 @@ pub mod api { ), query_delivery_fees::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "XcmPaymentApi", "query_delivery_fees", (destination, message, asset_id), @@ -415,9 +423,7 @@ pub mod api { pub mod output { use super::runtime_types; pub type Output = ::core::result::Result< - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::xcm::VersionedAssetId, - >, + ::subxt::alloc::vec::Vec, runtime_types::xcm_runtime_apis::fees::Error, >; } @@ -482,7 +488,7 @@ pub mod api { origin: dry_run_call::Origin, call: dry_run_call::Call, result_xcms_version: dry_run_call::ResultXcmsVersion, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( dry_run_call::Origin, dry_run_call::Call, @@ -490,7 +496,7 @@ pub mod api { ), dry_run_call::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "DryRunApi", "dry_run_call", (origin, call, result_xcms_version), @@ -507,11 +513,11 @@ pub mod api { &self, origin_location: dry_run_xcm::OriginLocation, xcm: dry_run_xcm::Xcm, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (dry_run_xcm::OriginLocation, dry_run_xcm::Xcm), dry_run_xcm::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "DryRunApi", "dry_run_xcm", (origin_location, xcm), @@ -565,11 +571,11 @@ pub mod api { pub fn convert_location( &self, location: convert_location::Location, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (convert_location::Location,), convert_location::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "LocationToAccountApi", "convert_location", (location,), @@ -589,7 +595,7 @@ pub mod api { pub mod output { use super::runtime_types; pub type Output = ::core::result::Result< - ::subxt::ext::subxt_core::utils::AccountId32, + ::subxt::utils::AccountId32, runtime_types::xcm_runtime_apis::conversions::Error, >; } @@ -604,11 +610,9 @@ pub mod api { #[doc = " Returns the metadata of a runtime."] pub fn metadata( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - metadata::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), metadata::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "Metadata", "metadata", (), @@ -626,11 +630,11 @@ pub mod api { pub fn metadata_at_version( &self, version: metadata_at_version::Version, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (metadata_at_version::Version,), metadata_at_version::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "Metadata", "metadata_at_version", (version,), @@ -647,11 +651,9 @@ pub mod api { #[doc = " This can be used to call `metadata_at_version`."] pub fn metadata_versions( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - metadata_versions::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), metadata_versions::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "Metadata", "metadata_versions", (), @@ -687,8 +689,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u32>; + pub type Output = ::subxt::alloc::vec::Vec<::core::primitive::u32>; } } } @@ -705,11 +706,11 @@ pub mod api { pub fn apply_extrinsic( &self, extrinsic: apply_extrinsic::Extrinsic, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (apply_extrinsic::Extrinsic,), apply_extrinsic::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "BlockBuilder", "apply_extrinsic", (extrinsic,), @@ -723,11 +724,9 @@ pub mod api { #[doc = " Finish the current block."] pub fn finalize_block( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - finalize_block::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), finalize_block::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "BlockBuilder", "finalize_block", (), @@ -742,11 +741,11 @@ pub mod api { pub fn inherent_extrinsics( &self, inherent: inherent_extrinsics::Inherent, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (inherent_extrinsics::Inherent,), inherent_extrinsics::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "BlockBuilder", "inherent_extrinsics", (inherent,), @@ -763,11 +762,11 @@ pub mod api { &self, block: check_inherents::Block, data: check_inherents::Data, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (check_inherents::Block, check_inherents::Data), check_inherents::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "BlockBuilder", "check_inherents", (block, data), @@ -783,7 +782,7 @@ pub mod api { pub mod apply_extrinsic { use super::root_mod; use super::runtime_types; - pub type Extrinsic = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; + pub type Extrinsic = :: subxt :: utils :: UncheckedExtrinsic < :: subxt :: utils :: MultiAddress < :: subxt :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; pub mod output { use super::runtime_types; pub type Output = ::core::result::Result< @@ -807,13 +806,13 @@ pub mod api { pub type Inherent = runtime_types::sp_inherents::InherentData; pub mod output { use super::runtime_types; - pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; + pub type Output = :: subxt :: alloc :: vec :: Vec < :: subxt :: utils :: UncheckedExtrinsic < :: subxt :: utils :: MultiAddress < :: subxt :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; } } pub mod check_inherents { use super::root_mod; use super::runtime_types; - pub type Block = runtime_types :: sp_runtime :: generic :: block :: LazyBlock < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; + pub type Block = runtime_types :: sp_runtime :: generic :: block :: LazyBlock < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: utils :: UncheckedExtrinsic < :: subxt :: utils :: MultiAddress < :: subxt :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; pub type Data = runtime_types::sp_inherents::InherentData; pub mod output { use super::runtime_types; @@ -841,7 +840,7 @@ pub mod api { source: validate_transaction::Source, tx: validate_transaction::Tx, block_hash: validate_transaction::BlockHash, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( validate_transaction::Source, validate_transaction::Tx, @@ -849,7 +848,7 @@ pub mod api { ), validate_transaction::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "TaggedTransactionQueue", "validate_transaction", (source, tx, block_hash), @@ -867,8 +866,8 @@ pub mod api { use super::runtime_types; pub type Source = runtime_types::sp_runtime::transaction_validity::TransactionSource; - pub type Tx = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; - pub type BlockHash = ::subxt::ext::subxt_core::utils::H256; + pub type Tx = :: subxt :: utils :: UncheckedExtrinsic < :: subxt :: utils :: MultiAddress < :: subxt :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; + pub type BlockHash = ::subxt::utils::H256; pub mod output { use super::runtime_types; pub type Output = ::core::result::Result< @@ -888,11 +887,11 @@ pub mod api { pub fn offchain_worker( &self, header: offchain_worker::Header, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (offchain_worker::Header,), offchain_worker::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "OffchainWorkerApi", "offchain_worker", (header,), @@ -924,11 +923,9 @@ pub mod api { #[doc = " Get the current validators."] pub fn validators( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - validators::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), validators::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "validators", (), @@ -945,11 +942,9 @@ pub mod api { #[doc = " should be the successor of the number of the block."] pub fn validator_groups( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - validator_groups::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), validator_groups::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "validator_groups", (), @@ -965,11 +960,9 @@ pub mod api { #[doc = " Cores are either free or occupied. Free cores can have paras assigned to them."] pub fn availability_cores( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - availability_cores::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), availability_cores::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "availability_cores", (), @@ -989,14 +982,14 @@ pub mod api { &self, para_id: persisted_validation_data::ParaId, assumption: persisted_validation_data::Assumption, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( persisted_validation_data::ParaId, persisted_validation_data::Assumption, ), persisted_validation_data::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "persisted_validation_data", (para_id, assumption), @@ -1014,14 +1007,14 @@ pub mod api { &self, para_id: assumed_validation_data::ParaId, expected_persisted_validation_data_hash : assumed_validation_data :: ExpectedPersistedValidationDataHash, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( assumed_validation_data::ParaId, assumed_validation_data::ExpectedPersistedValidationDataHash, ), assumed_validation_data::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "assumed_validation_data", (para_id, expected_persisted_validation_data_hash), @@ -1037,14 +1030,14 @@ pub mod api { &self, para_id: check_validation_outputs::ParaId, outputs: check_validation_outputs::Outputs, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( check_validation_outputs::ParaId, check_validation_outputs::Outputs, ), check_validation_outputs::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "check_validation_outputs", (para_id, outputs), @@ -1061,11 +1054,9 @@ pub mod api { #[doc = " This can be used to instantiate a `SigningContext`."] pub fn session_index_for_child( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - session_index_for_child::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), session_index_for_child::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "session_index_for_child", (), @@ -1084,11 +1075,11 @@ pub mod api { &self, para_id: validation_code::ParaId, assumption: validation_code::Assumption, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (validation_code::ParaId, validation_code::Assumption), validation_code::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "validation_code", (para_id, assumption), @@ -1105,11 +1096,11 @@ pub mod api { pub fn candidate_pending_availability( &self, para_id: candidate_pending_availability::ParaId, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (candidate_pending_availability::ParaId,), candidate_pending_availability::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "candidate_pending_availability", (para_id,), @@ -1124,11 +1115,9 @@ pub mod api { #[doc = " Get a vector of events concerning candidates that occurred within a block."] pub fn candidate_events( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - candidate_events::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), candidate_events::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "candidate_events", (), @@ -1143,11 +1132,11 @@ pub mod api { pub fn dmq_contents( &self, recipient: dmq_contents::Recipient, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (dmq_contents::Recipient,), dmq_contents::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "dmq_contents", (recipient,), @@ -1163,11 +1152,11 @@ pub mod api { pub fn inbound_hrmp_channels_contents( &self, recipient: inbound_hrmp_channels_contents::Recipient, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (inbound_hrmp_channels_contents::Recipient,), inbound_hrmp_channels_contents::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "inbound_hrmp_channels_contents", (recipient,), @@ -1182,11 +1171,11 @@ pub mod api { pub fn validation_code_by_hash( &self, hash: validation_code_by_hash::Hash, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (validation_code_by_hash::Hash,), validation_code_by_hash::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "validation_code_by_hash", (hash,), @@ -1201,11 +1190,9 @@ pub mod api { #[doc = " Scrape dispute relevant from on-chain, backing votes and resolved disputes."] pub fn on_chain_votes( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - on_chain_votes::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), on_chain_votes::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "on_chain_votes", (), @@ -1222,11 +1209,11 @@ pub mod api { pub fn session_info( &self, index: session_info::Index, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (session_info::Index,), session_info::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "session_info", (index,), @@ -1244,14 +1231,14 @@ pub mod api { &self, stmt: submit_pvf_check_statement::Stmt, signature: submit_pvf_check_statement::Signature, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( submit_pvf_check_statement::Stmt, submit_pvf_check_statement::Signature, ), submit_pvf_check_statement::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "submit_pvf_check_statement", (stmt, signature), @@ -1267,11 +1254,9 @@ pub mod api { #[doc = " NOTE: This function is only available since parachain host version 2."] pub fn pvfs_require_precheck( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - pvfs_require_precheck::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), pvfs_require_precheck::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "pvfs_require_precheck", (), @@ -1289,14 +1274,14 @@ pub mod api { &self, para_id: validation_code_hash::ParaId, assumption: validation_code_hash::Assumption, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( validation_code_hash::ParaId, validation_code_hash::Assumption, ), validation_code_hash::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "validation_code_hash", (para_id, assumption), @@ -1311,11 +1296,9 @@ pub mod api { #[doc = " Returns all onchain disputes."] pub fn disputes( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - disputes::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), disputes::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "disputes", (), @@ -1330,11 +1313,11 @@ pub mod api { pub fn session_executor_params( &self, session_index: session_executor_params::SessionIndex, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (session_executor_params::SessionIndex,), session_executor_params::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "session_executor_params", (session_index,), @@ -1350,11 +1333,9 @@ pub mod api { #[doc = " Deprecated. Use `unapplied_slashes_v2` instead."] pub fn unapplied_slashes( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - unapplied_slashes::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), unapplied_slashes::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "unapplied_slashes", (), @@ -1370,11 +1351,11 @@ pub mod api { pub fn key_ownership_proof( &self, validator_id: key_ownership_proof::ValidatorId, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (key_ownership_proof::ValidatorId,), key_ownership_proof::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "key_ownership_proof", (validator_id,), @@ -1392,14 +1373,14 @@ pub mod api { &self, dispute_proof: submit_report_dispute_lost::DisputeProof, key_ownership_proof: submit_report_dispute_lost::KeyOwnershipProof, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( submit_report_dispute_lost::DisputeProof, submit_report_dispute_lost::KeyOwnershipProof, ), submit_report_dispute_lost::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "submit_report_dispute_lost", (dispute_proof, key_ownership_proof), @@ -1415,11 +1396,9 @@ pub mod api { #[doc = " This is a staging method! Do not use on production runtimes!"] pub fn minimum_backing_votes( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - minimum_backing_votes::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), minimum_backing_votes::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "minimum_backing_votes", (), @@ -1435,11 +1414,11 @@ pub mod api { pub fn para_backing_state( &self, runtime_api_generated_name_0__: para_backing_state::RuntimeApiGeneratedName0, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (para_backing_state::RuntimeApiGeneratedName0,), para_backing_state::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "para_backing_state", (runtime_api_generated_name_0__,), @@ -1454,11 +1433,9 @@ pub mod api { #[doc = " Returns candidate's acceptance limitations for asynchronous backing for a relay parent."] pub fn async_backing_params( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - async_backing_params::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), async_backing_params::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "async_backing_params", (), @@ -1473,11 +1450,9 @@ pub mod api { #[doc = " Returns a list of all disabled validators at the given block."] pub fn disabled_validators( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - disabled_validators::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), disabled_validators::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "disabled_validators", (), @@ -1493,11 +1468,9 @@ pub mod api { #[doc = " This is a staging method! Do not use on production runtimes!"] pub fn node_features( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - node_features::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), node_features::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "node_features", (), @@ -1511,11 +1484,9 @@ pub mod api { #[doc = " Approval voting configuration parameters"] pub fn approval_voting_params( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - approval_voting_params::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), approval_voting_params::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "approval_voting_params", (), @@ -1530,11 +1501,9 @@ pub mod api { #[doc = " Claim queue"] pub fn claim_queue( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - claim_queue::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), claim_queue::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "claim_queue", (), @@ -1550,11 +1519,11 @@ pub mod api { pub fn candidates_pending_availability( &self, para_id: candidates_pending_availability::ParaId, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (candidates_pending_availability::ParaId,), candidates_pending_availability::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "candidates_pending_availability", (para_id,), @@ -1568,11 +1537,11 @@ pub mod api { #[doc = " Retrieve the maximum uncompressed code size."] pub fn validation_code_bomb_limit( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (), validation_code_bomb_limit::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "validation_code_bomb_limit", (), @@ -1589,11 +1558,11 @@ pub mod api { pub fn backing_constraints( &self, para_id: backing_constraints::ParaId, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (backing_constraints::ParaId,), backing_constraints::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "backing_constraints", (para_id,), @@ -1607,11 +1576,9 @@ pub mod api { #[doc = " Retrieve the scheduling lookahead"] pub fn scheduling_lookahead( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - scheduling_lookahead::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), scheduling_lookahead::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "scheduling_lookahead", (), @@ -1626,11 +1593,9 @@ pub mod api { #[doc = " Retrieve paraids at relay parent"] pub fn para_ids( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - para_ids::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), para_ids::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "para_ids", (), @@ -1645,11 +1610,9 @@ pub mod api { #[doc = " Returns a list of validators that lost a past session dispute and need to be slashed."] pub fn unapplied_slashes_v2( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - unapplied_slashes_v2::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), unapplied_slashes_v2::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "ParachainHost", "unapplied_slashes_v2", (), @@ -1666,7 +1629,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + pub type Output = ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::validator_app::Public, >; } @@ -1677,8 +1640,8 @@ pub mod api { pub mod output { use super::runtime_types; pub type Output = ( - ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::alloc::vec::Vec< + ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::ValidatorIndex, >, >, @@ -1693,9 +1656,9 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + pub type Output = ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::CoreState< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, ::core::primitive::u32, >, >; @@ -1711,7 +1674,7 @@ pub mod api { use super::runtime_types; pub type Output = ::core::option::Option< runtime_types::polkadot_primitives::v9::PersistedValidationData< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, ::core::primitive::u32, >, >; @@ -1721,11 +1684,10 @@ pub mod api { use super::root_mod; use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type ExpectedPersistedValidationDataHash = - ::subxt::ext::subxt_core::utils::H256; + pub type ExpectedPersistedValidationDataHash = ::subxt::utils::H256; pub mod output { use super::runtime_types; - pub type Output = :: core :: option :: Option < (runtime_types :: polkadot_primitives :: v9 :: PersistedValidationData < :: subxt :: ext :: subxt_core :: utils :: H256 , :: core :: primitive :: u32 > , runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ,) > ; + pub type Output = :: core :: option :: Option < (runtime_types :: polkadot_primitives :: v9 :: PersistedValidationData < :: subxt :: utils :: H256 , :: core :: primitive :: u32 > , runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ,) > ; } } pub mod check_validation_outputs { @@ -1769,7 +1731,7 @@ pub mod api { use super::runtime_types; pub type Output = ::core::option::Option< runtime_types::polkadot_primitives::v9::CommittedCandidateReceiptV2< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >, >; } @@ -1779,9 +1741,9 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + pub type Output = ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::CandidateEvent< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >, >; } @@ -1792,7 +1754,7 @@ pub mod api { pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + pub type Output = ::subxt::alloc::vec::Vec< runtime_types::polkadot_core_primitives::InboundDownwardMessage< ::core::primitive::u32, >, @@ -1805,9 +1767,9 @@ pub mod api { pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::KeyedVec< + pub type Output = ::subxt::utils::KeyedVec< runtime_types::polkadot_parachain_primitives::primitives::Id, - ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::alloc::vec::Vec< runtime_types::polkadot_core_primitives::InboundHrmpMessage< ::core::primitive::u32, >, @@ -1834,7 +1796,7 @@ pub mod api { use super::runtime_types; pub type Output = ::core::option::Option< runtime_types::polkadot_primitives::v9::ScrapedOnChainVotes< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >, >; } @@ -1865,7 +1827,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash > ; + pub type Output = :: subxt :: alloc :: vec :: Vec < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash > ; } } pub mod validation_code_hash { @@ -1884,7 +1846,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub type Output = ::subxt::alloc::vec::Vec<( ::core::primitive::u32, runtime_types::polkadot_core_primitives::CandidateHash, runtime_types::polkadot_primitives::v9::DisputeState< @@ -1909,7 +1871,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub type Output = ::subxt::alloc::vec::Vec<( ::core::primitive::u32, runtime_types::polkadot_core_primitives::CandidateHash, runtime_types::polkadot_primitives::v9::slashing::LegacyPendingSlashes, @@ -1957,7 +1919,7 @@ pub mod api { use super::runtime_types; pub type Output = ::core::option::Option< runtime_types::polkadot_primitives::v9::async_backing::BackingState< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, ::core::primitive::u32, >, >; @@ -1977,7 +1939,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + pub type Output = ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::ValidatorIndex, >; } @@ -1987,9 +1949,9 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub type Output = ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >; } } @@ -2006,9 +1968,9 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::KeyedVec< + pub type Output = ::subxt::utils::KeyedVec< runtime_types::polkadot_primitives::v9::CoreIndex, - ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::alloc::vec::Vec< runtime_types::polkadot_parachain_primitives::primitives::Id, >, >; @@ -2020,9 +1982,9 @@ pub mod api { pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + pub type Output = ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::CommittedCandidateReceiptV2< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >, >; } @@ -2061,7 +2023,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + pub type Output = ::subxt::alloc::vec::Vec< runtime_types::polkadot_parachain_primitives::primitives::Id, >; } @@ -2071,7 +2033,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub type Output = ::subxt::alloc::vec::Vec<( ::core::primitive::u32, runtime_types::polkadot_core_primitives::CandidateHash, runtime_types::polkadot_primitives::v9::slashing::PendingSlashes, @@ -2088,11 +2050,9 @@ pub mod api { #[doc = " Return the block number where BEEFY consensus is enabled/started"] pub fn beefy_genesis( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - beefy_genesis::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), beefy_genesis::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "BeefyApi", "beefy_genesis", (), @@ -2107,11 +2067,9 @@ pub mod api { #[doc = " Return the current active BEEFY validator set"] pub fn validator_set( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - validator_set::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), validator_set::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "BeefyApi", "validator_set", (), @@ -2135,14 +2093,14 @@ pub mod api { &self, equivocation_proof : submit_report_double_voting_unsigned_extrinsic :: EquivocationProof, key_owner_proof: submit_report_double_voting_unsigned_extrinsic::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( submit_report_double_voting_unsigned_extrinsic::EquivocationProof, submit_report_double_voting_unsigned_extrinsic::KeyOwnerProof, ), submit_report_double_voting_unsigned_extrinsic::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "BeefyApi", "submit_report_double_voting_unsigned_extrinsic", (equivocation_proof, key_owner_proof), @@ -2166,14 +2124,14 @@ pub mod api { &self, equivocation_proof : submit_report_fork_voting_unsigned_extrinsic :: EquivocationProof, key_owner_proof: submit_report_fork_voting_unsigned_extrinsic::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( submit_report_fork_voting_unsigned_extrinsic::EquivocationProof, submit_report_fork_voting_unsigned_extrinsic::KeyOwnerProof, ), submit_report_fork_voting_unsigned_extrinsic::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "BeefyApi", "submit_report_fork_voting_unsigned_extrinsic", (equivocation_proof, key_owner_proof), @@ -2196,14 +2154,14 @@ pub mod api { &self, equivocation_proof : submit_report_future_block_voting_unsigned_extrinsic :: EquivocationProof, key_owner_proof : submit_report_future_block_voting_unsigned_extrinsic :: KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( submit_report_future_block_voting_unsigned_extrinsic::EquivocationProof, submit_report_future_block_voting_unsigned_extrinsic::KeyOwnerProof, ), submit_report_future_block_voting_unsigned_extrinsic::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "BeefyApi", "submit_report_future_block_voting_unsigned_extrinsic", (equivocation_proof, key_owner_proof), @@ -2230,14 +2188,14 @@ pub mod api { &self, set_id: generate_key_ownership_proof::SetId, authority_id: generate_key_ownership_proof::AuthorityId, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( generate_key_ownership_proof::SetId, generate_key_ownership_proof::AuthorityId, ), generate_key_ownership_proof::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "BeefyApi", "generate_key_ownership_proof", (set_id, authority_id), @@ -2332,11 +2290,9 @@ pub mod api { #[doc = " Return the on-chain MMR root hash."] pub fn mmr_root( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - mmr_root::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), mmr_root::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "MmrApi", "mmr_root", (), @@ -2350,11 +2306,9 @@ pub mod api { #[doc = " Return the number of MMR blocks in the chain."] pub fn mmr_leaf_count( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - mmr_leaf_count::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), mmr_leaf_count::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "MmrApi", "mmr_leaf_count", (), @@ -2372,14 +2326,14 @@ pub mod api { &self, block_numbers: generate_proof::BlockNumbers, best_known_block_number: generate_proof::BestKnownBlockNumber, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( generate_proof::BlockNumbers, generate_proof::BestKnownBlockNumber, ), generate_proof::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "MmrApi", "generate_proof", (block_numbers, best_known_block_number), @@ -2397,14 +2351,14 @@ pub mod api { &self, prev_block_number: generate_ancestry_proof::PrevBlockNumber, best_known_block_number: generate_ancestry_proof::BestKnownBlockNumber, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( generate_ancestry_proof::PrevBlockNumber, generate_ancestry_proof::BestKnownBlockNumber, ), generate_ancestry_proof::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "MmrApi", "generate_ancestry_proof", (prev_block_number, best_known_block_number), @@ -2424,11 +2378,11 @@ pub mod api { &self, leaves: verify_proof::Leaves, proof: verify_proof::Proof, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (verify_proof::Leaves, verify_proof::Proof), verify_proof::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "MmrApi", "verify_proof", (leaves, proof), @@ -2452,7 +2406,7 @@ pub mod api { root: verify_proof_stateless::Root, leaves: verify_proof_stateless::Leaves, proof: verify_proof_stateless::Proof, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( verify_proof_stateless::Root, verify_proof_stateless::Leaves, @@ -2460,7 +2414,7 @@ pub mod api { ), verify_proof_stateless::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "MmrApi", "verify_proof_stateless", (root, leaves, proof), @@ -2478,7 +2432,7 @@ pub mod api { pub mod output { use super::runtime_types; pub type Output = ::core::result::Result< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, runtime_types::sp_mmr_primitives::Error, >; } @@ -2497,19 +2451,16 @@ pub mod api { pub mod generate_proof { use super::root_mod; use super::runtime_types; - pub type BlockNumbers = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u32>; + pub type BlockNumbers = ::subxt::alloc::vec::Vec<::core::primitive::u32>; pub type BestKnownBlockNumber = ::core::option::Option<::core::primitive::u32>; pub mod output { use super::runtime_types; pub type Output = ::core::result::Result< ( - ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::alloc::vec::Vec< runtime_types::sp_mmr_primitives::EncodableOpaqueLeaf, >, - runtime_types::sp_mmr_primitives::LeafProof< - ::subxt::ext::subxt_core::utils::H256, - >, + runtime_types::sp_mmr_primitives::LeafProof<::subxt::utils::H256>, ), runtime_types::sp_mmr_primitives::Error, >; @@ -2523,9 +2474,7 @@ pub mod api { pub mod output { use super::runtime_types; pub type Output = ::core::result::Result< - runtime_types::sp_mmr_primitives::AncestryProof< - ::subxt::ext::subxt_core::utils::H256, - >, + runtime_types::sp_mmr_primitives::AncestryProof<::subxt::utils::H256>, runtime_types::sp_mmr_primitives::Error, >; } @@ -2533,12 +2482,9 @@ pub mod api { pub mod verify_proof { use super::root_mod; use super::runtime_types; - pub type Leaves = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::sp_mmr_primitives::EncodableOpaqueLeaf, - >; - pub type Proof = runtime_types::sp_mmr_primitives::LeafProof< - ::subxt::ext::subxt_core::utils::H256, - >; + pub type Leaves = + ::subxt::alloc::vec::Vec; + pub type Proof = runtime_types::sp_mmr_primitives::LeafProof<::subxt::utils::H256>; pub mod output { use super::runtime_types; pub type Output = @@ -2548,13 +2494,10 @@ pub mod api { pub mod verify_proof_stateless { use super::root_mod; use super::runtime_types; - pub type Root = ::subxt::ext::subxt_core::utils::H256; - pub type Leaves = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::sp_mmr_primitives::EncodableOpaqueLeaf, - >; - pub type Proof = runtime_types::sp_mmr_primitives::LeafProof< - ::subxt::ext::subxt_core::utils::H256, - >; + pub type Root = ::subxt::utils::H256; + pub type Leaves = + ::subxt::alloc::vec::Vec; + pub type Proof = runtime_types::sp_mmr_primitives::LeafProof<::subxt::utils::H256>; pub mod output { use super::runtime_types; pub type Output = @@ -2584,11 +2527,9 @@ pub mod api { #[doc = " is finalized by the authorities from block B-1."] pub fn grandpa_authorities( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - grandpa_authorities::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), grandpa_authorities::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "GrandpaApi", "grandpa_authorities", (), @@ -2611,14 +2552,14 @@ pub mod api { &self, equivocation_proof : submit_report_equivocation_unsigned_extrinsic :: EquivocationProof, key_owner_proof: submit_report_equivocation_unsigned_extrinsic::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( submit_report_equivocation_unsigned_extrinsic::EquivocationProof, submit_report_equivocation_unsigned_extrinsic::KeyOwnerProof, ), submit_report_equivocation_unsigned_extrinsic::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "GrandpaApi", "submit_report_equivocation_unsigned_extrinsic", (equivocation_proof, key_owner_proof), @@ -2644,14 +2585,14 @@ pub mod api { &self, set_id: generate_key_ownership_proof::SetId, authority_id: generate_key_ownership_proof::AuthorityId, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( generate_key_ownership_proof::SetId, generate_key_ownership_proof::AuthorityId, ), generate_key_ownership_proof::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "GrandpaApi", "generate_key_ownership_proof", (set_id, authority_id), @@ -2665,11 +2606,9 @@ pub mod api { #[doc = " Get current GRANDPA authority set id."] pub fn current_set_id( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - current_set_id::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), current_set_id::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "GrandpaApi", "current_set_id", (), @@ -2687,7 +2626,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub type Output = ::subxt::alloc::vec::Vec<( runtime_types::sp_consensus_grandpa::app::Public, ::core::primitive::u64, )>; @@ -2697,7 +2636,7 @@ pub mod api { use super::root_mod; use super::runtime_types; pub type EquivocationProof = runtime_types::sp_consensus_grandpa::EquivocationProof< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, ::core::primitive::u32, >; pub type KeyOwnerProof = runtime_types::sp_runtime::OpaqueValue; @@ -2735,11 +2674,9 @@ pub mod api { #[doc = " Return the configuration for BABE."] pub fn configuration( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - configuration::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), configuration::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "BabeApi", "configuration", (), @@ -2753,11 +2690,9 @@ pub mod api { #[doc = " Returns the slot that started the current epoch."] pub fn current_epoch_start( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - current_epoch_start::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), current_epoch_start::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "BabeApi", "current_epoch_start", (), @@ -2772,11 +2707,9 @@ pub mod api { #[doc = " Returns information regarding the current epoch."] pub fn current_epoch( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - current_epoch::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), current_epoch::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "BabeApi", "current_epoch", (), @@ -2792,11 +2725,9 @@ pub mod api { #[doc = " previously announced)."] pub fn next_epoch( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - next_epoch::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), next_epoch::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "BabeApi", "next_epoch", (), @@ -2823,14 +2754,14 @@ pub mod api { &self, slot: generate_key_ownership_proof::Slot, authority_id: generate_key_ownership_proof::AuthorityId, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( generate_key_ownership_proof::Slot, generate_key_ownership_proof::AuthorityId, ), generate_key_ownership_proof::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "BabeApi", "generate_key_ownership_proof", (slot, authority_id), @@ -2853,14 +2784,14 @@ pub mod api { &self, equivocation_proof : submit_report_equivocation_unsigned_extrinsic :: EquivocationProof, key_owner_proof: submit_report_equivocation_unsigned_extrinsic::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( submit_report_equivocation_unsigned_extrinsic::EquivocationProof, submit_report_equivocation_unsigned_extrinsic::KeyOwnerProof, ), submit_report_equivocation_unsigned_extrinsic::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "BabeApi", "submit_report_equivocation_unsigned_extrinsic", (equivocation_proof, key_owner_proof), @@ -2942,11 +2873,9 @@ pub mod api { #[doc = " Retrieve authority identifiers of the current and next authority set."] pub fn authorities( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - authorities::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), authorities::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "AuthorityDiscoveryApi", "authorities", (), @@ -2963,7 +2892,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + pub type Output = ::subxt::alloc::vec::Vec< runtime_types::sp_authority_discovery::app::Public, >; } @@ -2985,11 +2914,11 @@ pub mod api { pub fn generate_session_keys( &self, seed: generate_session_keys::Seed, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (generate_session_keys::Seed,), generate_session_keys::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "SessionKeys", "generate_session_keys", (seed,), @@ -3006,11 +2935,11 @@ pub mod api { pub fn decode_session_keys( &self, encoded: decode_session_keys::Encoded, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (decode_session_keys::Encoded,), decode_session_keys::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "SessionKeys", "decode_session_keys", (encoded,), @@ -3026,24 +2955,22 @@ pub mod api { pub mod generate_session_keys { use super::root_mod; use super::runtime_types; - pub type Seed = ::core::option::Option< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >; + pub type Seed = + ::core::option::Option<::subxt::alloc::vec::Vec<::core::primitive::u8>>; pub mod output { use super::runtime_types; - pub type Output = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Output = ::subxt::alloc::vec::Vec<::core::primitive::u8>; } } pub mod decode_session_keys { use super::root_mod; use super::runtime_types; - pub type Encoded = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Encoded = ::subxt::alloc::vec::Vec<::core::primitive::u8>; pub mod output { use super::runtime_types; pub type Output = ::core::option::Option< - ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt::alloc::vec::Vec<( + ::subxt::alloc::vec::Vec<::core::primitive::u8>, runtime_types::sp_core::crypto::KeyTypeId, )>, >; @@ -3060,11 +2987,11 @@ pub mod api { pub fn account_nonce( &self, account: account_nonce::Account, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (account_nonce::Account,), account_nonce::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "AccountNonceApi", "account_nonce", (account,), @@ -3080,7 +3007,7 @@ pub mod api { pub mod account_nonce { use super::root_mod; use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Account = ::subxt::utils::AccountId32; pub mod output { use super::runtime_types; pub type Output = ::core::primitive::u32; @@ -3096,11 +3023,11 @@ pub mod api { &self, uxt: query_info::Uxt, len: query_info::Len, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (query_info::Uxt, query_info::Len), query_info::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "TransactionPaymentApi", "query_info", (uxt, len), @@ -3115,11 +3042,11 @@ pub mod api { &self, uxt: query_fee_details::Uxt, len: query_fee_details::Len, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (query_fee_details::Uxt, query_fee_details::Len), query_fee_details::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "TransactionPaymentApi", "query_fee_details", (uxt, len), @@ -3134,11 +3061,11 @@ pub mod api { pub fn query_weight_to_fee( &self, weight: query_weight_to_fee::Weight, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (query_weight_to_fee::Weight,), query_weight_to_fee::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "TransactionPaymentApi", "query_weight_to_fee", (weight,), @@ -3153,11 +3080,11 @@ pub mod api { pub fn query_length_to_fee( &self, length: query_length_to_fee::Length, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (query_length_to_fee::Length,), query_length_to_fee::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "TransactionPaymentApi", "query_length_to_fee", (length,), @@ -3172,7 +3099,7 @@ pub mod api { pub mod query_info { use super::root_mod; use super::runtime_types; - pub type Uxt = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; + pub type Uxt = :: subxt :: utils :: UncheckedExtrinsic < :: subxt :: utils :: MultiAddress < :: subxt :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; pub type Len = ::core::primitive::u32; pub mod output { use super::runtime_types; @@ -3186,7 +3113,7 @@ pub mod api { pub mod query_fee_details { use super::root_mod; use super::runtime_types; - pub type Uxt = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; + pub type Uxt = :: subxt :: utils :: UncheckedExtrinsic < :: subxt :: utils :: MultiAddress < :: subxt :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; pub type Len = ::core::primitive::u32; pub mod output { use super::runtime_types; @@ -3223,11 +3150,9 @@ pub mod api { #[doc = " Return the currently active BEEFY authority set proof."] pub fn authority_set_proof( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - authority_set_proof::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), authority_set_proof::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "BeefyMmrApi", "authority_set_proof", (), @@ -3242,11 +3167,11 @@ pub mod api { #[doc = " Return the next/queued BEEFY authority set proof."] pub fn next_authority_set_proof( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (), next_authority_set_proof::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "BeefyMmrApi", "next_authority_set_proof", (), @@ -3264,7 +3189,7 @@ pub mod api { pub mod output { use super::runtime_types; pub type Output = runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >; } } @@ -3274,7 +3199,7 @@ pub mod api { pub mod output { use super::runtime_types; pub type Output = runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >; } } @@ -3298,11 +3223,11 @@ pub mod api { pub fn build_state( &self, json: build_state::Json, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (build_state::Json,), build_state::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "GenesisBuilder", "build_state", (json,), @@ -3330,11 +3255,11 @@ pub mod api { pub fn get_preset( &self, id: get_preset::Id, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (get_preset::Id,), get_preset::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "GenesisBuilder", "get_preset", (id,), @@ -3352,11 +3277,9 @@ pub mod api { #[doc = " no named presets are provided by the runtime the list is empty."] pub fn preset_names( &self, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - (), - preset_names::output::Output, - > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ) -> ::subxt::runtime_apis::StaticPayload<(), preset_names::output::Output> + { + ::subxt::runtime_apis::StaticPayload::new_static( "GenesisBuilder", "preset_names", (), @@ -3372,23 +3295,20 @@ pub mod api { pub mod build_state { use super::root_mod; use super::runtime_types; - pub type Json = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Json = ::subxt::alloc::vec::Vec<::core::primitive::u8>; pub mod output { use super::runtime_types; - pub type Output = - ::core::result::Result<(), ::subxt::ext::subxt_core::alloc::string::String>; + pub type Output = ::core::result::Result<(), ::subxt::alloc::string::String>; } } pub mod get_preset { use super::root_mod; use super::runtime_types; - pub type Id = - ::core::option::Option<::subxt::ext::subxt_core::alloc::string::String>; + pub type Id = ::core::option::Option<::subxt::alloc::string::String>; pub mod output { use super::runtime_types; - pub type Output = ::core::option::Option< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >; + pub type Output = + ::core::option::Option<::subxt::alloc::vec::Vec<::core::primitive::u8>>; } } pub mod preset_names { @@ -3396,9 +3316,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::string::String, - >; + pub type Output = ::subxt::alloc::vec::Vec<::subxt::alloc::string::String>; } } } @@ -3417,11 +3335,11 @@ pub mod api { &self, asset: is_trusted_reserve::Asset, location: is_trusted_reserve::Location, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< (is_trusted_reserve::Asset, is_trusted_reserve::Location), is_trusted_reserve::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "TrustedQueryApi", "is_trusted_reserve", (asset, location), @@ -3441,14 +3359,14 @@ pub mod api { &self, asset: is_trusted_teleporter::Asset, location: is_trusted_teleporter::Location, - ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< + ) -> ::subxt::runtime_apis::StaticPayload< ( is_trusted_teleporter::Asset, is_trusted_teleporter::Location, ), is_trusted_teleporter::output::Output, > { - ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( + ::subxt::runtime_apis::StaticPayload::new_static( "TrustedQueryApi", "is_trusted_teleporter", (asset, location), @@ -3491,7 +3409,7 @@ pub mod api { pub fn view_functions() -> ViewFunctionsApi { ViewFunctionsApi } - pub fn custom() -> CustomValuesApi { + pub fn custom_values() -> CustomValuesApi { CustomValuesApi } pub struct CustomValuesApi; @@ -3809,178 +3727,180 @@ pub mod api { } pub struct TransactionApi; impl TransactionApi { - pub fn system(&self) -> system::calls::TransactionApi { - system::calls::TransactionApi + pub fn system(&self) -> system::calls::api::TransactionApi { + system::calls::api::TransactionApi } - pub fn babe(&self) -> babe::calls::TransactionApi { - babe::calls::TransactionApi + pub fn babe(&self) -> babe::calls::api::TransactionApi { + babe::calls::api::TransactionApi } - pub fn timestamp(&self) -> timestamp::calls::TransactionApi { - timestamp::calls::TransactionApi + pub fn timestamp(&self) -> timestamp::calls::api::TransactionApi { + timestamp::calls::api::TransactionApi } - pub fn indices(&self) -> indices::calls::TransactionApi { - indices::calls::TransactionApi + pub fn indices(&self) -> indices::calls::api::TransactionApi { + indices::calls::api::TransactionApi } - pub fn balances(&self) -> balances::calls::TransactionApi { - balances::calls::TransactionApi + pub fn balances(&self) -> balances::calls::api::TransactionApi { + balances::calls::api::TransactionApi } - pub fn parameters(&self) -> parameters::calls::TransactionApi { - parameters::calls::TransactionApi + pub fn parameters(&self) -> parameters::calls::api::TransactionApi { + parameters::calls::api::TransactionApi } - pub fn session(&self) -> session::calls::TransactionApi { - session::calls::TransactionApi + pub fn session(&self) -> session::calls::api::TransactionApi { + session::calls::api::TransactionApi } - pub fn grandpa(&self) -> grandpa::calls::TransactionApi { - grandpa::calls::TransactionApi + pub fn grandpa(&self) -> grandpa::calls::api::TransactionApi { + grandpa::calls::api::TransactionApi } - pub fn treasury(&self) -> treasury::calls::TransactionApi { - treasury::calls::TransactionApi + pub fn treasury(&self) -> treasury::calls::api::TransactionApi { + treasury::calls::api::TransactionApi } - pub fn conviction_voting(&self) -> conviction_voting::calls::TransactionApi { - conviction_voting::calls::TransactionApi + pub fn conviction_voting(&self) -> conviction_voting::calls::api::TransactionApi { + conviction_voting::calls::api::TransactionApi } - pub fn referenda(&self) -> referenda::calls::TransactionApi { - referenda::calls::TransactionApi + pub fn referenda(&self) -> referenda::calls::api::TransactionApi { + referenda::calls::api::TransactionApi } - pub fn fellowship_collective(&self) -> fellowship_collective::calls::TransactionApi { - fellowship_collective::calls::TransactionApi + pub fn fellowship_collective(&self) -> fellowship_collective::calls::api::TransactionApi { + fellowship_collective::calls::api::TransactionApi } - pub fn fellowship_referenda(&self) -> fellowship_referenda::calls::TransactionApi { - fellowship_referenda::calls::TransactionApi + pub fn fellowship_referenda(&self) -> fellowship_referenda::calls::api::TransactionApi { + fellowship_referenda::calls::api::TransactionApi } - pub fn whitelist(&self) -> whitelist::calls::TransactionApi { - whitelist::calls::TransactionApi + pub fn whitelist(&self) -> whitelist::calls::api::TransactionApi { + whitelist::calls::api::TransactionApi } - pub fn claims(&self) -> claims::calls::TransactionApi { - claims::calls::TransactionApi + pub fn claims(&self) -> claims::calls::api::TransactionApi { + claims::calls::api::TransactionApi } - pub fn utility(&self) -> utility::calls::TransactionApi { - utility::calls::TransactionApi + pub fn utility(&self) -> utility::calls::api::TransactionApi { + utility::calls::api::TransactionApi } - pub fn identity(&self) -> identity::calls::TransactionApi { - identity::calls::TransactionApi + pub fn identity(&self) -> identity::calls::api::TransactionApi { + identity::calls::api::TransactionApi } - pub fn society(&self) -> society::calls::TransactionApi { - society::calls::TransactionApi + pub fn society(&self) -> society::calls::api::TransactionApi { + society::calls::api::TransactionApi } - pub fn recovery(&self) -> recovery::calls::TransactionApi { - recovery::calls::TransactionApi + pub fn recovery(&self) -> recovery::calls::api::TransactionApi { + recovery::calls::api::TransactionApi } - pub fn vesting(&self) -> vesting::calls::TransactionApi { - vesting::calls::TransactionApi + pub fn vesting(&self) -> vesting::calls::api::TransactionApi { + vesting::calls::api::TransactionApi } - pub fn scheduler(&self) -> scheduler::calls::TransactionApi { - scheduler::calls::TransactionApi + pub fn scheduler(&self) -> scheduler::calls::api::TransactionApi { + scheduler::calls::api::TransactionApi } - pub fn proxy(&self) -> proxy::calls::TransactionApi { - proxy::calls::TransactionApi + pub fn proxy(&self) -> proxy::calls::api::TransactionApi { + proxy::calls::api::TransactionApi } - pub fn multisig(&self) -> multisig::calls::TransactionApi { - multisig::calls::TransactionApi + pub fn multisig(&self) -> multisig::calls::api::TransactionApi { + multisig::calls::api::TransactionApi } - pub fn preimage(&self) -> preimage::calls::TransactionApi { - preimage::calls::TransactionApi + pub fn preimage(&self) -> preimage::calls::api::TransactionApi { + preimage::calls::api::TransactionApi } - pub fn asset_rate(&self) -> asset_rate::calls::TransactionApi { - asset_rate::calls::TransactionApi + pub fn asset_rate(&self) -> asset_rate::calls::api::TransactionApi { + asset_rate::calls::api::TransactionApi } - pub fn bounties(&self) -> bounties::calls::TransactionApi { - bounties::calls::TransactionApi + pub fn bounties(&self) -> bounties::calls::api::TransactionApi { + bounties::calls::api::TransactionApi } - pub fn child_bounties(&self) -> child_bounties::calls::TransactionApi { - child_bounties::calls::TransactionApi + pub fn child_bounties(&self) -> child_bounties::calls::api::TransactionApi { + child_bounties::calls::api::TransactionApi } - pub fn nis(&self) -> nis::calls::TransactionApi { - nis::calls::TransactionApi + pub fn nis(&self) -> nis::calls::api::TransactionApi { + nis::calls::api::TransactionApi } - pub fn nis_counterpart_balances(&self) -> nis_counterpart_balances::calls::TransactionApi { - nis_counterpart_balances::calls::TransactionApi + pub fn nis_counterpart_balances( + &self, + ) -> nis_counterpart_balances::calls::api::TransactionApi { + nis_counterpart_balances::calls::api::TransactionApi } - pub fn configuration(&self) -> configuration::calls::TransactionApi { - configuration::calls::TransactionApi + pub fn configuration(&self) -> configuration::calls::api::TransactionApi { + configuration::calls::api::TransactionApi } - pub fn paras_shared(&self) -> paras_shared::calls::TransactionApi { - paras_shared::calls::TransactionApi + pub fn paras_shared(&self) -> paras_shared::calls::api::TransactionApi { + paras_shared::calls::api::TransactionApi } - pub fn para_inclusion(&self) -> para_inclusion::calls::TransactionApi { - para_inclusion::calls::TransactionApi + pub fn para_inclusion(&self) -> para_inclusion::calls::api::TransactionApi { + para_inclusion::calls::api::TransactionApi } - pub fn para_inherent(&self) -> para_inherent::calls::TransactionApi { - para_inherent::calls::TransactionApi + pub fn para_inherent(&self) -> para_inherent::calls::api::TransactionApi { + para_inherent::calls::api::TransactionApi } - pub fn paras(&self) -> paras::calls::TransactionApi { - paras::calls::TransactionApi + pub fn paras(&self) -> paras::calls::api::TransactionApi { + paras::calls::api::TransactionApi } - pub fn initializer(&self) -> initializer::calls::TransactionApi { - initializer::calls::TransactionApi + pub fn initializer(&self) -> initializer::calls::api::TransactionApi { + initializer::calls::api::TransactionApi } - pub fn hrmp(&self) -> hrmp::calls::TransactionApi { - hrmp::calls::TransactionApi + pub fn hrmp(&self) -> hrmp::calls::api::TransactionApi { + hrmp::calls::api::TransactionApi } - pub fn paras_disputes(&self) -> paras_disputes::calls::TransactionApi { - paras_disputes::calls::TransactionApi + pub fn paras_disputes(&self) -> paras_disputes::calls::api::TransactionApi { + paras_disputes::calls::api::TransactionApi } - pub fn paras_slashing(&self) -> paras_slashing::calls::TransactionApi { - paras_slashing::calls::TransactionApi + pub fn paras_slashing(&self) -> paras_slashing::calls::api::TransactionApi { + paras_slashing::calls::api::TransactionApi } - pub fn message_queue(&self) -> message_queue::calls::TransactionApi { - message_queue::calls::TransactionApi + pub fn message_queue(&self) -> message_queue::calls::api::TransactionApi { + message_queue::calls::api::TransactionApi } pub fn on_demand_assignment_provider( &self, - ) -> on_demand_assignment_provider::calls::TransactionApi { - on_demand_assignment_provider::calls::TransactionApi + ) -> on_demand_assignment_provider::calls::api::TransactionApi { + on_demand_assignment_provider::calls::api::TransactionApi } - pub fn registrar(&self) -> registrar::calls::TransactionApi { - registrar::calls::TransactionApi + pub fn registrar(&self) -> registrar::calls::api::TransactionApi { + registrar::calls::api::TransactionApi } - pub fn slots(&self) -> slots::calls::TransactionApi { - slots::calls::TransactionApi + pub fn slots(&self) -> slots::calls::api::TransactionApi { + slots::calls::api::TransactionApi } - pub fn auctions(&self) -> auctions::calls::TransactionApi { - auctions::calls::TransactionApi + pub fn auctions(&self) -> auctions::calls::api::TransactionApi { + auctions::calls::api::TransactionApi } - pub fn crowdloan(&self) -> crowdloan::calls::TransactionApi { - crowdloan::calls::TransactionApi + pub fn crowdloan(&self) -> crowdloan::calls::api::TransactionApi { + crowdloan::calls::api::TransactionApi } - pub fn coretime(&self) -> coretime::calls::TransactionApi { - coretime::calls::TransactionApi + pub fn coretime(&self) -> coretime::calls::api::TransactionApi { + coretime::calls::api::TransactionApi } - pub fn multi_block_migrations(&self) -> multi_block_migrations::calls::TransactionApi { - multi_block_migrations::calls::TransactionApi + pub fn multi_block_migrations(&self) -> multi_block_migrations::calls::api::TransactionApi { + multi_block_migrations::calls::api::TransactionApi } - pub fn xcm_pallet(&self) -> xcm_pallet::calls::TransactionApi { - xcm_pallet::calls::TransactionApi + pub fn xcm_pallet(&self) -> xcm_pallet::calls::api::TransactionApi { + xcm_pallet::calls::api::TransactionApi } - pub fn beefy(&self) -> beefy::calls::TransactionApi { - beefy::calls::TransactionApi + pub fn beefy(&self) -> beefy::calls::api::TransactionApi { + beefy::calls::api::TransactionApi } - pub fn identity_migrator(&self) -> identity_migrator::calls::TransactionApi { - identity_migrator::calls::TransactionApi + pub fn identity_migrator(&self) -> identity_migrator::calls::api::TransactionApi { + identity_migrator::calls::api::TransactionApi } - pub fn paras_sudo_wrapper(&self) -> paras_sudo_wrapper::calls::TransactionApi { - paras_sudo_wrapper::calls::TransactionApi + pub fn paras_sudo_wrapper(&self) -> paras_sudo_wrapper::calls::api::TransactionApi { + paras_sudo_wrapper::calls::api::TransactionApi } - pub fn assigned_slots(&self) -> assigned_slots::calls::TransactionApi { - assigned_slots::calls::TransactionApi + pub fn assigned_slots(&self) -> assigned_slots::calls::api::TransactionApi { + assigned_slots::calls::api::TransactionApi } - pub fn validator_manager(&self) -> validator_manager::calls::TransactionApi { - validator_manager::calls::TransactionApi + pub fn validator_manager(&self) -> validator_manager::calls::api::TransactionApi { + validator_manager::calls::api::TransactionApi } - pub fn state_trie_migration(&self) -> state_trie_migration::calls::TransactionApi { - state_trie_migration::calls::TransactionApi + pub fn state_trie_migration(&self) -> state_trie_migration::calls::api::TransactionApi { + state_trie_migration::calls::api::TransactionApi } - pub fn root_testing(&self) -> root_testing::calls::TransactionApi { - root_testing::calls::TransactionApi + pub fn root_testing(&self) -> root_testing::calls::api::TransactionApi { + root_testing::calls::api::TransactionApi } - pub fn sudo(&self) -> sudo::calls::TransactionApi { - sudo::calls::TransactionApi + pub fn sudo(&self) -> sudo::calls::api::TransactionApi { + sudo::calls::api::TransactionApi } } pub struct ViewFunctionsApi; impl ViewFunctionsApi {} #[doc = r" check whether the metadata provided is aligned with this statically generated code."] - pub fn is_codegen_valid_for(metadata: &::subxt::ext::subxt_core::Metadata) -> bool { + pub fn is_codegen_valid_for(metadata: &::subxt::Metadata) -> bool { let runtime_metadata_hash = metadata .hasher() .only_these_pallets(&PALLETS) @@ -4003,527 +3923,528 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Make some on-chain remark."] + #[doc = ""] + #[doc = "Can be executed by every `origin`."] + pub struct Remark { + pub remark: remark::Remark, + } + pub mod remark { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Make some on-chain remark."] - #[doc = ""] - #[doc = "Can be executed by every `origin`."] - pub struct Remark { - pub remark: remark::Remark, - } - pub mod remark { - use super::runtime_types; - pub type Remark = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Remark { - const PALLET: &'static str = "System"; - const CALL: &'static str = "remark"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the number of pages in the WebAssembly environment's heap."] - pub struct SetHeapPages { - pub pages: set_heap_pages::Pages, - } - pub mod set_heap_pages { - use super::runtime_types; - pub type Pages = ::core::primitive::u64; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHeapPages { - const PALLET: &'static str = "System"; - const CALL: &'static str = "set_heap_pages"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the new runtime code."] - pub struct SetCode { - pub code: set_code::Code, - } - pub mod set_code { - use super::runtime_types; - pub type Code = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetCode { - const PALLET: &'static str = "System"; - const CALL: &'static str = "set_code"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the new runtime code without doing any checks of the given `code`."] - #[doc = ""] - #[doc = "Note that runtime upgrades will not run if this is called with a not-increasing spec"] - #[doc = "version!"] - pub struct SetCodeWithoutChecks { - pub code: set_code_without_checks::Code, - } - pub mod set_code_without_checks { - use super::runtime_types; - pub type Code = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetCodeWithoutChecks { - const PALLET: &'static str = "System"; - const CALL: &'static str = "set_code_without_checks"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set some items of storage."] - pub struct SetStorage { - pub items: set_storage::Items, - } - pub mod set_storage { - use super::runtime_types; - pub type Items = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - )>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetStorage { - const PALLET: &'static str = "System"; - const CALL: &'static str = "set_storage"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Kill some items from storage."] - pub struct KillStorage { - pub keys: kill_storage::Keys, - } - pub mod kill_storage { - use super::runtime_types; - pub type Keys = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for KillStorage { - const PALLET: &'static str = "System"; - const CALL: &'static str = "kill_storage"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Kill all storage items with a key that starts with the given prefix."] - #[doc = ""] - #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] - #[doc = "the prefix we are removing to accurately calculate the weight of this function."] - pub struct KillPrefix { - pub prefix: kill_prefix::Prefix, - pub subkeys: kill_prefix::Subkeys, - } - pub mod kill_prefix { - use super::runtime_types; - pub type Prefix = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Subkeys = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for KillPrefix { - const PALLET: &'static str = "System"; - const CALL: &'static str = "kill_prefix"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Make some on-chain remark and emit event."] - pub struct RemarkWithEvent { - pub remark: remark_with_event::Remark, - } - pub mod remark_with_event { - use super::runtime_types; - pub type Remark = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemarkWithEvent { - const PALLET: &'static str = "System"; - const CALL: &'static str = "remark_with_event"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] - #[doc = "later."] - #[doc = ""] - #[doc = "This call requires Root origin."] - pub struct AuthorizeUpgrade { - pub code_hash: authorize_upgrade::CodeHash, - } - pub mod authorize_upgrade { - use super::runtime_types; - pub type CodeHash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AuthorizeUpgrade { - const PALLET: &'static str = "System"; - const CALL: &'static str = "authorize_upgrade"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] - #[doc = "later."] - #[doc = ""] - #[doc = "WARNING: This authorizes an upgrade that will take place without any safety checks, for"] - #[doc = "example that the spec name remains the same and that the version number increases. Not"] - #[doc = "recommended for normal use. Use `authorize_upgrade` instead."] - #[doc = ""] - #[doc = "This call requires Root origin."] - pub struct AuthorizeUpgradeWithoutChecks { - pub code_hash: authorize_upgrade_without_checks::CodeHash, - } - pub mod authorize_upgrade_without_checks { - use super::runtime_types; - pub type CodeHash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AuthorizeUpgradeWithoutChecks { - const PALLET: &'static str = "System"; - const CALL: &'static str = "authorize_upgrade_without_checks"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Provide the preimage (runtime binary) `code` for an upgrade that has been authorized."] - #[doc = ""] - #[doc = "If the authorization required a version check, this call will ensure the spec name"] - #[doc = "remains unchanged and that the spec version has increased."] - #[doc = ""] - #[doc = "Depending on the runtime's `OnSetCode` configuration, this function may directly apply"] - #[doc = "the new `code` in the same block or attempt to schedule the upgrade."] - #[doc = ""] - #[doc = "All origins are allowed."] - pub struct ApplyAuthorizedUpgrade { - pub code: apply_authorized_upgrade::Code, - } - pub mod apply_authorized_upgrade { - use super::runtime_types; - pub type Code = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApplyAuthorizedUpgrade { - const PALLET: &'static str = "System"; - const CALL: &'static str = "apply_authorized_upgrade"; + pub type Remark = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl Remark { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "remark"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Remark { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Make some on-chain remark."] - #[doc = ""] - #[doc = "Can be executed by every `origin`."] - pub fn remark( - &self, - remark: types::remark::Remark, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "remark", - types::Remark { remark }, - [ - 43u8, 126u8, 180u8, 174u8, 141u8, 48u8, 52u8, 125u8, 166u8, 212u8, - 216u8, 98u8, 100u8, 24u8, 132u8, 71u8, 101u8, 64u8, 246u8, 169u8, 33u8, - 250u8, 147u8, 208u8, 2u8, 40u8, 129u8, 209u8, 232u8, 207u8, 207u8, - 13u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the number of pages in the WebAssembly environment's heap."] + pub struct SetHeapPages { + pub pages: set_heap_pages::Pages, + } + pub mod set_heap_pages { + use super::runtime_types; + pub type Pages = ::core::primitive::u64; + } + impl SetHeapPages { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "set_heap_pages"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetHeapPages { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the number of pages in the WebAssembly environment's heap."] - pub fn set_heap_pages( - &self, - pages: types::set_heap_pages::Pages, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "set_heap_pages", - types::SetHeapPages { pages }, - [ - 188u8, 191u8, 99u8, 216u8, 219u8, 109u8, 141u8, 50u8, 78u8, 235u8, - 215u8, 242u8, 195u8, 24u8, 111u8, 76u8, 229u8, 64u8, 99u8, 225u8, - 134u8, 121u8, 81u8, 209u8, 127u8, 223u8, 98u8, 215u8, 150u8, 70u8, - 57u8, 147u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the new runtime code."] + pub struct SetCode { + pub code: set_code::Code, + } + pub mod set_code { + use super::runtime_types; + pub type Code = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl SetCode { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "set_code"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetCode { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the new runtime code."] - pub fn set_code( - &self, - code: types::set_code::Code, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "set_code", - types::SetCode { code }, - [ - 233u8, 248u8, 88u8, 245u8, 28u8, 65u8, 25u8, 169u8, 35u8, 237u8, 19u8, - 203u8, 136u8, 160u8, 18u8, 3u8, 20u8, 197u8, 81u8, 169u8, 244u8, 188u8, - 27u8, 147u8, 147u8, 236u8, 65u8, 25u8, 3u8, 143u8, 182u8, 22u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the new runtime code without doing any checks of the given `code`."] + #[doc = ""] + #[doc = "Note that runtime upgrades will not run if this is called with a not-increasing spec"] + #[doc = "version!"] + pub struct SetCodeWithoutChecks { + pub code: set_code_without_checks::Code, + } + pub mod set_code_without_checks { + use super::runtime_types; + pub type Code = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl SetCodeWithoutChecks { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "set_code_without_checks"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetCodeWithoutChecks { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the new runtime code without doing any checks of the given `code`."] - #[doc = ""] - #[doc = "Note that runtime upgrades will not run if this is called with a not-increasing spec"] - #[doc = "version!"] - pub fn set_code_without_checks( - &self, - code: types::set_code_without_checks::Code, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "set_code_without_checks", - types::SetCodeWithoutChecks { code }, - [ - 82u8, 212u8, 157u8, 44u8, 70u8, 0u8, 143u8, 15u8, 109u8, 109u8, 107u8, - 157u8, 141u8, 42u8, 169u8, 11u8, 15u8, 186u8, 252u8, 138u8, 10u8, - 147u8, 15u8, 178u8, 247u8, 229u8, 213u8, 98u8, 207u8, 231u8, 119u8, - 115u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set some items of storage."] + pub struct SetStorage { + pub items: set_storage::Items, + } + pub mod set_storage { + use super::runtime_types; + pub type Items = ::subxt::alloc::vec::Vec<( + ::subxt::alloc::vec::Vec<::core::primitive::u8>, + ::subxt::alloc::vec::Vec<::core::primitive::u8>, + )>; + } + impl SetStorage { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "set_storage"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetStorage { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set some items of storage."] - pub fn set_storage( - &self, - items: types::set_storage::Items, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "set_storage", - types::SetStorage { items }, - [ - 141u8, 216u8, 52u8, 222u8, 223u8, 136u8, 123u8, 181u8, 19u8, 75u8, - 163u8, 102u8, 229u8, 189u8, 158u8, 142u8, 95u8, 235u8, 240u8, 49u8, - 150u8, 76u8, 78u8, 137u8, 126u8, 88u8, 183u8, 88u8, 231u8, 146u8, - 234u8, 43u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Kill some items from storage."] + pub struct KillStorage { + pub keys: kill_storage::Keys, + } + pub mod kill_storage { + use super::runtime_types; + pub type Keys = + ::subxt::alloc::vec::Vec<::subxt::alloc::vec::Vec<::core::primitive::u8>>; + } + impl KillStorage { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "kill_storage"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for KillStorage { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Kill some items from storage."] - pub fn kill_storage( - &self, - keys: types::kill_storage::Keys, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "kill_storage", - types::KillStorage { keys }, - [ - 73u8, 63u8, 196u8, 36u8, 144u8, 114u8, 34u8, 213u8, 108u8, 93u8, 209u8, - 234u8, 153u8, 185u8, 33u8, 91u8, 187u8, 195u8, 223u8, 130u8, 58u8, - 156u8, 63u8, 47u8, 228u8, 249u8, 216u8, 139u8, 143u8, 177u8, 41u8, - 35u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Kill all storage items with a key that starts with the given prefix."] + #[doc = ""] + #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] + #[doc = "the prefix we are removing to accurately calculate the weight of this function."] + pub struct KillPrefix { + pub prefix: kill_prefix::Prefix, + pub subkeys: kill_prefix::Subkeys, + } + pub mod kill_prefix { + use super::runtime_types; + pub type Prefix = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + pub type Subkeys = ::core::primitive::u32; + } + impl KillPrefix { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "kill_prefix"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for KillPrefix { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Kill all storage items with a key that starts with the given prefix."] - #[doc = ""] - #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] - #[doc = "the prefix we are removing to accurately calculate the weight of this function."] - pub fn kill_prefix( - &self, - prefix: types::kill_prefix::Prefix, - subkeys: types::kill_prefix::Subkeys, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "kill_prefix", - types::KillPrefix { prefix, subkeys }, - [ - 184u8, 57u8, 139u8, 24u8, 208u8, 87u8, 108u8, 215u8, 198u8, 189u8, - 175u8, 242u8, 167u8, 215u8, 97u8, 63u8, 110u8, 166u8, 238u8, 98u8, - 67u8, 236u8, 111u8, 110u8, 234u8, 81u8, 102u8, 5u8, 182u8, 5u8, 214u8, - 85u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Make some on-chain remark and emit event."] + pub struct RemarkWithEvent { + pub remark: remark_with_event::Remark, + } + pub mod remark_with_event { + use super::runtime_types; + pub type Remark = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl RemarkWithEvent { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "remark_with_event"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemarkWithEvent { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Make some on-chain remark and emit event."] - pub fn remark_with_event( - &self, - remark: types::remark_with_event::Remark, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "remark_with_event", - types::RemarkWithEvent { remark }, - [ - 120u8, 120u8, 153u8, 92u8, 184u8, 85u8, 34u8, 2u8, 174u8, 206u8, 105u8, - 228u8, 233u8, 130u8, 80u8, 246u8, 228u8, 59u8, 234u8, 240u8, 4u8, 49u8, - 147u8, 170u8, 115u8, 91u8, 149u8, 200u8, 228u8, 181u8, 8u8, 154u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] + #[doc = ""] + #[doc = "This call requires Root origin."] + pub struct AuthorizeUpgrade { + pub code_hash: authorize_upgrade::CodeHash, + } + pub mod authorize_upgrade { + use super::runtime_types; + pub type CodeHash = ::subxt::utils::H256; + } + impl AuthorizeUpgrade { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "authorize_upgrade"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AuthorizeUpgrade { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] - #[doc = "later."] - #[doc = ""] - #[doc = "This call requires Root origin."] - pub fn authorize_upgrade( - &self, - code_hash: types::authorize_upgrade::CodeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "authorize_upgrade", - types::AuthorizeUpgrade { code_hash }, - [ - 4u8, 14u8, 76u8, 107u8, 209u8, 129u8, 9u8, 39u8, 193u8, 17u8, 84u8, - 254u8, 170u8, 214u8, 24u8, 155u8, 29u8, 184u8, 249u8, 241u8, 109u8, - 58u8, 145u8, 131u8, 109u8, 63u8, 38u8, 165u8, 107u8, 215u8, 217u8, - 172u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] + #[doc = ""] + #[doc = "WARNING: This authorizes an upgrade that will take place without any safety checks, for"] + #[doc = "example that the spec name remains the same and that the version number increases. Not"] + #[doc = "recommended for normal use. Use `authorize_upgrade` instead."] + #[doc = ""] + #[doc = "This call requires Root origin."] + pub struct AuthorizeUpgradeWithoutChecks { + pub code_hash: authorize_upgrade_without_checks::CodeHash, + } + pub mod authorize_upgrade_without_checks { + use super::runtime_types; + pub type CodeHash = ::subxt::utils::H256; + } + impl AuthorizeUpgradeWithoutChecks { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "authorize_upgrade_without_checks"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AuthorizeUpgradeWithoutChecks { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] - #[doc = "later."] - #[doc = ""] - #[doc = "WARNING: This authorizes an upgrade that will take place without any safety checks, for"] - #[doc = "example that the spec name remains the same and that the version number increases. Not"] - #[doc = "recommended for normal use. Use `authorize_upgrade` instead."] - #[doc = ""] - #[doc = "This call requires Root origin."] - pub fn authorize_upgrade_without_checks( - &self, - code_hash: types::authorize_upgrade_without_checks::CodeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::AuthorizeUpgradeWithoutChecks, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "authorize_upgrade_without_checks", - types::AuthorizeUpgradeWithoutChecks { code_hash }, - [ - 126u8, 126u8, 55u8, 26u8, 47u8, 55u8, 66u8, 8u8, 167u8, 18u8, 29u8, - 136u8, 146u8, 14u8, 189u8, 117u8, 16u8, 227u8, 162u8, 61u8, 149u8, - 197u8, 104u8, 184u8, 185u8, 161u8, 99u8, 154u8, 80u8, 125u8, 181u8, - 233u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Provide the preimage (runtime binary) `code` for an upgrade that has been authorized."] + #[doc = ""] + #[doc = "If the authorization required a version check, this call will ensure the spec name"] + #[doc = "remains unchanged and that the spec version has increased."] + #[doc = ""] + #[doc = "Depending on the runtime's `OnSetCode` configuration, this function may directly apply"] + #[doc = "the new `code` in the same block or attempt to schedule the upgrade."] + #[doc = ""] + #[doc = "All origins are allowed."] + pub struct ApplyAuthorizedUpgrade { + pub code: apply_authorized_upgrade::Code, + } + pub mod apply_authorized_upgrade { + use super::runtime_types; + pub type Code = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl ApplyAuthorizedUpgrade { + const PALLET_NAME: &'static str = "System"; + const CALL_NAME: &'static str = "apply_authorized_upgrade"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ApplyAuthorizedUpgrade { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Provide the preimage (runtime binary) `code` for an upgrade that has been authorized."] - #[doc = ""] - #[doc = "If the authorization required a version check, this call will ensure the spec name"] - #[doc = "remains unchanged and that the spec version has increased."] - #[doc = ""] - #[doc = "Depending on the runtime's `OnSetCode` configuration, this function may directly apply"] - #[doc = "the new `code` in the same block or attempt to schedule the upgrade."] - #[doc = ""] - #[doc = "All origins are allowed."] - pub fn apply_authorized_upgrade( - &self, - code: types::apply_authorized_upgrade::Code, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ApplyAuthorizedUpgrade, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "System", - "apply_authorized_upgrade", - types::ApplyAuthorizedUpgrade { code }, - [ - 232u8, 107u8, 127u8, 38u8, 230u8, 29u8, 97u8, 4u8, 160u8, 191u8, 222u8, - 156u8, 245u8, 102u8, 196u8, 141u8, 44u8, 163u8, 98u8, 68u8, 125u8, - 32u8, 124u8, 101u8, 108u8, 93u8, 211u8, 52u8, 0u8, 231u8, 33u8, 227u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Make some on-chain remark."] + #[doc = ""] + #[doc = "Can be executed by every `origin`."] + pub fn remark( + &self, + remark: super::remark::Remark, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "System", + "remark", + super::Remark { remark }, + [ + 43u8, 126u8, 180u8, 174u8, 141u8, 48u8, 52u8, 125u8, 166u8, 212u8, + 216u8, 98u8, 100u8, 24u8, 132u8, 71u8, 101u8, 64u8, 246u8, 169u8, + 33u8, 250u8, 147u8, 208u8, 2u8, 40u8, 129u8, 209u8, 232u8, 207u8, + 207u8, 13u8, + ], + ) + } + #[doc = "Set the number of pages in the WebAssembly environment's heap."] + pub fn set_heap_pages( + &self, + pages: super::set_heap_pages::Pages, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "System", + "set_heap_pages", + super::SetHeapPages { pages }, + [ + 188u8, 191u8, 99u8, 216u8, 219u8, 109u8, 141u8, 50u8, 78u8, 235u8, + 215u8, 242u8, 195u8, 24u8, 111u8, 76u8, 229u8, 64u8, 99u8, 225u8, + 134u8, 121u8, 81u8, 209u8, 127u8, 223u8, 98u8, 215u8, 150u8, 70u8, + 57u8, 147u8, + ], + ) + } + #[doc = "Set the new runtime code."] + pub fn set_code( + &self, + code: super::set_code::Code, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "System", + "set_code", + super::SetCode { code }, + [ + 233u8, 248u8, 88u8, 245u8, 28u8, 65u8, 25u8, 169u8, 35u8, 237u8, + 19u8, 203u8, 136u8, 160u8, 18u8, 3u8, 20u8, 197u8, 81u8, 169u8, + 244u8, 188u8, 27u8, 147u8, 147u8, 236u8, 65u8, 25u8, 3u8, 143u8, + 182u8, 22u8, + ], + ) + } + #[doc = "Set the new runtime code without doing any checks of the given `code`."] + #[doc = ""] + #[doc = "Note that runtime upgrades will not run if this is called with a not-increasing spec"] + #[doc = "version!"] + pub fn set_code_without_checks( + &self, + code: super::set_code_without_checks::Code, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "System", + "set_code_without_checks", + super::SetCodeWithoutChecks { code }, + [ + 82u8, 212u8, 157u8, 44u8, 70u8, 0u8, 143u8, 15u8, 109u8, 109u8, + 107u8, 157u8, 141u8, 42u8, 169u8, 11u8, 15u8, 186u8, 252u8, 138u8, + 10u8, 147u8, 15u8, 178u8, 247u8, 229u8, 213u8, 98u8, 207u8, 231u8, + 119u8, 115u8, + ], + ) + } + #[doc = "Set some items of storage."] + pub fn set_storage( + &self, + items: super::set_storage::Items, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "System", + "set_storage", + super::SetStorage { items }, + [ + 141u8, 216u8, 52u8, 222u8, 223u8, 136u8, 123u8, 181u8, 19u8, 75u8, + 163u8, 102u8, 229u8, 189u8, 158u8, 142u8, 95u8, 235u8, 240u8, 49u8, + 150u8, 76u8, 78u8, 137u8, 126u8, 88u8, 183u8, 88u8, 231u8, 146u8, + 234u8, 43u8, + ], + ) + } + #[doc = "Kill some items from storage."] + pub fn kill_storage( + &self, + keys: super::kill_storage::Keys, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "System", + "kill_storage", + super::KillStorage { keys }, + [ + 73u8, 63u8, 196u8, 36u8, 144u8, 114u8, 34u8, 213u8, 108u8, 93u8, + 209u8, 234u8, 153u8, 185u8, 33u8, 91u8, 187u8, 195u8, 223u8, 130u8, + 58u8, 156u8, 63u8, 47u8, 228u8, 249u8, 216u8, 139u8, 143u8, 177u8, + 41u8, 35u8, + ], + ) + } + #[doc = "Kill all storage items with a key that starts with the given prefix."] + #[doc = ""] + #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] + #[doc = "the prefix we are removing to accurately calculate the weight of this function."] + pub fn kill_prefix( + &self, + prefix: super::kill_prefix::Prefix, + subkeys: super::kill_prefix::Subkeys, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "System", + "kill_prefix", + super::KillPrefix { prefix, subkeys }, + [ + 184u8, 57u8, 139u8, 24u8, 208u8, 87u8, 108u8, 215u8, 198u8, 189u8, + 175u8, 242u8, 167u8, 215u8, 97u8, 63u8, 110u8, 166u8, 238u8, 98u8, + 67u8, 236u8, 111u8, 110u8, 234u8, 81u8, 102u8, 5u8, 182u8, 5u8, + 214u8, 85u8, + ], + ) + } + #[doc = "Make some on-chain remark and emit event."] + pub fn remark_with_event( + &self, + remark: super::remark_with_event::Remark, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "System", + "remark_with_event", + super::RemarkWithEvent { remark }, + [ + 120u8, 120u8, 153u8, 92u8, 184u8, 85u8, 34u8, 2u8, 174u8, 206u8, + 105u8, 228u8, 233u8, 130u8, 80u8, 246u8, 228u8, 59u8, 234u8, 240u8, + 4u8, 49u8, 147u8, 170u8, 115u8, 91u8, 149u8, 200u8, 228u8, 181u8, + 8u8, 154u8, + ], + ) + } + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] + #[doc = ""] + #[doc = "This call requires Root origin."] + pub fn authorize_upgrade( + &self, + code_hash: super::authorize_upgrade::CodeHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "System", + "authorize_upgrade", + super::AuthorizeUpgrade { code_hash }, + [ + 4u8, 14u8, 76u8, 107u8, 209u8, 129u8, 9u8, 39u8, 193u8, 17u8, 84u8, + 254u8, 170u8, 214u8, 24u8, 155u8, 29u8, 184u8, 249u8, 241u8, 109u8, + 58u8, 145u8, 131u8, 109u8, 63u8, 38u8, 165u8, 107u8, 215u8, 217u8, + 172u8, + ], + ) + } + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] + #[doc = ""] + #[doc = "WARNING: This authorizes an upgrade that will take place without any safety checks, for"] + #[doc = "example that the spec name remains the same and that the version number increases. Not"] + #[doc = "recommended for normal use. Use `authorize_upgrade` instead."] + #[doc = ""] + #[doc = "This call requires Root origin."] + pub fn authorize_upgrade_without_checks( + &self, + code_hash: super::authorize_upgrade_without_checks::CodeHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "System", + "authorize_upgrade_without_checks", + super::AuthorizeUpgradeWithoutChecks { code_hash }, + [ + 126u8, 126u8, 55u8, 26u8, 47u8, 55u8, 66u8, 8u8, 167u8, 18u8, 29u8, + 136u8, 146u8, 14u8, 189u8, 117u8, 16u8, 227u8, 162u8, 61u8, 149u8, + 197u8, 104u8, 184u8, 185u8, 161u8, 99u8, 154u8, 80u8, 125u8, 181u8, + 233u8, + ], + ) + } + #[doc = "Provide the preimage (runtime binary) `code` for an upgrade that has been authorized."] + #[doc = ""] + #[doc = "If the authorization required a version check, this call will ensure the spec name"] + #[doc = "remains unchanged and that the spec version has increased."] + #[doc = ""] + #[doc = "Depending on the runtime's `OnSetCode` configuration, this function may directly apply"] + #[doc = "the new `code` in the same block or attempt to schedule the upgrade."] + #[doc = ""] + #[doc = "All origins are allowed."] + pub fn apply_authorized_upgrade( + &self, + code: super::apply_authorized_upgrade::Code, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "System", + "apply_authorized_upgrade", + super::ApplyAuthorizedUpgrade { code }, + [ + 232u8, 107u8, 127u8, 38u8, 230u8, 29u8, 97u8, 4u8, 160u8, 191u8, + 222u8, 156u8, 245u8, 102u8, 196u8, 141u8, 44u8, 163u8, 98u8, 68u8, + 125u8, 32u8, 124u8, 101u8, 108u8, 93u8, 211u8, 52u8, 0u8, 231u8, + 33u8, 227u8, + ], + ) + } } } } @@ -4532,12 +4453,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An extrinsic completed successfully."] pub struct ExtrinsicSuccess { pub dispatch_info: extrinsic_success::DispatchInfo, @@ -4546,17 +4467,22 @@ pub mod api { use super::runtime_types; pub type DispatchInfo = runtime_types::frame_system::DispatchEventInfo; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ExtrinsicSuccess { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "ExtrinsicSuccess"; + impl ExtrinsicSuccess { + const PALLET_NAME: &'static str = "System"; + const EVENT_NAME: &'static str = "ExtrinsicSuccess"; + } + impl ::subxt::events::DecodeAsEvent for ExtrinsicSuccess { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An extrinsic failed."] pub struct ExtrinsicFailed { pub dispatch_error: extrinsic_failed::DispatchError, @@ -4567,68 +4493,88 @@ pub mod api { pub type DispatchError = runtime_types::sp_runtime::DispatchError; pub type DispatchInfo = runtime_types::frame_system::DispatchEventInfo; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ExtrinsicFailed { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "ExtrinsicFailed"; + impl ExtrinsicFailed { + const PALLET_NAME: &'static str = "System"; + const EVENT_NAME: &'static str = "ExtrinsicFailed"; + } + impl ::subxt::events::DecodeAsEvent for ExtrinsicFailed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "`:code` was updated."] pub struct CodeUpdated; - impl ::subxt::ext::subxt_core::events::StaticEvent for CodeUpdated { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "CodeUpdated"; + impl CodeUpdated { + const PALLET_NAME: &'static str = "System"; + const EVENT_NAME: &'static str = "CodeUpdated"; + } + impl ::subxt::events::DecodeAsEvent for CodeUpdated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A new account was created."] pub struct NewAccount { pub account: new_account::Account, } pub mod new_account { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Account = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NewAccount { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "NewAccount"; + impl NewAccount { + const PALLET_NAME: &'static str = "System"; + const EVENT_NAME: &'static str = "NewAccount"; + } + impl ::subxt::events::DecodeAsEvent for NewAccount { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An account was reaped."] pub struct KilledAccount { pub account: killed_account::Account, } pub mod killed_account { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Account = ::subxt::utils::AccountId32; + } + impl KilledAccount { + const PALLET_NAME: &'static str = "System"; + const EVENT_NAME: &'static str = "KilledAccount"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for KilledAccount { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "KilledAccount"; + impl ::subxt::events::DecodeAsEvent for KilledAccount { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "On on-chain remark happened."] pub struct Remarked { pub sender: remarked::Sender, @@ -4636,20 +4582,25 @@ pub mod api { } pub mod remarked { use super::runtime_types; - pub type Sender = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Sender = ::subxt::utils::AccountId32; + pub type Hash = ::subxt::utils::H256; + } + impl Remarked { + const PALLET_NAME: &'static str = "System"; + const EVENT_NAME: &'static str = "Remarked"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Remarked { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "Remarked"; + impl ::subxt::events::DecodeAsEvent for Remarked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An upgrade was authorized."] pub struct UpgradeAuthorized { pub code_hash: upgrade_authorized::CodeHash, @@ -4657,20 +4608,25 @@ pub mod api { } pub mod upgrade_authorized { use super::runtime_types; - pub type CodeHash = ::subxt::ext::subxt_core::utils::H256; + pub type CodeHash = ::subxt::utils::H256; pub type CheckVersion = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UpgradeAuthorized { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "UpgradeAuthorized"; + impl UpgradeAuthorized { + const PALLET_NAME: &'static str = "System"; + const EVENT_NAME: &'static str = "UpgradeAuthorized"; + } + impl ::subxt::events::DecodeAsEvent for UpgradeAuthorized { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An invalid authorized upgrade was rejected while trying to apply it."] pub struct RejectedInvalidAuthorizedUpgrade { pub code_hash: rejected_invalid_authorized_upgrade::CodeHash, @@ -4678,12 +4634,17 @@ pub mod api { } pub mod rejected_invalid_authorized_upgrade { use super::runtime_types; - pub type CodeHash = ::subxt::ext::subxt_core::utils::H256; + pub type CodeHash = ::subxt::utils::H256; pub type Error = runtime_types::sp_runtime::DispatchError; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RejectedInvalidAuthorizedUpgrade { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "RejectedInvalidAuthorizedUpgrade"; + impl RejectedInvalidAuthorizedUpgrade { + const PALLET_NAME: &'static str = "System"; + const EVENT_NAME: &'static str = "RejectedInvalidAuthorizedUpgrade"; + } + impl ::subxt::events::DecodeAsEvent for RejectedInvalidAuthorizedUpgrade { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -4694,12 +4655,12 @@ pub mod api { #[doc = " The full account information for a particular account ID."] pub fn account( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (account::Param0,), - account::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (account::input::Param0,), + account::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "Account", [ @@ -4712,12 +4673,9 @@ pub mod api { #[doc = " Total extrinsics count for the current block."] pub fn extrinsic_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - extrinsic_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), extrinsic_count::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "System", "ExtrinsicCount", [ @@ -4731,12 +4689,12 @@ pub mod api { #[doc = " Whether all inherents have been applied."] pub fn inherents_applied( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - inherents_applied::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + inherents_applied::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "InherentsApplied", [ @@ -4749,12 +4707,9 @@ pub mod api { #[doc = " The current weight for the block."] pub fn block_weight( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - block_weight::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), block_weight::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "System", "BlockWeight", [ @@ -4767,12 +4722,12 @@ pub mod api { #[doc = " Total length (in bytes) for all extrinsics put together, for the current block."] pub fn all_extrinsics_len( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - all_extrinsics_len::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + all_extrinsics_len::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "AllExtrinsicsLen", [ @@ -4785,12 +4740,12 @@ pub mod api { #[doc = " Map of block numbers to block hashes."] pub fn block_hash( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (block_hash::Param0,), - block_hash::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (block_hash::input::Param0,), + block_hash::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "BlockHash", [ @@ -4803,12 +4758,12 @@ pub mod api { #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] pub fn extrinsic_data( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (extrinsic_data::Param0,), - extrinsic_data::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (extrinsic_data::input::Param0,), + extrinsic_data::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "ExtrinsicData", [ @@ -4822,12 +4777,9 @@ pub mod api { #[doc = " The current block number being processed. Set by `execute_block`."] pub fn number( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - number::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), number::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "System", "Number", [ @@ -4840,12 +4792,9 @@ pub mod api { #[doc = " Hash of the previous block."] pub fn parent_hash( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - parent_hash::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), parent_hash::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "System", "ParentHash", [ @@ -4858,12 +4807,9 @@ pub mod api { #[doc = " Digest of the current block, also part of the block header."] pub fn digest( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - digest::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), digest::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "System", "Digest", [ @@ -4883,12 +4829,9 @@ pub mod api { #[doc = " just in case someone still reads them from within the runtime."] pub fn events( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - events::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), events::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "System", "Events", [ @@ -4901,12 +4844,9 @@ pub mod api { #[doc = " The number of events in the `Events` list."] pub fn event_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - event_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), event_count::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "System", "EventCount", [ @@ -4928,12 +4868,12 @@ pub mod api { #[doc = " no notification will be triggered thus the event might be lost."] pub fn event_topics( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (event_topics::Param0,), - event_topics::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (event_topics::input::Param0,), + event_topics::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "EventTopics", [ @@ -4946,12 +4886,12 @@ pub mod api { #[doc = " Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened."] pub fn last_runtime_upgrade( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - last_runtime_upgrade::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + last_runtime_upgrade::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "LastRuntimeUpgrade", [ @@ -4965,12 +4905,12 @@ pub mod api { #[doc = " True if we have upgraded so that `type RefCount` is `u32`. False (default) if not."] pub fn upgraded_to_u32_ref_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - upgraded_to_u32_ref_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + upgraded_to_u32_ref_count::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "UpgradedToU32RefCount", [ @@ -4984,12 +4924,12 @@ pub mod api { #[doc = " (default) if not."] pub fn upgraded_to_triple_ref_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - upgraded_to_triple_ref_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + upgraded_to_triple_ref_count::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "UpgradedToTripleRefCount", [ @@ -5002,12 +4942,9 @@ pub mod api { #[doc = " The execution phase of the block."] pub fn execution_phase( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - execution_phase::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), execution_phase::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "System", "ExecutionPhase", [ @@ -5020,12 +4957,12 @@ pub mod api { #[doc = " `Some` if a code upgrade has been authorized."] pub fn authorized_upgrade( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - authorized_upgrade::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + authorized_upgrade::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "AuthorizedUpgrade", [ @@ -5044,12 +4981,12 @@ pub mod api { #[doc = " reduction."] pub fn extrinsic_weight_reclaimed( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - extrinsic_weight_reclaimed::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + extrinsic_weight_reclaimed::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "System", "ExtrinsicWeightReclaimed", [ @@ -5064,172 +5001,169 @@ pub mod api { pub mod account { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::frame_system::AccountInfo< - ::core::primitive::u32, - runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::frame_system::AccountInfo< + ::core::primitive::u32, + runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>, + >; } pub mod extrinsic_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod inherents_applied { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::bool; } + pub type Output = ::core::primitive::bool; } pub mod block_weight { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::frame_support::dispatch::PerDispatchClass< - runtime_types::sp_weights::weight_v2::Weight, - >; } + pub type Output = runtime_types::frame_support::dispatch::PerDispatchClass< + runtime_types::sp_weights::weight_v2::Weight, + >; } pub mod all_extrinsics_len { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod block_hash { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::H256; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::subxt::utils::H256; } pub mod extrinsic_data { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::subxt::alloc::vec::Vec<::core::primitive::u8>; } pub mod number { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod parent_hash { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::H256; } + pub type Output = ::subxt::utils::H256; } pub mod digest { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_runtime::generic::digest::Digest; } + pub type Output = runtime_types::sp_runtime::generic::digest::Digest; } pub mod events { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::frame_system::EventRecord< - runtime_types::rococo_runtime::RuntimeEvent, - ::subxt::ext::subxt_core::utils::H256, - >, - >; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::frame_system::EventRecord< + runtime_types::rococo_runtime::RuntimeEvent, + ::subxt::utils::H256, + >, + >; } pub mod event_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod event_topics { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u32, - ::core::primitive::u32, - )>; + pub type Param0 = ::subxt::utils::H256; } + pub type Output = + ::subxt::alloc::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; } pub mod last_runtime_upgrade { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::frame_system::LastRuntimeUpgradeInfo; } + pub type Output = runtime_types::frame_system::LastRuntimeUpgradeInfo; } pub mod upgraded_to_u32_ref_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::bool; } + pub type Output = ::core::primitive::bool; } pub mod upgraded_to_triple_ref_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::bool; } + pub type Output = ::core::primitive::bool; } pub mod execution_phase { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::frame_system::Phase; } + pub type Output = runtime_types::frame_system::Phase; } pub mod authorized_upgrade { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::frame_system::CodeUpgradeAuthorization; } + pub type Output = runtime_types::frame_system::CodeUpgradeAuthorization; } pub mod extrinsic_weight_reclaimed { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_weights::weight_v2::Weight; } + pub type Output = runtime_types::sp_weights::weight_v2::Weight; } } pub mod constants { @@ -5239,10 +5173,10 @@ pub mod api { #[doc = " Block & extrinsics weights: base values and limits."] pub fn block_weights( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< runtime_types::frame_system::limits::BlockWeights, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "System", "BlockWeights", [ @@ -5255,10 +5189,10 @@ pub mod api { #[doc = " The maximum length of a block (in bytes)."] pub fn block_length( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< runtime_types::frame_system::limits::BlockLength, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "System", "BlockLength", [ @@ -5271,10 +5205,8 @@ pub mod api { #[doc = " Maximum number of block number to block hash mappings to keep (oldest pruned first)."] pub fn block_hash_count( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "System", "BlockHashCount", [ @@ -5288,10 +5220,9 @@ pub mod api { #[doc = " The weight of runtime database operations the runtime can invoke."] pub fn db_weight( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_weights::RuntimeDbWeight, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress + { + ::subxt::constants::StaticAddress::new_static( "System", "DbWeight", [ @@ -5305,10 +5236,9 @@ pub mod api { #[doc = " Get the chain's in-code version."] pub fn version( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_version::RuntimeVersion, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress + { + ::subxt::constants::StaticAddress::new_static( "System", "Version", [ @@ -5325,10 +5255,8 @@ pub mod api { #[doc = " an identifier of the chain."] pub fn ss58_prefix( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u16, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u16> { + ::subxt::constants::StaticAddress::new_static( "System", "SS58Prefix", [ @@ -5351,193 +5279,185 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Report authority equivocation/misbehavior. This method will verify"] + #[doc = "the equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence will"] + #[doc = "be reported."] + pub struct ReportEquivocation { + pub equivocation_proof: + ::subxt::alloc::boxed::Box, + pub key_owner_proof: report_equivocation::KeyOwnerProof, + } + pub mod report_equivocation { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Report authority equivocation/misbehavior. This method will verify"] - #[doc = "the equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence will"] - #[doc = "be reported."] - pub struct ReportEquivocation { - pub equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_equivocation::EquivocationProof, - >, - pub key_owner_proof: report_equivocation::KeyOwnerProof, - } - pub mod report_equivocation { - use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - >, - runtime_types::sp_consensus_babe::app::Public, - >; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportEquivocation { - const PALLET: &'static str = "Babe"; - const CALL: &'static str = "report_equivocation"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Report authority equivocation/misbehavior. This method will verify"] - #[doc = "the equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence will"] - #[doc = "be reported."] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub struct ReportEquivocationUnsigned { - pub equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_equivocation_unsigned::EquivocationProof, - >, - pub key_owner_proof: report_equivocation_unsigned::KeyOwnerProof, - } - pub mod report_equivocation_unsigned { - use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - >, - runtime_types::sp_consensus_babe::app::Public, - >; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportEquivocationUnsigned { - const PALLET: &'static str = "Babe"; - const CALL: &'static str = "report_equivocation_unsigned"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] - #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] - #[doc = "Multiple calls to this method will replace any existing planned config change that had"] - #[doc = "not been enacted yet."] - pub struct PlanConfigChange { - pub config: plan_config_change::Config, - } - pub mod plan_config_change { - use super::runtime_types; - pub type Config = - runtime_types::sp_consensus_babe::digests::NextConfigDescriptor; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlanConfigChange { - const PALLET: &'static str = "Babe"; - const CALL: &'static str = "plan_config_change"; + pub type EquivocationProof = runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, + runtime_types::sp_consensus_babe::app::Public, + >; + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + impl ReportEquivocation { + const PALLET_NAME: &'static str = "Babe"; + const CALL_NAME: &'static str = "report_equivocation"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportEquivocation { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Report authority equivocation/misbehavior. This method will verify"] - #[doc = "the equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence will"] - #[doc = "be reported."] - pub fn report_equivocation( - &self, - equivocation_proof: types::report_equivocation::EquivocationProof, - key_owner_proof: types::report_equivocation::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Babe", - "report_equivocation", - types::ReportEquivocation { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }, - [ - 97u8, 65u8, 136u8, 207u8, 137u8, 113u8, 206u8, 76u8, 166u8, 245u8, - 231u8, 162u8, 65u8, 47u8, 251u8, 149u8, 68u8, 179u8, 13u8, 123u8, - 209u8, 146u8, 83u8, 54u8, 14u8, 150u8, 62u8, 195u8, 27u8, 190u8, 76u8, - 224u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Report authority equivocation/misbehavior. This method will verify"] + #[doc = "the equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence will"] + #[doc = "be reported."] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub struct ReportEquivocationUnsigned { + pub equivocation_proof: + ::subxt::alloc::boxed::Box, + pub key_owner_proof: report_equivocation_unsigned::KeyOwnerProof, + } + pub mod report_equivocation_unsigned { + use super::runtime_types; + pub type EquivocationProof = runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, + runtime_types::sp_consensus_babe::app::Public, + >; + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + impl ReportEquivocationUnsigned { + const PALLET_NAME: &'static str = "Babe"; + const CALL_NAME: &'static str = "report_equivocation_unsigned"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportEquivocationUnsigned { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Report authority equivocation/misbehavior. This method will verify"] - #[doc = "the equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence will"] - #[doc = "be reported."] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub fn report_equivocation_unsigned( - &self, - equivocation_proof: types::report_equivocation_unsigned::EquivocationProof, - key_owner_proof: types::report_equivocation_unsigned::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ReportEquivocationUnsigned, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Babe", - "report_equivocation_unsigned", - types::ReportEquivocationUnsigned { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }, - [ - 184u8, 158u8, 14u8, 168u8, 175u8, 23u8, 10u8, 63u8, 54u8, 15u8, 182u8, - 163u8, 5u8, 49u8, 223u8, 197u8, 45u8, 204u8, 216u8, 26u8, 126u8, 157u8, - 242u8, 233u8, 228u8, 203u8, 117u8, 216u8, 185u8, 157u8, 199u8, 117u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] + #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] + #[doc = "Multiple calls to this method will replace any existing planned config change that had"] + #[doc = "not been enacted yet."] + pub struct PlanConfigChange { + pub config: plan_config_change::Config, + } + pub mod plan_config_change { + use super::runtime_types; + pub type Config = runtime_types::sp_consensus_babe::digests::NextConfigDescriptor; + } + impl PlanConfigChange { + const PALLET_NAME: &'static str = "Babe"; + const CALL_NAME: &'static str = "plan_config_change"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PlanConfigChange { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] - #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] - #[doc = "Multiple calls to this method will replace any existing planned config change that had"] - #[doc = "not been enacted yet."] - pub fn plan_config_change( - &self, - config: types::plan_config_change::Config, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Babe", - "plan_config_change", - types::PlanConfigChange { config }, - [ - 227u8, 155u8, 182u8, 231u8, 240u8, 107u8, 30u8, 22u8, 15u8, 52u8, - 172u8, 203u8, 115u8, 47u8, 6u8, 66u8, 170u8, 231u8, 186u8, 77u8, 19u8, - 235u8, 91u8, 136u8, 95u8, 149u8, 188u8, 163u8, 161u8, 109u8, 164u8, - 179u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Report authority equivocation/misbehavior. This method will verify"] + #[doc = "the equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence will"] + #[doc = "be reported."] + pub fn report_equivocation( + &self, + equivocation_proof: super::report_equivocation::EquivocationProof, + key_owner_proof: super::report_equivocation::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Babe", + "report_equivocation", + super::ReportEquivocation { + equivocation_proof: ::subxt::alloc::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }, + [ + 97u8, 65u8, 136u8, 207u8, 137u8, 113u8, 206u8, 76u8, 166u8, 245u8, + 231u8, 162u8, 65u8, 47u8, 251u8, 149u8, 68u8, 179u8, 13u8, 123u8, + 209u8, 146u8, 83u8, 54u8, 14u8, 150u8, 62u8, 195u8, 27u8, 190u8, + 76u8, 224u8, + ], + ) + } + #[doc = "Report authority equivocation/misbehavior. This method will verify"] + #[doc = "the equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence will"] + #[doc = "be reported."] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub fn report_equivocation_unsigned( + &self, + equivocation_proof: super::report_equivocation_unsigned::EquivocationProof, + key_owner_proof: super::report_equivocation_unsigned::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Babe", + "report_equivocation_unsigned", + super::ReportEquivocationUnsigned { + equivocation_proof: ::subxt::alloc::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }, + [ + 184u8, 158u8, 14u8, 168u8, 175u8, 23u8, 10u8, 63u8, 54u8, 15u8, + 182u8, 163u8, 5u8, 49u8, 223u8, 197u8, 45u8, 204u8, 216u8, 26u8, + 126u8, 157u8, 242u8, 233u8, 228u8, 203u8, 117u8, 216u8, 185u8, + 157u8, 199u8, 117u8, + ], + ) + } + #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] + #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] + #[doc = "Multiple calls to this method will replace any existing planned config change that had"] + #[doc = "not been enacted yet."] + pub fn plan_config_change( + &self, + config: super::plan_config_change::Config, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Babe", + "plan_config_change", + super::PlanConfigChange { config }, + [ + 227u8, 155u8, 182u8, 231u8, 240u8, 107u8, 30u8, 22u8, 15u8, 52u8, + 172u8, 203u8, 115u8, 47u8, 6u8, 66u8, 170u8, 231u8, 186u8, 77u8, + 19u8, 235u8, 91u8, 136u8, 95u8, 149u8, 188u8, 163u8, 161u8, 109u8, + 164u8, 179u8, + ], + ) + } } } } @@ -5549,12 +5469,9 @@ pub mod api { #[doc = " Current epoch index."] pub fn epoch_index( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - epoch_index::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), epoch_index::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "EpochIndex", [ @@ -5567,12 +5484,9 @@ pub mod api { #[doc = " Current epoch authorities."] pub fn authorities( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - authorities::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), authorities::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "Authorities", [ @@ -5586,12 +5500,9 @@ pub mod api { #[doc = " until the first block of the chain."] pub fn genesis_slot( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - genesis_slot::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), genesis_slot::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "GenesisSlot", [ @@ -5605,12 +5516,9 @@ pub mod api { #[doc = " Current slot number."] pub fn current_slot( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - current_slot::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), current_slot::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "CurrentSlot", [ @@ -5633,12 +5541,9 @@ pub mod api { #[doc = " adversary, for purposes such as public-coin zero-knowledge proofs."] pub fn randomness( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - randomness::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), randomness::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "Randomness", [ @@ -5652,12 +5557,12 @@ pub mod api { #[doc = " Pending epoch configuration change that will be applied when the next epoch is enacted."] pub fn pending_epoch_config_change( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - pending_epoch_config_change::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + pending_epoch_config_change::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Babe", "PendingEpochConfigChange", [ @@ -5670,12 +5575,9 @@ pub mod api { #[doc = " Next epoch randomness."] pub fn next_randomness( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - next_randomness::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), next_randomness::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "NextRandomness", [ @@ -5688,12 +5590,12 @@ pub mod api { #[doc = " Next epoch authorities."] pub fn next_authorities( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - next_authorities::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + next_authorities::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Babe", "NextAuthorities", [ @@ -5714,12 +5616,9 @@ pub mod api { #[doc = " epoch."] pub fn segment_index( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - segment_index::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), segment_index::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "SegmentIndex", [ @@ -5732,12 +5631,12 @@ pub mod api { #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] pub fn under_construction( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (under_construction::Param0,), - under_construction::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (under_construction::input::Param0,), + under_construction::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Babe", "UnderConstruction", [ @@ -5751,12 +5650,9 @@ pub mod api { #[doc = " if per-block initialization has already been called for current block."] pub fn initialized( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - initialized::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), initialized::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "Initialized", [ @@ -5773,12 +5669,12 @@ pub mod api { #[doc = " It is set in `on_finalize`, before it will contain the value from the last block."] pub fn author_vrf_randomness( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - author_vrf_randomness::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + author_vrf_randomness::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Babe", "AuthorVrfRandomness", [ @@ -5795,12 +5691,9 @@ pub mod api { #[doc = " slots, which may be skipped, the block numbers may not line up with the slot numbers."] pub fn epoch_start( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - epoch_start::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), epoch_start::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "EpochStart", [ @@ -5817,12 +5710,9 @@ pub mod api { #[doc = " execution context should always yield zero."] pub fn lateness( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - lateness::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), lateness::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "Lateness", [ @@ -5836,12 +5726,9 @@ pub mod api { #[doc = " genesis."] pub fn epoch_config( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - epoch_config::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), epoch_config::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "EpochConfig", [ @@ -5855,12 +5742,12 @@ pub mod api { #[doc = " (you can fallback to `EpochConfig` instead in that case)."] pub fn next_epoch_config( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - next_epoch_config::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + next_epoch_config::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Babe", "NextEpochConfig", [ @@ -5880,12 +5767,9 @@ pub mod api { #[doc = " active epoch index was during that session."] pub fn skipped_epochs( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - skipped_epochs::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), skipped_epochs::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Babe", "SkippedEpochs", [ @@ -5899,154 +5783,153 @@ pub mod api { pub mod epoch_index { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u64; } + pub type Output = ::core::primitive::u64; } pub mod authorities { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_consensus_babe::app::Public, - ::core::primitive::u64, - )>; } + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( + runtime_types::sp_consensus_babe::app::Public, + ::core::primitive::u64, + )>; } pub mod genesis_slot { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_consensus_slots::Slot; } + pub type Output = runtime_types::sp_consensus_slots::Slot; } pub mod current_slot { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_consensus_slots::Slot; } + pub type Output = runtime_types::sp_consensus_slots::Slot; } pub mod randomness { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = [::core::primitive::u8; 32usize]; } + pub type Output = [::core::primitive::u8; 32usize]; } pub mod pending_epoch_config_change { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::sp_consensus_babe::digests::NextConfigDescriptor; } + pub type Output = runtime_types::sp_consensus_babe::digests::NextConfigDescriptor; } pub mod next_randomness { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = [::core::primitive::u8; 32usize]; } + pub type Output = [::core::primitive::u8; 32usize]; } pub mod next_authorities { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_consensus_babe::app::Public, - ::core::primitive::u64, - )>; } + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( + runtime_types::sp_consensus_babe::app::Public, + ::core::primitive::u64, + )>; } pub mod segment_index { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod under_construction { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >; + pub type Param0 = ::core::primitive::u32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + [::core::primitive::u8; 32usize], + >; } pub mod initialized { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::sp_consensus_babe::digests::PreDigest, - >; } + pub type Output = + ::core::option::Option; } pub mod author_vrf_randomness { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::option::Option<[::core::primitive::u8; 32usize]>; } + pub type Output = ::core::option::Option<[::core::primitive::u8; 32usize]>; } pub mod epoch_start { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (::core::primitive::u32, ::core::primitive::u32); } + pub type Output = (::core::primitive::u32, ::core::primitive::u32); } pub mod lateness { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod epoch_config { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_consensus_babe::BabeEpochConfiguration; } + pub type Output = runtime_types::sp_consensus_babe::BabeEpochConfiguration; } pub mod next_epoch_config { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_consensus_babe::BabeEpochConfiguration; } + pub type Output = runtime_types::sp_consensus_babe::BabeEpochConfiguration; } pub mod skipped_epochs { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - (::core::primitive::u64, ::core::primitive::u32), - >; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u64, + ::core::primitive::u32, + )>; } } pub mod constants { @@ -6058,10 +5941,8 @@ pub mod api { #[doc = " the chain has started. Attempting to do so will brick block production."] pub fn epoch_duration( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u64> { + ::subxt::constants::StaticAddress::new_static( "Babe", "EpochDuration", [ @@ -6079,10 +5960,8 @@ pub mod api { #[doc = " the probability of a slot being empty)."] pub fn expected_block_time( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u64> { + ::subxt::constants::StaticAddress::new_static( "Babe", "ExpectedBlockTime", [ @@ -6096,10 +5975,8 @@ pub mod api { #[doc = " Max number of authorities allowed"] pub fn max_authorities( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Babe", "MaxAuthorities", [ @@ -6113,10 +5990,8 @@ pub mod api { #[doc = " The maximum number of nominators for each validator."] pub fn max_nominators( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Babe", "MaxNominators", [ @@ -6138,88 +6013,87 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the current time."] + #[doc = ""] + #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase, if this call hasn't been invoked by that time."] + #[doc = ""] + #[doc = "The timestamp should be greater than the previous one by the amount specified by"] + #[doc = "[`Config::MinimumPeriod`]."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "This dispatch class is _Mandatory_ to ensure it gets executed in the block. Be aware"] + #[doc = "that changing the complexity of this call could result exhausting the resources in a"] + #[doc = "block to execute any other calls."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] + #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)` because of `DidUpdate::take` in"] + #[doc = " `on_finalize`)"] + #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] + pub struct Set { + #[codec(compact)] + pub now: set::Now, + } + pub mod set { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the current time."] - #[doc = ""] - #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] - #[doc = "phase, if this call hasn't been invoked by that time."] - #[doc = ""] - #[doc = "The timestamp should be greater than the previous one by the amount specified by"] - #[doc = "[`Config::MinimumPeriod`]."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _None_."] - #[doc = ""] - #[doc = "This dispatch class is _Mandatory_ to ensure it gets executed in the block. Be aware"] - #[doc = "that changing the complexity of this call could result exhausting the resources in a"] - #[doc = "block to execute any other calls."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] - #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)` because of `DidUpdate::take` in"] - #[doc = " `on_finalize`)"] - #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] - pub struct Set { - #[codec(compact)] - pub now: set::Now, - } - pub mod set { - use super::runtime_types; - pub type Now = ::core::primitive::u64; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Set { - const PALLET: &'static str = "Timestamp"; - const CALL: &'static str = "set"; + pub type Now = ::core::primitive::u64; + } + impl Set { + const PALLET_NAME: &'static str = "Timestamp"; + const CALL_NAME: &'static str = "set"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Set { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Set the current time."] - #[doc = ""] - #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] - #[doc = "phase, if this call hasn't been invoked by that time."] - #[doc = ""] - #[doc = "The timestamp should be greater than the previous one by the amount specified by"] - #[doc = "[`Config::MinimumPeriod`]."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _None_."] - #[doc = ""] - #[doc = "This dispatch class is _Mandatory_ to ensure it gets executed in the block. Be aware"] - #[doc = "that changing the complexity of this call could result exhausting the resources in a"] - #[doc = "block to execute any other calls."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] - #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)` because of `DidUpdate::take` in"] - #[doc = " `on_finalize`)"] - #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] - pub fn set( - &self, - now: types::set::Now, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Timestamp", - "set", - types::Set { now }, - [ - 37u8, 95u8, 49u8, 218u8, 24u8, 22u8, 0u8, 95u8, 72u8, 35u8, 155u8, - 199u8, 213u8, 54u8, 207u8, 22u8, 185u8, 193u8, 221u8, 70u8, 18u8, - 200u8, 4u8, 231u8, 195u8, 173u8, 6u8, 122u8, 11u8, 203u8, 231u8, 227u8, - ], - ) + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the current time."] + #[doc = ""] + #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase, if this call hasn't been invoked by that time."] + #[doc = ""] + #[doc = "The timestamp should be greater than the previous one by the amount specified by"] + #[doc = "[`Config::MinimumPeriod`]."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "This dispatch class is _Mandatory_ to ensure it gets executed in the block. Be aware"] + #[doc = "that changing the complexity of this call could result exhausting the resources in a"] + #[doc = "block to execute any other calls."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] + #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)` because of `DidUpdate::take` in"] + #[doc = " `on_finalize`)"] + #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] + pub fn set( + &self, + now: super::set::Now, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Timestamp", + "set", + super::Set { now }, + [ + 37u8, 95u8, 49u8, 218u8, 24u8, 22u8, 0u8, 95u8, 72u8, 35u8, 155u8, + 199u8, 213u8, 54u8, 207u8, 22u8, 185u8, 193u8, 221u8, 70u8, 18u8, + 200u8, 4u8, 231u8, 195u8, 173u8, 6u8, 122u8, 11u8, 203u8, 231u8, + 227u8, + ], + ) + } } } } @@ -6231,12 +6105,9 @@ pub mod api { #[doc = " The current time for the current block."] pub fn now( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - now::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), now::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Timestamp", "Now", [ @@ -6252,12 +6123,9 @@ pub mod api { #[doc = " It is then checked at the end of each block execution in the `on_finalize` hook."] pub fn did_update( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - did_update::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), did_update::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Timestamp", "DidUpdate", [ @@ -6272,18 +6140,18 @@ pub mod api { pub mod now { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u64; } + pub type Output = ::core::primitive::u64; } pub mod did_update { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::bool; } + pub type Output = ::core::primitive::bool; } } pub mod constants { @@ -6298,10 +6166,8 @@ pub mod api { #[doc = " period on default settings."] pub fn minimum_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u64> { + ::subxt::constants::StaticAddress::new_static( "Timestamp", "MinimumPeriod", [ @@ -6325,401 +6191,396 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Assign an previously unassigned index."] + #[doc = ""] + #[doc = "Payment: `Deposit` is reserved from the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be claimed. This must not be in use."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub struct Claim { + pub index: claim::Index, + } + pub mod claim { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Assign an previously unassigned index."] - #[doc = ""] - #[doc = "Payment: `Deposit` is reserved from the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be claimed. This must not be in use."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct Claim { - pub index: claim::Index, - } - pub mod claim { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Claim { - const PALLET: &'static str = "Indices"; - const CALL: &'static str = "claim"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] - #[doc = "is effectively transferred to the new account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct Transfer { - pub new: transfer::New, - pub index: transfer::Index, - } - pub mod transfer { - use super::runtime_types; - pub type New = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Transfer { - const PALLET: &'static str = "Indices"; - const CALL: &'static str = "transfer"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Free up an index owned by the sender."] - #[doc = ""] - #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] - #[doc = ""] - #[doc = "- `index`: the index to be freed. This must be owned by the sender."] - #[doc = ""] - #[doc = "Emits `IndexFreed` if successful."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct Free { - pub index: free::Index, - } - pub mod free { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Free { - const PALLET: &'static str = "Indices"; - const CALL: &'static str = "free"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] - #[doc = "held, then any deposit is reimbursed to its current owner."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `index`: the index to be (re-)assigned."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct ForceTransfer { - pub new: force_transfer::New, - pub index: force_transfer::Index, - pub freeze: force_transfer::Freeze, - } - pub mod force_transfer { - use super::runtime_types; - pub type New = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Index = ::core::primitive::u32; - pub type Freeze = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceTransfer { - const PALLET: &'static str = "Indices"; - const CALL: &'static str = "force_transfer"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] - #[doc = "deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] - #[doc = "non-frozen account `index`."] - #[doc = ""] - #[doc = "- `index`: the index to be frozen in place."] - #[doc = ""] - #[doc = "Emits `IndexFrozen` if successful."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct Freeze { - pub index: freeze::Index, - } - pub mod freeze { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Freeze { - const PALLET: &'static str = "Indices"; - const CALL: &'static str = "freeze"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Poke the deposit reserved for an index."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] - #[doc = "non-frozen account `index`."] - #[doc = ""] - #[doc = "The transaction fees is waived if the deposit is changed after poking/reconsideration."] - #[doc = ""] - #[doc = "- `index`: the index whose deposit is to be poked/reconsidered."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if successful."] - pub struct PokeDeposit { - pub index: poke_deposit::Index, - } - pub mod poke_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { - const PALLET: &'static str = "Indices"; - const CALL: &'static str = "poke_deposit"; + pub type Index = ::core::primitive::u32; + } + impl Claim { + const PALLET_NAME: &'static str = "Indices"; + const CALL_NAME: &'static str = "claim"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Claim { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Assign an previously unassigned index."] - #[doc = ""] - #[doc = "Payment: `Deposit` is reserved from the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be claimed. This must not be in use."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn claim( - &self, - index: types::claim::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Indices", - "claim", - types::Claim { index }, - [ - 146u8, 58u8, 246u8, 135u8, 59u8, 90u8, 3u8, 5u8, 140u8, 169u8, 232u8, - 195u8, 11u8, 107u8, 36u8, 141u8, 118u8, 174u8, 160u8, 160u8, 19u8, - 205u8, 177u8, 193u8, 18u8, 102u8, 115u8, 31u8, 72u8, 29u8, 91u8, 235u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] + #[doc = "is effectively transferred to the new account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub struct Transfer { + pub new: transfer::New, + pub index: transfer::Index, + } + pub mod transfer { + use super::runtime_types; + pub type New = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Index = ::core::primitive::u32; + } + impl Transfer { + const PALLET_NAME: &'static str = "Indices"; + const CALL_NAME: &'static str = "transfer"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Transfer { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] - #[doc = "is effectively transferred to the new account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn transfer( - &self, - new: types::transfer::New, - index: types::transfer::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Indices", - "transfer", - types::Transfer { new, index }, - [ - 121u8, 156u8, 174u8, 248u8, 72u8, 126u8, 99u8, 188u8, 71u8, 134u8, - 107u8, 147u8, 139u8, 139u8, 57u8, 198u8, 17u8, 241u8, 142u8, 64u8, - 16u8, 121u8, 249u8, 146u8, 24u8, 86u8, 78u8, 187u8, 38u8, 146u8, 96u8, - 218u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Free up an index owned by the sender."] + #[doc = ""] + #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] + #[doc = ""] + #[doc = "- `index`: the index to be freed. This must be owned by the sender."] + #[doc = ""] + #[doc = "Emits `IndexFreed` if successful."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub struct Free { + pub index: free::Index, + } + pub mod free { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl Free { + const PALLET_NAME: &'static str = "Indices"; + const CALL_NAME: &'static str = "free"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Free { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Free up an index owned by the sender."] - #[doc = ""] - #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] - #[doc = ""] - #[doc = "- `index`: the index to be freed. This must be owned by the sender."] - #[doc = ""] - #[doc = "Emits `IndexFreed` if successful."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn free( - &self, - index: types::free::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Indices", - "free", - types::Free { index }, - [ - 241u8, 211u8, 234u8, 102u8, 189u8, 22u8, 209u8, 27u8, 8u8, 229u8, 80u8, - 227u8, 138u8, 252u8, 222u8, 111u8, 77u8, 201u8, 235u8, 51u8, 163u8, - 247u8, 13u8, 126u8, 216u8, 136u8, 57u8, 222u8, 56u8, 66u8, 215u8, - 244u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] + #[doc = "held, then any deposit is reimbursed to its current owner."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `index`: the index to be (re-)assigned."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub struct ForceTransfer { + pub new: force_transfer::New, + pub index: force_transfer::Index, + pub freeze: force_transfer::Freeze, + } + pub mod force_transfer { + use super::runtime_types; + pub type New = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Index = ::core::primitive::u32; + pub type Freeze = ::core::primitive::bool; + } + impl ForceTransfer { + const PALLET_NAME: &'static str = "Indices"; + const CALL_NAME: &'static str = "force_transfer"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceTransfer { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] - #[doc = "held, then any deposit is reimbursed to its current owner."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `index`: the index to be (re-)assigned."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn force_transfer( - &self, - new: types::force_transfer::New, - index: types::force_transfer::Index, - freeze: types::force_transfer::Freeze, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Indices", - "force_transfer", - types::ForceTransfer { new, index, freeze }, - [ - 137u8, 128u8, 43u8, 135u8, 129u8, 169u8, 162u8, 136u8, 175u8, 31u8, - 161u8, 120u8, 15u8, 176u8, 203u8, 23u8, 107u8, 31u8, 135u8, 200u8, - 221u8, 186u8, 162u8, 229u8, 238u8, 82u8, 192u8, 122u8, 136u8, 6u8, - 176u8, 42u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] + #[doc = "deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] + #[doc = "non-frozen account `index`."] + #[doc = ""] + #[doc = "- `index`: the index to be frozen in place."] + #[doc = ""] + #[doc = "Emits `IndexFrozen` if successful."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub struct Freeze { + pub index: freeze::Index, + } + pub mod freeze { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl Freeze { + const PALLET_NAME: &'static str = "Indices"; + const CALL_NAME: &'static str = "freeze"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Freeze { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] - #[doc = "deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] - #[doc = "non-frozen account `index`."] - #[doc = ""] - #[doc = "- `index`: the index to be frozen in place."] - #[doc = ""] - #[doc = "Emits `IndexFrozen` if successful."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn freeze( - &self, - index: types::freeze::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Indices", - "freeze", - types::Freeze { index }, - [ - 238u8, 215u8, 108u8, 156u8, 84u8, 240u8, 130u8, 229u8, 27u8, 132u8, - 93u8, 78u8, 2u8, 251u8, 43u8, 203u8, 2u8, 142u8, 147u8, 48u8, 92u8, - 101u8, 207u8, 24u8, 51u8, 16u8, 36u8, 229u8, 188u8, 129u8, 160u8, - 117u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Poke the deposit reserved for an index."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] + #[doc = "non-frozen account `index`."] + #[doc = ""] + #[doc = "The transaction fees is waived if the deposit is changed after poking/reconsideration."] + #[doc = ""] + #[doc = "- `index`: the index whose deposit is to be poked/reconsidered."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if successful."] + pub struct PokeDeposit { + pub index: poke_deposit::Index, + } + pub mod poke_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl PokeDeposit { + const PALLET_NAME: &'static str = "Indices"; + const CALL_NAME: &'static str = "poke_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PokeDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Poke the deposit reserved for an index."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] - #[doc = "non-frozen account `index`."] - #[doc = ""] - #[doc = "The transaction fees is waived if the deposit is changed after poking/reconsideration."] - #[doc = ""] - #[doc = "- `index`: the index whose deposit is to be poked/reconsidered."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if successful."] - pub fn poke_deposit( - &self, - index: types::poke_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Indices", - "poke_deposit", - types::PokeDeposit { index }, - [ - 105u8, 242u8, 155u8, 137u8, 22u8, 179u8, 151u8, 68u8, 214u8, 99u8, - 110u8, 144u8, 91u8, 37u8, 222u8, 116u8, 67u8, 21u8, 100u8, 59u8, 145u8, - 185u8, 181u8, 166u8, 236u8, 138u8, 153u8, 73u8, 138u8, 81u8, 206u8, - 238u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Assign an previously unassigned index."] + #[doc = ""] + #[doc = "Payment: `Deposit` is reserved from the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be claimed. This must not be in use."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub fn claim( + &self, + index: super::claim::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Indices", + "claim", + super::Claim { index }, + [ + 146u8, 58u8, 246u8, 135u8, 59u8, 90u8, 3u8, 5u8, 140u8, 169u8, + 232u8, 195u8, 11u8, 107u8, 36u8, 141u8, 118u8, 174u8, 160u8, 160u8, + 19u8, 205u8, 177u8, 193u8, 18u8, 102u8, 115u8, 31u8, 72u8, 29u8, + 91u8, 235u8, + ], + ) + } + #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] + #[doc = "is effectively transferred to the new account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub fn transfer( + &self, + new: super::transfer::New, + index: super::transfer::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Indices", + "transfer", + super::Transfer { new, index }, + [ + 121u8, 156u8, 174u8, 248u8, 72u8, 126u8, 99u8, 188u8, 71u8, 134u8, + 107u8, 147u8, 139u8, 139u8, 57u8, 198u8, 17u8, 241u8, 142u8, 64u8, + 16u8, 121u8, 249u8, 146u8, 24u8, 86u8, 78u8, 187u8, 38u8, 146u8, + 96u8, 218u8, + ], + ) + } + #[doc = "Free up an index owned by the sender."] + #[doc = ""] + #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] + #[doc = ""] + #[doc = "- `index`: the index to be freed. This must be owned by the sender."] + #[doc = ""] + #[doc = "Emits `IndexFreed` if successful."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub fn free( + &self, + index: super::free::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Indices", + "free", + super::Free { index }, + [ + 241u8, 211u8, 234u8, 102u8, 189u8, 22u8, 209u8, 27u8, 8u8, 229u8, + 80u8, 227u8, 138u8, 252u8, 222u8, 111u8, 77u8, 201u8, 235u8, 51u8, + 163u8, 247u8, 13u8, 126u8, 216u8, 136u8, 57u8, 222u8, 56u8, 66u8, + 215u8, 244u8, + ], + ) + } + #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] + #[doc = "held, then any deposit is reimbursed to its current owner."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `index`: the index to be (re-)assigned."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub fn force_transfer( + &self, + new: super::force_transfer::New, + index: super::force_transfer::Index, + freeze: super::force_transfer::Freeze, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Indices", + "force_transfer", + super::ForceTransfer { new, index, freeze }, + [ + 137u8, 128u8, 43u8, 135u8, 129u8, 169u8, 162u8, 136u8, 175u8, 31u8, + 161u8, 120u8, 15u8, 176u8, 203u8, 23u8, 107u8, 31u8, 135u8, 200u8, + 221u8, 186u8, 162u8, 229u8, 238u8, 82u8, 192u8, 122u8, 136u8, 6u8, + 176u8, 42u8, + ], + ) + } + #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] + #[doc = "deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] + #[doc = "non-frozen account `index`."] + #[doc = ""] + #[doc = "- `index`: the index to be frozen in place."] + #[doc = ""] + #[doc = "Emits `IndexFrozen` if successful."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub fn freeze( + &self, + index: super::freeze::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Indices", + "freeze", + super::Freeze { index }, + [ + 238u8, 215u8, 108u8, 156u8, 84u8, 240u8, 130u8, 229u8, 27u8, 132u8, + 93u8, 78u8, 2u8, 251u8, 43u8, 203u8, 2u8, 142u8, 147u8, 48u8, 92u8, + 101u8, 207u8, 24u8, 51u8, 16u8, 36u8, 229u8, 188u8, 129u8, 160u8, + 117u8, + ], + ) + } + #[doc = "Poke the deposit reserved for an index."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] + #[doc = "non-frozen account `index`."] + #[doc = ""] + #[doc = "The transaction fees is waived if the deposit is changed after poking/reconsideration."] + #[doc = ""] + #[doc = "- `index`: the index whose deposit is to be poked/reconsidered."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if successful."] + pub fn poke_deposit( + &self, + index: super::poke_deposit::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Indices", + "poke_deposit", + super::PokeDeposit { index }, + [ + 105u8, 242u8, 155u8, 137u8, 22u8, 179u8, 151u8, 68u8, 214u8, 99u8, + 110u8, 144u8, 91u8, 37u8, 222u8, 116u8, 67u8, 21u8, 100u8, 59u8, + 145u8, 185u8, 181u8, 166u8, 236u8, 138u8, 153u8, 73u8, 138u8, 81u8, + 206u8, 238u8, + ], + ) + } } } } @@ -6728,12 +6589,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A account index was assigned."] pub struct IndexAssigned { pub who: index_assigned::Who, @@ -6741,20 +6602,25 @@ pub mod api { } pub mod index_assigned { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for IndexAssigned { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexAssigned"; + impl IndexAssigned { + const PALLET_NAME: &'static str = "Indices"; + const EVENT_NAME: &'static str = "IndexAssigned"; + } + impl ::subxt::events::DecodeAsEvent for IndexAssigned { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A account index has been freed up (unassigned)."] pub struct IndexFreed { pub index: index_freed::Index, @@ -6763,17 +6629,22 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for IndexFreed { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexFreed"; + impl IndexFreed { + const PALLET_NAME: &'static str = "Indices"; + const EVENT_NAME: &'static str = "IndexFreed"; + } + impl ::subxt::events::DecodeAsEvent for IndexFreed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A account index has been frozen to its current account ID."] pub struct IndexFrozen { pub index: index_frozen::Index, @@ -6782,19 +6653,24 @@ pub mod api { pub mod index_frozen { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for IndexFrozen { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexFrozen"; + impl IndexFrozen { + const PALLET_NAME: &'static str = "Indices"; + const EVENT_NAME: &'static str = "IndexFrozen"; + } + impl ::subxt::events::DecodeAsEvent for IndexFrozen { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A deposit to reserve an index has been poked/reconsidered."] pub struct DepositPoked { pub who: deposit_poked::Who, @@ -6804,14 +6680,19 @@ pub mod api { } pub mod deposit_poked { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Index = ::core::primitive::u32; pub type OldDeposit = ::core::primitive::u128; pub type NewDeposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "DepositPoked"; + impl DepositPoked { + const PALLET_NAME: &'static str = "Indices"; + const EVENT_NAME: &'static str = "DepositPoked"; + } + impl ::subxt::events::DecodeAsEvent for DepositPoked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -6822,12 +6703,12 @@ pub mod api { #[doc = " The lookup from index to account."] pub fn accounts( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (accounts::Param0,), - accounts::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (accounts::input::Param0,), + accounts::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Indices", "Accounts", [ @@ -6842,15 +6723,15 @@ pub mod api { pub mod accounts { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ( - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - ); + pub type Param0 = ::core::primitive::u32; } + pub type Output = ( + ::subxt::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::bool, + ); } } pub mod constants { @@ -6860,10 +6741,8 @@ pub mod api { #[doc = " The deposit needed for reserving an index."] pub fn deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Indices", "Deposit", [ @@ -6886,529 +6765,517 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + pub struct TransferAllowDeath { + pub dest: transfer_allow_death::Dest, + #[codec(compact)] + pub value: transfer_allow_death::Value, + } + pub mod transfer_allow_death { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer some liquid free balance to another account."] - #[doc = ""] - #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] - #[doc = "If the sender's account is below the existential deposit as a result"] - #[doc = "of the transfer, the account will be reaped."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] - pub struct TransferAllowDeath { - pub dest: transfer_allow_death::Dest, - #[codec(compact)] - pub value: transfer_allow_death::Value, - } - pub mod transfer_allow_death { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Value = ::core::primitive::u128; + pub type Dest = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Value = ::core::primitive::u128; + } + impl TransferAllowDeath { + const PALLET_NAME: &'static str = "Balances"; + const CALL_NAME: &'static str = "transfer_allow_death"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for TransferAllowDeath { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAllowDeath { - const PALLET: &'static str = "Balances"; - const CALL: &'static str = "transfer_allow_death"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] + #[doc = "may be specified."] + pub struct ForceTransfer { + pub source: force_transfer::Source, + pub dest: force_transfer::Dest, + #[codec(compact)] + pub value: force_transfer::Value, + } + pub mod force_transfer { + use super::runtime_types; + pub type Source = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Dest = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Value = ::core::primitive::u128; + } + impl ForceTransfer { + const PALLET_NAME: &'static str = "Balances"; + const CALL_NAME: &'static str = "force_transfer"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceTransfer { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] - #[doc = "may be specified."] - pub struct ForceTransfer { - pub source: force_transfer::Source, - pub dest: force_transfer::Dest, - #[codec(compact)] - pub value: force_transfer::Value, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] + #[doc = "kill the origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer_allow_death`] instead."] + #[doc = ""] + #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] + pub struct TransferKeepAlive { + pub dest: transfer_keep_alive::Dest, + #[codec(compact)] + pub value: transfer_keep_alive::Value, + } + pub mod transfer_keep_alive { + use super::runtime_types; + pub type Dest = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Value = ::core::primitive::u128; + } + impl TransferKeepAlive { + const PALLET_NAME: &'static str = "Balances"; + const CALL_NAME: &'static str = "transfer_keep_alive"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for TransferKeepAlive { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod force_transfer { - use super::runtime_types; - pub type Source = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Value = ::core::primitive::u128; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true)."] + pub struct TransferAll { + pub dest: transfer_all::Dest, + pub keep_alive: transfer_all::KeepAlive, + } + pub mod transfer_all { + use super::runtime_types; + pub type Dest = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type KeepAlive = ::core::primitive::bool; + } + impl TransferAll { + const PALLET_NAME: &'static str = "Balances"; + const CALL_NAME: &'static str = "transfer_all"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for TransferAll { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceTransfer { - const PALLET: &'static str = "Balances"; - const CALL: &'static str = "force_transfer"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + pub struct ForceUnreserve { + pub who: force_unreserve::Who, + pub amount: force_unreserve::Amount, + } + pub mod force_unreserve { + use super::runtime_types; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Amount = ::core::primitive::u128; + } + impl ForceUnreserve { + const PALLET_NAME: &'static str = "Balances"; + const CALL_NAME: &'static str = "force_unreserve"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceUnreserve { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] - #[doc = "kill the origin account."] - #[doc = ""] - #[doc = "99% of the time you want [`transfer_allow_death`] instead."] - #[doc = ""] - #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] - pub struct TransferKeepAlive { - pub dest: transfer_keep_alive::Dest, - #[codec(compact)] - pub value: transfer_keep_alive::Value, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Upgrade a specified account."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `who`: The account to be upgraded."] + #[doc = ""] + #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] + #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] + #[doc = "possibility of churn)."] + pub struct UpgradeAccounts { + pub who: upgrade_accounts::Who, + } + pub mod upgrade_accounts { + use super::runtime_types; + pub type Who = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + } + impl UpgradeAccounts { + const PALLET_NAME: &'static str = "Balances"; + const CALL_NAME: &'static str = "upgrade_accounts"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for UpgradeAccounts { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod transfer_keep_alive { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Value = ::core::primitive::u128; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the regular balance of a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + pub struct ForceSetBalance { + pub who: force_set_balance::Who, + #[codec(compact)] + pub new_free: force_set_balance::NewFree, + } + pub mod force_set_balance { + use super::runtime_types; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type NewFree = ::core::primitive::u128; + } + impl ForceSetBalance { + const PALLET_NAME: &'static str = "Balances"; + const CALL_NAME: &'static str = "force_set_balance"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceSetBalance { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferKeepAlive { - const PALLET: &'static str = "Balances"; - const CALL: &'static str = "transfer_keep_alive"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer the entire transferable balance from the caller account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] - #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] - #[doc = " keep the sender account alive (true)."] - pub struct TransferAll { - pub dest: transfer_all::Dest, - pub keep_alive: transfer_all::KeepAlive, - } - pub mod transfer_all { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type KeepAlive = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAll { - const PALLET: &'static str = "Balances"; - const CALL: &'static str = "transfer_all"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Unreserve some balance from a user by force."] - #[doc = ""] - #[doc = "Can only be called by ROOT."] - pub struct ForceUnreserve { - pub who: force_unreserve::Who, - pub amount: force_unreserve::Amount, - } - pub mod force_unreserve { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceUnreserve { - const PALLET: &'static str = "Balances"; - const CALL: &'static str = "force_unreserve"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Upgrade a specified account."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed`."] - #[doc = "- `who`: The account to be upgraded."] - #[doc = ""] - #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] - #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] - #[doc = "possibility of churn)."] - pub struct UpgradeAccounts { - pub who: upgrade_accounts::Who, - } - pub mod upgrade_accounts { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UpgradeAccounts { - const PALLET: &'static str = "Balances"; - const CALL: &'static str = "upgrade_accounts"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the regular balance of a given account."] - #[doc = ""] - #[doc = "The dispatch origin for this call is `root`."] - pub struct ForceSetBalance { - pub who: force_set_balance::Who, - #[codec(compact)] - pub new_free: force_set_balance::NewFree, - } - pub mod force_set_balance { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type NewFree = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetBalance { - const PALLET: &'static str = "Balances"; - const CALL: &'static str = "force_set_balance"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Adjust the total issuance in a saturating way."] - #[doc = ""] - #[doc = "Can only be called by root and always needs a positive `delta`."] - #[doc = ""] - #[doc = "# Example"] - pub struct ForceAdjustTotalIssuance { - pub direction: force_adjust_total_issuance::Direction, - #[codec(compact)] - pub delta: force_adjust_total_issuance::Delta, - } - pub mod force_adjust_total_issuance { - use super::runtime_types; - pub type Direction = runtime_types::pallet_balances::types::AdjustmentDirection; - pub type Delta = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceAdjustTotalIssuance { - const PALLET: &'static str = "Balances"; - const CALL: &'static str = "force_adjust_total_issuance"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Burn the specified liquid free balance from the origin account."] - #[doc = ""] - #[doc = "If the origin's account ends up below the existential deposit as a result"] - #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] - #[doc = ""] - #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] - #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] - pub struct Burn { - #[codec(compact)] - pub value: burn::Value, - pub keep_alive: burn::KeepAlive, - } - pub mod burn { - use super::runtime_types; - pub type Value = ::core::primitive::u128; - pub type KeepAlive = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Burn { - const PALLET: &'static str = "Balances"; - const CALL: &'static str = "burn"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Adjust the total issuance in a saturating way."] + #[doc = ""] + #[doc = "Can only be called by root and always needs a positive `delta`."] + #[doc = ""] + #[doc = "# Example"] + pub struct ForceAdjustTotalIssuance { + pub direction: force_adjust_total_issuance::Direction, + #[codec(compact)] + pub delta: force_adjust_total_issuance::Delta, + } + pub mod force_adjust_total_issuance { + use super::runtime_types; + pub type Direction = runtime_types::pallet_balances::types::AdjustmentDirection; + pub type Delta = ::core::primitive::u128; + } + impl ForceAdjustTotalIssuance { + const PALLET_NAME: &'static str = "Balances"; + const CALL_NAME: &'static str = "force_adjust_total_issuance"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceAdjustTotalIssuance { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Transfer some liquid free balance to another account."] - #[doc = ""] - #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] - #[doc = "If the sender's account is below the existential deposit as a result"] - #[doc = "of the transfer, the account will be reaped."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] - pub fn transfer_allow_death( - &self, - dest: types::transfer_allow_death::Dest, - value: types::transfer_allow_death::Value, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Balances", - "transfer_allow_death", - types::TransferAllowDeath { dest, value }, - [ - 51u8, 166u8, 195u8, 10u8, 139u8, 218u8, 55u8, 130u8, 6u8, 194u8, 35u8, - 140u8, 27u8, 205u8, 214u8, 222u8, 102u8, 43u8, 143u8, 145u8, 86u8, - 219u8, 210u8, 147u8, 13u8, 39u8, 51u8, 21u8, 237u8, 179u8, 132u8, - 130u8, - ], - ) - } - #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] - #[doc = "may be specified."] - pub fn force_transfer( - &self, - source: types::force_transfer::Source, - dest: types::force_transfer::Dest, - value: types::force_transfer::Value, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Balances", - "force_transfer", - types::ForceTransfer { - source, - dest, - value, - }, - [ - 154u8, 93u8, 222u8, 27u8, 12u8, 248u8, 63u8, 213u8, 224u8, 86u8, 250u8, - 153u8, 249u8, 102u8, 83u8, 160u8, 79u8, 125u8, 105u8, 222u8, 77u8, - 180u8, 90u8, 105u8, 81u8, 217u8, 60u8, 25u8, 213u8, 51u8, 185u8, 96u8, - ], - ) - } - #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] - #[doc = "kill the origin account."] - #[doc = ""] - #[doc = "99% of the time you want [`transfer_allow_death`] instead."] - #[doc = ""] - #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] - pub fn transfer_keep_alive( - &self, - dest: types::transfer_keep_alive::Dest, - value: types::transfer_keep_alive::Value, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Balances", - "transfer_keep_alive", - types::TransferKeepAlive { dest, value }, - [ - 245u8, 14u8, 190u8, 193u8, 32u8, 210u8, 74u8, 92u8, 25u8, 182u8, 76u8, - 55u8, 247u8, 83u8, 114u8, 75u8, 143u8, 236u8, 117u8, 25u8, 54u8, 157u8, - 208u8, 207u8, 233u8, 89u8, 70u8, 161u8, 235u8, 242u8, 222u8, 59u8, - ], - ) - } - #[doc = "Transfer the entire transferable balance from the caller account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] - #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] - #[doc = " keep the sender account alive (true)."] - pub fn transfer_all( - &self, - dest: types::transfer_all::Dest, - keep_alive: types::transfer_all::KeepAlive, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Balances", - "transfer_all", - types::TransferAll { dest, keep_alive }, - [ - 105u8, 132u8, 49u8, 144u8, 195u8, 250u8, 34u8, 46u8, 213u8, 248u8, - 112u8, 188u8, 81u8, 228u8, 136u8, 18u8, 67u8, 172u8, 37u8, 38u8, 238u8, - 9u8, 34u8, 15u8, 67u8, 34u8, 148u8, 195u8, 223u8, 29u8, 154u8, 6u8, - ], - ) - } - #[doc = "Unreserve some balance from a user by force."] - #[doc = ""] - #[doc = "Can only be called by ROOT."] - pub fn force_unreserve( - &self, - who: types::force_unreserve::Who, - amount: types::force_unreserve::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Balances", - "force_unreserve", - types::ForceUnreserve { who, amount }, - [ - 142u8, 151u8, 64u8, 205u8, 46u8, 64u8, 62u8, 122u8, 108u8, 49u8, 223u8, - 140u8, 120u8, 153u8, 35u8, 165u8, 187u8, 38u8, 157u8, 200u8, 123u8, - 199u8, 198u8, 168u8, 208u8, 159u8, 39u8, 134u8, 92u8, 103u8, 84u8, - 171u8, - ], - ) - } - #[doc = "Upgrade a specified account."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed`."] - #[doc = "- `who`: The account to be upgraded."] - #[doc = ""] - #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] - #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] - #[doc = "possibility of churn)."] - pub fn upgrade_accounts( - &self, - who: types::upgrade_accounts::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Balances", - "upgrade_accounts", - types::UpgradeAccounts { who }, - [ - 66u8, 200u8, 179u8, 104u8, 65u8, 2u8, 101u8, 56u8, 130u8, 161u8, 224u8, - 233u8, 255u8, 124u8, 70u8, 122u8, 8u8, 49u8, 103u8, 178u8, 68u8, 47u8, - 214u8, 166u8, 217u8, 116u8, 178u8, 50u8, 212u8, 164u8, 98u8, 226u8, - ], - ) - } - #[doc = "Set the regular balance of a given account."] - #[doc = ""] - #[doc = "The dispatch origin for this call is `root`."] - pub fn force_set_balance( - &self, - who: types::force_set_balance::Who, - new_free: types::force_set_balance::NewFree, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Balances", - "force_set_balance", - types::ForceSetBalance { who, new_free }, - [ - 114u8, 229u8, 59u8, 204u8, 180u8, 83u8, 17u8, 4u8, 59u8, 4u8, 55u8, - 39u8, 151u8, 196u8, 124u8, 60u8, 209u8, 65u8, 193u8, 11u8, 44u8, 164u8, - 116u8, 93u8, 169u8, 30u8, 199u8, 165u8, 55u8, 231u8, 223u8, 43u8, - ], - ) - } - #[doc = "Adjust the total issuance in a saturating way."] - #[doc = ""] - #[doc = "Can only be called by root and always needs a positive `delta`."] - #[doc = ""] - #[doc = "# Example"] - pub fn force_adjust_total_issuance( - &self, - direction: types::force_adjust_total_issuance::Direction, - delta: types::force_adjust_total_issuance::Delta, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceAdjustTotalIssuance, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Balances", - "force_adjust_total_issuance", - types::ForceAdjustTotalIssuance { direction, delta }, - [ - 208u8, 134u8, 56u8, 133u8, 232u8, 164u8, 10u8, 213u8, 53u8, 193u8, - 190u8, 63u8, 236u8, 186u8, 96u8, 122u8, 104u8, 87u8, 173u8, 38u8, 58u8, - 176u8, 21u8, 78u8, 42u8, 106u8, 46u8, 248u8, 251u8, 190u8, 150u8, - 202u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Burn the specified liquid free balance from the origin account."] + #[doc = ""] + #[doc = "If the origin's account ends up below the existential deposit as a result"] + #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] + #[doc = ""] + #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] + #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] + pub struct Burn { + #[codec(compact)] + pub value: burn::Value, + pub keep_alive: burn::KeepAlive, + } + pub mod burn { + use super::runtime_types; + pub type Value = ::core::primitive::u128; + pub type KeepAlive = ::core::primitive::bool; + } + impl Burn { + const PALLET_NAME: &'static str = "Balances"; + const CALL_NAME: &'static str = "burn"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Burn { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Burn the specified liquid free balance from the origin account."] - #[doc = ""] - #[doc = "If the origin's account ends up below the existential deposit as a result"] - #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] - #[doc = ""] - #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] - #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] - pub fn burn( - &self, - value: types::burn::Value, - keep_alive: types::burn::KeepAlive, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Balances", - "burn", - types::Burn { value, keep_alive }, - [ - 176u8, 64u8, 7u8, 109u8, 16u8, 44u8, 145u8, 125u8, 147u8, 152u8, 130u8, - 114u8, 221u8, 201u8, 150u8, 162u8, 118u8, 71u8, 52u8, 92u8, 240u8, - 116u8, 203u8, 98u8, 5u8, 22u8, 43u8, 102u8, 94u8, 208u8, 101u8, 57u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + pub fn transfer_allow_death( + &self, + dest: super::transfer_allow_death::Dest, + value: super::transfer_allow_death::Value, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Balances", + "transfer_allow_death", + super::TransferAllowDeath { dest, value }, + [ + 51u8, 166u8, 195u8, 10u8, 139u8, 218u8, 55u8, 130u8, 6u8, 194u8, + 35u8, 140u8, 27u8, 205u8, 214u8, 222u8, 102u8, 43u8, 143u8, 145u8, + 86u8, 219u8, 210u8, 147u8, 13u8, 39u8, 51u8, 21u8, 237u8, 179u8, + 132u8, 130u8, + ], + ) + } + #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] + #[doc = "may be specified."] + pub fn force_transfer( + &self, + source: super::force_transfer::Source, + dest: super::force_transfer::Dest, + value: super::force_transfer::Value, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Balances", + "force_transfer", + super::ForceTransfer { + source, + dest, + value, + }, + [ + 154u8, 93u8, 222u8, 27u8, 12u8, 248u8, 63u8, 213u8, 224u8, 86u8, + 250u8, 153u8, 249u8, 102u8, 83u8, 160u8, 79u8, 125u8, 105u8, 222u8, + 77u8, 180u8, 90u8, 105u8, 81u8, 217u8, 60u8, 25u8, 213u8, 51u8, + 185u8, 96u8, + ], + ) + } + #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] + #[doc = "kill the origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer_allow_death`] instead."] + #[doc = ""] + #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] + pub fn transfer_keep_alive( + &self, + dest: super::transfer_keep_alive::Dest, + value: super::transfer_keep_alive::Value, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Balances", + "transfer_keep_alive", + super::TransferKeepAlive { dest, value }, + [ + 245u8, 14u8, 190u8, 193u8, 32u8, 210u8, 74u8, 92u8, 25u8, 182u8, + 76u8, 55u8, 247u8, 83u8, 114u8, 75u8, 143u8, 236u8, 117u8, 25u8, + 54u8, 157u8, 208u8, 207u8, 233u8, 89u8, 70u8, 161u8, 235u8, 242u8, + 222u8, 59u8, + ], + ) + } + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true)."] + pub fn transfer_all( + &self, + dest: super::transfer_all::Dest, + keep_alive: super::transfer_all::KeepAlive, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Balances", + "transfer_all", + super::TransferAll { dest, keep_alive }, + [ + 105u8, 132u8, 49u8, 144u8, 195u8, 250u8, 34u8, 46u8, 213u8, 248u8, + 112u8, 188u8, 81u8, 228u8, 136u8, 18u8, 67u8, 172u8, 37u8, 38u8, + 238u8, 9u8, 34u8, 15u8, 67u8, 34u8, 148u8, 195u8, 223u8, 29u8, + 154u8, 6u8, + ], + ) + } + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + pub fn force_unreserve( + &self, + who: super::force_unreserve::Who, + amount: super::force_unreserve::Amount, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Balances", + "force_unreserve", + super::ForceUnreserve { who, amount }, + [ + 142u8, 151u8, 64u8, 205u8, 46u8, 64u8, 62u8, 122u8, 108u8, 49u8, + 223u8, 140u8, 120u8, 153u8, 35u8, 165u8, 187u8, 38u8, 157u8, 200u8, + 123u8, 199u8, 198u8, 168u8, 208u8, 159u8, 39u8, 134u8, 92u8, 103u8, + 84u8, 171u8, + ], + ) + } + #[doc = "Upgrade a specified account."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `who`: The account to be upgraded."] + #[doc = ""] + #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] + #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] + #[doc = "possibility of churn)."] + pub fn upgrade_accounts( + &self, + who: super::upgrade_accounts::Who, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Balances", + "upgrade_accounts", + super::UpgradeAccounts { who }, + [ + 66u8, 200u8, 179u8, 104u8, 65u8, 2u8, 101u8, 56u8, 130u8, 161u8, + 224u8, 233u8, 255u8, 124u8, 70u8, 122u8, 8u8, 49u8, 103u8, 178u8, + 68u8, 47u8, 214u8, 166u8, 217u8, 116u8, 178u8, 50u8, 212u8, 164u8, + 98u8, 226u8, + ], + ) + } + #[doc = "Set the regular balance of a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + pub fn force_set_balance( + &self, + who: super::force_set_balance::Who, + new_free: super::force_set_balance::NewFree, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Balances", + "force_set_balance", + super::ForceSetBalance { who, new_free }, + [ + 114u8, 229u8, 59u8, 204u8, 180u8, 83u8, 17u8, 4u8, 59u8, 4u8, 55u8, + 39u8, 151u8, 196u8, 124u8, 60u8, 209u8, 65u8, 193u8, 11u8, 44u8, + 164u8, 116u8, 93u8, 169u8, 30u8, 199u8, 165u8, 55u8, 231u8, 223u8, + 43u8, + ], + ) + } + #[doc = "Adjust the total issuance in a saturating way."] + #[doc = ""] + #[doc = "Can only be called by root and always needs a positive `delta`."] + #[doc = ""] + #[doc = "# Example"] + pub fn force_adjust_total_issuance( + &self, + direction: super::force_adjust_total_issuance::Direction, + delta: super::force_adjust_total_issuance::Delta, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Balances", + "force_adjust_total_issuance", + super::ForceAdjustTotalIssuance { direction, delta }, + [ + 208u8, 134u8, 56u8, 133u8, 232u8, 164u8, 10u8, 213u8, 53u8, 193u8, + 190u8, 63u8, 236u8, 186u8, 96u8, 122u8, 104u8, 87u8, 173u8, 38u8, + 58u8, 176u8, 21u8, 78u8, 42u8, 106u8, 46u8, 248u8, 251u8, 190u8, + 150u8, 202u8, + ], + ) + } + #[doc = "Burn the specified liquid free balance from the origin account."] + #[doc = ""] + #[doc = "If the origin's account ends up below the existential deposit as a result"] + #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] + #[doc = ""] + #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] + #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] + pub fn burn( + &self, + value: super::burn::Value, + keep_alive: super::burn::KeepAlive, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Balances", + "burn", + super::Burn { value, keep_alive }, + [ + 176u8, 64u8, 7u8, 109u8, 16u8, 44u8, 145u8, 125u8, 147u8, 152u8, + 130u8, 114u8, 221u8, 201u8, 150u8, 162u8, 118u8, 71u8, 52u8, 92u8, + 240u8, 116u8, 203u8, 98u8, 5u8, 22u8, 43u8, 102u8, 94u8, 208u8, + 101u8, 57u8, + ], + ) + } } } } @@ -7417,12 +7284,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An account was created with some free balance."] pub struct Endowed { pub account: endowed::Account, @@ -7430,20 +7297,25 @@ pub mod api { } pub mod endowed { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Account = ::subxt::utils::AccountId32; pub type FreeBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Endowed { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Endowed"; + impl Endowed { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Endowed"; + } + impl ::subxt::events::DecodeAsEvent for Endowed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] #[doc = "resulting in an outright loss."] pub struct DustLost { @@ -7452,20 +7324,25 @@ pub mod api { } pub mod dust_lost { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Account = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DustLost { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "DustLost"; + impl DustLost { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "DustLost"; + } + impl ::subxt::events::DecodeAsEvent for DustLost { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Transfer succeeded."] pub struct Transfer { pub from: transfer::From, @@ -7474,21 +7351,26 @@ pub mod api { } pub mod transfer { use super::runtime_types; - pub type From = ::subxt::ext::subxt_core::utils::AccountId32; - pub type To = ::subxt::ext::subxt_core::utils::AccountId32; + pub type From = ::subxt::utils::AccountId32; + pub type To = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Transfer { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Transfer"; + impl Transfer { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Transfer"; + } + impl ::subxt::events::DecodeAsEvent for Transfer { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A balance was set by root."] pub struct BalanceSet { pub who: balance_set::Who, @@ -7496,20 +7378,25 @@ pub mod api { } pub mod balance_set { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Free = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BalanceSet { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "BalanceSet"; + impl BalanceSet { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "BalanceSet"; + } + impl ::subxt::events::DecodeAsEvent for BalanceSet { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was reserved (moved from free to reserved)."] pub struct Reserved { pub who: reserved::Who, @@ -7517,20 +7404,25 @@ pub mod api { } pub mod reserved { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Reserved { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Reserved"; + impl Reserved { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Reserved"; + } + impl ::subxt::events::DecodeAsEvent for Reserved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was unreserved (moved from reserved to free)."] pub struct Unreserved { pub who: unreserved::Who, @@ -7538,20 +7430,25 @@ pub mod api { } pub mod unreserved { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Unreserved { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Unreserved"; + impl Unreserved { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Unreserved"; + } + impl ::subxt::events::DecodeAsEvent for Unreserved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was moved from the reserve of the first account to the second account."] #[doc = "Final argument indicates the destination balance type."] pub struct ReserveRepatriated { @@ -7562,23 +7459,28 @@ pub mod api { } pub mod reserve_repatriated { use super::runtime_types; - pub type From = ::subxt::ext::subxt_core::utils::AccountId32; - pub type To = ::subxt::ext::subxt_core::utils::AccountId32; + pub type From = ::subxt::utils::AccountId32; + pub type To = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; pub type DestinationStatus = runtime_types::frame_support::traits::tokens::misc::BalanceStatus; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ReserveRepatriated { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "ReserveRepatriated"; + impl ReserveRepatriated { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "ReserveRepatriated"; + } + impl ::subxt::events::DecodeAsEvent for ReserveRepatriated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was deposited (e.g. for transaction fees)."] pub struct Deposit { pub who: deposit::Who, @@ -7586,20 +7488,25 @@ pub mod api { } pub mod deposit { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Deposit { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Deposit"; + impl Deposit { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Deposit"; + } + impl ::subxt::events::DecodeAsEvent for Deposit { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] pub struct Withdraw { pub who: withdraw::Who, @@ -7607,20 +7514,25 @@ pub mod api { } pub mod withdraw { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Withdraw { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Withdraw"; + impl Withdraw { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Withdraw"; + } + impl ::subxt::events::DecodeAsEvent for Withdraw { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] pub struct Slashed { pub who: slashed::Who, @@ -7628,20 +7540,25 @@ pub mod api { } pub mod slashed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Slashed { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Slashed"; + impl Slashed { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Slashed"; + } + impl ::subxt::events::DecodeAsEvent for Slashed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was minted into an account."] pub struct Minted { pub who: minted::Who, @@ -7649,20 +7566,25 @@ pub mod api { } pub mod minted { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Minted { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Minted"; + impl Minted { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Minted"; + } + impl ::subxt::events::DecodeAsEvent for Minted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some credit was balanced and added to the TotalIssuance."] pub struct MintedCredit { pub amount: minted_credit::Amount, @@ -7671,17 +7593,22 @@ pub mod api { use super::runtime_types; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MintedCredit { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "MintedCredit"; + impl MintedCredit { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "MintedCredit"; + } + impl ::subxt::events::DecodeAsEvent for MintedCredit { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was burned from an account."] pub struct Burned { pub who: burned::Who, @@ -7689,20 +7616,25 @@ pub mod api { } pub mod burned { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Burned"; + impl Burned { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Burned"; + } + impl ::subxt::events::DecodeAsEvent for Burned { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some debt has been dropped from the Total Issuance."] pub struct BurnedDebt { pub amount: burned_debt::Amount, @@ -7711,17 +7643,22 @@ pub mod api { use super::runtime_types; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BurnedDebt { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "BurnedDebt"; + impl BurnedDebt { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "BurnedDebt"; + } + impl ::subxt::events::DecodeAsEvent for BurnedDebt { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was suspended from an account (it can be restored later)."] pub struct Suspended { pub who: suspended::Who, @@ -7729,20 +7666,25 @@ pub mod api { } pub mod suspended { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Suspended { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Suspended"; + impl Suspended { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Suspended"; + } + impl ::subxt::events::DecodeAsEvent for Suspended { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was restored into an account."] pub struct Restored { pub who: restored::Who, @@ -7750,39 +7692,49 @@ pub mod api { } pub mod restored { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Restored { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Restored"; + impl Restored { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Restored"; + } + impl ::subxt::events::DecodeAsEvent for Restored { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An account was upgraded."] pub struct Upgraded { pub who: upgraded::Who, } pub mod upgraded { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Upgraded { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Upgraded"; + impl Upgraded { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Upgraded"; + } + impl ::subxt::events::DecodeAsEvent for Upgraded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Total issuance was increased by `amount`, creating a credit to be balanced."] pub struct Issued { pub amount: issued::Amount, @@ -7791,17 +7743,22 @@ pub mod api { use super::runtime_types; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Issued { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Issued"; + impl Issued { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Issued"; + } + impl ::subxt::events::DecodeAsEvent for Issued { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Total issuance was decreased by `amount`, creating a debt to be balanced."] pub struct Rescinded { pub amount: rescinded::Amount, @@ -7810,17 +7767,22 @@ pub mod api { use super::runtime_types; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rescinded { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Rescinded"; + impl Rescinded { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Rescinded"; + } + impl ::subxt::events::DecodeAsEvent for Rescinded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was locked."] pub struct Locked { pub who: locked::Who, @@ -7828,20 +7790,25 @@ pub mod api { } pub mod locked { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Locked { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Locked"; + impl Locked { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Locked"; + } + impl ::subxt::events::DecodeAsEvent for Locked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was unlocked."] pub struct Unlocked { pub who: unlocked::Who, @@ -7849,20 +7816,25 @@ pub mod api { } pub mod unlocked { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Unlocked { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Unlocked"; + impl Unlocked { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Unlocked"; + } + impl ::subxt::events::DecodeAsEvent for Unlocked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was frozen."] pub struct Frozen { pub who: frozen::Who, @@ -7870,20 +7842,25 @@ pub mod api { } pub mod frozen { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Frozen { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Frozen"; + impl Frozen { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Frozen"; + } + impl ::subxt::events::DecodeAsEvent for Frozen { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was thawed."] pub struct Thawed { pub who: thawed::Who, @@ -7891,20 +7868,25 @@ pub mod api { } pub mod thawed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Thawed { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Thawed"; + impl Thawed { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Thawed"; + } + impl ::subxt::events::DecodeAsEvent for Thawed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `TotalIssuance` was forcefully changed."] pub struct TotalIssuanceForced { pub old: total_issuance_forced::Old, @@ -7915,17 +7897,22 @@ pub mod api { pub type Old = ::core::primitive::u128; pub type New = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TotalIssuanceForced { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "TotalIssuanceForced"; + impl TotalIssuanceForced { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "TotalIssuanceForced"; + } + impl ::subxt::events::DecodeAsEvent for TotalIssuanceForced { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was placed on hold."] pub struct Held { pub reason: held::Reason, @@ -7935,20 +7922,25 @@ pub mod api { pub mod held { use super::runtime_types; pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Held { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Held"; + impl Held { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Held"; + } + impl ::subxt::events::DecodeAsEvent for Held { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Held balance was burned from an account."] pub struct BurnedHeld { pub reason: burned_held::Reason, @@ -7958,20 +7950,25 @@ pub mod api { pub mod burned_held { use super::runtime_types; pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BurnedHeld { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "BurnedHeld"; + impl BurnedHeld { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "BurnedHeld"; + } + impl ::subxt::events::DecodeAsEvent for BurnedHeld { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A transfer of `amount` on hold from `source` to `dest` was initiated."] pub struct TransferOnHold { pub reason: transfer_on_hold::Reason, @@ -7982,21 +7979,26 @@ pub mod api { pub mod transfer_on_hold { use super::runtime_types; pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; - pub type Source = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Dest = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Source = ::subxt::utils::AccountId32; + pub type Dest = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransferOnHold { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "TransferOnHold"; + impl TransferOnHold { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "TransferOnHold"; + } + impl ::subxt::events::DecodeAsEvent for TransferOnHold { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `transferred` balance is placed on hold at the `dest` account."] pub struct TransferAndHold { pub reason: transfer_and_hold::Reason, @@ -8007,21 +8009,26 @@ pub mod api { pub mod transfer_and_hold { use super::runtime_types; pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; - pub type Source = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Dest = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Source = ::subxt::utils::AccountId32; + pub type Dest = ::subxt::utils::AccountId32; pub type Transferred = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransferAndHold { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "TransferAndHold"; + impl TransferAndHold { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "TransferAndHold"; + } + impl ::subxt::events::DecodeAsEvent for TransferAndHold { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was released from hold."] pub struct Released { pub reason: released::Reason, @@ -8031,29 +8038,39 @@ pub mod api { pub mod released { use super::runtime_types; pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Released { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Released"; + impl Released { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Released"; + } + impl ::subxt::events::DecodeAsEvent for Released { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An unexpected/defensive event was triggered."] pub struct Unexpected(pub unexpected::Field0); pub mod unexpected { use super::runtime_types; pub type Field0 = runtime_types::pallet_balances::pallet::UnexpectedKind; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Unexpected { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Unexpected"; + impl Unexpected { + const PALLET_NAME: &'static str = "Balances"; + const EVENT_NAME: &'static str = "Unexpected"; + } + impl ::subxt::events::DecodeAsEvent for Unexpected { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -8064,12 +8081,9 @@ pub mod api { #[doc = " The total units issued in the system."] pub fn total_issuance( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - total_issuance::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), total_issuance::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Balances", "TotalIssuance", [ @@ -8082,12 +8096,12 @@ pub mod api { #[doc = " The total units of outstanding deactivated balance in the system."] pub fn inactive_issuance( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - inactive_issuance::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + inactive_issuance::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Balances", "InactiveIssuance", [ @@ -8123,12 +8137,12 @@ pub mod api { #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] pub fn account( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (account::Param0,), - account::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (account::input::Param0,), + account::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Balances", "Account", [ @@ -8145,12 +8159,12 @@ pub mod api { #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] pub fn locks( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (locks::Param0,), - locks::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (locks::input::Param0,), + locks::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Balances", "Locks", [ @@ -8166,12 +8180,12 @@ pub mod api { #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] pub fn reserves( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (reserves::Param0,), - reserves::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (reserves::input::Param0,), + reserves::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Balances", "Reserves", [ @@ -8185,12 +8199,12 @@ pub mod api { #[doc = " Holds on account balances."] pub fn holds( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (holds::Param0,), - holds::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (holds::input::Param0,), + holds::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Balances", "Holds", [ @@ -8203,12 +8217,12 @@ pub mod api { #[doc = " Freeze locks on account balances."] pub fn freezes( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (freezes::Param0,), - freezes::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (freezes::input::Param0,), + freezes::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Balances", "Freezes", [ @@ -8223,84 +8237,82 @@ pub mod api { pub mod total_issuance { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u128; } + pub type Output = ::core::primitive::u128; } pub mod inactive_issuance { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u128; } + pub type Output = ::core::primitive::u128; } pub mod account { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = + runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>; } pub mod locks { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< - runtime_types::pallet_balances::types::BalanceLock< - ::core::primitive::u128, - >, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + runtime_types::pallet_balances::types::BalanceLock<::core::primitive::u128>, + >; } pub mod reserves { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_balances::types::ReserveData< - [::core::primitive::u8; 8usize], - ::core::primitive::u128, - >, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_balances::types::ReserveData< + [::core::primitive::u8; 8usize], + ::core::primitive::u128, + >, + >; } pub mod holds { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::frame_support::traits::tokens::misc::IdAmount< - runtime_types::rococo_runtime::RuntimeHoldReason, - ::core::primitive::u128, - >, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::frame_support::traits::tokens::misc::IdAmount< + runtime_types::rococo_runtime::RuntimeHoldReason, + ::core::primitive::u128, + >, + >; } pub mod freezes { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::frame_support::traits::tokens::misc::IdAmount< - (), - ::core::primitive::u128, - >, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::frame_support::traits::tokens::misc::IdAmount< + (), + ::core::primitive::u128, + >, + >; } } pub mod constants { @@ -8317,10 +8329,8 @@ pub mod api { #[doc = " Bottom line: Do yourself a favour and make it at least one!"] pub fn existential_deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Balances", "ExistentialDeposit", [ @@ -8336,10 +8346,8 @@ pub mod api { #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] pub fn max_locks( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Balances", "MaxLocks", [ @@ -8355,10 +8363,8 @@ pub mod api { #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] pub fn max_reserves( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Balances", "MaxReserves", [ @@ -8372,10 +8378,8 @@ pub mod api { #[doc = " The maximum number of individual freeze locks that can exist on an account at any time."] pub fn max_freezes( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Balances", "MaxFreezes", [ @@ -8397,57 +8401,57 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the value of a parameter."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `AdminOrigin` for the given `key`. Values be"] + #[doc = "deleted by setting them to `None`."] + pub struct SetParameter { + pub key_value: set_parameter::KeyValue, + } + pub mod set_parameter { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the value of a parameter."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `AdminOrigin` for the given `key`. Values be"] - #[doc = "deleted by setting them to `None`."] - pub struct SetParameter { - pub key_value: set_parameter::KeyValue, - } - pub mod set_parameter { - use super::runtime_types; - pub type KeyValue = runtime_types::rococo_runtime::RuntimeParameters; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetParameter { - const PALLET: &'static str = "Parameters"; - const CALL: &'static str = "set_parameter"; + pub type KeyValue = runtime_types::rococo_runtime::RuntimeParameters; + } + impl SetParameter { + const PALLET_NAME: &'static str = "Parameters"; + const CALL_NAME: &'static str = "set_parameter"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetParameter { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Set the value of a parameter."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `AdminOrigin` for the given `key`. Values be"] - #[doc = "deleted by setting them to `None`."] - pub fn set_parameter( - &self, - key_value: types::set_parameter::KeyValue, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Parameters", - "set_parameter", - types::SetParameter { key_value }, - [ - 82u8, 119u8, 126u8, 179u8, 210u8, 236u8, 135u8, 48u8, 188u8, 108u8, - 183u8, 91u8, 202u8, 109u8, 117u8, 199u8, 73u8, 154u8, 5u8, 3u8, 122u8, - 247u8, 107u8, 7u8, 55u8, 20u8, 127u8, 171u8, 14u8, 177u8, 4u8, 225u8, - ], - ) + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the value of a parameter."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `AdminOrigin` for the given `key`. Values be"] + #[doc = "deleted by setting them to `None`."] + pub fn set_parameter( + &self, + key_value: super::set_parameter::KeyValue, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Parameters", + "set_parameter", + super::SetParameter { key_value }, + [ + 82u8, 119u8, 126u8, 179u8, 210u8, 236u8, 135u8, 48u8, 188u8, 108u8, + 183u8, 91u8, 202u8, 109u8, 117u8, 199u8, 73u8, 154u8, 5u8, 3u8, + 122u8, 247u8, 107u8, 7u8, 55u8, 20u8, 127u8, 171u8, 14u8, 177u8, + 4u8, 225u8, + ], + ) + } } } } @@ -8456,12 +8460,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A Parameter was set."] #[doc = ""] #[doc = "Is also emitted when the value was not changed."] @@ -8478,9 +8482,14 @@ pub mod api { pub type NewValue = ::core::option::Option; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Updated { - const PALLET: &'static str = "Parameters"; - const EVENT: &'static str = "Updated"; + impl Updated { + const PALLET_NAME: &'static str = "Parameters"; + const EVENT_NAME: &'static str = "Updated"; + } + impl ::subxt::events::DecodeAsEvent for Updated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -8491,12 +8500,12 @@ pub mod api { #[doc = " Stored parameters."] pub fn parameters( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (parameters::Param0,), - parameters::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (parameters::input::Param0,), + parameters::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Parameters", "Parameters", [ @@ -8511,11 +8520,11 @@ pub mod api { pub mod parameters { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::rococo_runtime::RuntimeParametersKey; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::rococo_runtime::RuntimeParametersValue; + pub type Param0 = runtime_types::rococo_runtime::RuntimeParametersKey; } + pub type Output = runtime_types::rococo_runtime::RuntimeParametersValue; } } } @@ -8527,12 +8536,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,"] #[doc = "has been paid by `who`."] pub struct TransactionFeePaid { @@ -8542,13 +8551,18 @@ pub mod api { } pub mod transaction_fee_paid { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type ActualFee = ::core::primitive::u128; pub type Tip = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionFeePaid { - const PALLET: &'static str = "TransactionPayment"; - const EVENT: &'static str = "TransactionFeePaid"; + impl TransactionFeePaid { + const PALLET_NAME: &'static str = "TransactionPayment"; + const EVENT_NAME: &'static str = "TransactionFeePaid"; + } + impl ::subxt::events::DecodeAsEvent for TransactionFeePaid { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -8558,12 +8572,12 @@ pub mod api { impl StorageApi { pub fn next_fee_multiplier( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - next_fee_multiplier::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + next_fee_multiplier::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "TransactionPayment", "NextFeeMultiplier", [ @@ -8575,12 +8589,9 @@ pub mod api { } pub fn storage_version( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - storage_version::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), storage_version::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "TransactionPayment", "StorageVersion", [ @@ -8596,12 +8607,12 @@ pub mod api { #[doc = " Use `withdraw_txfee` and `remaining_txfee` to access from outside the crate."] pub fn tx_payment_credit( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - tx_payment_credit::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + tx_payment_credit::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "TransactionPayment", "TxPaymentCredit", [ @@ -8615,26 +8626,30 @@ pub mod api { pub mod next_fee_multiplier { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_arithmetic::fixed_point::FixedU128; } + pub type Output = runtime_types::sp_arithmetic::fixed_point::FixedU128; } pub mod storage_version { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_transaction_payment::Releases; } + pub type Output = runtime_types::pallet_transaction_payment::Releases; } pub mod tx_payment_credit { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: frame_support :: traits :: storage :: NoDrop < runtime_types :: frame_support :: traits :: tokens :: fungible :: imbalance :: Imbalance < :: core :: primitive :: u128 > > ; } + pub type Output = runtime_types::frame_support::traits::storage::NoDrop< + runtime_types::frame_support::traits::tokens::fungible::imbalance::Imbalance< + ::core::primitive::u128, + >, + >; } } pub mod constants { @@ -8664,10 +8679,8 @@ pub mod api { #[doc = " transactions."] pub fn operational_fee_multiplier( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u8, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u8> { + ::subxt::constants::StaticAddress::new_static( "TransactionPayment", "OperationalFeeMultiplier", [ @@ -8692,12 +8705,9 @@ pub mod api { #[doc = " Author of current block."] pub fn author( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - author::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), author::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Authorship", "Author", [ @@ -8712,10 +8722,10 @@ pub mod api { pub mod author { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; } + pub type Output = ::subxt::utils::AccountId32; } } } @@ -8727,12 +8737,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] #[doc = "(kind-specific) time slot. This event is not deposited for duplicate slashes."] #[doc = "\\[kind, timeslot\\]."] @@ -8743,12 +8753,16 @@ pub mod api { pub mod offence { use super::runtime_types; pub type Kind = [::core::primitive::u8; 16usize]; - pub type Timeslot = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Timeslot = ::subxt::alloc::vec::Vec<::core::primitive::u8>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Offence { - const PALLET: &'static str = "Offences"; - const EVENT: &'static str = "Offence"; + impl Offence { + const PALLET_NAME: &'static str = "Offences"; + const EVENT_NAME: &'static str = "Offence"; + } + impl ::subxt::events::DecodeAsEvent for Offence { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -8759,12 +8773,12 @@ pub mod api { #[doc = " The primary structure that holds all offence records keyed by report identifiers."] pub fn reports( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (reports::Param0,), - reports::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (reports::input::Param0,), + reports::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Offences", "Reports", [ @@ -8777,15 +8791,15 @@ pub mod api { #[doc = " A vector of reports of the same kind that happened at the same time slot."] pub fn concurrent_reports_index( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< ( - concurrent_reports_index::Param0, - concurrent_reports_index::Param1, + concurrent_reports_index::input::Param0, + concurrent_reports_index::input::Param1, ), - concurrent_reports_index::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + concurrent_reports_index::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Offences", "ConcurrentReportsIndex", [ @@ -8800,26 +8814,24 @@ pub mod api { pub mod reports { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_staking::offence::OffenceDetails< - ::subxt::ext::subxt_core::utils::AccountId32, - (::subxt::ext::subxt_core::utils::AccountId32, ()), - >; + pub type Param0 = ::subxt::utils::H256; } + pub type Output = runtime_types::sp_staking::offence::OffenceDetails< + ::subxt::utils::AccountId32, + (::subxt::utils::AccountId32, ()), + >; } pub mod concurrent_reports_index { use super::root_mod; use super::runtime_types; - pub type Param0 = [::core::primitive::u8; 16usize]; - pub type Param1 = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::H256, - >; + pub type Param0 = [::core::primitive::u8; 16usize]; + pub type Param1 = ::subxt::alloc::vec::Vec<::core::primitive::u8>; } + pub type Output = ::subxt::alloc::vec::Vec<::subxt::utils::H256>; } } } @@ -8831,12 +8843,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The merkle root of the validators of the said session were stored"] pub struct RootStored { pub index: root_stored::Index, @@ -8845,17 +8857,22 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RootStored { - const PALLET: &'static str = "Historical"; - const EVENT: &'static str = "RootStored"; + impl RootStored { + const PALLET_NAME: &'static str = "Historical"; + const EVENT_NAME: &'static str = "RootStored"; + } + impl ::subxt::events::DecodeAsEvent for RootStored { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The merkle roots of up to this session index were pruned"] pub struct RootsPruned { pub up_to: roots_pruned::UpTo, @@ -8864,9 +8881,14 @@ pub mod api { use super::runtime_types; pub type UpTo = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RootsPruned { - const PALLET: &'static str = "Historical"; - const EVENT: &'static str = "RootsPruned"; + impl RootsPruned { + const PALLET_NAME: &'static str = "Historical"; + const EVENT_NAME: &'static str = "RootsPruned"; + } + impl ::subxt::events::DecodeAsEvent for RootsPruned { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -8877,12 +8899,12 @@ pub mod api { #[doc = " Mapping from historical session indices to session-data root hash and validator count."] pub fn historical_sessions( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (historical_sessions::Param0,), - historical_sessions::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (historical_sessions::input::Param0,), + historical_sessions::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Historical", "HistoricalSessions", [ @@ -8896,12 +8918,9 @@ pub mod api { #[doc = " The range of historical sessions we store. [first, last)"] pub fn stored_range( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - stored_range::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), stored_range::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Historical", "StoredRange", [ @@ -8916,22 +8935,19 @@ pub mod api { pub mod historical_sessions { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ( - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - ); + pub type Param0 = ::core::primitive::u32; } + pub type Output = (::subxt::utils::H256, ::core::primitive::u32); } pub mod stored_range { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (::core::primitive::u32, ::core::primitive::u32); } + pub type Output = (::core::primitive::u32, ::core::primitive::u32); } } } @@ -8945,127 +8961,126 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the session key(s) of the function caller to `keys`."] + #[doc = "Allows an account to set its session key prior to becoming a validator."] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be signed."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`. Actual cost depends on the number of length of `T::Keys::key_ids()` which is"] + #[doc = " fixed."] + pub struct SetKeys { + pub keys: set_keys::Keys, + pub proof: set_keys::Proof, + } + pub mod set_keys { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the session key(s) of the function caller to `keys`."] - #[doc = "Allows an account to set its session key prior to becoming a validator."] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be signed."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`. Actual cost depends on the number of length of `T::Keys::key_ids()` which is"] - #[doc = " fixed."] - pub struct SetKeys { - pub keys: set_keys::Keys, - pub proof: set_keys::Proof, - } - pub mod set_keys { - use super::runtime_types; - pub type Keys = runtime_types::rococo_runtime::SessionKeys; - pub type Proof = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetKeys { - const PALLET: &'static str = "Session"; - const CALL: &'static str = "set_keys"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Removes any session key(s) of the function caller."] - #[doc = ""] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] - #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] - #[doc = "means being a controller account) or directly convertible into a validator ID (which"] - #[doc = "usually means being a stash account)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)` in number of key types. Actual cost depends on the number of length of"] - #[doc = " `T::Keys::key_ids()` which is fixed."] - pub struct PurgeKeys; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PurgeKeys { - const PALLET: &'static str = "Session"; - const CALL: &'static str = "purge_keys"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Sets the session key(s) of the function caller to `keys`."] - #[doc = "Allows an account to set its session key prior to becoming a validator."] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be signed."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`. Actual cost depends on the number of length of `T::Keys::key_ids()` which is"] - #[doc = " fixed."] - pub fn set_keys( - &self, - keys: types::set_keys::Keys, - proof: types::set_keys::Proof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Session", - "set_keys", - types::SetKeys { keys, proof }, - [ - 251u8, 79u8, 44u8, 78u8, 55u8, 160u8, 150u8, 159u8, 183u8, 86u8, 129u8, - 32u8, 250u8, 138u8, 223u8, 100u8, 40u8, 203u8, 116u8, 224u8, 244u8, - 142u8, 7u8, 154u8, 147u8, 97u8, 160u8, 162u8, 95u8, 5u8, 213u8, 246u8, - ], - ) + pub type Keys = runtime_types::rococo_runtime::SessionKeys; + pub type Proof = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl SetKeys { + const PALLET_NAME: &'static str = "Session"; + const CALL_NAME: &'static str = "set_keys"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetKeys { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Removes any session key(s) of the function caller."] - #[doc = ""] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] - #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] - #[doc = "means being a controller account) or directly convertible into a validator ID (which"] - #[doc = "usually means being a stash account)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)` in number of key types. Actual cost depends on the number of length of"] - #[doc = " `T::Keys::key_ids()` which is fixed."] - pub fn purge_keys( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Session", - "purge_keys", - types::PurgeKeys {}, - [ - 215u8, 204u8, 146u8, 236u8, 32u8, 78u8, 198u8, 79u8, 85u8, 214u8, 15u8, - 151u8, 158u8, 31u8, 146u8, 119u8, 119u8, 204u8, 151u8, 169u8, 226u8, - 67u8, 217u8, 39u8, 241u8, 245u8, 203u8, 240u8, 203u8, 172u8, 16u8, - 209u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Removes any session key(s) of the function caller."] + #[doc = ""] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] + #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] + #[doc = "means being a controller account) or directly convertible into a validator ID (which"] + #[doc = "usually means being a stash account)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)` in number of key types. Actual cost depends on the number of length of"] + #[doc = " `T::Keys::key_ids()` which is fixed."] + pub struct PurgeKeys; + impl PurgeKeys { + const PALLET_NAME: &'static str = "Session"; + const CALL_NAME: &'static str = "purge_keys"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PurgeKeys { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Sets the session key(s) of the function caller to `keys`."] + #[doc = "Allows an account to set its session key prior to becoming a validator."] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be signed."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`. Actual cost depends on the number of length of `T::Keys::key_ids()` which is"] + #[doc = " fixed."] + pub fn set_keys( + &self, + keys: super::set_keys::Keys, + proof: super::set_keys::Proof, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Session", + "set_keys", + super::SetKeys { keys, proof }, + [ + 251u8, 79u8, 44u8, 78u8, 55u8, 160u8, 150u8, 159u8, 183u8, 86u8, + 129u8, 32u8, 250u8, 138u8, 223u8, 100u8, 40u8, 203u8, 116u8, 224u8, + 244u8, 142u8, 7u8, 154u8, 147u8, 97u8, 160u8, 162u8, 95u8, 5u8, + 213u8, 246u8, + ], + ) + } + #[doc = "Removes any session key(s) of the function caller."] + #[doc = ""] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] + #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] + #[doc = "means being a controller account) or directly convertible into a validator ID (which"] + #[doc = "usually means being a stash account)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)` in number of key types. Actual cost depends on the number of length of"] + #[doc = " `T::Keys::key_ids()` which is fixed."] + pub fn purge_keys( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Session", + "purge_keys", + super::PurgeKeys {}, + [ + 215u8, 204u8, 146u8, 236u8, 32u8, 78u8, 198u8, 79u8, 85u8, 214u8, + 15u8, 151u8, 158u8, 31u8, 146u8, 119u8, 119u8, 204u8, 151u8, 169u8, + 226u8, 67u8, 217u8, 39u8, 241u8, 245u8, 203u8, 240u8, 203u8, 172u8, + 16u8, 209u8, + ], + ) + } } } } @@ -9074,12 +9089,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "New session has happened. Note that the argument is the session index, not the"] #[doc = "block number as the type might suggest."] pub struct NewSession { @@ -9089,61 +9104,81 @@ pub mod api { use super::runtime_types; pub type SessionIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NewSession { - const PALLET: &'static str = "Session"; - const EVENT: &'static str = "NewSession"; + impl NewSession { + const PALLET_NAME: &'static str = "Session"; + const EVENT_NAME: &'static str = "NewSession"; + } + impl ::subxt::events::DecodeAsEvent for NewSession { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `NewSession` event in the current block also implies a new validator set to be"] #[doc = "queued."] pub struct NewQueued; - impl ::subxt::ext::subxt_core::events::StaticEvent for NewQueued { - const PALLET: &'static str = "Session"; - const EVENT: &'static str = "NewQueued"; + impl NewQueued { + const PALLET_NAME: &'static str = "Session"; + const EVENT_NAME: &'static str = "NewQueued"; + } + impl ::subxt::events::DecodeAsEvent for NewQueued { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Validator has been disabled."] pub struct ValidatorDisabled { pub validator: validator_disabled::Validator, } pub mod validator_disabled { use super::runtime_types; - pub type Validator = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Validator = ::subxt::utils::AccountId32; + } + impl ValidatorDisabled { + const PALLET_NAME: &'static str = "Session"; + const EVENT_NAME: &'static str = "ValidatorDisabled"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ValidatorDisabled { - const PALLET: &'static str = "Session"; - const EVENT: &'static str = "ValidatorDisabled"; + impl ::subxt::events::DecodeAsEvent for ValidatorDisabled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Validator has been re-enabled."] pub struct ValidatorReenabled { pub validator: validator_reenabled::Validator, } pub mod validator_reenabled { use super::runtime_types; - pub type Validator = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Validator = ::subxt::utils::AccountId32; + } + impl ValidatorReenabled { + const PALLET_NAME: &'static str = "Session"; + const EVENT_NAME: &'static str = "ValidatorReenabled"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ValidatorReenabled { - const PALLET: &'static str = "Session"; - const EVENT: &'static str = "ValidatorReenabled"; + impl ::subxt::events::DecodeAsEvent for ValidatorReenabled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -9154,12 +9189,9 @@ pub mod api { #[doc = " The current set of validators."] pub fn validators( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - validators::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), validators::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Session", "Validators", [ @@ -9173,12 +9205,9 @@ pub mod api { #[doc = " Current index of the session."] pub fn current_index( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - current_index::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), current_index::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Session", "CurrentIndex", [ @@ -9193,12 +9222,9 @@ pub mod api { #[doc = " has changed in the queued validator set."] pub fn queued_changed( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - queued_changed::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), queued_changed::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Session", "QueuedChanged", [ @@ -9213,12 +9239,9 @@ pub mod api { #[doc = " will be used to determine the validator's session keys."] pub fn queued_keys( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - queued_keys::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), queued_keys::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Session", "QueuedKeys", [ @@ -9236,12 +9259,12 @@ pub mod api { #[doc = " a new set of identities."] pub fn disabled_validators( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - disabled_validators::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + disabled_validators::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Session", "DisabledValidators", [ @@ -9254,12 +9277,12 @@ pub mod api { #[doc = " The next session keys for a validator."] pub fn next_keys( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (next_keys::Param0,), - next_keys::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (next_keys::input::Param0,), + next_keys::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Session", "NextKeys", [ @@ -9272,12 +9295,12 @@ pub mod api { #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] pub fn key_owner( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (key_owner::Param0,), - key_owner::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (key_owner::input::Param0,), + key_owner::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Session", "KeyOwner", [ @@ -9292,71 +9315,69 @@ pub mod api { pub mod validators { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; } + pub type Output = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; } pub mod current_index { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod queued_changed { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::bool; } + pub type Output = ::core::primitive::bool; } pub mod queued_keys { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::rococo_runtime::SessionKeys, - )>; } + pub type Output = ::subxt::alloc::vec::Vec<( + ::subxt::utils::AccountId32, + runtime_types::rococo_runtime::SessionKeys, + )>; } pub mod disabled_validators { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u32, - runtime_types::sp_staking::offence::OffenceSeverity, - )>; } + pub type Output = ::subxt::alloc::vec::Vec<( + ::core::primitive::u32, + runtime_types::sp_staking::offence::OffenceSeverity, + )>; } pub mod next_keys { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::rococo_runtime::SessionKeys; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::rococo_runtime::SessionKeys; } pub mod key_owner { use super::root_mod; use super::runtime_types; - pub type Param0 = ( - runtime_types::sp_core::crypto::KeyTypeId, - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ); - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param0 = ( + runtime_types::sp_core::crypto::KeyTypeId, + ::subxt::alloc::vec::Vec<::core::primitive::u8>, + ); } + pub type Output = ::subxt::utils::AccountId32; } } pub mod constants { @@ -9366,10 +9387,8 @@ pub mod api { #[doc = " The amount to be held when setting keys."] pub fn key_deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Session", "KeyDeposit", [ @@ -9392,211 +9411,209 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + pub struct ReportEquivocation { + pub equivocation_proof: + ::subxt::alloc::boxed::Box, + pub key_owner_proof: report_equivocation::KeyOwnerProof, + } + pub mod report_equivocation { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - pub struct ReportEquivocation { - pub equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_equivocation::EquivocationProof, - >, - pub key_owner_proof: report_equivocation::KeyOwnerProof, - } - pub mod report_equivocation { - use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_grandpa::EquivocationProof< - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - >; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportEquivocation { - const PALLET: &'static str = "Grandpa"; - const CALL: &'static str = "report_equivocation"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub struct ReportEquivocationUnsigned { - pub equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_equivocation_unsigned::EquivocationProof, - >, - pub key_owner_proof: report_equivocation_unsigned::KeyOwnerProof, - } - pub mod report_equivocation_unsigned { - use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_grandpa::EquivocationProof< - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - >; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportEquivocationUnsigned { - const PALLET: &'static str = "Grandpa"; - const CALL: &'static str = "report_equivocation_unsigned"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Note that the current authority set of the GRANDPA finality gadget has stalled."] - #[doc = ""] - #[doc = "This will trigger a forced authority set change at the beginning of the next session, to"] - #[doc = "be enacted `delay` blocks after that. The `delay` should be high enough to safely assume"] - #[doc = "that the block signalling the forced change will not be re-orged e.g. 1000 blocks."] - #[doc = "The block production rate (which may be slowed down because of finality lagging) should"] - #[doc = "be taken into account when choosing the `delay`. The GRANDPA voters based on the new"] - #[doc = "authority will start voting on top of `best_finalized_block_number` for new finalized"] - #[doc = "blocks. `best_finalized_block_number` should be the highest of the latest finalized"] - #[doc = "block of all validators of the new authority set."] - #[doc = ""] - #[doc = "Only callable by root."] - pub struct NoteStalled { - pub delay: note_stalled::Delay, - pub best_finalized_block_number: note_stalled::BestFinalizedBlockNumber, - } - pub mod note_stalled { - use super::runtime_types; - pub type Delay = ::core::primitive::u32; - pub type BestFinalizedBlockNumber = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NoteStalled { - const PALLET: &'static str = "Grandpa"; - const CALL: &'static str = "note_stalled"; + pub type EquivocationProof = runtime_types::sp_consensus_grandpa::EquivocationProof< + ::subxt::utils::H256, + ::core::primitive::u32, + >; + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + impl ReportEquivocation { + const PALLET_NAME: &'static str = "Grandpa"; + const CALL_NAME: &'static str = "report_equivocation"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportEquivocation { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - pub fn report_equivocation( - &self, - equivocation_proof: types::report_equivocation::EquivocationProof, - key_owner_proof: types::report_equivocation::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Grandpa", - "report_equivocation", - types::ReportEquivocation { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }, - [ - 197u8, 206u8, 246u8, 26u8, 171u8, 25u8, 214u8, 211u8, 138u8, 132u8, - 148u8, 48u8, 66u8, 12u8, 92u8, 17u8, 190u8, 155u8, 121u8, 222u8, 226u8, - 171u8, 208u8, 123u8, 253u8, 247u8, 253u8, 191u8, 90u8, 4u8, 224u8, - 104u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub struct ReportEquivocationUnsigned { + pub equivocation_proof: + ::subxt::alloc::boxed::Box, + pub key_owner_proof: report_equivocation_unsigned::KeyOwnerProof, + } + pub mod report_equivocation_unsigned { + use super::runtime_types; + pub type EquivocationProof = runtime_types::sp_consensus_grandpa::EquivocationProof< + ::subxt::utils::H256, + ::core::primitive::u32, + >; + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + impl ReportEquivocationUnsigned { + const PALLET_NAME: &'static str = "Grandpa"; + const CALL_NAME: &'static str = "report_equivocation_unsigned"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportEquivocationUnsigned { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub fn report_equivocation_unsigned( - &self, - equivocation_proof: types::report_equivocation_unsigned::EquivocationProof, - key_owner_proof: types::report_equivocation_unsigned::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ReportEquivocationUnsigned, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Grandpa", - "report_equivocation_unsigned", - types::ReportEquivocationUnsigned { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }, - [ - 109u8, 97u8, 251u8, 184u8, 77u8, 61u8, 95u8, 187u8, 132u8, 146u8, 18u8, - 105u8, 109u8, 124u8, 181u8, 74u8, 143u8, 171u8, 248u8, 188u8, 69u8, - 63u8, 65u8, 92u8, 64u8, 42u8, 104u8, 131u8, 67u8, 202u8, 172u8, 73u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Note that the current authority set of the GRANDPA finality gadget has stalled."] + #[doc = ""] + #[doc = "This will trigger a forced authority set change at the beginning of the next session, to"] + #[doc = "be enacted `delay` blocks after that. The `delay` should be high enough to safely assume"] + #[doc = "that the block signalling the forced change will not be re-orged e.g. 1000 blocks."] + #[doc = "The block production rate (which may be slowed down because of finality lagging) should"] + #[doc = "be taken into account when choosing the `delay`. The GRANDPA voters based on the new"] + #[doc = "authority will start voting on top of `best_finalized_block_number` for new finalized"] + #[doc = "blocks. `best_finalized_block_number` should be the highest of the latest finalized"] + #[doc = "block of all validators of the new authority set."] + #[doc = ""] + #[doc = "Only callable by root."] + pub struct NoteStalled { + pub delay: note_stalled::Delay, + pub best_finalized_block_number: note_stalled::BestFinalizedBlockNumber, + } + pub mod note_stalled { + use super::runtime_types; + pub type Delay = ::core::primitive::u32; + pub type BestFinalizedBlockNumber = ::core::primitive::u32; + } + impl NoteStalled { + const PALLET_NAME: &'static str = "Grandpa"; + const CALL_NAME: &'static str = "note_stalled"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for NoteStalled { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Note that the current authority set of the GRANDPA finality gadget has stalled."] - #[doc = ""] - #[doc = "This will trigger a forced authority set change at the beginning of the next session, to"] - #[doc = "be enacted `delay` blocks after that. The `delay` should be high enough to safely assume"] - #[doc = "that the block signalling the forced change will not be re-orged e.g. 1000 blocks."] - #[doc = "The block production rate (which may be slowed down because of finality lagging) should"] - #[doc = "be taken into account when choosing the `delay`. The GRANDPA voters based on the new"] - #[doc = "authority will start voting on top of `best_finalized_block_number` for new finalized"] - #[doc = "blocks. `best_finalized_block_number` should be the highest of the latest finalized"] - #[doc = "block of all validators of the new authority set."] - #[doc = ""] - #[doc = "Only callable by root."] - pub fn note_stalled( - &self, - delay: types::note_stalled::Delay, - best_finalized_block_number: types::note_stalled::BestFinalizedBlockNumber, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Grandpa", - "note_stalled", - types::NoteStalled { - delay, - best_finalized_block_number, - }, - [ - 158u8, 25u8, 64u8, 114u8, 131u8, 139u8, 227u8, 132u8, 42u8, 107u8, - 40u8, 249u8, 18u8, 93u8, 254u8, 86u8, 37u8, 67u8, 250u8, 35u8, 241u8, - 194u8, 209u8, 20u8, 39u8, 75u8, 186u8, 21u8, 48u8, 124u8, 151u8, 31u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + pub fn report_equivocation( + &self, + equivocation_proof: super::report_equivocation::EquivocationProof, + key_owner_proof: super::report_equivocation::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Grandpa", + "report_equivocation", + super::ReportEquivocation { + equivocation_proof: ::subxt::alloc::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }, + [ + 197u8, 206u8, 246u8, 26u8, 171u8, 25u8, 214u8, 211u8, 138u8, 132u8, + 148u8, 48u8, 66u8, 12u8, 92u8, 17u8, 190u8, 155u8, 121u8, 222u8, + 226u8, 171u8, 208u8, 123u8, 253u8, 247u8, 253u8, 191u8, 90u8, 4u8, + 224u8, 104u8, + ], + ) + } + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub fn report_equivocation_unsigned( + &self, + equivocation_proof: super::report_equivocation_unsigned::EquivocationProof, + key_owner_proof: super::report_equivocation_unsigned::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Grandpa", + "report_equivocation_unsigned", + super::ReportEquivocationUnsigned { + equivocation_proof: ::subxt::alloc::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }, + [ + 109u8, 97u8, 251u8, 184u8, 77u8, 61u8, 95u8, 187u8, 132u8, 146u8, + 18u8, 105u8, 109u8, 124u8, 181u8, 74u8, 143u8, 171u8, 248u8, 188u8, + 69u8, 63u8, 65u8, 92u8, 64u8, 42u8, 104u8, 131u8, 67u8, 202u8, + 172u8, 73u8, + ], + ) + } + #[doc = "Note that the current authority set of the GRANDPA finality gadget has stalled."] + #[doc = ""] + #[doc = "This will trigger a forced authority set change at the beginning of the next session, to"] + #[doc = "be enacted `delay` blocks after that. The `delay` should be high enough to safely assume"] + #[doc = "that the block signalling the forced change will not be re-orged e.g. 1000 blocks."] + #[doc = "The block production rate (which may be slowed down because of finality lagging) should"] + #[doc = "be taken into account when choosing the `delay`. The GRANDPA voters based on the new"] + #[doc = "authority will start voting on top of `best_finalized_block_number` for new finalized"] + #[doc = "blocks. `best_finalized_block_number` should be the highest of the latest finalized"] + #[doc = "block of all validators of the new authority set."] + #[doc = ""] + #[doc = "Only callable by root."] + pub fn note_stalled( + &self, + delay: super::note_stalled::Delay, + best_finalized_block_number: super::note_stalled::BestFinalizedBlockNumber, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Grandpa", + "note_stalled", + super::NoteStalled { + delay, + best_finalized_block_number, + }, + [ + 158u8, 25u8, 64u8, 114u8, 131u8, 139u8, 227u8, 132u8, 42u8, 107u8, + 40u8, 249u8, 18u8, 93u8, 254u8, 86u8, 37u8, 67u8, 250u8, 35u8, + 241u8, 194u8, 209u8, 20u8, 39u8, 75u8, 186u8, 21u8, 48u8, 124u8, + 151u8, 31u8, + ], + ) + } } } } @@ -9605,52 +9622,67 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "New authority set has been applied."] pub struct NewAuthorities { pub authority_set: new_authorities::AuthoritySet, } pub mod new_authorities { use super::runtime_types; - pub type AuthoritySet = ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub type AuthoritySet = ::subxt::alloc::vec::Vec<( runtime_types::sp_consensus_grandpa::app::Public, ::core::primitive::u64, )>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NewAuthorities { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "NewAuthorities"; + impl NewAuthorities { + const PALLET_NAME: &'static str = "Grandpa"; + const EVENT_NAME: &'static str = "NewAuthorities"; + } + impl ::subxt::events::DecodeAsEvent for NewAuthorities { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Current authority set has been paused."] pub struct Paused; - impl ::subxt::ext::subxt_core::events::StaticEvent for Paused { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "Paused"; + impl Paused { + const PALLET_NAME: &'static str = "Grandpa"; + const EVENT_NAME: &'static str = "Paused"; + } + impl ::subxt::events::DecodeAsEvent for Paused { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Current authority set has been resumed."] pub struct Resumed; - impl ::subxt::ext::subxt_core::events::StaticEvent for Resumed { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "Resumed"; + impl Resumed { + const PALLET_NAME: &'static str = "Grandpa"; + const EVENT_NAME: &'static str = "Resumed"; + } + impl ::subxt::events::DecodeAsEvent for Resumed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -9661,12 +9693,9 @@ pub mod api { #[doc = " State of the current authority set."] pub fn state( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - state::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), state::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Grandpa", "State", [ @@ -9680,12 +9709,9 @@ pub mod api { #[doc = " Pending change: (signaled at, scheduled change)."] pub fn pending_change( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - pending_change::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), pending_change::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Grandpa", "PendingChange", [ @@ -9698,12 +9724,9 @@ pub mod api { #[doc = " next block number where we can force a change."] pub fn next_forced( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - next_forced::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), next_forced::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Grandpa", "NextForced", [ @@ -9716,12 +9739,9 @@ pub mod api { #[doc = " `true` if we are currently stalled."] pub fn stalled( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - stalled::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), stalled::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Grandpa", "Stalled", [ @@ -9735,12 +9755,9 @@ pub mod api { #[doc = " in the \"set\" of Grandpa validators from genesis."] pub fn current_set_id( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - current_set_id::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), current_set_id::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Grandpa", "CurrentSetId", [ @@ -9763,12 +9780,12 @@ pub mod api { #[doc = " TWOX-NOTE: `SetId` is not under user control."] pub fn set_id_session( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (set_id_session::Param0,), - set_id_session::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (set_id_session::input::Param0,), + set_id_session::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Grandpa", "SetIdSession", [ @@ -9782,12 +9799,9 @@ pub mod api { #[doc = " The current list of authorities."] pub fn authorities( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - authorities::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), authorities::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Grandpa", "Authorities", [ @@ -9801,65 +9815,65 @@ pub mod api { pub mod state { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>; } + pub type Output = + runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>; } pub mod pending_change { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::pallet_grandpa::StoredPendingChange<::core::primitive::u32>; } + pub type Output = + runtime_types::pallet_grandpa::StoredPendingChange<::core::primitive::u32>; } pub mod next_forced { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod stalled { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (::core::primitive::u32, ::core::primitive::u32); } + pub type Output = (::core::primitive::u32, ::core::primitive::u32); } pub mod current_set_id { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u64; } + pub type Output = ::core::primitive::u64; } pub mod set_id_session { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u64; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u64; } + pub type Output = ::core::primitive::u32; } pub mod authorities { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_consensus_grandpa::app::Public, - ::core::primitive::u64, - )>; } + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( + runtime_types::sp_consensus_grandpa::app::Public, + ::core::primitive::u64, + )>; } } pub mod constants { @@ -9869,10 +9883,8 @@ pub mod api { #[doc = " Max Authorities in use"] pub fn max_authorities( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Grandpa", "MaxAuthorities", [ @@ -9886,10 +9898,8 @@ pub mod api { #[doc = " The maximum number of nominators for each validator."] pub fn max_nominators( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Grandpa", "MaxNominators", [ @@ -9908,10 +9918,8 @@ pub mod api { #[doc = " can be zero."] pub fn max_set_id_session_entries( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u64> { + ::subxt::constants::StaticAddress::new_static( "Grandpa", "MaxSetIdSessionEntries", [ @@ -9936,12 +9944,9 @@ pub mod api { #[doc = " Keys of the current authority set."] pub fn keys( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - keys::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), keys::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "AuthorityDiscovery", "Keys", [ @@ -9954,12 +9959,9 @@ pub mod api { #[doc = " Keys of the next authority set."] pub fn next_keys( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - next_keys::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), next_keys::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "AuthorityDiscovery", "NextKeys", [ @@ -9974,24 +9976,24 @@ pub mod api { pub mod keys { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< - runtime_types::sp_authority_discovery::app::Public, - >; } + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + runtime_types::sp_authority_discovery::app::Public, + >; } pub mod next_keys { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< - runtime_types::sp_authority_discovery::app::Public, - >; } + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + runtime_types::sp_authority_discovery::app::Public, + >; } } } @@ -10005,509 +10007,508 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] + #[doc = ""] + #[doc = "### Details"] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The destination account for the transfer."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::SpendApproved`] if successful."] + pub struct SpendLocal { + #[codec(compact)] + pub amount: spend_local::Amount, + pub beneficiary: spend_local::Beneficiary, + } + pub mod spend_local { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] - #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The destination account for the transfer."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::SpendApproved`] if successful."] - pub struct SpendLocal { - #[codec(compact)] - pub amount: spend_local::Amount, - pub beneficiary: spend_local::Beneficiary, - } - pub mod spend_local { - use super::runtime_types; - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SpendLocal { - const PALLET: &'static str = "Treasury"; - const CALL: &'static str = "spend_local"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force a previously approved proposal to be removed from the approval queue."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The original deposit will no longer be returned."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] - #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] - #[doc = ""] - #[doc = "### Errors"] - #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] - #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] - #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] - #[doc = " in the first place."] - pub struct RemoveApproval { - #[codec(compact)] - pub proposal_id: remove_approval::ProposalId, - } - pub mod remove_approval { - use super::runtime_types; - pub type ProposalId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveApproval { - const PALLET: &'static str = "Treasury"; - const CALL: &'static str = "remove_approval"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] - #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] - #[doc = "for assertion using the [`Config::BalanceConverter`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] - #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] - #[doc = "the [`Config::PayoutPeriod`]."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The beneficiary of the spend."] - #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] - #[doc = " the past if the resulting spend has not yet expired according to the"] - #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] - #[doc = " approval."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] - pub struct Spend { - pub asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box, - #[codec(compact)] - pub amount: spend::Amount, - pub beneficiary: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub valid_from: spend::ValidFrom, - } - pub mod spend { - use super::runtime_types; - pub type AssetKind = - runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = runtime_types::xcm::VersionedLocation; - pub type ValidFrom = ::core::option::Option<::core::primitive::u32>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Spend { - const PALLET: &'static str = "Treasury"; - const CALL: &'static str = "spend"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Claim a spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed"] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] - #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] - #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] - #[doc = "dispatchable before retrying with the current function."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - pub struct Payout { - pub index: payout::Index, - } - pub mod payout { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Payout { - const PALLET: &'static str = "Treasury"; - const CALL: &'static str = "payout"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Check the status of the spend and remove it from the storage if processed."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The status check is a prerequisite for retrying a failed payout."] - #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] - #[doc = "function. In such instances, transaction fees are refunded."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] - #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] - pub struct CheckStatus { - pub index: check_status::Index, - } - pub mod check_status { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CheckStatus { - const PALLET: &'static str = "Treasury"; - const CALL: &'static str = "check_status"; + pub type Amount = ::core::primitive::u128; + pub type Beneficiary = + ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl SpendLocal { + const PALLET_NAME: &'static str = "Treasury"; + const CALL_NAME: &'static str = "spend_local"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SpendLocal { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Void previously approved spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "A spend void is only possible if the payout has not been attempted yet."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] - pub struct VoidSpend { - pub index: void_spend::Index, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Force a previously approved proposal to be removed from the approval queue."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "The original deposit will no longer be returned."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `proposal_id`: The index of a proposal"] + #[doc = ""] + #[doc = "### Complexity"] + #[doc = "- O(A) where `A` is the number of approvals"] + #[doc = ""] + #[doc = "### Errors"] + #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] + #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] + #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] + #[doc = " in the first place."] + pub struct RemoveApproval { + #[codec(compact)] + pub proposal_id: remove_approval::ProposalId, + } + pub mod remove_approval { + use super::runtime_types; + pub type ProposalId = ::core::primitive::u32; + } + impl RemoveApproval { + const PALLET_NAME: &'static str = "Treasury"; + const CALL_NAME: &'static str = "remove_approval"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveApproval { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod void_spend { - use super::runtime_types; - pub type Index = ::core::primitive::u32; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] + #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] + #[doc = "for assertion using the [`Config::BalanceConverter`]."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] + #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] + #[doc = "the [`Config::PayoutPeriod`]."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The beneficiary of the spend."] + #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] + #[doc = " the past if the resulting spend has not yet expired according to the"] + #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] + #[doc = " approval."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] + pub struct Spend { + pub asset_kind: ::subxt::alloc::boxed::Box, + #[codec(compact)] + pub amount: spend::Amount, + pub beneficiary: ::subxt::alloc::boxed::Box, + pub valid_from: spend::ValidFrom, + } + pub mod spend { + use super::runtime_types; + pub type AssetKind = + runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; + pub type Amount = ::core::primitive::u128; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type ValidFrom = ::core::option::Option<::core::primitive::u32>; + } + impl Spend { + const PALLET_NAME: &'static str = "Treasury"; + const CALL_NAME: &'static str = "spend"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Spend { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VoidSpend { - const PALLET: &'static str = "Treasury"; - const CALL: &'static str = "void_spend"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Claim a spend."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be signed"] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] + #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] + #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] + #[doc = "dispatchable before retrying with the current function."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::Paid`] if successful."] + pub struct Payout { + pub index: payout::Index, + } + pub mod payout { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl Payout { + const PALLET_NAME: &'static str = "Treasury"; + const CALL_NAME: &'static str = "payout"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Payout { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] - #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The destination account for the transfer."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::SpendApproved`] if successful."] - pub fn spend_local( - &self, - amount: types::spend_local::Amount, - beneficiary: types::spend_local::Beneficiary, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Treasury", - "spend_local", - types::SpendLocal { - amount, - beneficiary, - }, - [ - 137u8, 171u8, 83u8, 247u8, 245u8, 212u8, 152u8, 127u8, 210u8, 71u8, - 254u8, 134u8, 189u8, 26u8, 249u8, 41u8, 214u8, 175u8, 24u8, 64u8, 33u8, - 90u8, 23u8, 134u8, 44u8, 110u8, 63u8, 46u8, 46u8, 146u8, 222u8, 79u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Check the status of the spend and remove it from the storage if processed."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be signed."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "The status check is a prerequisite for retrying a failed payout."] + #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] + #[doc = "function. In such instances, transaction fees are refunded."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] + #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] + pub struct CheckStatus { + pub index: check_status::Index, + } + pub mod check_status { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl CheckStatus { + const PALLET_NAME: &'static str = "Treasury"; + const CALL_NAME: &'static str = "check_status"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CheckStatus { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Force a previously approved proposal to be removed from the approval queue."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The original deposit will no longer be returned."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] - #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] - #[doc = ""] - #[doc = "### Errors"] - #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] - #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] - #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] - #[doc = " in the first place."] - pub fn remove_approval( - &self, - proposal_id: types::remove_approval::ProposalId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Treasury", - "remove_approval", - types::RemoveApproval { proposal_id }, - [ - 180u8, 20u8, 39u8, 227u8, 29u8, 228u8, 234u8, 36u8, 155u8, 114u8, - 197u8, 135u8, 185u8, 31u8, 56u8, 247u8, 224u8, 168u8, 254u8, 233u8, - 250u8, 134u8, 186u8, 155u8, 108u8, 84u8, 94u8, 226u8, 207u8, 130u8, - 196u8, 100u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Void previously approved spend."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "A spend void is only possible if the payout has not been attempted yet."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] + pub struct VoidSpend { + pub index: void_spend::Index, + } + pub mod void_spend { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl VoidSpend { + const PALLET_NAME: &'static str = "Treasury"; + const CALL_NAME: &'static str = "void_spend"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for VoidSpend { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] - #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] - #[doc = "for assertion using the [`Config::BalanceConverter`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] - #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] - #[doc = "the [`Config::PayoutPeriod`]."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The beneficiary of the spend."] - #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] - #[doc = " the past if the resulting spend has not yet expired according to the"] - #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] - #[doc = " approval."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] - pub fn spend( - &self, - asset_kind: types::spend::AssetKind, - amount: types::spend::Amount, - beneficiary: types::spend::Beneficiary, - valid_from: types::spend::ValidFrom, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Treasury", - "spend", - types::Spend { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - asset_kind, - ), - amount, - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] + #[doc = ""] + #[doc = "### Details"] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The destination account for the transfer."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::SpendApproved`] if successful."] + pub fn spend_local( + &self, + amount: super::spend_local::Amount, + beneficiary: super::spend_local::Beneficiary, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Treasury", + "spend_local", + super::SpendLocal { + amount, beneficiary, - ), - valid_from, - }, - [ - 137u8, 73u8, 150u8, 96u8, 128u8, 170u8, 125u8, 117u8, 152u8, 83u8, - 169u8, 159u8, 126u8, 173u8, 62u8, 236u8, 156u8, 244u8, 70u8, 123u8, - 18u8, 104u8, 120u8, 8u8, 39u8, 51u8, 98u8, 241u8, 132u8, 145u8, 69u8, - 250u8, - ], - ) - } - #[doc = "Claim a spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed"] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] - #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] - #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] - #[doc = "dispatchable before retrying with the current function."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - pub fn payout( - &self, - index: types::payout::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Treasury", - "payout", - types::Payout { index }, - [ - 179u8, 254u8, 82u8, 94u8, 248u8, 26u8, 6u8, 34u8, 93u8, 244u8, 186u8, - 199u8, 163u8, 32u8, 110u8, 220u8, 78u8, 11u8, 168u8, 182u8, 169u8, - 56u8, 53u8, 194u8, 168u8, 218u8, 131u8, 38u8, 46u8, 156u8, 93u8, 234u8, - ], - ) - } - #[doc = "Check the status of the spend and remove it from the storage if processed."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The status check is a prerequisite for retrying a failed payout."] - #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] - #[doc = "function. In such instances, transaction fees are refunded."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] - #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] - pub fn check_status( - &self, - index: types::check_status::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Treasury", - "check_status", - types::CheckStatus { index }, - [ - 164u8, 111u8, 10u8, 11u8, 104u8, 237u8, 112u8, 240u8, 104u8, 130u8, - 179u8, 221u8, 54u8, 18u8, 8u8, 172u8, 148u8, 245u8, 110u8, 174u8, 75u8, - 38u8, 46u8, 143u8, 101u8, 232u8, 65u8, 252u8, 36u8, 152u8, 29u8, 209u8, - ], - ) - } - #[doc = "Void previously approved spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "A spend void is only possible if the payout has not been attempted yet."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] - pub fn void_spend( - &self, - index: types::void_spend::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Treasury", - "void_spend", - types::VoidSpend { index }, - [ - 9u8, 212u8, 174u8, 92u8, 43u8, 102u8, 224u8, 124u8, 247u8, 239u8, - 196u8, 68u8, 132u8, 171u8, 116u8, 206u8, 52u8, 23u8, 92u8, 31u8, 156u8, - 160u8, 25u8, 16u8, 125u8, 60u8, 9u8, 109u8, 145u8, 139u8, 102u8, 224u8, - ], - ) + }, + [ + 137u8, 171u8, 83u8, 247u8, 245u8, 212u8, 152u8, 127u8, 210u8, 71u8, + 254u8, 134u8, 189u8, 26u8, 249u8, 41u8, 214u8, 175u8, 24u8, 64u8, + 33u8, 90u8, 23u8, 134u8, 44u8, 110u8, 63u8, 46u8, 46u8, 146u8, + 222u8, 79u8, + ], + ) + } + #[doc = "Force a previously approved proposal to be removed from the approval queue."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "The original deposit will no longer be returned."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `proposal_id`: The index of a proposal"] + #[doc = ""] + #[doc = "### Complexity"] + #[doc = "- O(A) where `A` is the number of approvals"] + #[doc = ""] + #[doc = "### Errors"] + #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] + #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] + #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] + #[doc = " in the first place."] + pub fn remove_approval( + &self, + proposal_id: super::remove_approval::ProposalId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Treasury", + "remove_approval", + super::RemoveApproval { proposal_id }, + [ + 180u8, 20u8, 39u8, 227u8, 29u8, 228u8, 234u8, 36u8, 155u8, 114u8, + 197u8, 135u8, 185u8, 31u8, 56u8, 247u8, 224u8, 168u8, 254u8, 233u8, + 250u8, 134u8, 186u8, 155u8, 108u8, 84u8, 94u8, 226u8, 207u8, 130u8, + 196u8, 100u8, + ], + ) + } + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] + #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] + #[doc = "for assertion using the [`Config::BalanceConverter`]."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] + #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] + #[doc = "the [`Config::PayoutPeriod`]."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The beneficiary of the spend."] + #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] + #[doc = " the past if the resulting spend has not yet expired according to the"] + #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] + #[doc = " approval."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] + pub fn spend( + &self, + asset_kind: super::spend::AssetKind, + amount: super::spend::Amount, + beneficiary: super::spend::Beneficiary, + valid_from: super::spend::ValidFrom, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Treasury", + "spend", + super::Spend { + asset_kind: ::subxt::alloc::boxed::Box::new(asset_kind), + amount, + beneficiary: ::subxt::alloc::boxed::Box::new(beneficiary), + valid_from, + }, + [ + 137u8, 73u8, 150u8, 96u8, 128u8, 170u8, 125u8, 117u8, 152u8, 83u8, + 169u8, 159u8, 126u8, 173u8, 62u8, 236u8, 156u8, 244u8, 70u8, 123u8, + 18u8, 104u8, 120u8, 8u8, 39u8, 51u8, 98u8, 241u8, 132u8, 145u8, + 69u8, 250u8, + ], + ) + } + #[doc = "Claim a spend."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be signed"] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] + #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] + #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] + #[doc = "dispatchable before retrying with the current function."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::Paid`] if successful."] + pub fn payout( + &self, + index: super::payout::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Treasury", + "payout", + super::Payout { index }, + [ + 179u8, 254u8, 82u8, 94u8, 248u8, 26u8, 6u8, 34u8, 93u8, 244u8, + 186u8, 199u8, 163u8, 32u8, 110u8, 220u8, 78u8, 11u8, 168u8, 182u8, + 169u8, 56u8, 53u8, 194u8, 168u8, 218u8, 131u8, 38u8, 46u8, 156u8, + 93u8, 234u8, + ], + ) + } + #[doc = "Check the status of the spend and remove it from the storage if processed."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be signed."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "The status check is a prerequisite for retrying a failed payout."] + #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] + #[doc = "function. In such instances, transaction fees are refunded."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] + #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] + pub fn check_status( + &self, + index: super::check_status::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Treasury", + "check_status", + super::CheckStatus { index }, + [ + 164u8, 111u8, 10u8, 11u8, 104u8, 237u8, 112u8, 240u8, 104u8, 130u8, + 179u8, 221u8, 54u8, 18u8, 8u8, 172u8, 148u8, 245u8, 110u8, 174u8, + 75u8, 38u8, 46u8, 143u8, 101u8, 232u8, 65u8, 252u8, 36u8, 152u8, + 29u8, 209u8, + ], + ) + } + #[doc = "Void previously approved spend."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "A spend void is only possible if the payout has not been attempted yet."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] + pub fn void_spend( + &self, + index: super::void_spend::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Treasury", + "void_spend", + super::VoidSpend { index }, + [ + 9u8, 212u8, 174u8, 92u8, 43u8, 102u8, 224u8, 124u8, 247u8, 239u8, + 196u8, 68u8, 132u8, 171u8, 116u8, 206u8, 52u8, 23u8, 92u8, 31u8, + 156u8, 160u8, 25u8, 16u8, 125u8, 60u8, 9u8, 109u8, 145u8, 139u8, + 102u8, 224u8, + ], + ) + } } } } @@ -10516,12 +10517,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "We have ended a spend period and will now allocate funds."] pub struct Spending { pub budget_remaining: spending::BudgetRemaining, @@ -10530,17 +10531,22 @@ pub mod api { use super::runtime_types; pub type BudgetRemaining = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Spending { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Spending"; + impl Spending { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "Spending"; + } + impl ::subxt::events::DecodeAsEvent for Spending { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some funds have been allocated."] pub struct Awarded { pub proposal_index: awarded::ProposalIndex, @@ -10551,19 +10557,24 @@ pub mod api { use super::runtime_types; pub type ProposalIndex = ::core::primitive::u32; pub type Award = ::core::primitive::u128; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Account = ::subxt::utils::AccountId32; + } + impl Awarded { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "Awarded"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Awarded { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Awarded"; + impl ::subxt::events::DecodeAsEvent for Awarded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some of our funds have been burnt."] pub struct Burnt { pub burnt_funds: burnt::BurntFunds, @@ -10572,17 +10583,22 @@ pub mod api { use super::runtime_types; pub type BurntFunds = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Burnt { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Burnt"; + impl Burnt { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "Burnt"; + } + impl ::subxt::events::DecodeAsEvent for Burnt { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Spending has finished; this is the amount that rolls over until next spend."] pub struct Rollover { pub rollover_balance: rollover::RolloverBalance, @@ -10591,17 +10607,22 @@ pub mod api { use super::runtime_types; pub type RolloverBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rollover { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Rollover"; + impl Rollover { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "Rollover"; + } + impl ::subxt::events::DecodeAsEvent for Rollover { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some funds have been deposited."] pub struct Deposit { pub value: deposit::Value, @@ -10610,17 +10631,22 @@ pub mod api { use super::runtime_types; pub type Value = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Deposit { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Deposit"; + impl Deposit { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "Deposit"; + } + impl ::subxt::events::DecodeAsEvent for Deposit { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A new spend proposal has been approved."] pub struct SpendApproved { pub proposal_index: spend_approved::ProposalIndex, @@ -10631,19 +10657,24 @@ pub mod api { use super::runtime_types; pub type ProposalIndex = ::core::primitive::u32; pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Beneficiary = ::subxt::utils::AccountId32; + } + impl SpendApproved { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "SpendApproved"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SpendApproved { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "SpendApproved"; + impl ::subxt::events::DecodeAsEvent for SpendApproved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The inactive funds of the pallet have been updated."] pub struct UpdatedInactive { pub reactivated: updated_inactive::Reactivated, @@ -10654,17 +10685,22 @@ pub mod api { pub type Reactivated = ::core::primitive::u128; pub type Deactivated = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UpdatedInactive { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "UpdatedInactive"; + impl UpdatedInactive { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "UpdatedInactive"; + } + impl ::subxt::events::DecodeAsEvent for UpdatedInactive { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A new asset spend proposal has been approved."] pub struct AssetSpendApproved { pub index: asset_spend_approved::Index, @@ -10684,17 +10720,22 @@ pub mod api { pub type ValidFrom = ::core::primitive::u32; pub type ExpireAt = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetSpendApproved { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "AssetSpendApproved"; + impl AssetSpendApproved { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "AssetSpendApproved"; + } + impl ::subxt::events::DecodeAsEvent for AssetSpendApproved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An approved spend was voided."] pub struct AssetSpendVoided { pub index: asset_spend_voided::Index, @@ -10703,17 +10744,22 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetSpendVoided { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "AssetSpendVoided"; + impl AssetSpendVoided { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "AssetSpendVoided"; + } + impl ::subxt::events::DecodeAsEvent for AssetSpendVoided { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A payment happened."] pub struct Paid { pub index: paid::Index, @@ -10724,17 +10770,22 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type PaymentId = ::core::primitive::u64; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Paid { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Paid"; + impl Paid { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "Paid"; + } + impl ::subxt::events::DecodeAsEvent for Paid { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A payment failed and can be retried."] pub struct PaymentFailed { pub index: payment_failed::Index, @@ -10745,17 +10796,22 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type PaymentId = ::core::primitive::u64; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PaymentFailed { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "PaymentFailed"; + impl PaymentFailed { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "PaymentFailed"; + } + impl ::subxt::events::DecodeAsEvent for PaymentFailed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A spend was processed and removed from the storage. It might have been successfully"] #[doc = "paid or it may have expired."] pub struct SpendProcessed { @@ -10765,9 +10821,14 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SpendProcessed { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "SpendProcessed"; + impl SpendProcessed { + const PALLET_NAME: &'static str = "Treasury"; + const EVENT_NAME: &'static str = "SpendProcessed"; + } + impl ::subxt::events::DecodeAsEvent for SpendProcessed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -10781,12 +10842,9 @@ pub mod api { #[doc = " Number of proposals that have been made."] pub fn proposal_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - proposal_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), proposal_count::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Treasury", "ProposalCount", [ @@ -10803,12 +10861,12 @@ pub mod api { #[doc = " Proposals that have been made."] pub fn proposals( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (proposals::Param0,), - proposals::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (proposals::input::Param0,), + proposals::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Treasury", "Proposals", [ @@ -10821,12 +10879,9 @@ pub mod api { #[doc = " The amount which has been reported as inactive to Currency."] pub fn deactivated( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - deactivated::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), deactivated::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Treasury", "Deactivated", [ @@ -10842,12 +10897,9 @@ pub mod api { #[doc = " Proposal indices that have been approved but not yet awarded."] pub fn approvals( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - approvals::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), approvals::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Treasury", "Approvals", [ @@ -10861,12 +10913,9 @@ pub mod api { #[doc = " The count of spends that have been made."] pub fn spend_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - spend_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), spend_count::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Treasury", "SpendCount", [ @@ -10880,12 +10929,12 @@ pub mod api { #[doc = " Spends that have been approved and being processed."] pub fn spends( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (spends::Param0,), - spends::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (spends::input::Param0,), + spends::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Treasury", "Spends", [ @@ -10899,12 +10948,12 @@ pub mod api { #[doc = " The blocknumber for the last triggered spend period."] pub fn last_spend_period( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - last_spend_period::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + last_spend_period::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Treasury", "LastSpendPeriod", [ @@ -10918,71 +10967,71 @@ pub mod api { pub mod proposal_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod proposals { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_treasury::Proposal< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; + pub type Param0 = ::core::primitive::u32; } + pub type Output = runtime_types::pallet_treasury::Proposal< + ::subxt::utils::AccountId32, + ::core::primitive::u128, + >; } pub mod deactivated { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u128; } + pub type Output = ::core::primitive::u128; } pub mod approvals { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; } pub mod spend_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod spends { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_treasury::SpendStatus< - runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset, - ::core::primitive::u128, - runtime_types::xcm::VersionedLocation, - ::core::primitive::u32, - ::core::primitive::u64, - >; + pub type Param0 = ::core::primitive::u32; } + pub type Output = runtime_types::pallet_treasury::SpendStatus< + runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset, + ::core::primitive::u128, + runtime_types::xcm::VersionedLocation, + ::core::primitive::u32, + ::core::primitive::u64, + >; } pub mod last_spend_period { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } } pub mod constants { @@ -10992,10 +11041,8 @@ pub mod api { #[doc = " Period between successive spends."] pub fn spend_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Treasury", "SpendPeriod", [ @@ -11009,10 +11056,10 @@ pub mod api { #[doc = " Percentage of spare funds (if any) that are burnt per spend period."] pub fn burn( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< runtime_types::sp_arithmetic::per_things::Permill, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "Treasury", "Burn", [ @@ -11025,10 +11072,9 @@ pub mod api { #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] pub fn pallet_id( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress + { + ::subxt::constants::StaticAddress::new_static( "Treasury", "PalletId", [ @@ -11046,10 +11092,8 @@ pub mod api { #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] pub fn max_approvals( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Treasury", "MaxApprovals", [ @@ -11063,10 +11107,8 @@ pub mod api { #[doc = " The period during which an approved treasury spend has to be claimed."] pub fn payout_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Treasury", "PayoutPeriod", [ @@ -11080,10 +11122,9 @@ pub mod api { #[doc = " Gets this pallet's derived pot account."] pub fn pot_account( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::subxt::utils::AccountId32> + { + ::subxt::constants::StaticAddress::new_static( "Treasury", "pot_account", [ @@ -11107,489 +11148,483 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] + #[doc = "otherwise it is a vote to keep the status quo."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `poll_index`: The index of the poll to vote for."] + #[doc = "- `vote`: The vote configuration."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] + pub struct Vote { + #[codec(compact)] + pub poll_index: vote::PollIndex, + pub vote: vote::Vote, + } + pub mod vote { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `poll_index`: The index of the poll to vote for."] - #[doc = "- `vote`: The vote configuration."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] - pub struct Vote { - #[codec(compact)] - pub poll_index: vote::PollIndex, - pub vote: vote::Vote, - } - pub mod vote { - use super::runtime_types; - pub type PollIndex = ::core::primitive::u32; - pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "vote"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] - #[doc = "particular class of polls."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed through"] - #[doc = " `remove_vote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] - #[doc = " to this function are required."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] - #[doc = ""] - #[doc = "Emits `Delegated`."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub struct Delegate { - pub class: delegate::Class, - pub to: delegate::To, - pub conviction: delegate::Conviction, - pub balance: delegate::Balance, - } - pub mod delegate { - use super::runtime_types; - pub type Class = ::core::primitive::u16; - pub type To = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Conviction = - runtime_types::pallet_conviction_voting::conviction::Conviction; - pub type Balance = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Delegate { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "delegate"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] - #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued has passed."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] - #[doc = ""] - #[doc = "- `class`: The class of polls to remove the delegation from."] - #[doc = ""] - #[doc = "Emits `Undelegated`."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub struct Undelegate { - pub class: undelegate::Class, - } - pub mod undelegate { - use super::runtime_types; - pub type Class = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Undelegate { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "undelegate"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] - #[doc = "class."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `class`: The class of polls to unlock."] - #[doc = "- `target`: The account to remove the lock on."] - #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - pub struct Unlock { - pub class: unlock::Class, - pub target: unlock::Target, - } - pub mod unlock { - use super::runtime_types; - pub type Class = ::core::primitive::u16; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Unlock { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "unlock"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If:"] - #[doc = "- the poll was cancelled, or"] - #[doc = "- the poll is ongoing, or"] - #[doc = "- the poll has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the poll has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for poll `index`."] - #[doc = ""] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] - #[doc = " which have finished or are cancelled, this must be `Some`."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub struct RemoveVote { - pub class: remove_vote::Class, - pub index: remove_vote::Index, - } - pub mod remove_vote { - use super::runtime_types; - pub type Class = ::core::option::Option<::core::primitive::u16>; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveVote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "remove_vote"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the poll was cancelled, because the voter lost the poll or"] - #[doc = "because the conviction period is over."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] - #[doc = " `index`."] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: The class of the poll."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub struct RemoveOtherVote { - pub target: remove_other_vote::Target, - pub class: remove_other_vote::Class, - pub index: remove_other_vote::Index, - } - pub mod remove_other_vote { - use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Class = ::core::primitive::u16; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveOtherVote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "remove_other_vote"; + pub type PollIndex = ::core::primitive::u32; + pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< + ::core::primitive::u128, + >; + } + impl Vote { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const CALL_NAME: &'static str = "vote"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Vote { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `poll_index`: The index of the poll to vote for."] - #[doc = "- `vote`: The vote configuration."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] - pub fn vote( - &self, - poll_index: types::vote::PollIndex, - vote: types::vote::Vote, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "vote", - types::Vote { poll_index, vote }, - [ - 57u8, 170u8, 177u8, 168u8, 158u8, 43u8, 87u8, 242u8, 176u8, 85u8, - 230u8, 64u8, 103u8, 239u8, 190u8, 6u8, 228u8, 165u8, 248u8, 77u8, - 231u8, 221u8, 186u8, 107u8, 249u8, 201u8, 226u8, 52u8, 129u8, 90u8, - 142u8, 159u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] + #[doc = "particular class of polls."] + #[doc = ""] + #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] + #[doc = "time appropriate for the conviction's lock period."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] + #[doc = " - be delegating already; or"] + #[doc = " - have no voting activity (if there is, then it will need to be removed through"] + #[doc = " `remove_vote`)."] + #[doc = ""] + #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] + #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] + #[doc = " to this function are required."] + #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] + #[doc = " account is undelegated, the funds will be locked for the corresponding period."] + #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] + #[doc = " be more than the account's current balance."] + #[doc = ""] + #[doc = "Emits `Delegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub struct Delegate { + pub class: delegate::Class, + pub to: delegate::To, + pub conviction: delegate::Conviction, + pub balance: delegate::Balance, + } + pub mod delegate { + use super::runtime_types; + pub type Class = ::core::primitive::u16; + pub type To = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Conviction = + runtime_types::pallet_conviction_voting::conviction::Conviction; + pub type Balance = ::core::primitive::u128; + } + impl Delegate { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const CALL_NAME: &'static str = "delegate"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Delegate { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] - #[doc = "particular class of polls."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed through"] - #[doc = " `remove_vote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] - #[doc = " to this function are required."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] - #[doc = ""] - #[doc = "Emits `Delegated`."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub fn delegate( - &self, - class: types::delegate::Class, - to: types::delegate::To, - conviction: types::delegate::Conviction, - balance: types::delegate::Balance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "delegate", - types::Delegate { - class, - to, - conviction, - balance, - }, - [ - 223u8, 143u8, 33u8, 94u8, 32u8, 156u8, 43u8, 40u8, 142u8, 134u8, 209u8, - 134u8, 255u8, 179u8, 97u8, 46u8, 8u8, 140u8, 5u8, 29u8, 76u8, 22u8, - 36u8, 7u8, 108u8, 190u8, 220u8, 151u8, 10u8, 47u8, 89u8, 55u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] + #[doc = ""] + #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] + #[doc = "of the conviction with which the delegation was issued has passed."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] + #[doc = "currently delegating."] + #[doc = ""] + #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = ""] + #[doc = "Emits `Undelegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub struct Undelegate { + pub class: undelegate::Class, + } + pub mod undelegate { + use super::runtime_types; + pub type Class = ::core::primitive::u16; + } + impl Undelegate { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const CALL_NAME: &'static str = "undelegate"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Undelegate { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] - #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued has passed."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] - #[doc = ""] - #[doc = "- `class`: The class of polls to remove the delegation from."] - #[doc = ""] - #[doc = "Emits `Undelegated`."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub fn undelegate( - &self, - class: types::undelegate::Class, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "undelegate", - types::Undelegate { class }, - [ - 140u8, 232u8, 6u8, 53u8, 228u8, 8u8, 131u8, 144u8, 65u8, 66u8, 245u8, - 247u8, 147u8, 135u8, 198u8, 57u8, 82u8, 212u8, 89u8, 46u8, 236u8, - 168u8, 200u8, 220u8, 93u8, 168u8, 101u8, 29u8, 110u8, 76u8, 67u8, - 181u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] + #[doc = "class."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `class`: The class of polls to unlock."] + #[doc = "- `target`: The account to remove the lock on."] + #[doc = ""] + #[doc = "Weight: `O(R)` with R number of vote of target."] + pub struct Unlock { + pub class: unlock::Class, + pub target: unlock::Target, + } + pub mod unlock { + use super::runtime_types; + pub type Class = ::core::primitive::u16; + pub type Target = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl Unlock { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const CALL_NAME: &'static str = "unlock"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Unlock { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] - #[doc = "class."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `class`: The class of polls to unlock."] - #[doc = "- `target`: The account to remove the lock on."] - #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - pub fn unlock( - &self, - class: types::unlock::Class, - target: types::unlock::Target, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "unlock", - types::Unlock { class, target }, - [ - 79u8, 5u8, 252u8, 237u8, 109u8, 238u8, 157u8, 237u8, 125u8, 171u8, - 65u8, 160u8, 102u8, 192u8, 5u8, 141u8, 179u8, 249u8, 253u8, 213u8, - 105u8, 251u8, 241u8, 145u8, 186u8, 177u8, 244u8, 139u8, 71u8, 140u8, - 173u8, 108u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove a vote for a poll."] + #[doc = ""] + #[doc = "If:"] + #[doc = "- the poll was cancelled, or"] + #[doc = "- the poll is ongoing, or"] + #[doc = "- the poll has ended such that"] + #[doc = " - the vote of the account was in opposition to the result; or"] + #[doc = " - there was no conviction to the account's vote; or"] + #[doc = " - the account made a split vote"] + #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] + #[doc = "funds being available."] + #[doc = ""] + #[doc = "If, however, the poll has ended and:"] + #[doc = "- it finished corresponding to the vote of the account, and"] + #[doc = "- the account made a standard vote with conviction, and"] + #[doc = "- the lock period of the conviction is not over"] + #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] + #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] + #[doc = "of both the amount locked and the time is it locked for)."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] + #[doc = "registered for poll `index`."] + #[doc = ""] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] + #[doc = " which have finished or are cancelled, this must be `Some`."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub struct RemoveVote { + pub class: remove_vote::Class, + pub index: remove_vote::Index, + } + pub mod remove_vote { + use super::runtime_types; + pub type Class = ::core::option::Option<::core::primitive::u16>; + pub type Index = ::core::primitive::u32; + } + impl RemoveVote { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const CALL_NAME: &'static str = "remove_vote"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveVote { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If:"] - #[doc = "- the poll was cancelled, or"] - #[doc = "- the poll is ongoing, or"] - #[doc = "- the poll has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the poll has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for poll `index`."] - #[doc = ""] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] - #[doc = " which have finished or are cancelled, this must be `Some`."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub fn remove_vote( - &self, - class: types::remove_vote::Class, - index: types::remove_vote::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "remove_vote", - types::RemoveVote { class, index }, - [ - 255u8, 108u8, 211u8, 146u8, 168u8, 231u8, 207u8, 44u8, 76u8, 24u8, - 235u8, 60u8, 23u8, 79u8, 192u8, 192u8, 46u8, 40u8, 134u8, 27u8, 125u8, - 114u8, 125u8, 247u8, 85u8, 102u8, 76u8, 159u8, 34u8, 167u8, 152u8, - 148u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove a vote for a poll."] + #[doc = ""] + #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] + #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] + #[doc = "either because the poll was cancelled, because the voter lost the poll or"] + #[doc = "because the conviction period is over."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] + #[doc = " `index`."] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: The class of the poll."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub struct RemoveOtherVote { + pub target: remove_other_vote::Target, + pub class: remove_other_vote::Class, + pub index: remove_other_vote::Index, + } + pub mod remove_other_vote { + use super::runtime_types; + pub type Target = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Class = ::core::primitive::u16; + pub type Index = ::core::primitive::u32; + } + impl RemoveOtherVote { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const CALL_NAME: &'static str = "remove_other_vote"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveOtherVote { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the poll was cancelled, because the voter lost the poll or"] - #[doc = "because the conviction period is over."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] - #[doc = " `index`."] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: The class of the poll."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub fn remove_other_vote( - &self, - target: types::remove_other_vote::Target, - class: types::remove_other_vote::Class, - index: types::remove_other_vote::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "remove_other_vote", - types::RemoveOtherVote { - target, - class, - index, - }, - [ - 165u8, 26u8, 166u8, 37u8, 10u8, 174u8, 243u8, 10u8, 73u8, 93u8, 213u8, - 69u8, 200u8, 16u8, 48u8, 146u8, 160u8, 92u8, 28u8, 26u8, 158u8, 55u8, - 6u8, 251u8, 36u8, 132u8, 46u8, 195u8, 107u8, 34u8, 0u8, 100u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] + #[doc = "otherwise it is a vote to keep the status quo."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `poll_index`: The index of the poll to vote for."] + #[doc = "- `vote`: The vote configuration."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] + pub fn vote( + &self, + poll_index: super::vote::PollIndex, + vote: super::vote::Vote, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "ConvictionVoting", + "vote", + super::Vote { poll_index, vote }, + [ + 57u8, 170u8, 177u8, 168u8, 158u8, 43u8, 87u8, 242u8, 176u8, 85u8, + 230u8, 64u8, 103u8, 239u8, 190u8, 6u8, 228u8, 165u8, 248u8, 77u8, + 231u8, 221u8, 186u8, 107u8, 249u8, 201u8, 226u8, 52u8, 129u8, 90u8, + 142u8, 159u8, + ], + ) + } + #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] + #[doc = "particular class of polls."] + #[doc = ""] + #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] + #[doc = "time appropriate for the conviction's lock period."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] + #[doc = " - be delegating already; or"] + #[doc = " - have no voting activity (if there is, then it will need to be removed through"] + #[doc = " `remove_vote`)."] + #[doc = ""] + #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] + #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] + #[doc = " to this function are required."] + #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] + #[doc = " account is undelegated, the funds will be locked for the corresponding period."] + #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] + #[doc = " be more than the account's current balance."] + #[doc = ""] + #[doc = "Emits `Delegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub fn delegate( + &self, + class: super::delegate::Class, + to: super::delegate::To, + conviction: super::delegate::Conviction, + balance: super::delegate::Balance, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "ConvictionVoting", + "delegate", + super::Delegate { + class, + to, + conviction, + balance, + }, + [ + 223u8, 143u8, 33u8, 94u8, 32u8, 156u8, 43u8, 40u8, 142u8, 134u8, + 209u8, 134u8, 255u8, 179u8, 97u8, 46u8, 8u8, 140u8, 5u8, 29u8, + 76u8, 22u8, 36u8, 7u8, 108u8, 190u8, 220u8, 151u8, 10u8, 47u8, + 89u8, 55u8, + ], + ) + } + #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] + #[doc = ""] + #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] + #[doc = "of the conviction with which the delegation was issued has passed."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] + #[doc = "currently delegating."] + #[doc = ""] + #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = ""] + #[doc = "Emits `Undelegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub fn undelegate( + &self, + class: super::undelegate::Class, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ConvictionVoting", + "undelegate", + super::Undelegate { class }, + [ + 140u8, 232u8, 6u8, 53u8, 228u8, 8u8, 131u8, 144u8, 65u8, 66u8, + 245u8, 247u8, 147u8, 135u8, 198u8, 57u8, 82u8, 212u8, 89u8, 46u8, + 236u8, 168u8, 200u8, 220u8, 93u8, 168u8, 101u8, 29u8, 110u8, 76u8, + 67u8, 181u8, + ], + ) + } + #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] + #[doc = "class."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `class`: The class of polls to unlock."] + #[doc = "- `target`: The account to remove the lock on."] + #[doc = ""] + #[doc = "Weight: `O(R)` with R number of vote of target."] + pub fn unlock( + &self, + class: super::unlock::Class, + target: super::unlock::Target, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "ConvictionVoting", + "unlock", + super::Unlock { class, target }, + [ + 79u8, 5u8, 252u8, 237u8, 109u8, 238u8, 157u8, 237u8, 125u8, 171u8, + 65u8, 160u8, 102u8, 192u8, 5u8, 141u8, 179u8, 249u8, 253u8, 213u8, + 105u8, 251u8, 241u8, 145u8, 186u8, 177u8, 244u8, 139u8, 71u8, + 140u8, 173u8, 108u8, + ], + ) + } + #[doc = "Remove a vote for a poll."] + #[doc = ""] + #[doc = "If:"] + #[doc = "- the poll was cancelled, or"] + #[doc = "- the poll is ongoing, or"] + #[doc = "- the poll has ended such that"] + #[doc = " - the vote of the account was in opposition to the result; or"] + #[doc = " - there was no conviction to the account's vote; or"] + #[doc = " - the account made a split vote"] + #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] + #[doc = "funds being available."] + #[doc = ""] + #[doc = "If, however, the poll has ended and:"] + #[doc = "- it finished corresponding to the vote of the account, and"] + #[doc = "- the account made a standard vote with conviction, and"] + #[doc = "- the lock period of the conviction is not over"] + #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] + #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] + #[doc = "of both the amount locked and the time is it locked for)."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] + #[doc = "registered for poll `index`."] + #[doc = ""] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] + #[doc = " which have finished or are cancelled, this must be `Some`."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub fn remove_vote( + &self, + class: super::remove_vote::Class, + index: super::remove_vote::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ConvictionVoting", + "remove_vote", + super::RemoveVote { class, index }, + [ + 255u8, 108u8, 211u8, 146u8, 168u8, 231u8, 207u8, 44u8, 76u8, 24u8, + 235u8, 60u8, 23u8, 79u8, 192u8, 192u8, 46u8, 40u8, 134u8, 27u8, + 125u8, 114u8, 125u8, 247u8, 85u8, 102u8, 76u8, 159u8, 34u8, 167u8, + 152u8, 148u8, + ], + ) + } + #[doc = "Remove a vote for a poll."] + #[doc = ""] + #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] + #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] + #[doc = "either because the poll was cancelled, because the voter lost the poll or"] + #[doc = "because the conviction period is over."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] + #[doc = " `index`."] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: The class of the poll."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub fn remove_other_vote( + &self, + target: super::remove_other_vote::Target, + class: super::remove_other_vote::Class, + index: super::remove_other_vote::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ConvictionVoting", + "remove_other_vote", + super::RemoveOtherVote { + target, + class, + index, + }, + [ + 165u8, 26u8, 166u8, 37u8, 10u8, 174u8, 243u8, 10u8, 73u8, 93u8, + 213u8, 69u8, 200u8, 16u8, 48u8, 146u8, 160u8, 92u8, 28u8, 26u8, + 158u8, 55u8, 6u8, 251u8, 36u8, 132u8, 46u8, 195u8, 107u8, 34u8, + 0u8, 100u8, + ], + ) + } } } } @@ -11598,12 +11633,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An account has delegated their vote to another account. \\[who, target\\]"] pub struct Delegated( pub delegated::Field0, @@ -11612,39 +11647,49 @@ pub mod api { ); pub mod delegated { use super::runtime_types; - pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Field1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Field0 = ::subxt::utils::AccountId32; + pub type Field1 = ::subxt::utils::AccountId32; pub type Field2 = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Delegated { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Delegated"; + impl Delegated { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const EVENT_NAME: &'static str = "Delegated"; + } + impl ::subxt::events::DecodeAsEvent for Delegated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An \\[account\\] has cancelled a previous delegation operation."] pub struct Undelegated(pub undelegated::Field0, pub undelegated::Field1); pub mod undelegated { use super::runtime_types; - pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Field0 = ::subxt::utils::AccountId32; pub type Field1 = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Undelegated { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Undelegated"; + impl Undelegated { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const EVENT_NAME: &'static str = "Undelegated"; + } + impl ::subxt::events::DecodeAsEvent for Undelegated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An account has voted"] pub struct Voted { pub who: voted::Who, @@ -11653,23 +11698,28 @@ pub mod api { } pub mod voted { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< ::core::primitive::u128, >; pub type PollIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Voted"; + impl Voted { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const EVENT_NAME: &'static str = "Voted"; + } + impl ::subxt::events::DecodeAsEvent for Voted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A vote has been removed"] pub struct VoteRemoved { pub who: vote_removed::Who, @@ -11678,23 +11728,28 @@ pub mod api { } pub mod vote_removed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< ::core::primitive::u128, >; pub type PollIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VoteRemoved { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "VoteRemoved"; + impl VoteRemoved { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const EVENT_NAME: &'static str = "VoteRemoved"; + } + impl ::subxt::events::DecodeAsEvent for VoteRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The lockup period of a conviction vote expired, and the funds have been unlocked."] pub struct VoteUnlocked { pub who: vote_unlocked::Who, @@ -11702,12 +11757,17 @@ pub mod api { } pub mod vote_unlocked { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Class = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VoteUnlocked { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "VoteUnlocked"; + impl VoteUnlocked { + const PALLET_NAME: &'static str = "ConvictionVoting"; + const EVENT_NAME: &'static str = "VoteUnlocked"; + } + impl ::subxt::events::DecodeAsEvent for VoteUnlocked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -11719,12 +11779,12 @@ pub mod api { #[doc = " number of votes that we have recorded."] pub fn voting_for( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (voting_for::Param0, voting_for::Param1), - voting_for::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (voting_for::input::Param0, voting_for::input::Param1), + voting_for::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ConvictionVoting", "VotingFor", [ @@ -11739,12 +11799,12 @@ pub mod api { #[doc = " this list."] pub fn class_locks_for( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (class_locks_for::Param0,), - class_locks_for::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (class_locks_for::input::Param0,), + class_locks_for::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ConvictionVoting", "ClassLocksFor", [ @@ -11759,28 +11819,29 @@ pub mod api { pub mod voting_for { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::core::primitive::u16; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_conviction_voting::vote::Voting< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - ::core::primitive::u32, - >; + pub type Param0 = ::subxt::utils::AccountId32; + pub type Param1 = ::core::primitive::u16; } + pub type Output = runtime_types::pallet_conviction_voting::vote::Voting< + ::core::primitive::u128, + ::subxt::utils::AccountId32, + ::core::primitive::u32, + ::core::primitive::u32, + >; } pub mod class_locks_for { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - (::core::primitive::u16, ::core::primitive::u128), - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u16, + ::core::primitive::u128, + )>; } } pub mod constants { @@ -11793,10 +11854,8 @@ pub mod api { #[doc = " weight estimation: see `delegate` for instance."] pub fn max_votes( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "ConvictionVoting", "MaxVotes", [ @@ -11813,10 +11872,8 @@ pub mod api { #[doc = " those successful voters are locked into the consequences that their votes entail."] pub fn vote_locking_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "ConvictionVoting", "VoteLockingPeriod", [ @@ -11840,510 +11897,511 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Propose a referendum on a privileged action."] + #[doc = ""] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = ""] + #[doc = "Emits `Submitted`."] + pub struct Submit { + pub proposal_origin: ::subxt::alloc::boxed::Box, + pub proposal: submit::Proposal, + pub enactment_moment: submit::EnactmentMoment, + } + pub mod submit { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] - #[doc = ""] - #[doc = "Emits `Submitted`."] - pub struct Submit { - pub proposal_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub proposal: submit::Proposal, - pub enactment_moment: submit::EnactmentMoment, - } - pub mod submit { - use super::runtime_types; - pub type ProposalOrigin = runtime_types::rococo_runtime::OriginCaller; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::rococo_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, + pub type ProposalOrigin = runtime_types::rococo_runtime::OriginCaller; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::rococo_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, + >; + pub type EnactmentMoment = + runtime_types::frame_support::traits::schedule::DispatchTime< + ::core::primitive::u32, >; - pub type EnactmentMoment = - runtime_types::frame_support::traits::schedule::DispatchTime< - ::core::primitive::u32, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "submit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Post the Decision Deposit for a referendum."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] - #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub struct PlaceDecisionDeposit { - pub index: place_decision_deposit::Index, - } - pub mod place_decision_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; + } + impl Submit { + const PALLET_NAME: &'static str = "Referenda"; + const CALL_NAME: &'static str = "submit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Submit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "place_decision_deposit"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Post the Decision Deposit for a referendum."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] + #[doc = ""] + #[doc = "Emits `DecisionDepositPlaced`."] + pub struct PlaceDecisionDeposit { + pub index: place_decision_deposit::Index, + } + pub mod place_decision_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl PlaceDecisionDeposit { + const PALLET_NAME: &'static str = "Referenda"; + const CALL_NAME: &'static str = "place_decision_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PlaceDecisionDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub struct RefundDecisionDeposit { - pub index: refund_decision_deposit::Index, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `DecisionDepositRefunded`."] + pub struct RefundDecisionDeposit { + pub index: refund_decision_deposit::Index, + } + pub mod refund_decision_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl RefundDecisionDeposit { + const PALLET_NAME: &'static str = "Referenda"; + const CALL_NAME: &'static str = "refund_decision_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RefundDecisionDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod refund_decision_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel an ongoing referendum."] + #[doc = ""] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Cancelled`."] + pub struct Cancel { + pub index: cancel::Index, + } + pub mod cancel { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl Cancel { + const PALLET_NAME: &'static str = "Referenda"; + const CALL_NAME: &'static str = "cancel"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Cancel { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "refund_decision_deposit"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = ""] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub struct Kill { + pub index: kill::Index, + } + pub mod kill { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl Kill { + const PALLET_NAME: &'static str = "Referenda"; + const CALL_NAME: &'static str = "kill"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Kill { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an ongoing referendum."] - #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub struct Cancel { - pub index: cancel::Index, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub struct NudgeReferendum { + pub index: nudge_referendum::Index, + } + pub mod nudge_referendum { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl NudgeReferendum { + const PALLET_NAME: &'static str = "Referenda"; + const CALL_NAME: &'static str = "nudge_referendum"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for NudgeReferendum { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod cancel { - use super::runtime_types; - pub type Index = ::core::primitive::u32; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] + #[doc = ""] + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub struct OneFewerDeciding { + pub track: one_fewer_deciding::Track, + } + pub mod one_fewer_deciding { + use super::runtime_types; + pub type Track = ::core::primitive::u16; + } + impl OneFewerDeciding { + const PALLET_NAME: &'static str = "Referenda"; + const CALL_NAME: &'static str = "one_fewer_deciding"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for OneFewerDeciding { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "cancel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an ongoing referendum and slash the deposits."] - #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub struct Kill { - pub index: kill::Index, - } - pub mod kill { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "kill"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Advance a referendum onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub struct NudgeReferendum { - pub index: nudge_referendum::Index, - } - pub mod nudge_referendum { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "nudge_referendum"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Advance a track onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] - #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub struct OneFewerDeciding { - pub track: one_fewer_deciding::Track, - } - pub mod one_fewer_deciding { - use super::runtime_types; - pub type Track = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "one_fewer_deciding"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub struct RefundSubmissionDeposit { - pub index: refund_submission_deposit::Index, - } - pub mod refund_submission_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "refund_submission_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set or clear metadata of a referendum."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub struct SetMetadata { - pub index: set_metadata::Index, - pub maybe_hash: set_metadata::MaybeHash, - } - pub mod set_metadata { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type MaybeHash = - ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "set_metadata"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `SubmissionDepositRefunded`."] + pub struct RefundSubmissionDeposit { + pub index: refund_submission_deposit::Index, + } + pub mod refund_submission_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl RefundSubmissionDeposit { + const PALLET_NAME: &'static str = "Referenda"; + const CALL_NAME: &'static str = "refund_submission_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RefundSubmissionDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Propose a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] - #[doc = ""] - #[doc = "Emits `Submitted`."] - pub fn submit( - &self, - proposal_origin: types::submit::ProposalOrigin, - proposal: types::submit::Proposal, - enactment_moment: types::submit::EnactmentMoment, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "submit", - types::Submit { - proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - proposal_origin, - ), - proposal, - enactment_moment, - }, - [ - 86u8, 84u8, 96u8, 114u8, 247u8, 25u8, 6u8, 101u8, 96u8, 162u8, 250u8, - 43u8, 112u8, 243u8, 41u8, 89u8, 137u8, 193u8, 155u8, 47u8, 105u8, - 195u8, 219u8, 139u8, 202u8, 232u8, 181u8, 48u8, 72u8, 230u8, 24u8, - 154u8, - ], - ) - } - #[doc = "Post the Decision Deposit for a referendum."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] - #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub fn place_decision_deposit( - &self, - index: types::place_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "place_decision_deposit", - types::PlaceDecisionDeposit { index }, - [ - 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, - 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, - 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, - ], - ) - } - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub fn refund_decision_deposit( - &self, - index: types::refund_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundDecisionDeposit, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "refund_decision_deposit", - types::RefundDecisionDeposit { index }, - [ - 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, - 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, - 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, - ], - ) - } - #[doc = "Cancel an ongoing referendum."] - #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub fn cancel( - &self, - index: types::cancel::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "cancel", - types::Cancel { index }, - [ - 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, - 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, - 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, - 122u8, - ], - ) - } - #[doc = "Cancel an ongoing referendum and slash the deposits."] - #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub fn kill( - &self, - index: types::kill::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "kill", - types::Kill { index }, - [ - 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, - 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, - 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, - 48u8, - ], - ) - } - #[doc = "Advance a referendum onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub fn nudge_referendum( - &self, - index: types::nudge_referendum::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "nudge_referendum", - types::NudgeReferendum { index }, - [ - 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, - 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, - 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, - 213u8, - ], - ) - } - #[doc = "Advance a track onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] - #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub fn one_fewer_deciding( - &self, - track: types::one_fewer_deciding::Track, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "one_fewer_deciding", - types::OneFewerDeciding { track }, - [ - 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, - 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, - 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, - 131u8, 167u8, - ], - ) - } - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub fn refund_submission_deposit( - &self, - index: types::refund_submission_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundSubmissionDeposit, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "refund_submission_deposit", - types::RefundSubmissionDeposit { index }, - [ - 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, - 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, - 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set or clear metadata of a referendum."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub struct SetMetadata { + pub index: set_metadata::Index, + pub maybe_hash: set_metadata::MaybeHash, + } + pub mod set_metadata { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type MaybeHash = ::core::option::Option<::subxt::utils::H256>; + } + impl SetMetadata { + const PALLET_NAME: &'static str = "Referenda"; + const CALL_NAME: &'static str = "set_metadata"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMetadata { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set or clear metadata of a referendum."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub fn set_metadata( - &self, - index: types::set_metadata::Index, - maybe_hash: types::set_metadata::MaybeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "set_metadata", - types::SetMetadata { index, maybe_hash }, - [ - 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, - 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, - 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, - 88u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Propose a referendum on a privileged action."] + #[doc = ""] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = ""] + #[doc = "Emits `Submitted`."] + pub fn submit( + &self, + proposal_origin: super::submit::ProposalOrigin, + proposal: super::submit::Proposal, + enactment_moment: super::submit::EnactmentMoment, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Referenda", + "submit", + super::Submit { + proposal_origin: ::subxt::alloc::boxed::Box::new(proposal_origin), + proposal, + enactment_moment, + }, + [ + 86u8, 84u8, 96u8, 114u8, 247u8, 25u8, 6u8, 101u8, 96u8, 162u8, + 250u8, 43u8, 112u8, 243u8, 41u8, 89u8, 137u8, 193u8, 155u8, 47u8, + 105u8, 195u8, 219u8, 139u8, 202u8, 232u8, 181u8, 48u8, 72u8, 230u8, + 24u8, 154u8, + ], + ) + } + #[doc = "Post the Decision Deposit for a referendum."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] + #[doc = ""] + #[doc = "Emits `DecisionDepositPlaced`."] + pub fn place_decision_deposit( + &self, + index: super::place_decision_deposit::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Referenda", + "place_decision_deposit", + super::PlaceDecisionDeposit { index }, + [ + 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, + 86u8, 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, + 40u8, 84u8, 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, + 247u8, 220u8, + ], + ) + } + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `DecisionDepositRefunded`."] + pub fn refund_decision_deposit( + &self, + index: super::refund_decision_deposit::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Referenda", + "refund_decision_deposit", + super::RefundDecisionDeposit { index }, + [ + 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, + 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, + 115u8, 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, + 77u8, 164u8, + ], + ) + } + #[doc = "Cancel an ongoing referendum."] + #[doc = ""] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Cancelled`."] + pub fn cancel( + &self, + index: super::cancel::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Referenda", + "cancel", + super::Cancel { index }, + [ + 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, + 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, + 60u8, 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, + 237u8, 122u8, + ], + ) + } + #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = ""] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub fn kill( + &self, + index: super::kill::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Referenda", + "kill", + super::Kill { index }, + [ + 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, + 126u8, 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, + 223u8, 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, + 143u8, 48u8, + ], + ) + } + #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub fn nudge_referendum( + &self, + index: super::nudge_referendum::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Referenda", + "nudge_referendum", + super::NudgeReferendum { index }, + [ + 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, + 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, + 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, + 54u8, 213u8, + ], + ) + } + #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] + #[doc = ""] + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub fn one_fewer_deciding( + &self, + track: super::one_fewer_deciding::Track, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Referenda", + "one_fewer_deciding", + super::OneFewerDeciding { track }, + [ + 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, + 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, + 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, + 131u8, 167u8, + ], + ) + } + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `SubmissionDepositRefunded`."] + pub fn refund_submission_deposit( + &self, + index: super::refund_submission_deposit::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Referenda", + "refund_submission_deposit", + super::RefundSubmissionDeposit { index }, + [ + 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, + 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, + 98u8, 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, + 122u8, + ], + ) + } + #[doc = "Set or clear metadata of a referendum."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub fn set_metadata( + &self, + index: super::set_metadata::Index, + maybe_hash: super::set_metadata::MaybeHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Referenda", + "set_metadata", + super::SetMetadata { index, maybe_hash }, + [ + 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, + 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, + 1u8, 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, + 112u8, 88u8, + ], + ) + } } } } @@ -12352,12 +12410,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has been submitted."] pub struct Submitted { pub index: submitted::Index, @@ -12373,17 +12431,22 @@ pub mod api { runtime_types::sp_runtime::traits::BlakeTwo256, >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Submitted"; + impl Submitted { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "Submitted"; + } + impl ::subxt::events::DecodeAsEvent for Submitted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The decision deposit has been placed."] pub struct DecisionDepositPlaced { pub index: decision_deposit_placed::Index, @@ -12393,20 +12456,25 @@ pub mod api { pub mod decision_deposit_placed { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionDepositPlaced"; + impl DecisionDepositPlaced { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "DecisionDepositPlaced"; + } + impl ::subxt::events::DecodeAsEvent for DecisionDepositPlaced { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The decision deposit has been refunded."] pub struct DecisionDepositRefunded { pub index: decision_deposit_refunded::Index, @@ -12416,20 +12484,25 @@ pub mod api { pub mod decision_deposit_refunded { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionDepositRefunded"; + impl DecisionDepositRefunded { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "DecisionDepositRefunded"; + } + impl ::subxt::events::DecodeAsEvent for DecisionDepositRefunded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A deposit has been slashed."] pub struct DepositSlashed { pub who: deposit_slashed::Who, @@ -12437,20 +12510,25 @@ pub mod api { } pub mod deposit_slashed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DepositSlashed"; + impl DepositSlashed { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "DepositSlashed"; + } + impl ::subxt::events::DecodeAsEvent for DepositSlashed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has moved into the deciding phase."] pub struct DecisionStarted { pub index: decision_started::Index, @@ -12469,17 +12547,22 @@ pub mod api { pub type Tally = runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionStarted"; + impl DecisionStarted { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "DecisionStarted"; + } + impl ::subxt::events::DecodeAsEvent for DecisionStarted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ConfirmStarted { pub index: confirm_started::Index, } @@ -12487,17 +12570,22 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "ConfirmStarted"; + impl ConfirmStarted { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "ConfirmStarted"; + } + impl ::subxt::events::DecodeAsEvent for ConfirmStarted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ConfirmAborted { pub index: confirm_aborted::Index, } @@ -12505,17 +12593,22 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "ConfirmAborted"; + impl ConfirmAborted { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "ConfirmAborted"; + } + impl ::subxt::events::DecodeAsEvent for ConfirmAborted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has ended its confirmation phase and is ready for approval."] pub struct Confirmed { pub index: confirmed::Index, @@ -12527,17 +12620,22 @@ pub mod api { pub type Tally = runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Confirmed"; + impl Confirmed { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "Confirmed"; + } + impl ::subxt::events::DecodeAsEvent for Confirmed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has been approved and its proposal has been scheduled."] pub struct Approved { pub index: approved::Index, @@ -12546,17 +12644,22 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Approved"; + impl Approved { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "Approved"; + } + impl ::subxt::events::DecodeAsEvent for Approved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A proposal has been rejected by referendum."] pub struct Rejected { pub index: rejected::Index, @@ -12568,17 +12671,22 @@ pub mod api { pub type Tally = runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Rejected"; + impl Rejected { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "Rejected"; + } + impl ::subxt::events::DecodeAsEvent for Rejected { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has been timed out without being decided."] pub struct TimedOut { pub index: timed_out::Index, @@ -12590,17 +12698,22 @@ pub mod api { pub type Tally = runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "TimedOut"; + impl TimedOut { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "TimedOut"; + } + impl ::subxt::events::DecodeAsEvent for TimedOut { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has been cancelled."] pub struct Cancelled { pub index: cancelled::Index, @@ -12612,17 +12725,22 @@ pub mod api { pub type Tally = runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Cancelled"; + impl Cancelled { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "Cancelled"; + } + impl ::subxt::events::DecodeAsEvent for Cancelled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has been killed."] pub struct Killed { pub index: killed::Index, @@ -12634,17 +12752,22 @@ pub mod api { pub type Tally = runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Killed"; + impl Killed { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "Killed"; + } + impl ::subxt::events::DecodeAsEvent for Killed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The submission deposit has been refunded."] pub struct SubmissionDepositRefunded { pub index: submission_deposit_refunded::Index, @@ -12654,20 +12777,25 @@ pub mod api { pub mod submission_deposit_refunded { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "SubmissionDepositRefunded"; + impl SubmissionDepositRefunded { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "SubmissionDepositRefunded"; + } + impl ::subxt::events::DecodeAsEvent for SubmissionDepositRefunded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Metadata for a referendum has been set."] pub struct MetadataSet { pub index: metadata_set::Index, @@ -12676,19 +12804,24 @@ pub mod api { pub mod metadata_set { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Hash = ::subxt::utils::H256; + } + impl MetadataSet { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "MetadataSet"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "MetadataSet"; + impl ::subxt::events::DecodeAsEvent for MetadataSet { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Metadata for a referendum has been cleared."] pub struct MetadataCleared { pub index: metadata_cleared::Index, @@ -12697,11 +12830,16 @@ pub mod api { pub mod metadata_cleared { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Hash = ::subxt::utils::H256; + } + impl MetadataCleared { + const PALLET_NAME: &'static str = "Referenda"; + const EVENT_NAME: &'static str = "MetadataCleared"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "MetadataCleared"; + impl ::subxt::events::DecodeAsEvent for MetadataCleared { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -12712,12 +12850,12 @@ pub mod api { #[doc = " The next free referendum index, aka the number of referenda started so far."] pub fn referendum_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - referendum_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + referendum_count::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Referenda", "ReferendumCount", [ @@ -12730,12 +12868,12 @@ pub mod api { #[doc = " Information concerning any given referendum."] pub fn referendum_info_for( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (referendum_info_for::Param0,), - referendum_info_for::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (referendum_info_for::input::Param0,), + referendum_info_for::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Referenda", "ReferendumInfoFor", [ @@ -12752,12 +12890,12 @@ pub mod api { #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] pub fn track_queue( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (track_queue::Param0,), - track_queue::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (track_queue::input::Param0,), + track_queue::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Referenda", "TrackQueue", [ @@ -12770,12 +12908,12 @@ pub mod api { #[doc = " The number of referenda being decided currently."] pub fn deciding_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (deciding_count::Param0,), - deciding_count::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (deciding_count::input::Param0,), + deciding_count::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Referenda", "DecidingCount", [ @@ -12793,12 +12931,12 @@ pub mod api { #[doc = " large preimages."] pub fn metadata_of( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (metadata_of::Param0,), - metadata_of::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (metadata_of::input::Param0,), + metadata_of::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Referenda", "MetadataOf", [ @@ -12813,62 +12951,61 @@ pub mod api { pub mod referendum_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod referendum_info_for { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_referenda::types::ReferendumInfo< - ::core::primitive::u16, - runtime_types::rococo_runtime::OriginCaller, - ::core::primitive::u32, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::rococo_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - ::core::primitive::u128, - runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - ::subxt::ext::subxt_core::utils::AccountId32, - (::core::primitive::u32, ::core::primitive::u32), - >; + pub type Param0 = ::core::primitive::u32; } + pub type Output = runtime_types::pallet_referenda::types::ReferendumInfo< + ::core::primitive::u16, + runtime_types::rococo_runtime::OriginCaller, + ::core::primitive::u32, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::rococo_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + ::core::primitive::u128, + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>, + ::subxt::utils::AccountId32, + (::core::primitive::u32, ::core::primitive::u32), + >; } pub mod track_queue { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u16; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - (::core::primitive::u32, ::core::primitive::u128), - >; + pub type Param0 = ::core::primitive::u16; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u32, + ::core::primitive::u128, + )>; } pub mod deciding_count { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u16; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; } + pub type Output = ::core::primitive::u32; } pub mod metadata_of { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::H256; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::subxt::utils::H256; } } pub mod constants { @@ -12878,10 +13015,8 @@ pub mod api { #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] pub fn submission_deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Referenda", "SubmissionDeposit", [ @@ -12894,10 +13029,8 @@ pub mod api { #[doc = " Maximum size of the referendum queue for a single track."] pub fn max_queued( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Referenda", "MaxQueued", [ @@ -12912,10 +13045,8 @@ pub mod api { #[doc = " Once this passes, then anyone may cancel the referendum."] pub fn undeciding_timeout( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Referenda", "UndecidingTimeout", [ @@ -12931,10 +13062,8 @@ pub mod api { #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] pub fn alarm_interval( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Referenda", "AlarmInterval", [ @@ -12950,17 +13079,17 @@ pub mod api { #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] pub fn tracks( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::alloc::vec::Vec<( + ) -> ::subxt::constants::StaticAddress< + ::subxt::alloc::vec::Vec<( ::core::primitive::u16, runtime_types::pallet_referenda::types::TrackDetails< ::core::primitive::u128, ::core::primitive::u32, - ::subxt::ext::subxt_core::alloc::string::String, + ::subxt::alloc::string::String, >, )>, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "Referenda", "Tracks", [ @@ -12984,416 +13113,404 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Introduce a new member."] + #[doc = ""] + #[doc = "- `origin`: Must be the `AddOrigin`."] + #[doc = "- `who`: Account of non-member which will become a member."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct AddMember { + pub who: add_member::Who, + } + pub mod add_member { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Introduce a new member."] - #[doc = ""] - #[doc = "- `origin`: Must be the `AddOrigin`."] - #[doc = "- `who`: Account of non-member which will become a member."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct AddMember { - pub who: add_member::Who, - } - pub mod add_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddMember { - const PALLET: &'static str = "FellowshipCollective"; - const CALL: &'static str = "add_member"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Increment the rank of an existing member by one."] - #[doc = ""] - #[doc = "- `origin`: Must be the `PromoteOrigin`."] - #[doc = "- `who`: Account of existing member."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct PromoteMember { - pub who: promote_member::Who, - } - pub mod promote_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PromoteMember { - const PALLET: &'static str = "FellowshipCollective"; - const CALL: &'static str = "promote_member"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] - #[doc = "then they are removed entirely."] - #[doc = ""] - #[doc = "- `origin`: Must be the `DemoteOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] - pub struct DemoteMember { - pub who: demote_member::Who, - } - pub mod demote_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DemoteMember { - const PALLET: &'static str = "FellowshipCollective"; - const CALL: &'static str = "demote_member"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove the member entirely."] - #[doc = ""] - #[doc = "- `origin`: Must be the `RemoveOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = "- `min_rank`: The rank of the member or greater."] - #[doc = ""] - #[doc = "Weight: `O(min_rank)`."] - pub struct RemoveMember { - pub who: remove_member::Who, - pub min_rank: remove_member::MinRank, - } - pub mod remove_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type MinRank = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveMember { - const PALLET: &'static str = "FellowshipCollective"; - const CALL: &'static str = "remove_member"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Add an aye or nay vote for the sender to the given proposal."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by a member account."] - #[doc = "- `poll`: Index of a poll which is ongoing."] - #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] - #[doc = ""] - #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] - #[doc = ""] - #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] - pub struct Vote { - pub poll: vote::Poll, - pub aye: vote::Aye, - } - pub mod vote { - use super::runtime_types; - pub type Poll = ::core::primitive::u32; - pub type Aye = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { - const PALLET: &'static str = "FellowshipCollective"; - const CALL: &'static str = "vote"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove votes from the given poll. It must have ended."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by any account."] - #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] - #[doc = " exist."] - #[doc = "- `max`: Maximum number of vote items from remove in this call."] - #[doc = ""] - #[doc = "Transaction fees are waived if the operation is successful."] - #[doc = ""] - #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] - pub struct CleanupPoll { - pub poll_index: cleanup_poll::PollIndex, - pub max: cleanup_poll::Max, - } - pub mod cleanup_poll { - use super::runtime_types; - pub type PollIndex = ::core::primitive::u32; - pub type Max = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CleanupPoll { - const PALLET: &'static str = "FellowshipCollective"; - const CALL: &'static str = "cleanup_poll"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Exchanges a member with a new account and the same existing rank."] - #[doc = ""] - #[doc = "- `origin`: Must be the `ExchangeOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] - #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] - pub struct ExchangeMember { - pub who: exchange_member::Who, - pub new_who: exchange_member::NewWho, - } - pub mod exchange_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type NewWho = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExchangeMember { - const PALLET: &'static str = "FellowshipCollective"; - const CALL: &'static str = "exchange_member"; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl AddMember { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const CALL_NAME: &'static str = "add_member"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AddMember { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Introduce a new member."] - #[doc = ""] - #[doc = "- `origin`: Must be the `AddOrigin`."] - #[doc = "- `who`: Account of non-member which will become a member."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn add_member( - &self, - who: types::add_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipCollective", - "add_member", - types::AddMember { who }, - [ - 2u8, 131u8, 37u8, 217u8, 112u8, 46u8, 86u8, 165u8, 248u8, 244u8, 33u8, - 236u8, 155u8, 28u8, 163u8, 169u8, 213u8, 32u8, 70u8, 217u8, 97u8, - 194u8, 138u8, 77u8, 133u8, 97u8, 188u8, 49u8, 49u8, 31u8, 177u8, 206u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Increment the rank of an existing member by one."] + #[doc = ""] + #[doc = "- `origin`: Must be the `PromoteOrigin`."] + #[doc = "- `who`: Account of existing member."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct PromoteMember { + pub who: promote_member::Who, + } + pub mod promote_member { + use super::runtime_types; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl PromoteMember { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const CALL_NAME: &'static str = "promote_member"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PromoteMember { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Increment the rank of an existing member by one."] - #[doc = ""] - #[doc = "- `origin`: Must be the `PromoteOrigin`."] - #[doc = "- `who`: Account of existing member."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn promote_member( - &self, - who: types::promote_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipCollective", - "promote_member", - types::PromoteMember { who }, - [ - 169u8, 155u8, 9u8, 50u8, 144u8, 133u8, 230u8, 60u8, 216u8, 147u8, 3u8, - 236u8, 94u8, 185u8, 106u8, 139u8, 235u8, 143u8, 189u8, 135u8, 208u8, - 176u8, 126u8, 124u8, 85u8, 140u8, 189u8, 125u8, 87u8, 56u8, 57u8, - 246u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] + #[doc = "then they are removed entirely."] + #[doc = ""] + #[doc = "- `origin`: Must be the `DemoteOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] + pub struct DemoteMember { + pub who: demote_member::Who, + } + pub mod demote_member { + use super::runtime_types; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl DemoteMember { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const CALL_NAME: &'static str = "demote_member"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for DemoteMember { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] - #[doc = "then they are removed entirely."] - #[doc = ""] - #[doc = "- `origin`: Must be the `DemoteOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] - pub fn demote_member( - &self, - who: types::demote_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipCollective", - "demote_member", - types::DemoteMember { who }, - [ - 21u8, 185u8, 71u8, 166u8, 106u8, 88u8, 74u8, 251u8, 78u8, 28u8, 205u8, - 171u8, 199u8, 195u8, 97u8, 149u8, 175u8, 229u8, 25u8, 113u8, 96u8, - 25u8, 240u8, 64u8, 109u8, 246u8, 203u8, 45u8, 110u8, 205u8, 115u8, - 178u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove the member entirely."] + #[doc = ""] + #[doc = "- `origin`: Must be the `RemoveOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `min_rank`: The rank of the member or greater."] + #[doc = ""] + #[doc = "Weight: `O(min_rank)`."] + pub struct RemoveMember { + pub who: remove_member::Who, + pub min_rank: remove_member::MinRank, + } + pub mod remove_member { + use super::runtime_types; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type MinRank = ::core::primitive::u16; + } + impl RemoveMember { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const CALL_NAME: &'static str = "remove_member"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveMember { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove the member entirely."] - #[doc = ""] - #[doc = "- `origin`: Must be the `RemoveOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = "- `min_rank`: The rank of the member or greater."] - #[doc = ""] - #[doc = "Weight: `O(min_rank)`."] - pub fn remove_member( - &self, - who: types::remove_member::Who, - min_rank: types::remove_member::MinRank, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipCollective", - "remove_member", - types::RemoveMember { who, min_rank }, - [ - 23u8, 156u8, 32u8, 64u8, 158u8, 50u8, 64u8, 199u8, 108u8, 67u8, 133u8, - 128u8, 138u8, 241u8, 14u8, 238u8, 192u8, 173u8, 250u8, 11u8, 124u8, - 119u8, 177u8, 190u8, 152u8, 116u8, 134u8, 42u8, 216u8, 49u8, 113u8, - 49u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed` by a member account."] + #[doc = "- `poll`: Index of a poll which is ongoing."] + #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] + #[doc = ""] + #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] + #[doc = ""] + #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] + pub struct Vote { + pub poll: vote::Poll, + pub aye: vote::Aye, + } + pub mod vote { + use super::runtime_types; + pub type Poll = ::core::primitive::u32; + pub type Aye = ::core::primitive::bool; + } + impl Vote { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const CALL_NAME: &'static str = "vote"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Vote { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Add an aye or nay vote for the sender to the given proposal."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by a member account."] - #[doc = "- `poll`: Index of a poll which is ongoing."] - #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] - #[doc = ""] - #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] - #[doc = ""] - #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] - pub fn vote( - &self, - poll: types::vote::Poll, - aye: types::vote::Aye, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipCollective", - "vote", - types::Vote { poll, aye }, - [ - 54u8, 116u8, 81u8, 239u8, 223u8, 35u8, 11u8, 244u8, 245u8, 94u8, 23u8, - 241u8, 125u8, 231u8, 56u8, 150u8, 105u8, 125u8, 100u8, 171u8, 182u8, - 186u8, 134u8, 40u8, 4u8, 121u8, 119u8, 11u8, 93u8, 158u8, 59u8, 209u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove votes from the given poll. It must have ended."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed` by any account."] + #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] + #[doc = " exist."] + #[doc = "- `max`: Maximum number of vote items from remove in this call."] + #[doc = ""] + #[doc = "Transaction fees are waived if the operation is successful."] + #[doc = ""] + #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] + pub struct CleanupPoll { + pub poll_index: cleanup_poll::PollIndex, + pub max: cleanup_poll::Max, + } + pub mod cleanup_poll { + use super::runtime_types; + pub type PollIndex = ::core::primitive::u32; + pub type Max = ::core::primitive::u32; + } + impl CleanupPoll { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const CALL_NAME: &'static str = "cleanup_poll"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CleanupPoll { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove votes from the given poll. It must have ended."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by any account."] - #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] - #[doc = " exist."] - #[doc = "- `max`: Maximum number of vote items from remove in this call."] - #[doc = ""] - #[doc = "Transaction fees are waived if the operation is successful."] - #[doc = ""] - #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] - pub fn cleanup_poll( - &self, - poll_index: types::cleanup_poll::PollIndex, - max: types::cleanup_poll::Max, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipCollective", - "cleanup_poll", - types::CleanupPoll { poll_index, max }, - [ - 157u8, 109u8, 86u8, 253u8, 62u8, 107u8, 235u8, 255u8, 171u8, 68u8, - 103u8, 92u8, 245u8, 25u8, 252u8, 158u8, 174u8, 137u8, 77u8, 251u8, - 105u8, 113u8, 165u8, 46u8, 39u8, 55u8, 166u8, 79u8, 103u8, 81u8, 121u8, - 37u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Exchanges a member with a new account and the same existing rank."] + #[doc = ""] + #[doc = "- `origin`: Must be the `ExchangeOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] + #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] + pub struct ExchangeMember { + pub who: exchange_member::Who, + pub new_who: exchange_member::NewWho, + } + pub mod exchange_member { + use super::runtime_types; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type NewWho = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl ExchangeMember { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const CALL_NAME: &'static str = "exchange_member"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ExchangeMember { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Exchanges a member with a new account and the same existing rank."] - #[doc = ""] - #[doc = "- `origin`: Must be the `ExchangeOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] - #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] - pub fn exchange_member( - &self, - who: types::exchange_member::Who, - new_who: types::exchange_member::NewWho, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipCollective", - "exchange_member", - types::ExchangeMember { who, new_who }, - [ - 240u8, 208u8, 76u8, 147u8, 117u8, 23u8, 91u8, 37u8, 22u8, 101u8, 53u8, - 247u8, 161u8, 94u8, 109u8, 233u8, 104u8, 129u8, 67u8, 31u8, 223u8, - 182u8, 50u8, 233u8, 120u8, 129u8, 224u8, 135u8, 52u8, 162u8, 26u8, - 189u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Introduce a new member."] + #[doc = ""] + #[doc = "- `origin`: Must be the `AddOrigin`."] + #[doc = "- `who`: Account of non-member which will become a member."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn add_member( + &self, + who: super::add_member::Who, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipCollective", + "add_member", + super::AddMember { who }, + [ + 2u8, 131u8, 37u8, 217u8, 112u8, 46u8, 86u8, 165u8, 248u8, 244u8, + 33u8, 236u8, 155u8, 28u8, 163u8, 169u8, 213u8, 32u8, 70u8, 217u8, + 97u8, 194u8, 138u8, 77u8, 133u8, 97u8, 188u8, 49u8, 49u8, 31u8, + 177u8, 206u8, + ], + ) + } + #[doc = "Increment the rank of an existing member by one."] + #[doc = ""] + #[doc = "- `origin`: Must be the `PromoteOrigin`."] + #[doc = "- `who`: Account of existing member."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn promote_member( + &self, + who: super::promote_member::Who, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipCollective", + "promote_member", + super::PromoteMember { who }, + [ + 169u8, 155u8, 9u8, 50u8, 144u8, 133u8, 230u8, 60u8, 216u8, 147u8, + 3u8, 236u8, 94u8, 185u8, 106u8, 139u8, 235u8, 143u8, 189u8, 135u8, + 208u8, 176u8, 126u8, 124u8, 85u8, 140u8, 189u8, 125u8, 87u8, 56u8, + 57u8, 246u8, + ], + ) + } + #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] + #[doc = "then they are removed entirely."] + #[doc = ""] + #[doc = "- `origin`: Must be the `DemoteOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] + pub fn demote_member( + &self, + who: super::demote_member::Who, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipCollective", + "demote_member", + super::DemoteMember { who }, + [ + 21u8, 185u8, 71u8, 166u8, 106u8, 88u8, 74u8, 251u8, 78u8, 28u8, + 205u8, 171u8, 199u8, 195u8, 97u8, 149u8, 175u8, 229u8, 25u8, 113u8, + 96u8, 25u8, 240u8, 64u8, 109u8, 246u8, 203u8, 45u8, 110u8, 205u8, + 115u8, 178u8, + ], + ) + } + #[doc = "Remove the member entirely."] + #[doc = ""] + #[doc = "- `origin`: Must be the `RemoveOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `min_rank`: The rank of the member or greater."] + #[doc = ""] + #[doc = "Weight: `O(min_rank)`."] + pub fn remove_member( + &self, + who: super::remove_member::Who, + min_rank: super::remove_member::MinRank, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipCollective", + "remove_member", + super::RemoveMember { who, min_rank }, + [ + 23u8, 156u8, 32u8, 64u8, 158u8, 50u8, 64u8, 199u8, 108u8, 67u8, + 133u8, 128u8, 138u8, 241u8, 14u8, 238u8, 192u8, 173u8, 250u8, 11u8, + 124u8, 119u8, 177u8, 190u8, 152u8, 116u8, 134u8, 42u8, 216u8, 49u8, + 113u8, 49u8, + ], + ) + } + #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed` by a member account."] + #[doc = "- `poll`: Index of a poll which is ongoing."] + #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] + #[doc = ""] + #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] + #[doc = ""] + #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] + pub fn vote( + &self, + poll: super::vote::Poll, + aye: super::vote::Aye, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipCollective", + "vote", + super::Vote { poll, aye }, + [ + 54u8, 116u8, 81u8, 239u8, 223u8, 35u8, 11u8, 244u8, 245u8, 94u8, + 23u8, 241u8, 125u8, 231u8, 56u8, 150u8, 105u8, 125u8, 100u8, 171u8, + 182u8, 186u8, 134u8, 40u8, 4u8, 121u8, 119u8, 11u8, 93u8, 158u8, + 59u8, 209u8, + ], + ) + } + #[doc = "Remove votes from the given poll. It must have ended."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed` by any account."] + #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] + #[doc = " exist."] + #[doc = "- `max`: Maximum number of vote items from remove in this call."] + #[doc = ""] + #[doc = "Transaction fees are waived if the operation is successful."] + #[doc = ""] + #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] + pub fn cleanup_poll( + &self, + poll_index: super::cleanup_poll::PollIndex, + max: super::cleanup_poll::Max, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipCollective", + "cleanup_poll", + super::CleanupPoll { poll_index, max }, + [ + 157u8, 109u8, 86u8, 253u8, 62u8, 107u8, 235u8, 255u8, 171u8, 68u8, + 103u8, 92u8, 245u8, 25u8, 252u8, 158u8, 174u8, 137u8, 77u8, 251u8, + 105u8, 113u8, 165u8, 46u8, 39u8, 55u8, 166u8, 79u8, 103u8, 81u8, + 121u8, 37u8, + ], + ) + } + #[doc = "Exchanges a member with a new account and the same existing rank."] + #[doc = ""] + #[doc = "- `origin`: Must be the `ExchangeOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] + #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] + pub fn exchange_member( + &self, + who: super::exchange_member::Who, + new_who: super::exchange_member::NewWho, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipCollective", + "exchange_member", + super::ExchangeMember { who, new_who }, + [ + 240u8, 208u8, 76u8, 147u8, 117u8, 23u8, 91u8, 37u8, 22u8, 101u8, + 53u8, 247u8, 161u8, 94u8, 109u8, 233u8, 104u8, 129u8, 67u8, 31u8, + 223u8, 182u8, 50u8, 233u8, 120u8, 129u8, 224u8, 135u8, 52u8, 162u8, + 26u8, 189u8, + ], + ) + } } } } @@ -13402,31 +13519,36 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A member `who` has been added."] pub struct MemberAdded { pub who: member_added::Who, } pub mod member_added { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; + } + impl MemberAdded { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const EVENT_NAME: &'static str = "MemberAdded"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberAdded { - const PALLET: &'static str = "FellowshipCollective"; - const EVENT: &'static str = "MemberAdded"; + impl ::subxt::events::DecodeAsEvent for MemberAdded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The member `who`se rank has been changed to the given `rank`."] pub struct RankChanged { pub who: rank_changed::Who, @@ -13434,20 +13556,25 @@ pub mod api { } pub mod rank_changed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Rank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RankChanged { - const PALLET: &'static str = "FellowshipCollective"; - const EVENT: &'static str = "RankChanged"; + impl RankChanged { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const EVENT_NAME: &'static str = "RankChanged"; + } + impl ::subxt::events::DecodeAsEvent for RankChanged { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The member `who` of given `rank` has been removed from the collective."] pub struct MemberRemoved { pub who: member_removed::Who, @@ -13455,20 +13582,25 @@ pub mod api { } pub mod member_removed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Rank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberRemoved { - const PALLET: &'static str = "FellowshipCollective"; - const EVENT: &'static str = "MemberRemoved"; + impl MemberRemoved { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const EVENT_NAME: &'static str = "MemberRemoved"; + } + impl ::subxt::events::DecodeAsEvent for MemberRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The member `who` has voted for the `poll` with the given `vote` leading to an updated"] #[doc = "`tally`."] pub struct Voted { @@ -13479,22 +13611,27 @@ pub mod api { } pub mod voted { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Poll = ::core::primitive::u32; pub type Vote = runtime_types::pallet_ranked_collective::VoteRecord; pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { - const PALLET: &'static str = "FellowshipCollective"; - const EVENT: &'static str = "Voted"; + impl Voted { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const EVENT_NAME: &'static str = "Voted"; + } + impl ::subxt::events::DecodeAsEvent for Voted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The member `who` had their `AccountId` changed to `new_who`."] pub struct MemberExchanged { pub who: member_exchanged::Who, @@ -13502,12 +13639,17 @@ pub mod api { } pub mod member_exchanged { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type NewWho = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; + pub type NewWho = ::subxt::utils::AccountId32; + } + impl MemberExchanged { + const PALLET_NAME: &'static str = "FellowshipCollective"; + const EVENT_NAME: &'static str = "MemberExchanged"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberExchanged { - const PALLET: &'static str = "FellowshipCollective"; - const EVENT: &'static str = "MemberExchanged"; + impl ::subxt::events::DecodeAsEvent for MemberExchanged { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -13519,12 +13661,12 @@ pub mod api { #[doc = " of the vec."] pub fn member_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (member_count::Param0,), - member_count::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (member_count::input::Param0,), + member_count::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipCollective", "MemberCount", [ @@ -13537,12 +13679,12 @@ pub mod api { #[doc = " The current members of the collective."] pub fn members( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (members::Param0,), - members::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (members::input::Param0,), + members::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipCollective", "Members", [ @@ -13556,12 +13698,12 @@ pub mod api { #[doc = " The index of each ranks's member into the group of members who have at least that rank."] pub fn id_to_index( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (id_to_index::Param0, id_to_index::Param1), - id_to_index::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (id_to_index::input::Param0, id_to_index::input::Param1), + id_to_index::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipCollective", "IdToIndex", [ @@ -13575,12 +13717,12 @@ pub mod api { #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] pub fn index_to_id( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (index_to_id::Param0, index_to_id::Param1), - index_to_id::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (index_to_id::input::Param0, index_to_id::input::Param1), + index_to_id::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipCollective", "IndexToId", [ @@ -13593,12 +13735,12 @@ pub mod api { #[doc = " Votes on a given proposal, if it is ongoing."] pub fn voting( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (voting::Param0, voting::Param1), - voting::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (voting::input::Param0, voting::input::Param1), + voting::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipCollective", "Voting", [ @@ -13610,12 +13752,12 @@ pub mod api { } pub fn voting_cleanup( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (voting_cleanup::Param0,), - voting_cleanup::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (voting_cleanup::input::Param0,), + voting_cleanup::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipCollective", "VotingCleanup", [ @@ -13629,61 +13771,61 @@ pub mod api { pub mod member_count { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u16; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; } + pub type Output = ::core::primitive::u32; } pub mod members { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_ranked_collective::MemberRecord; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_ranked_collective::MemberRecord; } pub mod id_to_index { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u16; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; + pub type Param1 = ::subxt::utils::AccountId32; } + pub type Output = ::core::primitive::u32; } pub mod index_to_id { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u16; - pub type Param1 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param0 = ::core::primitive::u16; + pub type Param1 = ::core::primitive::u32; } + pub type Output = ::subxt::utils::AccountId32; } pub mod voting { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_ranked_collective::VoteRecord; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_ranked_collective::VoteRecord; } pub mod voting_cleanup { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + pub type Param0 = ::core::primitive::u32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; } } } @@ -13696,574 +13838,585 @@ pub mod api { pub type Call = runtime_types::pallet_referenda::pallet::Call; pub mod calls { use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] - #[doc = ""] - #[doc = "Emits `Submitted`."] - pub struct Submit { - pub proposal_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub proposal: submit::Proposal, - pub enactment_moment: submit::EnactmentMoment, - } - pub mod submit { - use super::runtime_types; - pub type ProposalOrigin = runtime_types::rococo_runtime::OriginCaller; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::rococo_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >; - pub type EnactmentMoment = - runtime_types::frame_support::traits::schedule::DispatchTime< - ::core::primitive::u32, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { - const PALLET: &'static str = "FellowshipReferenda"; - const CALL: &'static str = "submit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Post the Decision Deposit for a referendum."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] - #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub struct PlaceDecisionDeposit { - pub index: place_decision_deposit::Index, - } - pub mod place_decision_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { - const PALLET: &'static str = "FellowshipReferenda"; - const CALL: &'static str = "place_decision_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub struct RefundDecisionDeposit { - pub index: refund_decision_deposit::Index, - } - pub mod refund_decision_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { - const PALLET: &'static str = "FellowshipReferenda"; - const CALL: &'static str = "refund_decision_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an ongoing referendum."] - #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub struct Cancel { - pub index: cancel::Index, - } - pub mod cancel { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "FellowshipReferenda"; - const CALL: &'static str = "cancel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an ongoing referendum and slash the deposits."] - #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub struct Kill { - pub index: kill::Index, - } - pub mod kill { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { - const PALLET: &'static str = "FellowshipReferenda"; - const CALL: &'static str = "kill"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Advance a referendum onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub struct NudgeReferendum { - pub index: nudge_referendum::Index, - } - pub mod nudge_referendum { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { - const PALLET: &'static str = "FellowshipReferenda"; - const CALL: &'static str = "nudge_referendum"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Advance a track onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] - #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub struct OneFewerDeciding { - pub track: one_fewer_deciding::Track, - } - pub mod one_fewer_deciding { - use super::runtime_types; - pub type Track = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { - const PALLET: &'static str = "FellowshipReferenda"; - const CALL: &'static str = "one_fewer_deciding"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub struct RefundSubmissionDeposit { - pub index: refund_submission_deposit::Index, - } - pub mod refund_submission_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { - const PALLET: &'static str = "FellowshipReferenda"; - const CALL: &'static str = "refund_submission_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set or clear metadata of a referendum."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub struct SetMetadata { - pub index: set_metadata::Index, - pub maybe_hash: set_metadata::MaybeHash, - } - pub mod set_metadata { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type MaybeHash = - ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "FellowshipReferenda"; - const CALL: &'static str = "set_metadata"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Propose a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] - #[doc = ""] - #[doc = "Emits `Submitted`."] - pub fn submit( - &self, - proposal_origin: types::submit::ProposalOrigin, - proposal: types::submit::Proposal, - enactment_moment: types::submit::EnactmentMoment, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipReferenda", - "submit", - types::Submit { - proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - proposal_origin, - ), - proposal, - enactment_moment, - }, - [ - 86u8, 84u8, 96u8, 114u8, 247u8, 25u8, 6u8, 101u8, 96u8, 162u8, 250u8, - 43u8, 112u8, 243u8, 41u8, 89u8, 137u8, 193u8, 155u8, 47u8, 105u8, - 195u8, 219u8, 139u8, 202u8, 232u8, 181u8, 48u8, 72u8, 230u8, 24u8, - 154u8, - ], - ) - } - #[doc = "Post the Decision Deposit for a referendum."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] - #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub fn place_decision_deposit( - &self, - index: types::place_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipReferenda", - "place_decision_deposit", - types::PlaceDecisionDeposit { index }, - [ - 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, - 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, - 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, - ], - ) - } - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub fn refund_decision_deposit( - &self, - index: types::refund_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundDecisionDeposit, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipReferenda", - "refund_decision_deposit", - types::RefundDecisionDeposit { index }, - [ - 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, - 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, - 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, - ], - ) - } - #[doc = "Cancel an ongoing referendum."] - #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub fn cancel( - &self, - index: types::cancel::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipReferenda", - "cancel", - types::Cancel { index }, - [ - 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, - 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, - 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, - 122u8, - ], - ) - } - #[doc = "Cancel an ongoing referendum and slash the deposits."] - #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub fn kill( - &self, - index: types::kill::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipReferenda", - "kill", - types::Kill { index }, - [ - 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, - 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, - 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, - 48u8, - ], - ) - } - #[doc = "Advance a referendum onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub fn nudge_referendum( - &self, - index: types::nudge_referendum::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipReferenda", - "nudge_referendum", - types::NudgeReferendum { index }, - [ - 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, - 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, - 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, - 213u8, - ], - ) - } - #[doc = "Advance a track onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] - #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub fn one_fewer_deciding( - &self, - track: types::one_fewer_deciding::Track, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipReferenda", - "one_fewer_deciding", - types::OneFewerDeciding { track }, - [ - 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, - 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, - 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, - 131u8, 167u8, - ], - ) - } - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub fn refund_submission_deposit( - &self, - index: types::refund_submission_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundSubmissionDeposit, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipReferenda", - "refund_submission_deposit", - types::RefundSubmissionDeposit { index }, - [ - 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, - 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, - 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, - ], - ) - } - #[doc = "Set or clear metadata of a referendum."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub fn set_metadata( - &self, - index: types::set_metadata::Index, - maybe_hash: types::set_metadata::MaybeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "FellowshipReferenda", - "set_metadata", - types::SetMetadata { index, maybe_hash }, - [ - 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, - 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, - 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, - 88u8, - ], - ) - } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_referenda::pallet::Event2; - pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been submitted."] - pub struct Submitted { - pub index: submitted::Index, - pub track: submitted::Track, - pub proposal: submitted::Proposal, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Propose a referendum on a privileged action."] + #[doc = ""] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = ""] + #[doc = "Emits `Submitted`."] + pub struct Submit { + pub proposal_origin: ::subxt::alloc::boxed::Box, + pub proposal: submit::Proposal, + pub enactment_moment: submit::EnactmentMoment, } - pub mod submitted { + pub mod submit { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; + pub type ProposalOrigin = runtime_types::rococo_runtime::OriginCaller; pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< runtime_types::rococo_runtime::RuntimeCall, runtime_types::sp_runtime::traits::BlakeTwo256, >; + pub type EnactmentMoment = + runtime_types::frame_support::traits::schedule::DispatchTime< + ::core::primitive::u32, + >; + } + impl Submit { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const CALL_NAME: &'static str = "submit"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "Submitted"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for Submit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been placed."] - pub struct DecisionDepositPlaced { - pub index: decision_deposit_placed::Index, - pub who: decision_deposit_placed::Who, - pub amount: decision_deposit_placed::Amount, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Post the Decision Deposit for a referendum."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] + #[doc = ""] + #[doc = "Emits `DecisionDepositPlaced`."] + pub struct PlaceDecisionDeposit { + pub index: place_decision_deposit::Index, } - pub mod decision_deposit_placed { + pub mod place_decision_deposit { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "DecisionDepositPlaced"; + impl PlaceDecisionDeposit { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const CALL_NAME: &'static str = "place_decision_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PlaceDecisionDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `DecisionDepositRefunded`."] + pub struct RefundDecisionDeposit { + pub index: refund_decision_deposit::Index, + } + pub mod refund_decision_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl RefundDecisionDeposit { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const CALL_NAME: &'static str = "refund_decision_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RefundDecisionDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel an ongoing referendum."] + #[doc = ""] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Cancelled`."] + pub struct Cancel { + pub index: cancel::Index, + } + pub mod cancel { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl Cancel { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const CALL_NAME: &'static str = "cancel"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Cancel { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = ""] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub struct Kill { + pub index: kill::Index, + } + pub mod kill { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl Kill { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const CALL_NAME: &'static str = "kill"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Kill { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub struct NudgeReferendum { + pub index: nudge_referendum::Index, + } + pub mod nudge_referendum { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl NudgeReferendum { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const CALL_NAME: &'static str = "nudge_referendum"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for NudgeReferendum { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] + #[doc = ""] + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub struct OneFewerDeciding { + pub track: one_fewer_deciding::Track, + } + pub mod one_fewer_deciding { + use super::runtime_types; + pub type Track = ::core::primitive::u16; + } + impl OneFewerDeciding { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const CALL_NAME: &'static str = "one_fewer_deciding"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for OneFewerDeciding { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `SubmissionDepositRefunded`."] + pub struct RefundSubmissionDeposit { + pub index: refund_submission_deposit::Index, + } + pub mod refund_submission_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl RefundSubmissionDeposit { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const CALL_NAME: &'static str = "refund_submission_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RefundSubmissionDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set or clear metadata of a referendum."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub struct SetMetadata { + pub index: set_metadata::Index, + pub maybe_hash: set_metadata::MaybeHash, + } + pub mod set_metadata { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type MaybeHash = ::core::option::Option<::subxt::utils::H256>; + } + impl SetMetadata { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const CALL_NAME: &'static str = "set_metadata"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMetadata { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Propose a referendum on a privileged action."] + #[doc = ""] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = ""] + #[doc = "Emits `Submitted`."] + pub fn submit( + &self, + proposal_origin: super::submit::ProposalOrigin, + proposal: super::submit::Proposal, + enactment_moment: super::submit::EnactmentMoment, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipReferenda", + "submit", + super::Submit { + proposal_origin: ::subxt::alloc::boxed::Box::new(proposal_origin), + proposal, + enactment_moment, + }, + [ + 86u8, 84u8, 96u8, 114u8, 247u8, 25u8, 6u8, 101u8, 96u8, 162u8, + 250u8, 43u8, 112u8, 243u8, 41u8, 89u8, 137u8, 193u8, 155u8, 47u8, + 105u8, 195u8, 219u8, 139u8, 202u8, 232u8, 181u8, 48u8, 72u8, 230u8, + 24u8, 154u8, + ], + ) + } + #[doc = "Post the Decision Deposit for a referendum."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] + #[doc = ""] + #[doc = "Emits `DecisionDepositPlaced`."] + pub fn place_decision_deposit( + &self, + index: super::place_decision_deposit::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipReferenda", + "place_decision_deposit", + super::PlaceDecisionDeposit { index }, + [ + 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, + 86u8, 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, + 40u8, 84u8, 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, + 247u8, 220u8, + ], + ) + } + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `DecisionDepositRefunded`."] + pub fn refund_decision_deposit( + &self, + index: super::refund_decision_deposit::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipReferenda", + "refund_decision_deposit", + super::RefundDecisionDeposit { index }, + [ + 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, + 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, + 115u8, 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, + 77u8, 164u8, + ], + ) + } + #[doc = "Cancel an ongoing referendum."] + #[doc = ""] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Cancelled`."] + pub fn cancel( + &self, + index: super::cancel::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipReferenda", + "cancel", + super::Cancel { index }, + [ + 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, + 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, + 60u8, 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, + 237u8, 122u8, + ], + ) + } + #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = ""] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub fn kill( + &self, + index: super::kill::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipReferenda", + "kill", + super::Kill { index }, + [ + 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, + 126u8, 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, + 223u8, 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, + 143u8, 48u8, + ], + ) + } + #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub fn nudge_referendum( + &self, + index: super::nudge_referendum::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipReferenda", + "nudge_referendum", + super::NudgeReferendum { index }, + [ + 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, + 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, + 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, + 54u8, 213u8, + ], + ) + } + #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] + #[doc = ""] + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub fn one_fewer_deciding( + &self, + track: super::one_fewer_deciding::Track, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipReferenda", + "one_fewer_deciding", + super::OneFewerDeciding { track }, + [ + 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, + 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, + 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, + 131u8, 167u8, + ], + ) + } + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `SubmissionDepositRefunded`."] + pub fn refund_submission_deposit( + &self, + index: super::refund_submission_deposit::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipReferenda", + "refund_submission_deposit", + super::RefundSubmissionDeposit { index }, + [ + 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, + 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, + 98u8, 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, + 122u8, + ], + ) + } + #[doc = "Set or clear metadata of a referendum."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub fn set_metadata( + &self, + index: super::set_metadata::Index, + maybe_hash: super::set_metadata::MaybeHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "FellowshipReferenda", + "set_metadata", + super::SetMetadata { index, maybe_hash }, + [ + 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, + 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, + 1u8, 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, + 112u8, 88u8, + ], + ) + } + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_referenda::pallet::Event2; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A referendum has been submitted."] + pub struct Submitted { + pub index: submitted::Index, + pub track: submitted::Track, + pub proposal: submitted::Proposal, + } + pub mod submitted { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::rococo_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, + >; + } + impl Submitted { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "Submitted"; + } + impl ::subxt::events::DecodeAsEvent for Submitted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "The decision deposit has been placed."] + pub struct DecisionDepositPlaced { + pub index: decision_deposit_placed::Index, + pub who: decision_deposit_placed::Who, + pub amount: decision_deposit_placed::Amount, + } + pub mod decision_deposit_placed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl DecisionDepositPlaced { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "DecisionDepositPlaced"; + } + impl ::subxt::events::DecodeAsEvent for DecisionDepositPlaced { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The decision deposit has been refunded."] pub struct DecisionDepositRefunded { pub index: decision_deposit_refunded::Index, @@ -14273,20 +14426,25 @@ pub mod api { pub mod decision_deposit_refunded { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "DecisionDepositRefunded"; + impl DecisionDepositRefunded { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "DecisionDepositRefunded"; + } + impl ::subxt::events::DecodeAsEvent for DecisionDepositRefunded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A deposit has been slashed."] pub struct DepositSlashed { pub who: deposit_slashed::Who, @@ -14294,20 +14452,25 @@ pub mod api { } pub mod deposit_slashed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "DepositSlashed"; + impl DepositSlashed { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "DepositSlashed"; + } + impl ::subxt::events::DecodeAsEvent for DepositSlashed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has moved into the deciding phase."] pub struct DecisionStarted { pub index: decision_started::Index, @@ -14325,17 +14488,22 @@ pub mod api { >; pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "DecisionStarted"; + impl DecisionStarted { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "DecisionStarted"; + } + impl ::subxt::events::DecodeAsEvent for DecisionStarted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ConfirmStarted { pub index: confirm_started::Index, } @@ -14343,17 +14511,22 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "ConfirmStarted"; + impl ConfirmStarted { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "ConfirmStarted"; + } + impl ::subxt::events::DecodeAsEvent for ConfirmStarted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ConfirmAborted { pub index: confirm_aborted::Index, } @@ -14361,17 +14534,22 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "ConfirmAborted"; + impl ConfirmAborted { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "ConfirmAborted"; + } + impl ::subxt::events::DecodeAsEvent for ConfirmAborted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has ended its confirmation phase and is ready for approval."] pub struct Confirmed { pub index: confirmed::Index, @@ -14382,17 +14560,22 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "Confirmed"; + impl Confirmed { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "Confirmed"; + } + impl ::subxt::events::DecodeAsEvent for Confirmed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has been approved and its proposal has been scheduled."] pub struct Approved { pub index: approved::Index, @@ -14401,17 +14584,22 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "Approved"; + impl Approved { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "Approved"; + } + impl ::subxt::events::DecodeAsEvent for Approved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A proposal has been rejected by referendum."] pub struct Rejected { pub index: rejected::Index, @@ -14422,17 +14610,22 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "Rejected"; + impl Rejected { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "Rejected"; + } + impl ::subxt::events::DecodeAsEvent for Rejected { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has been timed out without being decided."] pub struct TimedOut { pub index: timed_out::Index, @@ -14443,17 +14636,22 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "TimedOut"; + impl TimedOut { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "TimedOut"; + } + impl ::subxt::events::DecodeAsEvent for TimedOut { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has been cancelled."] pub struct Cancelled { pub index: cancelled::Index, @@ -14464,17 +14662,22 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "Cancelled"; + impl Cancelled { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "Cancelled"; + } + impl ::subxt::events::DecodeAsEvent for Cancelled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A referendum has been killed."] pub struct Killed { pub index: killed::Index, @@ -14485,17 +14688,22 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "Killed"; + impl Killed { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "Killed"; + } + impl ::subxt::events::DecodeAsEvent for Killed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The submission deposit has been refunded."] pub struct SubmissionDepositRefunded { pub index: submission_deposit_refunded::Index, @@ -14505,20 +14713,25 @@ pub mod api { pub mod submission_deposit_refunded { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "SubmissionDepositRefunded"; + impl SubmissionDepositRefunded { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "SubmissionDepositRefunded"; + } + impl ::subxt::events::DecodeAsEvent for SubmissionDepositRefunded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Metadata for a referendum has been set."] pub struct MetadataSet { pub index: metadata_set::Index, @@ -14527,19 +14740,24 @@ pub mod api { pub mod metadata_set { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Hash = ::subxt::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "MetadataSet"; + impl MetadataSet { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "MetadataSet"; + } + impl ::subxt::events::DecodeAsEvent for MetadataSet { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Metadata for a referendum has been cleared."] pub struct MetadataCleared { pub index: metadata_cleared::Index, @@ -14548,11 +14766,16 @@ pub mod api { pub mod metadata_cleared { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Hash = ::subxt::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { - const PALLET: &'static str = "FellowshipReferenda"; - const EVENT: &'static str = "MetadataCleared"; + impl MetadataCleared { + const PALLET_NAME: &'static str = "FellowshipReferenda"; + const EVENT_NAME: &'static str = "MetadataCleared"; + } + impl ::subxt::events::DecodeAsEvent for MetadataCleared { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -14563,12 +14786,12 @@ pub mod api { #[doc = " The next free referendum index, aka the number of referenda started so far."] pub fn referendum_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - referendum_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + referendum_count::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipReferenda", "ReferendumCount", [ @@ -14581,12 +14804,12 @@ pub mod api { #[doc = " Information concerning any given referendum."] pub fn referendum_info_for( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (referendum_info_for::Param0,), - referendum_info_for::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (referendum_info_for::input::Param0,), + referendum_info_for::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipReferenda", "ReferendumInfoFor", [ @@ -14602,12 +14825,12 @@ pub mod api { #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] pub fn track_queue( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (track_queue::Param0,), - track_queue::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (track_queue::input::Param0,), + track_queue::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipReferenda", "TrackQueue", [ @@ -14620,12 +14843,12 @@ pub mod api { #[doc = " The number of referenda being decided currently."] pub fn deciding_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (deciding_count::Param0,), - deciding_count::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (deciding_count::input::Param0,), + deciding_count::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipReferenda", "DecidingCount", [ @@ -14643,12 +14866,12 @@ pub mod api { #[doc = " large preimages."] pub fn metadata_of( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (metadata_of::Param0,), - metadata_of::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (metadata_of::input::Param0,), + metadata_of::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "FellowshipReferenda", "MetadataOf", [ @@ -14663,60 +14886,61 @@ pub mod api { pub mod referendum_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod referendum_info_for { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_referenda::types::ReferendumInfo< - ::core::primitive::u16, - runtime_types::rococo_runtime::OriginCaller, - ::core::primitive::u32, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::rococo_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - ::core::primitive::u128, - runtime_types::pallet_ranked_collective::Tally, - ::subxt::ext::subxt_core::utils::AccountId32, - (::core::primitive::u32, ::core::primitive::u32), - >; + pub type Param0 = ::core::primitive::u32; } + pub type Output = runtime_types::pallet_referenda::types::ReferendumInfo< + ::core::primitive::u16, + runtime_types::rococo_runtime::OriginCaller, + ::core::primitive::u32, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::rococo_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + ::core::primitive::u128, + runtime_types::pallet_ranked_collective::Tally, + ::subxt::utils::AccountId32, + (::core::primitive::u32, ::core::primitive::u32), + >; } pub mod track_queue { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u16; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - (::core::primitive::u32, ::core::primitive::u32), - >; + pub type Param0 = ::core::primitive::u16; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u32, + ::core::primitive::u32, + )>; } pub mod deciding_count { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u16; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; } + pub type Output = ::core::primitive::u32; } pub mod metadata_of { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::H256; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::subxt::utils::H256; } } pub mod constants { @@ -14726,10 +14950,8 @@ pub mod api { #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] pub fn submission_deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "FellowshipReferenda", "SubmissionDeposit", [ @@ -14742,10 +14964,8 @@ pub mod api { #[doc = " Maximum size of the referendum queue for a single track."] pub fn max_queued( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "FellowshipReferenda", "MaxQueued", [ @@ -14760,10 +14980,8 @@ pub mod api { #[doc = " Once this passes, then anyone may cancel the referendum."] pub fn undeciding_timeout( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "FellowshipReferenda", "UndecidingTimeout", [ @@ -14779,10 +14997,8 @@ pub mod api { #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] pub fn alarm_interval( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "FellowshipReferenda", "AlarmInterval", [ @@ -14798,17 +15014,17 @@ pub mod api { #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] pub fn tracks( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::alloc::vec::Vec<( + ) -> ::subxt::constants::StaticAddress< + ::subxt::alloc::vec::Vec<( ::core::primitive::u16, runtime_types::pallet_referenda::types::TrackDetails< ::core::primitive::u128, ::core::primitive::u32, - ::subxt::ext::subxt_core::alloc::string::String, + ::subxt::alloc::string::String, >, )>, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "FellowshipReferenda", "Tracks", [ @@ -14836,184 +15052,182 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct WhitelistCall { + pub call_hash: whitelist_call::CallHash, + } + pub mod whitelist_call { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct WhitelistCall { - pub call_hash: whitelist_call::CallHash, - } - pub mod whitelist_call { - use super::runtime_types; - pub type CallHash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for WhitelistCall { - const PALLET: &'static str = "Whitelist"; - const CALL: &'static str = "whitelist_call"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct RemoveWhitelistedCall { - pub call_hash: remove_whitelisted_call::CallHash, - } - pub mod remove_whitelisted_call { - use super::runtime_types; - pub type CallHash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveWhitelistedCall { - const PALLET: &'static str = "Whitelist"; - const CALL: &'static str = "remove_whitelisted_call"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct DispatchWhitelistedCall { - pub call_hash: dispatch_whitelisted_call::CallHash, - pub call_encoded_len: dispatch_whitelisted_call::CallEncodedLen, - pub call_weight_witness: dispatch_whitelisted_call::CallWeightWitness, - } - pub mod dispatch_whitelisted_call { - use super::runtime_types; - pub type CallHash = ::subxt::ext::subxt_core::utils::H256; - pub type CallEncodedLen = ::core::primitive::u32; - pub type CallWeightWitness = runtime_types::sp_weights::weight_v2::Weight; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchWhitelistedCall { - const PALLET: &'static str = "Whitelist"; - const CALL: &'static str = "dispatch_whitelisted_call"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct DispatchWhitelistedCallWithPreimage { - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box< - dispatch_whitelisted_call_with_preimage::Call, - >, - } - pub mod dispatch_whitelisted_call_with_preimage { - use super::runtime_types; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchWhitelistedCallWithPreimage { - const PALLET: &'static str = "Whitelist"; - const CALL: &'static str = "dispatch_whitelisted_call_with_preimage"; - } + pub type CallHash = ::subxt::utils::H256; } - pub struct TransactionApi; - impl TransactionApi { - pub fn whitelist_call( - &self, - call_hash: types::whitelist_call::CallHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Whitelist", - "whitelist_call", - types::WhitelistCall { call_hash }, - [ - 121u8, 165u8, 49u8, 37u8, 127u8, 38u8, 126u8, 213u8, 115u8, 148u8, - 122u8, 211u8, 24u8, 91u8, 147u8, 27u8, 87u8, 210u8, 84u8, 104u8, 229u8, - 155u8, 133u8, 30u8, 34u8, 249u8, 107u8, 110u8, 31u8, 191u8, 128u8, - 28u8, - ], - ) + impl WhitelistCall { + const PALLET_NAME: &'static str = "Whitelist"; + const CALL_NAME: &'static str = "whitelist_call"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for WhitelistCall { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub fn remove_whitelisted_call( - &self, - call_hash: types::remove_whitelisted_call::CallHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RemoveWhitelistedCall, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Whitelist", - "remove_whitelisted_call", - types::RemoveWhitelistedCall { call_hash }, - [ - 30u8, 47u8, 13u8, 231u8, 165u8, 219u8, 246u8, 210u8, 11u8, 38u8, 219u8, - 218u8, 151u8, 226u8, 101u8, 175u8, 0u8, 239u8, 35u8, 46u8, 156u8, - 104u8, 145u8, 173u8, 105u8, 100u8, 21u8, 189u8, 123u8, 227u8, 196u8, - 40u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct RemoveWhitelistedCall { + pub call_hash: remove_whitelisted_call::CallHash, + } + pub mod remove_whitelisted_call { + use super::runtime_types; + pub type CallHash = ::subxt::utils::H256; + } + impl RemoveWhitelistedCall { + const PALLET_NAME: &'static str = "Whitelist"; + const CALL_NAME: &'static str = "remove_whitelisted_call"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveWhitelistedCall { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub fn dispatch_whitelisted_call( - &self, - call_hash: types::dispatch_whitelisted_call::CallHash, - call_encoded_len: types::dispatch_whitelisted_call::CallEncodedLen, - call_weight_witness: types::dispatch_whitelisted_call::CallWeightWitness, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::DispatchWhitelistedCall, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Whitelist", - "dispatch_whitelisted_call", - types::DispatchWhitelistedCall { - call_hash, - call_encoded_len, - call_weight_witness, - }, - [ - 112u8, 67u8, 72u8, 26u8, 3u8, 214u8, 86u8, 102u8, 29u8, 96u8, 222u8, - 24u8, 115u8, 15u8, 124u8, 160u8, 148u8, 184u8, 56u8, 162u8, 188u8, - 123u8, 213u8, 234u8, 208u8, 123u8, 133u8, 253u8, 43u8, 226u8, 66u8, - 116u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct DispatchWhitelistedCall { + pub call_hash: dispatch_whitelisted_call::CallHash, + pub call_encoded_len: dispatch_whitelisted_call::CallEncodedLen, + pub call_weight_witness: dispatch_whitelisted_call::CallWeightWitness, + } + pub mod dispatch_whitelisted_call { + use super::runtime_types; + pub type CallHash = ::subxt::utils::H256; + pub type CallEncodedLen = ::core::primitive::u32; + pub type CallWeightWitness = runtime_types::sp_weights::weight_v2::Weight; + } + impl DispatchWhitelistedCall { + const PALLET_NAME: &'static str = "Whitelist"; + const CALL_NAME: &'static str = "dispatch_whitelisted_call"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for DispatchWhitelistedCall { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub fn dispatch_whitelisted_call_with_preimage( - &self, - call: types::dispatch_whitelisted_call_with_preimage::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::DispatchWhitelistedCallWithPreimage, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Whitelist", - "dispatch_whitelisted_call_with_preimage", - types::DispatchWhitelistedCallWithPreimage { - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 246u8, 33u8, 102u8, 124u8, 212u8, 219u8, 99u8, 224u8, 18u8, 35u8, - 117u8, 224u8, 56u8, 173u8, 58u8, 12u8, 161u8, 123u8, 14u8, 214u8, - 178u8, 70u8, 165u8, 1u8, 171u8, 195u8, 218u8, 230u8, 114u8, 197u8, - 51u8, 193u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct DispatchWhitelistedCallWithPreimage { + pub call: ::subxt::alloc::boxed::Box, + } + pub mod dispatch_whitelisted_call_with_preimage { + use super::runtime_types; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl DispatchWhitelistedCallWithPreimage { + const PALLET_NAME: &'static str = "Whitelist"; + const CALL_NAME: &'static str = "dispatch_whitelisted_call_with_preimage"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for DispatchWhitelistedCallWithPreimage { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + pub fn whitelist_call( + &self, + call_hash: super::whitelist_call::CallHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Whitelist", + "whitelist_call", + super::WhitelistCall { call_hash }, + [ + 121u8, 165u8, 49u8, 37u8, 127u8, 38u8, 126u8, 213u8, 115u8, 148u8, + 122u8, 211u8, 24u8, 91u8, 147u8, 27u8, 87u8, 210u8, 84u8, 104u8, + 229u8, 155u8, 133u8, 30u8, 34u8, 249u8, 107u8, 110u8, 31u8, 191u8, + 128u8, 28u8, + ], + ) + } + pub fn remove_whitelisted_call( + &self, + call_hash: super::remove_whitelisted_call::CallHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Whitelist", + "remove_whitelisted_call", + super::RemoveWhitelistedCall { call_hash }, + [ + 30u8, 47u8, 13u8, 231u8, 165u8, 219u8, 246u8, 210u8, 11u8, 38u8, + 219u8, 218u8, 151u8, 226u8, 101u8, 175u8, 0u8, 239u8, 35u8, 46u8, + 156u8, 104u8, 145u8, 173u8, 105u8, 100u8, 21u8, 189u8, 123u8, + 227u8, 196u8, 40u8, + ], + ) + } + pub fn dispatch_whitelisted_call( + &self, + call_hash: super::dispatch_whitelisted_call::CallHash, + call_encoded_len: super::dispatch_whitelisted_call::CallEncodedLen, + call_weight_witness: super::dispatch_whitelisted_call::CallWeightWitness, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Whitelist", + "dispatch_whitelisted_call", + super::DispatchWhitelistedCall { + call_hash, + call_encoded_len, + call_weight_witness, + }, + [ + 112u8, 67u8, 72u8, 26u8, 3u8, 214u8, 86u8, 102u8, 29u8, 96u8, + 222u8, 24u8, 115u8, 15u8, 124u8, 160u8, 148u8, 184u8, 56u8, 162u8, + 188u8, 123u8, 213u8, 234u8, 208u8, 123u8, 133u8, 253u8, 43u8, + 226u8, 66u8, 116u8, + ], + ) + } + pub fn dispatch_whitelisted_call_with_preimage( + &self, + call: super::dispatch_whitelisted_call_with_preimage::Call, + ) -> ::subxt::transactions::StaticPayload< + super::DispatchWhitelistedCallWithPreimage, + > { + ::subxt::transactions::StaticPayload::new_static( + "Whitelist", + "dispatch_whitelisted_call_with_preimage", + super::DispatchWhitelistedCallWithPreimage { + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 246u8, 33u8, 102u8, 124u8, 212u8, 219u8, 99u8, 224u8, 18u8, 35u8, + 117u8, 224u8, 56u8, 173u8, 58u8, 12u8, 161u8, 123u8, 14u8, 214u8, + 178u8, 70u8, 165u8, 1u8, 171u8, 195u8, 218u8, 230u8, 114u8, 197u8, + 51u8, 193u8, + ], + ) + } } } } @@ -15022,55 +15236,65 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CallWhitelisted { pub call_hash: call_whitelisted::CallHash, } pub mod call_whitelisted { use super::runtime_types; - pub type CallHash = ::subxt::ext::subxt_core::utils::H256; + pub type CallHash = ::subxt::utils::H256; + } + impl CallWhitelisted { + const PALLET_NAME: &'static str = "Whitelist"; + const EVENT_NAME: &'static str = "CallWhitelisted"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CallWhitelisted { - const PALLET: &'static str = "Whitelist"; - const EVENT: &'static str = "CallWhitelisted"; + impl ::subxt::events::DecodeAsEvent for CallWhitelisted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct WhitelistedCallRemoved { pub call_hash: whitelisted_call_removed::CallHash, } pub mod whitelisted_call_removed { use super::runtime_types; - pub type CallHash = ::subxt::ext::subxt_core::utils::H256; + pub type CallHash = ::subxt::utils::H256; + } + impl WhitelistedCallRemoved { + const PALLET_NAME: &'static str = "Whitelist"; + const EVENT_NAME: &'static str = "WhitelistedCallRemoved"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for WhitelistedCallRemoved { - const PALLET: &'static str = "Whitelist"; - const EVENT: &'static str = "WhitelistedCallRemoved"; + impl ::subxt::events::DecodeAsEvent for WhitelistedCallRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct WhitelistedCallDispatched { pub call_hash: whitelisted_call_dispatched::CallHash, pub result: whitelisted_call_dispatched::Result, } pub mod whitelisted_call_dispatched { use super::runtime_types; - pub type CallHash = ::subxt::ext::subxt_core::utils::H256; + pub type CallHash = ::subxt::utils::H256; pub type Result = ::core::result::Result< runtime_types::frame_support::dispatch::PostDispatchInfo, runtime_types::sp_runtime::DispatchErrorWithPostInfo< @@ -15078,9 +15302,14 @@ pub mod api { >, >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for WhitelistedCallDispatched { - const PALLET: &'static str = "Whitelist"; - const EVENT: &'static str = "WhitelistedCallDispatched"; + impl WhitelistedCallDispatched { + const PALLET_NAME: &'static str = "Whitelist"; + const EVENT_NAME: &'static str = "WhitelistedCallDispatched"; + } + impl ::subxt::events::DecodeAsEvent for WhitelistedCallDispatched { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -15090,12 +15319,12 @@ pub mod api { impl StorageApi { pub fn whitelisted_call( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (whitelisted_call::Param0,), - whitelisted_call::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (whitelisted_call::input::Param0,), + whitelisted_call::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Whitelist", "WhitelistedCall", [ @@ -15109,11 +15338,11 @@ pub mod api { pub mod whitelisted_call { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (); + pub type Param0 = ::subxt::utils::H256; } + pub type Output = (); } } } @@ -15127,425 +15356,425 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Make a claim to collect your DOTs."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "Unsigned Validation:"] + #[doc = "A call to claim is deemed valid if the signature provided matches"] + #[doc = "the expected signed message of:"] + #[doc = ""] + #[doc = "> Ethereum Signed Message:"] + #[doc = "> (configured prefix string)(address)"] + #[doc = ""] + #[doc = "and `address` matches the `dest` account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `dest`: The destination account to payout the claim."] + #[doc = "- `ethereum_signature`: The signature of an ethereum signed message matching the format"] + #[doc = " described above."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "Weight includes logic to validate unsigned `claim` call."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub struct Claim { + pub dest: claim::Dest, + pub ethereum_signature: claim::EthereumSignature, + } + pub mod claim { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Make a claim to collect your DOTs."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _None_."] - #[doc = ""] - #[doc = "Unsigned Validation:"] - #[doc = "A call to claim is deemed valid if the signature provided matches"] - #[doc = "the expected signed message of:"] - #[doc = ""] - #[doc = "> Ethereum Signed Message:"] - #[doc = "> (configured prefix string)(address)"] - #[doc = ""] - #[doc = "and `address` matches the `dest` account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `dest`: The destination account to payout the claim."] - #[doc = "- `ethereum_signature`: The signature of an ethereum signed message matching the format"] - #[doc = " described above."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "Weight includes logic to validate unsigned `claim` call."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub struct Claim { - pub dest: claim::Dest, - pub ethereum_signature: claim::EthereumSignature, - } - pub mod claim { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::AccountId32; - pub type EthereumSignature = - runtime_types::polkadot_runtime_common::claims::EcdsaSignature; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Claim { - const PALLET: &'static str = "Claims"; - const CALL: &'static str = "claim"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Mint a new claim to collect DOTs."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `who`: The Ethereum address allowed to collect this claim."] - #[doc = "- `value`: The number of DOTs that will be claimed."] - #[doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "We assume worst case that both vesting and statement is being inserted."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub struct MintClaim { - pub who: mint_claim::Who, - pub value: mint_claim::Value, - pub vesting_schedule: mint_claim::VestingSchedule, - pub statement: mint_claim::Statement, - } - pub mod mint_claim { - use super::runtime_types; - pub type Who = runtime_types::polkadot_runtime_common::claims::EthereumAddress; - pub type Value = ::core::primitive::u128; - pub type VestingSchedule = ::core::option::Option<( - ::core::primitive::u128, - ::core::primitive::u128, - ::core::primitive::u32, - )>; - pub type Statement = ::core::option::Option< - runtime_types::polkadot_runtime_common::claims::StatementKind, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for MintClaim { - const PALLET: &'static str = "Claims"; - const CALL: &'static str = "mint_claim"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Make a claim to collect your DOTs by signing a statement."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _None_."] - #[doc = ""] - #[doc = "Unsigned Validation:"] - #[doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] - #[doc = "the expected signed message of:"] - #[doc = ""] - #[doc = "> Ethereum Signed Message:"] - #[doc = "> (configured prefix string)(address)(statement)"] - #[doc = ""] - #[doc = "and `address` matches the `dest` account; the `statement` must match that which is"] - #[doc = "expected according to your purchase arrangement."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `dest`: The destination account to payout the claim."] - #[doc = "- `ethereum_signature`: The signature of an ethereum signed message matching the format"] - #[doc = " described above."] - #[doc = "- `statement`: The identity of the statement which is being attested to in the"] - #[doc = " signature."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "Weight includes logic to validate unsigned `claim_attest` call."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub struct ClaimAttest { - pub dest: claim_attest::Dest, - pub ethereum_signature: claim_attest::EthereumSignature, - pub statement: claim_attest::Statement, - } - pub mod claim_attest { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::AccountId32; - pub type EthereumSignature = - runtime_types::polkadot_runtime_common::claims::EcdsaSignature; - pub type Statement = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimAttest { - const PALLET: &'static str = "Claims"; - const CALL: &'static str = "claim_attest"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Attest to a statement, needed to finalize the claims process."] - #[doc = ""] - #[doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a"] - #[doc = "`TransactionExtension`."] - #[doc = ""] - #[doc = "Unsigned Validation:"] - #[doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] - #[doc = "and provides a `statement` which is expected for the account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `statement`: The identity of the statement which is being attested to in the"] - #[doc = " signature."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "Weight includes logic to do pre-validation on `attest` call."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub struct Attest { - pub statement: attest::Statement, - } - pub mod attest { - use super::runtime_types; - pub type Statement = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Dest = ::subxt::utils::AccountId32; + pub type EthereumSignature = + runtime_types::polkadot_runtime_common::claims::EcdsaSignature; + } + impl Claim { + const PALLET_NAME: &'static str = "Claims"; + const CALL_NAME: &'static str = "claim"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Claim { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Attest { - const PALLET: &'static str = "Claims"; - const CALL: &'static str = "attest"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Mint a new claim to collect DOTs."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `who`: The Ethereum address allowed to collect this claim."] + #[doc = "- `value`: The number of DOTs that will be claimed."] + #[doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "We assume worst case that both vesting and statement is being inserted."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub struct MintClaim { + pub who: mint_claim::Who, + pub value: mint_claim::Value, + pub vesting_schedule: mint_claim::VestingSchedule, + pub statement: mint_claim::Statement, + } + pub mod mint_claim { + use super::runtime_types; + pub type Who = runtime_types::polkadot_runtime_common::claims::EthereumAddress; + pub type Value = ::core::primitive::u128; + pub type VestingSchedule = ::core::option::Option<( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + )>; + pub type Statement = ::core::option::Option< + runtime_types::polkadot_runtime_common::claims::StatementKind, + >; + } + impl MintClaim { + const PALLET_NAME: &'static str = "Claims"; + const CALL_NAME: &'static str = "mint_claim"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for MintClaim { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct MoveClaim { - pub old: move_claim::Old, - pub new: move_claim::New, - pub maybe_preclaim: move_claim::MaybePreclaim, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Make a claim to collect your DOTs by signing a statement."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "Unsigned Validation:"] + #[doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] + #[doc = "the expected signed message of:"] + #[doc = ""] + #[doc = "> Ethereum Signed Message:"] + #[doc = "> (configured prefix string)(address)(statement)"] + #[doc = ""] + #[doc = "and `address` matches the `dest` account; the `statement` must match that which is"] + #[doc = "expected according to your purchase arrangement."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `dest`: The destination account to payout the claim."] + #[doc = "- `ethereum_signature`: The signature of an ethereum signed message matching the format"] + #[doc = " described above."] + #[doc = "- `statement`: The identity of the statement which is being attested to in the"] + #[doc = " signature."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "Weight includes logic to validate unsigned `claim_attest` call."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub struct ClaimAttest { + pub dest: claim_attest::Dest, + pub ethereum_signature: claim_attest::EthereumSignature, + pub statement: claim_attest::Statement, + } + pub mod claim_attest { + use super::runtime_types; + pub type Dest = ::subxt::utils::AccountId32; + pub type EthereumSignature = + runtime_types::polkadot_runtime_common::claims::EcdsaSignature; + pub type Statement = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl ClaimAttest { + const PALLET_NAME: &'static str = "Claims"; + const CALL_NAME: &'static str = "claim_attest"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ClaimAttest { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod move_claim { - use super::runtime_types; - pub type Old = runtime_types::polkadot_runtime_common::claims::EthereumAddress; - pub type New = runtime_types::polkadot_runtime_common::claims::EthereumAddress; - pub type MaybePreclaim = - ::core::option::Option<::subxt::ext::subxt_core::utils::AccountId32>; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Attest to a statement, needed to finalize the claims process."] + #[doc = ""] + #[doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a"] + #[doc = "`TransactionExtension`."] + #[doc = ""] + #[doc = "Unsigned Validation:"] + #[doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] + #[doc = "and provides a `statement` which is expected for the account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `statement`: The identity of the statement which is being attested to in the"] + #[doc = " signature."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "Weight includes logic to do pre-validation on `attest` call."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub struct Attest { + pub statement: attest::Statement, + } + pub mod attest { + use super::runtime_types; + pub type Statement = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl Attest { + const PALLET_NAME: &'static str = "Claims"; + const CALL_NAME: &'static str = "attest"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Attest { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for MoveClaim { - const PALLET: &'static str = "Claims"; - const CALL: &'static str = "move_claim"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct MoveClaim { + pub old: move_claim::Old, + pub new: move_claim::New, + pub maybe_preclaim: move_claim::MaybePreclaim, + } + pub mod move_claim { + use super::runtime_types; + pub type Old = runtime_types::polkadot_runtime_common::claims::EthereumAddress; + pub type New = runtime_types::polkadot_runtime_common::claims::EthereumAddress; + pub type MaybePreclaim = ::core::option::Option<::subxt::utils::AccountId32>; + } + impl MoveClaim { + const PALLET_NAME: &'static str = "Claims"; + const CALL_NAME: &'static str = "move_claim"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for MoveClaim { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Make a claim to collect your DOTs."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _None_."] - #[doc = ""] - #[doc = "Unsigned Validation:"] - #[doc = "A call to claim is deemed valid if the signature provided matches"] - #[doc = "the expected signed message of:"] - #[doc = ""] - #[doc = "> Ethereum Signed Message:"] - #[doc = "> (configured prefix string)(address)"] - #[doc = ""] - #[doc = "and `address` matches the `dest` account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `dest`: The destination account to payout the claim."] - #[doc = "- `ethereum_signature`: The signature of an ethereum signed message matching the format"] - #[doc = " described above."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "Weight includes logic to validate unsigned `claim` call."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub fn claim( - &self, - dest: types::claim::Dest, - ethereum_signature: types::claim::EthereumSignature, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Claims", - "claim", - types::Claim { - dest, - ethereum_signature, - }, - [ - 218u8, 236u8, 60u8, 12u8, 231u8, 72u8, 155u8, 30u8, 116u8, 126u8, - 145u8, 166u8, 135u8, 118u8, 22u8, 112u8, 212u8, 140u8, 129u8, 97u8, - 9u8, 241u8, 159u8, 140u8, 252u8, 128u8, 4u8, 175u8, 180u8, 133u8, 70u8, - 55u8, - ], - ) - } - #[doc = "Mint a new claim to collect DOTs."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `who`: The Ethereum address allowed to collect this claim."] - #[doc = "- `value`: The number of DOTs that will be claimed."] - #[doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "We assume worst case that both vesting and statement is being inserted."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub fn mint_claim( - &self, - who: types::mint_claim::Who, - value: types::mint_claim::Value, - vesting_schedule: types::mint_claim::VestingSchedule, - statement: types::mint_claim::Statement, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Claims", - "mint_claim", - types::MintClaim { - who, - value, - vesting_schedule, - statement, - }, - [ - 59u8, 71u8, 27u8, 16u8, 177u8, 189u8, 53u8, 54u8, 86u8, 157u8, 122u8, - 182u8, 246u8, 113u8, 225u8, 10u8, 31u8, 253u8, 15u8, 48u8, 182u8, - 198u8, 38u8, 211u8, 90u8, 75u8, 10u8, 68u8, 70u8, 152u8, 141u8, 222u8, - ], - ) - } - #[doc = "Make a claim to collect your DOTs by signing a statement."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _None_."] - #[doc = ""] - #[doc = "Unsigned Validation:"] - #[doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] - #[doc = "the expected signed message of:"] - #[doc = ""] - #[doc = "> Ethereum Signed Message:"] - #[doc = "> (configured prefix string)(address)(statement)"] - #[doc = ""] - #[doc = "and `address` matches the `dest` account; the `statement` must match that which is"] - #[doc = "expected according to your purchase arrangement."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `dest`: The destination account to payout the claim."] - #[doc = "- `ethereum_signature`: The signature of an ethereum signed message matching the format"] - #[doc = " described above."] - #[doc = "- `statement`: The identity of the statement which is being attested to in the"] - #[doc = " signature."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "Weight includes logic to validate unsigned `claim_attest` call."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub fn claim_attest( - &self, - dest: types::claim_attest::Dest, - ethereum_signature: types::claim_attest::EthereumSignature, - statement: types::claim_attest::Statement, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Claims", - "claim_attest", - types::ClaimAttest { - dest, - ethereum_signature, - statement, - }, - [ - 61u8, 16u8, 39u8, 50u8, 23u8, 249u8, 217u8, 155u8, 138u8, 128u8, 247u8, - 214u8, 185u8, 7u8, 87u8, 108u8, 15u8, 43u8, 44u8, 224u8, 204u8, 39u8, - 219u8, 188u8, 197u8, 104u8, 120u8, 144u8, 152u8, 161u8, 244u8, 37u8, - ], - ) - } - #[doc = "Attest to a statement, needed to finalize the claims process."] - #[doc = ""] - #[doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a"] - #[doc = "`TransactionExtension`."] - #[doc = ""] - #[doc = "Unsigned Validation:"] - #[doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] - #[doc = "and provides a `statement` which is expected for the account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `statement`: The identity of the statement which is being attested to in the"] - #[doc = " signature."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "Weight includes logic to do pre-validation on `attest` call."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub fn attest( - &self, - statement: types::attest::Statement, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Claims", - "attest", - types::Attest { statement }, - [ - 254u8, 56u8, 140u8, 129u8, 227u8, 155u8, 161u8, 107u8, 167u8, 148u8, - 167u8, 104u8, 139u8, 174u8, 204u8, 124u8, 126u8, 198u8, 165u8, 61u8, - 83u8, 197u8, 242u8, 13u8, 70u8, 153u8, 14u8, 62u8, 214u8, 129u8, 64u8, - 93u8, - ], - ) - } - pub fn move_claim( - &self, - old: types::move_claim::Old, - new: types::move_claim::New, - maybe_preclaim: types::move_claim::MaybePreclaim, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Claims", - "move_claim", - types::MoveClaim { - old, - new, - maybe_preclaim, - }, - [ - 187u8, 200u8, 222u8, 83u8, 110u8, 49u8, 60u8, 134u8, 91u8, 215u8, 67u8, - 18u8, 187u8, 241u8, 191u8, 127u8, 222u8, 171u8, 151u8, 245u8, 161u8, - 196u8, 123u8, 99u8, 206u8, 110u8, 55u8, 82u8, 210u8, 151u8, 116u8, - 230u8, - ], - ) + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Make a claim to collect your DOTs."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "Unsigned Validation:"] + #[doc = "A call to claim is deemed valid if the signature provided matches"] + #[doc = "the expected signed message of:"] + #[doc = ""] + #[doc = "> Ethereum Signed Message:"] + #[doc = "> (configured prefix string)(address)"] + #[doc = ""] + #[doc = "and `address` matches the `dest` account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `dest`: The destination account to payout the claim."] + #[doc = "- `ethereum_signature`: The signature of an ethereum signed message matching the format"] + #[doc = " described above."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "Weight includes logic to validate unsigned `claim` call."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub fn claim( + &self, + dest: super::claim::Dest, + ethereum_signature: super::claim::EthereumSignature, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Claims", + "claim", + super::Claim { + dest, + ethereum_signature, + }, + [ + 218u8, 236u8, 60u8, 12u8, 231u8, 72u8, 155u8, 30u8, 116u8, 126u8, + 145u8, 166u8, 135u8, 118u8, 22u8, 112u8, 212u8, 140u8, 129u8, 97u8, + 9u8, 241u8, 159u8, 140u8, 252u8, 128u8, 4u8, 175u8, 180u8, 133u8, + 70u8, 55u8, + ], + ) + } + #[doc = "Mint a new claim to collect DOTs."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `who`: The Ethereum address allowed to collect this claim."] + #[doc = "- `value`: The number of DOTs that will be claimed."] + #[doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "We assume worst case that both vesting and statement is being inserted."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub fn mint_claim( + &self, + who: super::mint_claim::Who, + value: super::mint_claim::Value, + vesting_schedule: super::mint_claim::VestingSchedule, + statement: super::mint_claim::Statement, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Claims", + "mint_claim", + super::MintClaim { + who, + value, + vesting_schedule, + statement, + }, + [ + 59u8, 71u8, 27u8, 16u8, 177u8, 189u8, 53u8, 54u8, 86u8, 157u8, + 122u8, 182u8, 246u8, 113u8, 225u8, 10u8, 31u8, 253u8, 15u8, 48u8, + 182u8, 198u8, 38u8, 211u8, 90u8, 75u8, 10u8, 68u8, 70u8, 152u8, + 141u8, 222u8, + ], + ) + } + #[doc = "Make a claim to collect your DOTs by signing a statement."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "Unsigned Validation:"] + #[doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] + #[doc = "the expected signed message of:"] + #[doc = ""] + #[doc = "> Ethereum Signed Message:"] + #[doc = "> (configured prefix string)(address)(statement)"] + #[doc = ""] + #[doc = "and `address` matches the `dest` account; the `statement` must match that which is"] + #[doc = "expected according to your purchase arrangement."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `dest`: The destination account to payout the claim."] + #[doc = "- `ethereum_signature`: The signature of an ethereum signed message matching the format"] + #[doc = " described above."] + #[doc = "- `statement`: The identity of the statement which is being attested to in the"] + #[doc = " signature."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "Weight includes logic to validate unsigned `claim_attest` call."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub fn claim_attest( + &self, + dest: super::claim_attest::Dest, + ethereum_signature: super::claim_attest::EthereumSignature, + statement: super::claim_attest::Statement, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Claims", + "claim_attest", + super::ClaimAttest { + dest, + ethereum_signature, + statement, + }, + [ + 61u8, 16u8, 39u8, 50u8, 23u8, 249u8, 217u8, 155u8, 138u8, 128u8, + 247u8, 214u8, 185u8, 7u8, 87u8, 108u8, 15u8, 43u8, 44u8, 224u8, + 204u8, 39u8, 219u8, 188u8, 197u8, 104u8, 120u8, 144u8, 152u8, + 161u8, 244u8, 37u8, + ], + ) + } + #[doc = "Attest to a statement, needed to finalize the claims process."] + #[doc = ""] + #[doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a"] + #[doc = "`TransactionExtension`."] + #[doc = ""] + #[doc = "Unsigned Validation:"] + #[doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] + #[doc = "and provides a `statement` which is expected for the account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `statement`: The identity of the statement which is being attested to in the"] + #[doc = " signature."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "Weight includes logic to do pre-validation on `attest` call."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub fn attest( + &self, + statement: super::attest::Statement, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Claims", + "attest", + super::Attest { statement }, + [ + 254u8, 56u8, 140u8, 129u8, 227u8, 155u8, 161u8, 107u8, 167u8, + 148u8, 167u8, 104u8, 139u8, 174u8, 204u8, 124u8, 126u8, 198u8, + 165u8, 61u8, 83u8, 197u8, 242u8, 13u8, 70u8, 153u8, 14u8, 62u8, + 214u8, 129u8, 64u8, 93u8, + ], + ) + } + pub fn move_claim( + &self, + old: super::move_claim::Old, + new: super::move_claim::New, + maybe_preclaim: super::move_claim::MaybePreclaim, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Claims", + "move_claim", + super::MoveClaim { + old, + new, + maybe_preclaim, + }, + [ + 187u8, 200u8, 222u8, 83u8, 110u8, 49u8, 60u8, 134u8, 91u8, 215u8, + 67u8, 18u8, 187u8, 241u8, 191u8, 127u8, 222u8, 171u8, 151u8, 245u8, + 161u8, 196u8, 123u8, 99u8, 206u8, 110u8, 55u8, 82u8, 210u8, 151u8, + 116u8, 230u8, + ], + ) + } } } } @@ -15554,12 +15783,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Someone claimed some DOTs."] pub struct Claimed { pub who: claimed::Who, @@ -15568,14 +15797,19 @@ pub mod api { } pub mod claimed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type EthereumAddress = runtime_types::polkadot_runtime_common::claims::EthereumAddress; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Claimed { - const PALLET: &'static str = "Claims"; - const EVENT: &'static str = "Claimed"; + impl Claimed { + const PALLET_NAME: &'static str = "Claims"; + const EVENT_NAME: &'static str = "Claimed"; + } + impl ::subxt::events::DecodeAsEvent for Claimed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -15585,12 +15819,12 @@ pub mod api { impl StorageApi { pub fn claims( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (claims::Param0,), - claims::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (claims::input::Param0,), + claims::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Claims", "Claims", [ @@ -15603,12 +15837,9 @@ pub mod api { } pub fn total( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - total::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), total::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Claims", "Total", [ @@ -15625,12 +15856,12 @@ pub mod api { #[doc = " The block number is when the vesting should start."] pub fn vesting( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (vesting::Param0,), - vesting::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (vesting::input::Param0,), + vesting::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Claims", "Vesting", [ @@ -15643,12 +15874,12 @@ pub mod api { #[doc = " The statement kind that must be signed, if any."] pub fn signing( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (signing::Param0,), - signing::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (signing::input::Param0,), + signing::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Claims", "Signing", [ @@ -15662,12 +15893,12 @@ pub mod api { #[doc = " Pre-claimed Ethereum accounts, by the Account ID that they are claimed to."] pub fn preclaims( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (preclaims::Param0,), - preclaims::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (preclaims::input::Param0,), + preclaims::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Claims", "Preclaims", [ @@ -15681,51 +15912,53 @@ pub mod api { pub mod claims { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_runtime_common::claims::EthereumAddress; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u128; + pub type Param0 = + runtime_types::polkadot_runtime_common::claims::EthereumAddress; } + pub type Output = ::core::primitive::u128; } pub mod total { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u128; } + pub type Output = ::core::primitive::u128; } pub mod vesting { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_runtime_common::claims::EthereumAddress; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ( - ::core::primitive::u128, - ::core::primitive::u128, - ::core::primitive::u32, - ); + pub type Param0 = + runtime_types::polkadot_runtime_common::claims::EthereumAddress; } + pub type Output = ( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + ); } pub mod signing { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_runtime_common::claims::EthereumAddress; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::polkadot_runtime_common::claims::StatementKind; + pub type Param0 = + runtime_types::polkadot_runtime_common::claims::EthereumAddress; } + pub type Output = runtime_types::polkadot_runtime_common::claims::StatementKind; } pub mod preclaims { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_runtime_common::claims::EthereumAddress; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::polkadot_runtime_common::claims::EthereumAddress; } } pub mod constants { @@ -15734,10 +15967,10 @@ pub mod api { impl ConstantsApi { pub fn prefix( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::constants::StaticAddress< + ::subxt::alloc::vec::Vec<::core::primitive::u8>, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "Claims", "Prefix", [ @@ -15761,550 +15994,553 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + pub struct Batch { + pub calls: batch::Calls, + } + pub mod batch { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Send a batch of dispatch calls."] - #[doc = ""] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - #[doc = ""] - #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] - #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] - #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] - #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] - #[doc = "event is deposited."] - pub struct Batch { - pub calls: batch::Calls, - } - pub mod batch { - use super::runtime_types; - pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::rococo_runtime::RuntimeCall, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Batch { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "batch"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Send a call through an indexed pseudonym of the sender."] - #[doc = ""] - #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] - #[doc = "use the same filter as the origin of this call."] - #[doc = ""] - #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] - #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] - #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] - #[doc = "in the Multisig pallet instead."] - #[doc = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub struct AsDerivative { - pub index: as_derivative::Index, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod as_derivative { - use super::runtime_types; - pub type Index = ::core::primitive::u16; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsDerivative { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "as_derivative"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Send a batch of dispatch calls and atomically execute them."] - #[doc = "The whole transaction will rollback and fail if any of the calls failed."] - #[doc = ""] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub struct BatchAll { - pub calls: batch_all::Calls, - } - pub mod batch_all { - use super::runtime_types; - pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::rococo_runtime::RuntimeCall, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for BatchAll { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "batch_all"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct DispatchAs { - pub as_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod dispatch_as { - use super::runtime_types; - pub type AsOrigin = runtime_types::rococo_runtime::OriginCaller; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAs { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "dispatch_as"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Send a batch of dispatch calls."] - #[doc = "Unlike `batch`, it allows errors and won't interrupt."] - #[doc = ""] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub struct ForceBatch { - pub calls: force_batch::Calls, - } - pub mod force_batch { - use super::runtime_types; - pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::rococo_runtime::RuntimeCall, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceBatch { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "force_batch"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Dispatch a function call with a specified weight."] - #[doc = ""] - #[doc = "This function does not check the weight of the call, and instead allows the"] - #[doc = "Root origin to specify the weight of the call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub struct WithWeight { - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub weight: with_weight::Weight, - } - pub mod with_weight { - use super::runtime_types; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - pub type Weight = runtime_types::sp_weights::weight_v2::Weight; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for WithWeight { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "with_weight"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Dispatch a fallback call in the event the main call fails to execute."] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "This function first attempts to dispatch the `main` call."] - #[doc = "If the `main` call fails, the `fallback` is attemted."] - #[doc = "if the fallback is successfully dispatched, the weights of both calls"] - #[doc = "are accumulated and an event containing the main call error is deposited."] - #[doc = ""] - #[doc = "In the event of a fallback failure the whole call fails"] - #[doc = "with the weights returned."] - #[doc = ""] - #[doc = "- `main`: The main call to be dispatched. This is the primary action to execute."] - #[doc = "- `fallback`: The fallback call to be dispatched in case the `main` call fails."] - #[doc = ""] - #[doc = "## Dispatch Logic"] - #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] - #[doc = " applying any origin filters."] - #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] - #[doc = " `fallback` calls."] - #[doc = ""] - #[doc = "## Use Case"] - #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] - #[doc = " or both."] - pub struct IfElse { - pub main: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub fallback: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod if_else { - use super::runtime_types; - pub type Main = runtime_types::rococo_runtime::RuntimeCall; - pub type Fallback = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for IfElse { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "if_else"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub struct DispatchAsFallible { - pub as_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub call: - ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod dispatch_as_fallible { - use super::runtime_types; - pub type AsOrigin = runtime_types::rococo_runtime::OriginCaller; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAsFallible { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "dispatch_as_fallible"; + pub type Calls = + ::subxt::alloc::vec::Vec; + } + impl Batch { + const PALLET_NAME: &'static str = "Utility"; + const CALL_NAME: &'static str = "batch"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Batch { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Send a batch of dispatch calls."] - #[doc = ""] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - #[doc = ""] - #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] - #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] - #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] - #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] - #[doc = "event is deposited."] - pub fn batch( - &self, - calls: types::batch::Calls, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "batch", - types::Batch { calls }, - [ - 3u8, 237u8, 56u8, 53u8, 21u8, 11u8, 83u8, 138u8, 190u8, 176u8, 250u8, - 61u8, 193u8, 4u8, 109u8, 250u8, 196u8, 95u8, 159u8, 4u8, 119u8, 229u8, - 79u8, 74u8, 13u8, 167u8, 29u8, 23u8, 120u8, 41u8, 61u8, 123u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub struct AsDerivative { + pub index: as_derivative::Index, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod as_derivative { + use super::runtime_types; + pub type Index = ::core::primitive::u16; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl AsDerivative { + const PALLET_NAME: &'static str = "Utility"; + const CALL_NAME: &'static str = "as_derivative"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AsDerivative { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Send a call through an indexed pseudonym of the sender."] - #[doc = ""] - #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] - #[doc = "use the same filter as the origin of this call."] - #[doc = ""] - #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] - #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] - #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] - #[doc = "in the Multisig pallet instead."] - #[doc = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub fn as_derivative( - &self, - index: types::as_derivative::Index, - call: types::as_derivative::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "as_derivative", - types::AsDerivative { - index, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 186u8, 212u8, 100u8, 244u8, 88u8, 215u8, 10u8, 103u8, 96u8, 184u8, - 160u8, 213u8, 212u8, 0u8, 73u8, 99u8, 234u8, 128u8, 232u8, 29u8, 91u8, - 253u8, 216u8, 226u8, 113u8, 203u8, 41u8, 84u8, 101u8, 209u8, 222u8, - 163u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub struct BatchAll { + pub calls: batch_all::Calls, + } + pub mod batch_all { + use super::runtime_types; + pub type Calls = + ::subxt::alloc::vec::Vec; + } + impl BatchAll { + const PALLET_NAME: &'static str = "Utility"; + const CALL_NAME: &'static str = "batch_all"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for BatchAll { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Send a batch of dispatch calls and atomically execute them."] - #[doc = "The whole transaction will rollback and fail if any of the calls failed."] - #[doc = ""] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub fn batch_all( - &self, - calls: types::batch_all::Calls, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "batch_all", - types::BatchAll { calls }, - [ - 238u8, 192u8, 118u8, 217u8, 228u8, 209u8, 113u8, 16u8, 189u8, 24u8, - 140u8, 27u8, 179u8, 201u8, 44u8, 86u8, 211u8, 7u8, 75u8, 154u8, 199u8, - 36u8, 165u8, 26u8, 207u8, 12u8, 29u8, 209u8, 233u8, 37u8, 176u8, 215u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct DispatchAs { + pub as_origin: ::subxt::alloc::boxed::Box, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod dispatch_as { + use super::runtime_types; + pub type AsOrigin = runtime_types::rococo_runtime::OriginCaller; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl DispatchAs { + const PALLET_NAME: &'static str = "Utility"; + const CALL_NAME: &'static str = "dispatch_as"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for DispatchAs { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn dispatch_as( - &self, - as_origin: types::dispatch_as::AsOrigin, - call: types::dispatch_as::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "dispatch_as", - types::DispatchAs { - as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new(as_origin), - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 208u8, 21u8, 102u8, 243u8, 68u8, 60u8, 28u8, 175u8, 113u8, 105u8, 63u8, - 153u8, 20u8, 248u8, 72u8, 103u8, 139u8, 126u8, 131u8, 253u8, 32u8, - 26u8, 112u8, 47u8, 34u8, 195u8, 129u8, 0u8, 81u8, 78u8, 231u8, 184u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub struct ForceBatch { + pub calls: force_batch::Calls, + } + pub mod force_batch { + use super::runtime_types; + pub type Calls = + ::subxt::alloc::vec::Vec; + } + impl ForceBatch { + const PALLET_NAME: &'static str = "Utility"; + const CALL_NAME: &'static str = "force_batch"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceBatch { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Send a batch of dispatch calls."] - #[doc = "Unlike `batch`, it allows errors and won't interrupt."] - #[doc = ""] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub fn force_batch( - &self, - calls: types::force_batch::Calls, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "force_batch", - types::ForceBatch { calls }, - [ - 88u8, 134u8, 254u8, 240u8, 121u8, 181u8, 66u8, 132u8, 41u8, 200u8, - 213u8, 247u8, 170u8, 75u8, 80u8, 20u8, 231u8, 221u8, 157u8, 147u8, - 214u8, 33u8, 162u8, 126u8, 89u8, 98u8, 29u8, 67u8, 234u8, 13u8, 252u8, - 192u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Dispatch a function call with a specified weight."] + #[doc = ""] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Root origin to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + pub struct WithWeight { + pub call: ::subxt::alloc::boxed::Box, + pub weight: with_weight::Weight, + } + pub mod with_weight { + use super::runtime_types; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + pub type Weight = runtime_types::sp_weights::weight_v2::Weight; + } + impl WithWeight { + const PALLET_NAME: &'static str = "Utility"; + const CALL_NAME: &'static str = "with_weight"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for WithWeight { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Dispatch a function call with a specified weight."] - #[doc = ""] - #[doc = "This function does not check the weight of the call, and instead allows the"] - #[doc = "Root origin to specify the weight of the call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub fn with_weight( - &self, - call: types::with_weight::Call, - weight: types::with_weight::Weight, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "with_weight", - types::WithWeight { - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - weight, - }, - [ - 48u8, 131u8, 229u8, 42u8, 81u8, 107u8, 85u8, 108u8, 214u8, 84u8, 18u8, - 251u8, 178u8, 241u8, 170u8, 13u8, 147u8, 104u8, 58u8, 241u8, 152u8, - 220u8, 165u8, 70u8, 153u8, 1u8, 45u8, 79u8, 129u8, 27u8, 13u8, 198u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Dispatch a fallback call in the event the main call fails to execute."] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "This function first attempts to dispatch the `main` call."] + #[doc = "If the `main` call fails, the `fallback` is attemted."] + #[doc = "if the fallback is successfully dispatched, the weights of both calls"] + #[doc = "are accumulated and an event containing the main call error is deposited."] + #[doc = ""] + #[doc = "In the event of a fallback failure the whole call fails"] + #[doc = "with the weights returned."] + #[doc = ""] + #[doc = "- `main`: The main call to be dispatched. This is the primary action to execute."] + #[doc = "- `fallback`: The fallback call to be dispatched in case the `main` call fails."] + #[doc = ""] + #[doc = "## Dispatch Logic"] + #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] + #[doc = " applying any origin filters."] + #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] + #[doc = " `fallback` calls."] + #[doc = ""] + #[doc = "## Use Case"] + #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] + #[doc = " or both."] + pub struct IfElse { + pub main: ::subxt::alloc::boxed::Box, + pub fallback: ::subxt::alloc::boxed::Box, + } + pub mod if_else { + use super::runtime_types; + pub type Main = runtime_types::rococo_runtime::RuntimeCall; + pub type Fallback = runtime_types::rococo_runtime::RuntimeCall; + } + impl IfElse { + const PALLET_NAME: &'static str = "Utility"; + const CALL_NAME: &'static str = "if_else"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for IfElse { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Dispatch a fallback call in the event the main call fails to execute."] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "This function first attempts to dispatch the `main` call."] - #[doc = "If the `main` call fails, the `fallback` is attemted."] - #[doc = "if the fallback is successfully dispatched, the weights of both calls"] - #[doc = "are accumulated and an event containing the main call error is deposited."] - #[doc = ""] - #[doc = "In the event of a fallback failure the whole call fails"] - #[doc = "with the weights returned."] - #[doc = ""] - #[doc = "- `main`: The main call to be dispatched. This is the primary action to execute."] - #[doc = "- `fallback`: The fallback call to be dispatched in case the `main` call fails."] - #[doc = ""] - #[doc = "## Dispatch Logic"] - #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] - #[doc = " applying any origin filters."] - #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] - #[doc = " `fallback` calls."] - #[doc = ""] - #[doc = "## Use Case"] - #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] - #[doc = " or both."] - pub fn if_else( - &self, - main: types::if_else::Main, - fallback: types::if_else::Fallback, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "if_else", - types::IfElse { - main: ::subxt::ext::subxt_core::alloc::boxed::Box::new(main), - fallback: ::subxt::ext::subxt_core::alloc::boxed::Box::new(fallback), - }, - [ - 3u8, 66u8, 49u8, 122u8, 112u8, 61u8, 159u8, 150u8, 57u8, 100u8, 10u8, - 127u8, 87u8, 65u8, 235u8, 116u8, 11u8, 7u8, 1u8, 50u8, 128u8, 137u8, - 29u8, 151u8, 119u8, 128u8, 34u8, 87u8, 122u8, 215u8, 108u8, 89u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + pub struct DispatchAsFallible { + pub as_origin: ::subxt::alloc::boxed::Box, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod dispatch_as_fallible { + use super::runtime_types; + pub type AsOrigin = runtime_types::rococo_runtime::OriginCaller; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl DispatchAsFallible { + const PALLET_NAME: &'static str = "Utility"; + const CALL_NAME: &'static str = "dispatch_as_fallible"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for DispatchAsFallible { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub fn dispatch_as_fallible( - &self, - as_origin: types::dispatch_as_fallible::AsOrigin, - call: types::dispatch_as_fallible::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "dispatch_as_fallible", - types::DispatchAsFallible { - as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new(as_origin), - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 35u8, 54u8, 22u8, 174u8, 37u8, 180u8, 178u8, 22u8, 208u8, 211u8, 68u8, - 254u8, 16u8, 67u8, 52u8, 83u8, 46u8, 64u8, 125u8, 21u8, 226u8, 214u8, - 233u8, 25u8, 166u8, 36u8, 40u8, 99u8, 31u8, 110u8, 109u8, 112u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + pub fn batch( + &self, + calls: super::batch::Calls, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Utility", + "batch", + super::Batch { calls }, + [ + 3u8, 237u8, 56u8, 53u8, 21u8, 11u8, 83u8, 138u8, 190u8, 176u8, + 250u8, 61u8, 193u8, 4u8, 109u8, 250u8, 196u8, 95u8, 159u8, 4u8, + 119u8, 229u8, 79u8, 74u8, 13u8, 167u8, 29u8, 23u8, 120u8, 41u8, + 61u8, 123u8, + ], + ) + } + #[doc = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub fn as_derivative( + &self, + index: super::as_derivative::Index, + call: super::as_derivative::Call, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Utility", + "as_derivative", + super::AsDerivative { + index, + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 186u8, 212u8, 100u8, 244u8, 88u8, 215u8, 10u8, 103u8, 96u8, 184u8, + 160u8, 213u8, 212u8, 0u8, 73u8, 99u8, 234u8, 128u8, 232u8, 29u8, + 91u8, 253u8, 216u8, 226u8, 113u8, 203u8, 41u8, 84u8, 101u8, 209u8, + 222u8, 163u8, + ], + ) + } + #[doc = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub fn batch_all( + &self, + calls: super::batch_all::Calls, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Utility", + "batch_all", + super::BatchAll { calls }, + [ + 238u8, 192u8, 118u8, 217u8, 228u8, 209u8, 113u8, 16u8, 189u8, 24u8, + 140u8, 27u8, 179u8, 201u8, 44u8, 86u8, 211u8, 7u8, 75u8, 154u8, + 199u8, 36u8, 165u8, 26u8, 207u8, 12u8, 29u8, 209u8, 233u8, 37u8, + 176u8, 215u8, + ], + ) + } + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn dispatch_as( + &self, + as_origin: super::dispatch_as::AsOrigin, + call: super::dispatch_as::Call, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Utility", + "dispatch_as", + super::DispatchAs { + as_origin: ::subxt::alloc::boxed::Box::new(as_origin), + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 208u8, 21u8, 102u8, 243u8, 68u8, 60u8, 28u8, 175u8, 113u8, 105u8, + 63u8, 153u8, 20u8, 248u8, 72u8, 103u8, 139u8, 126u8, 131u8, 253u8, + 32u8, 26u8, 112u8, 47u8, 34u8, 195u8, 129u8, 0u8, 81u8, 78u8, + 231u8, 184u8, + ], + ) + } + #[doc = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub fn force_batch( + &self, + calls: super::force_batch::Calls, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Utility", + "force_batch", + super::ForceBatch { calls }, + [ + 88u8, 134u8, 254u8, 240u8, 121u8, 181u8, 66u8, 132u8, 41u8, 200u8, + 213u8, 247u8, 170u8, 75u8, 80u8, 20u8, 231u8, 221u8, 157u8, 147u8, + 214u8, 33u8, 162u8, 126u8, 89u8, 98u8, 29u8, 67u8, 234u8, 13u8, + 252u8, 192u8, + ], + ) + } + #[doc = "Dispatch a function call with a specified weight."] + #[doc = ""] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Root origin to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + pub fn with_weight( + &self, + call: super::with_weight::Call, + weight: super::with_weight::Weight, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Utility", + "with_weight", + super::WithWeight { + call: ::subxt::alloc::boxed::Box::new(call), + weight, + }, + [ + 48u8, 131u8, 229u8, 42u8, 81u8, 107u8, 85u8, 108u8, 214u8, 84u8, + 18u8, 251u8, 178u8, 241u8, 170u8, 13u8, 147u8, 104u8, 58u8, 241u8, + 152u8, 220u8, 165u8, 70u8, 153u8, 1u8, 45u8, 79u8, 129u8, 27u8, + 13u8, 198u8, + ], + ) + } + #[doc = "Dispatch a fallback call in the event the main call fails to execute."] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "This function first attempts to dispatch the `main` call."] + #[doc = "If the `main` call fails, the `fallback` is attemted."] + #[doc = "if the fallback is successfully dispatched, the weights of both calls"] + #[doc = "are accumulated and an event containing the main call error is deposited."] + #[doc = ""] + #[doc = "In the event of a fallback failure the whole call fails"] + #[doc = "with the weights returned."] + #[doc = ""] + #[doc = "- `main`: The main call to be dispatched. This is the primary action to execute."] + #[doc = "- `fallback`: The fallback call to be dispatched in case the `main` call fails."] + #[doc = ""] + #[doc = "## Dispatch Logic"] + #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] + #[doc = " applying any origin filters."] + #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] + #[doc = " `fallback` calls."] + #[doc = ""] + #[doc = "## Use Case"] + #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] + #[doc = " or both."] + pub fn if_else( + &self, + main: super::if_else::Main, + fallback: super::if_else::Fallback, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Utility", + "if_else", + super::IfElse { + main: ::subxt::alloc::boxed::Box::new(main), + fallback: ::subxt::alloc::boxed::Box::new(fallback), + }, + [ + 3u8, 66u8, 49u8, 122u8, 112u8, 61u8, 159u8, 150u8, 57u8, 100u8, + 10u8, 127u8, 87u8, 65u8, 235u8, 116u8, 11u8, 7u8, 1u8, 50u8, 128u8, + 137u8, 29u8, 151u8, 119u8, 128u8, 34u8, 87u8, 122u8, 215u8, 108u8, + 89u8, + ], + ) + } + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + pub fn dispatch_as_fallible( + &self, + as_origin: super::dispatch_as_fallible::AsOrigin, + call: super::dispatch_as_fallible::Call, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Utility", + "dispatch_as_fallible", + super::DispatchAsFallible { + as_origin: ::subxt::alloc::boxed::Box::new(as_origin), + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 35u8, 54u8, 22u8, 174u8, 37u8, 180u8, 178u8, 22u8, 208u8, 211u8, + 68u8, 254u8, 16u8, 67u8, 52u8, 83u8, 46u8, 64u8, 125u8, 21u8, + 226u8, 214u8, 233u8, 25u8, 166u8, 36u8, 40u8, 99u8, 31u8, 110u8, + 109u8, 112u8, + ], + ) + } } } } @@ -16313,12 +16549,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] #[doc = "well as the error."] pub struct BatchInterrupted { @@ -16330,56 +16566,76 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type Error = runtime_types::sp_runtime::DispatchError; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BatchInterrupted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchInterrupted"; + impl BatchInterrupted { + const PALLET_NAME: &'static str = "Utility"; + const EVENT_NAME: &'static str = "BatchInterrupted"; + } + impl ::subxt::events::DecodeAsEvent for BatchInterrupted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Batch of dispatches completed fully with no error."] pub struct BatchCompleted; - impl ::subxt::ext::subxt_core::events::StaticEvent for BatchCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompleted"; + impl BatchCompleted { + const PALLET_NAME: &'static str = "Utility"; + const EVENT_NAME: &'static str = "BatchCompleted"; + } + impl ::subxt::events::DecodeAsEvent for BatchCompleted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Batch of dispatches completed but has errors."] pub struct BatchCompletedWithErrors; - impl ::subxt::ext::subxt_core::events::StaticEvent for BatchCompletedWithErrors { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompletedWithErrors"; + impl BatchCompletedWithErrors { + const PALLET_NAME: &'static str = "Utility"; + const EVENT_NAME: &'static str = "BatchCompletedWithErrors"; + } + impl ::subxt::events::DecodeAsEvent for BatchCompletedWithErrors { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A single item within a Batch of dispatches has completed with no error."] pub struct ItemCompleted; - impl ::subxt::ext::subxt_core::events::StaticEvent for ItemCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemCompleted"; + impl ItemCompleted { + const PALLET_NAME: &'static str = "Utility"; + const EVENT_NAME: &'static str = "ItemCompleted"; + } + impl ::subxt::events::DecodeAsEvent for ItemCompleted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A single item within a Batch of dispatches has completed with error."] pub struct ItemFailed { pub error: item_failed::Error, @@ -16388,17 +16644,22 @@ pub mod api { use super::runtime_types; pub type Error = runtime_types::sp_runtime::DispatchError; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ItemFailed { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemFailed"; + impl ItemFailed { + const PALLET_NAME: &'static str = "Utility"; + const EVENT_NAME: &'static str = "ItemFailed"; + } + impl ::subxt::events::DecodeAsEvent for ItemFailed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A call was dispatched."] pub struct DispatchedAs { pub result: dispatched_as::Result, @@ -16408,30 +16669,40 @@ pub mod api { pub type Result = ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DispatchedAs { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "DispatchedAs"; + impl DispatchedAs { + const PALLET_NAME: &'static str = "Utility"; + const EVENT_NAME: &'static str = "DispatchedAs"; + } + impl ::subxt::events::DecodeAsEvent for DispatchedAs { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Main call was dispatched."] pub struct IfElseMainSuccess; - impl ::subxt::ext::subxt_core::events::StaticEvent for IfElseMainSuccess { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "IfElseMainSuccess"; + impl IfElseMainSuccess { + const PALLET_NAME: &'static str = "Utility"; + const EVENT_NAME: &'static str = "IfElseMainSuccess"; + } + impl ::subxt::events::DecodeAsEvent for IfElseMainSuccess { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The fallback call was dispatched."] pub struct IfElseFallbackCalled { pub main_error: if_else_fallback_called::MainError, @@ -16440,9 +16711,14 @@ pub mod api { use super::runtime_types; pub type MainError = runtime_types::sp_runtime::DispatchError; } - impl ::subxt::ext::subxt_core::events::StaticEvent for IfElseFallbackCalled { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "IfElseFallbackCalled"; + impl IfElseFallbackCalled { + const PALLET_NAME: &'static str = "Utility"; + const EVENT_NAME: &'static str = "IfElseFallbackCalled"; + } + impl ::subxt::events::DecodeAsEvent for IfElseFallbackCalled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod constants { @@ -16452,10 +16728,8 @@ pub mod api { #[doc = " The limit on the number of batched calls."] pub fn batched_calls_limit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Utility", "batched_calls_limit", [ @@ -16479,1378 +16753,1370 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Add a registrar to the system."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] + #[doc = ""] + #[doc = "- `account`: the account of the registrar."] + #[doc = ""] + #[doc = "Emits `RegistrarAdded` if successful."] + pub struct AddRegistrar { + pub account: add_registrar::Account, + } + pub mod add_registrar { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Add a registrar to the system."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] - #[doc = ""] - #[doc = "- `account`: the account of the registrar."] - #[doc = ""] - #[doc = "Emits `RegistrarAdded` if successful."] - pub struct AddRegistrar { - pub account: add_registrar::Account, - } - pub mod add_registrar { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddRegistrar { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "add_registrar"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set an account's identity information and reserve the appropriate deposit."] - #[doc = ""] - #[doc = "If the account already has identity information, the deposit is taken as part payment"] - #[doc = "for the new deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `info`: The identity information."] - #[doc = ""] - #[doc = "Emits `IdentitySet` if successful."] - pub struct SetIdentity { - pub info: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod set_identity { - use super::runtime_types; - pub type Info = runtime_types::pallet_identity::legacy::IdentityInfo; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetIdentity { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "set_identity"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the sub-accounts of the sender."] - #[doc = ""] - #[doc = "Payment: Any aggregate balance reserved by previous `set_subs` calls will be returned"] - #[doc = "and an amount `SubAccountDeposit` will be reserved for each item in `subs`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "identity."] - #[doc = ""] - #[doc = "- `subs`: The identity's (new) sub-accounts."] - pub struct SetSubs { - pub subs: set_subs::Subs, - } - pub mod set_subs { - use super::runtime_types; - pub type Subs = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::pallet_identity::types::Data, - )>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetSubs { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "set_subs"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] - #[doc = ""] - #[doc = "Payment: All reserved balances on the account are returned."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "identity."] - #[doc = ""] - #[doc = "Emits `IdentityCleared` if successful."] - pub struct ClearIdentity; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClearIdentity { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "clear_identity"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Request a judgement from a registrar."] - #[doc = ""] - #[doc = "Payment: At most `max_fee` will be reserved for payment to the registrar if judgement"] - #[doc = "given."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] - #[doc = "registered identity."] - #[doc = ""] - #[doc = "- `reg_index`: The index of the registrar whose judgement is requested."] - #[doc = "- `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:"] - #[doc = ""] - #[doc = "```nocompile"] - #[doc = "Registrars::::get().get(reg_index).unwrap().fee"] - #[doc = "```"] - #[doc = ""] - #[doc = "Emits `JudgementRequested` if successful."] - pub struct RequestJudgement { - #[codec(compact)] - pub reg_index: request_judgement::RegIndex, - #[codec(compact)] - pub max_fee: request_judgement::MaxFee, - } - pub mod request_judgement { - use super::runtime_types; - pub type RegIndex = ::core::primitive::u32; - pub type MaxFee = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RequestJudgement { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "request_judgement"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel a previous request."] - #[doc = ""] - #[doc = "Payment: A previously reserved deposit is returned on success."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] - #[doc = "registered identity."] - #[doc = ""] - #[doc = "- `reg_index`: The index of the registrar whose judgement is no longer requested."] - #[doc = ""] - #[doc = "Emits `JudgementUnrequested` if successful."] - pub struct CancelRequest { - pub reg_index: cancel_request::RegIndex, - } - pub mod cancel_request { - use super::runtime_types; - pub type RegIndex = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRequest { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "cancel_request"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the fee required for a judgement to be requested from a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `fee`: the new fee."] - pub struct SetFee { - #[codec(compact)] - pub index: set_fee::Index, - #[codec(compact)] - pub fee: set_fee::Fee, - } - pub mod set_fee { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Fee = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetFee { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "set_fee"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Change the account associated with a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `new`: the new account ID."] - pub struct SetAccountId { - #[codec(compact)] - pub index: set_account_id::Index, - pub new: set_account_id::New, - } - pub mod set_account_id { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type New = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetAccountId { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "set_account_id"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the field information for a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `fields`: the fields that the registrar concerns themselves with."] - pub struct SetFields { - #[codec(compact)] - pub index: set_fields::Index, - pub fields: set_fields::Fields, - } - pub mod set_fields { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Fields = ::core::primitive::u64; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetFields { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "set_fields"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Provide a judgement for an account's identity."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `reg_index`."] - #[doc = ""] - #[doc = "- `reg_index`: the index of the registrar whose judgement is being made."] - #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] - #[doc = " with a registered identity."] - #[doc = "- `judgement`: the judgement of the registrar of index `reg_index` about `target`."] - #[doc = "- `identity`: The hash of the [`IdentityInformationProvider`] for that the judgement is"] - #[doc = " provided."] - #[doc = ""] - #[doc = "Note: Judgements do not apply to a username."] - #[doc = ""] - #[doc = "Emits `JudgementGiven` if successful."] - pub struct ProvideJudgement { - #[codec(compact)] - pub reg_index: provide_judgement::RegIndex, - pub target: provide_judgement::Target, - pub judgement: provide_judgement::Judgement, - pub identity: provide_judgement::Identity, - } - pub mod provide_judgement { - use super::runtime_types; - pub type RegIndex = ::core::primitive::u32; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Judgement = - runtime_types::pallet_identity::types::Judgement<::core::primitive::u128>; - pub type Identity = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ProvideJudgement { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "provide_judgement"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove an account's identity and sub-account information and slash the deposits."] - #[doc = ""] - #[doc = "Payment: Reserved balances from `set_subs` and `set_identity` are slashed and handled by"] - #[doc = "`Slash`. Verification request deposits are not returned; they should be cancelled"] - #[doc = "manually using `cancel_request`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - #[doc = ""] - #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] - #[doc = " with a registered identity."] - #[doc = ""] - #[doc = "Emits `IdentityKilled` if successful."] - pub struct KillIdentity { - pub target: kill_identity::Target, - } - pub mod kill_identity { - use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for KillIdentity { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "kill_identity"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Add the given account to the sender's subs."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - pub struct AddSub { - pub sub: add_sub::Sub, - pub data: add_sub::Data, - } - pub mod add_sub { - use super::runtime_types; - pub type Sub = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Data = runtime_types::pallet_identity::types::Data; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddSub { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "add_sub"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Alter the associated name of the given sub-account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - pub struct RenameSub { - pub sub: rename_sub::Sub, - pub data: rename_sub::Data, + pub type Account = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl AddRegistrar { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "add_registrar"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AddRegistrar { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod rename_sub { - use super::runtime_types; - pub type Sub = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Data = runtime_types::pallet_identity::types::Data; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set an account's identity information and reserve the appropriate deposit."] + #[doc = ""] + #[doc = "If the account already has identity information, the deposit is taken as part payment"] + #[doc = "for the new deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `info`: The identity information."] + #[doc = ""] + #[doc = "Emits `IdentitySet` if successful."] + pub struct SetIdentity { + pub info: ::subxt::alloc::boxed::Box, + } + pub mod set_identity { + use super::runtime_types; + pub type Info = runtime_types::pallet_identity::legacy::IdentityInfo; + } + impl SetIdentity { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "set_identity"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetIdentity { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RenameSub { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "rename_sub"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the sub-accounts of the sender."] + #[doc = ""] + #[doc = "Payment: Any aggregate balance reserved by previous `set_subs` calls will be returned"] + #[doc = "and an amount `SubAccountDeposit` will be reserved for each item in `subs`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "- `subs`: The identity's (new) sub-accounts."] + pub struct SetSubs { + pub subs: set_subs::Subs, + } + pub mod set_subs { + use super::runtime_types; + pub type Subs = ::subxt::alloc::vec::Vec<( + ::subxt::utils::AccountId32, + runtime_types::pallet_identity::types::Data, + )>; + } + impl SetSubs { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "set_subs"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetSubs { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove the given account from the sender's subs."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - pub struct RemoveSub { - pub sub: remove_sub::Sub, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] + #[doc = ""] + #[doc = "Payment: All reserved balances on the account are returned."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "Emits `IdentityCleared` if successful."] + pub struct ClearIdentity; + impl ClearIdentity { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "clear_identity"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ClearIdentity { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod remove_sub { - use super::runtime_types; - pub type Sub = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Request a judgement from a registrar."] + #[doc = ""] + #[doc = "Payment: At most `max_fee` will be reserved for payment to the registrar if judgement"] + #[doc = "given."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is requested."] + #[doc = "- `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:"] + #[doc = ""] + #[doc = "```nocompile"] + #[doc = "Registrars::::get().get(reg_index).unwrap().fee"] + #[doc = "```"] + #[doc = ""] + #[doc = "Emits `JudgementRequested` if successful."] + pub struct RequestJudgement { + #[codec(compact)] + pub reg_index: request_judgement::RegIndex, + #[codec(compact)] + pub max_fee: request_judgement::MaxFee, + } + pub mod request_judgement { + use super::runtime_types; + pub type RegIndex = ::core::primitive::u32; + pub type MaxFee = ::core::primitive::u128; + } + impl RequestJudgement { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "request_judgement"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RequestJudgement { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveSub { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "remove_sub"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel a previous request."] + #[doc = ""] + #[doc = "Payment: A previously reserved deposit is returned on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is no longer requested."] + #[doc = ""] + #[doc = "Emits `JudgementUnrequested` if successful."] + pub struct CancelRequest { + pub reg_index: cancel_request::RegIndex, + } + pub mod cancel_request { + use super::runtime_types; + pub type RegIndex = ::core::primitive::u32; + } + impl CancelRequest { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "cancel_request"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CancelRequest { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove the sender as a sub-account."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender (*not* the original depositor)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "super-identity."] - #[doc = ""] - #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] - #[doc = "controller of an account is maliciously registered as a sub-account."] - pub struct QuitSub; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for QuitSub { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "quit_sub"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the fee required for a judgement to be requested from a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fee`: the new fee."] + pub struct SetFee { + #[codec(compact)] + pub index: set_fee::Index, + #[codec(compact)] + pub fee: set_fee::Fee, + } + pub mod set_fee { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Fee = ::core::primitive::u128; + } + impl SetFee { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "set_fee"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetFee { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Add an `AccountId` with permission to grant usernames with a given `suffix` appended."] - #[doc = ""] - #[doc = "The authority can grant up to `allocation` usernames. To top up the allocation or"] - #[doc = "change the account used to grant usernames, this call can be used with the updated"] - #[doc = "parameters to overwrite the existing configuration."] - pub struct AddUsernameAuthority { - pub authority: add_username_authority::Authority, - pub suffix: add_username_authority::Suffix, - pub allocation: add_username_authority::Allocation, - } - pub mod add_username_authority { - use super::runtime_types; - pub type Authority = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Suffix = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Allocation = ::core::primitive::u32; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Change the account associated with a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `new`: the new account ID."] + pub struct SetAccountId { + #[codec(compact)] + pub index: set_account_id::Index, + pub new: set_account_id::New, + } + pub mod set_account_id { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type New = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl SetAccountId { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "set_account_id"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetAccountId { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddUsernameAuthority { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "add_username_authority"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the field information for a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fields`: the fields that the registrar concerns themselves with."] + pub struct SetFields { + #[codec(compact)] + pub index: set_fields::Index, + pub fields: set_fields::Fields, + } + pub mod set_fields { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Fields = ::core::primitive::u64; + } + impl SetFields { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "set_fields"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetFields { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove `authority` from the username authorities."] - pub struct RemoveUsernameAuthority { - pub suffix: remove_username_authority::Suffix, - pub authority: remove_username_authority::Authority, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Provide a judgement for an account's identity."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `reg_index`."] + #[doc = ""] + #[doc = "- `reg_index`: the index of the registrar whose judgement is being made."] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = "- `judgement`: the judgement of the registrar of index `reg_index` about `target`."] + #[doc = "- `identity`: The hash of the [`IdentityInformationProvider`] for that the judgement is"] + #[doc = " provided."] + #[doc = ""] + #[doc = "Note: Judgements do not apply to a username."] + #[doc = ""] + #[doc = "Emits `JudgementGiven` if successful."] + pub struct ProvideJudgement { + #[codec(compact)] + pub reg_index: provide_judgement::RegIndex, + pub target: provide_judgement::Target, + pub judgement: provide_judgement::Judgement, + pub identity: provide_judgement::Identity, + } + pub mod provide_judgement { + use super::runtime_types; + pub type RegIndex = ::core::primitive::u32; + pub type Target = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Judgement = + runtime_types::pallet_identity::types::Judgement<::core::primitive::u128>; + pub type Identity = ::subxt::utils::H256; + } + impl ProvideJudgement { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "provide_judgement"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ProvideJudgement { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod remove_username_authority { - use super::runtime_types; - pub type Suffix = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Authority = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove an account's identity and sub-account information and slash the deposits."] + #[doc = ""] + #[doc = "Payment: Reserved balances from `set_subs` and `set_identity` are slashed and handled by"] + #[doc = "`Slash`. Verification request deposits are not returned; they should be cancelled"] + #[doc = "manually using `cancel_request`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + #[doc = ""] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = ""] + #[doc = "Emits `IdentityKilled` if successful."] + pub struct KillIdentity { + pub target: kill_identity::Target, + } + pub mod kill_identity { + use super::runtime_types; + pub type Target = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl KillIdentity { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "kill_identity"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for KillIdentity { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveUsernameAuthority { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "remove_username_authority"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Add the given account to the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub struct AddSub { + pub sub: add_sub::Sub, + pub data: add_sub::Data, + } + pub mod add_sub { + use super::runtime_types; + pub type Sub = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Data = runtime_types::pallet_identity::types::Data; + } + impl AddSub { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "add_sub"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AddSub { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the username for `who`. Must be called by a username authority."] - #[doc = ""] - #[doc = "If `use_allocation` is set, the authority must have a username allocation available to"] - #[doc = "spend. Otherwise, the authority will need to put up a deposit for registering the"] - #[doc = "username."] - #[doc = ""] - #[doc = "Users can either pre-sign their usernames or"] - #[doc = "accept them later."] - #[doc = ""] - #[doc = "Usernames must:"] - #[doc = " - Only contain lowercase ASCII characters or digits."] - #[doc = " - When combined with the suffix of the issuing authority be _less than_ the"] - #[doc = " `MaxUsernameLength`."] - pub struct SetUsernameFor { - pub who: set_username_for::Who, - pub username: set_username_for::Username, - pub signature: set_username_for::Signature, - pub use_allocation: set_username_for::UseAllocation, - } - pub mod set_username_for { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Username = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Signature = - ::core::option::Option; - pub type UseAllocation = ::core::primitive::bool; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Alter the associated name of the given sub-account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub struct RenameSub { + pub sub: rename_sub::Sub, + pub data: rename_sub::Data, + } + pub mod rename_sub { + use super::runtime_types; + pub type Sub = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Data = runtime_types::pallet_identity::types::Data; + } + impl RenameSub { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "rename_sub"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RenameSub { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetUsernameFor { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "set_username_for"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove the given account from the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub struct RemoveSub { + pub sub: remove_sub::Sub, + } + pub mod remove_sub { + use super::runtime_types; + pub type Sub = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl RemoveSub { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "remove_sub"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveSub { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Accept a given username that an `authority` granted. The call must include the full"] - #[doc = "username, as in `username.suffix`."] - pub struct AcceptUsername { - pub username: accept_username::Username, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove the sender as a sub-account."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender (*not* the original depositor)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "super-identity."] + #[doc = ""] + #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] + #[doc = "controller of an account is maliciously registered as a sub-account."] + pub struct QuitSub; + impl QuitSub { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "quit_sub"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for QuitSub { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod accept_username { - use super::runtime_types; - pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Add an `AccountId` with permission to grant usernames with a given `suffix` appended."] + #[doc = ""] + #[doc = "The authority can grant up to `allocation` usernames. To top up the allocation or"] + #[doc = "change the account used to grant usernames, this call can be used with the updated"] + #[doc = "parameters to overwrite the existing configuration."] + pub struct AddUsernameAuthority { + pub authority: add_username_authority::Authority, + pub suffix: add_username_authority::Suffix, + pub allocation: add_username_authority::Allocation, + } + pub mod add_username_authority { + use super::runtime_types; + pub type Authority = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Suffix = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + pub type Allocation = ::core::primitive::u32; + } + impl AddUsernameAuthority { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "add_username_authority"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AddUsernameAuthority { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AcceptUsername { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "accept_username"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove `authority` from the username authorities."] + pub struct RemoveUsernameAuthority { + pub suffix: remove_username_authority::Suffix, + pub authority: remove_username_authority::Authority, + } + pub mod remove_username_authority { + use super::runtime_types; + pub type Suffix = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + pub type Authority = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl RemoveUsernameAuthority { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "remove_username_authority"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveUsernameAuthority { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove an expired username approval. The username was approved by an authority but never"] - #[doc = "accepted by the user and must now be beyond its expiration. The call must include the"] - #[doc = "full username, as in `username.suffix`."] - pub struct RemoveExpiredApproval { - pub username: remove_expired_approval::Username, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the username for `who`. Must be called by a username authority."] + #[doc = ""] + #[doc = "If `use_allocation` is set, the authority must have a username allocation available to"] + #[doc = "spend. Otherwise, the authority will need to put up a deposit for registering the"] + #[doc = "username."] + #[doc = ""] + #[doc = "Users can either pre-sign their usernames or"] + #[doc = "accept them later."] + #[doc = ""] + #[doc = "Usernames must:"] + #[doc = " - Only contain lowercase ASCII characters or digits."] + #[doc = " - When combined with the suffix of the issuing authority be _less than_ the"] + #[doc = " `MaxUsernameLength`."] + pub struct SetUsernameFor { + pub who: set_username_for::Who, + pub username: set_username_for::Username, + pub signature: set_username_for::Signature, + pub use_allocation: set_username_for::UseAllocation, + } + pub mod set_username_for { + use super::runtime_types; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Username = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + pub type Signature = + ::core::option::Option; + pub type UseAllocation = ::core::primitive::bool; + } + impl SetUsernameFor { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "set_username_for"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetUsernameFor { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod remove_expired_approval { - use super::runtime_types; - pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Accept a given username that an `authority` granted. The call must include the full"] + #[doc = "username, as in `username.suffix`."] + pub struct AcceptUsername { + pub username: accept_username::Username, + } + pub mod accept_username { + use super::runtime_types; + pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + impl AcceptUsername { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "accept_username"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AcceptUsername { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveExpiredApproval { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "remove_expired_approval"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove an expired username approval. The username was approved by an authority but never"] + #[doc = "accepted by the user and must now be beyond its expiration. The call must include the"] + #[doc = "full username, as in `username.suffix`."] + pub struct RemoveExpiredApproval { + pub username: remove_expired_approval::Username, + } + pub mod remove_expired_approval { + use super::runtime_types; + pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + impl RemoveExpiredApproval { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "remove_expired_approval"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveExpiredApproval { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set a given username as the primary. The username should include the suffix."] - pub struct SetPrimaryUsername { - pub username: set_primary_username::Username, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set a given username as the primary. The username should include the suffix."] + pub struct SetPrimaryUsername { + pub username: set_primary_username::Username, + } + pub mod set_primary_username { + use super::runtime_types; + pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + impl SetPrimaryUsername { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "set_primary_username"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetPrimaryUsername { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod set_primary_username { - use super::runtime_types; - pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Start the process of removing a username by placing it in the unbinding usernames map."] + #[doc = "Once the grace period has passed, the username can be deleted by calling"] + #[doc = "[remove_username](crate::Call::remove_username)."] + pub struct UnbindUsername { + pub username: unbind_username::Username, + } + pub mod unbind_username { + use super::runtime_types; + pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + impl UnbindUsername { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "unbind_username"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for UnbindUsername { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetPrimaryUsername { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "set_primary_username"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Permanently delete a username which has been unbinding for longer than the grace period."] + #[doc = "Caller is refunded the fee if the username expired and the removal was successful."] + pub struct RemoveUsername { + pub username: remove_username::Username, + } + pub mod remove_username { + use super::runtime_types; + pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + impl RemoveUsername { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "remove_username"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveUsername { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Start the process of removing a username by placing it in the unbinding usernames map."] - #[doc = "Once the grace period has passed, the username can be deleted by calling"] - #[doc = "[remove_username](crate::Call::remove_username)."] - pub struct UnbindUsername { - pub username: unbind_username::Username, - } - pub mod unbind_username { - use super::runtime_types; - pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnbindUsername { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "unbind_username"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Permanently delete a username which has been unbinding for longer than the grace period."] - #[doc = "Caller is refunded the fee if the username expired and the removal was successful."] - pub struct RemoveUsername { - pub username: remove_username::Username, - } - pub mod remove_username { - use super::runtime_types; - pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveUsername { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "remove_username"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Call with [ForceOrigin](crate::Config::ForceOrigin) privileges which deletes a username"] - #[doc = "and slashes any deposit associated with it."] - pub struct KillUsername { - pub username: kill_username::Username, - } - pub mod kill_username { - use super::runtime_types; - pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for KillUsername { - const PALLET: &'static str = "Identity"; - const CALL: &'static str = "kill_username"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Call with [ForceOrigin](crate::Config::ForceOrigin) privileges which deletes a username"] + #[doc = "and slashes any deposit associated with it."] + pub struct KillUsername { + pub username: kill_username::Username, + } + pub mod kill_username { + use super::runtime_types; + pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + impl KillUsername { + const PALLET_NAME: &'static str = "Identity"; + const CALL_NAME: &'static str = "kill_username"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for KillUsername { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Add a registrar to the system."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] - #[doc = ""] - #[doc = "- `account`: the account of the registrar."] - #[doc = ""] - #[doc = "Emits `RegistrarAdded` if successful."] - pub fn add_registrar( - &self, - account: types::add_registrar::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "add_registrar", - types::AddRegistrar { account }, - [ - 6u8, 131u8, 82u8, 191u8, 37u8, 240u8, 158u8, 187u8, 247u8, 98u8, 175u8, - 200u8, 147u8, 78u8, 88u8, 176u8, 227u8, 179u8, 184u8, 194u8, 91u8, 1u8, - 1u8, 20u8, 121u8, 4u8, 96u8, 94u8, 103u8, 140u8, 247u8, 253u8, - ], - ) - } - #[doc = "Set an account's identity information and reserve the appropriate deposit."] - #[doc = ""] - #[doc = "If the account already has identity information, the deposit is taken as part payment"] - #[doc = "for the new deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `info`: The identity information."] - #[doc = ""] - #[doc = "Emits `IdentitySet` if successful."] - pub fn set_identity( - &self, - info: types::set_identity::Info, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "set_identity", - types::SetIdentity { - info: ::subxt::ext::subxt_core::alloc::boxed::Box::new(info), - }, - [ - 18u8, 86u8, 67u8, 10u8, 116u8, 254u8, 94u8, 95u8, 166u8, 30u8, 204u8, - 189u8, 174u8, 70u8, 191u8, 255u8, 149u8, 93u8, 156u8, 120u8, 105u8, - 138u8, 199u8, 181u8, 43u8, 150u8, 143u8, 254u8, 182u8, 81u8, 86u8, - 45u8, - ], - ) - } - #[doc = "Set the sub-accounts of the sender."] - #[doc = ""] - #[doc = "Payment: Any aggregate balance reserved by previous `set_subs` calls will be returned"] - #[doc = "and an amount `SubAccountDeposit` will be reserved for each item in `subs`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "identity."] - #[doc = ""] - #[doc = "- `subs`: The identity's (new) sub-accounts."] - pub fn set_subs( - &self, - subs: types::set_subs::Subs, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "set_subs", - types::SetSubs { subs }, - [ - 34u8, 184u8, 18u8, 155u8, 112u8, 247u8, 235u8, 75u8, 209u8, 236u8, - 21u8, 238u8, 43u8, 237u8, 223u8, 147u8, 48u8, 6u8, 39u8, 231u8, 174u8, - 164u8, 243u8, 184u8, 220u8, 151u8, 165u8, 69u8, 219u8, 122u8, 234u8, - 100u8, - ], - ) - } - #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] - #[doc = ""] - #[doc = "Payment: All reserved balances on the account are returned."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "identity."] - #[doc = ""] - #[doc = "Emits `IdentityCleared` if successful."] - pub fn clear_identity( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "clear_identity", - types::ClearIdentity {}, - [ - 43u8, 115u8, 205u8, 44u8, 24u8, 130u8, 220u8, 69u8, 247u8, 176u8, - 200u8, 175u8, 67u8, 183u8, 36u8, 200u8, 162u8, 132u8, 242u8, 25u8, - 21u8, 106u8, 197u8, 219u8, 141u8, 51u8, 204u8, 13u8, 191u8, 201u8, - 31u8, 31u8, - ], - ) - } - #[doc = "Request a judgement from a registrar."] - #[doc = ""] - #[doc = "Payment: At most `max_fee` will be reserved for payment to the registrar if judgement"] - #[doc = "given."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] - #[doc = "registered identity."] - #[doc = ""] - #[doc = "- `reg_index`: The index of the registrar whose judgement is requested."] - #[doc = "- `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:"] - #[doc = ""] - #[doc = "```nocompile"] - #[doc = "Registrars::::get().get(reg_index).unwrap().fee"] - #[doc = "```"] - #[doc = ""] - #[doc = "Emits `JudgementRequested` if successful."] - pub fn request_judgement( - &self, - reg_index: types::request_judgement::RegIndex, - max_fee: types::request_judgement::MaxFee, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "request_judgement", - types::RequestJudgement { reg_index, max_fee }, - [ - 83u8, 85u8, 55u8, 184u8, 14u8, 54u8, 49u8, 212u8, 26u8, 148u8, 33u8, - 147u8, 182u8, 54u8, 180u8, 12u8, 61u8, 179u8, 216u8, 157u8, 103u8, - 52u8, 120u8, 252u8, 83u8, 203u8, 144u8, 65u8, 15u8, 3u8, 21u8, 33u8, - ], - ) - } - #[doc = "Cancel a previous request."] - #[doc = ""] - #[doc = "Payment: A previously reserved deposit is returned on success."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] - #[doc = "registered identity."] - #[doc = ""] - #[doc = "- `reg_index`: The index of the registrar whose judgement is no longer requested."] - #[doc = ""] - #[doc = "Emits `JudgementUnrequested` if successful."] - pub fn cancel_request( - &self, - reg_index: types::cancel_request::RegIndex, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "cancel_request", - types::CancelRequest { reg_index }, - [ - 81u8, 14u8, 133u8, 219u8, 43u8, 84u8, 163u8, 208u8, 21u8, 185u8, 75u8, - 117u8, 126u8, 33u8, 210u8, 106u8, 122u8, 210u8, 35u8, 207u8, 104u8, - 206u8, 41u8, 117u8, 247u8, 108u8, 56u8, 23u8, 123u8, 169u8, 169u8, - 61u8, - ], - ) - } - #[doc = "Set the fee required for a judgement to be requested from a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `fee`: the new fee."] - pub fn set_fee( - &self, - index: types::set_fee::Index, - fee: types::set_fee::Fee, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "set_fee", - types::SetFee { index, fee }, - [ - 131u8, 20u8, 17u8, 127u8, 180u8, 65u8, 225u8, 144u8, 193u8, 60u8, - 131u8, 241u8, 30u8, 149u8, 8u8, 76u8, 29u8, 52u8, 102u8, 108u8, 127u8, - 130u8, 70u8, 18u8, 94u8, 145u8, 179u8, 109u8, 252u8, 219u8, 58u8, - 163u8, - ], - ) - } - #[doc = "Change the account associated with a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `new`: the new account ID."] - pub fn set_account_id( - &self, - index: types::set_account_id::Index, - new: types::set_account_id::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "set_account_id", - types::SetAccountId { index, new }, - [ - 68u8, 57u8, 39u8, 134u8, 39u8, 82u8, 156u8, 107u8, 113u8, 99u8, 9u8, - 163u8, 58u8, 249u8, 247u8, 208u8, 38u8, 203u8, 54u8, 153u8, 116u8, - 143u8, 81u8, 46u8, 228u8, 149u8, 127u8, 115u8, 252u8, 83u8, 33u8, - 101u8, - ], - ) - } - #[doc = "Set the field information for a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `fields`: the fields that the registrar concerns themselves with."] - pub fn set_fields( - &self, - index: types::set_fields::Index, - fields: types::set_fields::Fields, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "set_fields", - types::SetFields { index, fields }, - [ - 75u8, 38u8, 58u8, 93u8, 92u8, 164u8, 146u8, 146u8, 183u8, 245u8, 135u8, - 235u8, 12u8, 148u8, 37u8, 193u8, 58u8, 66u8, 173u8, 223u8, 166u8, - 169u8, 54u8, 159u8, 141u8, 36u8, 25u8, 231u8, 190u8, 211u8, 254u8, - 38u8, - ], - ) - } - #[doc = "Provide a judgement for an account's identity."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `reg_index`."] - #[doc = ""] - #[doc = "- `reg_index`: the index of the registrar whose judgement is being made."] - #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] - #[doc = " with a registered identity."] - #[doc = "- `judgement`: the judgement of the registrar of index `reg_index` about `target`."] - #[doc = "- `identity`: The hash of the [`IdentityInformationProvider`] for that the judgement is"] - #[doc = " provided."] - #[doc = ""] - #[doc = "Note: Judgements do not apply to a username."] - #[doc = ""] - #[doc = "Emits `JudgementGiven` if successful."] - pub fn provide_judgement( - &self, - reg_index: types::provide_judgement::RegIndex, - target: types::provide_judgement::Target, - judgement: types::provide_judgement::Judgement, - identity: types::provide_judgement::Identity, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "provide_judgement", - types::ProvideJudgement { - reg_index, - target, - judgement, - identity, - }, - [ - 145u8, 188u8, 61u8, 236u8, 183u8, 49u8, 49u8, 149u8, 240u8, 184u8, - 202u8, 75u8, 69u8, 0u8, 95u8, 103u8, 132u8, 24u8, 107u8, 221u8, 236u8, - 75u8, 231u8, 125u8, 39u8, 189u8, 45u8, 202u8, 116u8, 123u8, 236u8, - 96u8, - ], - ) - } - #[doc = "Remove an account's identity and sub-account information and slash the deposits."] - #[doc = ""] - #[doc = "Payment: Reserved balances from `set_subs` and `set_identity` are slashed and handled by"] - #[doc = "`Slash`. Verification request deposits are not returned; they should be cancelled"] - #[doc = "manually using `cancel_request`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - #[doc = ""] - #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] - #[doc = " with a registered identity."] - #[doc = ""] - #[doc = "Emits `IdentityKilled` if successful."] - pub fn kill_identity( - &self, - target: types::kill_identity::Target, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "kill_identity", - types::KillIdentity { target }, - [ - 114u8, 249u8, 102u8, 62u8, 118u8, 105u8, 185u8, 61u8, 173u8, 52u8, - 57u8, 190u8, 102u8, 74u8, 108u8, 239u8, 142u8, 176u8, 116u8, 51u8, - 49u8, 197u8, 6u8, 183u8, 248u8, 202u8, 202u8, 140u8, 134u8, 59u8, - 103u8, 182u8, - ], - ) - } - #[doc = "Add the given account to the sender's subs."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - pub fn add_sub( - &self, - sub: types::add_sub::Sub, - data: types::add_sub::Data, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "add_sub", - types::AddSub { sub, data }, - [ - 3u8, 65u8, 137u8, 35u8, 238u8, 133u8, 56u8, 233u8, 37u8, 125u8, 221u8, - 186u8, 153u8, 74u8, 69u8, 196u8, 244u8, 82u8, 51u8, 7u8, 216u8, 29u8, - 18u8, 16u8, 198u8, 184u8, 0u8, 181u8, 71u8, 227u8, 144u8, 33u8, - ], - ) - } - #[doc = "Alter the associated name of the given sub-account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - pub fn rename_sub( - &self, - sub: types::rename_sub::Sub, - data: types::rename_sub::Data, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "rename_sub", - types::RenameSub { sub, data }, - [ - 252u8, 50u8, 201u8, 112u8, 49u8, 248u8, 223u8, 239u8, 219u8, 226u8, - 64u8, 68u8, 227u8, 20u8, 30u8, 24u8, 36u8, 77u8, 26u8, 235u8, 144u8, - 240u8, 11u8, 111u8, 145u8, 167u8, 184u8, 207u8, 173u8, 58u8, 152u8, - 202u8, - ], - ) - } - #[doc = "Remove the given account from the sender's subs."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - pub fn remove_sub( - &self, - sub: types::remove_sub::Sub, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "remove_sub", - types::RemoveSub { sub }, - [ - 95u8, 249u8, 171u8, 27u8, 100u8, 186u8, 67u8, 214u8, 226u8, 6u8, 118u8, - 39u8, 91u8, 122u8, 1u8, 87u8, 1u8, 226u8, 101u8, 9u8, 199u8, 167u8, - 84u8, 202u8, 141u8, 196u8, 80u8, 195u8, 15u8, 114u8, 140u8, 144u8, - ], - ) - } - #[doc = "Remove the sender as a sub-account."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender (*not* the original depositor)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "super-identity."] - #[doc = ""] - #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] - #[doc = "controller of an account is maliciously registered as a sub-account."] - pub fn quit_sub( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "quit_sub", - types::QuitSub {}, - [ - 147u8, 131u8, 175u8, 171u8, 187u8, 201u8, 240u8, 26u8, 146u8, 224u8, - 74u8, 166u8, 242u8, 193u8, 204u8, 247u8, 168u8, 93u8, 18u8, 32u8, 27u8, - 208u8, 149u8, 146u8, 179u8, 172u8, 75u8, 112u8, 84u8, 141u8, 233u8, - 223u8, - ], - ) - } - #[doc = "Add an `AccountId` with permission to grant usernames with a given `suffix` appended."] - #[doc = ""] - #[doc = "The authority can grant up to `allocation` usernames. To top up the allocation or"] - #[doc = "change the account used to grant usernames, this call can be used with the updated"] - #[doc = "parameters to overwrite the existing configuration."] - pub fn add_username_authority( - &self, - authority: types::add_username_authority::Authority, - suffix: types::add_username_authority::Suffix, - allocation: types::add_username_authority::Allocation, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "add_username_authority", - types::AddUsernameAuthority { - authority, - suffix, - allocation, - }, - [ - 225u8, 197u8, 122u8, 209u8, 206u8, 241u8, 247u8, 232u8, 196u8, 110u8, - 75u8, 157u8, 44u8, 181u8, 35u8, 75u8, 182u8, 219u8, 100u8, 64u8, 208u8, - 112u8, 120u8, 229u8, 211u8, 69u8, 193u8, 214u8, 195u8, 98u8, 10u8, - 25u8, - ], - ) - } - #[doc = "Remove `authority` from the username authorities."] - pub fn remove_username_authority( - &self, - suffix: types::remove_username_authority::Suffix, - authority: types::remove_username_authority::Authority, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RemoveUsernameAuthority, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "remove_username_authority", - types::RemoveUsernameAuthority { suffix, authority }, - [ - 97u8, 5u8, 0u8, 114u8, 226u8, 202u8, 96u8, 101u8, 141u8, 79u8, 242u8, - 232u8, 203u8, 98u8, 24u8, 18u8, 133u8, 168u8, 153u8, 14u8, 50u8, 17u8, - 92u8, 9u8, 157u8, 251u8, 214u8, 214u8, 146u8, 140u8, 28u8, 6u8, - ], - ) - } - #[doc = "Set the username for `who`. Must be called by a username authority."] - #[doc = ""] - #[doc = "If `use_allocation` is set, the authority must have a username allocation available to"] - #[doc = "spend. Otherwise, the authority will need to put up a deposit for registering the"] - #[doc = "username."] - #[doc = ""] - #[doc = "Users can either pre-sign their usernames or"] - #[doc = "accept them later."] - #[doc = ""] - #[doc = "Usernames must:"] - #[doc = " - Only contain lowercase ASCII characters or digits."] - #[doc = " - When combined with the suffix of the issuing authority be _less than_ the"] - #[doc = " `MaxUsernameLength`."] - pub fn set_username_for( - &self, - who: types::set_username_for::Who, - username: types::set_username_for::Username, - signature: types::set_username_for::Signature, - use_allocation: types::set_username_for::UseAllocation, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "set_username_for", - types::SetUsernameFor { - who, - username, - signature, - use_allocation, - }, - [ - 129u8, 186u8, 207u8, 39u8, 40u8, 3u8, 51u8, 218u8, 133u8, 145u8, 95u8, - 35u8, 105u8, 65u8, 134u8, 71u8, 104u8, 238u8, 17u8, 165u8, 130u8, 43u8, - 85u8, 246u8, 59u8, 136u8, 110u8, 25u8, 196u8, 213u8, 171u8, 16u8, - ], - ) - } - #[doc = "Accept a given username that an `authority` granted. The call must include the full"] - #[doc = "username, as in `username.suffix`."] - pub fn accept_username( - &self, - username: types::accept_username::Username, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "accept_username", - types::AcceptUsername { username }, - [ - 247u8, 162u8, 83u8, 250u8, 214u8, 7u8, 12u8, 253u8, 227u8, 4u8, 95u8, - 71u8, 150u8, 218u8, 216u8, 86u8, 137u8, 37u8, 114u8, 188u8, 18u8, - 232u8, 229u8, 179u8, 172u8, 251u8, 70u8, 29u8, 18u8, 86u8, 33u8, 129u8, - ], - ) - } - #[doc = "Remove an expired username approval. The username was approved by an authority but never"] - #[doc = "accepted by the user and must now be beyond its expiration. The call must include the"] - #[doc = "full username, as in `username.suffix`."] - pub fn remove_expired_approval( - &self, - username: types::remove_expired_approval::Username, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RemoveExpiredApproval, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "remove_expired_approval", - types::RemoveExpiredApproval { username }, - [ - 159u8, 171u8, 27u8, 97u8, 224u8, 171u8, 14u8, 89u8, 65u8, 213u8, 208u8, - 67u8, 118u8, 146u8, 0u8, 131u8, 82u8, 186u8, 142u8, 52u8, 173u8, 90u8, - 104u8, 107u8, 114u8, 202u8, 123u8, 222u8, 49u8, 53u8, 59u8, 61u8, - ], - ) - } - #[doc = "Set a given username as the primary. The username should include the suffix."] - pub fn set_primary_username( - &self, - username: types::set_primary_username::Username, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "set_primary_username", - types::SetPrimaryUsername { username }, - [ - 3u8, 25u8, 56u8, 26u8, 108u8, 165u8, 84u8, 231u8, 16u8, 4u8, 6u8, - 232u8, 141u8, 7u8, 254u8, 50u8, 26u8, 230u8, 66u8, 245u8, 255u8, 101u8, - 183u8, 234u8, 197u8, 186u8, 132u8, 197u8, 251u8, 84u8, 212u8, 162u8, - ], - ) - } - #[doc = "Start the process of removing a username by placing it in the unbinding usernames map."] - #[doc = "Once the grace period has passed, the username can be deleted by calling"] - #[doc = "[remove_username](crate::Call::remove_username)."] - pub fn unbind_username( - &self, - username: types::unbind_username::Username, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "unbind_username", - types::UnbindUsername { username }, - [ - 231u8, 59u8, 154u8, 107u8, 195u8, 183u8, 146u8, 12u8, 232u8, 249u8, - 119u8, 51u8, 99u8, 223u8, 197u8, 231u8, 249u8, 66u8, 189u8, 148u8, - 207u8, 163u8, 192u8, 150u8, 151u8, 111u8, 86u8, 170u8, 123u8, 194u8, - 141u8, 251u8, - ], - ) - } - #[doc = "Permanently delete a username which has been unbinding for longer than the grace period."] - #[doc = "Caller is refunded the fee if the username expired and the removal was successful."] - pub fn remove_username( - &self, - username: types::remove_username::Username, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "remove_username", - types::RemoveUsername { username }, - [ - 68u8, 30u8, 96u8, 37u8, 56u8, 235u8, 48u8, 61u8, 77u8, 235u8, 6u8, 4u8, - 123u8, 85u8, 176u8, 90u8, 255u8, 196u8, 178u8, 190u8, 230u8, 228u8, - 70u8, 141u8, 156u8, 156u8, 34u8, 7u8, 177u8, 204u8, 152u8, 145u8, - ], - ) - } - #[doc = "Call with [ForceOrigin](crate::Config::ForceOrigin) privileges which deletes a username"] - #[doc = "and slashes any deposit associated with it."] - pub fn kill_username( - &self, - username: types::kill_username::Username, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Identity", - "kill_username", - types::KillUsername { username }, - [ - 147u8, 229u8, 92u8, 195u8, 22u8, 114u8, 25u8, 16u8, 125u8, 80u8, 226u8, - 188u8, 47u8, 199u8, 13u8, 245u8, 60u8, 93u8, 84u8, 97u8, 82u8, 238u8, - 248u8, 44u8, 171u8, 132u8, 66u8, 0u8, 151u8, 108u8, 96u8, 25u8, - ], - ) + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Add a registrar to the system."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] + #[doc = ""] + #[doc = "- `account`: the account of the registrar."] + #[doc = ""] + #[doc = "Emits `RegistrarAdded` if successful."] + pub fn add_registrar( + &self, + account: super::add_registrar::Account, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "add_registrar", + super::AddRegistrar { account }, + [ + 6u8, 131u8, 82u8, 191u8, 37u8, 240u8, 158u8, 187u8, 247u8, 98u8, + 175u8, 200u8, 147u8, 78u8, 88u8, 176u8, 227u8, 179u8, 184u8, 194u8, + 91u8, 1u8, 1u8, 20u8, 121u8, 4u8, 96u8, 94u8, 103u8, 140u8, 247u8, + 253u8, + ], + ) + } + #[doc = "Set an account's identity information and reserve the appropriate deposit."] + #[doc = ""] + #[doc = "If the account already has identity information, the deposit is taken as part payment"] + #[doc = "for the new deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `info`: The identity information."] + #[doc = ""] + #[doc = "Emits `IdentitySet` if successful."] + pub fn set_identity( + &self, + info: super::set_identity::Info, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "set_identity", + super::SetIdentity { + info: ::subxt::alloc::boxed::Box::new(info), + }, + [ + 18u8, 86u8, 67u8, 10u8, 116u8, 254u8, 94u8, 95u8, 166u8, 30u8, + 204u8, 189u8, 174u8, 70u8, 191u8, 255u8, 149u8, 93u8, 156u8, 120u8, + 105u8, 138u8, 199u8, 181u8, 43u8, 150u8, 143u8, 254u8, 182u8, 81u8, + 86u8, 45u8, + ], + ) + } + #[doc = "Set the sub-accounts of the sender."] + #[doc = ""] + #[doc = "Payment: Any aggregate balance reserved by previous `set_subs` calls will be returned"] + #[doc = "and an amount `SubAccountDeposit` will be reserved for each item in `subs`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "- `subs`: The identity's (new) sub-accounts."] + pub fn set_subs( + &self, + subs: super::set_subs::Subs, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "set_subs", + super::SetSubs { subs }, + [ + 34u8, 184u8, 18u8, 155u8, 112u8, 247u8, 235u8, 75u8, 209u8, 236u8, + 21u8, 238u8, 43u8, 237u8, 223u8, 147u8, 48u8, 6u8, 39u8, 231u8, + 174u8, 164u8, 243u8, 184u8, 220u8, 151u8, 165u8, 69u8, 219u8, + 122u8, 234u8, 100u8, + ], + ) + } + #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] + #[doc = ""] + #[doc = "Payment: All reserved balances on the account are returned."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "Emits `IdentityCleared` if successful."] + pub fn clear_identity( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "clear_identity", + super::ClearIdentity {}, + [ + 43u8, 115u8, 205u8, 44u8, 24u8, 130u8, 220u8, 69u8, 247u8, 176u8, + 200u8, 175u8, 67u8, 183u8, 36u8, 200u8, 162u8, 132u8, 242u8, 25u8, + 21u8, 106u8, 197u8, 219u8, 141u8, 51u8, 204u8, 13u8, 191u8, 201u8, + 31u8, 31u8, + ], + ) + } + #[doc = "Request a judgement from a registrar."] + #[doc = ""] + #[doc = "Payment: At most `max_fee` will be reserved for payment to the registrar if judgement"] + #[doc = "given."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is requested."] + #[doc = "- `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:"] + #[doc = ""] + #[doc = "```nocompile"] + #[doc = "Registrars::::get().get(reg_index).unwrap().fee"] + #[doc = "```"] + #[doc = ""] + #[doc = "Emits `JudgementRequested` if successful."] + pub fn request_judgement( + &self, + reg_index: super::request_judgement::RegIndex, + max_fee: super::request_judgement::MaxFee, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "request_judgement", + super::RequestJudgement { reg_index, max_fee }, + [ + 83u8, 85u8, 55u8, 184u8, 14u8, 54u8, 49u8, 212u8, 26u8, 148u8, + 33u8, 147u8, 182u8, 54u8, 180u8, 12u8, 61u8, 179u8, 216u8, 157u8, + 103u8, 52u8, 120u8, 252u8, 83u8, 203u8, 144u8, 65u8, 15u8, 3u8, + 21u8, 33u8, + ], + ) + } + #[doc = "Cancel a previous request."] + #[doc = ""] + #[doc = "Payment: A previously reserved deposit is returned on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is no longer requested."] + #[doc = ""] + #[doc = "Emits `JudgementUnrequested` if successful."] + pub fn cancel_request( + &self, + reg_index: super::cancel_request::RegIndex, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "cancel_request", + super::CancelRequest { reg_index }, + [ + 81u8, 14u8, 133u8, 219u8, 43u8, 84u8, 163u8, 208u8, 21u8, 185u8, + 75u8, 117u8, 126u8, 33u8, 210u8, 106u8, 122u8, 210u8, 35u8, 207u8, + 104u8, 206u8, 41u8, 117u8, 247u8, 108u8, 56u8, 23u8, 123u8, 169u8, + 169u8, 61u8, + ], + ) + } + #[doc = "Set the fee required for a judgement to be requested from a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fee`: the new fee."] + pub fn set_fee( + &self, + index: super::set_fee::Index, + fee: super::set_fee::Fee, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "set_fee", + super::SetFee { index, fee }, + [ + 131u8, 20u8, 17u8, 127u8, 180u8, 65u8, 225u8, 144u8, 193u8, 60u8, + 131u8, 241u8, 30u8, 149u8, 8u8, 76u8, 29u8, 52u8, 102u8, 108u8, + 127u8, 130u8, 70u8, 18u8, 94u8, 145u8, 179u8, 109u8, 252u8, 219u8, + 58u8, 163u8, + ], + ) + } + #[doc = "Change the account associated with a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `new`: the new account ID."] + pub fn set_account_id( + &self, + index: super::set_account_id::Index, + new: super::set_account_id::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "set_account_id", + super::SetAccountId { index, new }, + [ + 68u8, 57u8, 39u8, 134u8, 39u8, 82u8, 156u8, 107u8, 113u8, 99u8, + 9u8, 163u8, 58u8, 249u8, 247u8, 208u8, 38u8, 203u8, 54u8, 153u8, + 116u8, 143u8, 81u8, 46u8, 228u8, 149u8, 127u8, 115u8, 252u8, 83u8, + 33u8, 101u8, + ], + ) + } + #[doc = "Set the field information for a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fields`: the fields that the registrar concerns themselves with."] + pub fn set_fields( + &self, + index: super::set_fields::Index, + fields: super::set_fields::Fields, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "set_fields", + super::SetFields { index, fields }, + [ + 75u8, 38u8, 58u8, 93u8, 92u8, 164u8, 146u8, 146u8, 183u8, 245u8, + 135u8, 235u8, 12u8, 148u8, 37u8, 193u8, 58u8, 66u8, 173u8, 223u8, + 166u8, 169u8, 54u8, 159u8, 141u8, 36u8, 25u8, 231u8, 190u8, 211u8, + 254u8, 38u8, + ], + ) + } + #[doc = "Provide a judgement for an account's identity."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `reg_index`."] + #[doc = ""] + #[doc = "- `reg_index`: the index of the registrar whose judgement is being made."] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = "- `judgement`: the judgement of the registrar of index `reg_index` about `target`."] + #[doc = "- `identity`: The hash of the [`IdentityInformationProvider`] for that the judgement is"] + #[doc = " provided."] + #[doc = ""] + #[doc = "Note: Judgements do not apply to a username."] + #[doc = ""] + #[doc = "Emits `JudgementGiven` if successful."] + pub fn provide_judgement( + &self, + reg_index: super::provide_judgement::RegIndex, + target: super::provide_judgement::Target, + judgement: super::provide_judgement::Judgement, + identity: super::provide_judgement::Identity, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "provide_judgement", + super::ProvideJudgement { + reg_index, + target, + judgement, + identity, + }, + [ + 145u8, 188u8, 61u8, 236u8, 183u8, 49u8, 49u8, 149u8, 240u8, 184u8, + 202u8, 75u8, 69u8, 0u8, 95u8, 103u8, 132u8, 24u8, 107u8, 221u8, + 236u8, 75u8, 231u8, 125u8, 39u8, 189u8, 45u8, 202u8, 116u8, 123u8, + 236u8, 96u8, + ], + ) + } + #[doc = "Remove an account's identity and sub-account information and slash the deposits."] + #[doc = ""] + #[doc = "Payment: Reserved balances from `set_subs` and `set_identity` are slashed and handled by"] + #[doc = "`Slash`. Verification request deposits are not returned; they should be cancelled"] + #[doc = "manually using `cancel_request`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + #[doc = ""] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = ""] + #[doc = "Emits `IdentityKilled` if successful."] + pub fn kill_identity( + &self, + target: super::kill_identity::Target, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "kill_identity", + super::KillIdentity { target }, + [ + 114u8, 249u8, 102u8, 62u8, 118u8, 105u8, 185u8, 61u8, 173u8, 52u8, + 57u8, 190u8, 102u8, 74u8, 108u8, 239u8, 142u8, 176u8, 116u8, 51u8, + 49u8, 197u8, 6u8, 183u8, 248u8, 202u8, 202u8, 140u8, 134u8, 59u8, + 103u8, 182u8, + ], + ) + } + #[doc = "Add the given account to the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub fn add_sub( + &self, + sub: super::add_sub::Sub, + data: super::add_sub::Data, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "add_sub", + super::AddSub { sub, data }, + [ + 3u8, 65u8, 137u8, 35u8, 238u8, 133u8, 56u8, 233u8, 37u8, 125u8, + 221u8, 186u8, 153u8, 74u8, 69u8, 196u8, 244u8, 82u8, 51u8, 7u8, + 216u8, 29u8, 18u8, 16u8, 198u8, 184u8, 0u8, 181u8, 71u8, 227u8, + 144u8, 33u8, + ], + ) + } + #[doc = "Alter the associated name of the given sub-account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub fn rename_sub( + &self, + sub: super::rename_sub::Sub, + data: super::rename_sub::Data, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "rename_sub", + super::RenameSub { sub, data }, + [ + 252u8, 50u8, 201u8, 112u8, 49u8, 248u8, 223u8, 239u8, 219u8, 226u8, + 64u8, 68u8, 227u8, 20u8, 30u8, 24u8, 36u8, 77u8, 26u8, 235u8, + 144u8, 240u8, 11u8, 111u8, 145u8, 167u8, 184u8, 207u8, 173u8, 58u8, + 152u8, 202u8, + ], + ) + } + #[doc = "Remove the given account from the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub fn remove_sub( + &self, + sub: super::remove_sub::Sub, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "remove_sub", + super::RemoveSub { sub }, + [ + 95u8, 249u8, 171u8, 27u8, 100u8, 186u8, 67u8, 214u8, 226u8, 6u8, + 118u8, 39u8, 91u8, 122u8, 1u8, 87u8, 1u8, 226u8, 101u8, 9u8, 199u8, + 167u8, 84u8, 202u8, 141u8, 196u8, 80u8, 195u8, 15u8, 114u8, 140u8, + 144u8, + ], + ) + } + #[doc = "Remove the sender as a sub-account."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender (*not* the original depositor)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "super-identity."] + #[doc = ""] + #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] + #[doc = "controller of an account is maliciously registered as a sub-account."] + pub fn quit_sub(&self) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "quit_sub", + super::QuitSub {}, + [ + 147u8, 131u8, 175u8, 171u8, 187u8, 201u8, 240u8, 26u8, 146u8, + 224u8, 74u8, 166u8, 242u8, 193u8, 204u8, 247u8, 168u8, 93u8, 18u8, + 32u8, 27u8, 208u8, 149u8, 146u8, 179u8, 172u8, 75u8, 112u8, 84u8, + 141u8, 233u8, 223u8, + ], + ) + } + #[doc = "Add an `AccountId` with permission to grant usernames with a given `suffix` appended."] + #[doc = ""] + #[doc = "The authority can grant up to `allocation` usernames. To top up the allocation or"] + #[doc = "change the account used to grant usernames, this call can be used with the updated"] + #[doc = "parameters to overwrite the existing configuration."] + pub fn add_username_authority( + &self, + authority: super::add_username_authority::Authority, + suffix: super::add_username_authority::Suffix, + allocation: super::add_username_authority::Allocation, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "add_username_authority", + super::AddUsernameAuthority { + authority, + suffix, + allocation, + }, + [ + 225u8, 197u8, 122u8, 209u8, 206u8, 241u8, 247u8, 232u8, 196u8, + 110u8, 75u8, 157u8, 44u8, 181u8, 35u8, 75u8, 182u8, 219u8, 100u8, + 64u8, 208u8, 112u8, 120u8, 229u8, 211u8, 69u8, 193u8, 214u8, 195u8, + 98u8, 10u8, 25u8, + ], + ) + } + #[doc = "Remove `authority` from the username authorities."] + pub fn remove_username_authority( + &self, + suffix: super::remove_username_authority::Suffix, + authority: super::remove_username_authority::Authority, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "remove_username_authority", + super::RemoveUsernameAuthority { suffix, authority }, + [ + 97u8, 5u8, 0u8, 114u8, 226u8, 202u8, 96u8, 101u8, 141u8, 79u8, + 242u8, 232u8, 203u8, 98u8, 24u8, 18u8, 133u8, 168u8, 153u8, 14u8, + 50u8, 17u8, 92u8, 9u8, 157u8, 251u8, 214u8, 214u8, 146u8, 140u8, + 28u8, 6u8, + ], + ) + } + #[doc = "Set the username for `who`. Must be called by a username authority."] + #[doc = ""] + #[doc = "If `use_allocation` is set, the authority must have a username allocation available to"] + #[doc = "spend. Otherwise, the authority will need to put up a deposit for registering the"] + #[doc = "username."] + #[doc = ""] + #[doc = "Users can either pre-sign their usernames or"] + #[doc = "accept them later."] + #[doc = ""] + #[doc = "Usernames must:"] + #[doc = " - Only contain lowercase ASCII characters or digits."] + #[doc = " - When combined with the suffix of the issuing authority be _less than_ the"] + #[doc = " `MaxUsernameLength`."] + pub fn set_username_for( + &self, + who: super::set_username_for::Who, + username: super::set_username_for::Username, + signature: super::set_username_for::Signature, + use_allocation: super::set_username_for::UseAllocation, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "set_username_for", + super::SetUsernameFor { + who, + username, + signature, + use_allocation, + }, + [ + 129u8, 186u8, 207u8, 39u8, 40u8, 3u8, 51u8, 218u8, 133u8, 145u8, + 95u8, 35u8, 105u8, 65u8, 134u8, 71u8, 104u8, 238u8, 17u8, 165u8, + 130u8, 43u8, 85u8, 246u8, 59u8, 136u8, 110u8, 25u8, 196u8, 213u8, + 171u8, 16u8, + ], + ) + } + #[doc = "Accept a given username that an `authority` granted. The call must include the full"] + #[doc = "username, as in `username.suffix`."] + pub fn accept_username( + &self, + username: super::accept_username::Username, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "accept_username", + super::AcceptUsername { username }, + [ + 247u8, 162u8, 83u8, 250u8, 214u8, 7u8, 12u8, 253u8, 227u8, 4u8, + 95u8, 71u8, 150u8, 218u8, 216u8, 86u8, 137u8, 37u8, 114u8, 188u8, + 18u8, 232u8, 229u8, 179u8, 172u8, 251u8, 70u8, 29u8, 18u8, 86u8, + 33u8, 129u8, + ], + ) + } + #[doc = "Remove an expired username approval. The username was approved by an authority but never"] + #[doc = "accepted by the user and must now be beyond its expiration. The call must include the"] + #[doc = "full username, as in `username.suffix`."] + pub fn remove_expired_approval( + &self, + username: super::remove_expired_approval::Username, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "remove_expired_approval", + super::RemoveExpiredApproval { username }, + [ + 159u8, 171u8, 27u8, 97u8, 224u8, 171u8, 14u8, 89u8, 65u8, 213u8, + 208u8, 67u8, 118u8, 146u8, 0u8, 131u8, 82u8, 186u8, 142u8, 52u8, + 173u8, 90u8, 104u8, 107u8, 114u8, 202u8, 123u8, 222u8, 49u8, 53u8, + 59u8, 61u8, + ], + ) + } + #[doc = "Set a given username as the primary. The username should include the suffix."] + pub fn set_primary_username( + &self, + username: super::set_primary_username::Username, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "set_primary_username", + super::SetPrimaryUsername { username }, + [ + 3u8, 25u8, 56u8, 26u8, 108u8, 165u8, 84u8, 231u8, 16u8, 4u8, 6u8, + 232u8, 141u8, 7u8, 254u8, 50u8, 26u8, 230u8, 66u8, 245u8, 255u8, + 101u8, 183u8, 234u8, 197u8, 186u8, 132u8, 197u8, 251u8, 84u8, + 212u8, 162u8, + ], + ) + } + #[doc = "Start the process of removing a username by placing it in the unbinding usernames map."] + #[doc = "Once the grace period has passed, the username can be deleted by calling"] + #[doc = "[remove_username](crate::Call::remove_username)."] + pub fn unbind_username( + &self, + username: super::unbind_username::Username, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "unbind_username", + super::UnbindUsername { username }, + [ + 231u8, 59u8, 154u8, 107u8, 195u8, 183u8, 146u8, 12u8, 232u8, 249u8, + 119u8, 51u8, 99u8, 223u8, 197u8, 231u8, 249u8, 66u8, 189u8, 148u8, + 207u8, 163u8, 192u8, 150u8, 151u8, 111u8, 86u8, 170u8, 123u8, + 194u8, 141u8, 251u8, + ], + ) + } + #[doc = "Permanently delete a username which has been unbinding for longer than the grace period."] + #[doc = "Caller is refunded the fee if the username expired and the removal was successful."] + pub fn remove_username( + &self, + username: super::remove_username::Username, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "remove_username", + super::RemoveUsername { username }, + [ + 68u8, 30u8, 96u8, 37u8, 56u8, 235u8, 48u8, 61u8, 77u8, 235u8, 6u8, + 4u8, 123u8, 85u8, 176u8, 90u8, 255u8, 196u8, 178u8, 190u8, 230u8, + 228u8, 70u8, 141u8, 156u8, 156u8, 34u8, 7u8, 177u8, 204u8, 152u8, + 145u8, + ], + ) + } + #[doc = "Call with [ForceOrigin](crate::Config::ForceOrigin) privileges which deletes a username"] + #[doc = "and slashes any deposit associated with it."] + pub fn kill_username( + &self, + username: super::kill_username::Username, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Identity", + "kill_username", + super::KillUsername { username }, + [ + 147u8, 229u8, 92u8, 195u8, 22u8, 114u8, 25u8, 16u8, 125u8, 80u8, + 226u8, 188u8, 47u8, 199u8, 13u8, 245u8, 60u8, 93u8, 84u8, 97u8, + 82u8, 238u8, 248u8, 44u8, 171u8, 132u8, 66u8, 0u8, 151u8, 108u8, + 96u8, 25u8, + ], + ) + } } } } @@ -17859,31 +18125,36 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A name was set or reset (which will remove all judgements)."] pub struct IdentitySet { pub who: identity_set::Who, } pub mod identity_set { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; + } + impl IdentitySet { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "IdentitySet"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for IdentitySet { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentitySet"; + impl ::subxt::events::DecodeAsEvent for IdentitySet { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A name was cleared, and the given balance returned."] pub struct IdentityCleared { pub who: identity_cleared::Who, @@ -17891,20 +18162,25 @@ pub mod api { } pub mod identity_cleared { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Deposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for IdentityCleared { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentityCleared"; + impl IdentityCleared { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "IdentityCleared"; + } + impl ::subxt::events::DecodeAsEvent for IdentityCleared { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A name was removed and the given balance slashed."] pub struct IdentityKilled { pub who: identity_killed::Who, @@ -17912,20 +18188,25 @@ pub mod api { } pub mod identity_killed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Deposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for IdentityKilled { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentityKilled"; + impl IdentityKilled { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "IdentityKilled"; + } + impl ::subxt::events::DecodeAsEvent for IdentityKilled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A judgement was asked from a registrar."] pub struct JudgementRequested { pub who: judgement_requested::Who, @@ -17933,20 +18214,25 @@ pub mod api { } pub mod judgement_requested { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type RegistrarIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for JudgementRequested { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementRequested"; + impl JudgementRequested { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "JudgementRequested"; + } + impl ::subxt::events::DecodeAsEvent for JudgementRequested { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A judgement request was retracted."] pub struct JudgementUnrequested { pub who: judgement_unrequested::Who, @@ -17954,20 +18240,25 @@ pub mod api { } pub mod judgement_unrequested { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type RegistrarIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for JudgementUnrequested { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementUnrequested"; + impl JudgementUnrequested { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "JudgementUnrequested"; + } + impl ::subxt::events::DecodeAsEvent for JudgementUnrequested { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A judgement was given by a registrar."] pub struct JudgementGiven { pub target: judgement_given::Target, @@ -17975,20 +18266,25 @@ pub mod api { } pub mod judgement_given { use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Target = ::subxt::utils::AccountId32; pub type RegistrarIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for JudgementGiven { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementGiven"; + impl JudgementGiven { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "JudgementGiven"; + } + impl ::subxt::events::DecodeAsEvent for JudgementGiven { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A registrar was added."] pub struct RegistrarAdded { pub registrar_index: registrar_added::RegistrarIndex, @@ -17997,17 +18293,22 @@ pub mod api { use super::runtime_types; pub type RegistrarIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RegistrarAdded { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "RegistrarAdded"; + impl RegistrarAdded { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "RegistrarAdded"; + } + impl ::subxt::events::DecodeAsEvent for RegistrarAdded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A sub-identity was added to an identity and the deposit paid."] pub struct SubIdentityAdded { pub sub: sub_identity_added::Sub, @@ -18016,21 +18317,26 @@ pub mod api { } pub mod sub_identity_added { use super::runtime_types; - pub type Sub = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Main = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Sub = ::subxt::utils::AccountId32; + pub type Main = ::subxt::utils::AccountId32; pub type Deposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubIdentityAdded { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityAdded"; + impl SubIdentityAdded { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "SubIdentityAdded"; + } + impl ::subxt::events::DecodeAsEvent for SubIdentityAdded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An account's sub-identities were set (in bulk)."] pub struct SubIdentitiesSet { pub main: sub_identities_set::Main, @@ -18039,21 +18345,26 @@ pub mod api { } pub mod sub_identities_set { use super::runtime_types; - pub type Main = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Main = ::subxt::utils::AccountId32; pub type NumberOfSubs = ::core::primitive::u32; pub type NewDeposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubIdentitiesSet { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentitiesSet"; + impl SubIdentitiesSet { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "SubIdentitiesSet"; + } + impl ::subxt::events::DecodeAsEvent for SubIdentitiesSet { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A given sub-account's associated name was changed by its super-identity."] pub struct SubIdentityRenamed { pub sub: sub_identity_renamed::Sub, @@ -18061,20 +18372,25 @@ pub mod api { } pub mod sub_identity_renamed { use super::runtime_types; - pub type Sub = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Main = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Sub = ::subxt::utils::AccountId32; + pub type Main = ::subxt::utils::AccountId32; + } + impl SubIdentityRenamed { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "SubIdentityRenamed"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubIdentityRenamed { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityRenamed"; + impl ::subxt::events::DecodeAsEvent for SubIdentityRenamed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A sub-identity was removed from an identity and the deposit freed."] pub struct SubIdentityRemoved { pub sub: sub_identity_removed::Sub, @@ -18083,21 +18399,26 @@ pub mod api { } pub mod sub_identity_removed { use super::runtime_types; - pub type Sub = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Main = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Sub = ::subxt::utils::AccountId32; + pub type Main = ::subxt::utils::AccountId32; pub type Deposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubIdentityRemoved { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityRemoved"; + impl SubIdentityRemoved { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "SubIdentityRemoved"; + } + impl ::subxt::events::DecodeAsEvent for SubIdentityRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A sub-identity was cleared, and the given deposit repatriated from the"] #[doc = "main identity account to the sub-identity account."] pub struct SubIdentityRevoked { @@ -18107,59 +18428,74 @@ pub mod api { } pub mod sub_identity_revoked { use super::runtime_types; - pub type Sub = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Main = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Sub = ::subxt::utils::AccountId32; + pub type Main = ::subxt::utils::AccountId32; pub type Deposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubIdentityRevoked { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityRevoked"; + impl SubIdentityRevoked { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "SubIdentityRevoked"; + } + impl ::subxt::events::DecodeAsEvent for SubIdentityRevoked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A username authority was added."] pub struct AuthorityAdded { pub authority: authority_added::Authority, } pub mod authority_added { use super::runtime_types; - pub type Authority = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Authority = ::subxt::utils::AccountId32; + } + impl AuthorityAdded { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "AuthorityAdded"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AuthorityAdded { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "AuthorityAdded"; + impl ::subxt::events::DecodeAsEvent for AuthorityAdded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A username authority was removed."] pub struct AuthorityRemoved { pub authority: authority_removed::Authority, } pub mod authority_removed { use super::runtime_types; - pub type Authority = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Authority = ::subxt::utils::AccountId32; + } + impl AuthorityRemoved { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "AuthorityRemoved"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AuthorityRemoved { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "AuthorityRemoved"; + impl ::subxt::events::DecodeAsEvent for AuthorityRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A username was set for `who`."] pub struct UsernameSet { pub who: username_set::Who, @@ -18167,22 +18503,27 @@ pub mod api { } pub mod username_set { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< ::core::primitive::u8, >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UsernameSet { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "UsernameSet"; + impl UsernameSet { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "UsernameSet"; + } + impl ::subxt::events::DecodeAsEvent for UsernameSet { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A username was queued, but `who` must accept it prior to `expiration`."] pub struct UsernameQueued { pub who: username_queued::Who, @@ -18191,42 +18532,52 @@ pub mod api { } pub mod username_queued { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< ::core::primitive::u8, >; pub type Expiration = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UsernameQueued { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "UsernameQueued"; + impl UsernameQueued { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "UsernameQueued"; + } + impl ::subxt::events::DecodeAsEvent for UsernameQueued { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A queued username passed its expiration without being claimed and was removed."] pub struct PreapprovalExpired { pub whose: preapproval_expired::Whose, } pub mod preapproval_expired { use super::runtime_types; - pub type Whose = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Whose = ::subxt::utils::AccountId32; + } + impl PreapprovalExpired { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "PreapprovalExpired"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PreapprovalExpired { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "PreapprovalExpired"; + impl ::subxt::events::DecodeAsEvent for PreapprovalExpired { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A username was set as a primary and can be looked up from `who`."] pub struct PrimaryUsernameSet { pub who: primary_username_set::Who, @@ -18234,22 +18585,27 @@ pub mod api { } pub mod primary_username_set { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< ::core::primitive::u8, >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PrimaryUsernameSet { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "PrimaryUsernameSet"; + impl PrimaryUsernameSet { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "PrimaryUsernameSet"; + } + impl ::subxt::events::DecodeAsEvent for PrimaryUsernameSet { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A dangling username (as in, a username corresponding to an account that has removed its"] #[doc = "identity) has been removed."] pub struct DanglingUsernameRemoved { @@ -18258,22 +18614,27 @@ pub mod api { } pub mod dangling_username_removed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Username = runtime_types::bounded_collections::bounded_vec::BoundedVec< ::core::primitive::u8, >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DanglingUsernameRemoved { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "DanglingUsernameRemoved"; + impl DanglingUsernameRemoved { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "DanglingUsernameRemoved"; + } + impl ::subxt::events::DecodeAsEvent for DanglingUsernameRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A username has been unbound."] pub struct UsernameUnbound { pub username: username_unbound::Username, @@ -18284,17 +18645,22 @@ pub mod api { ::core::primitive::u8, >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UsernameUnbound { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "UsernameUnbound"; + impl UsernameUnbound { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "UsernameUnbound"; + } + impl ::subxt::events::DecodeAsEvent for UsernameUnbound { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A username has been removed."] pub struct UsernameRemoved { pub username: username_removed::Username, @@ -18305,17 +18671,22 @@ pub mod api { ::core::primitive::u8, >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UsernameRemoved { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "UsernameRemoved"; + impl UsernameRemoved { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "UsernameRemoved"; + } + impl ::subxt::events::DecodeAsEvent for UsernameRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A username has been killed."] pub struct UsernameKilled { pub username: username_killed::Username, @@ -18326,9 +18697,14 @@ pub mod api { ::core::primitive::u8, >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UsernameKilled { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "UsernameKilled"; + impl UsernameKilled { + const PALLET_NAME: &'static str = "Identity"; + const EVENT_NAME: &'static str = "UsernameKilled"; + } + impl ::subxt::events::DecodeAsEvent for UsernameKilled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -18342,12 +18718,12 @@ pub mod api { #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] pub fn identity_of( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (identity_of::Param0,), - identity_of::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (identity_of::input::Param0,), + identity_of::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Identity", "IdentityOf", [ @@ -18361,12 +18737,12 @@ pub mod api { #[doc = " Identifies the primary username of an account."] pub fn username_of( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (username_of::Param0,), - username_of::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (username_of::input::Param0,), + username_of::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Identity", "UsernameOf", [ @@ -18380,12 +18756,12 @@ pub mod api { #[doc = " context. If the account is not some other account's sub-identity, then just `None`."] pub fn super_of( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (super_of::Param0,), - super_of::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (super_of::input::Param0,), + super_of::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Identity", "SuperOf", [ @@ -18403,12 +18779,12 @@ pub mod api { #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] pub fn subs_of( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (subs_of::Param0,), - subs_of::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (subs_of::input::Param0,), + subs_of::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Identity", "SubsOf", [ @@ -18424,12 +18800,9 @@ pub mod api { #[doc = " The index into this can be cast to `RegistrarIndex` to get a valid value."] pub fn registrars( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - registrars::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), registrars::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Identity", "Registrars", [ @@ -18442,12 +18815,12 @@ pub mod api { #[doc = " A map of the accounts who are authorized to grant usernames."] pub fn authority_of( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (authority_of::Param0,), - authority_of::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (authority_of::input::Param0,), + authority_of::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Identity", "AuthorityOf", [ @@ -18466,12 +18839,12 @@ pub mod api { #[doc = " primary username."] pub fn username_info_of( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (username_info_of::Param0,), - username_info_of::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (username_info_of::input::Param0,), + username_info_of::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Identity", "UsernameInfoOf", [ @@ -18490,12 +18863,12 @@ pub mod api { #[doc = " First tuple item is the account and second is the acceptance deadline."] pub fn pending_usernames( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (pending_usernames::Param0,), - pending_usernames::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (pending_usernames::input::Param0,), + pending_usernames::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Identity", "PendingUsernames", [ @@ -18512,12 +18885,12 @@ pub mod api { #[doc = " [remove_username](`Call::remove_username`) call."] pub fn unbinding_usernames( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (unbinding_usernames::Param0,), - unbinding_usernames::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (unbinding_usernames::input::Param0,), + unbinding_usernames::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Identity", "UnbindingUsernames", [ @@ -18531,120 +18904,120 @@ pub mod api { pub mod identity_of { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_identity::types::Registration< - ::core::primitive::u128, - runtime_types::pallet_identity::legacy::IdentityInfo, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, + runtime_types::pallet_identity::legacy::IdentityInfo, + >; } pub mod username_of { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; } pub mod super_of { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ( - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::pallet_identity::types::Data, - ); + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = ( + ::subxt::utils::AccountId32, + runtime_types::pallet_identity::types::Data, + ); } pub mod subs_of { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ( - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - ); + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = ( + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::utils::AccountId32, + >, + ); } pub mod registrars { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::option::Option< - runtime_types::pallet_identity::types::RegistrarInfo< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u64, - >, - >, - >; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::option::Option< + runtime_types::pallet_identity::types::RegistrarInfo< + ::core::primitive::u128, + ::subxt::utils::AccountId32, + ::core::primitive::u64, + >, + >, + >; } pub mod authority_of { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_identity::types::AuthorityProperties< - ::subxt::ext::subxt_core::utils::AccountId32, + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, >; } + pub type Output = runtime_types::pallet_identity::types::AuthorityProperties< + ::subxt::utils::AccountId32, + >; } pub mod username_info_of { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_identity::types::UsernameInformation< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, >; } + pub type Output = runtime_types::pallet_identity::types::UsernameInformation< + ::subxt::utils::AccountId32, + ::core::primitive::u128, + >; } pub mod pending_usernames { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ( - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - runtime_types::pallet_identity::types::Provider<::core::primitive::u128>, - ); + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; } + pub type Output = ( + ::subxt::utils::AccountId32, + ::core::primitive::u32, + runtime_types::pallet_identity::types::Provider<::core::primitive::u128>, + ); } pub mod unbinding_usernames { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; } + pub type Output = ::core::primitive::u32; } } pub mod constants { @@ -18654,10 +19027,8 @@ pub mod api { #[doc = " The amount held on deposit for a registered identity."] pub fn basic_deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Identity", "BasicDeposit", [ @@ -18670,10 +19041,8 @@ pub mod api { #[doc = " The amount held on deposit per encoded byte for a registered identity."] pub fn byte_deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Identity", "ByteDeposit", [ @@ -18687,10 +19056,8 @@ pub mod api { #[doc = " runtime upgrades with proper migration of existing deposits."] pub fn username_deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Identity", "UsernameDeposit", [ @@ -18705,10 +19072,8 @@ pub mod api { #[doc = " be another trie item whose value is the size of an account ID plus 32 bytes."] pub fn sub_account_deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Identity", "SubAccountDeposit", [ @@ -18721,10 +19086,8 @@ pub mod api { #[doc = " The maximum number of sub-accounts allowed per identified account."] pub fn max_sub_accounts( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Identity", "MaxSubAccounts", [ @@ -18739,10 +19102,8 @@ pub mod api { #[doc = " of, e.g., updating judgements."] pub fn max_registrars( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Identity", "MaxRegistrars", [ @@ -18756,10 +19117,8 @@ pub mod api { #[doc = " The number of blocks within which a username grant must be accepted."] pub fn pending_username_expiration( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Identity", "PendingUsernameExpiration", [ @@ -18774,10 +19133,8 @@ pub mod api { #[doc = " its respective authority."] pub fn username_grace_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Identity", "UsernameGracePeriod", [ @@ -18791,10 +19148,8 @@ pub mod api { #[doc = " The maximum length of a suffix."] pub fn max_suffix_length( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Identity", "MaxSuffixLength", [ @@ -18808,10 +19163,8 @@ pub mod api { #[doc = " The maximum length of a username, including its suffix and any system-added delimiters."] pub fn max_username_length( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Identity", "MaxUsernameLength", [ @@ -18834,1266 +19187,1300 @@ pub mod api { pub type Call = runtime_types::pallet_society::pallet::Call; pub mod calls { use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "A user outside of the society can make a bid for entry."] - #[doc = ""] - #[doc = "Payment: The group's Candidate Deposit will be reserved for making a bid. It is returned"] - #[doc = "when the bid becomes a member, or if the bid calls `unbid`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `value`: A one time payment the bid would like to receive when joining the society."] - pub struct Bid { - pub value: bid::Value, - } - pub mod bid { - use super::runtime_types; - pub type Value = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Bid { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "bid"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "A bidder can remove their bid for entry into society."] - #[doc = "By doing so, they will have their candidate deposit returned or"] - #[doc = "they will unvouch their voucher."] - #[doc = ""] - #[doc = "Payment: The bid deposit is unreserved if the user made a bid."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a bidder."] - pub struct Unbid; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Unbid { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "unbid"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "As a member, vouch for someone to join society by placing a bid on their behalf."] - #[doc = ""] - #[doc = "There is no deposit required to vouch for a new bid, but a member can only vouch for"] - #[doc = "one bid at a time. If the bid becomes a suspended candidate and ultimately rejected by"] - #[doc = "the suspension judgement origin, the member will be banned from vouching again."] - #[doc = ""] - #[doc = "As a vouching member, you can claim a tip if the candidate is accepted. This tip will"] - #[doc = "be paid as a portion of the reward the member will receive for joining the society."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a member."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `who`: The user who you would like to vouch for."] - #[doc = "- `value`: The total reward to be paid between you and the candidate if they become"] - #[doc = "a member in the society."] - #[doc = "- `tip`: Your cut of the total `value` payout when the candidate is inducted into"] - #[doc = "the society. Tips larger than `value` will be saturated upon payout."] - pub struct Vouch { - pub who: vouch::Who, - pub value: vouch::Value, - pub tip: vouch::Tip, - } - pub mod vouch { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Value = ::core::primitive::u128; - pub type Tip = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vouch { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "vouch"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "As a vouching member, unvouch a bid. This only works while vouched user is"] - #[doc = "only a bidder (and not a candidate)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a vouching member."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `pos`: Position in the `Bids` vector of the bid who should be unvouched."] - pub struct Unvouch; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Unvouch { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "unvouch"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "As a member, vote on a candidate."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a member."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `candidate`: The candidate that the member would like to bid on."] - #[doc = "- `approve`: A boolean which says if the candidate should be approved (`true`) or"] - #[doc = " rejected (`false`)."] - pub struct Vote { - pub candidate: vote::Candidate, - pub approve: vote::Approve, - } - pub mod vote { - use super::runtime_types; - pub type Candidate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Approve = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "vote"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "As a member, vote on the defender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a member."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `approve`: A boolean which says if the candidate should be"] - #[doc = "approved (`true`) or rejected (`false`)."] - pub struct DefenderVote { - pub approve: defender_vote::Approve, - } - pub mod defender_vote { - use super::runtime_types; - pub type Approve = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DefenderVote { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "defender_vote"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer the first matured payout for the sender and remove it from the records."] - #[doc = ""] - #[doc = "NOTE: This extrinsic needs to be called multiple times to claim multiple matured"] - #[doc = "payouts."] - #[doc = ""] - #[doc = "Payment: The member will receive a payment equal to their first matured"] - #[doc = "payout to their free balance."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a member with"] - #[doc = "payouts remaining."] - pub struct Payout; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Payout { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "payout"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Repay the payment previously given to the member with the signed origin, remove any"] - #[doc = "pending payments, and elevate them from rank 0 to rank 1."] - pub struct WaiveRepay { - pub amount: waive_repay::Amount, - } - pub mod waive_repay { - use super::runtime_types; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for WaiveRepay { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "waive_repay"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Found the society."] - #[doc = ""] - #[doc = "This is done as a discrete action in order to allow for the"] - #[doc = "pallet to be included into a running chain and can only be done once."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be from the _FounderSetOrigin_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `founder` - The first member and head of the newly founded society."] - #[doc = "- `max_members` - The initial max number of members for the society."] - #[doc = "- `max_intake` - The maximum number of candidates per intake period."] - #[doc = "- `max_strikes`: The maximum number of strikes a member may get before they become"] - #[doc = " suspended and may only be reinstated by the founder."] - #[doc = "- `candidate_deposit`: The deposit required to make a bid for membership of the group."] - #[doc = "- `rules` - The rules of this society concerning membership."] - #[doc = ""] - #[doc = "Complexity: O(1)"] - pub struct FoundSociety { - pub founder: found_society::Founder, - pub max_members: found_society::MaxMembers, - pub max_intake: found_society::MaxIntake, - pub max_strikes: found_society::MaxStrikes, - pub candidate_deposit: found_society::CandidateDeposit, - pub rules: found_society::Rules, - } - pub mod found_society { - use super::runtime_types; - pub type Founder = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type MaxMembers = ::core::primitive::u32; - pub type MaxIntake = ::core::primitive::u32; - pub type MaxStrikes = ::core::primitive::u32; - pub type CandidateDeposit = ::core::primitive::u128; - pub type Rules = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FoundSociety { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "found_society"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Dissolve the society and remove all members."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be Signed, and the signing account must be both"] - #[doc = "the `Founder` and the `Head`. This implies that it may only be done when there is one"] - #[doc = "member."] - pub struct Dissolve; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Dissolve { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "dissolve"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allow suspension judgement origin to make judgement on a suspended member."] - #[doc = ""] - #[doc = "If a suspended member is forgiven, we simply add them back as a member, not affecting"] - #[doc = "any of the existing storage items for that member."] - #[doc = ""] - #[doc = "If a suspended member is rejected, remove all associated storage items, including"] - #[doc = "their payouts, and remove any vouched bids they currently have."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be Signed from the Founder."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `who` - The suspended member to be judged."] - #[doc = "- `forgive` - A boolean representing whether the suspension judgement origin forgives"] - #[doc = " (`true`) or rejects (`false`) a suspended member."] - pub struct JudgeSuspendedMember { - pub who: judge_suspended_member::Who, - pub forgive: judge_suspended_member::Forgive, - } - pub mod judge_suspended_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Forgive = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for JudgeSuspendedMember { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "judge_suspended_member"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Change the maximum number of members in society and the maximum number of new candidates"] - #[doc = "in a single intake period."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be Signed by the Founder."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `max_members` - The maximum number of members for the society. This must be no less"] - #[doc = " than the current number of members."] - #[doc = "- `max_intake` - The maximum number of candidates per intake period."] - #[doc = "- `max_strikes`: The maximum number of strikes a member may get before they become"] - #[doc = " suspended and may only be reinstated by the founder."] - #[doc = "- `candidate_deposit`: The deposit required to make a bid for membership of the group."] - pub struct SetParameters { - pub max_members: set_parameters::MaxMembers, - pub max_intake: set_parameters::MaxIntake, - pub max_strikes: set_parameters::MaxStrikes, - pub candidate_deposit: set_parameters::CandidateDeposit, - } - pub mod set_parameters { - use super::runtime_types; - pub type MaxMembers = ::core::primitive::u32; - pub type MaxIntake = ::core::primitive::u32; - pub type MaxStrikes = ::core::primitive::u32; - pub type CandidateDeposit = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetParameters { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "set_parameters"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Punish the skeptic with a strike if they did not vote on a candidate. Callable by the"] - #[doc = "candidate."] - pub struct PunishSkeptic; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PunishSkeptic { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "punish_skeptic"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transform an approved candidate into a member. Callable only by the"] - #[doc = "the candidate, and only after the period for voting has ended."] - pub struct ClaimMembership; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimMembership { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "claim_membership"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transform an approved candidate into a member. Callable only by the Signed origin of the"] - #[doc = "Founder, only after the period for voting has ended and only when the candidate is not"] - #[doc = "clearly rejected."] - pub struct BestowMembership { - pub candidate: bestow_membership::Candidate, - } - pub mod bestow_membership { - use super::runtime_types; - pub type Candidate = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for BestowMembership { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "bestow_membership"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove the candidate's application from the society. Callable only by the Signed origin"] - #[doc = "of the Founder, only after the period for voting has ended, and only when they do not"] - #[doc = "have a clear approval."] - #[doc = ""] - #[doc = "Any bid deposit is lost and voucher is banned."] - pub struct KickCandidate { - pub candidate: kick_candidate::Candidate, - } - pub mod kick_candidate { - use super::runtime_types; - pub type Candidate = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for KickCandidate { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "kick_candidate"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove the candidate's application from the society. Callable only by the candidate."] - #[doc = ""] - #[doc = "Any bid deposit is lost and voucher is banned."] - pub struct ResignCandidacy; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ResignCandidacy { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "resign_candidacy"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove a `candidate`'s failed application from the society. Callable by any"] - #[doc = "signed origin but only at the end of the subsequent round and only for"] - #[doc = "a candidate with more rejections than approvals."] - #[doc = ""] - #[doc = "The bid deposit is lost and the voucher is banned."] - pub struct DropCandidate { - pub candidate: drop_candidate::Candidate, - } - pub mod drop_candidate { - use super::runtime_types; - pub type Candidate = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DropCandidate { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "drop_candidate"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove up to `max` stale votes for the given `candidate`."] - #[doc = ""] - #[doc = "May be called by any Signed origin, but only after the candidate's candidacy is ended."] - pub struct CleanupCandidacy { - pub candidate: cleanup_candidacy::Candidate, - pub max: cleanup_candidacy::Max, - } - pub mod cleanup_candidacy { - use super::runtime_types; - pub type Candidate = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Max = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CleanupCandidacy { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "cleanup_candidacy"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove up to `max` stale votes for the defender in the given `challenge_round`."] - #[doc = ""] - #[doc = "May be called by any Signed origin, but only after the challenge round is ended."] - pub struct CleanupChallenge { - pub challenge_round: cleanup_challenge::ChallengeRound, - pub max: cleanup_challenge::Max, - } - pub mod cleanup_challenge { - use super::runtime_types; - pub type ChallengeRound = ::core::primitive::u32; - pub type Max = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CleanupChallenge { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "cleanup_challenge"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Poke the deposit reserved when bidding."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be the bidder."] - #[doc = ""] - #[doc = "The transaction fee is waived if the deposit is changed after poking/reconsideration."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if successful."] - pub struct PokeDeposit; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { - const PALLET: &'static str = "Society"; - const CALL: &'static str = "poke_deposit"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "A user outside of the society can make a bid for entry."] - #[doc = ""] - #[doc = "Payment: The group's Candidate Deposit will be reserved for making a bid. It is returned"] - #[doc = "when the bid becomes a member, or if the bid calls `unbid`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `value`: A one time payment the bid would like to receive when joining the society."] - pub fn bid( - &self, - value: types::bid::Value, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "bid", - types::Bid { value }, - [ - 196u8, 8u8, 236u8, 188u8, 3u8, 185u8, 190u8, 227u8, 11u8, 146u8, 225u8, - 241u8, 196u8, 125u8, 128u8, 67u8, 244u8, 144u8, 10u8, 152u8, 161u8, - 60u8, 72u8, 33u8, 124u8, 137u8, 40u8, 200u8, 177u8, 21u8, 27u8, 45u8, - ], - ) - } - #[doc = "A bidder can remove their bid for entry into society."] - #[doc = "By doing so, they will have their candidate deposit returned or"] - #[doc = "they will unvouch their voucher."] - #[doc = ""] - #[doc = "Payment: The bid deposit is unreserved if the user made a bid."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a bidder."] - pub fn unbid( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "unbid", - types::Unbid {}, - [ - 188u8, 248u8, 46u8, 6u8, 82u8, 191u8, 129u8, 234u8, 187u8, 249u8, 69u8, - 242u8, 173u8, 185u8, 209u8, 51u8, 228u8, 80u8, 27u8, 111u8, 59u8, - 110u8, 180u8, 106u8, 205u8, 6u8, 121u8, 66u8, 232u8, 89u8, 166u8, - 154u8, - ], - ) - } - #[doc = "As a member, vouch for someone to join society by placing a bid on their behalf."] - #[doc = ""] - #[doc = "There is no deposit required to vouch for a new bid, but a member can only vouch for"] - #[doc = "one bid at a time. If the bid becomes a suspended candidate and ultimately rejected by"] - #[doc = "the suspension judgement origin, the member will be banned from vouching again."] - #[doc = ""] - #[doc = "As a vouching member, you can claim a tip if the candidate is accepted. This tip will"] - #[doc = "be paid as a portion of the reward the member will receive for joining the society."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a member."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `who`: The user who you would like to vouch for."] - #[doc = "- `value`: The total reward to be paid between you and the candidate if they become"] - #[doc = "a member in the society."] - #[doc = "- `tip`: Your cut of the total `value` payout when the candidate is inducted into"] - #[doc = "the society. Tips larger than `value` will be saturated upon payout."] - pub fn vouch( - &self, - who: types::vouch::Who, - value: types::vouch::Value, - tip: types::vouch::Tip, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "vouch", - types::Vouch { who, value, tip }, - [ - 112u8, 149u8, 72u8, 181u8, 135u8, 149u8, 62u8, 134u8, 12u8, 214u8, 0u8, - 31u8, 142u8, 128u8, 27u8, 243u8, 210u8, 197u8, 72u8, 177u8, 164u8, - 112u8, 223u8, 28u8, 43u8, 149u8, 5u8, 249u8, 157u8, 150u8, 123u8, 58u8, - ], - ) - } - #[doc = "As a vouching member, unvouch a bid. This only works while vouched user is"] - #[doc = "only a bidder (and not a candidate)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a vouching member."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `pos`: Position in the `Bids` vector of the bid who should be unvouched."] - pub fn unvouch( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "unvouch", - types::Unvouch {}, - [ - 205u8, 176u8, 119u8, 76u8, 199u8, 30u8, 22u8, 108u8, 111u8, 117u8, - 24u8, 9u8, 164u8, 14u8, 126u8, 124u8, 224u8, 50u8, 195u8, 136u8, 244u8, - 77u8, 238u8, 99u8, 97u8, 133u8, 151u8, 109u8, 245u8, 83u8, 159u8, - 136u8, - ], - ) - } - #[doc = "As a member, vote on a candidate."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a member."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `candidate`: The candidate that the member would like to bid on."] - #[doc = "- `approve`: A boolean which says if the candidate should be approved (`true`) or"] - #[doc = " rejected (`false`)."] - pub fn vote( - &self, - candidate: types::vote::Candidate, - approve: types::vote::Approve, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "vote", - types::Vote { candidate, approve }, - [ - 64u8, 168u8, 166u8, 195u8, 208u8, 246u8, 156u8, 39u8, 195u8, 28u8, - 153u8, 58u8, 52u8, 185u8, 166u8, 8u8, 108u8, 169u8, 44u8, 70u8, 244u8, - 244u8, 81u8, 27u8, 236u8, 79u8, 123u8, 176u8, 155u8, 40u8, 154u8, 70u8, - ], - ) - } - #[doc = "As a member, vote on the defender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a member."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `approve`: A boolean which says if the candidate should be"] - #[doc = "approved (`true`) or rejected (`false`)."] - pub fn defender_vote( - &self, - approve: types::defender_vote::Approve, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "defender_vote", - types::DefenderVote { approve }, - [ - 38u8, 196u8, 123u8, 172u8, 243u8, 40u8, 208u8, 63u8, 231u8, 155u8, - 151u8, 181u8, 58u8, 122u8, 185u8, 86u8, 76u8, 124u8, 168u8, 225u8, - 37u8, 13u8, 127u8, 250u8, 122u8, 124u8, 140u8, 57u8, 242u8, 214u8, - 145u8, 119u8, - ], - ) - } - #[doc = "Transfer the first matured payout for the sender and remove it from the records."] - #[doc = ""] - #[doc = "NOTE: This extrinsic needs to be called multiple times to claim multiple matured"] - #[doc = "payouts."] - #[doc = ""] - #[doc = "Payment: The member will receive a payment equal to their first matured"] - #[doc = "payout to their free balance."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a member with"] - #[doc = "payouts remaining."] - pub fn payout( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "payout", - types::Payout {}, - [ - 214u8, 12u8, 233u8, 89u8, 186u8, 0u8, 61u8, 206u8, 251u8, 1u8, 55u8, - 0u8, 126u8, 105u8, 55u8, 109u8, 101u8, 104u8, 46u8, 98u8, 62u8, 228u8, - 64u8, 195u8, 61u8, 24u8, 48u8, 148u8, 146u8, 108u8, 67u8, 52u8, - ], - ) - } - #[doc = "Repay the payment previously given to the member with the signed origin, remove any"] - #[doc = "pending payments, and elevate them from rank 0 to rank 1."] - pub fn waive_repay( - &self, - amount: types::waive_repay::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "waive_repay", - types::WaiveRepay { amount }, - [ - 83u8, 11u8, 65u8, 16u8, 92u8, 73u8, 39u8, 178u8, 16u8, 170u8, 41u8, - 70u8, 241u8, 255u8, 89u8, 121u8, 50u8, 140u8, 240u8, 31u8, 27u8, 51u8, - 51u8, 22u8, 241u8, 218u8, 127u8, 76u8, 52u8, 246u8, 214u8, 52u8, - ], - ) - } - #[doc = "Found the society."] - #[doc = ""] - #[doc = "This is done as a discrete action in order to allow for the"] - #[doc = "pallet to be included into a running chain and can only be done once."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be from the _FounderSetOrigin_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `founder` - The first member and head of the newly founded society."] - #[doc = "- `max_members` - The initial max number of members for the society."] - #[doc = "- `max_intake` - The maximum number of candidates per intake period."] - #[doc = "- `max_strikes`: The maximum number of strikes a member may get before they become"] - #[doc = " suspended and may only be reinstated by the founder."] - #[doc = "- `candidate_deposit`: The deposit required to make a bid for membership of the group."] - #[doc = "- `rules` - The rules of this society concerning membership."] - #[doc = ""] - #[doc = "Complexity: O(1)"] - pub fn found_society( - &self, - founder: types::found_society::Founder, - max_members: types::found_society::MaxMembers, - max_intake: types::found_society::MaxIntake, - max_strikes: types::found_society::MaxStrikes, - candidate_deposit: types::found_society::CandidateDeposit, - rules: types::found_society::Rules, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "found_society", - types::FoundSociety { - founder, - max_members, - max_intake, - max_strikes, - candidate_deposit, - rules, - }, - [ - 232u8, 23u8, 175u8, 166u8, 217u8, 99u8, 210u8, 160u8, 122u8, 68u8, - 169u8, 134u8, 248u8, 126u8, 186u8, 130u8, 97u8, 245u8, 69u8, 159u8, - 19u8, 52u8, 67u8, 144u8, 77u8, 154u8, 215u8, 67u8, 233u8, 96u8, 40u8, - 81u8, - ], - ) - } - #[doc = "Dissolve the society and remove all members."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be Signed, and the signing account must be both"] - #[doc = "the `Founder` and the `Head`. This implies that it may only be done when there is one"] - #[doc = "member."] - pub fn dissolve( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "dissolve", - types::Dissolve {}, - [ - 159u8, 138u8, 214u8, 34u8, 208u8, 201u8, 11u8, 33u8, 173u8, 66u8, - 243u8, 3u8, 226u8, 190u8, 199u8, 200u8, 215u8, 210u8, 226u8, 213u8, - 150u8, 217u8, 192u8, 88u8, 87u8, 202u8, 226u8, 105u8, 20u8, 201u8, - 50u8, 242u8, - ], - ) - } - #[doc = "Allow suspension judgement origin to make judgement on a suspended member."] - #[doc = ""] - #[doc = "If a suspended member is forgiven, we simply add them back as a member, not affecting"] - #[doc = "any of the existing storage items for that member."] - #[doc = ""] - #[doc = "If a suspended member is rejected, remove all associated storage items, including"] - #[doc = "their payouts, and remove any vouched bids they currently have."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be Signed from the Founder."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `who` - The suspended member to be judged."] - #[doc = "- `forgive` - A boolean representing whether the suspension judgement origin forgives"] - #[doc = " (`true`) or rejects (`false`) a suspended member."] - pub fn judge_suspended_member( - &self, - who: types::judge_suspended_member::Who, - forgive: types::judge_suspended_member::Forgive, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "judge_suspended_member", - types::JudgeSuspendedMember { who, forgive }, - [ - 219u8, 45u8, 90u8, 201u8, 128u8, 28u8, 215u8, 68u8, 125u8, 127u8, 57u8, - 207u8, 25u8, 110u8, 162u8, 30u8, 211u8, 208u8, 192u8, 182u8, 69u8, - 151u8, 233u8, 84u8, 81u8, 72u8, 74u8, 253u8, 106u8, 46u8, 157u8, 21u8, - ], - ) - } - #[doc = "Change the maximum number of members in society and the maximum number of new candidates"] - #[doc = "in a single intake period."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be Signed by the Founder."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `max_members` - The maximum number of members for the society. This must be no less"] - #[doc = " than the current number of members."] - #[doc = "- `max_intake` - The maximum number of candidates per intake period."] - #[doc = "- `max_strikes`: The maximum number of strikes a member may get before they become"] - #[doc = " suspended and may only be reinstated by the founder."] - #[doc = "- `candidate_deposit`: The deposit required to make a bid for membership of the group."] - pub fn set_parameters( - &self, - max_members: types::set_parameters::MaxMembers, - max_intake: types::set_parameters::MaxIntake, - max_strikes: types::set_parameters::MaxStrikes, - candidate_deposit: types::set_parameters::CandidateDeposit, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "set_parameters", - types::SetParameters { - max_members, - max_intake, - max_strikes, - candidate_deposit, - }, - [ - 141u8, 29u8, 233u8, 249u8, 125u8, 139u8, 186u8, 89u8, 112u8, 201u8, - 38u8, 108u8, 79u8, 204u8, 140u8, 185u8, 156u8, 202u8, 77u8, 178u8, - 205u8, 99u8, 36u8, 78u8, 68u8, 94u8, 160u8, 198u8, 176u8, 226u8, 35u8, - 229u8, - ], - ) - } - #[doc = "Punish the skeptic with a strike if they did not vote on a candidate. Callable by the"] - #[doc = "candidate."] - pub fn punish_skeptic( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "punish_skeptic", - types::PunishSkeptic {}, - [ - 69u8, 32u8, 105u8, 1u8, 25u8, 240u8, 148u8, 136u8, 141u8, 97u8, 247u8, - 14u8, 18u8, 169u8, 184u8, 247u8, 89u8, 145u8, 239u8, 51u8, 161u8, - 149u8, 37u8, 127u8, 160u8, 54u8, 144u8, 222u8, 54u8, 135u8, 184u8, - 244u8, - ], - ) - } - #[doc = "Transform an approved candidate into a member. Callable only by the"] - #[doc = "the candidate, and only after the period for voting has ended."] - pub fn claim_membership( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "claim_membership", - types::ClaimMembership {}, - [ - 129u8, 50u8, 134u8, 231u8, 159u8, 194u8, 140u8, 16u8, 139u8, 189u8, - 131u8, 82u8, 150u8, 112u8, 138u8, 116u8, 3u8, 28u8, 183u8, 151u8, 19u8, - 122u8, 29u8, 152u8, 88u8, 123u8, 34u8, 84u8, 42u8, 12u8, 230u8, 220u8, - ], - ) - } - #[doc = "Transform an approved candidate into a member. Callable only by the Signed origin of the"] - #[doc = "Founder, only after the period for voting has ended and only when the candidate is not"] - #[doc = "clearly rejected."] - pub fn bestow_membership( - &self, - candidate: types::bestow_membership::Candidate, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "bestow_membership", - types::BestowMembership { candidate }, - [ - 146u8, 123u8, 220u8, 105u8, 41u8, 24u8, 3u8, 83u8, 38u8, 64u8, 93u8, - 69u8, 149u8, 46u8, 177u8, 32u8, 197u8, 152u8, 186u8, 198u8, 39u8, 47u8, - 54u8, 174u8, 86u8, 41u8, 170u8, 74u8, 107u8, 141u8, 169u8, 222u8, - ], - ) - } - #[doc = "Remove the candidate's application from the society. Callable only by the Signed origin"] - #[doc = "of the Founder, only after the period for voting has ended, and only when they do not"] - #[doc = "have a clear approval."] - #[doc = ""] - #[doc = "Any bid deposit is lost and voucher is banned."] - pub fn kick_candidate( - &self, - candidate: types::kick_candidate::Candidate, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "kick_candidate", - types::KickCandidate { candidate }, - [ - 51u8, 17u8, 10u8, 153u8, 91u8, 22u8, 117u8, 204u8, 32u8, 141u8, 59u8, - 94u8, 240u8, 99u8, 247u8, 217u8, 233u8, 39u8, 132u8, 191u8, 225u8, - 74u8, 140u8, 182u8, 106u8, 74u8, 90u8, 129u8, 71u8, 240u8, 5u8, 70u8, - ], - ) - } - #[doc = "Remove the candidate's application from the society. Callable only by the candidate."] - #[doc = ""] - #[doc = "Any bid deposit is lost and voucher is banned."] - pub fn resign_candidacy( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "resign_candidacy", - types::ResignCandidacy {}, - [ - 40u8, 237u8, 128u8, 221u8, 162u8, 143u8, 104u8, 151u8, 11u8, 97u8, - 212u8, 53u8, 26u8, 145u8, 124u8, 196u8, 155u8, 118u8, 232u8, 251u8, - 42u8, 35u8, 11u8, 149u8, 78u8, 99u8, 6u8, 56u8, 23u8, 166u8, 167u8, - 116u8, - ], - ) - } - #[doc = "Remove a `candidate`'s failed application from the society. Callable by any"] - #[doc = "signed origin but only at the end of the subsequent round and only for"] - #[doc = "a candidate with more rejections than approvals."] - #[doc = ""] - #[doc = "The bid deposit is lost and the voucher is banned."] - pub fn drop_candidate( - &self, - candidate: types::drop_candidate::Candidate, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "drop_candidate", - types::DropCandidate { candidate }, - [ - 140u8, 7u8, 82u8, 134u8, 101u8, 180u8, 217u8, 22u8, 204u8, 194u8, - 125u8, 165u8, 69u8, 7u8, 193u8, 0u8, 33u8, 246u8, 43u8, 221u8, 110u8, - 105u8, 227u8, 61u8, 22u8, 110u8, 98u8, 141u8, 44u8, 212u8, 55u8, 157u8, - ], - ) - } - #[doc = "Remove up to `max` stale votes for the given `candidate`."] - #[doc = ""] - #[doc = "May be called by any Signed origin, but only after the candidate's candidacy is ended."] - pub fn cleanup_candidacy( - &self, - candidate: types::cleanup_candidacy::Candidate, - max: types::cleanup_candidacy::Max, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "cleanup_candidacy", - types::CleanupCandidacy { candidate, max }, - [ - 115u8, 111u8, 140u8, 201u8, 68u8, 53u8, 116u8, 204u8, 131u8, 66u8, - 13u8, 123u8, 157u8, 235u8, 252u8, 24u8, 126u8, 233u8, 80u8, 227u8, - 130u8, 231u8, 81u8, 23u8, 104u8, 39u8, 166u8, 3u8, 231u8, 137u8, 172u8, - 107u8, - ], - ) - } - #[doc = "Remove up to `max` stale votes for the defender in the given `challenge_round`."] - #[doc = ""] - #[doc = "May be called by any Signed origin, but only after the challenge round is ended."] - pub fn cleanup_challenge( - &self, - challenge_round: types::cleanup_challenge::ChallengeRound, - max: types::cleanup_challenge::Max, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "cleanup_challenge", - types::CleanupChallenge { - challenge_round, - max, - }, - [ - 255u8, 67u8, 39u8, 222u8, 23u8, 216u8, 63u8, 255u8, 82u8, 135u8, 30u8, - 135u8, 120u8, 255u8, 56u8, 223u8, 137u8, 72u8, 128u8, 165u8, 147u8, - 167u8, 93u8, 17u8, 118u8, 27u8, 32u8, 187u8, 220u8, 206u8, 123u8, - 242u8, - ], - ) - } - #[doc = "Poke the deposit reserved when bidding."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be the bidder."] - #[doc = ""] - #[doc = "The transaction fee is waived if the deposit is changed after poking/reconsideration."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if successful."] - pub fn poke_deposit( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Society", - "poke_deposit", - types::PokeDeposit {}, - [ - 127u8, 254u8, 187u8, 13u8, 51u8, 85u8, 145u8, 82u8, 61u8, 152u8, 218u8, - 135u8, 191u8, 67u8, 53u8, 140u8, 42u8, 68u8, 7u8, 14u8, 95u8, 60u8, - 41u8, 135u8, 32u8, 99u8, 40u8, 111u8, 10u8, 21u8, 103u8, 107u8, - ], - ) - } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_society::pallet::Event; - pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The society is founded by the given identity."] - pub struct Founded { - pub founder: founded::Founder, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A user outside of the society can make a bid for entry."] + #[doc = ""] + #[doc = "Payment: The group's Candidate Deposit will be reserved for making a bid. It is returned"] + #[doc = "when the bid becomes a member, or if the bid calls `unbid`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `value`: A one time payment the bid would like to receive when joining the society."] + pub struct Bid { + pub value: bid::Value, } - pub mod founded { + pub mod bid { use super::runtime_types; - pub type Founder = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Value = ::core::primitive::u128; + } + impl Bid { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "bid"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Founded { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Founded"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for Bid { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A membership bid just happened. The given account is the candidate's ID and their offer"] - #[doc = "is the second."] - pub struct Bid { - pub candidate_id: bid::CandidateId, - pub offer: bid::Offer, - } - pub mod bid { - use super::runtime_types; - pub type CandidateId = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Offer = ::core::primitive::u128; + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bidder can remove their bid for entry into society."] + #[doc = "By doing so, they will have their candidate deposit returned or"] + #[doc = "they will unvouch their voucher."] + #[doc = ""] + #[doc = "Payment: The bid deposit is unreserved if the user made a bid."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a bidder."] + pub struct Unbid; + impl Unbid { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "unbid"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Bid { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Bid"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for Unbid { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A membership bid just happened by vouching. The given account is the candidate's ID and"] - #[doc = "their offer is the second. The vouching party is the third."] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "As a member, vouch for someone to join society by placing a bid on their behalf."] + #[doc = ""] + #[doc = "There is no deposit required to vouch for a new bid, but a member can only vouch for"] + #[doc = "one bid at a time. If the bid becomes a suspended candidate and ultimately rejected by"] + #[doc = "the suspension judgement origin, the member will be banned from vouching again."] + #[doc = ""] + #[doc = "As a vouching member, you can claim a tip if the candidate is accepted. This tip will"] + #[doc = "be paid as a portion of the reward the member will receive for joining the society."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a member."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `who`: The user who you would like to vouch for."] + #[doc = "- `value`: The total reward to be paid between you and the candidate if they become"] + #[doc = "a member in the society."] + #[doc = "- `tip`: Your cut of the total `value` payout when the candidate is inducted into"] + #[doc = "the society. Tips larger than `value` will be saturated upon payout."] pub struct Vouch { - pub candidate_id: vouch::CandidateId, - pub offer: vouch::Offer, - pub vouching: vouch::Vouching, + pub who: vouch::Who, + pub value: vouch::Value, + pub tip: vouch::Tip, } pub mod vouch { use super::runtime_types; - pub type CandidateId = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Offer = ::core::primitive::u128; - pub type Vouching = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Value = ::core::primitive::u128; + pub type Tip = ::core::primitive::u128; + } + impl Vouch { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "vouch"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Vouch { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Vouch"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for Vouch { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A candidate was dropped (due to an excess of bids in the system)."] - pub struct AutoUnbid { - pub candidate: auto_unbid::Candidate, - } - pub mod auto_unbid { - use super::runtime_types; - pub type Candidate = ::subxt::ext::subxt_core::utils::AccountId32; + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "As a vouching member, unvouch a bid. This only works while vouched user is"] + #[doc = "only a bidder (and not a candidate)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a vouching member."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `pos`: Position in the `Bids` vector of the bid who should be unvouched."] + pub struct Unvouch; + impl Unvouch { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "unvouch"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AutoUnbid { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "AutoUnbid"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for Unvouch { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A candidate was dropped (by their request)."] - pub struct Unbid { - pub candidate: unbid::Candidate, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "As a member, vote on a candidate."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a member."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `candidate`: The candidate that the member would like to bid on."] + #[doc = "- `approve`: A boolean which says if the candidate should be approved (`true`) or"] + #[doc = " rejected (`false`)."] + pub struct Vote { + pub candidate: vote::Candidate, + pub approve: vote::Approve, } - pub mod unbid { + pub mod vote { + use super::runtime_types; + pub type Candidate = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Approve = ::core::primitive::bool; + } + impl Vote { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "vote"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Vote { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "As a member, vote on the defender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a member."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `approve`: A boolean which says if the candidate should be"] + #[doc = "approved (`true`) or rejected (`false`)."] + pub struct DefenderVote { + pub approve: defender_vote::Approve, + } + pub mod defender_vote { + use super::runtime_types; + pub type Approve = ::core::primitive::bool; + } + impl DefenderVote { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "defender_vote"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for DefenderVote { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transfer the first matured payout for the sender and remove it from the records."] + #[doc = ""] + #[doc = "NOTE: This extrinsic needs to be called multiple times to claim multiple matured"] + #[doc = "payouts."] + #[doc = ""] + #[doc = "Payment: The member will receive a payment equal to their first matured"] + #[doc = "payout to their free balance."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a member with"] + #[doc = "payouts remaining."] + pub struct Payout; + impl Payout { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "payout"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Payout { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Repay the payment previously given to the member with the signed origin, remove any"] + #[doc = "pending payments, and elevate them from rank 0 to rank 1."] + pub struct WaiveRepay { + pub amount: waive_repay::Amount, + } + pub mod waive_repay { + use super::runtime_types; + pub type Amount = ::core::primitive::u128; + } + impl WaiveRepay { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "waive_repay"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for WaiveRepay { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Found the society."] + #[doc = ""] + #[doc = "This is done as a discrete action in order to allow for the"] + #[doc = "pallet to be included into a running chain and can only be done once."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be from the _FounderSetOrigin_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `founder` - The first member and head of the newly founded society."] + #[doc = "- `max_members` - The initial max number of members for the society."] + #[doc = "- `max_intake` - The maximum number of candidates per intake period."] + #[doc = "- `max_strikes`: The maximum number of strikes a member may get before they become"] + #[doc = " suspended and may only be reinstated by the founder."] + #[doc = "- `candidate_deposit`: The deposit required to make a bid for membership of the group."] + #[doc = "- `rules` - The rules of this society concerning membership."] + #[doc = ""] + #[doc = "Complexity: O(1)"] + pub struct FoundSociety { + pub founder: found_society::Founder, + pub max_members: found_society::MaxMembers, + pub max_intake: found_society::MaxIntake, + pub max_strikes: found_society::MaxStrikes, + pub candidate_deposit: found_society::CandidateDeposit, + pub rules: found_society::Rules, + } + pub mod found_society { + use super::runtime_types; + pub type Founder = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type MaxMembers = ::core::primitive::u32; + pub type MaxIntake = ::core::primitive::u32; + pub type MaxStrikes = ::core::primitive::u32; + pub type CandidateDeposit = ::core::primitive::u128; + pub type Rules = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl FoundSociety { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "found_society"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for FoundSociety { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Dissolve the society and remove all members."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be Signed, and the signing account must be both"] + #[doc = "the `Founder` and the `Head`. This implies that it may only be done when there is one"] + #[doc = "member."] + pub struct Dissolve; + impl Dissolve { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "dissolve"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Dissolve { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Allow suspension judgement origin to make judgement on a suspended member."] + #[doc = ""] + #[doc = "If a suspended member is forgiven, we simply add them back as a member, not affecting"] + #[doc = "any of the existing storage items for that member."] + #[doc = ""] + #[doc = "If a suspended member is rejected, remove all associated storage items, including"] + #[doc = "their payouts, and remove any vouched bids they currently have."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be Signed from the Founder."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `who` - The suspended member to be judged."] + #[doc = "- `forgive` - A boolean representing whether the suspension judgement origin forgives"] + #[doc = " (`true`) or rejects (`false`) a suspended member."] + pub struct JudgeSuspendedMember { + pub who: judge_suspended_member::Who, + pub forgive: judge_suspended_member::Forgive, + } + pub mod judge_suspended_member { + use super::runtime_types; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Forgive = ::core::primitive::bool; + } + impl JudgeSuspendedMember { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "judge_suspended_member"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for JudgeSuspendedMember { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Change the maximum number of members in society and the maximum number of new candidates"] + #[doc = "in a single intake period."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be Signed by the Founder."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `max_members` - The maximum number of members for the society. This must be no less"] + #[doc = " than the current number of members."] + #[doc = "- `max_intake` - The maximum number of candidates per intake period."] + #[doc = "- `max_strikes`: The maximum number of strikes a member may get before they become"] + #[doc = " suspended and may only be reinstated by the founder."] + #[doc = "- `candidate_deposit`: The deposit required to make a bid for membership of the group."] + pub struct SetParameters { + pub max_members: set_parameters::MaxMembers, + pub max_intake: set_parameters::MaxIntake, + pub max_strikes: set_parameters::MaxStrikes, + pub candidate_deposit: set_parameters::CandidateDeposit, + } + pub mod set_parameters { + use super::runtime_types; + pub type MaxMembers = ::core::primitive::u32; + pub type MaxIntake = ::core::primitive::u32; + pub type MaxStrikes = ::core::primitive::u32; + pub type CandidateDeposit = ::core::primitive::u128; + } + impl SetParameters { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "set_parameters"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetParameters { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Punish the skeptic with a strike if they did not vote on a candidate. Callable by the"] + #[doc = "candidate."] + pub struct PunishSkeptic; + impl PunishSkeptic { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "punish_skeptic"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PunishSkeptic { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transform an approved candidate into a member. Callable only by the"] + #[doc = "the candidate, and only after the period for voting has ended."] + pub struct ClaimMembership; + impl ClaimMembership { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "claim_membership"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ClaimMembership { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transform an approved candidate into a member. Callable only by the Signed origin of the"] + #[doc = "Founder, only after the period for voting has ended and only when the candidate is not"] + #[doc = "clearly rejected."] + pub struct BestowMembership { + pub candidate: bestow_membership::Candidate, + } + pub mod bestow_membership { + use super::runtime_types; + pub type Candidate = ::subxt::utils::AccountId32; + } + impl BestowMembership { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "bestow_membership"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for BestowMembership { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove the candidate's application from the society. Callable only by the Signed origin"] + #[doc = "of the Founder, only after the period for voting has ended, and only when they do not"] + #[doc = "have a clear approval."] + #[doc = ""] + #[doc = "Any bid deposit is lost and voucher is banned."] + pub struct KickCandidate { + pub candidate: kick_candidate::Candidate, + } + pub mod kick_candidate { + use super::runtime_types; + pub type Candidate = ::subxt::utils::AccountId32; + } + impl KickCandidate { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "kick_candidate"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for KickCandidate { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove the candidate's application from the society. Callable only by the candidate."] + #[doc = ""] + #[doc = "Any bid deposit is lost and voucher is banned."] + pub struct ResignCandidacy; + impl ResignCandidacy { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "resign_candidacy"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ResignCandidacy { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove a `candidate`'s failed application from the society. Callable by any"] + #[doc = "signed origin but only at the end of the subsequent round and only for"] + #[doc = "a candidate with more rejections than approvals."] + #[doc = ""] + #[doc = "The bid deposit is lost and the voucher is banned."] + pub struct DropCandidate { + pub candidate: drop_candidate::Candidate, + } + pub mod drop_candidate { + use super::runtime_types; + pub type Candidate = ::subxt::utils::AccountId32; + } + impl DropCandidate { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "drop_candidate"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for DropCandidate { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove up to `max` stale votes for the given `candidate`."] + #[doc = ""] + #[doc = "May be called by any Signed origin, but only after the candidate's candidacy is ended."] + pub struct CleanupCandidacy { + pub candidate: cleanup_candidacy::Candidate, + pub max: cleanup_candidacy::Max, + } + pub mod cleanup_candidacy { + use super::runtime_types; + pub type Candidate = ::subxt::utils::AccountId32; + pub type Max = ::core::primitive::u32; + } + impl CleanupCandidacy { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "cleanup_candidacy"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CleanupCandidacy { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove up to `max` stale votes for the defender in the given `challenge_round`."] + #[doc = ""] + #[doc = "May be called by any Signed origin, but only after the challenge round is ended."] + pub struct CleanupChallenge { + pub challenge_round: cleanup_challenge::ChallengeRound, + pub max: cleanup_challenge::Max, + } + pub mod cleanup_challenge { + use super::runtime_types; + pub type ChallengeRound = ::core::primitive::u32; + pub type Max = ::core::primitive::u32; + } + impl CleanupChallenge { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "cleanup_challenge"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CleanupChallenge { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Poke the deposit reserved when bidding."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be the bidder."] + #[doc = ""] + #[doc = "The transaction fee is waived if the deposit is changed after poking/reconsideration."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if successful."] + pub struct PokeDeposit; + impl PokeDeposit { + const PALLET_NAME: &'static str = "Society"; + const CALL_NAME: &'static str = "poke_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PokeDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "A user outside of the society can make a bid for entry."] + #[doc = ""] + #[doc = "Payment: The group's Candidate Deposit will be reserved for making a bid. It is returned"] + #[doc = "when the bid becomes a member, or if the bid calls `unbid`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `value`: A one time payment the bid would like to receive when joining the society."] + pub fn bid( + &self, + value: super::bid::Value, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "bid", + super::Bid { value }, + [ + 196u8, 8u8, 236u8, 188u8, 3u8, 185u8, 190u8, 227u8, 11u8, 146u8, + 225u8, 241u8, 196u8, 125u8, 128u8, 67u8, 244u8, 144u8, 10u8, 152u8, + 161u8, 60u8, 72u8, 33u8, 124u8, 137u8, 40u8, 200u8, 177u8, 21u8, + 27u8, 45u8, + ], + ) + } + #[doc = "A bidder can remove their bid for entry into society."] + #[doc = "By doing so, they will have their candidate deposit returned or"] + #[doc = "they will unvouch their voucher."] + #[doc = ""] + #[doc = "Payment: The bid deposit is unreserved if the user made a bid."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a bidder."] + pub fn unbid(&self) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "unbid", + super::Unbid {}, + [ + 188u8, 248u8, 46u8, 6u8, 82u8, 191u8, 129u8, 234u8, 187u8, 249u8, + 69u8, 242u8, 173u8, 185u8, 209u8, 51u8, 228u8, 80u8, 27u8, 111u8, + 59u8, 110u8, 180u8, 106u8, 205u8, 6u8, 121u8, 66u8, 232u8, 89u8, + 166u8, 154u8, + ], + ) + } + #[doc = "As a member, vouch for someone to join society by placing a bid on their behalf."] + #[doc = ""] + #[doc = "There is no deposit required to vouch for a new bid, but a member can only vouch for"] + #[doc = "one bid at a time. If the bid becomes a suspended candidate and ultimately rejected by"] + #[doc = "the suspension judgement origin, the member will be banned from vouching again."] + #[doc = ""] + #[doc = "As a vouching member, you can claim a tip if the candidate is accepted. This tip will"] + #[doc = "be paid as a portion of the reward the member will receive for joining the society."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a member."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `who`: The user who you would like to vouch for."] + #[doc = "- `value`: The total reward to be paid between you and the candidate if they become"] + #[doc = "a member in the society."] + #[doc = "- `tip`: Your cut of the total `value` payout when the candidate is inducted into"] + #[doc = "the society. Tips larger than `value` will be saturated upon payout."] + pub fn vouch( + &self, + who: super::vouch::Who, + value: super::vouch::Value, + tip: super::vouch::Tip, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "vouch", + super::Vouch { who, value, tip }, + [ + 112u8, 149u8, 72u8, 181u8, 135u8, 149u8, 62u8, 134u8, 12u8, 214u8, + 0u8, 31u8, 142u8, 128u8, 27u8, 243u8, 210u8, 197u8, 72u8, 177u8, + 164u8, 112u8, 223u8, 28u8, 43u8, 149u8, 5u8, 249u8, 157u8, 150u8, + 123u8, 58u8, + ], + ) + } + #[doc = "As a vouching member, unvouch a bid. This only works while vouched user is"] + #[doc = "only a bidder (and not a candidate)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a vouching member."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `pos`: Position in the `Bids` vector of the bid who should be unvouched."] + pub fn unvouch(&self) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "unvouch", + super::Unvouch {}, + [ + 205u8, 176u8, 119u8, 76u8, 199u8, 30u8, 22u8, 108u8, 111u8, 117u8, + 24u8, 9u8, 164u8, 14u8, 126u8, 124u8, 224u8, 50u8, 195u8, 136u8, + 244u8, 77u8, 238u8, 99u8, 97u8, 133u8, 151u8, 109u8, 245u8, 83u8, + 159u8, 136u8, + ], + ) + } + #[doc = "As a member, vote on a candidate."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a member."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `candidate`: The candidate that the member would like to bid on."] + #[doc = "- `approve`: A boolean which says if the candidate should be approved (`true`) or"] + #[doc = " rejected (`false`)."] + pub fn vote( + &self, + candidate: super::vote::Candidate, + approve: super::vote::Approve, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "vote", + super::Vote { candidate, approve }, + [ + 64u8, 168u8, 166u8, 195u8, 208u8, 246u8, 156u8, 39u8, 195u8, 28u8, + 153u8, 58u8, 52u8, 185u8, 166u8, 8u8, 108u8, 169u8, 44u8, 70u8, + 244u8, 244u8, 81u8, 27u8, 236u8, 79u8, 123u8, 176u8, 155u8, 40u8, + 154u8, 70u8, + ], + ) + } + #[doc = "As a member, vote on the defender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a member."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `approve`: A boolean which says if the candidate should be"] + #[doc = "approved (`true`) or rejected (`false`)."] + pub fn defender_vote( + &self, + approve: super::defender_vote::Approve, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "defender_vote", + super::DefenderVote { approve }, + [ + 38u8, 196u8, 123u8, 172u8, 243u8, 40u8, 208u8, 63u8, 231u8, 155u8, + 151u8, 181u8, 58u8, 122u8, 185u8, 86u8, 76u8, 124u8, 168u8, 225u8, + 37u8, 13u8, 127u8, 250u8, 122u8, 124u8, 140u8, 57u8, 242u8, 214u8, + 145u8, 119u8, + ], + ) + } + #[doc = "Transfer the first matured payout for the sender and remove it from the records."] + #[doc = ""] + #[doc = "NOTE: This extrinsic needs to be called multiple times to claim multiple matured"] + #[doc = "payouts."] + #[doc = ""] + #[doc = "Payment: The member will receive a payment equal to their first matured"] + #[doc = "payout to their free balance."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a member with"] + #[doc = "payouts remaining."] + pub fn payout(&self) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "payout", + super::Payout {}, + [ + 214u8, 12u8, 233u8, 89u8, 186u8, 0u8, 61u8, 206u8, 251u8, 1u8, + 55u8, 0u8, 126u8, 105u8, 55u8, 109u8, 101u8, 104u8, 46u8, 98u8, + 62u8, 228u8, 64u8, 195u8, 61u8, 24u8, 48u8, 148u8, 146u8, 108u8, + 67u8, 52u8, + ], + ) + } + #[doc = "Repay the payment previously given to the member with the signed origin, remove any"] + #[doc = "pending payments, and elevate them from rank 0 to rank 1."] + pub fn waive_repay( + &self, + amount: super::waive_repay::Amount, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "waive_repay", + super::WaiveRepay { amount }, + [ + 83u8, 11u8, 65u8, 16u8, 92u8, 73u8, 39u8, 178u8, 16u8, 170u8, 41u8, + 70u8, 241u8, 255u8, 89u8, 121u8, 50u8, 140u8, 240u8, 31u8, 27u8, + 51u8, 51u8, 22u8, 241u8, 218u8, 127u8, 76u8, 52u8, 246u8, 214u8, + 52u8, + ], + ) + } + #[doc = "Found the society."] + #[doc = ""] + #[doc = "This is done as a discrete action in order to allow for the"] + #[doc = "pallet to be included into a running chain and can only be done once."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be from the _FounderSetOrigin_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `founder` - The first member and head of the newly founded society."] + #[doc = "- `max_members` - The initial max number of members for the society."] + #[doc = "- `max_intake` - The maximum number of candidates per intake period."] + #[doc = "- `max_strikes`: The maximum number of strikes a member may get before they become"] + #[doc = " suspended and may only be reinstated by the founder."] + #[doc = "- `candidate_deposit`: The deposit required to make a bid for membership of the group."] + #[doc = "- `rules` - The rules of this society concerning membership."] + #[doc = ""] + #[doc = "Complexity: O(1)"] + pub fn found_society( + &self, + founder: super::found_society::Founder, + max_members: super::found_society::MaxMembers, + max_intake: super::found_society::MaxIntake, + max_strikes: super::found_society::MaxStrikes, + candidate_deposit: super::found_society::CandidateDeposit, + rules: super::found_society::Rules, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "found_society", + super::FoundSociety { + founder, + max_members, + max_intake, + max_strikes, + candidate_deposit, + rules, + }, + [ + 232u8, 23u8, 175u8, 166u8, 217u8, 99u8, 210u8, 160u8, 122u8, 68u8, + 169u8, 134u8, 248u8, 126u8, 186u8, 130u8, 97u8, 245u8, 69u8, 159u8, + 19u8, 52u8, 67u8, 144u8, 77u8, 154u8, 215u8, 67u8, 233u8, 96u8, + 40u8, 81u8, + ], + ) + } + #[doc = "Dissolve the society and remove all members."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be Signed, and the signing account must be both"] + #[doc = "the `Founder` and the `Head`. This implies that it may only be done when there is one"] + #[doc = "member."] + pub fn dissolve( + &self, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "dissolve", + super::Dissolve {}, + [ + 159u8, 138u8, 214u8, 34u8, 208u8, 201u8, 11u8, 33u8, 173u8, 66u8, + 243u8, 3u8, 226u8, 190u8, 199u8, 200u8, 215u8, 210u8, 226u8, 213u8, + 150u8, 217u8, 192u8, 88u8, 87u8, 202u8, 226u8, 105u8, 20u8, 201u8, + 50u8, 242u8, + ], + ) + } + #[doc = "Allow suspension judgement origin to make judgement on a suspended member."] + #[doc = ""] + #[doc = "If a suspended member is forgiven, we simply add them back as a member, not affecting"] + #[doc = "any of the existing storage items for that member."] + #[doc = ""] + #[doc = "If a suspended member is rejected, remove all associated storage items, including"] + #[doc = "their payouts, and remove any vouched bids they currently have."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be Signed from the Founder."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `who` - The suspended member to be judged."] + #[doc = "- `forgive` - A boolean representing whether the suspension judgement origin forgives"] + #[doc = " (`true`) or rejects (`false`) a suspended member."] + pub fn judge_suspended_member( + &self, + who: super::judge_suspended_member::Who, + forgive: super::judge_suspended_member::Forgive, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "judge_suspended_member", + super::JudgeSuspendedMember { who, forgive }, + [ + 219u8, 45u8, 90u8, 201u8, 128u8, 28u8, 215u8, 68u8, 125u8, 127u8, + 57u8, 207u8, 25u8, 110u8, 162u8, 30u8, 211u8, 208u8, 192u8, 182u8, + 69u8, 151u8, 233u8, 84u8, 81u8, 72u8, 74u8, 253u8, 106u8, 46u8, + 157u8, 21u8, + ], + ) + } + #[doc = "Change the maximum number of members in society and the maximum number of new candidates"] + #[doc = "in a single intake period."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be Signed by the Founder."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `max_members` - The maximum number of members for the society. This must be no less"] + #[doc = " than the current number of members."] + #[doc = "- `max_intake` - The maximum number of candidates per intake period."] + #[doc = "- `max_strikes`: The maximum number of strikes a member may get before they become"] + #[doc = " suspended and may only be reinstated by the founder."] + #[doc = "- `candidate_deposit`: The deposit required to make a bid for membership of the group."] + pub fn set_parameters( + &self, + max_members: super::set_parameters::MaxMembers, + max_intake: super::set_parameters::MaxIntake, + max_strikes: super::set_parameters::MaxStrikes, + candidate_deposit: super::set_parameters::CandidateDeposit, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "set_parameters", + super::SetParameters { + max_members, + max_intake, + max_strikes, + candidate_deposit, + }, + [ + 141u8, 29u8, 233u8, 249u8, 125u8, 139u8, 186u8, 89u8, 112u8, 201u8, + 38u8, 108u8, 79u8, 204u8, 140u8, 185u8, 156u8, 202u8, 77u8, 178u8, + 205u8, 99u8, 36u8, 78u8, 68u8, 94u8, 160u8, 198u8, 176u8, 226u8, + 35u8, 229u8, + ], + ) + } + #[doc = "Punish the skeptic with a strike if they did not vote on a candidate. Callable by the"] + #[doc = "candidate."] + pub fn punish_skeptic( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "punish_skeptic", + super::PunishSkeptic {}, + [ + 69u8, 32u8, 105u8, 1u8, 25u8, 240u8, 148u8, 136u8, 141u8, 97u8, + 247u8, 14u8, 18u8, 169u8, 184u8, 247u8, 89u8, 145u8, 239u8, 51u8, + 161u8, 149u8, 37u8, 127u8, 160u8, 54u8, 144u8, 222u8, 54u8, 135u8, + 184u8, 244u8, + ], + ) + } + #[doc = "Transform an approved candidate into a member. Callable only by the"] + #[doc = "the candidate, and only after the period for voting has ended."] + pub fn claim_membership( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "claim_membership", + super::ClaimMembership {}, + [ + 129u8, 50u8, 134u8, 231u8, 159u8, 194u8, 140u8, 16u8, 139u8, 189u8, + 131u8, 82u8, 150u8, 112u8, 138u8, 116u8, 3u8, 28u8, 183u8, 151u8, + 19u8, 122u8, 29u8, 152u8, 88u8, 123u8, 34u8, 84u8, 42u8, 12u8, + 230u8, 220u8, + ], + ) + } + #[doc = "Transform an approved candidate into a member. Callable only by the Signed origin of the"] + #[doc = "Founder, only after the period for voting has ended and only when the candidate is not"] + #[doc = "clearly rejected."] + pub fn bestow_membership( + &self, + candidate: super::bestow_membership::Candidate, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "bestow_membership", + super::BestowMembership { candidate }, + [ + 146u8, 123u8, 220u8, 105u8, 41u8, 24u8, 3u8, 83u8, 38u8, 64u8, + 93u8, 69u8, 149u8, 46u8, 177u8, 32u8, 197u8, 152u8, 186u8, 198u8, + 39u8, 47u8, 54u8, 174u8, 86u8, 41u8, 170u8, 74u8, 107u8, 141u8, + 169u8, 222u8, + ], + ) + } + #[doc = "Remove the candidate's application from the society. Callable only by the Signed origin"] + #[doc = "of the Founder, only after the period for voting has ended, and only when they do not"] + #[doc = "have a clear approval."] + #[doc = ""] + #[doc = "Any bid deposit is lost and voucher is banned."] + pub fn kick_candidate( + &self, + candidate: super::kick_candidate::Candidate, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "kick_candidate", + super::KickCandidate { candidate }, + [ + 51u8, 17u8, 10u8, 153u8, 91u8, 22u8, 117u8, 204u8, 32u8, 141u8, + 59u8, 94u8, 240u8, 99u8, 247u8, 217u8, 233u8, 39u8, 132u8, 191u8, + 225u8, 74u8, 140u8, 182u8, 106u8, 74u8, 90u8, 129u8, 71u8, 240u8, + 5u8, 70u8, + ], + ) + } + #[doc = "Remove the candidate's application from the society. Callable only by the candidate."] + #[doc = ""] + #[doc = "Any bid deposit is lost and voucher is banned."] + pub fn resign_candidacy( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "resign_candidacy", + super::ResignCandidacy {}, + [ + 40u8, 237u8, 128u8, 221u8, 162u8, 143u8, 104u8, 151u8, 11u8, 97u8, + 212u8, 53u8, 26u8, 145u8, 124u8, 196u8, 155u8, 118u8, 232u8, 251u8, + 42u8, 35u8, 11u8, 149u8, 78u8, 99u8, 6u8, 56u8, 23u8, 166u8, 167u8, + 116u8, + ], + ) + } + #[doc = "Remove a `candidate`'s failed application from the society. Callable by any"] + #[doc = "signed origin but only at the end of the subsequent round and only for"] + #[doc = "a candidate with more rejections than approvals."] + #[doc = ""] + #[doc = "The bid deposit is lost and the voucher is banned."] + pub fn drop_candidate( + &self, + candidate: super::drop_candidate::Candidate, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "drop_candidate", + super::DropCandidate { candidate }, + [ + 140u8, 7u8, 82u8, 134u8, 101u8, 180u8, 217u8, 22u8, 204u8, 194u8, + 125u8, 165u8, 69u8, 7u8, 193u8, 0u8, 33u8, 246u8, 43u8, 221u8, + 110u8, 105u8, 227u8, 61u8, 22u8, 110u8, 98u8, 141u8, 44u8, 212u8, + 55u8, 157u8, + ], + ) + } + #[doc = "Remove up to `max` stale votes for the given `candidate`."] + #[doc = ""] + #[doc = "May be called by any Signed origin, but only after the candidate's candidacy is ended."] + pub fn cleanup_candidacy( + &self, + candidate: super::cleanup_candidacy::Candidate, + max: super::cleanup_candidacy::Max, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "cleanup_candidacy", + super::CleanupCandidacy { candidate, max }, + [ + 115u8, 111u8, 140u8, 201u8, 68u8, 53u8, 116u8, 204u8, 131u8, 66u8, + 13u8, 123u8, 157u8, 235u8, 252u8, 24u8, 126u8, 233u8, 80u8, 227u8, + 130u8, 231u8, 81u8, 23u8, 104u8, 39u8, 166u8, 3u8, 231u8, 137u8, + 172u8, 107u8, + ], + ) + } + #[doc = "Remove up to `max` stale votes for the defender in the given `challenge_round`."] + #[doc = ""] + #[doc = "May be called by any Signed origin, but only after the challenge round is ended."] + pub fn cleanup_challenge( + &self, + challenge_round: super::cleanup_challenge::ChallengeRound, + max: super::cleanup_challenge::Max, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "cleanup_challenge", + super::CleanupChallenge { + challenge_round, + max, + }, + [ + 255u8, 67u8, 39u8, 222u8, 23u8, 216u8, 63u8, 255u8, 82u8, 135u8, + 30u8, 135u8, 120u8, 255u8, 56u8, 223u8, 137u8, 72u8, 128u8, 165u8, + 147u8, 167u8, 93u8, 17u8, 118u8, 27u8, 32u8, 187u8, 220u8, 206u8, + 123u8, 242u8, + ], + ) + } + #[doc = "Poke the deposit reserved when bidding."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be the bidder."] + #[doc = ""] + #[doc = "The transaction fee is waived if the deposit is changed after poking/reconsideration."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if successful."] + pub fn poke_deposit( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Society", + "poke_deposit", + super::PokeDeposit {}, + [ + 127u8, 254u8, 187u8, 13u8, 51u8, 85u8, 145u8, 82u8, 61u8, 152u8, + 218u8, 135u8, 191u8, 67u8, 53u8, 140u8, 42u8, 68u8, 7u8, 14u8, + 95u8, 60u8, 41u8, 135u8, 32u8, 99u8, 40u8, 111u8, 10u8, 21u8, + 103u8, 107u8, + ], + ) + } + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_society::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "The society is founded by the given identity."] + pub struct Founded { + pub founder: founded::Founder, + } + pub mod founded { + use super::runtime_types; + pub type Founder = ::subxt::utils::AccountId32; + } + impl Founded { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Founded"; + } + impl ::subxt::events::DecodeAsEvent for Founded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A membership bid just happened. The given account is the candidate's ID and their offer"] + #[doc = "is the second."] + pub struct Bid { + pub candidate_id: bid::CandidateId, + pub offer: bid::Offer, + } + pub mod bid { + use super::runtime_types; + pub type CandidateId = ::subxt::utils::AccountId32; + pub type Offer = ::core::primitive::u128; + } + impl Bid { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Bid"; + } + impl ::subxt::events::DecodeAsEvent for Bid { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A membership bid just happened by vouching. The given account is the candidate's ID and"] + #[doc = "their offer is the second. The vouching party is the third."] + pub struct Vouch { + pub candidate_id: vouch::CandidateId, + pub offer: vouch::Offer, + pub vouching: vouch::Vouching, + } + pub mod vouch { + use super::runtime_types; + pub type CandidateId = ::subxt::utils::AccountId32; + pub type Offer = ::core::primitive::u128; + pub type Vouching = ::subxt::utils::AccountId32; + } + impl Vouch { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Vouch"; + } + impl ::subxt::events::DecodeAsEvent for Vouch { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A candidate was dropped (due to an excess of bids in the system)."] + pub struct AutoUnbid { + pub candidate: auto_unbid::Candidate, + } + pub mod auto_unbid { + use super::runtime_types; + pub type Candidate = ::subxt::utils::AccountId32; + } + impl AutoUnbid { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "AutoUnbid"; + } + impl ::subxt::events::DecodeAsEvent for AutoUnbid { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A candidate was dropped (by their request)."] + pub struct Unbid { + pub candidate: unbid::Candidate, + } + pub mod unbid { use super::runtime_types; - pub type Candidate = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Candidate = ::subxt::utils::AccountId32; + } + impl Unbid { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Unbid"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Unbid { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Unbid"; + impl ::subxt::events::DecodeAsEvent for Unbid { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A candidate was dropped (by request of who vouched for them)."] pub struct Unvouch { pub candidate: unvouch::Candidate, } pub mod unvouch { use super::runtime_types; - pub type Candidate = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Candidate = ::subxt::utils::AccountId32; + } + impl Unvouch { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Unvouch"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Unvouch { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Unvouch"; + impl ::subxt::events::DecodeAsEvent for Unvouch { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A group of candidates have been inducted. The batch's primary is the first value, the"] #[doc = "batch in full is the second."] pub struct Inducted { @@ -20102,22 +20489,25 @@ pub mod api { } pub mod inducted { use super::runtime_types; - pub type Primary = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Candidates = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; + pub type Primary = ::subxt::utils::AccountId32; + pub type Candidates = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Inducted { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Inducted"; + impl Inducted { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Inducted"; + } + impl ::subxt::events::DecodeAsEvent for Inducted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A suspended member has been judged."] pub struct SuspendedMemberJudgement { pub who: suspended_member_judgement::Who, @@ -20125,77 +20515,97 @@ pub mod api { } pub mod suspended_member_judgement { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Judged = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SuspendedMemberJudgement { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "SuspendedMemberJudgement"; + impl SuspendedMemberJudgement { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "SuspendedMemberJudgement"; + } + impl ::subxt::events::DecodeAsEvent for SuspendedMemberJudgement { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A candidate has been suspended"] pub struct CandidateSuspended { pub candidate: candidate_suspended::Candidate, } pub mod candidate_suspended { use super::runtime_types; - pub type Candidate = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Candidate = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CandidateSuspended { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "CandidateSuspended"; + impl CandidateSuspended { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "CandidateSuspended"; + } + impl ::subxt::events::DecodeAsEvent for CandidateSuspended { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A member has been suspended"] pub struct MemberSuspended { pub member: member_suspended::Member, } pub mod member_suspended { use super::runtime_types; - pub type Member = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Member = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberSuspended { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "MemberSuspended"; + impl MemberSuspended { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "MemberSuspended"; + } + impl ::subxt::events::DecodeAsEvent for MemberSuspended { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A member has been challenged"] pub struct Challenged { pub member: challenged::Member, } pub mod challenged { use super::runtime_types; - pub type Member = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Member = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Challenged { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Challenged"; + impl Challenged { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Challenged"; + } + impl ::subxt::events::DecodeAsEvent for Challenged { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A vote has been placed"] pub struct Vote { pub candidate: vote::Candidate, @@ -20204,21 +20614,26 @@ pub mod api { } pub mod vote { use super::runtime_types; - pub type Candidate = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Voter = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Candidate = ::subxt::utils::AccountId32; + pub type Voter = ::subxt::utils::AccountId32; pub type Vote = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Vote { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Vote"; + impl Vote { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Vote"; + } + impl ::subxt::events::DecodeAsEvent for Vote { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A vote has been placed for a defending member"] pub struct DefenderVote { pub voter: defender_vote::Voter, @@ -20226,20 +20641,25 @@ pub mod api { } pub mod defender_vote { use super::runtime_types; - pub type Voter = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Voter = ::subxt::utils::AccountId32; pub type Vote = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DefenderVote { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "DefenderVote"; + impl DefenderVote { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "DefenderVote"; + } + impl ::subxt::events::DecodeAsEvent for DefenderVote { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A new set of \\[params\\] has been set for the group."] pub struct NewParams { pub params: new_params::Params, @@ -20249,36 +20669,46 @@ pub mod api { pub type Params = runtime_types::pallet_society::GroupParams<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NewParams { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "NewParams"; + impl NewParams { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "NewParams"; + } + impl ::subxt::events::DecodeAsEvent for NewParams { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Society is unfounded."] pub struct Unfounded { pub founder: unfounded::Founder, } pub mod unfounded { use super::runtime_types; - pub type Founder = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Founder = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Unfounded { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Unfounded"; + impl Unfounded { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Unfounded"; + } + impl ::subxt::events::DecodeAsEvent for Unfounded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some funds were deposited into the society account."] pub struct Deposit { pub value: deposit::Value, @@ -20287,17 +20717,22 @@ pub mod api { use super::runtime_types; pub type Value = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Deposit { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Deposit"; + impl Deposit { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Deposit"; + } + impl ::subxt::events::DecodeAsEvent for Deposit { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A \\[member\\] got elevated to \\[rank\\]."] pub struct Elevated { pub member: elevated::Member, @@ -20305,20 +20740,25 @@ pub mod api { } pub mod elevated { use super::runtime_types; - pub type Member = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Member = ::subxt::utils::AccountId32; pub type Rank = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Elevated { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Elevated"; + impl Elevated { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "Elevated"; + } + impl ::subxt::events::DecodeAsEvent for Elevated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A deposit was poked / adjusted."] pub struct DepositPoked { pub who: deposit_poked::Who, @@ -20327,13 +20767,18 @@ pub mod api { } pub mod deposit_poked { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type OldDeposit = ::core::primitive::u128; pub type NewDeposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "DepositPoked"; + impl DepositPoked { + const PALLET_NAME: &'static str = "Society"; + const EVENT_NAME: &'static str = "DepositPoked"; + } + impl ::subxt::events::DecodeAsEvent for DepositPoked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -20344,12 +20789,9 @@ pub mod api { #[doc = " The max number of members for the society at one time."] pub fn parameters( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - parameters::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), parameters::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "Parameters", [ @@ -20363,12 +20805,9 @@ pub mod api { #[doc = " Amount of our account balance that is specifically for the next round's bid(s)."] pub fn pot( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - pot::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), pot::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "Pot", [ @@ -20381,12 +20820,9 @@ pub mod api { #[doc = " The first member."] pub fn founder( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - founder::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), founder::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "Founder", [ @@ -20400,12 +20836,9 @@ pub mod api { #[doc = " The most primary from the most recently approved rank 0 members in the society."] pub fn head( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - head::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), head::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "Head", [ @@ -20419,12 +20852,9 @@ pub mod api { #[doc = " only by the founder."] pub fn rules( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - rules::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), rules::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "Rules", [ @@ -20437,12 +20867,12 @@ pub mod api { #[doc = " The current members and their rank. Doesn't include `SuspendedMembers`."] pub fn members( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (members::Param0,), - members::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (members::input::Param0,), + members::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Society", "Members", [ @@ -20456,12 +20886,12 @@ pub mod api { #[doc = " Information regarding rank-0 payouts, past and future."] pub fn payouts( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (payouts::Param0,), - payouts::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (payouts::input::Param0,), + payouts::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Society", "Payouts", [ @@ -20474,12 +20904,9 @@ pub mod api { #[doc = " The number of items in `Members` currently. (Doesn't include `SuspendedMembers`.)"] pub fn member_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - member_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), member_count::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "MemberCount", [ @@ -20494,12 +20921,12 @@ pub mod api { #[doc = " `0..MemberCount` (does not include `MemberCount`)."] pub fn member_by_index( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (member_by_index::Param0,), - member_by_index::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (member_by_index::input::Param0,), + member_by_index::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Society", "MemberByIndex", [ @@ -20512,12 +20939,12 @@ pub mod api { #[doc = " The set of suspended members, with their old membership record."] pub fn suspended_members( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (suspended_members::Param0,), - suspended_members::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (suspended_members::input::Param0,), + suspended_members::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Society", "SuspendedMembers", [ @@ -20530,12 +20957,9 @@ pub mod api { #[doc = " The number of rounds which have passed."] pub fn round_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - round_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), round_count::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "RoundCount", [ @@ -20549,12 +20973,9 @@ pub mod api { #[doc = " The current bids, stored ordered by the value of the bid."] pub fn bids( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - bids::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), bids::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "Bids", [ @@ -20567,12 +20988,12 @@ pub mod api { } pub fn candidates( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (candidates::Param0,), - candidates::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (candidates::input::Param0,), + candidates::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Society", "Candidates", [ @@ -20586,12 +21007,9 @@ pub mod api { #[doc = " The current skeptic."] pub fn skeptic( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - skeptic::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), skeptic::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "Skeptic", [ @@ -20604,12 +21022,12 @@ pub mod api { #[doc = " Double map from Candidate -> Voter -> (Maybe) Vote."] pub fn votes( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (votes::Param0, votes::Param1), - votes::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (votes::input::Param0, votes::input::Param1), + votes::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Society", "Votes", [ @@ -20623,12 +21041,12 @@ pub mod api { #[doc = " Clear-cursor for Vote, map from Candidate -> (Maybe) Cursor."] pub fn vote_clear_cursor( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (vote_clear_cursor::Param0,), - vote_clear_cursor::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (vote_clear_cursor::input::Param0,), + vote_clear_cursor::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Society", "VoteClearCursor", [ @@ -20643,12 +21061,9 @@ pub mod api { #[doc = " become the new `Head`."] pub fn next_head( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - next_head::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), next_head::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "NextHead", [ @@ -20661,12 +21076,12 @@ pub mod api { #[doc = " The number of challenge rounds there have been. Used to identify stale DefenderVotes."] pub fn challenge_round_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - challenge_round_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + challenge_round_count::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Society", "ChallengeRoundCount", [ @@ -20680,12 +21095,9 @@ pub mod api { #[doc = " The defending member currently being challenged, along with a running tally of votes."] pub fn defending( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - defending::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), defending::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "Defending", [ @@ -20698,12 +21110,12 @@ pub mod api { #[doc = " Votes for the defender, keyed by challenge round."] pub fn defender_votes( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (defender_votes::Param0, defender_votes::Param1), - defender_votes::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (defender_votes::input::Param0, defender_votes::input::Param1), + defender_votes::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Society", "DefenderVotes", [ @@ -20716,12 +21128,9 @@ pub mod api { #[doc = " Next intake rotation scheduled with [Config::BlockNumberProvider]."] pub fn next_intake_at( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - next_intake_at::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), next_intake_at::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Society", "NextIntakeAt", [ @@ -20734,12 +21143,12 @@ pub mod api { #[doc = " Next challenge rotation scheduled with [Config::BlockNumberProvider]."] pub fn next_challenge_at( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - next_challenge_at::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + next_challenge_at::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Society", "NextChallengeAt", [ @@ -20754,212 +21163,212 @@ pub mod api { pub mod parameters { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::pallet_society::GroupParams<::core::primitive::u128>; } + pub type Output = + runtime_types::pallet_society::GroupParams<::core::primitive::u128>; } pub mod pot { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u128; } + pub type Output = ::core::primitive::u128; } pub mod founder { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; } + pub type Output = ::subxt::utils::AccountId32; } pub mod head { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; } + pub type Output = ::subxt::utils::AccountId32; } pub mod rules { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::H256; } + pub type Output = ::subxt::utils::H256; } pub mod members { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_society::MemberRecord; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_society::MemberRecord; } pub mod payouts { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_society::PayoutRecord< - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u128, - )>, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_society::PayoutRecord< + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u32, + ::core::primitive::u128, + )>, + >; } pub mod member_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod member_by_index { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::subxt::utils::AccountId32; } pub mod suspended_members { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_society::MemberRecord; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_society::MemberRecord; } pub mod round_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod bids { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_society::Bid< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >, - >; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_society::Bid< + ::subxt::utils::AccountId32, + ::core::primitive::u128, + >, + >; } pub mod candidates { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_society::Candidacy< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_society::Candidacy< + ::subxt::utils::AccountId32, + ::core::primitive::u128, + >; } pub mod skeptic { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; } + pub type Output = ::subxt::utils::AccountId32; } pub mod votes { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_society::Vote; + pub type Param0 = ::subxt::utils::AccountId32; + pub type Param1 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_society::Vote; } pub mod vote_clear_cursor { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; } pub mod next_head { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_society::IntakeRecord< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; } + pub type Output = runtime_types::pallet_society::IntakeRecord< + ::subxt::utils::AccountId32, + ::core::primitive::u128, + >; } pub mod challenge_round_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod defending { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ( - ::subxt::ext::subxt_core::utils::AccountId32, - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::pallet_society::Tally, - ); } + pub type Output = ( + ::subxt::utils::AccountId32, + ::subxt::utils::AccountId32, + runtime_types::pallet_society::Tally, + ); } pub mod defender_votes { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_society::Vote; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_society::Vote; } pub mod next_intake_at { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod next_challenge_at { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } } pub mod constants { @@ -20969,10 +21378,9 @@ pub mod api { #[doc = " The societies's pallet id"] pub fn pallet_id( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress + { + ::subxt::constants::StaticAddress::new_static( "Society", "PalletId", [ @@ -20985,10 +21393,8 @@ pub mod api { #[doc = " The maximum number of strikes before a member gets funds slashed."] pub fn grace_strikes( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Society", "GraceStrikes", [ @@ -21002,10 +21408,8 @@ pub mod api { #[doc = " The amount of incentive paid within each period. Doesn't include VoterTip."] pub fn period_spend( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Society", "PeriodSpend", [ @@ -21020,10 +21424,8 @@ pub mod api { #[doc = " `ClaimPeriod`, this sums to the number of blocks between candidate intake periods."] pub fn voting_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Society", "VotingPeriod", [ @@ -21038,10 +21440,8 @@ pub mod api { #[doc = " their membership and be the named head."] pub fn claim_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Society", "ClaimPeriod", [ @@ -21055,10 +21455,8 @@ pub mod api { #[doc = " The maximum duration of the payout lock."] pub fn max_lock_duration( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Society", "MaxLockDuration", [ @@ -21072,10 +21470,8 @@ pub mod api { #[doc = " The number of [Config::BlockNumberProvider] blocks between membership challenges."] pub fn challenge_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Society", "ChallengePeriod", [ @@ -21089,10 +21485,8 @@ pub mod api { #[doc = " The maximum number of payouts a member may have waiting unclaimed."] pub fn max_payouts( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Society", "MaxPayouts", [ @@ -21106,10 +21500,8 @@ pub mod api { #[doc = " The maximum number of bids at once."] pub fn max_bids( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Society", "MaxBids", [ @@ -21133,677 +21525,658 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Send a call through a recovered account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] + #[doc = "- `call`: The call you want to make with the recovered account."] + pub struct AsRecovered { + pub account: as_recovered::Account, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod as_recovered { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Send a call through a recovered account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] - #[doc = "- `call`: The call you want to make with the recovered account."] - pub struct AsRecovered { - pub account: as_recovered::Account, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod as_recovered { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "as_recovered"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] - #[doc = "for a lost account directly."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _ROOT_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The \"lost account\" to be recovered."] - #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] - pub struct SetRecovered { - pub lost: set_recovered::Lost, - pub rescuer: set_recovered::Rescuer, - } - pub mod set_recovered { - use super::runtime_types; - pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "set_recovered"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] - #[doc = ""] - #[doc = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] - #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] - #[doc = "in full when the user calls `remove_recovery`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] - #[doc = " ordered and contain no duplicate values."] - #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] - #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] - #[doc = " friends."] - #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] - #[doc = " needs to pass before the account can be recovered."] - pub struct CreateRecovery { - pub friends: create_recovery::Friends, - pub threshold: create_recovery::Threshold, - pub delay_period: create_recovery::DelayPeriod, - } - pub mod create_recovery { - use super::runtime_types; - pub type Friends = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Threshold = ::core::primitive::u16; - pub type DelayPeriod = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "create_recovery"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Initiate the process for recovering a recoverable account."] - #[doc = ""] - #[doc = "Payment: `RecoveryDeposit` balance will be reserved for initiating the"] - #[doc = "recovery process. This deposit will always be repatriated to the account"] - #[doc = "trying to be recovered. See `close_recovery`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The lost account that you want to recover. This account needs to be"] - #[doc = " recoverable (i.e. have a recovery configuration)."] - pub struct InitiateRecovery { - pub account: initiate_recovery::Account, - } - pub mod initiate_recovery { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for InitiateRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "initiate_recovery"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] - #[doc = "process for that account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] - #[doc = "for the recoverable account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The lost account that you want to recover."] - #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] - #[doc = ""] - #[doc = "The combination of these two parameters must point to an active recovery"] - #[doc = "process."] - pub struct VouchRecovery { - pub lost: vouch_recovery::Lost, - pub rescuer: vouch_recovery::Rescuer, - } - pub mod vouch_recovery { - use super::runtime_types; - pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VouchRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "vouch_recovery"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allow a successful rescuer to claim their recovered account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] - #[doc = "who has successfully completed the account recovery process: collected"] - #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] - #[doc = " you."] - pub struct ClaimRecovery { - pub account: claim_recovery::Account, - } - pub mod claim_recovery { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "claim_recovery"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "As the controller of a recoverable account, close an active recovery"] - #[doc = "process for your account."] - #[doc = ""] - #[doc = "Payment: By calling this function, the recoverable account will receive"] - #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account with an active recovery process for it."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] - pub struct CloseRecovery { - pub rescuer: close_recovery::Rescuer, - } - pub mod close_recovery { - use super::runtime_types; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CloseRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "close_recovery"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] - #[doc = ""] - #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] - #[doc = "recovery attempts before calling this function else it will fail."] - #[doc = ""] - #[doc = "Payment: By calling this function the recoverable account will unreserve"] - #[doc = "their recovery configuration deposit."] - #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account (i.e. has a recovery configuration)."] - pub struct RemoveRecovery; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "remove_recovery"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel the ability to use `as_recovered` for `account`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] - pub struct CancelRecovered { - pub account: cancel_recovered::Account, - } - pub mod cancel_recovered { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "cancel_recovered"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Poke deposits for recovery configurations and / or active recoveries."] - #[doc = ""] - #[doc = "This can be used by accounts to possibly lower their locked amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] - #[doc = "and want to adjust the deposit for the active recovery."] - #[doc = ""] - #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] - #[doc = "of the caller:"] - #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] - #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] - #[doc = "`maybe_account`, checks and adjusts those deposits"] - #[doc = ""] - #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] - #[doc = "account."] - #[doc = ""] - #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if any deposit is updated."] - #[doc = "Multiple events may be emitted in case both types of deposits are updated."] - pub struct PokeDeposit { - pub maybe_account: poke_deposit::MaybeAccount, - } - pub mod poke_deposit { - use super::runtime_types; - pub type MaybeAccount = ::core::option::Option< - ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "poke_deposit"; + pub type Account = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl AsRecovered { + const PALLET_NAME: &'static str = "Recovery"; + const CALL_NAME: &'static str = "as_recovered"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AsRecovered { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Send a call through a recovered account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] - #[doc = "- `call`: The call you want to make with the recovered account."] - pub fn as_recovered( - &self, - account: types::as_recovered::Account, - call: types::as_recovered::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "as_recovered", - types::AsRecovered { - account, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 202u8, 158u8, 177u8, 109u8, 142u8, 51u8, 247u8, 244u8, 31u8, 67u8, - 178u8, 75u8, 40u8, 12u8, 147u8, 252u8, 100u8, 42u8, 245u8, 8u8, 84u8, - 192u8, 168u8, 2u8, 252u8, 159u8, 230u8, 143u8, 159u8, 116u8, 195u8, - 176u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] + #[doc = "for a lost account directly."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _ROOT_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `lost`: The \"lost account\" to be recovered."] + #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] + pub struct SetRecovered { + pub lost: set_recovered::Lost, + pub rescuer: set_recovered::Rescuer, + } + pub mod set_recovered { + use super::runtime_types; + pub type Lost = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Rescuer = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl SetRecovered { + const PALLET_NAME: &'static str = "Recovery"; + const CALL_NAME: &'static str = "set_recovered"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetRecovered { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] - #[doc = "for a lost account directly."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _ROOT_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The \"lost account\" to be recovered."] - #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] - pub fn set_recovered( - &self, - lost: types::set_recovered::Lost, - rescuer: types::set_recovered::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "set_recovered", - types::SetRecovered { lost, rescuer }, - [ - 194u8, 147u8, 14u8, 197u8, 132u8, 185u8, 122u8, 81u8, 61u8, 14u8, 10u8, - 177u8, 74u8, 184u8, 150u8, 217u8, 246u8, 149u8, 26u8, 165u8, 196u8, - 83u8, 230u8, 195u8, 213u8, 40u8, 51u8, 180u8, 23u8, 90u8, 3u8, 14u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] + #[doc = ""] + #[doc = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] + #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] + #[doc = "in full when the user calls `remove_recovery`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] + #[doc = " ordered and contain no duplicate values."] + #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] + #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] + #[doc = " friends."] + #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] + #[doc = " needs to pass before the account can be recovered."] + pub struct CreateRecovery { + pub friends: create_recovery::Friends, + pub threshold: create_recovery::Threshold, + pub delay_period: create_recovery::DelayPeriod, + } + pub mod create_recovery { + use super::runtime_types; + pub type Friends = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + pub type Threshold = ::core::primitive::u16; + pub type DelayPeriod = ::core::primitive::u32; + } + impl CreateRecovery { + const PALLET_NAME: &'static str = "Recovery"; + const CALL_NAME: &'static str = "create_recovery"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CreateRecovery { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] - #[doc = ""] - #[doc = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] - #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] - #[doc = "in full when the user calls `remove_recovery`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] - #[doc = " ordered and contain no duplicate values."] - #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] - #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] - #[doc = " friends."] - #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] - #[doc = " needs to pass before the account can be recovered."] - pub fn create_recovery( - &self, - friends: types::create_recovery::Friends, - threshold: types::create_recovery::Threshold, - delay_period: types::create_recovery::DelayPeriod, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "create_recovery", - types::CreateRecovery { - friends, - threshold, - delay_period, - }, - [ - 36u8, 175u8, 11u8, 85u8, 95u8, 170u8, 58u8, 193u8, 102u8, 18u8, 117u8, - 27u8, 199u8, 214u8, 70u8, 47u8, 129u8, 130u8, 109u8, 242u8, 240u8, - 255u8, 120u8, 176u8, 40u8, 243u8, 175u8, 71u8, 3u8, 91u8, 186u8, 220u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Initiate the process for recovering a recoverable account."] + #[doc = ""] + #[doc = "Payment: `RecoveryDeposit` balance will be reserved for initiating the"] + #[doc = "recovery process. This deposit will always be repatriated to the account"] + #[doc = "trying to be recovered. See `close_recovery`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The lost account that you want to recover. This account needs to be"] + #[doc = " recoverable (i.e. have a recovery configuration)."] + pub struct InitiateRecovery { + pub account: initiate_recovery::Account, + } + pub mod initiate_recovery { + use super::runtime_types; + pub type Account = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl InitiateRecovery { + const PALLET_NAME: &'static str = "Recovery"; + const CALL_NAME: &'static str = "initiate_recovery"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for InitiateRecovery { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Initiate the process for recovering a recoverable account."] - #[doc = ""] - #[doc = "Payment: `RecoveryDeposit` balance will be reserved for initiating the"] - #[doc = "recovery process. This deposit will always be repatriated to the account"] - #[doc = "trying to be recovered. See `close_recovery`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The lost account that you want to recover. This account needs to be"] - #[doc = " recoverable (i.e. have a recovery configuration)."] - pub fn initiate_recovery( - &self, - account: types::initiate_recovery::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "initiate_recovery", - types::InitiateRecovery { account }, - [ - 60u8, 243u8, 229u8, 176u8, 221u8, 52u8, 44u8, 224u8, 233u8, 14u8, 89u8, - 100u8, 174u8, 74u8, 38u8, 32u8, 97u8, 48u8, 53u8, 74u8, 30u8, 242u8, - 19u8, 114u8, 145u8, 74u8, 69u8, 125u8, 227u8, 214u8, 144u8, 58u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] + #[doc = "process for that account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] + #[doc = "for the recoverable account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `lost`: The lost account that you want to recover."] + #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] + #[doc = ""] + #[doc = "The combination of these two parameters must point to an active recovery"] + #[doc = "process."] + pub struct VouchRecovery { + pub lost: vouch_recovery::Lost, + pub rescuer: vouch_recovery::Rescuer, + } + pub mod vouch_recovery { + use super::runtime_types; + pub type Lost = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Rescuer = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl VouchRecovery { + const PALLET_NAME: &'static str = "Recovery"; + const CALL_NAME: &'static str = "vouch_recovery"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for VouchRecovery { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] - #[doc = "process for that account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] - #[doc = "for the recoverable account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The lost account that you want to recover."] - #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] - #[doc = ""] - #[doc = "The combination of these two parameters must point to an active recovery"] - #[doc = "process."] - pub fn vouch_recovery( - &self, - lost: types::vouch_recovery::Lost, - rescuer: types::vouch_recovery::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "vouch_recovery", - types::VouchRecovery { lost, rescuer }, - [ - 97u8, 190u8, 60u8, 15u8, 191u8, 117u8, 1u8, 217u8, 62u8, 40u8, 210u8, - 1u8, 237u8, 111u8, 48u8, 196u8, 180u8, 154u8, 198u8, 12u8, 108u8, 42u8, - 6u8, 234u8, 2u8, 113u8, 163u8, 111u8, 80u8, 146u8, 6u8, 73u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Allow a successful rescuer to claim their recovered account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] + #[doc = "who has successfully completed the account recovery process: collected"] + #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] + #[doc = " you."] + pub struct ClaimRecovery { + pub account: claim_recovery::Account, + } + pub mod claim_recovery { + use super::runtime_types; + pub type Account = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl ClaimRecovery { + const PALLET_NAME: &'static str = "Recovery"; + const CALL_NAME: &'static str = "claim_recovery"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ClaimRecovery { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Allow a successful rescuer to claim their recovered account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] - #[doc = "who has successfully completed the account recovery process: collected"] - #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] - #[doc = " you."] - pub fn claim_recovery( - &self, - account: types::claim_recovery::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "claim_recovery", - types::ClaimRecovery { account }, - [ - 41u8, 47u8, 162u8, 88u8, 13u8, 166u8, 130u8, 146u8, 218u8, 162u8, - 166u8, 33u8, 89u8, 129u8, 177u8, 178u8, 68u8, 128u8, 161u8, 229u8, - 207u8, 3u8, 57u8, 35u8, 211u8, 208u8, 74u8, 155u8, 183u8, 173u8, 74u8, - 56u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "As the controller of a recoverable account, close an active recovery"] + #[doc = "process for your account."] + #[doc = ""] + #[doc = "Payment: By calling this function, the recoverable account will receive"] + #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account with an active recovery process for it."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] + pub struct CloseRecovery { + pub rescuer: close_recovery::Rescuer, + } + pub mod close_recovery { + use super::runtime_types; + pub type Rescuer = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl CloseRecovery { + const PALLET_NAME: &'static str = "Recovery"; + const CALL_NAME: &'static str = "close_recovery"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CloseRecovery { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "As the controller of a recoverable account, close an active recovery"] - #[doc = "process for your account."] - #[doc = ""] - #[doc = "Payment: By calling this function, the recoverable account will receive"] - #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account with an active recovery process for it."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] - pub fn close_recovery( - &self, - rescuer: types::close_recovery::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "close_recovery", - types::CloseRecovery { rescuer }, - [ - 161u8, 178u8, 117u8, 209u8, 119u8, 164u8, 135u8, 41u8, 25u8, 108u8, - 194u8, 175u8, 221u8, 65u8, 184u8, 137u8, 171u8, 97u8, 204u8, 61u8, - 159u8, 39u8, 192u8, 53u8, 246u8, 69u8, 113u8, 16u8, 170u8, 232u8, - 163u8, 10u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] + #[doc = ""] + #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] + #[doc = "recovery attempts before calling this function else it will fail."] + #[doc = ""] + #[doc = "Payment: By calling this function the recoverable account will unreserve"] + #[doc = "their recovery configuration deposit."] + #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account (i.e. has a recovery configuration)."] + pub struct RemoveRecovery; + impl RemoveRecovery { + const PALLET_NAME: &'static str = "Recovery"; + const CALL_NAME: &'static str = "remove_recovery"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveRecovery { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] - #[doc = ""] - #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] - #[doc = "recovery attempts before calling this function else it will fail."] - #[doc = ""] - #[doc = "Payment: By calling this function the recoverable account will unreserve"] - #[doc = "their recovery configuration deposit."] - #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account (i.e. has a recovery configuration)."] - pub fn remove_recovery( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "remove_recovery", - types::RemoveRecovery {}, - [ - 11u8, 38u8, 133u8, 172u8, 212u8, 252u8, 57u8, 216u8, 42u8, 202u8, - 206u8, 91u8, 115u8, 91u8, 242u8, 123u8, 95u8, 196u8, 172u8, 243u8, - 164u8, 1u8, 69u8, 180u8, 40u8, 68u8, 208u8, 221u8, 161u8, 250u8, 8u8, - 72u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] + pub struct CancelRecovered { + pub account: cancel_recovered::Account, + } + pub mod cancel_recovered { + use super::runtime_types; + pub type Account = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl CancelRecovered { + const PALLET_NAME: &'static str = "Recovery"; + const CALL_NAME: &'static str = "cancel_recovered"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CancelRecovered { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Cancel the ability to use `as_recovered` for `account`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] - pub fn cancel_recovered( - &self, - account: types::cancel_recovered::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "cancel_recovered", - types::CancelRecovered { account }, - [ - 100u8, 222u8, 80u8, 226u8, 187u8, 188u8, 111u8, 58u8, 190u8, 5u8, - 178u8, 144u8, 37u8, 98u8, 71u8, 145u8, 28u8, 248u8, 222u8, 188u8, 53u8, - 21u8, 127u8, 176u8, 249u8, 166u8, 250u8, 59u8, 170u8, 33u8, 251u8, - 239u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Poke deposits for recovery configurations and / or active recoveries."] + #[doc = ""] + #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] + #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = ""] + #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] + #[doc = "of the caller:"] + #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] + #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] + #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = ""] + #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] + #[doc = "account."] + #[doc = ""] + #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if any deposit is updated."] + #[doc = "Multiple events may be emitted in case both types of deposits are updated."] + pub struct PokeDeposit { + pub maybe_account: poke_deposit::MaybeAccount, + } + pub mod poke_deposit { + use super::runtime_types; + pub type MaybeAccount = ::core::option::Option< + ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + >; + } + impl PokeDeposit { + const PALLET_NAME: &'static str = "Recovery"; + const CALL_NAME: &'static str = "poke_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PokeDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Poke deposits for recovery configurations and / or active recoveries."] - #[doc = ""] - #[doc = "This can be used by accounts to possibly lower their locked amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] - #[doc = "and want to adjust the deposit for the active recovery."] - #[doc = ""] - #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] - #[doc = "of the caller:"] - #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] - #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] - #[doc = "`maybe_account`, checks and adjusts those deposits"] - #[doc = ""] - #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] - #[doc = "account."] - #[doc = ""] - #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if any deposit is updated."] - #[doc = "Multiple events may be emitted in case both types of deposits are updated."] - pub fn poke_deposit( - &self, - maybe_account: types::poke_deposit::MaybeAccount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "poke_deposit", - types::PokeDeposit { maybe_account }, - [ - 177u8, 98u8, 53u8, 15u8, 228u8, 36u8, 173u8, 55u8, 125u8, 3u8, 234u8, - 70u8, 147u8, 147u8, 124u8, 86u8, 31u8, 101u8, 171u8, 56u8, 148u8, - 180u8, 87u8, 149u8, 11u8, 113u8, 195u8, 35u8, 56u8, 32u8, 251u8, 56u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Send a call through a recovered account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] + #[doc = "- `call`: The call you want to make with the recovered account."] + pub fn as_recovered( + &self, + account: super::as_recovered::Account, + call: super::as_recovered::Call, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Recovery", + "as_recovered", + super::AsRecovered { + account, + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 202u8, 158u8, 177u8, 109u8, 142u8, 51u8, 247u8, 244u8, 31u8, 67u8, + 178u8, 75u8, 40u8, 12u8, 147u8, 252u8, 100u8, 42u8, 245u8, 8u8, + 84u8, 192u8, 168u8, 2u8, 252u8, 159u8, 230u8, 143u8, 159u8, 116u8, + 195u8, 176u8, + ], + ) + } + #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] + #[doc = "for a lost account directly."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _ROOT_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `lost`: The \"lost account\" to be recovered."] + #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] + pub fn set_recovered( + &self, + lost: super::set_recovered::Lost, + rescuer: super::set_recovered::Rescuer, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Recovery", + "set_recovered", + super::SetRecovered { lost, rescuer }, + [ + 194u8, 147u8, 14u8, 197u8, 132u8, 185u8, 122u8, 81u8, 61u8, 14u8, + 10u8, 177u8, 74u8, 184u8, 150u8, 217u8, 246u8, 149u8, 26u8, 165u8, + 196u8, 83u8, 230u8, 195u8, 213u8, 40u8, 51u8, 180u8, 23u8, 90u8, + 3u8, 14u8, + ], + ) + } + #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] + #[doc = ""] + #[doc = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] + #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] + #[doc = "in full when the user calls `remove_recovery`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] + #[doc = " ordered and contain no duplicate values."] + #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] + #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] + #[doc = " friends."] + #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] + #[doc = " needs to pass before the account can be recovered."] + pub fn create_recovery( + &self, + friends: super::create_recovery::Friends, + threshold: super::create_recovery::Threshold, + delay_period: super::create_recovery::DelayPeriod, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Recovery", + "create_recovery", + super::CreateRecovery { + friends, + threshold, + delay_period, + }, + [ + 36u8, 175u8, 11u8, 85u8, 95u8, 170u8, 58u8, 193u8, 102u8, 18u8, + 117u8, 27u8, 199u8, 214u8, 70u8, 47u8, 129u8, 130u8, 109u8, 242u8, + 240u8, 255u8, 120u8, 176u8, 40u8, 243u8, 175u8, 71u8, 3u8, 91u8, + 186u8, 220u8, + ], + ) + } + #[doc = "Initiate the process for recovering a recoverable account."] + #[doc = ""] + #[doc = "Payment: `RecoveryDeposit` balance will be reserved for initiating the"] + #[doc = "recovery process. This deposit will always be repatriated to the account"] + #[doc = "trying to be recovered. See `close_recovery`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The lost account that you want to recover. This account needs to be"] + #[doc = " recoverable (i.e. have a recovery configuration)."] + pub fn initiate_recovery( + &self, + account: super::initiate_recovery::Account, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Recovery", + "initiate_recovery", + super::InitiateRecovery { account }, + [ + 60u8, 243u8, 229u8, 176u8, 221u8, 52u8, 44u8, 224u8, 233u8, 14u8, + 89u8, 100u8, 174u8, 74u8, 38u8, 32u8, 97u8, 48u8, 53u8, 74u8, 30u8, + 242u8, 19u8, 114u8, 145u8, 74u8, 69u8, 125u8, 227u8, 214u8, 144u8, + 58u8, + ], + ) + } + #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] + #[doc = "process for that account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] + #[doc = "for the recoverable account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `lost`: The lost account that you want to recover."] + #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] + #[doc = ""] + #[doc = "The combination of these two parameters must point to an active recovery"] + #[doc = "process."] + pub fn vouch_recovery( + &self, + lost: super::vouch_recovery::Lost, + rescuer: super::vouch_recovery::Rescuer, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Recovery", + "vouch_recovery", + super::VouchRecovery { lost, rescuer }, + [ + 97u8, 190u8, 60u8, 15u8, 191u8, 117u8, 1u8, 217u8, 62u8, 40u8, + 210u8, 1u8, 237u8, 111u8, 48u8, 196u8, 180u8, 154u8, 198u8, 12u8, + 108u8, 42u8, 6u8, 234u8, 2u8, 113u8, 163u8, 111u8, 80u8, 146u8, + 6u8, 73u8, + ], + ) + } + #[doc = "Allow a successful rescuer to claim their recovered account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] + #[doc = "who has successfully completed the account recovery process: collected"] + #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] + #[doc = " you."] + pub fn claim_recovery( + &self, + account: super::claim_recovery::Account, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Recovery", + "claim_recovery", + super::ClaimRecovery { account }, + [ + 41u8, 47u8, 162u8, 88u8, 13u8, 166u8, 130u8, 146u8, 218u8, 162u8, + 166u8, 33u8, 89u8, 129u8, 177u8, 178u8, 68u8, 128u8, 161u8, 229u8, + 207u8, 3u8, 57u8, 35u8, 211u8, 208u8, 74u8, 155u8, 183u8, 173u8, + 74u8, 56u8, + ], + ) + } + #[doc = "As the controller of a recoverable account, close an active recovery"] + #[doc = "process for your account."] + #[doc = ""] + #[doc = "Payment: By calling this function, the recoverable account will receive"] + #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account with an active recovery process for it."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] + pub fn close_recovery( + &self, + rescuer: super::close_recovery::Rescuer, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Recovery", + "close_recovery", + super::CloseRecovery { rescuer }, + [ + 161u8, 178u8, 117u8, 209u8, 119u8, 164u8, 135u8, 41u8, 25u8, 108u8, + 194u8, 175u8, 221u8, 65u8, 184u8, 137u8, 171u8, 97u8, 204u8, 61u8, + 159u8, 39u8, 192u8, 53u8, 246u8, 69u8, 113u8, 16u8, 170u8, 232u8, + 163u8, 10u8, + ], + ) + } + #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] + #[doc = ""] + #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] + #[doc = "recovery attempts before calling this function else it will fail."] + #[doc = ""] + #[doc = "Payment: By calling this function the recoverable account will unreserve"] + #[doc = "their recovery configuration deposit."] + #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account (i.e. has a recovery configuration)."] + pub fn remove_recovery( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Recovery", + "remove_recovery", + super::RemoveRecovery {}, + [ + 11u8, 38u8, 133u8, 172u8, 212u8, 252u8, 57u8, 216u8, 42u8, 202u8, + 206u8, 91u8, 115u8, 91u8, 242u8, 123u8, 95u8, 196u8, 172u8, 243u8, + 164u8, 1u8, 69u8, 180u8, 40u8, 68u8, 208u8, 221u8, 161u8, 250u8, + 8u8, 72u8, + ], + ) + } + #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] + pub fn cancel_recovered( + &self, + account: super::cancel_recovered::Account, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Recovery", + "cancel_recovered", + super::CancelRecovered { account }, + [ + 100u8, 222u8, 80u8, 226u8, 187u8, 188u8, 111u8, 58u8, 190u8, 5u8, + 178u8, 144u8, 37u8, 98u8, 71u8, 145u8, 28u8, 248u8, 222u8, 188u8, + 53u8, 21u8, 127u8, 176u8, 249u8, 166u8, 250u8, 59u8, 170u8, 33u8, + 251u8, 239u8, + ], + ) + } + #[doc = "Poke deposits for recovery configurations and / or active recoveries."] + #[doc = ""] + #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] + #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = ""] + #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] + #[doc = "of the caller:"] + #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] + #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] + #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = ""] + #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] + #[doc = "account."] + #[doc = ""] + #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if any deposit is updated."] + #[doc = "Multiple events may be emitted in case both types of deposits are updated."] + pub fn poke_deposit( + &self, + maybe_account: super::poke_deposit::MaybeAccount, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Recovery", + "poke_deposit", + super::PokeDeposit { maybe_account }, + [ + 177u8, 98u8, 53u8, 15u8, 228u8, 36u8, 173u8, 55u8, 125u8, 3u8, + 234u8, 70u8, 147u8, 147u8, 124u8, 86u8, 31u8, 101u8, 171u8, 56u8, + 148u8, 180u8, 87u8, 149u8, 11u8, 113u8, 195u8, 35u8, 56u8, 32u8, + 251u8, 56u8, + ], + ) + } } } } @@ -21812,31 +22185,36 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A recovery process has been set up for an account."] pub struct RecoveryCreated { pub account: recovery_created::Account, } pub mod recovery_created { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Account = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryCreated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryCreated"; + impl RecoveryCreated { + const PALLET_NAME: &'static str = "Recovery"; + const EVENT_NAME: &'static str = "RecoveryCreated"; + } + impl ::subxt::events::DecodeAsEvent for RecoveryCreated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A recovery process has been initiated for lost account by rescuer account."] pub struct RecoveryInitiated { pub lost_account: recovery_initiated::LostAccount, @@ -21844,20 +22222,25 @@ pub mod api { } pub mod recovery_initiated { use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type LostAccount = ::subxt::utils::AccountId32; + pub type RescuerAccount = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryInitiated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryInitiated"; + impl RecoveryInitiated { + const PALLET_NAME: &'static str = "Recovery"; + const EVENT_NAME: &'static str = "RecoveryInitiated"; + } + impl ::subxt::events::DecodeAsEvent for RecoveryInitiated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A recovery process for lost account by rescuer account has been vouched for by sender."] pub struct RecoveryVouched { pub lost_account: recovery_vouched::LostAccount, @@ -21866,21 +22249,26 @@ pub mod api { } pub mod recovery_vouched { use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Sender = ::subxt::ext::subxt_core::utils::AccountId32; + pub type LostAccount = ::subxt::utils::AccountId32; + pub type RescuerAccount = ::subxt::utils::AccountId32; + pub type Sender = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryVouched { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryVouched"; + impl RecoveryVouched { + const PALLET_NAME: &'static str = "Recovery"; + const EVENT_NAME: &'static str = "RecoveryVouched"; + } + impl ::subxt::events::DecodeAsEvent for RecoveryVouched { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A recovery process for lost account by rescuer account has been closed."] pub struct RecoveryClosed { pub lost_account: recovery_closed::LostAccount, @@ -21888,20 +22276,25 @@ pub mod api { } pub mod recovery_closed { use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type LostAccount = ::subxt::utils::AccountId32; + pub type RescuerAccount = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryClosed { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryClosed"; + impl RecoveryClosed { + const PALLET_NAME: &'static str = "Recovery"; + const EVENT_NAME: &'static str = "RecoveryClosed"; + } + impl ::subxt::events::DecodeAsEvent for RecoveryClosed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Lost account has been successfully recovered by rescuer account."] pub struct AccountRecovered { pub lost_account: account_recovered::LostAccount, @@ -21909,39 +22302,49 @@ pub mod api { } pub mod account_recovered { use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type LostAccount = ::subxt::utils::AccountId32; + pub type RescuerAccount = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AccountRecovered { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "AccountRecovered"; + impl AccountRecovered { + const PALLET_NAME: &'static str = "Recovery"; + const EVENT_NAME: &'static str = "AccountRecovered"; + } + impl ::subxt::events::DecodeAsEvent for AccountRecovered { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A recovery process has been removed for an account."] pub struct RecoveryRemoved { pub lost_account: recovery_removed::LostAccount, } pub mod recovery_removed { use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type LostAccount = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryRemoved { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryRemoved"; + impl RecoveryRemoved { + const PALLET_NAME: &'static str = "Recovery"; + const EVENT_NAME: &'static str = "RecoveryRemoved"; + } + impl ::subxt::events::DecodeAsEvent for RecoveryRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A deposit has been updated."] pub struct DepositPoked { pub who: deposit_poked::Who, @@ -21951,16 +22354,21 @@ pub mod api { } pub mod deposit_poked { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Kind = runtime_types::pallet_recovery::DepositKind< runtime_types::rococo_runtime::Runtime, >; pub type OldDeposit = ::core::primitive::u128; pub type NewDeposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "DepositPoked"; + impl DepositPoked { + const PALLET_NAME: &'static str = "Recovery"; + const EVENT_NAME: &'static str = "DepositPoked"; + } + impl ::subxt::events::DecodeAsEvent for DepositPoked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -21971,12 +22379,12 @@ pub mod api { #[doc = " The set of recoverable accounts and their recovery configuration."] pub fn recoverable( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (recoverable::Param0,), - recoverable::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (recoverable::input::Param0,), + recoverable::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Recovery", "Recoverable", [ @@ -21993,12 +22401,15 @@ pub mod api { #[doc = " is the user trying to recover the account."] pub fn active_recoveries( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (active_recoveries::Param0, active_recoveries::Param1), - active_recoveries::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + ( + active_recoveries::input::Param0, + active_recoveries::input::Param1, + ), + active_recoveries::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Recovery", "ActiveRecoveries", [ @@ -22013,12 +22424,12 @@ pub mod api { #[doc = " Map from the user who can access it to the recovered account."] pub fn proxy( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (proxy::Param0,), - proxy::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (proxy::input::Param0,), + proxy::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Recovery", "Proxy", [ @@ -22033,42 +22444,42 @@ pub mod api { pub mod recoverable { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_recovery::RecoveryConfig< - ::core::primitive::u32, - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_recovery::RecoveryConfig< + ::core::primitive::u32, + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::utils::AccountId32, + >, + >; } pub mod active_recoveries { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_recovery::ActiveRecovery< - ::core::primitive::u32, - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; + pub type Param0 = ::subxt::utils::AccountId32; + pub type Param1 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::pallet_recovery::ActiveRecovery< + ::core::primitive::u32, + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::utils::AccountId32, + >, + >; } pub mod proxy { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = ::subxt::utils::AccountId32; } } pub mod constants { @@ -22081,10 +22492,8 @@ pub mod api { #[doc = " `2 + sizeof(BlockNumber, Balance)` bytes."] pub fn config_deposit_base( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Recovery", "ConfigDepositBase", [ @@ -22101,10 +22510,8 @@ pub mod api { #[doc = " value."] pub fn friend_deposit_factor( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Recovery", "FriendDepositFactor", [ @@ -22122,10 +22529,8 @@ pub mod api { #[doc = " to anyway..."] pub fn max_friends( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Recovery", "MaxFriends", [ @@ -22145,10 +22550,8 @@ pub mod api { #[doc = " threshold."] pub fn recovery_deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Recovery", "RecoveryDeposit", [ @@ -22171,429 +22574,418 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Unlock any vested funds of the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct Vest; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vest { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "vest"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Unlock any vested funds of a `target` account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct VestOther { - pub target: vest_other::Target, - } - pub mod vest_other { - use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VestOther { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "vest_other"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account receiving the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct VestedTransfer { - pub target: vested_transfer::Target, - pub schedule: vested_transfer::Schedule, - } - pub mod vested_transfer { - use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Schedule = runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VestedTransfer { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "vested_transfer"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `source`: The account whose funds should be transferred."] - #[doc = "- `target`: The account that should be transferred the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct ForceVestedTransfer { - pub source: force_vested_transfer::Source, - pub target: force_vested_transfer::Target, - pub schedule: force_vested_transfer::Schedule, - } - pub mod force_vested_transfer { - use super::runtime_types; - pub type Source = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Schedule = runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceVestedTransfer { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "force_vested_transfer"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] - #[doc = "the highest possible start and end blocks. If both schedules have already started the"] - #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] - #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] - #[doc = "unmodified."] - #[doc = ""] - #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] - #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] - #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] - #[doc = "and both will be removed."] - #[doc = ""] - #[doc = "Merged schedule attributes:"] - #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] - #[doc = " current_block)`."] - #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] - #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `schedule1_index`: index of the first schedule to merge."] - #[doc = "- `schedule2_index`: index of the second schedule to merge."] - pub struct MergeSchedules { - pub schedule1_index: merge_schedules::Schedule1Index, - pub schedule2_index: merge_schedules::Schedule2Index, - } - pub mod merge_schedules { - use super::runtime_types; - pub type Schedule1Index = ::core::primitive::u32; - pub type Schedule2Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for MergeSchedules { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "merge_schedules"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force remove a vesting schedule"] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `target`: An account that has a vesting schedule"] - #[doc = "- `schedule_index`: The vesting schedule index that should be removed"] - pub struct ForceRemoveVestingSchedule { - pub target: force_remove_vesting_schedule::Target, - pub schedule_index: force_remove_vesting_schedule::ScheduleIndex, - } - pub mod force_remove_vesting_schedule { - use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type ScheduleIndex = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceRemoveVestingSchedule { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "force_remove_vesting_schedule"; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Unlock any vested funds of the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub struct Vest; + impl Vest { + const PALLET_NAME: &'static str = "Vesting"; + const CALL_NAME: &'static str = "vest"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Vest { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Unlock any vested funds of the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vest( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "vest", - types::Vest {}, - [ - 149u8, 89u8, 178u8, 148u8, 127u8, 127u8, 155u8, 60u8, 114u8, 126u8, - 204u8, 123u8, 166u8, 70u8, 104u8, 208u8, 186u8, 69u8, 139u8, 181u8, - 151u8, 154u8, 235u8, 161u8, 191u8, 35u8, 111u8, 60u8, 21u8, 165u8, - 44u8, 122u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Unlock any vested funds of a `target` account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub struct VestOther { + pub target: vest_other::Target, + } + pub mod vest_other { + use super::runtime_types; + pub type Target = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl VestOther { + const PALLET_NAME: &'static str = "Vesting"; + const CALL_NAME: &'static str = "vest_other"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for VestOther { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Unlock any vested funds of a `target` account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vest_other( - &self, - target: types::vest_other::Target, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "vest_other", - types::VestOther { target }, - [ - 238u8, 92u8, 25u8, 149u8, 27u8, 211u8, 196u8, 31u8, 211u8, 28u8, 241u8, - 30u8, 128u8, 35u8, 0u8, 227u8, 202u8, 215u8, 186u8, 69u8, 216u8, 110u8, - 199u8, 120u8, 134u8, 141u8, 176u8, 224u8, 234u8, 42u8, 152u8, 128u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Create a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account receiving the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub struct VestedTransfer { + pub target: vested_transfer::Target, + pub schedule: vested_transfer::Schedule, + } + pub mod vested_transfer { + use super::runtime_types; + pub type Target = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Schedule = runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >; + } + impl VestedTransfer { + const PALLET_NAME: &'static str = "Vesting"; + const CALL_NAME: &'static str = "vested_transfer"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for VestedTransfer { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Create a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account receiving the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vested_transfer( - &self, - target: types::vested_transfer::Target, - schedule: types::vested_transfer::Schedule, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "vested_transfer", - types::VestedTransfer { target, schedule }, - [ - 198u8, 133u8, 254u8, 5u8, 22u8, 170u8, 205u8, 79u8, 218u8, 30u8, 81u8, - 207u8, 227u8, 121u8, 132u8, 14u8, 217u8, 43u8, 66u8, 206u8, 15u8, 80u8, - 173u8, 208u8, 128u8, 72u8, 223u8, 175u8, 93u8, 69u8, 128u8, 88u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Force a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `source`: The account whose funds should be transferred."] + #[doc = "- `target`: The account that should be transferred the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub struct ForceVestedTransfer { + pub source: force_vested_transfer::Source, + pub target: force_vested_transfer::Target, + pub schedule: force_vested_transfer::Schedule, + } + pub mod force_vested_transfer { + use super::runtime_types; + pub type Source = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Target = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Schedule = runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >; + } + impl ForceVestedTransfer { + const PALLET_NAME: &'static str = "Vesting"; + const CALL_NAME: &'static str = "force_vested_transfer"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceVestedTransfer { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Force a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `source`: The account whose funds should be transferred."] - #[doc = "- `target`: The account that should be transferred the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn force_vested_transfer( - &self, - source: types::force_vested_transfer::Source, - target: types::force_vested_transfer::Target, - schedule: types::force_vested_transfer::Schedule, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "force_vested_transfer", - types::ForceVestedTransfer { - source, - target, - schedule, - }, - [ - 112u8, 17u8, 176u8, 133u8, 169u8, 192u8, 155u8, 217u8, 153u8, 36u8, - 230u8, 45u8, 9u8, 192u8, 2u8, 201u8, 165u8, 60u8, 206u8, 226u8, 95u8, - 86u8, 239u8, 196u8, 109u8, 62u8, 224u8, 237u8, 88u8, 74u8, 209u8, - 251u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] + #[doc = "the highest possible start and end blocks. If both schedules have already started the"] + #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] + #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] + #[doc = "unmodified."] + #[doc = ""] + #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] + #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] + #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] + #[doc = "and both will be removed."] + #[doc = ""] + #[doc = "Merged schedule attributes:"] + #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] + #[doc = " current_block)`."] + #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] + #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `schedule1_index`: index of the first schedule to merge."] + #[doc = "- `schedule2_index`: index of the second schedule to merge."] + pub struct MergeSchedules { + pub schedule1_index: merge_schedules::Schedule1Index, + pub schedule2_index: merge_schedules::Schedule2Index, + } + pub mod merge_schedules { + use super::runtime_types; + pub type Schedule1Index = ::core::primitive::u32; + pub type Schedule2Index = ::core::primitive::u32; + } + impl MergeSchedules { + const PALLET_NAME: &'static str = "Vesting"; + const CALL_NAME: &'static str = "merge_schedules"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for MergeSchedules { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] - #[doc = "the highest possible start and end blocks. If both schedules have already started the"] - #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] - #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] - #[doc = "unmodified."] - #[doc = ""] - #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] - #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] - #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] - #[doc = "and both will be removed."] - #[doc = ""] - #[doc = "Merged schedule attributes:"] - #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] - #[doc = " current_block)`."] - #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] - #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `schedule1_index`: index of the first schedule to merge."] - #[doc = "- `schedule2_index`: index of the second schedule to merge."] - pub fn merge_schedules( - &self, - schedule1_index: types::merge_schedules::Schedule1Index, - schedule2_index: types::merge_schedules::Schedule2Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "merge_schedules", - types::MergeSchedules { - schedule1_index, - schedule2_index, - }, - [ - 45u8, 24u8, 13u8, 108u8, 26u8, 99u8, 61u8, 117u8, 195u8, 218u8, 182u8, - 23u8, 188u8, 157u8, 181u8, 81u8, 38u8, 136u8, 31u8, 226u8, 8u8, 190u8, - 33u8, 81u8, 86u8, 185u8, 156u8, 77u8, 157u8, 197u8, 41u8, 58u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Force remove a vesting schedule"] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `target`: An account that has a vesting schedule"] + #[doc = "- `schedule_index`: The vesting schedule index that should be removed"] + pub struct ForceRemoveVestingSchedule { + pub target: force_remove_vesting_schedule::Target, + pub schedule_index: force_remove_vesting_schedule::ScheduleIndex, + } + pub mod force_remove_vesting_schedule { + use super::runtime_types; + pub type Target = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type ScheduleIndex = ::core::primitive::u32; + } + impl ForceRemoveVestingSchedule { + const PALLET_NAME: &'static str = "Vesting"; + const CALL_NAME: &'static str = "force_remove_vesting_schedule"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceRemoveVestingSchedule { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Force remove a vesting schedule"] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `target`: An account that has a vesting schedule"] - #[doc = "- `schedule_index`: The vesting schedule index that should be removed"] - pub fn force_remove_vesting_schedule( - &self, - target: types::force_remove_vesting_schedule::Target, - schedule_index: types::force_remove_vesting_schedule::ScheduleIndex, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceRemoveVestingSchedule, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "force_remove_vesting_schedule", - types::ForceRemoveVestingSchedule { - target, - schedule_index, - }, - [ - 211u8, 253u8, 60u8, 15u8, 20u8, 53u8, 23u8, 13u8, 45u8, 223u8, 136u8, - 183u8, 162u8, 143u8, 196u8, 188u8, 35u8, 64u8, 174u8, 16u8, 47u8, 13u8, - 147u8, 173u8, 120u8, 143u8, 75u8, 89u8, 128u8, 187u8, 9u8, 18u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Unlock any vested funds of the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub fn vest(&self) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Vesting", + "vest", + super::Vest {}, + [ + 149u8, 89u8, 178u8, 148u8, 127u8, 127u8, 155u8, 60u8, 114u8, 126u8, + 204u8, 123u8, 166u8, 70u8, 104u8, 208u8, 186u8, 69u8, 139u8, 181u8, + 151u8, 154u8, 235u8, 161u8, 191u8, 35u8, 111u8, 60u8, 21u8, 165u8, + 44u8, 122u8, + ], + ) + } + #[doc = "Unlock any vested funds of a `target` account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub fn vest_other( + &self, + target: super::vest_other::Target, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Vesting", + "vest_other", + super::VestOther { target }, + [ + 238u8, 92u8, 25u8, 149u8, 27u8, 211u8, 196u8, 31u8, 211u8, 28u8, + 241u8, 30u8, 128u8, 35u8, 0u8, 227u8, 202u8, 215u8, 186u8, 69u8, + 216u8, 110u8, 199u8, 120u8, 134u8, 141u8, 176u8, 224u8, 234u8, + 42u8, 152u8, 128u8, + ], + ) + } + #[doc = "Create a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account receiving the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub fn vested_transfer( + &self, + target: super::vested_transfer::Target, + schedule: super::vested_transfer::Schedule, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Vesting", + "vested_transfer", + super::VestedTransfer { target, schedule }, + [ + 198u8, 133u8, 254u8, 5u8, 22u8, 170u8, 205u8, 79u8, 218u8, 30u8, + 81u8, 207u8, 227u8, 121u8, 132u8, 14u8, 217u8, 43u8, 66u8, 206u8, + 15u8, 80u8, 173u8, 208u8, 128u8, 72u8, 223u8, 175u8, 93u8, 69u8, + 128u8, 88u8, + ], + ) + } + #[doc = "Force a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `source`: The account whose funds should be transferred."] + #[doc = "- `target`: The account that should be transferred the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)`."] + pub fn force_vested_transfer( + &self, + source: super::force_vested_transfer::Source, + target: super::force_vested_transfer::Target, + schedule: super::force_vested_transfer::Schedule, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Vesting", + "force_vested_transfer", + super::ForceVestedTransfer { + source, + target, + schedule, + }, + [ + 112u8, 17u8, 176u8, 133u8, 169u8, 192u8, 155u8, 217u8, 153u8, 36u8, + 230u8, 45u8, 9u8, 192u8, 2u8, 201u8, 165u8, 60u8, 206u8, 226u8, + 95u8, 86u8, 239u8, 196u8, 109u8, 62u8, 224u8, 237u8, 88u8, 74u8, + 209u8, 251u8, + ], + ) + } + #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] + #[doc = "the highest possible start and end blocks. If both schedules have already started the"] + #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] + #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] + #[doc = "unmodified."] + #[doc = ""] + #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] + #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] + #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] + #[doc = "and both will be removed."] + #[doc = ""] + #[doc = "Merged schedule attributes:"] + #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] + #[doc = " current_block)`."] + #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] + #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `schedule1_index`: index of the first schedule to merge."] + #[doc = "- `schedule2_index`: index of the second schedule to merge."] + pub fn merge_schedules( + &self, + schedule1_index: super::merge_schedules::Schedule1Index, + schedule2_index: super::merge_schedules::Schedule2Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Vesting", + "merge_schedules", + super::MergeSchedules { + schedule1_index, + schedule2_index, + }, + [ + 45u8, 24u8, 13u8, 108u8, 26u8, 99u8, 61u8, 117u8, 195u8, 218u8, + 182u8, 23u8, 188u8, 157u8, 181u8, 81u8, 38u8, 136u8, 31u8, 226u8, + 8u8, 190u8, 33u8, 81u8, 86u8, 185u8, 156u8, 77u8, 157u8, 197u8, + 41u8, 58u8, + ], + ) + } + #[doc = "Force remove a vesting schedule"] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `target`: An account that has a vesting schedule"] + #[doc = "- `schedule_index`: The vesting schedule index that should be removed"] + pub fn force_remove_vesting_schedule( + &self, + target: super::force_remove_vesting_schedule::Target, + schedule_index: super::force_remove_vesting_schedule::ScheduleIndex, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Vesting", + "force_remove_vesting_schedule", + super::ForceRemoveVestingSchedule { + target, + schedule_index, + }, + [ + 211u8, 253u8, 60u8, 15u8, 20u8, 53u8, 23u8, 13u8, 45u8, 223u8, + 136u8, 183u8, 162u8, 143u8, 196u8, 188u8, 35u8, 64u8, 174u8, 16u8, + 47u8, 13u8, 147u8, 173u8, 120u8, 143u8, 75u8, 89u8, 128u8, 187u8, + 9u8, 18u8, + ], + ) + } } } } @@ -22602,12 +22994,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A vesting schedule has been created."] pub struct VestingCreated { pub account: vesting_created::Account, @@ -22615,20 +23007,25 @@ pub mod api { } pub mod vesting_created { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Account = ::subxt::utils::AccountId32; pub type ScheduleIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VestingCreated { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingCreated"; + impl VestingCreated { + const PALLET_NAME: &'static str = "Vesting"; + const EVENT_NAME: &'static str = "VestingCreated"; + } + impl ::subxt::events::DecodeAsEvent for VestingCreated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The amount vested has been updated. This could indicate a change in funds available."] #[doc = "The balance given is the amount which is left unvested (and thus locked)."] pub struct VestingUpdated { @@ -22637,31 +23034,41 @@ pub mod api { } pub mod vesting_updated { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Account = ::subxt::utils::AccountId32; pub type Unvested = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VestingUpdated { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingUpdated"; + impl VestingUpdated { + const PALLET_NAME: &'static str = "Vesting"; + const EVENT_NAME: &'static str = "VestingUpdated"; + } + impl ::subxt::events::DecodeAsEvent for VestingUpdated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An \\[account\\] has become fully vested."] pub struct VestingCompleted { pub account: vesting_completed::Account, } pub mod vesting_completed { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Account = ::subxt::utils::AccountId32; + } + impl VestingCompleted { + const PALLET_NAME: &'static str = "Vesting"; + const EVENT_NAME: &'static str = "VestingCompleted"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VestingCompleted { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingCompleted"; + impl ::subxt::events::DecodeAsEvent for VestingCompleted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -22672,12 +23079,12 @@ pub mod api { #[doc = " Information regarding the vesting of a given account."] pub fn vesting( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (vesting::Param0,), - vesting::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (vesting::input::Param0,), + vesting::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Vesting", "Vesting", [ @@ -22693,12 +23100,9 @@ pub mod api { #[doc = " New networks start with latest version, as determined by the genesis build."] pub fn storage_version( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - storage_version::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), storage_version::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Vesting", "StorageVersion", [ @@ -22713,24 +23117,24 @@ pub mod api { pub mod vesting { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - >; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + >; } pub mod storage_version { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_vesting::Releases; } + pub type Output = runtime_types::pallet_vesting::Releases; } } pub mod constants { @@ -22740,10 +23144,8 @@ pub mod api { #[doc = " The minimum amount transferred to call `vested_transfer`."] pub fn min_vested_transfer( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Vesting", "MinVestedTransfer", [ @@ -22755,10 +23157,8 @@ pub mod api { } pub fn max_vesting_schedules( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Vesting", "MaxVestingSchedules", [ @@ -22782,566 +23182,575 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Anonymously schedule a task."] + pub struct Schedule { + pub when: schedule::When, + pub maybe_periodic: schedule::MaybePeriodic, + pub priority: schedule::Priority, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod schedule { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Anonymously schedule a task."] - pub struct Schedule { - pub when: schedule::When, - pub maybe_periodic: schedule::MaybePeriodic, - pub priority: schedule::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod schedule { - use super::runtime_types; - pub type When = ::core::primitive::u32; - pub type MaybePeriodic = - ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Schedule { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel a scheduled task (named or anonymous), by providing the block it is scheduled for"] - #[doc = "execution in, as well as the index of the task in that block's agenda."] - #[doc = ""] - #[doc = "In the case of a named task, it will remove it from the lookup table as well."] - pub struct Cancel { - pub when: cancel::When, - pub index: cancel::Index, - } - pub mod cancel { - use super::runtime_types; - pub type When = ::core::primitive::u32; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule a named task."] - pub struct ScheduleNamed { - pub id: schedule_named::Id, - pub when: schedule_named::When, - pub maybe_periodic: schedule_named::MaybePeriodic, - pub priority: schedule_named::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod schedule_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type When = ::core::primitive::u32; - pub type MaybePeriodic = - ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_named"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel a named scheduled task."] - pub struct CancelNamed { - pub id: cancel_named::Id, + pub type When = ::core::primitive::u32; + pub type MaybePeriodic = + ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>; + pub type Priority = ::core::primitive::u8; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl Schedule { + const PALLET_NAME: &'static str = "Scheduler"; + const CALL_NAME: &'static str = "schedule"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Schedule { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod cancel_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel a scheduled task (named or anonymous), by providing the block it is scheduled for"] + #[doc = "execution in, as well as the index of the task in that block's agenda."] + #[doc = ""] + #[doc = "In the case of a named task, it will remove it from the lookup table as well."] + pub struct Cancel { + pub when: cancel::When, + pub index: cancel::Index, + } + pub mod cancel { + use super::runtime_types; + pub type When = ::core::primitive::u32; + pub type Index = ::core::primitive::u32; + } + impl Cancel { + const PALLET_NAME: &'static str = "Scheduler"; + const CALL_NAME: &'static str = "cancel"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Cancel { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_named"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Schedule a named task."] + pub struct ScheduleNamed { + pub id: schedule_named::Id, + pub when: schedule_named::When, + pub maybe_periodic: schedule_named::MaybePeriodic, + pub priority: schedule_named::Priority, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod schedule_named { + use super::runtime_types; + pub type Id = [::core::primitive::u8; 32usize]; + pub type When = ::core::primitive::u32; + pub type MaybePeriodic = + ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>; + pub type Priority = ::core::primitive::u8; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl ScheduleNamed { + const PALLET_NAME: &'static str = "Scheduler"; + const CALL_NAME: &'static str = "schedule_named"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ScheduleNamed { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Anonymously schedule a task after a delay."] - pub struct ScheduleAfter { - pub after: schedule_after::After, - pub maybe_periodic: schedule_after::MaybePeriodic, - pub priority: schedule_after::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod schedule_after { - use super::runtime_types; - pub type After = ::core::primitive::u32; - pub type MaybePeriodic = - ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel a named scheduled task."] + pub struct CancelNamed { + pub id: cancel_named::Id, + } + pub mod cancel_named { + use super::runtime_types; + pub type Id = [::core::primitive::u8; 32usize]; + } + impl CancelNamed { + const PALLET_NAME: &'static str = "Scheduler"; + const CALL_NAME: &'static str = "cancel_named"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CancelNamed { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAfter { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_after"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Anonymously schedule a task after a delay."] + pub struct ScheduleAfter { + pub after: schedule_after::After, + pub maybe_periodic: schedule_after::MaybePeriodic, + pub priority: schedule_after::Priority, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod schedule_after { + use super::runtime_types; + pub type After = ::core::primitive::u32; + pub type MaybePeriodic = + ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>; + pub type Priority = ::core::primitive::u8; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl ScheduleAfter { + const PALLET_NAME: &'static str = "Scheduler"; + const CALL_NAME: &'static str = "schedule_after"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ScheduleAfter { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule a named task after a delay."] - pub struct ScheduleNamedAfter { - pub id: schedule_named_after::Id, - pub after: schedule_named_after::After, - pub maybe_periodic: schedule_named_after::MaybePeriodic, - pub priority: schedule_named_after::Priority, - pub call: - ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod schedule_named_after { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type After = ::core::primitive::u32; - pub type MaybePeriodic = - ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Schedule a named task after a delay."] + pub struct ScheduleNamedAfter { + pub id: schedule_named_after::Id, + pub after: schedule_named_after::After, + pub maybe_periodic: schedule_named_after::MaybePeriodic, + pub priority: schedule_named_after::Priority, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod schedule_named_after { + use super::runtime_types; + pub type Id = [::core::primitive::u8; 32usize]; + pub type After = ::core::primitive::u32; + pub type MaybePeriodic = + ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>; + pub type Priority = ::core::primitive::u8; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl ScheduleNamedAfter { + const PALLET_NAME: &'static str = "Scheduler"; + const CALL_NAME: &'static str = "schedule_named_after"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ScheduleNamedAfter { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleNamedAfter { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_named_after"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] + #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] + #[doc = "succeeds."] + #[doc = ""] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[doc = "clones of the original task. Their retry configuration will be derived from the"] + #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] + #[doc = "original `total_retries`."] + #[doc = ""] + #[doc = "This call **cannot** be used to set a retry configuration for a named task."] + pub struct SetRetry { + pub task: set_retry::Task, + pub retries: set_retry::Retries, + pub period: set_retry::Period, + } + pub mod set_retry { + use super::runtime_types; + pub type Task = (::core::primitive::u32, ::core::primitive::u32); + pub type Retries = ::core::primitive::u8; + pub type Period = ::core::primitive::u32; + } + impl SetRetry { + const PALLET_NAME: &'static str = "Scheduler"; + const CALL_NAME: &'static str = "set_retry"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetRetry { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] - #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] - #[doc = "succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - #[doc = ""] - #[doc = "This call **cannot** be used to set a retry configuration for a named task."] - pub struct SetRetry { - pub task: set_retry::Task, - pub retries: set_retry::Retries, - pub period: set_retry::Period, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] + #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] + #[doc = "it succeeds."] + #[doc = ""] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[doc = "clones of the original task. Their retry configuration will be derived from the"] + #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] + #[doc = "original `total_retries`."] + #[doc = ""] + #[doc = "This is the only way to set a retry configuration for a named task."] + pub struct SetRetryNamed { + pub id: set_retry_named::Id, + pub retries: set_retry_named::Retries, + pub period: set_retry_named::Period, + } + pub mod set_retry_named { + use super::runtime_types; + pub type Id = [::core::primitive::u8; 32usize]; + pub type Retries = ::core::primitive::u8; + pub type Period = ::core::primitive::u32; + } + impl SetRetryNamed { + const PALLET_NAME: &'static str = "Scheduler"; + const CALL_NAME: &'static str = "set_retry_named"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetRetryNamed { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod set_retry { - use super::runtime_types; - pub type Task = (::core::primitive::u32, ::core::primitive::u32); - pub type Retries = ::core::primitive::u8; - pub type Period = ::core::primitive::u32; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Removes the retry configuration of a task."] + pub struct CancelRetry { + pub task: cancel_retry::Task, + } + pub mod cancel_retry { + use super::runtime_types; + pub type Task = (::core::primitive::u32, ::core::primitive::u32); + } + impl CancelRetry { + const PALLET_NAME: &'static str = "Scheduler"; + const CALL_NAME: &'static str = "cancel_retry"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CancelRetry { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "set_retry"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] - #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] - #[doc = "it succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - #[doc = ""] - #[doc = "This is the only way to set a retry configuration for a named task."] - pub struct SetRetryNamed { - pub id: set_retry_named::Id, - pub retries: set_retry_named::Retries, - pub period: set_retry_named::Period, - } - pub mod set_retry_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type Retries = ::core::primitive::u8; - pub type Period = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetryNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "set_retry_named"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Removes the retry configuration of a task."] - pub struct CancelRetry { - pub task: cancel_retry::Task, - } - pub mod cancel_retry { - use super::runtime_types; - pub type Task = (::core::primitive::u32, ::core::primitive::u32); - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_retry"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel the retry configuration of a named task."] - pub struct CancelRetryNamed { - pub id: cancel_retry_named::Id, - } - pub mod cancel_retry_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetryNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_retry_named"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel the retry configuration of a named task."] + pub struct CancelRetryNamed { + pub id: cancel_retry_named::Id, + } + pub mod cancel_retry_named { + use super::runtime_types; + pub type Id = [::core::primitive::u8; 32usize]; + } + impl CancelRetryNamed { + const PALLET_NAME: &'static str = "Scheduler"; + const CALL_NAME: &'static str = "cancel_retry_named"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CancelRetryNamed { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Anonymously schedule a task."] - pub fn schedule( - &self, - when: types::schedule::When, - maybe_periodic: types::schedule::MaybePeriodic, - priority: types::schedule::Priority, - call: types::schedule::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "schedule", - types::Schedule { - when, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 74u8, 115u8, 153u8, 70u8, 53u8, 63u8, 99u8, 226u8, 155u8, 176u8, 70u8, - 142u8, 154u8, 125u8, 211u8, 216u8, 115u8, 140u8, 238u8, 168u8, 50u8, - 71u8, 170u8, 214u8, 41u8, 201u8, 40u8, 153u8, 115u8, 2u8, 233u8, 12u8, - ], - ) - } - #[doc = "Cancel a scheduled task (named or anonymous), by providing the block it is scheduled for"] - #[doc = "execution in, as well as the index of the task in that block's agenda."] - #[doc = ""] - #[doc = "In the case of a named task, it will remove it from the lookup table as well."] - pub fn cancel( - &self, - when: types::cancel::When, - index: types::cancel::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel", - types::Cancel { when, index }, - [ - 183u8, 204u8, 143u8, 86u8, 17u8, 130u8, 132u8, 91u8, 133u8, 168u8, - 103u8, 129u8, 114u8, 56u8, 123u8, 42u8, 123u8, 120u8, 221u8, 211u8, - 26u8, 85u8, 82u8, 246u8, 192u8, 39u8, 254u8, 45u8, 147u8, 56u8, 178u8, - 133u8, - ], - ) - } - #[doc = "Schedule a named task."] - pub fn schedule_named( - &self, - id: types::schedule_named::Id, - when: types::schedule_named::When, - maybe_periodic: types::schedule_named::MaybePeriodic, - priority: types::schedule_named::Priority, - call: types::schedule_named::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "schedule_named", - types::ScheduleNamed { - id, - when, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 89u8, 41u8, 143u8, 1u8, 250u8, 74u8, 112u8, 211u8, 125u8, 68u8, 245u8, - 105u8, 25u8, 154u8, 155u8, 80u8, 31u8, 45u8, 87u8, 211u8, 154u8, 175u8, - 165u8, 36u8, 42u8, 80u8, 93u8, 69u8, 220u8, 40u8, 129u8, 131u8, - ], - ) - } - #[doc = "Cancel a named scheduled task."] - pub fn cancel_named( - &self, - id: types::cancel_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_named", - types::CancelNamed { id }, - [ - 205u8, 35u8, 28u8, 57u8, 224u8, 7u8, 49u8, 233u8, 236u8, 163u8, 93u8, - 236u8, 103u8, 69u8, 65u8, 51u8, 121u8, 84u8, 9u8, 196u8, 147u8, 122u8, - 227u8, 200u8, 181u8, 233u8, 62u8, 240u8, 174u8, 83u8, 129u8, 193u8, - ], - ) - } - #[doc = "Anonymously schedule a task after a delay."] - pub fn schedule_after( - &self, - after: types::schedule_after::After, - maybe_periodic: types::schedule_after::MaybePeriodic, - priority: types::schedule_after::Priority, - call: types::schedule_after::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "schedule_after", - types::ScheduleAfter { - after, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 159u8, 184u8, 114u8, 95u8, 119u8, 34u8, 87u8, 197u8, 117u8, 35u8, - 174u8, 71u8, 217u8, 135u8, 20u8, 60u8, 38u8, 178u8, 63u8, 136u8, 249u8, - 17u8, 210u8, 252u8, 98u8, 172u8, 160u8, 24u8, 142u8, 82u8, 195u8, - 175u8, - ], - ) - } - #[doc = "Schedule a named task after a delay."] - pub fn schedule_named_after( - &self, - id: types::schedule_named_after::Id, - after: types::schedule_named_after::After, - maybe_periodic: types::schedule_named_after::MaybePeriodic, - priority: types::schedule_named_after::Priority, - call: types::schedule_named_after::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "schedule_named_after", - types::ScheduleNamedAfter { - id, - after, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 124u8, 250u8, 227u8, 143u8, 63u8, 19u8, 160u8, 174u8, 50u8, 126u8, 4u8, - 178u8, 11u8, 153u8, 143u8, 179u8, 102u8, 244u8, 27u8, 61u8, 125u8, - 149u8, 243u8, 152u8, 196u8, 221u8, 209u8, 208u8, 178u8, 243u8, 243u8, - 65u8, - ], - ) - } - #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] - #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] - #[doc = "succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - #[doc = ""] - #[doc = "This call **cannot** be used to set a retry configuration for a named task."] - pub fn set_retry( - &self, - task: types::set_retry::Task, - retries: types::set_retry::Retries, - period: types::set_retry::Period, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "set_retry", - types::SetRetry { - task, - retries, - period, - }, - [ - 2u8, 242u8, 180u8, 69u8, 237u8, 168u8, 243u8, 93u8, 47u8, 222u8, 189u8, - 74u8, 233u8, 106u8, 54u8, 40u8, 160u8, 61u8, 78u8, 138u8, 232u8, 20u8, - 243u8, 17u8, 151u8, 194u8, 67u8, 200u8, 186u8, 192u8, 210u8, 214u8, - ], - ) - } - #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] - #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] - #[doc = "it succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - #[doc = ""] - #[doc = "This is the only way to set a retry configuration for a named task."] - pub fn set_retry_named( - &self, - id: types::set_retry_named::Id, - retries: types::set_retry_named::Retries, - period: types::set_retry_named::Period, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "set_retry_named", - types::SetRetryNamed { - id, - retries, - period, - }, - [ - 240u8, 102u8, 255u8, 253u8, 52u8, 81u8, 164u8, 170u8, 184u8, 178u8, - 254u8, 126u8, 41u8, 247u8, 121u8, 22u8, 254u8, 136u8, 237u8, 37u8, - 11u8, 42u8, 227u8, 234u8, 132u8, 83u8, 109u8, 168u8, 31u8, 44u8, 231u8, - 70u8, - ], - ) - } - #[doc = "Removes the retry configuration of a task."] - pub fn cancel_retry( - &self, - task: types::cancel_retry::Task, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_retry", - types::CancelRetry { task }, - [ - 142u8, 126u8, 127u8, 216u8, 64u8, 189u8, 42u8, 126u8, 63u8, 249u8, - 211u8, 202u8, 224u8, 197u8, 199u8, 240u8, 58u8, 94u8, 219u8, 177u8, - 20u8, 210u8, 153u8, 0u8, 127u8, 255u8, 235u8, 238u8, 170u8, 240u8, - 44u8, 49u8, - ], - ) - } - #[doc = "Cancel the retry configuration of a named task."] - pub fn cancel_retry_named( - &self, - id: types::cancel_retry_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_retry_named", - types::CancelRetryNamed { id }, - [ - 76u8, 157u8, 253u8, 113u8, 162u8, 54u8, 98u8, 21u8, 62u8, 44u8, 155u8, - 202u8, 2u8, 28u8, 153u8, 219u8, 67u8, 166u8, 206u8, 79u8, 139u8, 3u8, - 119u8, 182u8, 254u8, 134u8, 143u8, 121u8, 155u8, 220u8, 192u8, 209u8, - ], - ) + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Anonymously schedule a task."] + pub fn schedule( + &self, + when: super::schedule::When, + maybe_periodic: super::schedule::MaybePeriodic, + priority: super::schedule::Priority, + call: super::schedule::Call, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Scheduler", + "schedule", + super::Schedule { + when, + maybe_periodic, + priority, + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 74u8, 115u8, 153u8, 70u8, 53u8, 63u8, 99u8, 226u8, 155u8, 176u8, + 70u8, 142u8, 154u8, 125u8, 211u8, 216u8, 115u8, 140u8, 238u8, + 168u8, 50u8, 71u8, 170u8, 214u8, 41u8, 201u8, 40u8, 153u8, 115u8, + 2u8, 233u8, 12u8, + ], + ) + } + #[doc = "Cancel a scheduled task (named or anonymous), by providing the block it is scheduled for"] + #[doc = "execution in, as well as the index of the task in that block's agenda."] + #[doc = ""] + #[doc = "In the case of a named task, it will remove it from the lookup table as well."] + pub fn cancel( + &self, + when: super::cancel::When, + index: super::cancel::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Scheduler", + "cancel", + super::Cancel { when, index }, + [ + 183u8, 204u8, 143u8, 86u8, 17u8, 130u8, 132u8, 91u8, 133u8, 168u8, + 103u8, 129u8, 114u8, 56u8, 123u8, 42u8, 123u8, 120u8, 221u8, 211u8, + 26u8, 85u8, 82u8, 246u8, 192u8, 39u8, 254u8, 45u8, 147u8, 56u8, + 178u8, 133u8, + ], + ) + } + #[doc = "Schedule a named task."] + pub fn schedule_named( + &self, + id: super::schedule_named::Id, + when: super::schedule_named::When, + maybe_periodic: super::schedule_named::MaybePeriodic, + priority: super::schedule_named::Priority, + call: super::schedule_named::Call, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Scheduler", + "schedule_named", + super::ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 89u8, 41u8, 143u8, 1u8, 250u8, 74u8, 112u8, 211u8, 125u8, 68u8, + 245u8, 105u8, 25u8, 154u8, 155u8, 80u8, 31u8, 45u8, 87u8, 211u8, + 154u8, 175u8, 165u8, 36u8, 42u8, 80u8, 93u8, 69u8, 220u8, 40u8, + 129u8, 131u8, + ], + ) + } + #[doc = "Cancel a named scheduled task."] + pub fn cancel_named( + &self, + id: super::cancel_named::Id, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Scheduler", + "cancel_named", + super::CancelNamed { id }, + [ + 205u8, 35u8, 28u8, 57u8, 224u8, 7u8, 49u8, 233u8, 236u8, 163u8, + 93u8, 236u8, 103u8, 69u8, 65u8, 51u8, 121u8, 84u8, 9u8, 196u8, + 147u8, 122u8, 227u8, 200u8, 181u8, 233u8, 62u8, 240u8, 174u8, 83u8, + 129u8, 193u8, + ], + ) + } + #[doc = "Anonymously schedule a task after a delay."] + pub fn schedule_after( + &self, + after: super::schedule_after::After, + maybe_periodic: super::schedule_after::MaybePeriodic, + priority: super::schedule_after::Priority, + call: super::schedule_after::Call, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Scheduler", + "schedule_after", + super::ScheduleAfter { + after, + maybe_periodic, + priority, + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 159u8, 184u8, 114u8, 95u8, 119u8, 34u8, 87u8, 197u8, 117u8, 35u8, + 174u8, 71u8, 217u8, 135u8, 20u8, 60u8, 38u8, 178u8, 63u8, 136u8, + 249u8, 17u8, 210u8, 252u8, 98u8, 172u8, 160u8, 24u8, 142u8, 82u8, + 195u8, 175u8, + ], + ) + } + #[doc = "Schedule a named task after a delay."] + pub fn schedule_named_after( + &self, + id: super::schedule_named_after::Id, + after: super::schedule_named_after::After, + maybe_periodic: super::schedule_named_after::MaybePeriodic, + priority: super::schedule_named_after::Priority, + call: super::schedule_named_after::Call, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Scheduler", + "schedule_named_after", + super::ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 124u8, 250u8, 227u8, 143u8, 63u8, 19u8, 160u8, 174u8, 50u8, 126u8, + 4u8, 178u8, 11u8, 153u8, 143u8, 179u8, 102u8, 244u8, 27u8, 61u8, + 125u8, 149u8, 243u8, 152u8, 196u8, 221u8, 209u8, 208u8, 178u8, + 243u8, 243u8, 65u8, + ], + ) + } + #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] + #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] + #[doc = "succeeds."] + #[doc = ""] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[doc = "clones of the original task. Their retry configuration will be derived from the"] + #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] + #[doc = "original `total_retries`."] + #[doc = ""] + #[doc = "This call **cannot** be used to set a retry configuration for a named task."] + pub fn set_retry( + &self, + task: super::set_retry::Task, + retries: super::set_retry::Retries, + period: super::set_retry::Period, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Scheduler", + "set_retry", + super::SetRetry { + task, + retries, + period, + }, + [ + 2u8, 242u8, 180u8, 69u8, 237u8, 168u8, 243u8, 93u8, 47u8, 222u8, + 189u8, 74u8, 233u8, 106u8, 54u8, 40u8, 160u8, 61u8, 78u8, 138u8, + 232u8, 20u8, 243u8, 17u8, 151u8, 194u8, 67u8, 200u8, 186u8, 192u8, + 210u8, 214u8, + ], + ) + } + #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] + #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] + #[doc = "it succeeds."] + #[doc = ""] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[doc = "clones of the original task. Their retry configuration will be derived from the"] + #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] + #[doc = "original `total_retries`."] + #[doc = ""] + #[doc = "This is the only way to set a retry configuration for a named task."] + pub fn set_retry_named( + &self, + id: super::set_retry_named::Id, + retries: super::set_retry_named::Retries, + period: super::set_retry_named::Period, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Scheduler", + "set_retry_named", + super::SetRetryNamed { + id, + retries, + period, + }, + [ + 240u8, 102u8, 255u8, 253u8, 52u8, 81u8, 164u8, 170u8, 184u8, 178u8, + 254u8, 126u8, 41u8, 247u8, 121u8, 22u8, 254u8, 136u8, 237u8, 37u8, + 11u8, 42u8, 227u8, 234u8, 132u8, 83u8, 109u8, 168u8, 31u8, 44u8, + 231u8, 70u8, + ], + ) + } + #[doc = "Removes the retry configuration of a task."] + pub fn cancel_retry( + &self, + task: super::cancel_retry::Task, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Scheduler", + "cancel_retry", + super::CancelRetry { task }, + [ + 142u8, 126u8, 127u8, 216u8, 64u8, 189u8, 42u8, 126u8, 63u8, 249u8, + 211u8, 202u8, 224u8, 197u8, 199u8, 240u8, 58u8, 94u8, 219u8, 177u8, + 20u8, 210u8, 153u8, 0u8, 127u8, 255u8, 235u8, 238u8, 170u8, 240u8, + 44u8, 49u8, + ], + ) + } + #[doc = "Cancel the retry configuration of a named task."] + pub fn cancel_retry_named( + &self, + id: super::cancel_retry_named::Id, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Scheduler", + "cancel_retry_named", + super::CancelRetryNamed { id }, + [ + 76u8, 157u8, 253u8, 113u8, 162u8, 54u8, 98u8, 21u8, 62u8, 44u8, + 155u8, 202u8, 2u8, 28u8, 153u8, 219u8, 67u8, 166u8, 206u8, 79u8, + 139u8, 3u8, 119u8, 182u8, 254u8, 134u8, 143u8, 121u8, 155u8, 220u8, + 192u8, 209u8, + ], + ) + } } } } @@ -23350,12 +23759,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Scheduled some task."] pub struct Scheduled { pub when: scheduled::When, @@ -23366,17 +23775,22 @@ pub mod api { pub type When = ::core::primitive::u32; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Scheduled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Scheduled"; + impl Scheduled { + const PALLET_NAME: &'static str = "Scheduler"; + const EVENT_NAME: &'static str = "Scheduled"; + } + impl ::subxt::events::DecodeAsEvent for Scheduled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Canceled some task."] pub struct Canceled { pub when: canceled::When, @@ -23387,17 +23801,22 @@ pub mod api { pub type When = ::core::primitive::u32; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Canceled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Canceled"; + impl Canceled { + const PALLET_NAME: &'static str = "Scheduler"; + const EVENT_NAME: &'static str = "Canceled"; + } + impl ::subxt::events::DecodeAsEvent for Canceled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Dispatched some task."] pub struct Dispatched { pub task: dispatched::Task, @@ -23411,17 +23830,22 @@ pub mod api { pub type Result = ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Dispatched { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Dispatched"; + impl Dispatched { + const PALLET_NAME: &'static str = "Scheduler"; + const EVENT_NAME: &'static str = "Dispatched"; + } + impl ::subxt::events::DecodeAsEvent for Dispatched { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Set a retry configuration for some task."] pub struct RetrySet { pub task: retry_set::Task, @@ -23436,17 +23860,22 @@ pub mod api { pub type Period = ::core::primitive::u32; pub type Retries = ::core::primitive::u8; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetrySet { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetrySet"; + impl RetrySet { + const PALLET_NAME: &'static str = "Scheduler"; + const EVENT_NAME: &'static str = "RetrySet"; + } + impl ::subxt::events::DecodeAsEvent for RetrySet { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Cancel a retry configuration for some task."] pub struct RetryCancelled { pub task: retry_cancelled::Task, @@ -23457,17 +23886,22 @@ pub mod api { pub type Task = (::core::primitive::u32, ::core::primitive::u32); pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetryCancelled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetryCancelled"; + impl RetryCancelled { + const PALLET_NAME: &'static str = "Scheduler"; + const EVENT_NAME: &'static str = "RetryCancelled"; + } + impl ::subxt::events::DecodeAsEvent for RetryCancelled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The call for the provided hash was not found so the task has been aborted."] pub struct CallUnavailable { pub task: call_unavailable::Task, @@ -23478,17 +23912,22 @@ pub mod api { pub type Task = (::core::primitive::u32, ::core::primitive::u32); pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CallUnavailable { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "CallUnavailable"; + impl CallUnavailable { + const PALLET_NAME: &'static str = "Scheduler"; + const EVENT_NAME: &'static str = "CallUnavailable"; + } + impl ::subxt::events::DecodeAsEvent for CallUnavailable { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The given task was unable to be renewed since the agenda is full at that block."] pub struct PeriodicFailed { pub task: periodic_failed::Task, @@ -23499,17 +23938,22 @@ pub mod api { pub type Task = (::core::primitive::u32, ::core::primitive::u32); pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PeriodicFailed { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "PeriodicFailed"; + impl PeriodicFailed { + const PALLET_NAME: &'static str = "Scheduler"; + const EVENT_NAME: &'static str = "PeriodicFailed"; + } + impl ::subxt::events::DecodeAsEvent for PeriodicFailed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The given task was unable to be retried since the agenda is full at that block or there"] #[doc = "was not enough weight to reschedule it."] pub struct RetryFailed { @@ -23521,17 +23965,22 @@ pub mod api { pub type Task = (::core::primitive::u32, ::core::primitive::u32); pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetryFailed { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetryFailed"; + impl RetryFailed { + const PALLET_NAME: &'static str = "Scheduler"; + const EVENT_NAME: &'static str = "RetryFailed"; + } + impl ::subxt::events::DecodeAsEvent for RetryFailed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The given task can never be executed since it is overweight."] pub struct PermanentlyOverweight { pub task: permanently_overweight::Task, @@ -23542,17 +23991,22 @@ pub mod api { pub type Task = (::core::primitive::u32, ::core::primitive::u32); pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PermanentlyOverweight { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "PermanentlyOverweight"; + impl PermanentlyOverweight { + const PALLET_NAME: &'static str = "Scheduler"; + const EVENT_NAME: &'static str = "PermanentlyOverweight"; + } + impl ::subxt::events::DecodeAsEvent for PermanentlyOverweight { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Agenda is incomplete from `when`."] pub struct AgendaIncomplete { pub when: agenda_incomplete::When, @@ -23561,9 +24015,14 @@ pub mod api { use super::runtime_types; pub type When = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AgendaIncomplete { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "AgendaIncomplete"; + impl AgendaIncomplete { + const PALLET_NAME: &'static str = "Scheduler"; + const EVENT_NAME: &'static str = "AgendaIncomplete"; + } + impl ::subxt::events::DecodeAsEvent for AgendaIncomplete { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -23574,12 +24033,12 @@ pub mod api { #[doc = " Block number at which the agenda began incomplete execution."] pub fn incomplete_since( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - incomplete_since::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + incomplete_since::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Scheduler", "IncompleteSince", [ @@ -23592,12 +24051,12 @@ pub mod api { #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub fn agenda( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (agenda::Param0,), - agenda::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (agenda::input::Param0,), + agenda::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Scheduler", "Agenda", [ @@ -23610,12 +24069,12 @@ pub mod api { #[doc = " Retry configurations for items to be executed, indexed by task address."] pub fn retries( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (retries::Param0,), - retries::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (retries::input::Param0,), + retries::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Scheduler", "Retries", [ @@ -23631,12 +24090,12 @@ pub mod api { #[doc = " identities."] pub fn lookup( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (lookup::Param0,), - lookup::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (lookup::input::Param0,), + lookup::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Scheduler", "Lookup", [ @@ -23651,51 +24110,51 @@ pub mod api { pub mod incomplete_since { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod agenda { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::option::Option< - runtime_types::pallet_scheduler::Scheduled< - [::core::primitive::u8; 32usize], - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::rococo_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - ::core::primitive::u32, - runtime_types::rococo_runtime::OriginCaller, - ::subxt::ext::subxt_core::utils::AccountId32, + pub type Param0 = ::core::primitive::u32; + } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::option::Option< + runtime_types::pallet_scheduler::Scheduled< + [::core::primitive::u8; 32usize], + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::rococo_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, >, + ::core::primitive::u32, + runtime_types::rococo_runtime::OriginCaller, + ::subxt::utils::AccountId32, >, - >; - } + >, + >; } pub mod retries { use super::root_mod; use super::runtime_types; - pub type Param0 = (::core::primitive::u32, ::core::primitive::u32); - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::pallet_scheduler::RetryConfig<::core::primitive::u32>; + pub type Param0 = (::core::primitive::u32, ::core::primitive::u32); } + pub type Output = + runtime_types::pallet_scheduler::RetryConfig<::core::primitive::u32>; } pub mod lookup { use super::root_mod; use super::runtime_types; - pub type Param0 = [::core::primitive::u8; 32usize]; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (::core::primitive::u32, ::core::primitive::u32); + pub type Param0 = [::core::primitive::u8; 32usize]; } + pub type Output = (::core::primitive::u32, ::core::primitive::u32); } } pub mod constants { @@ -23705,10 +24164,9 @@ pub mod api { #[doc = " The maximum weight that may be scheduled per block for any dispatchables."] pub fn maximum_weight( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_weights::weight_v2::Weight, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress + { + ::subxt::constants::StaticAddress::new_static( "Scheduler", "MaximumWeight", [ @@ -23726,10 +24184,8 @@ pub mod api { #[doc = " higher limit under `runtime-benchmarks` feature."] pub fn max_scheduled_per_block( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Scheduler", "MaxScheduledPerBlock", [ @@ -23752,863 +24208,863 @@ pub mod api { pub type Call = runtime_types::pallet_proxy::pallet::Call; pub mod calls { use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - pub struct Proxy { - pub real: proxy::Real, - pub force_proxy_type: proxy::ForceProxyType, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod proxy { - use super::runtime_types; - pub type Real = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type ForceProxyType = - ::core::option::Option; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Proxy { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "proxy"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to make a proxy."] - #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - pub struct AddProxy { - pub delegate: add_proxy::Delegate, - pub proxy_type: add_proxy::ProxyType, - pub delay: add_proxy::Delay, - } - pub mod add_proxy { - use super::runtime_types; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type ProxyType = runtime_types::rococo_runtime::ProxyType; - pub type Delay = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddProxy { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "add_proxy"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Unregister a proxy account for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] - #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] - pub struct RemoveProxy { - pub delegate: remove_proxy::Delegate, - pub proxy_type: remove_proxy::ProxyType, - pub delay: remove_proxy::Delay, - } - pub mod remove_proxy { - use super::runtime_types; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type ProxyType = runtime_types::rococo_runtime::ProxyType; - pub type Delay = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveProxy { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "remove_proxy"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Unregister all proxy accounts for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "WARNING: This may be called on accounts created by `create_pure`, however if done, then"] - #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] - pub struct RemoveProxies; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveProxies { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "remove_proxies"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] - #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] - #[doc = ""] - #[doc = "Requires a `Signed` origin."] - #[doc = ""] - #[doc = "- `proxy_type`: The type of the proxy that the sender will be registered as over the"] - #[doc = "new account. This will almost always be the most permissive `ProxyType` possible to"] - #[doc = "allow for maximum flexibility."] - #[doc = "- `index`: A disambiguation index, in case this is called multiple times in the same"] - #[doc = "transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just"] - #[doc = "want to use `0`."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - #[doc = ""] - #[doc = "Fails with `Duplicate` if this has already been called in this transaction, from the"] - #[doc = "same sender, with the same parameters."] - #[doc = ""] - #[doc = "Fails if there are insufficient funds to pay for deposit."] - pub struct CreatePure { - pub proxy_type: create_pure::ProxyType, - pub delay: create_pure::Delay, - pub index: create_pure::Index, - } - pub mod create_pure { - use super::runtime_types; - pub type ProxyType = runtime_types::rococo_runtime::ProxyType; - pub type Delay = ::core::primitive::u32; - pub type Index = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreatePure { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "create_pure"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Removes a previously spawned pure proxy."] - #[doc = ""] - #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] - #[doc = "inaccessible."] - #[doc = ""] - #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] - #[doc = "`create_pure` with corresponding parameters."] - #[doc = ""] - #[doc = "- `spawner`: The account that originally called `create_pure` to create this account."] - #[doc = "- `index`: The disambiguation index originally passed to `create_pure`. Probably `0`."] - #[doc = "- `proxy_type`: The proxy type originally passed to `create_pure`."] - #[doc = "- `height`: The height of the chain when the call to `create_pure` was processed."] - #[doc = "- `ext_index`: The extrinsic index in which the call to `create_pure` was processed."] - #[doc = ""] - #[doc = "Fails with `NoPermission` in case the caller is not a previously created pure"] - #[doc = "account whose `create_pure` call has corresponding parameters."] - pub struct KillPure { - pub spawner: kill_pure::Spawner, - pub proxy_type: kill_pure::ProxyType, - pub index: kill_pure::Index, - #[codec(compact)] - pub height: kill_pure::Height, - #[codec(compact)] - pub ext_index: kill_pure::ExtIndex, - } - pub mod kill_pure { - use super::runtime_types; - pub type Spawner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type ProxyType = runtime_types::rococo_runtime::ProxyType; - pub type Index = ::core::primitive::u16; - pub type Height = ::core::primitive::u32; - pub type ExtIndex = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for KillPure { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "kill_pure"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Publish the hash of a proxy-call that will be made in the future."] - #[doc = ""] - #[doc = "This must be called some number of blocks before the corresponding `proxy` is attempted"] - #[doc = "if the delay associated with the proxy relationship is greater than zero."] - #[doc = ""] - #[doc = "No more than `MaxPending` announcements may be made at any one time."] - #[doc = ""] - #[doc = "This will take a deposit of `AnnouncementDepositFactor` as well as"] - #[doc = "`AnnouncementDepositBase` if there are no other pending announcements."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a proxy of `real`."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - pub struct Announce { - pub real: announce::Real, - pub call_hash: announce::CallHash, - } - pub mod announce { - use super::runtime_types; - pub type Real = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type CallHash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Announce { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "announce"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove a given announcement."] - #[doc = ""] - #[doc = "May be called by a proxy account to remove a call they previously announced and return"] - #[doc = "the deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - pub struct RemoveAnnouncement { - pub real: remove_announcement::Real, - pub call_hash: remove_announcement::CallHash, - } - pub mod remove_announcement { - use super::runtime_types; - pub type Real = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type CallHash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveAnnouncement { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "remove_announcement"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove the given announcement of a delegate."] - #[doc = ""] - #[doc = "May be called by a target (proxied) account to remove a call that one of their delegates"] - #[doc = "(`delegate`) has announced they want to execute. The deposit is returned."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `delegate`: The account that previously announced the call."] - #[doc = "- `call_hash`: The hash of the call to be made."] - pub struct RejectAnnouncement { - pub delegate: reject_announcement::Delegate, - pub call_hash: reject_announcement::CallHash, - } - pub mod reject_announcement { - use super::runtime_types; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type CallHash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RejectAnnouncement { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "reject_announcement"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "Removes any corresponding announcement(s)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - pub struct ProxyAnnounced { - pub delegate: proxy_announced::Delegate, - pub real: proxy_announced::Real, - pub force_proxy_type: proxy_announced::ForceProxyType, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod proxy_announced { - use super::runtime_types; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Real = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type ForceProxyType = - ::core::option::Option; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ProxyAnnounced { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "proxy_announced"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Poke / Adjust deposits made for proxies and announcements based on current values."] - #[doc = "This can be used by accounts to possibly lower their locked amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "The transaction fee is waived if the deposit amount has changed."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if successful."] - pub struct PokeDeposit; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { - const PALLET: &'static str = "Proxy"; - const CALL: &'static str = "poke_deposit"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - pub fn proxy( - &self, - real: types::proxy::Real, - force_proxy_type: types::proxy::ForceProxyType, - call: types::proxy::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "proxy", - types::Proxy { - real, - force_proxy_type, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 23u8, 157u8, 39u8, 96u8, 67u8, 226u8, 26u8, 153u8, 4u8, 84u8, 88u8, - 103u8, 135u8, 174u8, 17u8, 33u8, 148u8, 53u8, 54u8, 88u8, 103u8, 179u8, - 69u8, 185u8, 117u8, 46u8, 193u8, 60u8, 65u8, 98u8, 3u8, 81u8, - ], - ) - } - #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to make a proxy."] - #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - pub fn add_proxy( - &self, - delegate: types::add_proxy::Delegate, - proxy_type: types::add_proxy::ProxyType, - delay: types::add_proxy::Delay, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "add_proxy", - types::AddProxy { - delegate, - proxy_type, - delay, - }, - [ - 183u8, 95u8, 175u8, 194u8, 140u8, 90u8, 170u8, 28u8, 251u8, 192u8, - 151u8, 138u8, 76u8, 170u8, 207u8, 228u8, 169u8, 124u8, 19u8, 161u8, - 181u8, 87u8, 121u8, 214u8, 101u8, 16u8, 30u8, 122u8, 125u8, 33u8, - 156u8, 197u8, - ], - ) - } - #[doc = "Unregister a proxy account for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] - #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] - pub fn remove_proxy( - &self, - delegate: types::remove_proxy::Delegate, - proxy_type: types::remove_proxy::ProxyType, - delay: types::remove_proxy::Delay, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "remove_proxy", - types::RemoveProxy { - delegate, - proxy_type, - delay, - }, - [ - 225u8, 127u8, 66u8, 209u8, 96u8, 176u8, 66u8, 143u8, 58u8, 248u8, 7u8, - 95u8, 206u8, 250u8, 239u8, 199u8, 58u8, 128u8, 118u8, 204u8, 148u8, - 80u8, 4u8, 147u8, 20u8, 29u8, 35u8, 188u8, 21u8, 175u8, 107u8, 223u8, - ], - ) - } - #[doc = "Unregister all proxy accounts for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "WARNING: This may be called on accounts created by `create_pure`, however if done, then"] - #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] - pub fn remove_proxies( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "remove_proxies", - types::RemoveProxies {}, - [ - 1u8, 126u8, 36u8, 227u8, 185u8, 34u8, 218u8, 236u8, 125u8, 231u8, 68u8, - 185u8, 145u8, 63u8, 250u8, 225u8, 103u8, 3u8, 189u8, 37u8, 172u8, - 195u8, 197u8, 216u8, 99u8, 210u8, 240u8, 162u8, 158u8, 132u8, 24u8, - 6u8, - ], - ) - } - #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] - #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] - #[doc = ""] - #[doc = "Requires a `Signed` origin."] - #[doc = ""] - #[doc = "- `proxy_type`: The type of the proxy that the sender will be registered as over the"] - #[doc = "new account. This will almost always be the most permissive `ProxyType` possible to"] - #[doc = "allow for maximum flexibility."] - #[doc = "- `index`: A disambiguation index, in case this is called multiple times in the same"] - #[doc = "transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just"] - #[doc = "want to use `0`."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - #[doc = ""] - #[doc = "Fails with `Duplicate` if this has already been called in this transaction, from the"] - #[doc = "same sender, with the same parameters."] - #[doc = ""] - #[doc = "Fails if there are insufficient funds to pay for deposit."] - pub fn create_pure( - &self, - proxy_type: types::create_pure::ProxyType, - delay: types::create_pure::Delay, - index: types::create_pure::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "create_pure", - types::CreatePure { - proxy_type, - delay, - index, - }, - [ - 224u8, 201u8, 76u8, 254u8, 224u8, 64u8, 123u8, 29u8, 77u8, 114u8, - 213u8, 47u8, 9u8, 51u8, 87u8, 4u8, 142u8, 93u8, 212u8, 229u8, 148u8, - 159u8, 143u8, 56u8, 0u8, 34u8, 249u8, 228u8, 37u8, 242u8, 188u8, 28u8, - ], - ) - } - #[doc = "Removes a previously spawned pure proxy."] - #[doc = ""] - #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] - #[doc = "inaccessible."] - #[doc = ""] - #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] - #[doc = "`create_pure` with corresponding parameters."] - #[doc = ""] - #[doc = "- `spawner`: The account that originally called `create_pure` to create this account."] - #[doc = "- `index`: The disambiguation index originally passed to `create_pure`. Probably `0`."] - #[doc = "- `proxy_type`: The proxy type originally passed to `create_pure`."] - #[doc = "- `height`: The height of the chain when the call to `create_pure` was processed."] - #[doc = "- `ext_index`: The extrinsic index in which the call to `create_pure` was processed."] - #[doc = ""] - #[doc = "Fails with `NoPermission` in case the caller is not a previously created pure"] - #[doc = "account whose `create_pure` call has corresponding parameters."] - pub fn kill_pure( - &self, - spawner: types::kill_pure::Spawner, - proxy_type: types::kill_pure::ProxyType, - index: types::kill_pure::Index, - height: types::kill_pure::Height, - ext_index: types::kill_pure::ExtIndex, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "kill_pure", - types::KillPure { - spawner, - proxy_type, - index, - height, - ext_index, - }, - [ - 59u8, 143u8, 9u8, 128u8, 44u8, 243u8, 110u8, 190u8, 82u8, 230u8, 253u8, - 123u8, 30u8, 59u8, 114u8, 141u8, 255u8, 162u8, 42u8, 179u8, 222u8, - 124u8, 235u8, 148u8, 5u8, 45u8, 254u8, 235u8, 75u8, 224u8, 58u8, 148u8, - ], - ) - } - #[doc = "Publish the hash of a proxy-call that will be made in the future."] - #[doc = ""] - #[doc = "This must be called some number of blocks before the corresponding `proxy` is attempted"] - #[doc = "if the delay associated with the proxy relationship is greater than zero."] - #[doc = ""] - #[doc = "No more than `MaxPending` announcements may be made at any one time."] - #[doc = ""] - #[doc = "This will take a deposit of `AnnouncementDepositFactor` as well as"] - #[doc = "`AnnouncementDepositBase` if there are no other pending announcements."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a proxy of `real`."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - pub fn announce( - &self, - real: types::announce::Real, - call_hash: types::announce::CallHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "announce", - types::Announce { real, call_hash }, - [ - 105u8, 218u8, 232u8, 82u8, 80u8, 10u8, 11u8, 1u8, 93u8, 241u8, 121u8, - 198u8, 167u8, 218u8, 95u8, 15u8, 75u8, 122u8, 155u8, 233u8, 10u8, - 175u8, 145u8, 73u8, 214u8, 230u8, 67u8, 107u8, 23u8, 239u8, 69u8, - 240u8, - ], - ) - } - #[doc = "Remove a given announcement."] - #[doc = ""] - #[doc = "May be called by a proxy account to remove a call they previously announced and return"] - #[doc = "the deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - pub fn remove_announcement( - &self, - real: types::remove_announcement::Real, - call_hash: types::remove_announcement::CallHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "remove_announcement", - types::RemoveAnnouncement { real, call_hash }, - [ - 40u8, 237u8, 179u8, 128u8, 201u8, 183u8, 20u8, 47u8, 99u8, 182u8, 81u8, - 31u8, 27u8, 212u8, 133u8, 36u8, 8u8, 248u8, 57u8, 230u8, 138u8, 80u8, - 241u8, 147u8, 69u8, 236u8, 156u8, 167u8, 205u8, 49u8, 60u8, 16u8, - ], - ) - } - #[doc = "Remove the given announcement of a delegate."] - #[doc = ""] - #[doc = "May be called by a target (proxied) account to remove a call that one of their delegates"] - #[doc = "(`delegate`) has announced they want to execute. The deposit is returned."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `delegate`: The account that previously announced the call."] - #[doc = "- `call_hash`: The hash of the call to be made."] - pub fn reject_announcement( - &self, - delegate: types::reject_announcement::Delegate, - call_hash: types::reject_announcement::CallHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "reject_announcement", - types::RejectAnnouncement { - delegate, - call_hash, - }, - [ - 150u8, 178u8, 49u8, 160u8, 211u8, 75u8, 58u8, 228u8, 121u8, 253u8, - 167u8, 72u8, 68u8, 105u8, 159u8, 52u8, 41u8, 155u8, 92u8, 26u8, 169u8, - 177u8, 102u8, 36u8, 1u8, 47u8, 87u8, 189u8, 223u8, 238u8, 244u8, 110u8, - ], - ) - } - #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "Removes any corresponding announcement(s)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - pub fn proxy_announced( - &self, - delegate: types::proxy_announced::Delegate, - real: types::proxy_announced::Real, - force_proxy_type: types::proxy_announced::ForceProxyType, - call: types::proxy_announced::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "proxy_announced", - types::ProxyAnnounced { - delegate, - real, - force_proxy_type, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 108u8, 219u8, 113u8, 213u8, 48u8, 200u8, 156u8, 43u8, 157u8, 109u8, - 236u8, 149u8, 205u8, 5u8, 199u8, 253u8, 108u8, 143u8, 255u8, 3u8, - 167u8, 167u8, 181u8, 34u8, 115u8, 120u8, 169u8, 5u8, 14u8, 116u8, - 206u8, 44u8, - ], - ) - } - #[doc = "Poke / Adjust deposits made for proxies and announcements based on current values."] - #[doc = "This can be used by accounts to possibly lower their locked amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "The transaction fee is waived if the deposit amount has changed."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if successful."] - pub fn poke_deposit( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Proxy", - "poke_deposit", - types::PokeDeposit {}, - [ - 127u8, 254u8, 187u8, 13u8, 51u8, 85u8, 145u8, 82u8, 61u8, 152u8, 218u8, - 135u8, 191u8, 67u8, 53u8, 140u8, 42u8, 68u8, 7u8, 14u8, 95u8, 60u8, - 41u8, 135u8, 32u8, 99u8, 40u8, 111u8, 10u8, 21u8, 103u8, 107u8, - ], - ) - } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_proxy::pallet::Event; - pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A proxy was executed correctly, with the given."] - pub struct ProxyExecuted { - pub result: proxy_executed::Result, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] + #[doc = "`add_proxy`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] + #[doc = "- `call`: The call to be made by the `real` account."] + pub struct Proxy { + pub real: proxy::Real, + pub force_proxy_type: proxy::ForceProxyType, + pub call: ::subxt::alloc::boxed::Box, } - pub mod proxy_executed { + pub mod proxy { use super::runtime_types; - pub type Result = - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; + pub type Real = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type ForceProxyType = + ::core::option::Option; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ProxyExecuted { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyExecuted"; + impl Proxy { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "proxy"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Proxy { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A pure account has been created by new proxy with given"] - #[doc = "disambiguation index and proxy type."] - pub struct PureCreated { - pub pure: pure_created::Pure, - pub who: pure_created::Who, - pub proxy_type: pure_created::ProxyType, - pub disambiguation_index: pure_created::DisambiguationIndex, - pub at: pure_created::At, - pub extrinsic_index: pure_created::ExtrinsicIndex, - } - pub mod pure_created { - use super::runtime_types; - pub type Pure = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `proxy`: The account that the `caller` would like to make a proxy."] + #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] + #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] + #[doc = "zero."] + pub struct AddProxy { + pub delegate: add_proxy::Delegate, + pub proxy_type: add_proxy::ProxyType, + pub delay: add_proxy::Delay, + } + pub mod add_proxy { + use super::runtime_types; + pub type Delegate = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; pub type ProxyType = runtime_types::rococo_runtime::ProxyType; - pub type DisambiguationIndex = ::core::primitive::u16; - pub type At = ::core::primitive::u32; - pub type ExtrinsicIndex = ::core::primitive::u32; + pub type Delay = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PureCreated { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "PureCreated"; + impl AddProxy { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "add_proxy"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AddProxy { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A pure proxy was killed by its spawner."] - pub struct PureKilled { - pub pure: pure_killed::Pure, - pub spawner: pure_killed::Spawner, - pub proxy_type: pure_killed::ProxyType, - pub disambiguation_index: pure_killed::DisambiguationIndex, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Unregister a proxy account for the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] + #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] + pub struct RemoveProxy { + pub delegate: remove_proxy::Delegate, + pub proxy_type: remove_proxy::ProxyType, + pub delay: remove_proxy::Delay, } - pub mod pure_killed { + pub mod remove_proxy { use super::runtime_types; - pub type Pure = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Spawner = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delegate = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; pub type ProxyType = runtime_types::rococo_runtime::ProxyType; - pub type DisambiguationIndex = ::core::primitive::u16; + pub type Delay = ::core::primitive::u32; + } + impl RemoveProxy { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "remove_proxy"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PureKilled { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "PureKilled"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveProxy { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An announcement was placed to make a call in the future."] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Unregister all proxy accounts for the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "WARNING: This may be called on accounts created by `create_pure`, however if done, then"] + #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] + pub struct RemoveProxies; + impl RemoveProxies { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "remove_proxies"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveProxies { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] + #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] + #[doc = ""] + #[doc = "Requires a `Signed` origin."] + #[doc = ""] + #[doc = "- `proxy_type`: The type of the proxy that the sender will be registered as over the"] + #[doc = "new account. This will almost always be the most permissive `ProxyType` possible to"] + #[doc = "allow for maximum flexibility."] + #[doc = "- `index`: A disambiguation index, in case this is called multiple times in the same"] + #[doc = "transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just"] + #[doc = "want to use `0`."] + #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] + #[doc = "zero."] + #[doc = ""] + #[doc = "Fails with `Duplicate` if this has already been called in this transaction, from the"] + #[doc = "same sender, with the same parameters."] + #[doc = ""] + #[doc = "Fails if there are insufficient funds to pay for deposit."] + pub struct CreatePure { + pub proxy_type: create_pure::ProxyType, + pub delay: create_pure::Delay, + pub index: create_pure::Index, + } + pub mod create_pure { + use super::runtime_types; + pub type ProxyType = runtime_types::rococo_runtime::ProxyType; + pub type Delay = ::core::primitive::u32; + pub type Index = ::core::primitive::u16; + } + impl CreatePure { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "create_pure"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CreatePure { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Removes a previously spawned pure proxy."] + #[doc = ""] + #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] + #[doc = "inaccessible."] + #[doc = ""] + #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] + #[doc = "`create_pure` with corresponding parameters."] + #[doc = ""] + #[doc = "- `spawner`: The account that originally called `create_pure` to create this account."] + #[doc = "- `index`: The disambiguation index originally passed to `create_pure`. Probably `0`."] + #[doc = "- `proxy_type`: The proxy type originally passed to `create_pure`."] + #[doc = "- `height`: The height of the chain when the call to `create_pure` was processed."] + #[doc = "- `ext_index`: The extrinsic index in which the call to `create_pure` was processed."] + #[doc = ""] + #[doc = "Fails with `NoPermission` in case the caller is not a previously created pure"] + #[doc = "account whose `create_pure` call has corresponding parameters."] + pub struct KillPure { + pub spawner: kill_pure::Spawner, + pub proxy_type: kill_pure::ProxyType, + pub index: kill_pure::Index, + #[codec(compact)] + pub height: kill_pure::Height, + #[codec(compact)] + pub ext_index: kill_pure::ExtIndex, + } + pub mod kill_pure { + use super::runtime_types; + pub type Spawner = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type ProxyType = runtime_types::rococo_runtime::ProxyType; + pub type Index = ::core::primitive::u16; + pub type Height = ::core::primitive::u32; + pub type ExtIndex = ::core::primitive::u32; + } + impl KillPure { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "kill_pure"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for KillPure { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Publish the hash of a proxy-call that will be made in the future."] + #[doc = ""] + #[doc = "This must be called some number of blocks before the corresponding `proxy` is attempted"] + #[doc = "if the delay associated with the proxy relationship is greater than zero."] + #[doc = ""] + #[doc = "No more than `MaxPending` announcements may be made at any one time."] + #[doc = ""] + #[doc = "This will take a deposit of `AnnouncementDepositFactor` as well as"] + #[doc = "`AnnouncementDepositBase` if there are no other pending announcements."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a proxy of `real`."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] + pub struct Announce { + pub real: announce::Real, + pub call_hash: announce::CallHash, + } + pub mod announce { + use super::runtime_types; + pub type Real = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type CallHash = ::subxt::utils::H256; + } + impl Announce { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "announce"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Announce { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove a given announcement."] + #[doc = ""] + #[doc = "May be called by a proxy account to remove a call they previously announced and return"] + #[doc = "the deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] + pub struct RemoveAnnouncement { + pub real: remove_announcement::Real, + pub call_hash: remove_announcement::CallHash, + } + pub mod remove_announcement { + use super::runtime_types; + pub type Real = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type CallHash = ::subxt::utils::H256; + } + impl RemoveAnnouncement { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "remove_announcement"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveAnnouncement { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove the given announcement of a delegate."] + #[doc = ""] + #[doc = "May be called by a target (proxied) account to remove a call that one of their delegates"] + #[doc = "(`delegate`) has announced they want to execute. The deposit is returned."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `delegate`: The account that previously announced the call."] + #[doc = "- `call_hash`: The hash of the call to be made."] + pub struct RejectAnnouncement { + pub delegate: reject_announcement::Delegate, + pub call_hash: reject_announcement::CallHash, + } + pub mod reject_announcement { + use super::runtime_types; + pub type Delegate = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type CallHash = ::subxt::utils::H256; + } + impl RejectAnnouncement { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "reject_announcement"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RejectAnnouncement { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] + #[doc = "`add_proxy`."] + #[doc = ""] + #[doc = "Removes any corresponding announcement(s)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] + #[doc = "- `call`: The call to be made by the `real` account."] + pub struct ProxyAnnounced { + pub delegate: proxy_announced::Delegate, + pub real: proxy_announced::Real, + pub force_proxy_type: proxy_announced::ForceProxyType, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod proxy_announced { + use super::runtime_types; + pub type Delegate = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Real = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type ForceProxyType = + ::core::option::Option; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl ProxyAnnounced { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "proxy_announced"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ProxyAnnounced { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Poke / Adjust deposits made for proxies and announcements based on current values."] + #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "The transaction fee is waived if the deposit amount has changed."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if successful."] + pub struct PokeDeposit; + impl PokeDeposit { + const PALLET_NAME: &'static str = "Proxy"; + const CALL_NAME: &'static str = "poke_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PokeDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] + #[doc = "`add_proxy`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] + #[doc = "- `call`: The call to be made by the `real` account."] + pub fn proxy( + &self, + real: super::proxy::Real, + force_proxy_type: super::proxy::ForceProxyType, + call: super::proxy::Call, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "proxy", + super::Proxy { + real, + force_proxy_type, + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 23u8, 157u8, 39u8, 96u8, 67u8, 226u8, 26u8, 153u8, 4u8, 84u8, 88u8, + 103u8, 135u8, 174u8, 17u8, 33u8, 148u8, 53u8, 54u8, 88u8, 103u8, + 179u8, 69u8, 185u8, 117u8, 46u8, 193u8, 60u8, 65u8, 98u8, 3u8, + 81u8, + ], + ) + } + #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `proxy`: The account that the `caller` would like to make a proxy."] + #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] + #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] + #[doc = "zero."] + pub fn add_proxy( + &self, + delegate: super::add_proxy::Delegate, + proxy_type: super::add_proxy::ProxyType, + delay: super::add_proxy::Delay, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "add_proxy", + super::AddProxy { + delegate, + proxy_type, + delay, + }, + [ + 183u8, 95u8, 175u8, 194u8, 140u8, 90u8, 170u8, 28u8, 251u8, 192u8, + 151u8, 138u8, 76u8, 170u8, 207u8, 228u8, 169u8, 124u8, 19u8, 161u8, + 181u8, 87u8, 121u8, 214u8, 101u8, 16u8, 30u8, 122u8, 125u8, 33u8, + 156u8, 197u8, + ], + ) + } + #[doc = "Unregister a proxy account for the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] + #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] + pub fn remove_proxy( + &self, + delegate: super::remove_proxy::Delegate, + proxy_type: super::remove_proxy::ProxyType, + delay: super::remove_proxy::Delay, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "remove_proxy", + super::RemoveProxy { + delegate, + proxy_type, + delay, + }, + [ + 225u8, 127u8, 66u8, 209u8, 96u8, 176u8, 66u8, 143u8, 58u8, 248u8, + 7u8, 95u8, 206u8, 250u8, 239u8, 199u8, 58u8, 128u8, 118u8, 204u8, + 148u8, 80u8, 4u8, 147u8, 20u8, 29u8, 35u8, 188u8, 21u8, 175u8, + 107u8, 223u8, + ], + ) + } + #[doc = "Unregister all proxy accounts for the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "WARNING: This may be called on accounts created by `create_pure`, however if done, then"] + #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] + pub fn remove_proxies( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "remove_proxies", + super::RemoveProxies {}, + [ + 1u8, 126u8, 36u8, 227u8, 185u8, 34u8, 218u8, 236u8, 125u8, 231u8, + 68u8, 185u8, 145u8, 63u8, 250u8, 225u8, 103u8, 3u8, 189u8, 37u8, + 172u8, 195u8, 197u8, 216u8, 99u8, 210u8, 240u8, 162u8, 158u8, + 132u8, 24u8, 6u8, + ], + ) + } + #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] + #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] + #[doc = ""] + #[doc = "Requires a `Signed` origin."] + #[doc = ""] + #[doc = "- `proxy_type`: The type of the proxy that the sender will be registered as over the"] + #[doc = "new account. This will almost always be the most permissive `ProxyType` possible to"] + #[doc = "allow for maximum flexibility."] + #[doc = "- `index`: A disambiguation index, in case this is called multiple times in the same"] + #[doc = "transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just"] + #[doc = "want to use `0`."] + #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] + #[doc = "zero."] + #[doc = ""] + #[doc = "Fails with `Duplicate` if this has already been called in this transaction, from the"] + #[doc = "same sender, with the same parameters."] + #[doc = ""] + #[doc = "Fails if there are insufficient funds to pay for deposit."] + pub fn create_pure( + &self, + proxy_type: super::create_pure::ProxyType, + delay: super::create_pure::Delay, + index: super::create_pure::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "create_pure", + super::CreatePure { + proxy_type, + delay, + index, + }, + [ + 224u8, 201u8, 76u8, 254u8, 224u8, 64u8, 123u8, 29u8, 77u8, 114u8, + 213u8, 47u8, 9u8, 51u8, 87u8, 4u8, 142u8, 93u8, 212u8, 229u8, + 148u8, 159u8, 143u8, 56u8, 0u8, 34u8, 249u8, 228u8, 37u8, 242u8, + 188u8, 28u8, + ], + ) + } + #[doc = "Removes a previously spawned pure proxy."] + #[doc = ""] + #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] + #[doc = "inaccessible."] + #[doc = ""] + #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] + #[doc = "`create_pure` with corresponding parameters."] + #[doc = ""] + #[doc = "- `spawner`: The account that originally called `create_pure` to create this account."] + #[doc = "- `index`: The disambiguation index originally passed to `create_pure`. Probably `0`."] + #[doc = "- `proxy_type`: The proxy type originally passed to `create_pure`."] + #[doc = "- `height`: The height of the chain when the call to `create_pure` was processed."] + #[doc = "- `ext_index`: The extrinsic index in which the call to `create_pure` was processed."] + #[doc = ""] + #[doc = "Fails with `NoPermission` in case the caller is not a previously created pure"] + #[doc = "account whose `create_pure` call has corresponding parameters."] + pub fn kill_pure( + &self, + spawner: super::kill_pure::Spawner, + proxy_type: super::kill_pure::ProxyType, + index: super::kill_pure::Index, + height: super::kill_pure::Height, + ext_index: super::kill_pure::ExtIndex, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "kill_pure", + super::KillPure { + spawner, + proxy_type, + index, + height, + ext_index, + }, + [ + 59u8, 143u8, 9u8, 128u8, 44u8, 243u8, 110u8, 190u8, 82u8, 230u8, + 253u8, 123u8, 30u8, 59u8, 114u8, 141u8, 255u8, 162u8, 42u8, 179u8, + 222u8, 124u8, 235u8, 148u8, 5u8, 45u8, 254u8, 235u8, 75u8, 224u8, + 58u8, 148u8, + ], + ) + } + #[doc = "Publish the hash of a proxy-call that will be made in the future."] + #[doc = ""] + #[doc = "This must be called some number of blocks before the corresponding `proxy` is attempted"] + #[doc = "if the delay associated with the proxy relationship is greater than zero."] + #[doc = ""] + #[doc = "No more than `MaxPending` announcements may be made at any one time."] + #[doc = ""] + #[doc = "This will take a deposit of `AnnouncementDepositFactor` as well as"] + #[doc = "`AnnouncementDepositBase` if there are no other pending announcements."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a proxy of `real`."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] + pub fn announce( + &self, + real: super::announce::Real, + call_hash: super::announce::CallHash, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "announce", + super::Announce { real, call_hash }, + [ + 105u8, 218u8, 232u8, 82u8, 80u8, 10u8, 11u8, 1u8, 93u8, 241u8, + 121u8, 198u8, 167u8, 218u8, 95u8, 15u8, 75u8, 122u8, 155u8, 233u8, + 10u8, 175u8, 145u8, 73u8, 214u8, 230u8, 67u8, 107u8, 23u8, 239u8, + 69u8, 240u8, + ], + ) + } + #[doc = "Remove a given announcement."] + #[doc = ""] + #[doc = "May be called by a proxy account to remove a call they previously announced and return"] + #[doc = "the deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] + pub fn remove_announcement( + &self, + real: super::remove_announcement::Real, + call_hash: super::remove_announcement::CallHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "remove_announcement", + super::RemoveAnnouncement { real, call_hash }, + [ + 40u8, 237u8, 179u8, 128u8, 201u8, 183u8, 20u8, 47u8, 99u8, 182u8, + 81u8, 31u8, 27u8, 212u8, 133u8, 36u8, 8u8, 248u8, 57u8, 230u8, + 138u8, 80u8, 241u8, 147u8, 69u8, 236u8, 156u8, 167u8, 205u8, 49u8, + 60u8, 16u8, + ], + ) + } + #[doc = "Remove the given announcement of a delegate."] + #[doc = ""] + #[doc = "May be called by a target (proxied) account to remove a call that one of their delegates"] + #[doc = "(`delegate`) has announced they want to execute. The deposit is returned."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `delegate`: The account that previously announced the call."] + #[doc = "- `call_hash`: The hash of the call to be made."] + pub fn reject_announcement( + &self, + delegate: super::reject_announcement::Delegate, + call_hash: super::reject_announcement::CallHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "reject_announcement", + super::RejectAnnouncement { + delegate, + call_hash, + }, + [ + 150u8, 178u8, 49u8, 160u8, 211u8, 75u8, 58u8, 228u8, 121u8, 253u8, + 167u8, 72u8, 68u8, 105u8, 159u8, 52u8, 41u8, 155u8, 92u8, 26u8, + 169u8, 177u8, 102u8, 36u8, 1u8, 47u8, 87u8, 189u8, 223u8, 238u8, + 244u8, 110u8, + ], + ) + } + #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] + #[doc = "`add_proxy`."] + #[doc = ""] + #[doc = "Removes any corresponding announcement(s)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] + #[doc = "- `call`: The call to be made by the `real` account."] + pub fn proxy_announced( + &self, + delegate: super::proxy_announced::Delegate, + real: super::proxy_announced::Real, + force_proxy_type: super::proxy_announced::ForceProxyType, + call: super::proxy_announced::Call, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "proxy_announced", + super::ProxyAnnounced { + delegate, + real, + force_proxy_type, + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 108u8, 219u8, 113u8, 213u8, 48u8, 200u8, 156u8, 43u8, 157u8, 109u8, + 236u8, 149u8, 205u8, 5u8, 199u8, 253u8, 108u8, 143u8, 255u8, 3u8, + 167u8, 167u8, 181u8, 34u8, 115u8, 120u8, 169u8, 5u8, 14u8, 116u8, + 206u8, 44u8, + ], + ) + } + #[doc = "Poke / Adjust deposits made for proxies and announcements based on current values."] + #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "The transaction fee is waived if the deposit amount has changed."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if successful."] + pub fn poke_deposit( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Proxy", + "poke_deposit", + super::PokeDeposit {}, + [ + 127u8, 254u8, 187u8, 13u8, 51u8, 85u8, 145u8, 82u8, 61u8, 152u8, + 218u8, 135u8, 191u8, 67u8, 53u8, 140u8, 42u8, 68u8, 7u8, 14u8, + 95u8, 60u8, 41u8, 135u8, 32u8, 99u8, 40u8, 111u8, 10u8, 21u8, + 103u8, 107u8, + ], + ) + } + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_proxy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A proxy was executed correctly, with the given."] + pub struct ProxyExecuted { + pub result: proxy_executed::Result, + } + pub mod proxy_executed { + use super::runtime_types; + pub type Result = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; + } + impl ProxyExecuted { + const PALLET_NAME: &'static str = "Proxy"; + const EVENT_NAME: &'static str = "ProxyExecuted"; + } + impl ::subxt::events::DecodeAsEvent for ProxyExecuted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A pure account has been created by new proxy with given"] + #[doc = "disambiguation index and proxy type."] + pub struct PureCreated { + pub pure: pure_created::Pure, + pub who: pure_created::Who, + pub proxy_type: pure_created::ProxyType, + pub disambiguation_index: pure_created::DisambiguationIndex, + pub at: pure_created::At, + pub extrinsic_index: pure_created::ExtrinsicIndex, + } + pub mod pure_created { + use super::runtime_types; + pub type Pure = ::subxt::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; + pub type ProxyType = runtime_types::rococo_runtime::ProxyType; + pub type DisambiguationIndex = ::core::primitive::u16; + pub type At = ::core::primitive::u32; + pub type ExtrinsicIndex = ::core::primitive::u32; + } + impl PureCreated { + const PALLET_NAME: &'static str = "Proxy"; + const EVENT_NAME: &'static str = "PureCreated"; + } + impl ::subxt::events::DecodeAsEvent for PureCreated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A pure proxy was killed by its spawner."] + pub struct PureKilled { + pub pure: pure_killed::Pure, + pub spawner: pure_killed::Spawner, + pub proxy_type: pure_killed::ProxyType, + pub disambiguation_index: pure_killed::DisambiguationIndex, + } + pub mod pure_killed { + use super::runtime_types; + pub type Pure = ::subxt::utils::AccountId32; + pub type Spawner = ::subxt::utils::AccountId32; + pub type ProxyType = runtime_types::rococo_runtime::ProxyType; + pub type DisambiguationIndex = ::core::primitive::u16; + } + impl PureKilled { + const PALLET_NAME: &'static str = "Proxy"; + const EVENT_NAME: &'static str = "PureKilled"; + } + impl ::subxt::events::DecodeAsEvent for PureKilled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "An announcement was placed to make a call in the future."] pub struct Announced { pub real: announced::Real, pub proxy: announced::Proxy, @@ -24616,21 +25072,26 @@ pub mod api { } pub mod announced { use super::runtime_types; - pub type Real = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Proxy = ::subxt::ext::subxt_core::utils::AccountId32; - pub type CallHash = ::subxt::ext::subxt_core::utils::H256; + pub type Real = ::subxt::utils::AccountId32; + pub type Proxy = ::subxt::utils::AccountId32; + pub type CallHash = ::subxt::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Announced { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "Announced"; + impl Announced { + const PALLET_NAME: &'static str = "Proxy"; + const EVENT_NAME: &'static str = "Announced"; + } + impl ::subxt::events::DecodeAsEvent for Announced { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A proxy was added."] pub struct ProxyAdded { pub delegator: proxy_added::Delegator, @@ -24640,22 +25101,27 @@ pub mod api { } pub mod proxy_added { use super::runtime_types; - pub type Delegator = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delegatee = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delegator = ::subxt::utils::AccountId32; + pub type Delegatee = ::subxt::utils::AccountId32; pub type ProxyType = runtime_types::rococo_runtime::ProxyType; pub type Delay = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ProxyAdded { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyAdded"; + impl ProxyAdded { + const PALLET_NAME: &'static str = "Proxy"; + const EVENT_NAME: &'static str = "ProxyAdded"; + } + impl ::subxt::events::DecodeAsEvent for ProxyAdded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A proxy was removed."] pub struct ProxyRemoved { pub delegator: proxy_removed::Delegator, @@ -24665,22 +25131,27 @@ pub mod api { } pub mod proxy_removed { use super::runtime_types; - pub type Delegator = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delegatee = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delegator = ::subxt::utils::AccountId32; + pub type Delegatee = ::subxt::utils::AccountId32; pub type ProxyType = runtime_types::rococo_runtime::ProxyType; pub type Delay = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ProxyRemoved { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyRemoved"; + impl ProxyRemoved { + const PALLET_NAME: &'static str = "Proxy"; + const EVENT_NAME: &'static str = "ProxyRemoved"; + } + impl ::subxt::events::DecodeAsEvent for ProxyRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A deposit stored for proxies or announcements was poked / updated."] pub struct DepositPoked { pub who: deposit_poked::Who, @@ -24690,14 +25161,19 @@ pub mod api { } pub mod deposit_poked { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Kind = runtime_types::pallet_proxy::DepositKind; pub type OldDeposit = ::core::primitive::u128; pub type NewDeposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "DepositPoked"; + impl DepositPoked { + const PALLET_NAME: &'static str = "Proxy"; + const EVENT_NAME: &'static str = "DepositPoked"; + } + impl ::subxt::events::DecodeAsEvent for DepositPoked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -24709,12 +25185,12 @@ pub mod api { #[doc = " which are being delegated to, together with the amount held on deposit."] pub fn proxies( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (proxies::Param0,), - proxies::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (proxies::input::Param0,), + proxies::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Proxy", "Proxies", [ @@ -24727,12 +25203,12 @@ pub mod api { #[doc = " The announcements made by the proxy (key)."] pub fn announcements( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (announcements::Param0,), - announcements::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (announcements::input::Param0,), + announcements::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Proxy", "Announcements", [ @@ -24746,38 +25222,38 @@ pub mod api { pub mod proxies { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ( - runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::ProxyDefinition< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::rococo_runtime::ProxyType, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ); + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = ( + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::ProxyDefinition< + ::subxt::utils::AccountId32, + runtime_types::rococo_runtime::ProxyType, + ::core::primitive::u32, + >, + >, + ::core::primitive::u128, + ); } pub mod announcements { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ( - runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::Announcement< - ::subxt::ext::subxt_core::utils::AccountId32, - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ); + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = ( + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::Announcement< + ::subxt::utils::AccountId32, + ::subxt::utils::H256, + ::core::primitive::u32, + >, + >, + ::core::primitive::u128, + ); } } pub mod constants { @@ -24790,10 +25266,8 @@ pub mod api { #[doc = " `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes."] pub fn proxy_deposit_base( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Proxy", "ProxyDepositBase", [ @@ -24810,10 +25284,8 @@ pub mod api { #[doc = " into account `32 + proxy_type.encode().len()` bytes of data."] pub fn proxy_deposit_factor( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Proxy", "ProxyDepositFactor", [ @@ -24826,10 +25298,8 @@ pub mod api { #[doc = " The maximum amount of proxies allowed for a single account."] pub fn max_proxies( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Proxy", "MaxProxies", [ @@ -24843,10 +25313,8 @@ pub mod api { #[doc = " The maximum amount of time-delayed announcements that are allowed to be pending."] pub fn max_pending( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Proxy", "MaxPending", [ @@ -24863,10 +25331,8 @@ pub mod api { #[doc = " bytes)."] pub fn announcement_deposit_base( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Proxy", "AnnouncementDepositBase", [ @@ -24882,10 +25348,8 @@ pub mod api { #[doc = " into a pre-existing storage value."] pub fn announcement_deposit_factor( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Proxy", "AnnouncementDepositFactor", [ @@ -24908,555 +25372,553 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] + #[doc = "multi-signature, but do not participate in the approval process."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] + pub struct AsMultiThreshold1 { + pub other_signatories: as_multi_threshold1::OtherSignatories, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod as_multi_threshold1 { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] - #[doc = "multi-signature, but do not participate in the approval process."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] - pub struct AsMultiThreshold1 { - pub other_signatories: as_multi_threshold1::OtherSignatories, - pub call: - ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod as_multi_threshold1 { - use super::runtime_types; - pub type OtherSignatories = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsMultiThreshold1 { - const PALLET: &'static str = "Multisig"; - const CALL: &'static str = "as_multi_threshold_1"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "If there are enough, then dispatch the call."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] - #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] - #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] - #[doc = "may be found in the deposited `MultisigExecuted` event."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(S + Z + Call)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- The weight of the `call`."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - pub struct AsMulti { - pub threshold: as_multi::Threshold, - pub other_signatories: as_multi::OtherSignatories, - pub maybe_timepoint: as_multi::MaybeTimepoint, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub max_weight: as_multi::MaxWeight, - } - pub mod as_multi { - use super::runtime_types; - pub type Threshold = ::core::primitive::u16; - pub type OtherSignatories = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type MaybeTimepoint = ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - pub type MaxWeight = runtime_types::sp_weights::weight_v2::Weight; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsMulti { - const PALLET: &'static str = "Multisig"; - const CALL: &'static str = "as_multi"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - pub struct ApproveAsMulti { - pub threshold: approve_as_multi::Threshold, - pub other_signatories: approve_as_multi::OtherSignatories, - pub maybe_timepoint: approve_as_multi::MaybeTimepoint, - pub call_hash: approve_as_multi::CallHash, - pub max_weight: approve_as_multi::MaxWeight, - } - pub mod approve_as_multi { - use super::runtime_types; - pub type Threshold = ::core::primitive::u16; - pub type OtherSignatories = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type MaybeTimepoint = ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >; - pub type CallHash = [::core::primitive::u8; 32usize]; - pub type MaxWeight = runtime_types::sp_weights::weight_v2::Weight; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApproveAsMulti { - const PALLET: &'static str = "Multisig"; - const CALL: &'static str = "approve_as_multi"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] - #[doc = "for this operation will be unreserved on success."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] - #[doc = "transaction for this dispatch."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- One event."] - #[doc = "- I/O: 1 read `O(S)`, one remove."] - #[doc = "- Storage: removes one item."] - pub struct CancelAsMulti { - pub threshold: cancel_as_multi::Threshold, - pub other_signatories: cancel_as_multi::OtherSignatories, - pub timepoint: cancel_as_multi::Timepoint, - pub call_hash: cancel_as_multi::CallHash, - } - pub mod cancel_as_multi { - use super::runtime_types; - pub type Threshold = ::core::primitive::u16; - pub type OtherSignatories = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Timepoint = - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>; - pub type CallHash = [::core::primitive::u8; 32usize]; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelAsMulti { - const PALLET: &'static str = "Multisig"; - const CALL: &'static str = "cancel_as_multi"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Poke the deposit reserved for an existing multisig operation."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be the original depositor of"] - #[doc = "the multisig operation."] - #[doc = ""] - #[doc = "The transaction fee is waived if the deposit amount has changed."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals needed for this multisig."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] - #[doc = " multisig."] - #[doc = "- `call_hash`: The hash of the call this deposit is reserved for."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if successful."] - pub struct PokeDeposit { - pub threshold: poke_deposit::Threshold, - pub other_signatories: poke_deposit::OtherSignatories, - pub call_hash: poke_deposit::CallHash, - } - pub mod poke_deposit { - use super::runtime_types; - pub type Threshold = ::core::primitive::u16; - pub type OtherSignatories = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type CallHash = [::core::primitive::u8; 32usize]; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { - const PALLET: &'static str = "Multisig"; - const CALL: &'static str = "poke_deposit"; - } + pub type OtherSignatories = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] - #[doc = "multi-signature, but do not participate in the approval process."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] - pub fn as_multi_threshold_1( - &self, - other_signatories: types::as_multi_threshold1::OtherSignatories, - call: types::as_multi_threshold1::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Multisig", - "as_multi_threshold_1", - types::AsMultiThreshold1 { - other_signatories, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 155u8, 193u8, 223u8, 126u8, 147u8, 38u8, 173u8, 120u8, 69u8, 82u8, - 235u8, 44u8, 119u8, 17u8, 33u8, 0u8, 193u8, 125u8, 0u8, 202u8, 245u8, - 214u8, 25u8, 21u8, 241u8, 144u8, 216u8, 150u8, 109u8, 187u8, 40u8, - 111u8, - ], - ) - } - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "If there are enough, then dispatch the call."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] - #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] - #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] - #[doc = "may be found in the deposited `MultisigExecuted` event."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(S + Z + Call)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- The weight of the `call`."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - pub fn as_multi( - &self, - threshold: types::as_multi::Threshold, - other_signatories: types::as_multi::OtherSignatories, - maybe_timepoint: types::as_multi::MaybeTimepoint, - call: types::as_multi::Call, - max_weight: types::as_multi::MaxWeight, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Multisig", - "as_multi", - types::AsMulti { - threshold, - other_signatories, - maybe_timepoint, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - max_weight, - }, - [ - 231u8, 225u8, 55u8, 242u8, 193u8, 170u8, 114u8, 68u8, 231u8, 33u8, - 71u8, 215u8, 210u8, 63u8, 118u8, 112u8, 106u8, 1u8, 100u8, 178u8, 18u8, - 250u8, 96u8, 178u8, 140u8, 200u8, 145u8, 13u8, 147u8, 216u8, 88u8, - 209u8, - ], - ) - } - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - pub fn approve_as_multi( - &self, - threshold: types::approve_as_multi::Threshold, - other_signatories: types::approve_as_multi::OtherSignatories, - maybe_timepoint: types::approve_as_multi::MaybeTimepoint, - call_hash: types::approve_as_multi::CallHash, - max_weight: types::approve_as_multi::MaxWeight, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Multisig", - "approve_as_multi", - types::ApproveAsMulti { - threshold, - other_signatories, - maybe_timepoint, - call_hash, - max_weight, - }, - [ - 248u8, 46u8, 131u8, 35u8, 204u8, 12u8, 218u8, 150u8, 88u8, 131u8, 89u8, - 13u8, 95u8, 122u8, 87u8, 107u8, 136u8, 154u8, 92u8, 199u8, 108u8, 92u8, - 207u8, 171u8, 113u8, 8u8, 47u8, 248u8, 65u8, 26u8, 203u8, 135u8, - ], - ) - } - #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] - #[doc = "for this operation will be unreserved on success."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] - #[doc = "transaction for this dispatch."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- One event."] - #[doc = "- I/O: 1 read `O(S)`, one remove."] - #[doc = "- Storage: removes one item."] - pub fn cancel_as_multi( - &self, - threshold: types::cancel_as_multi::Threshold, - other_signatories: types::cancel_as_multi::OtherSignatories, - timepoint: types::cancel_as_multi::Timepoint, - call_hash: types::cancel_as_multi::CallHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Multisig", - "cancel_as_multi", - types::CancelAsMulti { - threshold, - other_signatories, - timepoint, - call_hash, - }, - [ - 212u8, 179u8, 123u8, 40u8, 209u8, 228u8, 181u8, 0u8, 109u8, 28u8, 27u8, - 48u8, 15u8, 47u8, 203u8, 54u8, 106u8, 114u8, 28u8, 118u8, 101u8, 201u8, - 95u8, 187u8, 46u8, 182u8, 4u8, 30u8, 227u8, 105u8, 14u8, 81u8, - ], - ) - } - #[doc = "Poke the deposit reserved for an existing multisig operation."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be the original depositor of"] - #[doc = "the multisig operation."] - #[doc = ""] - #[doc = "The transaction fee is waived if the deposit amount has changed."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals needed for this multisig."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] - #[doc = " multisig."] - #[doc = "- `call_hash`: The hash of the call this deposit is reserved for."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if successful."] - pub fn poke_deposit( - &self, - threshold: types::poke_deposit::Threshold, - other_signatories: types::poke_deposit::OtherSignatories, - call_hash: types::poke_deposit::CallHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Multisig", - "poke_deposit", - types::PokeDeposit { - threshold, - other_signatories, - call_hash, - }, - [ - 246u8, 199u8, 149u8, 204u8, 29u8, 162u8, 169u8, 44u8, 250u8, 24u8, - 64u8, 191u8, 18u8, 238u8, 140u8, 153u8, 139u8, 208u8, 157u8, 245u8, - 145u8, 205u8, 56u8, 130u8, 119u8, 246u8, 174u8, 111u8, 83u8, 221u8, - 85u8, 84u8, - ], - ) + impl AsMultiThreshold1 { + const PALLET_NAME: &'static str = "Multisig"; + const CALL_NAME: &'static str = "as_multi_threshold_1"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AsMultiThreshold1 { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_multisig::pallet::Event; - pub mod events { - use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A new multisig operation has begun."] - pub struct NewMultisig { - pub approving: new_multisig::Approving, - pub multisig: new_multisig::Multisig, - pub call_hash: new_multisig::CallHash, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "If there are enough, then dispatch the call."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] + #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] + #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] + #[doc = "may be found in the deposited `MultisigExecuted` event."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(S + Z + Call)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- The weight of the `call`."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + pub struct AsMulti { + pub threshold: as_multi::Threshold, + pub other_signatories: as_multi::OtherSignatories, + pub maybe_timepoint: as_multi::MaybeTimepoint, + pub call: ::subxt::alloc::boxed::Box, + pub max_weight: as_multi::MaxWeight, + } + pub mod as_multi { + use super::runtime_types; + pub type Threshold = ::core::primitive::u16; + pub type OtherSignatories = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + pub type MaybeTimepoint = ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + pub type MaxWeight = runtime_types::sp_weights::weight_v2::Weight; } - pub mod new_multisig { - use super::runtime_types; - pub type Approving = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Multisig = ::subxt::ext::subxt_core::utils::AccountId32; - pub type CallHash = [::core::primitive::u8; 32usize]; + impl AsMulti { + const PALLET_NAME: &'static str = "Multisig"; + const CALL_NAME: &'static str = "as_multi"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NewMultisig { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "NewMultisig"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for AsMulti { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A multisig operation has been approved by someone."] - pub struct MultisigApproval { + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + pub struct ApproveAsMulti { + pub threshold: approve_as_multi::Threshold, + pub other_signatories: approve_as_multi::OtherSignatories, + pub maybe_timepoint: approve_as_multi::MaybeTimepoint, + pub call_hash: approve_as_multi::CallHash, + pub max_weight: approve_as_multi::MaxWeight, + } + pub mod approve_as_multi { + use super::runtime_types; + pub type Threshold = ::core::primitive::u16; + pub type OtherSignatories = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + pub type MaybeTimepoint = ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >; + pub type CallHash = [::core::primitive::u8; 32usize]; + pub type MaxWeight = runtime_types::sp_weights::weight_v2::Weight; + } + impl ApproveAsMulti { + const PALLET_NAME: &'static str = "Multisig"; + const CALL_NAME: &'static str = "approve_as_multi"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ApproveAsMulti { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] + #[doc = "for this operation will be unreserved on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] + #[doc = "transaction for this dispatch."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- One event."] + #[doc = "- I/O: 1 read `O(S)`, one remove."] + #[doc = "- Storage: removes one item."] + pub struct CancelAsMulti { + pub threshold: cancel_as_multi::Threshold, + pub other_signatories: cancel_as_multi::OtherSignatories, + pub timepoint: cancel_as_multi::Timepoint, + pub call_hash: cancel_as_multi::CallHash, + } + pub mod cancel_as_multi { + use super::runtime_types; + pub type Threshold = ::core::primitive::u16; + pub type OtherSignatories = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + pub type Timepoint = + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>; + pub type CallHash = [::core::primitive::u8; 32usize]; + } + impl CancelAsMulti { + const PALLET_NAME: &'static str = "Multisig"; + const CALL_NAME: &'static str = "cancel_as_multi"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CancelAsMulti { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Poke the deposit reserved for an existing multisig operation."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be the original depositor of"] + #[doc = "the multisig operation."] + #[doc = ""] + #[doc = "The transaction fee is waived if the deposit amount has changed."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals needed for this multisig."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] + #[doc = " multisig."] + #[doc = "- `call_hash`: The hash of the call this deposit is reserved for."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if successful."] + pub struct PokeDeposit { + pub threshold: poke_deposit::Threshold, + pub other_signatories: poke_deposit::OtherSignatories, + pub call_hash: poke_deposit::CallHash, + } + pub mod poke_deposit { + use super::runtime_types; + pub type Threshold = ::core::primitive::u16; + pub type OtherSignatories = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + pub type CallHash = [::core::primitive::u8; 32usize]; + } + impl PokeDeposit { + const PALLET_NAME: &'static str = "Multisig"; + const CALL_NAME: &'static str = "poke_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PokeDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] + #[doc = "multi-signature, but do not participate in the approval process."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] + pub fn as_multi_threshold_1( + &self, + other_signatories: super::as_multi_threshold1::OtherSignatories, + call: super::as_multi_threshold1::Call, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Multisig", + "as_multi_threshold_1", + super::AsMultiThreshold1 { + other_signatories, + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 155u8, 193u8, 223u8, 126u8, 147u8, 38u8, 173u8, 120u8, 69u8, 82u8, + 235u8, 44u8, 119u8, 17u8, 33u8, 0u8, 193u8, 125u8, 0u8, 202u8, + 245u8, 214u8, 25u8, 21u8, 241u8, 144u8, 216u8, 150u8, 109u8, 187u8, + 40u8, 111u8, + ], + ) + } + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "If there are enough, then dispatch the call."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] + #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] + #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] + #[doc = "may be found in the deposited `MultisigExecuted` event."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(S + Z + Call)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- The weight of the `call`."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + pub fn as_multi( + &self, + threshold: super::as_multi::Threshold, + other_signatories: super::as_multi::OtherSignatories, + maybe_timepoint: super::as_multi::MaybeTimepoint, + call: super::as_multi::Call, + max_weight: super::as_multi::MaxWeight, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Multisig", + "as_multi", + super::AsMulti { + threshold, + other_signatories, + maybe_timepoint, + call: ::subxt::alloc::boxed::Box::new(call), + max_weight, + }, + [ + 231u8, 225u8, 55u8, 242u8, 193u8, 170u8, 114u8, 68u8, 231u8, 33u8, + 71u8, 215u8, 210u8, 63u8, 118u8, 112u8, 106u8, 1u8, 100u8, 178u8, + 18u8, 250u8, 96u8, 178u8, 140u8, 200u8, 145u8, 13u8, 147u8, 216u8, + 88u8, 209u8, + ], + ) + } + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + pub fn approve_as_multi( + &self, + threshold: super::approve_as_multi::Threshold, + other_signatories: super::approve_as_multi::OtherSignatories, + maybe_timepoint: super::approve_as_multi::MaybeTimepoint, + call_hash: super::approve_as_multi::CallHash, + max_weight: super::approve_as_multi::MaxWeight, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Multisig", + "approve_as_multi", + super::ApproveAsMulti { + threshold, + other_signatories, + maybe_timepoint, + call_hash, + max_weight, + }, + [ + 248u8, 46u8, 131u8, 35u8, 204u8, 12u8, 218u8, 150u8, 88u8, 131u8, + 89u8, 13u8, 95u8, 122u8, 87u8, 107u8, 136u8, 154u8, 92u8, 199u8, + 108u8, 92u8, 207u8, 171u8, 113u8, 8u8, 47u8, 248u8, 65u8, 26u8, + 203u8, 135u8, + ], + ) + } + #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] + #[doc = "for this operation will be unreserved on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] + #[doc = "transaction for this dispatch."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- One event."] + #[doc = "- I/O: 1 read `O(S)`, one remove."] + #[doc = "- Storage: removes one item."] + pub fn cancel_as_multi( + &self, + threshold: super::cancel_as_multi::Threshold, + other_signatories: super::cancel_as_multi::OtherSignatories, + timepoint: super::cancel_as_multi::Timepoint, + call_hash: super::cancel_as_multi::CallHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Multisig", + "cancel_as_multi", + super::CancelAsMulti { + threshold, + other_signatories, + timepoint, + call_hash, + }, + [ + 212u8, 179u8, 123u8, 40u8, 209u8, 228u8, 181u8, 0u8, 109u8, 28u8, + 27u8, 48u8, 15u8, 47u8, 203u8, 54u8, 106u8, 114u8, 28u8, 118u8, + 101u8, 201u8, 95u8, 187u8, 46u8, 182u8, 4u8, 30u8, 227u8, 105u8, + 14u8, 81u8, + ], + ) + } + #[doc = "Poke the deposit reserved for an existing multisig operation."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be the original depositor of"] + #[doc = "the multisig operation."] + #[doc = ""] + #[doc = "The transaction fee is waived if the deposit amount has changed."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals needed for this multisig."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] + #[doc = " multisig."] + #[doc = "- `call_hash`: The hash of the call this deposit is reserved for."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if successful."] + pub fn poke_deposit( + &self, + threshold: super::poke_deposit::Threshold, + other_signatories: super::poke_deposit::OtherSignatories, + call_hash: super::poke_deposit::CallHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Multisig", + "poke_deposit", + super::PokeDeposit { + threshold, + other_signatories, + call_hash, + }, + [ + 246u8, 199u8, 149u8, 204u8, 29u8, 162u8, 169u8, 44u8, 250u8, 24u8, + 64u8, 191u8, 18u8, 238u8, 140u8, 153u8, 139u8, 208u8, 157u8, 245u8, + 145u8, 205u8, 56u8, 130u8, 119u8, 246u8, 174u8, 111u8, 83u8, 221u8, + 85u8, 84u8, + ], + ) + } + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_multisig::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A new multisig operation has begun."] + pub struct NewMultisig { + pub approving: new_multisig::Approving, + pub multisig: new_multisig::Multisig, + pub call_hash: new_multisig::CallHash, + } + pub mod new_multisig { + use super::runtime_types; + pub type Approving = ::subxt::utils::AccountId32; + pub type Multisig = ::subxt::utils::AccountId32; + pub type CallHash = [::core::primitive::u8; 32usize]; + } + impl NewMultisig { + const PALLET_NAME: &'static str = "Multisig"; + const EVENT_NAME: &'static str = "NewMultisig"; + } + impl ::subxt::events::DecodeAsEvent for NewMultisig { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A multisig operation has been approved by someone."] + pub struct MultisigApproval { pub approving: multisig_approval::Approving, pub timepoint: multisig_approval::Timepoint, pub multisig: multisig_approval::Multisig, @@ -25464,23 +25926,28 @@ pub mod api { } pub mod multisig_approval { use super::runtime_types; - pub type Approving = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Approving = ::subxt::utils::AccountId32; pub type Timepoint = runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>; - pub type Multisig = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Multisig = ::subxt::utils::AccountId32; pub type CallHash = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MultisigApproval { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigApproval"; + impl MultisigApproval { + const PALLET_NAME: &'static str = "Multisig"; + const EVENT_NAME: &'static str = "MultisigApproval"; + } + impl ::subxt::events::DecodeAsEvent for MultisigApproval { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A multisig operation has been executed."] pub struct MultisigExecuted { pub approving: multisig_executed::Approving, @@ -25491,25 +25958,30 @@ pub mod api { } pub mod multisig_executed { use super::runtime_types; - pub type Approving = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Approving = ::subxt::utils::AccountId32; pub type Timepoint = runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>; - pub type Multisig = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Multisig = ::subxt::utils::AccountId32; pub type CallHash = [::core::primitive::u8; 32usize]; pub type Result = ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MultisigExecuted { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigExecuted"; + impl MultisigExecuted { + const PALLET_NAME: &'static str = "Multisig"; + const EVENT_NAME: &'static str = "MultisigExecuted"; + } + impl ::subxt::events::DecodeAsEvent for MultisigExecuted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A multisig operation has been cancelled."] pub struct MultisigCancelled { pub cancelling: multisig_cancelled::Cancelling, @@ -25519,23 +25991,28 @@ pub mod api { } pub mod multisig_cancelled { use super::runtime_types; - pub type Cancelling = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Cancelling = ::subxt::utils::AccountId32; pub type Timepoint = runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>; - pub type Multisig = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Multisig = ::subxt::utils::AccountId32; pub type CallHash = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MultisigCancelled { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigCancelled"; + impl MultisigCancelled { + const PALLET_NAME: &'static str = "Multisig"; + const EVENT_NAME: &'static str = "MultisigCancelled"; + } + impl ::subxt::events::DecodeAsEvent for MultisigCancelled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The deposit for a multisig operation has been updated/poked."] pub struct DepositPoked { pub who: deposit_poked::Who, @@ -25545,14 +26022,19 @@ pub mod api { } pub mod deposit_poked { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type CallHash = [::core::primitive::u8; 32usize]; pub type OldDeposit = ::core::primitive::u128; pub type NewDeposit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "DepositPoked"; + impl DepositPoked { + const PALLET_NAME: &'static str = "Multisig"; + const EVENT_NAME: &'static str = "DepositPoked"; + } + impl ::subxt::events::DecodeAsEvent for DepositPoked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -25563,12 +26045,12 @@ pub mod api { #[doc = " The set of open multisig operations."] pub fn multisigs( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (multisigs::Param0, multisigs::Param1), - multisigs::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (multisigs::input::Param0, multisigs::input::Param1), + multisigs::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Multisig", "Multisigs", [ @@ -25583,16 +26065,16 @@ pub mod api { pub mod multisigs { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = [::core::primitive::u8; 32usize]; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_multisig::Multisig< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - >; + pub type Param0 = ::subxt::utils::AccountId32; + pub type Param1 = [::core::primitive::u8; 32usize]; } + pub type Output = runtime_types::pallet_multisig::Multisig< + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::utils::AccountId32, + >; } } pub mod constants { @@ -25607,10 +26089,8 @@ pub mod api { #[doc = " `32 + sizeof(AccountId)` bytes."] pub fn deposit_base( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Multisig", "DepositBase", [ @@ -25625,10 +26105,8 @@ pub mod api { #[doc = " This is held for adding 32 bytes more into a pre-existing storage value."] pub fn deposit_factor( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Multisig", "DepositFactor", [ @@ -25641,10 +26119,8 @@ pub mod api { #[doc = " The maximum amount of signatories allowed in the multisig."] pub fn max_signatories( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Multisig", "MaxSignatories", [ @@ -25668,247 +26144,249 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Register a preimage on-chain."] + #[doc = ""] + #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] + #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] + pub struct NotePreimage { + pub bytes: note_preimage::Bytes, + } + pub mod note_preimage { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Register a preimage on-chain."] - #[doc = ""] - #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] - #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] - pub struct NotePreimage { - pub bytes: note_preimage::Bytes, - } - pub mod note_preimage { - use super::runtime_types; - pub type Bytes = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NotePreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "note_preimage"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clear an unrequested preimage from the runtime storage."] - #[doc = ""] - #[doc = "If `len` is provided, then it will be a much cheaper operation."] - #[doc = ""] - #[doc = "- `hash`: The hash of the preimage to be removed from the store."] - #[doc = "- `len`: The length of the preimage of `hash`."] - pub struct UnnotePreimage { - pub hash: unnote_preimage::Hash, - } - pub mod unnote_preimage { - use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnnotePreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "unnote_preimage"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] - #[doc = ""] - #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] - #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - pub struct RequestPreimage { - pub hash: request_preimage::Hash, - } - pub mod request_preimage { - use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RequestPreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "request_preimage"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clear a previously made request for a preimage."] - #[doc = ""] - #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - pub struct UnrequestPreimage { - pub hash: unrequest_preimage::Hash, - } - pub mod unrequest_preimage { - use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnrequestPreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "unrequest_preimage"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Ensure that the bulk of pre-images is upgraded."] - #[doc = ""] - #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] - pub struct EnsureUpdated { - pub hashes: ensure_updated::Hashes, - } - pub mod ensure_updated { - use super::runtime_types; - pub type Hashes = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::H256, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for EnsureUpdated { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "ensure_updated"; + pub type Bytes = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl NotePreimage { + const PALLET_NAME: &'static str = "Preimage"; + const CALL_NAME: &'static str = "note_preimage"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for NotePreimage { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Register a preimage on-chain."] - #[doc = ""] - #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] - #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] - pub fn note_preimage( - &self, - bytes: types::note_preimage::Bytes, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "note_preimage", - types::NotePreimage { bytes }, - [ - 121u8, 88u8, 18u8, 92u8, 176u8, 15u8, 192u8, 198u8, 146u8, 198u8, 38u8, - 242u8, 213u8, 83u8, 7u8, 230u8, 14u8, 110u8, 235u8, 32u8, 215u8, 26u8, - 192u8, 217u8, 113u8, 224u8, 206u8, 96u8, 177u8, 198u8, 246u8, 33u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Clear an unrequested preimage from the runtime storage."] + #[doc = ""] + #[doc = "If `len` is provided, then it will be a much cheaper operation."] + #[doc = ""] + #[doc = "- `hash`: The hash of the preimage to be removed from the store."] + #[doc = "- `len`: The length of the preimage of `hash`."] + pub struct UnnotePreimage { + pub hash: unnote_preimage::Hash, + } + pub mod unnote_preimage { + use super::runtime_types; + pub type Hash = ::subxt::utils::H256; + } + impl UnnotePreimage { + const PALLET_NAME: &'static str = "Preimage"; + const CALL_NAME: &'static str = "unnote_preimage"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for UnnotePreimage { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Clear an unrequested preimage from the runtime storage."] - #[doc = ""] - #[doc = "If `len` is provided, then it will be a much cheaper operation."] - #[doc = ""] - #[doc = "- `hash`: The hash of the preimage to be removed from the store."] - #[doc = "- `len`: The length of the preimage of `hash`."] - pub fn unnote_preimage( - &self, - hash: types::unnote_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "unnote_preimage", - types::UnnotePreimage { hash }, - [ - 188u8, 116u8, 222u8, 22u8, 127u8, 215u8, 2u8, 133u8, 96u8, 202u8, - 190u8, 123u8, 203u8, 43u8, 200u8, 161u8, 226u8, 24u8, 49u8, 36u8, - 221u8, 160u8, 130u8, 119u8, 30u8, 138u8, 144u8, 85u8, 5u8, 164u8, - 252u8, 222u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] + #[doc = ""] + #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] + #[doc = "a user may have paid, and take the control of the preimage out of their hands."] + pub struct RequestPreimage { + pub hash: request_preimage::Hash, + } + pub mod request_preimage { + use super::runtime_types; + pub type Hash = ::subxt::utils::H256; + } + impl RequestPreimage { + const PALLET_NAME: &'static str = "Preimage"; + const CALL_NAME: &'static str = "request_preimage"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RequestPreimage { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] - #[doc = ""] - #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] - #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - pub fn request_preimage( - &self, - hash: types::request_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "request_preimage", - types::RequestPreimage { hash }, - [ - 87u8, 0u8, 204u8, 111u8, 43u8, 115u8, 64u8, 209u8, 133u8, 13u8, 83u8, - 45u8, 164u8, 166u8, 233u8, 105u8, 242u8, 238u8, 235u8, 208u8, 113u8, - 134u8, 93u8, 242u8, 86u8, 32u8, 7u8, 152u8, 107u8, 208u8, 79u8, 59u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Clear a previously made request for a preimage."] + #[doc = ""] + #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] + pub struct UnrequestPreimage { + pub hash: unrequest_preimage::Hash, + } + pub mod unrequest_preimage { + use super::runtime_types; + pub type Hash = ::subxt::utils::H256; + } + impl UnrequestPreimage { + const PALLET_NAME: &'static str = "Preimage"; + const CALL_NAME: &'static str = "unrequest_preimage"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for UnrequestPreimage { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Clear a previously made request for a preimage."] - #[doc = ""] - #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - pub fn unrequest_preimage( - &self, - hash: types::unrequest_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "unrequest_preimage", - types::UnrequestPreimage { hash }, - [ - 55u8, 37u8, 224u8, 149u8, 142u8, 120u8, 8u8, 68u8, 183u8, 225u8, 255u8, - 240u8, 254u8, 111u8, 58u8, 200u8, 113u8, 217u8, 177u8, 203u8, 107u8, - 104u8, 233u8, 87u8, 252u8, 53u8, 33u8, 112u8, 116u8, 254u8, 117u8, - 134u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Ensure that the bulk of pre-images is upgraded."] + #[doc = ""] + #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] + pub struct EnsureUpdated { + pub hashes: ensure_updated::Hashes, + } + pub mod ensure_updated { + use super::runtime_types; + pub type Hashes = ::subxt::alloc::vec::Vec<::subxt::utils::H256>; + } + impl EnsureUpdated { + const PALLET_NAME: &'static str = "Preimage"; + const CALL_NAME: &'static str = "ensure_updated"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for EnsureUpdated { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Ensure that the bulk of pre-images is upgraded."] - #[doc = ""] - #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] - pub fn ensure_updated( - &self, - hashes: types::ensure_updated::Hashes, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "ensure_updated", - types::EnsureUpdated { hashes }, - [ - 254u8, 228u8, 88u8, 44u8, 126u8, 235u8, 188u8, 153u8, 61u8, 27u8, - 103u8, 253u8, 163u8, 161u8, 113u8, 243u8, 87u8, 136u8, 2u8, 231u8, - 209u8, 188u8, 215u8, 106u8, 192u8, 225u8, 75u8, 125u8, 224u8, 96u8, - 221u8, 90u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Register a preimage on-chain."] + #[doc = ""] + #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] + #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] + pub fn note_preimage( + &self, + bytes: super::note_preimage::Bytes, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Preimage", + "note_preimage", + super::NotePreimage { bytes }, + [ + 121u8, 88u8, 18u8, 92u8, 176u8, 15u8, 192u8, 198u8, 146u8, 198u8, + 38u8, 242u8, 213u8, 83u8, 7u8, 230u8, 14u8, 110u8, 235u8, 32u8, + 215u8, 26u8, 192u8, 217u8, 113u8, 224u8, 206u8, 96u8, 177u8, 198u8, + 246u8, 33u8, + ], + ) + } + #[doc = "Clear an unrequested preimage from the runtime storage."] + #[doc = ""] + #[doc = "If `len` is provided, then it will be a much cheaper operation."] + #[doc = ""] + #[doc = "- `hash`: The hash of the preimage to be removed from the store."] + #[doc = "- `len`: The length of the preimage of `hash`."] + pub fn unnote_preimage( + &self, + hash: super::unnote_preimage::Hash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Preimage", + "unnote_preimage", + super::UnnotePreimage { hash }, + [ + 188u8, 116u8, 222u8, 22u8, 127u8, 215u8, 2u8, 133u8, 96u8, 202u8, + 190u8, 123u8, 203u8, 43u8, 200u8, 161u8, 226u8, 24u8, 49u8, 36u8, + 221u8, 160u8, 130u8, 119u8, 30u8, 138u8, 144u8, 85u8, 5u8, 164u8, + 252u8, 222u8, + ], + ) + } + #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] + #[doc = ""] + #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] + #[doc = "a user may have paid, and take the control of the preimage out of their hands."] + pub fn request_preimage( + &self, + hash: super::request_preimage::Hash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Preimage", + "request_preimage", + super::RequestPreimage { hash }, + [ + 87u8, 0u8, 204u8, 111u8, 43u8, 115u8, 64u8, 209u8, 133u8, 13u8, + 83u8, 45u8, 164u8, 166u8, 233u8, 105u8, 242u8, 238u8, 235u8, 208u8, + 113u8, 134u8, 93u8, 242u8, 86u8, 32u8, 7u8, 152u8, 107u8, 208u8, + 79u8, 59u8, + ], + ) + } + #[doc = "Clear a previously made request for a preimage."] + #[doc = ""] + #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] + pub fn unrequest_preimage( + &self, + hash: super::unrequest_preimage::Hash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Preimage", + "unrequest_preimage", + super::UnrequestPreimage { hash }, + [ + 55u8, 37u8, 224u8, 149u8, 142u8, 120u8, 8u8, 68u8, 183u8, 225u8, + 255u8, 240u8, 254u8, 111u8, 58u8, 200u8, 113u8, 217u8, 177u8, + 203u8, 107u8, 104u8, 233u8, 87u8, 252u8, 53u8, 33u8, 112u8, 116u8, + 254u8, 117u8, 134u8, + ], + ) + } + #[doc = "Ensure that the bulk of pre-images is upgraded."] + #[doc = ""] + #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] + pub fn ensure_updated( + &self, + hashes: super::ensure_updated::Hashes, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Preimage", + "ensure_updated", + super::EnsureUpdated { hashes }, + [ + 254u8, 228u8, 88u8, 44u8, 126u8, 235u8, 188u8, 153u8, 61u8, 27u8, + 103u8, 253u8, 163u8, 161u8, 113u8, 243u8, 87u8, 136u8, 2u8, 231u8, + 209u8, 188u8, 215u8, 106u8, 192u8, 225u8, 75u8, 125u8, 224u8, 96u8, + 221u8, 90u8, + ], + ) + } } } } @@ -25917,61 +26395,76 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A preimage has been noted."] pub struct Noted { pub hash: noted::Hash, } pub mod noted { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Hash = ::subxt::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Noted { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Noted"; + impl Noted { + const PALLET_NAME: &'static str = "Preimage"; + const EVENT_NAME: &'static str = "Noted"; + } + impl ::subxt::events::DecodeAsEvent for Noted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A preimage has been requested."] pub struct Requested { pub hash: requested::Hash, } pub mod requested { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Hash = ::subxt::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Requested { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Requested"; + impl Requested { + const PALLET_NAME: &'static str = "Preimage"; + const EVENT_NAME: &'static str = "Requested"; + } + impl ::subxt::events::DecodeAsEvent for Requested { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A preimage has ben cleared."] pub struct Cleared { pub hash: cleared::Hash, } pub mod cleared { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Hash = ::subxt::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cleared { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Cleared"; + impl Cleared { + const PALLET_NAME: &'static str = "Preimage"; + const EVENT_NAME: &'static str = "Cleared"; + } + impl ::subxt::events::DecodeAsEvent for Cleared { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -25982,12 +26475,12 @@ pub mod api { #[doc = " The request status of a given hash."] pub fn status_for( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (status_for::Param0,), - status_for::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (status_for::input::Param0,), + status_for::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Preimage", "StatusFor", [ @@ -26001,12 +26494,12 @@ pub mod api { #[doc = " The request status of a given hash."] pub fn request_status_for( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (request_status_for::Param0,), - request_status_for::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (request_status_for::input::Param0,), + request_status_for::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Preimage", "RequestStatusFor", [ @@ -26018,12 +26511,12 @@ pub mod api { } pub fn preimage_for( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (preimage_for::Param0,), - preimage_for::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (preimage_for::input::Param0,), + preimage_for::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Preimage", "PreimageFor", [ @@ -26038,40 +26531,37 @@ pub mod api { pub mod status_for { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_preimage::OldRequestStatus< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; + pub type Param0 = ::subxt::utils::H256; } + pub type Output = runtime_types::pallet_preimage::OldRequestStatus< + ::subxt::utils::AccountId32, + ::core::primitive::u128, + >; } pub mod request_status_for { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_preimage::RequestStatus< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::frame_support::traits::tokens::fungible::HoldConsideration, - >; + pub type Param0 = ::subxt::utils::H256; } + pub type Output = runtime_types::pallet_preimage::RequestStatus< + ::subxt::utils::AccountId32, + runtime_types::frame_support::traits::tokens::fungible::HoldConsideration, + >; } pub mod preimage_for { use super::root_mod; use super::runtime_types; - pub type Param0 = ( - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - ); - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + pub type Param0 = (::subxt::utils::H256, ::core::primitive::u32); } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; } } } @@ -26085,173 +26575,167 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Initialize a conversion rate to native balance for the given asset."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)"] + pub struct Create { + pub asset_kind: ::subxt::alloc::boxed::Box, + pub rate: create::Rate, + } + pub mod create { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Initialize a conversion rate to native balance for the given asset."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)"] - pub struct Create { - pub asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub rate: create::Rate, - } - pub mod create { - use super::runtime_types; - pub type AssetKind = - runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; - pub type Rate = runtime_types::sp_arithmetic::fixed_point::FixedU128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Create { - const PALLET: &'static str = "AssetRate"; - const CALL: &'static str = "create"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Update the conversion rate to native balance for the given asset."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)"] - pub struct Update { - pub asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub rate: update::Rate, - } - pub mod update { - use super::runtime_types; - pub type AssetKind = - runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; - pub type Rate = runtime_types::sp_arithmetic::fixed_point::FixedU128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Update { - const PALLET: &'static str = "AssetRate"; - const CALL: &'static str = "update"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove an existing conversion rate to native balance for the given asset."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)"] - pub struct Remove { - pub asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod remove { - use super::runtime_types; - pub type AssetKind = - runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Remove { - const PALLET: &'static str = "AssetRate"; - const CALL: &'static str = "remove"; + pub type AssetKind = + runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; + pub type Rate = runtime_types::sp_arithmetic::fixed_point::FixedU128; + } + impl Create { + const PALLET_NAME: &'static str = "AssetRate"; + const CALL_NAME: &'static str = "create"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Create { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Initialize a conversion rate to native balance for the given asset."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)"] - pub fn create( - &self, - asset_kind: types::create::AssetKind, - rate: types::create::Rate, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "AssetRate", - "create", - types::Create { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - asset_kind, - ), - rate, - }, - [ - 244u8, 178u8, 124u8, 61u8, 129u8, 157u8, 214u8, 70u8, 142u8, 241u8, - 192u8, 255u8, 216u8, 27u8, 94u8, 163u8, 109u8, 23u8, 253u8, 8u8, 246u8, - 198u8, 177u8, 201u8, 188u8, 87u8, 54u8, 108u8, 191u8, 127u8, 41u8, - 24u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Update the conversion rate to native balance for the given asset."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)"] + pub struct Update { + pub asset_kind: ::subxt::alloc::boxed::Box, + pub rate: update::Rate, + } + pub mod update { + use super::runtime_types; + pub type AssetKind = + runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; + pub type Rate = runtime_types::sp_arithmetic::fixed_point::FixedU128; + } + impl Update { + const PALLET_NAME: &'static str = "AssetRate"; + const CALL_NAME: &'static str = "update"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Update { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Update the conversion rate to native balance for the given asset."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)"] - pub fn update( - &self, - asset_kind: types::update::AssetKind, - rate: types::update::Rate, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "AssetRate", - "update", - types::Update { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - asset_kind, - ), - rate, - }, - [ - 79u8, 68u8, 19u8, 151u8, 93u8, 46u8, 250u8, 172u8, 210u8, 237u8, 148u8, - 66u8, 87u8, 22u8, 54u8, 216u8, 209u8, 215u8, 196u8, 40u8, 229u8, 238u8, - 161u8, 44u8, 24u8, 249u8, 196u8, 116u8, 83u8, 51u8, 152u8, 157u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove an existing conversion rate to native balance for the given asset."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)"] + pub struct Remove { + pub asset_kind: ::subxt::alloc::boxed::Box, + } + pub mod remove { + use super::runtime_types; + pub type AssetKind = + runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; + } + impl Remove { + const PALLET_NAME: &'static str = "AssetRate"; + const CALL_NAME: &'static str = "remove"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Remove { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove an existing conversion rate to native balance for the given asset."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)"] - pub fn remove( - &self, - asset_kind: types::remove::AssetKind, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "AssetRate", - "remove", - types::Remove { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - asset_kind, - ), - }, - [ - 18u8, 24u8, 14u8, 156u8, 145u8, 109u8, 6u8, 129u8, 94u8, 178u8, 146u8, - 142u8, 192u8, 189u8, 96u8, 154u8, 248u8, 99u8, 202u8, 186u8, 219u8, - 130u8, 44u8, 4u8, 224u8, 56u8, 135u8, 148u8, 109u8, 7u8, 240u8, 241u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Initialize a conversion rate to native balance for the given asset."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)"] + pub fn create( + &self, + asset_kind: super::create::AssetKind, + rate: super::create::Rate, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "AssetRate", + "create", + super::Create { + asset_kind: ::subxt::alloc::boxed::Box::new(asset_kind), + rate, + }, + [ + 244u8, 178u8, 124u8, 61u8, 129u8, 157u8, 214u8, 70u8, 142u8, 241u8, + 192u8, 255u8, 216u8, 27u8, 94u8, 163u8, 109u8, 23u8, 253u8, 8u8, + 246u8, 198u8, 177u8, 201u8, 188u8, 87u8, 54u8, 108u8, 191u8, 127u8, + 41u8, 24u8, + ], + ) + } + #[doc = "Update the conversion rate to native balance for the given asset."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)"] + pub fn update( + &self, + asset_kind: super::update::AssetKind, + rate: super::update::Rate, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "AssetRate", + "update", + super::Update { + asset_kind: ::subxt::alloc::boxed::Box::new(asset_kind), + rate, + }, + [ + 79u8, 68u8, 19u8, 151u8, 93u8, 46u8, 250u8, 172u8, 210u8, 237u8, + 148u8, 66u8, 87u8, 22u8, 54u8, 216u8, 209u8, 215u8, 196u8, 40u8, + 229u8, 238u8, 161u8, 44u8, 24u8, 249u8, 196u8, 116u8, 83u8, 51u8, + 152u8, 157u8, + ], + ) + } + #[doc = "Remove an existing conversion rate to native balance for the given asset."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)"] + pub fn remove( + &self, + asset_kind: super::remove::AssetKind, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "AssetRate", + "remove", + super::Remove { + asset_kind: ::subxt::alloc::boxed::Box::new(asset_kind), + }, + [ + 18u8, 24u8, 14u8, 156u8, 145u8, 109u8, 6u8, 129u8, 94u8, 178u8, + 146u8, 142u8, 192u8, 189u8, 96u8, 154u8, 248u8, 99u8, 202u8, 186u8, + 219u8, 130u8, 44u8, 4u8, 224u8, 56u8, 135u8, 148u8, 109u8, 7u8, + 240u8, 241u8, + ], + ) + } } } } @@ -26260,12 +26744,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AssetRateCreated { pub asset_kind: asset_rate_created::AssetKind, pub rate: asset_rate_created::Rate, @@ -26276,17 +26760,22 @@ pub mod api { runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; pub type Rate = runtime_types::sp_arithmetic::fixed_point::FixedU128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetRateCreated { - const PALLET: &'static str = "AssetRate"; - const EVENT: &'static str = "AssetRateCreated"; + impl AssetRateCreated { + const PALLET_NAME: &'static str = "AssetRate"; + const EVENT_NAME: &'static str = "AssetRateCreated"; + } + impl ::subxt::events::DecodeAsEvent for AssetRateCreated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AssetRateRemoved { pub asset_kind: asset_rate_removed::AssetKind, } @@ -26295,17 +26784,22 @@ pub mod api { pub type AssetKind = runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetRateRemoved { - const PALLET: &'static str = "AssetRate"; - const EVENT: &'static str = "AssetRateRemoved"; + impl AssetRateRemoved { + const PALLET_NAME: &'static str = "AssetRate"; + const EVENT_NAME: &'static str = "AssetRateRemoved"; + } + impl ::subxt::events::DecodeAsEvent for AssetRateRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AssetRateUpdated { pub asset_kind: asset_rate_updated::AssetKind, pub old: asset_rate_updated::Old, @@ -26318,9 +26812,14 @@ pub mod api { pub type Old = runtime_types::sp_arithmetic::fixed_point::FixedU128; pub type New = runtime_types::sp_arithmetic::fixed_point::FixedU128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetRateUpdated { - const PALLET: &'static str = "AssetRate"; - const EVENT: &'static str = "AssetRateUpdated"; + impl AssetRateUpdated { + const PALLET_NAME: &'static str = "AssetRate"; + const EVENT_NAME: &'static str = "AssetRateUpdated"; + } + impl ::subxt::events::DecodeAsEvent for AssetRateUpdated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -26333,12 +26832,12 @@ pub mod api { #[doc = " E.g. `native_amount = asset_amount * ConversionRateToNative::::get(asset_kind)`"] pub fn conversion_rate_to_native( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (conversion_rate_to_native::Param0,), - conversion_rate_to_native::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (conversion_rate_to_native::input::Param0,), + conversion_rate_to_native::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "AssetRate", "ConversionRateToNative", [ @@ -26352,12 +26851,12 @@ pub mod api { pub mod conversion_rate_to_native { use super::root_mod; use super::runtime_types; - pub type Param0 = - runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_arithmetic::fixed_point::FixedU128; + pub type Param0 = + runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; } + pub type Output = runtime_types::sp_arithmetic::fixed_point::FixedU128; } } } @@ -26370,1091 +26869,1150 @@ pub mod api { pub type Call = runtime_types::pallet_bounties::pallet::Call; pub mod calls { use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose a new bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] - #[doc = "`DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,"] - #[doc = "or slashed when rejected."] - #[doc = ""] - #[doc = "- `curator`: The curator account whom will manage this bounty."] - #[doc = "- `fee`: The curator fee."] - #[doc = "- `value`: The total payment amount of this bounty, curator fee included."] - #[doc = "- `description`: The description of this bounty."] - pub struct ProposeBounty { - #[codec(compact)] - pub value: propose_bounty::Value, - pub description: propose_bounty::Description, - } - pub mod propose_bounty { - use super::runtime_types; - pub type Value = ::core::primitive::u128; - pub type Description = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ProposeBounty { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "propose_bounty"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] - #[doc = "and the original deposit will be returned."] - #[doc = ""] - #[doc = "May only be called from `T::SpendOrigin`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct ApproveBounty { - #[codec(compact)] - pub bounty_id: approve_bounty::BountyId, - } - pub mod approve_bounty { - use super::runtime_types; - pub type BountyId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApproveBounty { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "approve_bounty"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose a curator to a funded bounty."] - #[doc = ""] - #[doc = "May only be called from `T::SpendOrigin`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct ProposeCurator { - #[codec(compact)] - pub bounty_id: propose_curator::BountyId, - pub curator: propose_curator::Curator, - #[codec(compact)] - pub fee: propose_curator::Fee, - } - pub mod propose_curator { - use super::runtime_types; - pub type BountyId = ::core::primitive::u32; - pub type Curator = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Fee = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ProposeCurator { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "propose_curator"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Unassign curator from a bounty."] - #[doc = ""] - #[doc = "This function can only be called by the `RejectOrigin` a signed origin."] - #[doc = ""] - #[doc = "If this function is called by the `RejectOrigin`, we assume that the curator is"] - #[doc = "malicious or inactive. As a result, we will slash the curator when possible."] - #[doc = ""] - #[doc = "If the origin is the curator, we take this as a sign they are unable to do their job and"] - #[doc = "they willingly give up. We could slash them, but for now we allow them to recover their"] - #[doc = "deposit and exit without issue. (We may want to change this if it is abused.)"] - #[doc = ""] - #[doc = "Finally, the origin can be anyone if and only if the curator is \"inactive\". This allows"] - #[doc = "anyone in the community to call out that a curator is not doing their due diligence, and"] - #[doc = "we should pick a new curator. In this case the curator should also be slashed."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct UnassignCurator { - #[codec(compact)] - pub bounty_id: unassign_curator::BountyId, - } - pub mod unassign_curator { - use super::runtime_types; - pub type BountyId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnassignCurator { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "unassign_curator"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Accept the curator role for a bounty."] - #[doc = "A deposit will be reserved from curator and refund upon successful payout."] - #[doc = ""] - #[doc = "May only be called from the curator."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct AcceptCurator { - #[codec(compact)] - pub bounty_id: accept_curator::BountyId, - } - pub mod accept_curator { - use super::runtime_types; - pub type BountyId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AcceptCurator { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "accept_curator"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] - #[doc = "after a delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to award."] - #[doc = "- `beneficiary`: The beneficiary account whom will receive the payout."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct AwardBounty { - #[codec(compact)] - pub bounty_id: award_bounty::BountyId, - pub beneficiary: award_bounty::Beneficiary, - } - pub mod award_bounty { - use super::runtime_types; - pub type BountyId = ::core::primitive::u32; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AwardBounty { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "award_bounty"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Claim the payout from an awarded bounty after payout delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the beneficiary of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to claim."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct ClaimBounty { - #[codec(compact)] - pub bounty_id: claim_bounty::BountyId, - } - pub mod claim_bounty { - use super::runtime_types; - pub type BountyId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimBounty { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "claim_bounty"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] - #[doc = "the curator deposit will be unreserved if possible."] - #[doc = ""] - #[doc = "Only `T::RejectOrigin` is able to cancel a bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to cancel."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct CloseBounty { - #[codec(compact)] - pub bounty_id: close_bounty::BountyId, - } - pub mod close_bounty { - use super::runtime_types; - pub type BountyId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CloseBounty { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "close_bounty"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Extend the expiry time of an active bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to extend."] - #[doc = "- `remark`: additional information."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct ExtendBountyExpiry { - #[codec(compact)] - pub bounty_id: extend_bounty_expiry::BountyId, - pub remark: extend_bounty_expiry::Remark, - } - pub mod extend_bounty_expiry { - use super::runtime_types; - pub type BountyId = ::core::primitive::u32; - pub type Remark = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExtendBountyExpiry { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "extend_bounty_expiry"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Approve bountry and propose a curator simultaneously."] - #[doc = "This call is a shortcut to calling `approve_bounty` and `propose_curator` separately."] - #[doc = ""] - #[doc = "May only be called from `T::SpendOrigin`."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to approve."] - #[doc = "- `curator`: The curator account whom will manage this bounty."] - #[doc = "- `fee`: The curator fee."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct ApproveBountyWithCurator { - #[codec(compact)] - pub bounty_id: approve_bounty_with_curator::BountyId, - pub curator: approve_bounty_with_curator::Curator, - #[codec(compact)] - pub fee: approve_bounty_with_curator::Fee, - } - pub mod approve_bounty_with_curator { - use super::runtime_types; - pub type BountyId = ::core::primitive::u32; - pub type Curator = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Fee = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApproveBountyWithCurator { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "approve_bounty_with_curator"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Poke the deposit reserved for creating a bounty proposal."] - #[doc = ""] - #[doc = "This can be used by accounts to update their reserved amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `bounty_id`: The bounty id for which to adjust the deposit."] - #[doc = ""] - #[doc = "If the deposit is updated, the difference will be reserved/unreserved from the"] - #[doc = "proposer's account."] - #[doc = ""] - #[doc = "The transaction is made free if the deposit is updated and paid otherwise."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if the deposit is updated."] - pub struct PokeDeposit { - #[codec(compact)] - pub bounty_id: poke_deposit::BountyId, - } - pub mod poke_deposit { - use super::runtime_types; - pub type BountyId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { - const PALLET: &'static str = "Bounties"; - const CALL: &'static str = "poke_deposit"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Propose a new bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] - #[doc = "`DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,"] - #[doc = "or slashed when rejected."] - #[doc = ""] - #[doc = "- `curator`: The curator account whom will manage this bounty."] - #[doc = "- `fee`: The curator fee."] - #[doc = "- `value`: The total payment amount of this bounty, curator fee included."] - #[doc = "- `description`: The description of this bounty."] - pub fn propose_bounty( - &self, - value: types::propose_bounty::Value, - description: types::propose_bounty::Description, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "propose_bounty", - types::ProposeBounty { value, description }, - [ - 131u8, 169u8, 55u8, 102u8, 212u8, 139u8, 9u8, 65u8, 75u8, 112u8, 6u8, - 180u8, 92u8, 124u8, 43u8, 42u8, 38u8, 40u8, 226u8, 24u8, 28u8, 34u8, - 169u8, 220u8, 184u8, 206u8, 109u8, 227u8, 53u8, 228u8, 88u8, 25u8, - ], - ) - } - #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] - #[doc = "and the original deposit will be returned."] - #[doc = ""] - #[doc = "May only be called from `T::SpendOrigin`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn approve_bounty( - &self, - bounty_id: types::approve_bounty::BountyId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "approve_bounty", - types::ApproveBounty { bounty_id }, - [ - 85u8, 12u8, 177u8, 91u8, 183u8, 124u8, 175u8, 148u8, 188u8, 200u8, - 237u8, 144u8, 6u8, 67u8, 159u8, 48u8, 177u8, 222u8, 183u8, 137u8, - 173u8, 131u8, 128u8, 219u8, 255u8, 243u8, 80u8, 224u8, 126u8, 136u8, - 90u8, 47u8, - ], - ) - } - #[doc = "Propose a curator to a funded bounty."] - #[doc = ""] - #[doc = "May only be called from `T::SpendOrigin`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn propose_curator( - &self, - bounty_id: types::propose_curator::BountyId, - curator: types::propose_curator::Curator, - fee: types::propose_curator::Fee, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "propose_curator", - types::ProposeCurator { - bounty_id, - curator, - fee, - }, - [ - 238u8, 102u8, 86u8, 97u8, 169u8, 16u8, 133u8, 41u8, 24u8, 247u8, 149u8, - 200u8, 95u8, 213u8, 45u8, 62u8, 41u8, 247u8, 170u8, 62u8, 211u8, 194u8, - 5u8, 108u8, 129u8, 145u8, 108u8, 67u8, 84u8, 97u8, 237u8, 54u8, - ], - ) - } - #[doc = "Unassign curator from a bounty."] - #[doc = ""] - #[doc = "This function can only be called by the `RejectOrigin` a signed origin."] - #[doc = ""] - #[doc = "If this function is called by the `RejectOrigin`, we assume that the curator is"] - #[doc = "malicious or inactive. As a result, we will slash the curator when possible."] - #[doc = ""] - #[doc = "If the origin is the curator, we take this as a sign they are unable to do their job and"] - #[doc = "they willingly give up. We could slash them, but for now we allow them to recover their"] - #[doc = "deposit and exit without issue. (We may want to change this if it is abused.)"] - #[doc = ""] - #[doc = "Finally, the origin can be anyone if and only if the curator is \"inactive\". This allows"] - #[doc = "anyone in the community to call out that a curator is not doing their due diligence, and"] - #[doc = "we should pick a new curator. In this case the curator should also be slashed."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn unassign_curator( - &self, - bounty_id: types::unassign_curator::BountyId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "unassign_curator", - types::UnassignCurator { bounty_id }, - [ - 98u8, 94u8, 107u8, 111u8, 151u8, 182u8, 71u8, 239u8, 214u8, 88u8, - 108u8, 11u8, 51u8, 163u8, 102u8, 162u8, 245u8, 247u8, 244u8, 159u8, - 197u8, 23u8, 171u8, 6u8, 60u8, 146u8, 144u8, 101u8, 68u8, 133u8, 245u8, - 74u8, - ], - ) - } - #[doc = "Accept the curator role for a bounty."] - #[doc = "A deposit will be reserved from curator and refund upon successful payout."] - #[doc = ""] - #[doc = "May only be called from the curator."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn accept_curator( - &self, - bounty_id: types::accept_curator::BountyId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "accept_curator", - types::AcceptCurator { bounty_id }, - [ - 178u8, 142u8, 138u8, 15u8, 243u8, 10u8, 222u8, 169u8, 150u8, 200u8, - 85u8, 185u8, 39u8, 167u8, 134u8, 3u8, 186u8, 84u8, 43u8, 140u8, 11u8, - 70u8, 56u8, 197u8, 39u8, 84u8, 138u8, 139u8, 198u8, 104u8, 41u8, 238u8, - ], - ) - } - #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] - #[doc = "after a delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to award."] - #[doc = "- `beneficiary`: The beneficiary account whom will receive the payout."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn award_bounty( - &self, - bounty_id: types::award_bounty::BountyId, - beneficiary: types::award_bounty::Beneficiary, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "award_bounty", - types::AwardBounty { - bounty_id, - beneficiary, - }, - [ - 231u8, 248u8, 65u8, 2u8, 199u8, 19u8, 126u8, 23u8, 206u8, 206u8, 230u8, - 77u8, 53u8, 152u8, 230u8, 234u8, 211u8, 153u8, 82u8, 149u8, 93u8, 91u8, - 19u8, 72u8, 214u8, 92u8, 65u8, 207u8, 142u8, 168u8, 133u8, 87u8, - ], - ) - } - #[doc = "Claim the payout from an awarded bounty after payout delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the beneficiary of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to claim."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn claim_bounty( - &self, - bounty_id: types::claim_bounty::BountyId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "claim_bounty", - types::ClaimBounty { bounty_id }, - [ - 211u8, 143u8, 123u8, 205u8, 140u8, 43u8, 176u8, 103u8, 110u8, 125u8, - 158u8, 131u8, 103u8, 62u8, 69u8, 215u8, 220u8, 110u8, 11u8, 3u8, 30u8, - 193u8, 235u8, 177u8, 96u8, 241u8, 140u8, 53u8, 62u8, 133u8, 170u8, - 25u8, - ], - ) - } - #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] - #[doc = "the curator deposit will be unreserved if possible."] - #[doc = ""] - #[doc = "Only `T::RejectOrigin` is able to cancel a bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to cancel."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn close_bounty( - &self, - bounty_id: types::close_bounty::BountyId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "close_bounty", - types::CloseBounty { bounty_id }, - [ - 144u8, 234u8, 109u8, 39u8, 227u8, 231u8, 104u8, 48u8, 45u8, 196u8, - 217u8, 220u8, 241u8, 197u8, 157u8, 227u8, 154u8, 156u8, 181u8, 69u8, - 146u8, 77u8, 203u8, 167u8, 79u8, 102u8, 15u8, 253u8, 135u8, 53u8, 96u8, - 60u8, - ], - ) - } - #[doc = "Extend the expiry time of an active bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to extend."] - #[doc = "- `remark`: additional information."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn extend_bounty_expiry( - &self, - bounty_id: types::extend_bounty_expiry::BountyId, - remark: types::extend_bounty_expiry::Remark, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "extend_bounty_expiry", - types::ExtendBountyExpiry { bounty_id, remark }, - [ - 102u8, 118u8, 89u8, 189u8, 138u8, 157u8, 216u8, 10u8, 239u8, 3u8, - 200u8, 217u8, 219u8, 19u8, 195u8, 182u8, 105u8, 220u8, 11u8, 146u8, - 222u8, 79u8, 95u8, 136u8, 188u8, 230u8, 248u8, 119u8, 30u8, 6u8, 242u8, - 194u8, - ], - ) - } - #[doc = "Approve bountry and propose a curator simultaneously."] - #[doc = "This call is a shortcut to calling `approve_bounty` and `propose_curator` separately."] - #[doc = ""] - #[doc = "May only be called from `T::SpendOrigin`."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to approve."] - #[doc = "- `curator`: The curator account whom will manage this bounty."] - #[doc = "- `fee`: The curator fee."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn approve_bounty_with_curator( - &self, - bounty_id: types::approve_bounty_with_curator::BountyId, - curator: types::approve_bounty_with_curator::Curator, - fee: types::approve_bounty_with_curator::Fee, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ApproveBountyWithCurator, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "approve_bounty_with_curator", - types::ApproveBountyWithCurator { - bounty_id, - curator, - fee, - }, - [ - 179u8, 96u8, 44u8, 148u8, 94u8, 210u8, 45u8, 243u8, 157u8, 192u8, - 104u8, 213u8, 54u8, 81u8, 57u8, 172u8, 85u8, 128u8, 124u8, 66u8, 220u8, - 241u8, 156u8, 49u8, 134u8, 125u8, 32u8, 121u8, 12u8, 54u8, 129u8, - 155u8, - ], - ) - } - #[doc = "Poke the deposit reserved for creating a bounty proposal."] - #[doc = ""] - #[doc = "This can be used by accounts to update their reserved amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `bounty_id`: The bounty id for which to adjust the deposit."] - #[doc = ""] - #[doc = "If the deposit is updated, the difference will be reserved/unreserved from the"] - #[doc = "proposer's account."] - #[doc = ""] - #[doc = "The transaction is made free if the deposit is updated and paid otherwise."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if the deposit is updated."] - pub fn poke_deposit( - &self, - bounty_id: types::poke_deposit::BountyId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Bounties", - "poke_deposit", - types::PokeDeposit { bounty_id }, - [ - 45u8, 230u8, 25u8, 162u8, 115u8, 101u8, 83u8, 123u8, 247u8, 131u8, - 207u8, 156u8, 156u8, 190u8, 181u8, 219u8, 133u8, 238u8, 112u8, 238u8, - 120u8, 40u8, 106u8, 52u8, 205u8, 76u8, 5u8, 143u8, 175u8, 241u8, 34u8, - 85u8, - ], - ) - } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_bounties::pallet::Event; - pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "New bounty proposal."] - pub struct BountyProposed { - pub index: bounty_proposed::Index, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Propose a new bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] + #[doc = "`DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,"] + #[doc = "or slashed when rejected."] + #[doc = ""] + #[doc = "- `curator`: The curator account whom will manage this bounty."] + #[doc = "- `fee`: The curator fee."] + #[doc = "- `value`: The total payment amount of this bounty, curator fee included."] + #[doc = "- `description`: The description of this bounty."] + pub struct ProposeBounty { + #[codec(compact)] + pub value: propose_bounty::Value, + pub description: propose_bounty::Description, } - pub mod bounty_proposed { + pub mod propose_bounty { use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for BountyProposed { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyProposed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty proposal was rejected; funds were slashed."] - pub struct BountyRejected { - pub index: bounty_rejected::Index, - pub bond: bounty_rejected::Bond, + pub type Value = ::core::primitive::u128; + pub type Description = ::subxt::alloc::vec::Vec<::core::primitive::u8>; } - pub mod bounty_rejected { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Bond = ::core::primitive::u128; + impl ProposeBounty { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "propose_bounty"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BountyRejected { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyRejected"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for ProposeBounty { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty proposal is funded and became active."] - pub struct BountyBecameActive { - pub index: bounty_became_active::Index, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] + #[doc = "and the original deposit will be returned."] + #[doc = ""] + #[doc = "May only be called from `T::SpendOrigin`."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct ApproveBounty { + #[codec(compact)] + pub bounty_id: approve_bounty::BountyId, } - pub mod bounty_became_active { + pub mod approve_bounty { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type BountyId = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BountyBecameActive { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyBecameActive"; + impl ApproveBounty { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "approve_bounty"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ApproveBounty { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty is awarded to a beneficiary."] - pub struct BountyAwarded { - pub index: bounty_awarded::Index, - pub beneficiary: bounty_awarded::Beneficiary, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Propose a curator to a funded bounty."] + #[doc = ""] + #[doc = "May only be called from `T::SpendOrigin`."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct ProposeCurator { + #[codec(compact)] + pub bounty_id: propose_curator::BountyId, + pub curator: propose_curator::Curator, + #[codec(compact)] + pub fee: propose_curator::Fee, } - pub mod bounty_awarded { + pub mod propose_curator { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; + pub type BountyId = ::core::primitive::u32; + pub type Curator = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Fee = ::core::primitive::u128; + } + impl ProposeCurator { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "propose_curator"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BountyAwarded { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyAwarded"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for ProposeCurator { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty is claimed by beneficiary."] - pub struct BountyClaimed { - pub index: bounty_claimed::Index, - pub payout: bounty_claimed::Payout, - pub beneficiary: bounty_claimed::Beneficiary, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Unassign curator from a bounty."] + #[doc = ""] + #[doc = "This function can only be called by the `RejectOrigin` a signed origin."] + #[doc = ""] + #[doc = "If this function is called by the `RejectOrigin`, we assume that the curator is"] + #[doc = "malicious or inactive. As a result, we will slash the curator when possible."] + #[doc = ""] + #[doc = "If the origin is the curator, we take this as a sign they are unable to do their job and"] + #[doc = "they willingly give up. We could slash them, but for now we allow them to recover their"] + #[doc = "deposit and exit without issue. (We may want to change this if it is abused.)"] + #[doc = ""] + #[doc = "Finally, the origin can be anyone if and only if the curator is \"inactive\". This allows"] + #[doc = "anyone in the community to call out that a curator is not doing their due diligence, and"] + #[doc = "we should pick a new curator. In this case the curator should also be slashed."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct UnassignCurator { + #[codec(compact)] + pub bounty_id: unassign_curator::BountyId, } - pub mod bounty_claimed { + pub mod unassign_curator { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Payout = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; + pub type BountyId = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BountyClaimed { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyClaimed"; + impl UnassignCurator { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "unassign_curator"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for UnassignCurator { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty is cancelled."] - pub struct BountyCanceled { - pub index: bounty_canceled::Index, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Accept the curator role for a bounty."] + #[doc = "A deposit will be reserved from curator and refund upon successful payout."] + #[doc = ""] + #[doc = "May only be called from the curator."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct AcceptCurator { + #[codec(compact)] + pub bounty_id: accept_curator::BountyId, } - pub mod bounty_canceled { + pub mod accept_curator { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type BountyId = ::core::primitive::u32; + } + impl AcceptCurator { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "accept_curator"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BountyCanceled { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyCanceled"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for AcceptCurator { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty expiry is extended."] - pub struct BountyExtended { - pub index: bounty_extended::Index, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] + #[doc = "after a delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to award."] + #[doc = "- `beneficiary`: The beneficiary account whom will receive the payout."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct AwardBounty { + #[codec(compact)] + pub bounty_id: award_bounty::BountyId, + pub beneficiary: award_bounty::Beneficiary, } - pub mod bounty_extended { + pub mod award_bounty { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type BountyId = ::core::primitive::u32; + pub type Beneficiary = + ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl AwardBounty { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "award_bounty"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BountyExtended { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyExtended"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for AwardBounty { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty is approved."] - pub struct BountyApproved { - pub index: bounty_approved::Index, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Claim the payout from an awarded bounty after payout delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the beneficiary of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to claim."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct ClaimBounty { + #[codec(compact)] + pub bounty_id: claim_bounty::BountyId, } - pub mod bounty_approved { + pub mod claim_bounty { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type BountyId = ::core::primitive::u32; + } + impl ClaimBounty { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "claim_bounty"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BountyApproved { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyApproved"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for ClaimBounty { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty curator is proposed."] - pub struct CuratorProposed { - pub bounty_id: curator_proposed::BountyId, - pub curator: curator_proposed::Curator, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] + #[doc = "the curator deposit will be unreserved if possible."] + #[doc = ""] + #[doc = "Only `T::RejectOrigin` is able to cancel a bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to cancel."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct CloseBounty { + #[codec(compact)] + pub bounty_id: close_bounty::BountyId, } - pub mod curator_proposed { + pub mod close_bounty { use super::runtime_types; pub type BountyId = ::core::primitive::u32; - pub type Curator = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CuratorProposed { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "CuratorProposed"; + impl CloseBounty { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "close_bounty"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CloseBounty { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty curator is unassigned."] - pub struct CuratorUnassigned { - pub bounty_id: curator_unassigned::BountyId, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Extend the expiry time of an active bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to extend."] + #[doc = "- `remark`: additional information."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct ExtendBountyExpiry { + #[codec(compact)] + pub bounty_id: extend_bounty_expiry::BountyId, + pub remark: extend_bounty_expiry::Remark, } - pub mod curator_unassigned { + pub mod extend_bounty_expiry { use super::runtime_types; pub type BountyId = ::core::primitive::u32; + pub type Remark = ::subxt::alloc::vec::Vec<::core::primitive::u8>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CuratorUnassigned { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "CuratorUnassigned"; + impl ExtendBountyExpiry { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "extend_bounty_expiry"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ExtendBountyExpiry { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty curator is accepted."] - pub struct CuratorAccepted { - pub bounty_id: curator_accepted::BountyId, - pub curator: curator_accepted::Curator, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Approve bountry and propose a curator simultaneously."] + #[doc = "This call is a shortcut to calling `approve_bounty` and `propose_curator` separately."] + #[doc = ""] + #[doc = "May only be called from `T::SpendOrigin`."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to approve."] + #[doc = "- `curator`: The curator account whom will manage this bounty."] + #[doc = "- `fee`: The curator fee."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct ApproveBountyWithCurator { + #[codec(compact)] + pub bounty_id: approve_bounty_with_curator::BountyId, + pub curator: approve_bounty_with_curator::Curator, + #[codec(compact)] + pub fee: approve_bounty_with_curator::Fee, } - pub mod curator_accepted { + pub mod approve_bounty_with_curator { use super::runtime_types; pub type BountyId = ::core::primitive::u32; - pub type Curator = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Curator = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Fee = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CuratorAccepted { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "CuratorAccepted"; + impl ApproveBountyWithCurator { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "approve_bounty_with_curator"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ApproveBountyWithCurator { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A bounty deposit has been poked."] - pub struct DepositPoked { - pub bounty_id: deposit_poked::BountyId, - pub proposer: deposit_poked::Proposer, - pub old_deposit: deposit_poked::OldDeposit, - pub new_deposit: deposit_poked::NewDeposit, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Poke the deposit reserved for creating a bounty proposal."] + #[doc = ""] + #[doc = "This can be used by accounts to update their reserved amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `bounty_id`: The bounty id for which to adjust the deposit."] + #[doc = ""] + #[doc = "If the deposit is updated, the difference will be reserved/unreserved from the"] + #[doc = "proposer's account."] + #[doc = ""] + #[doc = "The transaction is made free if the deposit is updated and paid otherwise."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if the deposit is updated."] + pub struct PokeDeposit { + #[codec(compact)] + pub bounty_id: poke_deposit::BountyId, } - pub mod deposit_poked { + pub mod poke_deposit { use super::runtime_types; pub type BountyId = ::core::primitive::u32; - pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; - pub type OldDeposit = ::core::primitive::u128; - pub type NewDeposit = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "DepositPoked"; - } - } - pub mod storage { - use super::root_mod; - use super::runtime_types; - pub struct StorageApi; - impl StorageApi { - #[doc = " Number of bounty proposals that have been made."] - pub fn bounty_count( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - bounty_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Bounties", - "BountyCount", - [ - 180u8, 143u8, 192u8, 81u8, 137u8, 171u8, 129u8, 66u8, 33u8, 167u8, - 192u8, 58u8, 20u8, 51u8, 179u8, 108u8, 79u8, 170u8, 26u8, 192u8, 5u8, - 247u8, 22u8, 169u8, 71u8, 116u8, 127u8, 144u8, 208u8, 72u8, 10u8, 30u8, - ], - ) - } - #[doc = " Bounties that have been made."] - pub fn bounties( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (bounties::Param0,), - bounties::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Bounties", - "Bounties", - [ - 51u8, 6u8, 39u8, 186u8, 111u8, 207u8, 134u8, 132u8, 249u8, 212u8, - 200u8, 121u8, 90u8, 147u8, 86u8, 125u8, 17u8, 222u8, 213u8, 88u8, - 122u8, 5u8, 16u8, 207u8, 197u8, 190u8, 213u8, 73u8, 5u8, 180u8, 47u8, - 228u8, - ], - ) - } - #[doc = " The description of each bounty."] - pub fn bounty_descriptions( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (bounty_descriptions::Param0,), - bounty_descriptions::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Bounties", - "BountyDescriptions", - [ - 1u8, 183u8, 235u8, 160u8, 235u8, 209u8, 158u8, 179u8, 220u8, 217u8, - 158u8, 104u8, 49u8, 27u8, 147u8, 126u8, 171u8, 45u8, 160u8, 117u8, - 57u8, 183u8, 79u8, 109u8, 11u8, 74u8, 80u8, 123u8, 12u8, 109u8, 6u8, - 109u8, - ], - ) - } - #[doc = " Bounty indices that have been approved but not yet funded."] - pub fn bounty_approvals( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - bounty_approvals::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Bounties", - "BountyApprovals", - [ - 139u8, 89u8, 73u8, 125u8, 174u8, 134u8, 137u8, 151u8, 31u8, 79u8, - 134u8, 203u8, 58u8, 168u8, 233u8, 45u8, 6u8, 222u8, 53u8, 230u8, 215u8, - 234u8, 116u8, 44u8, 195u8, 23u8, 253u8, 253u8, 67u8, 18u8, 184u8, 68u8, - ], - ) - } - } - pub mod bounty_count { - use super::root_mod; - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u32; - } } - pub mod bounties { - use super::root_mod; - use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::pallet_bounties::Bounty< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; - } + impl PokeDeposit { + const PALLET_NAME: &'static str = "Bounties"; + const CALL_NAME: &'static str = "poke_deposit"; } - pub mod bounty_descriptions { - use super::root_mod; - use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + impl ::subxt::extrinsics::DecodeAsExtrinsic for PokeDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub mod bounty_approvals { - use super::root_mod; - use super::runtime_types; - pub mod output { + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Propose a new bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] + #[doc = "`DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,"] + #[doc = "or slashed when rejected."] + #[doc = ""] + #[doc = "- `curator`: The curator account whom will manage this bounty."] + #[doc = "- `fee`: The curator fee."] + #[doc = "- `value`: The total payment amount of this bounty, curator fee included."] + #[doc = "- `description`: The description of this bounty."] + pub fn propose_bounty( + &self, + value: super::propose_bounty::Value, + description: super::propose_bounty::Description, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "propose_bounty", + super::ProposeBounty { value, description }, + [ + 131u8, 169u8, 55u8, 102u8, 212u8, 139u8, 9u8, 65u8, 75u8, 112u8, + 6u8, 180u8, 92u8, 124u8, 43u8, 42u8, 38u8, 40u8, 226u8, 24u8, 28u8, + 34u8, 169u8, 220u8, 184u8, 206u8, 109u8, 227u8, 53u8, 228u8, 88u8, + 25u8, + ], + ) + } + #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] + #[doc = "and the original deposit will be returned."] + #[doc = ""] + #[doc = "May only be called from `T::SpendOrigin`."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn approve_bounty( + &self, + bounty_id: super::approve_bounty::BountyId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "approve_bounty", + super::ApproveBounty { bounty_id }, + [ + 85u8, 12u8, 177u8, 91u8, 183u8, 124u8, 175u8, 148u8, 188u8, 200u8, + 237u8, 144u8, 6u8, 67u8, 159u8, 48u8, 177u8, 222u8, 183u8, 137u8, + 173u8, 131u8, 128u8, 219u8, 255u8, 243u8, 80u8, 224u8, 126u8, + 136u8, 90u8, 47u8, + ], + ) + } + #[doc = "Propose a curator to a funded bounty."] + #[doc = ""] + #[doc = "May only be called from `T::SpendOrigin`."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn propose_curator( + &self, + bounty_id: super::propose_curator::BountyId, + curator: super::propose_curator::Curator, + fee: super::propose_curator::Fee, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "propose_curator", + super::ProposeCurator { + bounty_id, + curator, + fee, + }, + [ + 238u8, 102u8, 86u8, 97u8, 169u8, 16u8, 133u8, 41u8, 24u8, 247u8, + 149u8, 200u8, 95u8, 213u8, 45u8, 62u8, 41u8, 247u8, 170u8, 62u8, + 211u8, 194u8, 5u8, 108u8, 129u8, 145u8, 108u8, 67u8, 84u8, 97u8, + 237u8, 54u8, + ], + ) + } + #[doc = "Unassign curator from a bounty."] + #[doc = ""] + #[doc = "This function can only be called by the `RejectOrigin` a signed origin."] + #[doc = ""] + #[doc = "If this function is called by the `RejectOrigin`, we assume that the curator is"] + #[doc = "malicious or inactive. As a result, we will slash the curator when possible."] + #[doc = ""] + #[doc = "If the origin is the curator, we take this as a sign they are unable to do their job and"] + #[doc = "they willingly give up. We could slash them, but for now we allow them to recover their"] + #[doc = "deposit and exit without issue. (We may want to change this if it is abused.)"] + #[doc = ""] + #[doc = "Finally, the origin can be anyone if and only if the curator is \"inactive\". This allows"] + #[doc = "anyone in the community to call out that a curator is not doing their due diligence, and"] + #[doc = "we should pick a new curator. In this case the curator should also be slashed."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn unassign_curator( + &self, + bounty_id: super::unassign_curator::BountyId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "unassign_curator", + super::UnassignCurator { bounty_id }, + [ + 98u8, 94u8, 107u8, 111u8, 151u8, 182u8, 71u8, 239u8, 214u8, 88u8, + 108u8, 11u8, 51u8, 163u8, 102u8, 162u8, 245u8, 247u8, 244u8, 159u8, + 197u8, 23u8, 171u8, 6u8, 60u8, 146u8, 144u8, 101u8, 68u8, 133u8, + 245u8, 74u8, + ], + ) + } + #[doc = "Accept the curator role for a bounty."] + #[doc = "A deposit will be reserved from curator and refund upon successful payout."] + #[doc = ""] + #[doc = "May only be called from the curator."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn accept_curator( + &self, + bounty_id: super::accept_curator::BountyId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "accept_curator", + super::AcceptCurator { bounty_id }, + [ + 178u8, 142u8, 138u8, 15u8, 243u8, 10u8, 222u8, 169u8, 150u8, 200u8, + 85u8, 185u8, 39u8, 167u8, 134u8, 3u8, 186u8, 84u8, 43u8, 140u8, + 11u8, 70u8, 56u8, 197u8, 39u8, 84u8, 138u8, 139u8, 198u8, 104u8, + 41u8, 238u8, + ], + ) + } + #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] + #[doc = "after a delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to award."] + #[doc = "- `beneficiary`: The beneficiary account whom will receive the payout."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn award_bounty( + &self, + bounty_id: super::award_bounty::BountyId, + beneficiary: super::award_bounty::Beneficiary, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "award_bounty", + super::AwardBounty { + bounty_id, + beneficiary, + }, + [ + 231u8, 248u8, 65u8, 2u8, 199u8, 19u8, 126u8, 23u8, 206u8, 206u8, + 230u8, 77u8, 53u8, 152u8, 230u8, 234u8, 211u8, 153u8, 82u8, 149u8, + 93u8, 91u8, 19u8, 72u8, 214u8, 92u8, 65u8, 207u8, 142u8, 168u8, + 133u8, 87u8, + ], + ) + } + #[doc = "Claim the payout from an awarded bounty after payout delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the beneficiary of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to claim."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn claim_bounty( + &self, + bounty_id: super::claim_bounty::BountyId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "claim_bounty", + super::ClaimBounty { bounty_id }, + [ + 211u8, 143u8, 123u8, 205u8, 140u8, 43u8, 176u8, 103u8, 110u8, + 125u8, 158u8, 131u8, 103u8, 62u8, 69u8, 215u8, 220u8, 110u8, 11u8, + 3u8, 30u8, 193u8, 235u8, 177u8, 96u8, 241u8, 140u8, 53u8, 62u8, + 133u8, 170u8, 25u8, + ], + ) + } + #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] + #[doc = "the curator deposit will be unreserved if possible."] + #[doc = ""] + #[doc = "Only `T::RejectOrigin` is able to cancel a bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to cancel."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn close_bounty( + &self, + bounty_id: super::close_bounty::BountyId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "close_bounty", + super::CloseBounty { bounty_id }, + [ + 144u8, 234u8, 109u8, 39u8, 227u8, 231u8, 104u8, 48u8, 45u8, 196u8, + 217u8, 220u8, 241u8, 197u8, 157u8, 227u8, 154u8, 156u8, 181u8, + 69u8, 146u8, 77u8, 203u8, 167u8, 79u8, 102u8, 15u8, 253u8, 135u8, + 53u8, 96u8, 60u8, + ], + ) + } + #[doc = "Extend the expiry time of an active bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to extend."] + #[doc = "- `remark`: additional information."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn extend_bounty_expiry( + &self, + bounty_id: super::extend_bounty_expiry::BountyId, + remark: super::extend_bounty_expiry::Remark, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "extend_bounty_expiry", + super::ExtendBountyExpiry { bounty_id, remark }, + [ + 102u8, 118u8, 89u8, 189u8, 138u8, 157u8, 216u8, 10u8, 239u8, 3u8, + 200u8, 217u8, 219u8, 19u8, 195u8, 182u8, 105u8, 220u8, 11u8, 146u8, + 222u8, 79u8, 95u8, 136u8, 188u8, 230u8, 248u8, 119u8, 30u8, 6u8, + 242u8, 194u8, + ], + ) + } + #[doc = "Approve bountry and propose a curator simultaneously."] + #[doc = "This call is a shortcut to calling `approve_bounty` and `propose_curator` separately."] + #[doc = ""] + #[doc = "May only be called from `T::SpendOrigin`."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to approve."] + #[doc = "- `curator`: The curator account whom will manage this bounty."] + #[doc = "- `fee`: The curator fee."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn approve_bounty_with_curator( + &self, + bounty_id: super::approve_bounty_with_curator::BountyId, + curator: super::approve_bounty_with_curator::Curator, + fee: super::approve_bounty_with_curator::Fee, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "approve_bounty_with_curator", + super::ApproveBountyWithCurator { + bounty_id, + curator, + fee, + }, + [ + 179u8, 96u8, 44u8, 148u8, 94u8, 210u8, 45u8, 243u8, 157u8, 192u8, + 104u8, 213u8, 54u8, 81u8, 57u8, 172u8, 85u8, 128u8, 124u8, 66u8, + 220u8, 241u8, 156u8, 49u8, 134u8, 125u8, 32u8, 121u8, 12u8, 54u8, + 129u8, 155u8, + ], + ) + } + #[doc = "Poke the deposit reserved for creating a bounty proposal."] + #[doc = ""] + #[doc = "This can be used by accounts to update their reserved amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `bounty_id`: The bounty id for which to adjust the deposit."] + #[doc = ""] + #[doc = "If the deposit is updated, the difference will be reserved/unreserved from the"] + #[doc = "proposer's account."] + #[doc = ""] + #[doc = "The transaction is made free if the deposit is updated and paid otherwise."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if the deposit is updated."] + pub fn poke_deposit( + &self, + bounty_id: super::poke_deposit::BountyId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Bounties", + "poke_deposit", + super::PokeDeposit { bounty_id }, + [ + 45u8, 230u8, 25u8, 162u8, 115u8, 101u8, 83u8, 123u8, 247u8, 131u8, + 207u8, 156u8, 156u8, 190u8, 181u8, 219u8, 133u8, 238u8, 112u8, + 238u8, 120u8, 40u8, 106u8, 52u8, 205u8, 76u8, 5u8, 143u8, 175u8, + 241u8, 34u8, 85u8, + ], + ) + } + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_bounties::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "New bounty proposal."] + pub struct BountyProposed { + pub index: bounty_proposed::Index, + } + pub mod bounty_proposed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl BountyProposed { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "BountyProposed"; + } + impl ::subxt::events::DecodeAsEvent for BountyProposed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty proposal was rejected; funds were slashed."] + pub struct BountyRejected { + pub index: bounty_rejected::Index, + pub bond: bounty_rejected::Bond, + } + pub mod bounty_rejected { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Bond = ::core::primitive::u128; + } + impl BountyRejected { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "BountyRejected"; + } + impl ::subxt::events::DecodeAsEvent for BountyRejected { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty proposal is funded and became active."] + pub struct BountyBecameActive { + pub index: bounty_became_active::Index, + } + pub mod bounty_became_active { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl BountyBecameActive { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "BountyBecameActive"; + } + impl ::subxt::events::DecodeAsEvent for BountyBecameActive { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty is awarded to a beneficiary."] + pub struct BountyAwarded { + pub index: bounty_awarded::Index, + pub beneficiary: bounty_awarded::Beneficiary, + } + pub mod bounty_awarded { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Beneficiary = ::subxt::utils::AccountId32; + } + impl BountyAwarded { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "BountyAwarded"; + } + impl ::subxt::events::DecodeAsEvent for BountyAwarded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty is claimed by beneficiary."] + pub struct BountyClaimed { + pub index: bounty_claimed::Index, + pub payout: bounty_claimed::Payout, + pub beneficiary: bounty_claimed::Beneficiary, + } + pub mod bounty_claimed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Payout = ::core::primitive::u128; + pub type Beneficiary = ::subxt::utils::AccountId32; + } + impl BountyClaimed { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "BountyClaimed"; + } + impl ::subxt::events::DecodeAsEvent for BountyClaimed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty is cancelled."] + pub struct BountyCanceled { + pub index: bounty_canceled::Index, + } + pub mod bounty_canceled { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl BountyCanceled { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "BountyCanceled"; + } + impl ::subxt::events::DecodeAsEvent for BountyCanceled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty expiry is extended."] + pub struct BountyExtended { + pub index: bounty_extended::Index, + } + pub mod bounty_extended { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl BountyExtended { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "BountyExtended"; + } + impl ::subxt::events::DecodeAsEvent for BountyExtended { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty is approved."] + pub struct BountyApproved { + pub index: bounty_approved::Index, + } + pub mod bounty_approved { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl BountyApproved { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "BountyApproved"; + } + impl ::subxt::events::DecodeAsEvent for BountyApproved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty curator is proposed."] + pub struct CuratorProposed { + pub bounty_id: curator_proposed::BountyId, + pub curator: curator_proposed::Curator, + } + pub mod curator_proposed { + use super::runtime_types; + pub type BountyId = ::core::primitive::u32; + pub type Curator = ::subxt::utils::AccountId32; + } + impl CuratorProposed { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "CuratorProposed"; + } + impl ::subxt::events::DecodeAsEvent for CuratorProposed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty curator is unassigned."] + pub struct CuratorUnassigned { + pub bounty_id: curator_unassigned::BountyId, + } + pub mod curator_unassigned { + use super::runtime_types; + pub type BountyId = ::core::primitive::u32; + } + impl CuratorUnassigned { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "CuratorUnassigned"; + } + impl ::subxt::events::DecodeAsEvent for CuratorUnassigned { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty curator is accepted."] + pub struct CuratorAccepted { + pub bounty_id: curator_accepted::BountyId, + pub curator: curator_accepted::Curator, + } + pub mod curator_accepted { + use super::runtime_types; + pub type BountyId = ::core::primitive::u32; + pub type Curator = ::subxt::utils::AccountId32; + } + impl CuratorAccepted { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "CuratorAccepted"; + } + impl ::subxt::events::DecodeAsEvent for CuratorAccepted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A bounty deposit has been poked."] + pub struct DepositPoked { + pub bounty_id: deposit_poked::BountyId, + pub proposer: deposit_poked::Proposer, + pub old_deposit: deposit_poked::OldDeposit, + pub new_deposit: deposit_poked::NewDeposit, + } + pub mod deposit_poked { + use super::runtime_types; + pub type BountyId = ::core::primitive::u32; + pub type Proposer = ::subxt::utils::AccountId32; + pub type OldDeposit = ::core::primitive::u128; + pub type NewDeposit = ::core::primitive::u128; + } + impl DepositPoked { + const PALLET_NAME: &'static str = "Bounties"; + const EVENT_NAME: &'static str = "DepositPoked"; + } + impl ::subxt::events::DecodeAsEvent for DepositPoked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + } + pub mod storage { + use super::root_mod; + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Number of bounty proposals that have been made."] + pub fn bounty_count( + &self, + ) -> ::subxt::storage::StaticAddress<(), bounty_count::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( + "Bounties", + "BountyCount", + [ + 180u8, 143u8, 192u8, 81u8, 137u8, 171u8, 129u8, 66u8, 33u8, 167u8, + 192u8, 58u8, 20u8, 51u8, 179u8, 108u8, 79u8, 170u8, 26u8, 192u8, 5u8, + 247u8, 22u8, 169u8, 71u8, 116u8, 127u8, 144u8, 208u8, 72u8, 10u8, 30u8, + ], + ) + } + #[doc = " Bounties that have been made."] + pub fn bounties( + &self, + ) -> ::subxt::storage::StaticAddress< + (bounties::input::Param0,), + bounties::Output, + ::subxt::utils::Maybe, + > { + ::subxt::storage::StaticAddress::new_static( + "Bounties", + "Bounties", + [ + 51u8, 6u8, 39u8, 186u8, 111u8, 207u8, 134u8, 132u8, 249u8, 212u8, + 200u8, 121u8, 90u8, 147u8, 86u8, 125u8, 17u8, 222u8, 213u8, 88u8, + 122u8, 5u8, 16u8, 207u8, 197u8, 190u8, 213u8, 73u8, 5u8, 180u8, 47u8, + 228u8, + ], + ) + } + #[doc = " The description of each bounty."] + pub fn bounty_descriptions( + &self, + ) -> ::subxt::storage::StaticAddress< + (bounty_descriptions::input::Param0,), + bounty_descriptions::Output, + ::subxt::utils::Maybe, + > { + ::subxt::storage::StaticAddress::new_static( + "Bounties", + "BountyDescriptions", + [ + 1u8, 183u8, 235u8, 160u8, 235u8, 209u8, 158u8, 179u8, 220u8, 217u8, + 158u8, 104u8, 49u8, 27u8, 147u8, 126u8, 171u8, 45u8, 160u8, 117u8, + 57u8, 183u8, 79u8, 109u8, 11u8, 74u8, 80u8, 123u8, 12u8, 109u8, 6u8, + 109u8, + ], + ) + } + #[doc = " Bounty indices that have been approved but not yet funded."] + pub fn bounty_approvals( + &self, + ) -> ::subxt::storage::StaticAddress< + (), + bounty_approvals::Output, + ::subxt::utils::Yes, + > { + ::subxt::storage::StaticAddress::new_static( + "Bounties", + "BountyApprovals", + [ + 139u8, 89u8, 73u8, 125u8, 174u8, 134u8, 137u8, 151u8, 31u8, 79u8, + 134u8, 203u8, 58u8, 168u8, 233u8, 45u8, 6u8, 222u8, 53u8, 230u8, 215u8, + 234u8, 116u8, 44u8, 195u8, 23u8, 253u8, 253u8, 67u8, 18u8, 184u8, 68u8, + ], + ) + } + } + pub mod bounty_count { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; + } + pub type Output = ::core::primitive::u32; + } + pub mod bounties { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + } + pub type Output = runtime_types::pallet_bounties::Bounty< + ::subxt::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + } + pub mod bounty_descriptions { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + pub mod bounty_approvals { + use super::root_mod; + use super::runtime_types; + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; } } pub mod constants { @@ -27464,10 +28022,8 @@ pub mod api { #[doc = " The amount held on deposit for placing a bounty proposal."] pub fn bounty_deposit_base( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Bounties", "BountyDepositBase", [ @@ -27480,10 +28036,8 @@ pub mod api { #[doc = " The delay period for which a bounty beneficiary need to wait before claim the payout."] pub fn bounty_deposit_payout_delay( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Bounties", "BountyDepositPayoutDelay", [ @@ -27502,10 +28056,8 @@ pub mod api { #[doc = " removing the need for `extend_bounty_expiry`."] pub fn bounty_update_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Bounties", "BountyUpdatePeriod", [ @@ -27522,10 +28074,10 @@ pub mod api { #[doc = " `CuratorDepositMin`."] pub fn curator_deposit_multiplier( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< runtime_types::sp_arithmetic::per_things::Permill, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "Bounties", "CuratorDepositMultiplier", [ @@ -27538,10 +28090,10 @@ pub mod api { #[doc = " Maximum amount of funds that should be placed in a deposit for making a proposal."] pub fn curator_deposit_max( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< ::core::option::Option<::core::primitive::u128>, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "Bounties", "CuratorDepositMax", [ @@ -27555,10 +28107,10 @@ pub mod api { #[doc = " Minimum amount of funds that should be placed in a deposit for making a proposal."] pub fn curator_deposit_min( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< ::core::option::Option<::core::primitive::u128>, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "Bounties", "CuratorDepositMin", [ @@ -27572,10 +28124,8 @@ pub mod api { #[doc = " Minimum value for a bounty."] pub fn bounty_value_minimum( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Bounties", "BountyValueMinimum", [ @@ -27588,10 +28138,8 @@ pub mod api { #[doc = " The amount held on deposit per byte within the tip report reason or bounty description."] pub fn data_deposit_per_byte( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Bounties", "DataDepositPerByte", [ @@ -27606,10 +28154,8 @@ pub mod api { #[doc = " Benchmarks depend on this value, be sure to update weights file when changing this value"] pub fn maximum_reason_length( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Bounties", "MaximumReasonLength", [ @@ -27633,644 +28179,647 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Add a new child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of parent"] + #[doc = "bounty and the parent bounty must be in \"active\" state."] + #[doc = ""] + #[doc = "Child-bounty gets added successfully & fund gets transferred from"] + #[doc = "parent bounty to child-bounty account, if parent bounty has enough"] + #[doc = "funds, else the call fails."] + #[doc = ""] + #[doc = "Upper bound to maximum number of active child bounties that can be"] + #[doc = "added are managed via runtime trait config"] + #[doc = "[`Config::MaxActiveChildBountyCount`]."] + #[doc = ""] + #[doc = "If the call is success, the status of child-bounty is updated to"] + #[doc = "\"Added\"."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty for which child-bounty is being added."] + #[doc = "- `value`: Value for executing the proposal."] + #[doc = "- `description`: Text description for the child-bounty."] + pub struct AddChildBounty { + #[codec(compact)] + pub parent_bounty_id: add_child_bounty::ParentBountyId, + #[codec(compact)] + pub value: add_child_bounty::Value, + pub description: add_child_bounty::Description, + } + pub mod add_child_bounty { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Add a new child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of parent"] - #[doc = "bounty and the parent bounty must be in \"active\" state."] - #[doc = ""] - #[doc = "Child-bounty gets added successfully & fund gets transferred from"] - #[doc = "parent bounty to child-bounty account, if parent bounty has enough"] - #[doc = "funds, else the call fails."] - #[doc = ""] - #[doc = "Upper bound to maximum number of active child bounties that can be"] - #[doc = "added are managed via runtime trait config"] - #[doc = "[`Config::MaxActiveChildBountyCount`]."] - #[doc = ""] - #[doc = "If the call is success, the status of child-bounty is updated to"] - #[doc = "\"Added\"."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty for which child-bounty is being added."] - #[doc = "- `value`: Value for executing the proposal."] - #[doc = "- `description`: Text description for the child-bounty."] - pub struct AddChildBounty { - #[codec(compact)] - pub parent_bounty_id: add_child_bounty::ParentBountyId, - #[codec(compact)] - pub value: add_child_bounty::Value, - pub description: add_child_bounty::Description, - } - pub mod add_child_bounty { - use super::runtime_types; - pub type ParentBountyId = ::core::primitive::u32; - pub type Value = ::core::primitive::u128; - pub type Description = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddChildBounty { - const PALLET: &'static str = "ChildBounties"; - const CALL: &'static str = "add_child_bounty"; + pub type ParentBountyId = ::core::primitive::u32; + pub type Value = ::core::primitive::u128; + pub type Description = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl AddChildBounty { + const PALLET_NAME: &'static str = "ChildBounties"; + const CALL_NAME: &'static str = "add_child_bounty"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AddChildBounty { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose curator for funded child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be curator of parent bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in \"Added\" state, for processing the call. And"] - #[doc = "state of child-bounty is moved to \"CuratorProposed\" on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - #[doc = "- `curator`: Address of child-bounty curator."] - #[doc = "- `fee`: payment fee to child-bounty curator for execution."] - pub struct ProposeCurator { - #[codec(compact)] - pub parent_bounty_id: propose_curator::ParentBountyId, - #[codec(compact)] - pub child_bounty_id: propose_curator::ChildBountyId, - pub curator: propose_curator::Curator, - #[codec(compact)] - pub fee: propose_curator::Fee, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Propose curator for funded child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be curator of parent bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in \"Added\" state, for processing the call. And"] + #[doc = "state of child-bounty is moved to \"CuratorProposed\" on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + #[doc = "- `curator`: Address of child-bounty curator."] + #[doc = "- `fee`: payment fee to child-bounty curator for execution."] + pub struct ProposeCurator { + #[codec(compact)] + pub parent_bounty_id: propose_curator::ParentBountyId, + #[codec(compact)] + pub child_bounty_id: propose_curator::ChildBountyId, + pub curator: propose_curator::Curator, + #[codec(compact)] + pub fee: propose_curator::Fee, + } + pub mod propose_curator { + use super::runtime_types; + pub type ParentBountyId = ::core::primitive::u32; + pub type ChildBountyId = ::core::primitive::u32; + pub type Curator = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Fee = ::core::primitive::u128; + } + impl ProposeCurator { + const PALLET_NAME: &'static str = "ChildBounties"; + const CALL_NAME: &'static str = "propose_curator"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ProposeCurator { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod propose_curator { - use super::runtime_types; - pub type ParentBountyId = ::core::primitive::u32; - pub type ChildBountyId = ::core::primitive::u32; - pub type Curator = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Fee = ::core::primitive::u128; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Accept the curator role for the child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this"] + #[doc = "child-bounty."] + #[doc = ""] + #[doc = "A deposit will be reserved from the curator and refund upon"] + #[doc = "successful payout or cancellation."] + #[doc = ""] + #[doc = "Fee for curator is deducted from curator fee of parent bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in \"CuratorProposed\" state, for processing the"] + #[doc = "call. And state of child-bounty is moved to \"Active\" on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub struct AcceptCurator { + #[codec(compact)] + pub parent_bounty_id: accept_curator::ParentBountyId, + #[codec(compact)] + pub child_bounty_id: accept_curator::ChildBountyId, + } + pub mod accept_curator { + use super::runtime_types; + pub type ParentBountyId = ::core::primitive::u32; + pub type ChildBountyId = ::core::primitive::u32; + } + impl AcceptCurator { + const PALLET_NAME: &'static str = "ChildBounties"; + const CALL_NAME: &'static str = "accept_curator"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AcceptCurator { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ProposeCurator { - const PALLET: &'static str = "ChildBounties"; - const CALL: &'static str = "propose_curator"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Accept the curator role for the child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this"] - #[doc = "child-bounty."] - #[doc = ""] - #[doc = "A deposit will be reserved from the curator and refund upon"] - #[doc = "successful payout or cancellation."] - #[doc = ""] - #[doc = "Fee for curator is deducted from curator fee of parent bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in \"CuratorProposed\" state, for processing the"] - #[doc = "call. And state of child-bounty is moved to \"Active\" on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub struct AcceptCurator { - #[codec(compact)] - pub parent_bounty_id: accept_curator::ParentBountyId, - #[codec(compact)] - pub child_bounty_id: accept_curator::ChildBountyId, - } - pub mod accept_curator { - use super::runtime_types; - pub type ParentBountyId = ::core::primitive::u32; - pub type ChildBountyId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AcceptCurator { - const PALLET: &'static str = "ChildBounties"; - const CALL: &'static str = "accept_curator"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Unassign curator from a child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call can be either `RejectOrigin`, or"] - #[doc = "the curator of the parent bounty, or any signed origin."] - #[doc = ""] - #[doc = "For the origin other than T::RejectOrigin and the child-bounty"] - #[doc = "curator, parent bounty must be in active state, for this call to"] - #[doc = "work. We allow child-bounty curator and T::RejectOrigin to execute"] - #[doc = "this call irrespective of the parent bounty state."] - #[doc = ""] - #[doc = "If this function is called by the `RejectOrigin` or the"] - #[doc = "parent bounty curator, we assume that the child-bounty curator is"] - #[doc = "malicious or inactive. As a result, child-bounty curator deposit is"] - #[doc = "slashed."] - #[doc = ""] - #[doc = "If the origin is the child-bounty curator, we take this as a sign"] - #[doc = "that they are unable to do their job, and are willingly giving up."] - #[doc = "We could slash the deposit, but for now we allow them to unreserve"] - #[doc = "their deposit and exit without issue. (We may want to change this if"] - #[doc = "it is abused.)"] - #[doc = ""] - #[doc = "Finally, the origin can be anyone iff the child-bounty curator is"] - #[doc = "\"inactive\". Expiry update due of parent bounty is used to estimate"] - #[doc = "inactive state of child-bounty curator."] - #[doc = ""] - #[doc = "This allows anyone in the community to call out that a child-bounty"] - #[doc = "curator is not doing their due diligence, and we should pick a new"] - #[doc = "one. In this case the child-bounty curator deposit is slashed."] - #[doc = ""] - #[doc = "State of child-bounty is moved to Added state on successful call"] - #[doc = "completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub struct UnassignCurator { - #[codec(compact)] - pub parent_bounty_id: unassign_curator::ParentBountyId, - #[codec(compact)] - pub child_bounty_id: unassign_curator::ChildBountyId, - } - pub mod unassign_curator { - use super::runtime_types; - pub type ParentBountyId = ::core::primitive::u32; - pub type ChildBountyId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnassignCurator { - const PALLET: &'static str = "ChildBounties"; - const CALL: &'static str = "unassign_curator"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Award child-bounty to a beneficiary."] - #[doc = ""] - #[doc = "The beneficiary will be able to claim the funds after a delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the parent curator or"] - #[doc = "curator of this child-bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in active state, for processing the call. And"] - #[doc = "state of child-bounty is moved to \"PendingPayout\" on successful call"] - #[doc = "completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - #[doc = "- `beneficiary`: Beneficiary account."] - pub struct AwardChildBounty { - #[codec(compact)] - pub parent_bounty_id: award_child_bounty::ParentBountyId, - #[codec(compact)] - pub child_bounty_id: award_child_bounty::ChildBountyId, - pub beneficiary: award_child_bounty::Beneficiary, - } - pub mod award_child_bounty { - use super::runtime_types; - pub type ParentBountyId = ::core::primitive::u32; - pub type ChildBountyId = ::core::primitive::u32; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AwardChildBounty { - const PALLET: &'static str = "ChildBounties"; - const CALL: &'static str = "award_child_bounty"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Claim the payout from an awarded child-bounty after payout delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call may be any signed origin."] - #[doc = ""] - #[doc = "Call works independent of parent bounty state, No need for parent"] - #[doc = "bounty to be in active state."] - #[doc = ""] - #[doc = "The Beneficiary is paid out with agreed bounty value. Curator fee is"] - #[doc = "paid & curator deposit is unreserved."] - #[doc = ""] - #[doc = "Child-bounty must be in \"PendingPayout\" state, for processing the"] - #[doc = "call. And instance of child-bounty is removed from the state on"] - #[doc = "successful call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub struct ClaimChildBounty { - #[codec(compact)] - pub parent_bounty_id: claim_child_bounty::ParentBountyId, - #[codec(compact)] - pub child_bounty_id: claim_child_bounty::ChildBountyId, - } - pub mod claim_child_bounty { - use super::runtime_types; - pub type ParentBountyId = ::core::primitive::u32; - pub type ChildBountyId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimChildBounty { - const PALLET: &'static str = "ChildBounties"; - const CALL: &'static str = "claim_child_bounty"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel a proposed or active child-bounty. Child-bounty account funds"] - #[doc = "are transferred to parent bounty account. The child-bounty curator"] - #[doc = "deposit may be unreserved if possible."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be either parent curator or"] - #[doc = "`T::RejectOrigin`."] - #[doc = ""] - #[doc = "If the state of child-bounty is `Active`, curator deposit is"] - #[doc = "unreserved."] - #[doc = ""] - #[doc = "If the state of child-bounty is `PendingPayout`, call fails &"] - #[doc = "returns `PendingPayout` error."] - #[doc = ""] - #[doc = "For the origin other than T::RejectOrigin, parent bounty must be in"] - #[doc = "active state, for this child-bounty call to work. For origin"] - #[doc = "T::RejectOrigin execution is forced."] - #[doc = ""] - #[doc = "Instance of child-bounty is removed from the state on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub struct CloseChildBounty { - #[codec(compact)] - pub parent_bounty_id: close_child_bounty::ParentBountyId, - #[codec(compact)] - pub child_bounty_id: close_child_bounty::ChildBountyId, - } - pub mod close_child_bounty { - use super::runtime_types; - pub type ParentBountyId = ::core::primitive::u32; - pub type ChildBountyId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CloseChildBounty { - const PALLET: &'static str = "ChildBounties"; - const CALL: &'static str = "close_child_bounty"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Unassign curator from a child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call can be either `RejectOrigin`, or"] + #[doc = "the curator of the parent bounty, or any signed origin."] + #[doc = ""] + #[doc = "For the origin other than T::RejectOrigin and the child-bounty"] + #[doc = "curator, parent bounty must be in active state, for this call to"] + #[doc = "work. We allow child-bounty curator and T::RejectOrigin to execute"] + #[doc = "this call irrespective of the parent bounty state."] + #[doc = ""] + #[doc = "If this function is called by the `RejectOrigin` or the"] + #[doc = "parent bounty curator, we assume that the child-bounty curator is"] + #[doc = "malicious or inactive. As a result, child-bounty curator deposit is"] + #[doc = "slashed."] + #[doc = ""] + #[doc = "If the origin is the child-bounty curator, we take this as a sign"] + #[doc = "that they are unable to do their job, and are willingly giving up."] + #[doc = "We could slash the deposit, but for now we allow them to unreserve"] + #[doc = "their deposit and exit without issue. (We may want to change this if"] + #[doc = "it is abused.)"] + #[doc = ""] + #[doc = "Finally, the origin can be anyone iff the child-bounty curator is"] + #[doc = "\"inactive\". Expiry update due of parent bounty is used to estimate"] + #[doc = "inactive state of child-bounty curator."] + #[doc = ""] + #[doc = "This allows anyone in the community to call out that a child-bounty"] + #[doc = "curator is not doing their due diligence, and we should pick a new"] + #[doc = "one. In this case the child-bounty curator deposit is slashed."] + #[doc = ""] + #[doc = "State of child-bounty is moved to Added state on successful call"] + #[doc = "completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub struct UnassignCurator { + #[codec(compact)] + pub parent_bounty_id: unassign_curator::ParentBountyId, + #[codec(compact)] + pub child_bounty_id: unassign_curator::ChildBountyId, + } + pub mod unassign_curator { + use super::runtime_types; + pub type ParentBountyId = ::core::primitive::u32; + pub type ChildBountyId = ::core::primitive::u32; + } + impl UnassignCurator { + const PALLET_NAME: &'static str = "ChildBounties"; + const CALL_NAME: &'static str = "unassign_curator"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for UnassignCurator { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Add a new child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of parent"] - #[doc = "bounty and the parent bounty must be in \"active\" state."] - #[doc = ""] - #[doc = "Child-bounty gets added successfully & fund gets transferred from"] - #[doc = "parent bounty to child-bounty account, if parent bounty has enough"] - #[doc = "funds, else the call fails."] - #[doc = ""] - #[doc = "Upper bound to maximum number of active child bounties that can be"] - #[doc = "added are managed via runtime trait config"] - #[doc = "[`Config::MaxActiveChildBountyCount`]."] - #[doc = ""] - #[doc = "If the call is success, the status of child-bounty is updated to"] - #[doc = "\"Added\"."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty for which child-bounty is being added."] - #[doc = "- `value`: Value for executing the proposal."] - #[doc = "- `description`: Text description for the child-bounty."] - pub fn add_child_bounty( - &self, - parent_bounty_id: types::add_child_bounty::ParentBountyId, - value: types::add_child_bounty::Value, - description: types::add_child_bounty::Description, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ChildBounties", - "add_child_bounty", - types::AddChildBounty { - parent_bounty_id, - value, - description, - }, - [ - 249u8, 159u8, 185u8, 144u8, 114u8, 142u8, 104u8, 215u8, 136u8, 52u8, - 255u8, 125u8, 54u8, 243u8, 220u8, 171u8, 254u8, 49u8, 105u8, 134u8, - 137u8, 221u8, 100u8, 111u8, 72u8, 38u8, 184u8, 122u8, 72u8, 204u8, - 182u8, 123u8, - ], - ) - } - #[doc = "Propose curator for funded child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be curator of parent bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in \"Added\" state, for processing the call. And"] - #[doc = "state of child-bounty is moved to \"CuratorProposed\" on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - #[doc = "- `curator`: Address of child-bounty curator."] - #[doc = "- `fee`: payment fee to child-bounty curator for execution."] - pub fn propose_curator( - &self, - parent_bounty_id: types::propose_curator::ParentBountyId, - child_bounty_id: types::propose_curator::ChildBountyId, - curator: types::propose_curator::Curator, - fee: types::propose_curator::Fee, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ChildBounties", - "propose_curator", - types::ProposeCurator { - parent_bounty_id, - child_bounty_id, - curator, - fee, - }, - [ - 30u8, 186u8, 200u8, 181u8, 73u8, 219u8, 129u8, 195u8, 100u8, 30u8, - 36u8, 9u8, 131u8, 110u8, 136u8, 145u8, 146u8, 44u8, 96u8, 207u8, 74u8, - 59u8, 61u8, 94u8, 186u8, 184u8, 89u8, 170u8, 126u8, 64u8, 234u8, 177u8, - ], - ) - } - #[doc = "Accept the curator role for the child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this"] - #[doc = "child-bounty."] - #[doc = ""] - #[doc = "A deposit will be reserved from the curator and refund upon"] - #[doc = "successful payout or cancellation."] - #[doc = ""] - #[doc = "Fee for curator is deducted from curator fee of parent bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in \"CuratorProposed\" state, for processing the"] - #[doc = "call. And state of child-bounty is moved to \"Active\" on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub fn accept_curator( - &self, - parent_bounty_id: types::accept_curator::ParentBountyId, - child_bounty_id: types::accept_curator::ChildBountyId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ChildBounties", - "accept_curator", - types::AcceptCurator { - parent_bounty_id, - child_bounty_id, - }, - [ - 80u8, 117u8, 237u8, 83u8, 230u8, 230u8, 159u8, 136u8, 87u8, 17u8, - 239u8, 110u8, 190u8, 12u8, 52u8, 63u8, 171u8, 118u8, 82u8, 168u8, - 190u8, 255u8, 91u8, 85u8, 117u8, 226u8, 51u8, 28u8, 116u8, 230u8, - 137u8, 123u8, - ], - ) - } - #[doc = "Unassign curator from a child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call can be either `RejectOrigin`, or"] - #[doc = "the curator of the parent bounty, or any signed origin."] - #[doc = ""] - #[doc = "For the origin other than T::RejectOrigin and the child-bounty"] - #[doc = "curator, parent bounty must be in active state, for this call to"] - #[doc = "work. We allow child-bounty curator and T::RejectOrigin to execute"] - #[doc = "this call irrespective of the parent bounty state."] - #[doc = ""] - #[doc = "If this function is called by the `RejectOrigin` or the"] - #[doc = "parent bounty curator, we assume that the child-bounty curator is"] - #[doc = "malicious or inactive. As a result, child-bounty curator deposit is"] - #[doc = "slashed."] - #[doc = ""] - #[doc = "If the origin is the child-bounty curator, we take this as a sign"] - #[doc = "that they are unable to do their job, and are willingly giving up."] - #[doc = "We could slash the deposit, but for now we allow them to unreserve"] - #[doc = "their deposit and exit without issue. (We may want to change this if"] - #[doc = "it is abused.)"] - #[doc = ""] - #[doc = "Finally, the origin can be anyone iff the child-bounty curator is"] - #[doc = "\"inactive\". Expiry update due of parent bounty is used to estimate"] - #[doc = "inactive state of child-bounty curator."] - #[doc = ""] - #[doc = "This allows anyone in the community to call out that a child-bounty"] - #[doc = "curator is not doing their due diligence, and we should pick a new"] - #[doc = "one. In this case the child-bounty curator deposit is slashed."] - #[doc = ""] - #[doc = "State of child-bounty is moved to Added state on successful call"] - #[doc = "completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub fn unassign_curator( - &self, - parent_bounty_id: types::unassign_curator::ParentBountyId, - child_bounty_id: types::unassign_curator::ChildBountyId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ChildBounties", - "unassign_curator", - types::UnassignCurator { - parent_bounty_id, - child_bounty_id, - }, - [ - 120u8, 208u8, 75u8, 141u8, 220u8, 153u8, 79u8, 28u8, 255u8, 227u8, - 239u8, 10u8, 243u8, 116u8, 0u8, 226u8, 205u8, 208u8, 91u8, 193u8, - 154u8, 81u8, 169u8, 240u8, 120u8, 48u8, 102u8, 35u8, 25u8, 136u8, 92u8, - 141u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Award child-bounty to a beneficiary."] + #[doc = ""] + #[doc = "The beneficiary will be able to claim the funds after a delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the parent curator or"] + #[doc = "curator of this child-bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in active state, for processing the call. And"] + #[doc = "state of child-bounty is moved to \"PendingPayout\" on successful call"] + #[doc = "completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + #[doc = "- `beneficiary`: Beneficiary account."] + pub struct AwardChildBounty { + #[codec(compact)] + pub parent_bounty_id: award_child_bounty::ParentBountyId, + #[codec(compact)] + pub child_bounty_id: award_child_bounty::ChildBountyId, + pub beneficiary: award_child_bounty::Beneficiary, + } + pub mod award_child_bounty { + use super::runtime_types; + pub type ParentBountyId = ::core::primitive::u32; + pub type ChildBountyId = ::core::primitive::u32; + pub type Beneficiary = + ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl AwardChildBounty { + const PALLET_NAME: &'static str = "ChildBounties"; + const CALL_NAME: &'static str = "award_child_bounty"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AwardChildBounty { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Award child-bounty to a beneficiary."] - #[doc = ""] - #[doc = "The beneficiary will be able to claim the funds after a delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the parent curator or"] - #[doc = "curator of this child-bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in active state, for processing the call. And"] - #[doc = "state of child-bounty is moved to \"PendingPayout\" on successful call"] - #[doc = "completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - #[doc = "- `beneficiary`: Beneficiary account."] - pub fn award_child_bounty( - &self, - parent_bounty_id: types::award_child_bounty::ParentBountyId, - child_bounty_id: types::award_child_bounty::ChildBountyId, - beneficiary: types::award_child_bounty::Beneficiary, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ChildBounties", - "award_child_bounty", - types::AwardChildBounty { - parent_bounty_id, - child_bounty_id, - beneficiary, - }, - [ - 45u8, 172u8, 88u8, 8u8, 142u8, 34u8, 30u8, 132u8, 61u8, 31u8, 187u8, - 174u8, 21u8, 5u8, 248u8, 185u8, 142u8, 193u8, 29u8, 83u8, 225u8, 213u8, - 153u8, 247u8, 67u8, 219u8, 58u8, 206u8, 102u8, 55u8, 218u8, 154u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Claim the payout from an awarded child-bounty after payout delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call may be any signed origin."] + #[doc = ""] + #[doc = "Call works independent of parent bounty state, No need for parent"] + #[doc = "bounty to be in active state."] + #[doc = ""] + #[doc = "The Beneficiary is paid out with agreed bounty value. Curator fee is"] + #[doc = "paid & curator deposit is unreserved."] + #[doc = ""] + #[doc = "Child-bounty must be in \"PendingPayout\" state, for processing the"] + #[doc = "call. And instance of child-bounty is removed from the state on"] + #[doc = "successful call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub struct ClaimChildBounty { + #[codec(compact)] + pub parent_bounty_id: claim_child_bounty::ParentBountyId, + #[codec(compact)] + pub child_bounty_id: claim_child_bounty::ChildBountyId, + } + pub mod claim_child_bounty { + use super::runtime_types; + pub type ParentBountyId = ::core::primitive::u32; + pub type ChildBountyId = ::core::primitive::u32; + } + impl ClaimChildBounty { + const PALLET_NAME: &'static str = "ChildBounties"; + const CALL_NAME: &'static str = "claim_child_bounty"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ClaimChildBounty { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Claim the payout from an awarded child-bounty after payout delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call may be any signed origin."] - #[doc = ""] - #[doc = "Call works independent of parent bounty state, No need for parent"] - #[doc = "bounty to be in active state."] - #[doc = ""] - #[doc = "The Beneficiary is paid out with agreed bounty value. Curator fee is"] - #[doc = "paid & curator deposit is unreserved."] - #[doc = ""] - #[doc = "Child-bounty must be in \"PendingPayout\" state, for processing the"] - #[doc = "call. And instance of child-bounty is removed from the state on"] - #[doc = "successful call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub fn claim_child_bounty( - &self, - parent_bounty_id: types::claim_child_bounty::ParentBountyId, - child_bounty_id: types::claim_child_bounty::ChildBountyId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ChildBounties", - "claim_child_bounty", - types::ClaimChildBounty { - parent_bounty_id, - child_bounty_id, - }, - [ - 114u8, 134u8, 242u8, 240u8, 103u8, 141u8, 181u8, 214u8, 193u8, 222u8, - 23u8, 19u8, 68u8, 174u8, 190u8, 60u8, 94u8, 235u8, 14u8, 115u8, 155u8, - 199u8, 0u8, 106u8, 37u8, 144u8, 92u8, 188u8, 2u8, 149u8, 235u8, 244u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel a proposed or active child-bounty. Child-bounty account funds"] + #[doc = "are transferred to parent bounty account. The child-bounty curator"] + #[doc = "deposit may be unreserved if possible."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be either parent curator or"] + #[doc = "`T::RejectOrigin`."] + #[doc = ""] + #[doc = "If the state of child-bounty is `Active`, curator deposit is"] + #[doc = "unreserved."] + #[doc = ""] + #[doc = "If the state of child-bounty is `PendingPayout`, call fails &"] + #[doc = "returns `PendingPayout` error."] + #[doc = ""] + #[doc = "For the origin other than T::RejectOrigin, parent bounty must be in"] + #[doc = "active state, for this child-bounty call to work. For origin"] + #[doc = "T::RejectOrigin execution is forced."] + #[doc = ""] + #[doc = "Instance of child-bounty is removed from the state on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub struct CloseChildBounty { + #[codec(compact)] + pub parent_bounty_id: close_child_bounty::ParentBountyId, + #[codec(compact)] + pub child_bounty_id: close_child_bounty::ChildBountyId, + } + pub mod close_child_bounty { + use super::runtime_types; + pub type ParentBountyId = ::core::primitive::u32; + pub type ChildBountyId = ::core::primitive::u32; + } + impl CloseChildBounty { + const PALLET_NAME: &'static str = "ChildBounties"; + const CALL_NAME: &'static str = "close_child_bounty"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CloseChildBounty { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Cancel a proposed or active child-bounty. Child-bounty account funds"] - #[doc = "are transferred to parent bounty account. The child-bounty curator"] - #[doc = "deposit may be unreserved if possible."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be either parent curator or"] - #[doc = "`T::RejectOrigin`."] - #[doc = ""] - #[doc = "If the state of child-bounty is `Active`, curator deposit is"] - #[doc = "unreserved."] - #[doc = ""] - #[doc = "If the state of child-bounty is `PendingPayout`, call fails &"] - #[doc = "returns `PendingPayout` error."] - #[doc = ""] - #[doc = "For the origin other than T::RejectOrigin, parent bounty must be in"] - #[doc = "active state, for this child-bounty call to work. For origin"] - #[doc = "T::RejectOrigin execution is forced."] - #[doc = ""] - #[doc = "Instance of child-bounty is removed from the state on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub fn close_child_bounty( - &self, - parent_bounty_id: types::close_child_bounty::ParentBountyId, - child_bounty_id: types::close_child_bounty::ChildBountyId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ChildBounties", - "close_child_bounty", - types::CloseChildBounty { - parent_bounty_id, - child_bounty_id, - }, - [ - 121u8, 20u8, 81u8, 13u8, 102u8, 102u8, 162u8, 24u8, 133u8, 35u8, 203u8, - 58u8, 28u8, 195u8, 114u8, 31u8, 254u8, 252u8, 118u8, 57u8, 30u8, 211u8, - 217u8, 124u8, 148u8, 244u8, 144u8, 224u8, 39u8, 155u8, 162u8, 91u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Add a new child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of parent"] + #[doc = "bounty and the parent bounty must be in \"active\" state."] + #[doc = ""] + #[doc = "Child-bounty gets added successfully & fund gets transferred from"] + #[doc = "parent bounty to child-bounty account, if parent bounty has enough"] + #[doc = "funds, else the call fails."] + #[doc = ""] + #[doc = "Upper bound to maximum number of active child bounties that can be"] + #[doc = "added are managed via runtime trait config"] + #[doc = "[`Config::MaxActiveChildBountyCount`]."] + #[doc = ""] + #[doc = "If the call is success, the status of child-bounty is updated to"] + #[doc = "\"Added\"."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty for which child-bounty is being added."] + #[doc = "- `value`: Value for executing the proposal."] + #[doc = "- `description`: Text description for the child-bounty."] + pub fn add_child_bounty( + &self, + parent_bounty_id: super::add_child_bounty::ParentBountyId, + value: super::add_child_bounty::Value, + description: super::add_child_bounty::Description, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ChildBounties", + "add_child_bounty", + super::AddChildBounty { + parent_bounty_id, + value, + description, + }, + [ + 249u8, 159u8, 185u8, 144u8, 114u8, 142u8, 104u8, 215u8, 136u8, + 52u8, 255u8, 125u8, 54u8, 243u8, 220u8, 171u8, 254u8, 49u8, 105u8, + 134u8, 137u8, 221u8, 100u8, 111u8, 72u8, 38u8, 184u8, 122u8, 72u8, + 204u8, 182u8, 123u8, + ], + ) + } + #[doc = "Propose curator for funded child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be curator of parent bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in \"Added\" state, for processing the call. And"] + #[doc = "state of child-bounty is moved to \"CuratorProposed\" on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + #[doc = "- `curator`: Address of child-bounty curator."] + #[doc = "- `fee`: payment fee to child-bounty curator for execution."] + pub fn propose_curator( + &self, + parent_bounty_id: super::propose_curator::ParentBountyId, + child_bounty_id: super::propose_curator::ChildBountyId, + curator: super::propose_curator::Curator, + fee: super::propose_curator::Fee, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ChildBounties", + "propose_curator", + super::ProposeCurator { + parent_bounty_id, + child_bounty_id, + curator, + fee, + }, + [ + 30u8, 186u8, 200u8, 181u8, 73u8, 219u8, 129u8, 195u8, 100u8, 30u8, + 36u8, 9u8, 131u8, 110u8, 136u8, 145u8, 146u8, 44u8, 96u8, 207u8, + 74u8, 59u8, 61u8, 94u8, 186u8, 184u8, 89u8, 170u8, 126u8, 64u8, + 234u8, 177u8, + ], + ) + } + #[doc = "Accept the curator role for the child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this"] + #[doc = "child-bounty."] + #[doc = ""] + #[doc = "A deposit will be reserved from the curator and refund upon"] + #[doc = "successful payout or cancellation."] + #[doc = ""] + #[doc = "Fee for curator is deducted from curator fee of parent bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in \"CuratorProposed\" state, for processing the"] + #[doc = "call. And state of child-bounty is moved to \"Active\" on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub fn accept_curator( + &self, + parent_bounty_id: super::accept_curator::ParentBountyId, + child_bounty_id: super::accept_curator::ChildBountyId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ChildBounties", + "accept_curator", + super::AcceptCurator { + parent_bounty_id, + child_bounty_id, + }, + [ + 80u8, 117u8, 237u8, 83u8, 230u8, 230u8, 159u8, 136u8, 87u8, 17u8, + 239u8, 110u8, 190u8, 12u8, 52u8, 63u8, 171u8, 118u8, 82u8, 168u8, + 190u8, 255u8, 91u8, 85u8, 117u8, 226u8, 51u8, 28u8, 116u8, 230u8, + 137u8, 123u8, + ], + ) + } + #[doc = "Unassign curator from a child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call can be either `RejectOrigin`, or"] + #[doc = "the curator of the parent bounty, or any signed origin."] + #[doc = ""] + #[doc = "For the origin other than T::RejectOrigin and the child-bounty"] + #[doc = "curator, parent bounty must be in active state, for this call to"] + #[doc = "work. We allow child-bounty curator and T::RejectOrigin to execute"] + #[doc = "this call irrespective of the parent bounty state."] + #[doc = ""] + #[doc = "If this function is called by the `RejectOrigin` or the"] + #[doc = "parent bounty curator, we assume that the child-bounty curator is"] + #[doc = "malicious or inactive. As a result, child-bounty curator deposit is"] + #[doc = "slashed."] + #[doc = ""] + #[doc = "If the origin is the child-bounty curator, we take this as a sign"] + #[doc = "that they are unable to do their job, and are willingly giving up."] + #[doc = "We could slash the deposit, but for now we allow them to unreserve"] + #[doc = "their deposit and exit without issue. (We may want to change this if"] + #[doc = "it is abused.)"] + #[doc = ""] + #[doc = "Finally, the origin can be anyone iff the child-bounty curator is"] + #[doc = "\"inactive\". Expiry update due of parent bounty is used to estimate"] + #[doc = "inactive state of child-bounty curator."] + #[doc = ""] + #[doc = "This allows anyone in the community to call out that a child-bounty"] + #[doc = "curator is not doing their due diligence, and we should pick a new"] + #[doc = "one. In this case the child-bounty curator deposit is slashed."] + #[doc = ""] + #[doc = "State of child-bounty is moved to Added state on successful call"] + #[doc = "completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub fn unassign_curator( + &self, + parent_bounty_id: super::unassign_curator::ParentBountyId, + child_bounty_id: super::unassign_curator::ChildBountyId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ChildBounties", + "unassign_curator", + super::UnassignCurator { + parent_bounty_id, + child_bounty_id, + }, + [ + 120u8, 208u8, 75u8, 141u8, 220u8, 153u8, 79u8, 28u8, 255u8, 227u8, + 239u8, 10u8, 243u8, 116u8, 0u8, 226u8, 205u8, 208u8, 91u8, 193u8, + 154u8, 81u8, 169u8, 240u8, 120u8, 48u8, 102u8, 35u8, 25u8, 136u8, + 92u8, 141u8, + ], + ) + } + #[doc = "Award child-bounty to a beneficiary."] + #[doc = ""] + #[doc = "The beneficiary will be able to claim the funds after a delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the parent curator or"] + #[doc = "curator of this child-bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in active state, for processing the call. And"] + #[doc = "state of child-bounty is moved to \"PendingPayout\" on successful call"] + #[doc = "completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + #[doc = "- `beneficiary`: Beneficiary account."] + pub fn award_child_bounty( + &self, + parent_bounty_id: super::award_child_bounty::ParentBountyId, + child_bounty_id: super::award_child_bounty::ChildBountyId, + beneficiary: super::award_child_bounty::Beneficiary, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ChildBounties", + "award_child_bounty", + super::AwardChildBounty { + parent_bounty_id, + child_bounty_id, + beneficiary, + }, + [ + 45u8, 172u8, 88u8, 8u8, 142u8, 34u8, 30u8, 132u8, 61u8, 31u8, + 187u8, 174u8, 21u8, 5u8, 248u8, 185u8, 142u8, 193u8, 29u8, 83u8, + 225u8, 213u8, 153u8, 247u8, 67u8, 219u8, 58u8, 206u8, 102u8, 55u8, + 218u8, 154u8, + ], + ) + } + #[doc = "Claim the payout from an awarded child-bounty after payout delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call may be any signed origin."] + #[doc = ""] + #[doc = "Call works independent of parent bounty state, No need for parent"] + #[doc = "bounty to be in active state."] + #[doc = ""] + #[doc = "The Beneficiary is paid out with agreed bounty value. Curator fee is"] + #[doc = "paid & curator deposit is unreserved."] + #[doc = ""] + #[doc = "Child-bounty must be in \"PendingPayout\" state, for processing the"] + #[doc = "call. And instance of child-bounty is removed from the state on"] + #[doc = "successful call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub fn claim_child_bounty( + &self, + parent_bounty_id: super::claim_child_bounty::ParentBountyId, + child_bounty_id: super::claim_child_bounty::ChildBountyId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ChildBounties", + "claim_child_bounty", + super::ClaimChildBounty { + parent_bounty_id, + child_bounty_id, + }, + [ + 114u8, 134u8, 242u8, 240u8, 103u8, 141u8, 181u8, 214u8, 193u8, + 222u8, 23u8, 19u8, 68u8, 174u8, 190u8, 60u8, 94u8, 235u8, 14u8, + 115u8, 155u8, 199u8, 0u8, 106u8, 37u8, 144u8, 92u8, 188u8, 2u8, + 149u8, 235u8, 244u8, + ], + ) + } + #[doc = "Cancel a proposed or active child-bounty. Child-bounty account funds"] + #[doc = "are transferred to parent bounty account. The child-bounty curator"] + #[doc = "deposit may be unreserved if possible."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be either parent curator or"] + #[doc = "`T::RejectOrigin`."] + #[doc = ""] + #[doc = "If the state of child-bounty is `Active`, curator deposit is"] + #[doc = "unreserved."] + #[doc = ""] + #[doc = "If the state of child-bounty is `PendingPayout`, call fails &"] + #[doc = "returns `PendingPayout` error."] + #[doc = ""] + #[doc = "For the origin other than T::RejectOrigin, parent bounty must be in"] + #[doc = "active state, for this child-bounty call to work. For origin"] + #[doc = "T::RejectOrigin execution is forced."] + #[doc = ""] + #[doc = "Instance of child-bounty is removed from the state on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub fn close_child_bounty( + &self, + parent_bounty_id: super::close_child_bounty::ParentBountyId, + child_bounty_id: super::close_child_bounty::ChildBountyId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ChildBounties", + "close_child_bounty", + super::CloseChildBounty { + parent_bounty_id, + child_bounty_id, + }, + [ + 121u8, 20u8, 81u8, 13u8, 102u8, 102u8, 162u8, 24u8, 133u8, 35u8, + 203u8, 58u8, 28u8, 195u8, 114u8, 31u8, 254u8, 252u8, 118u8, 57u8, + 30u8, 211u8, 217u8, 124u8, 148u8, 244u8, 144u8, 224u8, 39u8, 155u8, + 162u8, 91u8, + ], + ) + } } } } @@ -28279,12 +28828,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A child-bounty is added."] pub struct Added { pub index: added::Index, @@ -28295,17 +28844,22 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type ChildIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Added { - const PALLET: &'static str = "ChildBounties"; - const EVENT: &'static str = "Added"; + impl Added { + const PALLET_NAME: &'static str = "ChildBounties"; + const EVENT_NAME: &'static str = "Added"; + } + impl ::subxt::events::DecodeAsEvent for Added { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A child-bounty is awarded to a beneficiary."] pub struct Awarded { pub index: awarded::Index, @@ -28316,19 +28870,24 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; pub type ChildIndex = ::core::primitive::u32; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Beneficiary = ::subxt::utils::AccountId32; + } + impl Awarded { + const PALLET_NAME: &'static str = "ChildBounties"; + const EVENT_NAME: &'static str = "Awarded"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Awarded { - const PALLET: &'static str = "ChildBounties"; - const EVENT: &'static str = "Awarded"; + impl ::subxt::events::DecodeAsEvent for Awarded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A child-bounty is claimed by beneficiary."] pub struct Claimed { pub index: claimed::Index, @@ -28341,19 +28900,24 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type ChildIndex = ::core::primitive::u32; pub type Payout = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Beneficiary = ::subxt::utils::AccountId32; + } + impl Claimed { + const PALLET_NAME: &'static str = "ChildBounties"; + const EVENT_NAME: &'static str = "Claimed"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Claimed { - const PALLET: &'static str = "ChildBounties"; - const EVENT: &'static str = "Claimed"; + impl ::subxt::events::DecodeAsEvent for Claimed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A child-bounty is cancelled."] pub struct Canceled { pub index: canceled::Index, @@ -28364,9 +28928,14 @@ pub mod api { pub type Index = ::core::primitive::u32; pub type ChildIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Canceled { - const PALLET: &'static str = "ChildBounties"; - const EVENT: &'static str = "Canceled"; + impl Canceled { + const PALLET_NAME: &'static str = "ChildBounties"; + const EVENT_NAME: &'static str = "Canceled"; + } + impl ::subxt::events::DecodeAsEvent for Canceled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -28378,12 +28947,12 @@ pub mod api { #[doc = " for each parent bounty. Number of total child bounties. Will be removed in May 2025."] pub fn child_bounty_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - child_bounty_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + child_bounty_count::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ChildBounties", "ChildBountyCount", [ @@ -28397,12 +28966,12 @@ pub mod api { #[doc = " Map of parent bounty index to number of child bounties."] pub fn parent_child_bounties( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (parent_child_bounties::Param0,), - parent_child_bounties::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (parent_child_bounties::input::Param0,), + parent_child_bounties::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ChildBounties", "ParentChildBounties", [ @@ -28415,12 +28984,12 @@ pub mod api { #[doc = " Number of total child bounties per parent bounty, including completed bounties."] pub fn parent_total_child_bounties( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (parent_total_child_bounties::Param0,), - parent_total_child_bounties::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (parent_total_child_bounties::input::Param0,), + parent_total_child_bounties::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ChildBounties", "ParentTotalChildBounties", [ @@ -28433,12 +29002,12 @@ pub mod api { #[doc = " Child bounties that have been added."] pub fn child_bounties( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (child_bounties::Param0, child_bounties::Param1), - child_bounties::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (child_bounties::input::Param0, child_bounties::input::Param1), + child_bounties::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ChildBounties", "ChildBounties", [ @@ -28454,15 +29023,15 @@ pub mod api { #[doc = " This item replaces the `ChildBountyDescriptions` storage item from the V0 storage version."] pub fn child_bounty_descriptions_v1( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< ( - child_bounty_descriptions_v1::Param0, - child_bounty_descriptions_v1::Param1, + child_bounty_descriptions_v1::input::Param0, + child_bounty_descriptions_v1::input::Param1, ), - child_bounty_descriptions_v1::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + child_bounty_descriptions_v1::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ChildBounties", "ChildBountyDescriptionsV1", [ @@ -28480,12 +29049,12 @@ pub mod api { #[doc = " The item intended solely for client convenience and not used in the pallet's core logic."] pub fn v0_to_v1_child_bounty_ids( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (v0_to_v1_child_bounty_ids::Param0,), - v0_to_v1_child_bounty_ids::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (v0_to_v1_child_bounty_ids::input::Param0,), + v0_to_v1_child_bounty_ids::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ChildBounties", "V0ToV1ChildBountyIds", [ @@ -28498,12 +29067,12 @@ pub mod api { #[doc = " The cumulative child-bounty curator fee for each parent bounty."] pub fn children_curator_fees( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (children_curator_fees::Param0,), - children_curator_fees::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (children_curator_fees::input::Param0,), + children_curator_fees::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ChildBounties", "ChildrenCuratorFees", [ @@ -28518,72 +29087,72 @@ pub mod api { pub mod child_bounty_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod parent_child_bounties { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod parent_total_child_bounties { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod child_bounties { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_child_bounties::ChildBounty< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::core::primitive::u32; } + pub type Output = runtime_types::pallet_child_bounties::ChildBounty< + ::subxt::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; } pub mod child_bounty_descriptions_v1 { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::core::primitive::u32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; } pub mod v0_to_v1_child_bounty_ids { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (::core::primitive::u32, ::core::primitive::u32); + pub type Param0 = ::core::primitive::u32; } + pub type Output = (::core::primitive::u32, ::core::primitive::u32); } pub mod children_curator_fees { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u128; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::core::primitive::u128; } } pub mod constants { @@ -28593,10 +29162,8 @@ pub mod api { #[doc = " Maximum number of child bounties that can be added to a parent bounty."] pub fn max_active_child_bounty_count( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "ChildBounties", "MaxActiveChildBountyCount", [ @@ -28610,10 +29177,8 @@ pub mod api { #[doc = " Minimum value for a child-bounty."] pub fn child_bounty_value_minimum( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "ChildBounties", "ChildBountyValueMinimum", [ @@ -28636,369 +29201,374 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Place a bid."] + #[doc = ""] + #[doc = "Origin must be Signed, and account must have at least `amount` in free balance."] + #[doc = ""] + #[doc = "- `amount`: The amount of the bid; these funds will be reserved, and if/when"] + #[doc = " consolidated, removed. Must be at least `MinBid`."] + #[doc = "- `duration`: The number of periods before which the newly consolidated bid may be"] + #[doc = " thawed. Must be greater than 1 and no more than `QueueCount`."] + #[doc = ""] + #[doc = "Complexities:"] + #[doc = "- `Queues[duration].len()` (just take max)."] + pub struct PlaceBid { + #[codec(compact)] + pub amount: place_bid::Amount, + pub duration: place_bid::Duration, + } + pub mod place_bid { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Place a bid."] - #[doc = ""] - #[doc = "Origin must be Signed, and account must have at least `amount` in free balance."] - #[doc = ""] - #[doc = "- `amount`: The amount of the bid; these funds will be reserved, and if/when"] - #[doc = " consolidated, removed. Must be at least `MinBid`."] - #[doc = "- `duration`: The number of periods before which the newly consolidated bid may be"] - #[doc = " thawed. Must be greater than 1 and no more than `QueueCount`."] - #[doc = ""] - #[doc = "Complexities:"] - #[doc = "- `Queues[duration].len()` (just take max)."] - pub struct PlaceBid { - #[codec(compact)] - pub amount: place_bid::Amount, - pub duration: place_bid::Duration, + pub type Amount = ::core::primitive::u128; + pub type Duration = ::core::primitive::u32; + } + impl PlaceBid { + const PALLET_NAME: &'static str = "Nis"; + const CALL_NAME: &'static str = "place_bid"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PlaceBid { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod place_bid { - use super::runtime_types; - pub type Amount = ::core::primitive::u128; - pub type Duration = ::core::primitive::u32; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Retract a previously placed bid."] + #[doc = ""] + #[doc = "Origin must be Signed, and the account should have previously issued a still-active bid"] + #[doc = "of `amount` for `duration`."] + #[doc = ""] + #[doc = "- `amount`: The amount of the previous bid."] + #[doc = "- `duration`: The duration of the previous bid."] + pub struct RetractBid { + #[codec(compact)] + pub amount: retract_bid::Amount, + pub duration: retract_bid::Duration, + } + pub mod retract_bid { + use super::runtime_types; + pub type Amount = ::core::primitive::u128; + pub type Duration = ::core::primitive::u32; + } + impl RetractBid { + const PALLET_NAME: &'static str = "Nis"; + const CALL_NAME: &'static str = "retract_bid"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RetractBid { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceBid { - const PALLET: &'static str = "Nis"; - const CALL: &'static str = "place_bid"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Ensure we have sufficient funding for all potential payouts."] + #[doc = ""] + #[doc = "- `origin`: Must be accepted by `FundOrigin`."] + pub struct FundDeficit; + impl FundDeficit { + const PALLET_NAME: &'static str = "Nis"; + const CALL_NAME: &'static str = "fund_deficit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for FundDeficit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Retract a previously placed bid."] - #[doc = ""] - #[doc = "Origin must be Signed, and the account should have previously issued a still-active bid"] - #[doc = "of `amount` for `duration`."] - #[doc = ""] - #[doc = "- `amount`: The amount of the previous bid."] - #[doc = "- `duration`: The duration of the previous bid."] - pub struct RetractBid { - #[codec(compact)] - pub amount: retract_bid::Amount, - pub duration: retract_bid::Duration, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Reduce or remove an outstanding receipt, placing the according proportion of funds into"] + #[doc = "the account of the owner."] + #[doc = ""] + #[doc = "- `origin`: Must be Signed and the account must be the owner of the receipt `index` as"] + #[doc = " well as any fungible counterpart."] + #[doc = "- `index`: The index of the receipt."] + #[doc = "- `portion`: If `Some`, then only the given portion of the receipt should be thawed. If"] + #[doc = " `None`, then all of it should be."] + pub struct ThawPrivate { + #[codec(compact)] + pub index: thaw_private::Index, + pub maybe_proportion: thaw_private::MaybeProportion, + } + pub mod thaw_private { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type MaybeProportion = + ::core::option::Option; + } + impl ThawPrivate { + const PALLET_NAME: &'static str = "Nis"; + const CALL_NAME: &'static str = "thaw_private"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ThawPrivate { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod retract_bid { - use super::runtime_types; - pub type Amount = ::core::primitive::u128; - pub type Duration = ::core::primitive::u32; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Reduce or remove an outstanding receipt, placing the according proportion of funds into"] + #[doc = "the account of the owner."] + #[doc = ""] + #[doc = "- `origin`: Must be Signed and the account must be the owner of the fungible counterpart"] + #[doc = " for receipt `index`."] + #[doc = "- `index`: The index of the receipt."] + pub struct ThawCommunal { + #[codec(compact)] + pub index: thaw_communal::Index, + } + pub mod thaw_communal { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ThawCommunal { + const PALLET_NAME: &'static str = "Nis"; + const CALL_NAME: &'static str = "thaw_communal"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ThawCommunal { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RetractBid { - const PALLET: &'static str = "Nis"; - const CALL: &'static str = "retract_bid"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Make a private receipt communal and create fungible counterparts for its owner."] + pub struct Communify { + #[codec(compact)] + pub index: communify::Index, + } + pub mod communify { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl Communify { + const PALLET_NAME: &'static str = "Nis"; + const CALL_NAME: &'static str = "communify"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Communify { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Ensure we have sufficient funding for all potential payouts."] - #[doc = ""] - #[doc = "- `origin`: Must be accepted by `FundOrigin`."] - pub struct FundDeficit; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FundDeficit { - const PALLET: &'static str = "Nis"; - const CALL: &'static str = "fund_deficit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Reduce or remove an outstanding receipt, placing the according proportion of funds into"] - #[doc = "the account of the owner."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed and the account must be the owner of the receipt `index` as"] - #[doc = " well as any fungible counterpart."] - #[doc = "- `index`: The index of the receipt."] - #[doc = "- `portion`: If `Some`, then only the given portion of the receipt should be thawed. If"] - #[doc = " `None`, then all of it should be."] - pub struct ThawPrivate { - #[codec(compact)] - pub index: thaw_private::Index, - pub maybe_proportion: thaw_private::MaybeProportion, - } - pub mod thaw_private { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type MaybeProportion = ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Perquintill, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ThawPrivate { - const PALLET: &'static str = "Nis"; - const CALL: &'static str = "thaw_private"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Reduce or remove an outstanding receipt, placing the according proportion of funds into"] - #[doc = "the account of the owner."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed and the account must be the owner of the fungible counterpart"] - #[doc = " for receipt `index`."] - #[doc = "- `index`: The index of the receipt."] - pub struct ThawCommunal { - #[codec(compact)] - pub index: thaw_communal::Index, - } - pub mod thaw_communal { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ThawCommunal { - const PALLET: &'static str = "Nis"; - const CALL: &'static str = "thaw_communal"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Make a private receipt communal and create fungible counterparts for its owner."] - pub struct Communify { - #[codec(compact)] - pub index: communify::Index, - } - pub mod communify { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Communify { - const PALLET: &'static str = "Nis"; - const CALL: &'static str = "communify"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Make a communal receipt private and burn fungible counterparts from its owner."] - pub struct Privatize { - #[codec(compact)] - pub index: privatize::Index, - } - pub mod privatize { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Privatize { - const PALLET: &'static str = "Nis"; - const CALL: &'static str = "privatize"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Make a communal receipt private and burn fungible counterparts from its owner."] + pub struct Privatize { + #[codec(compact)] + pub index: privatize::Index, + } + pub mod privatize { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl Privatize { + const PALLET_NAME: &'static str = "Nis"; + const CALL_NAME: &'static str = "privatize"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Privatize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Place a bid."] - #[doc = ""] - #[doc = "Origin must be Signed, and account must have at least `amount` in free balance."] - #[doc = ""] - #[doc = "- `amount`: The amount of the bid; these funds will be reserved, and if/when"] - #[doc = " consolidated, removed. Must be at least `MinBid`."] - #[doc = "- `duration`: The number of periods before which the newly consolidated bid may be"] - #[doc = " thawed. Must be greater than 1 and no more than `QueueCount`."] - #[doc = ""] - #[doc = "Complexities:"] - #[doc = "- `Queues[duration].len()` (just take max)."] - pub fn place_bid( - &self, - amount: types::place_bid::Amount, - duration: types::place_bid::Duration, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Nis", - "place_bid", - types::PlaceBid { amount, duration }, - [ - 138u8, 214u8, 63u8, 53u8, 233u8, 95u8, 186u8, 83u8, 235u8, 121u8, 4u8, - 41u8, 210u8, 214u8, 35u8, 196u8, 89u8, 102u8, 115u8, 130u8, 151u8, - 212u8, 13u8, 34u8, 198u8, 103u8, 160u8, 39u8, 22u8, 151u8, 216u8, - 243u8, - ], - ) - } - #[doc = "Retract a previously placed bid."] - #[doc = ""] - #[doc = "Origin must be Signed, and the account should have previously issued a still-active bid"] - #[doc = "of `amount` for `duration`."] - #[doc = ""] - #[doc = "- `amount`: The amount of the previous bid."] - #[doc = "- `duration`: The duration of the previous bid."] - pub fn retract_bid( - &self, - amount: types::retract_bid::Amount, - duration: types::retract_bid::Duration, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Nis", - "retract_bid", - types::RetractBid { amount, duration }, - [ - 156u8, 140u8, 160u8, 45u8, 107u8, 72u8, 2u8, 129u8, 149u8, 89u8, 103u8, - 95u8, 189u8, 42u8, 0u8, 21u8, 51u8, 236u8, 113u8, 33u8, 136u8, 115u8, - 93u8, 223u8, 72u8, 139u8, 46u8, 76u8, 128u8, 134u8, 209u8, 252u8, - ], - ) - } - #[doc = "Ensure we have sufficient funding for all potential payouts."] - #[doc = ""] - #[doc = "- `origin`: Must be accepted by `FundOrigin`."] - pub fn fund_deficit( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Nis", - "fund_deficit", - types::FundDeficit {}, - [ - 49u8, 183u8, 23u8, 249u8, 232u8, 74u8, 238u8, 100u8, 165u8, 242u8, - 42u8, 6u8, 58u8, 91u8, 28u8, 229u8, 5u8, 180u8, 108u8, 164u8, 63u8, - 20u8, 92u8, 122u8, 222u8, 149u8, 190u8, 194u8, 64u8, 114u8, 22u8, - 176u8, - ], - ) - } - #[doc = "Reduce or remove an outstanding receipt, placing the according proportion of funds into"] - #[doc = "the account of the owner."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed and the account must be the owner of the receipt `index` as"] - #[doc = " well as any fungible counterpart."] - #[doc = "- `index`: The index of the receipt."] - #[doc = "- `portion`: If `Some`, then only the given portion of the receipt should be thawed. If"] - #[doc = " `None`, then all of it should be."] - pub fn thaw_private( - &self, - index: types::thaw_private::Index, - maybe_proportion: types::thaw_private::MaybeProportion, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Nis", - "thaw_private", - types::ThawPrivate { - index, - maybe_proportion, - }, - [ - 202u8, 131u8, 103u8, 88u8, 165u8, 203u8, 191u8, 48u8, 99u8, 26u8, 1u8, - 133u8, 8u8, 139u8, 216u8, 195u8, 22u8, 91u8, 240u8, 188u8, 228u8, 54u8, - 140u8, 156u8, 66u8, 13u8, 53u8, 184u8, 157u8, 177u8, 227u8, 52u8, - ], - ) - } - #[doc = "Reduce or remove an outstanding receipt, placing the according proportion of funds into"] - #[doc = "the account of the owner."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed and the account must be the owner of the fungible counterpart"] - #[doc = " for receipt `index`."] - #[doc = "- `index`: The index of the receipt."] - pub fn thaw_communal( - &self, - index: types::thaw_communal::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Nis", - "thaw_communal", - types::ThawCommunal { index }, - [ - 106u8, 64u8, 53u8, 173u8, 59u8, 135u8, 254u8, 38u8, 119u8, 2u8, 4u8, - 109u8, 21u8, 220u8, 218u8, 220u8, 34u8, 10u8, 86u8, 248u8, 166u8, - 226u8, 183u8, 117u8, 211u8, 16u8, 53u8, 236u8, 0u8, 187u8, 140u8, - 221u8, - ], - ) - } - #[doc = "Make a private receipt communal and create fungible counterparts for its owner."] - pub fn communify( - &self, - index: types::communify::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Nis", - "communify", - types::Communify { index }, - [ - 206u8, 141u8, 231u8, 98u8, 101u8, 34u8, 101u8, 190u8, 22u8, 246u8, - 238u8, 30u8, 48u8, 104u8, 128u8, 115u8, 49u8, 78u8, 30u8, 230u8, 59u8, - 173u8, 70u8, 89u8, 82u8, 212u8, 105u8, 236u8, 86u8, 244u8, 248u8, - 144u8, - ], - ) - } - #[doc = "Make a communal receipt private and burn fungible counterparts from its owner."] - pub fn privatize( - &self, - index: types::privatize::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Nis", - "privatize", - types::Privatize { index }, - [ - 228u8, 215u8, 197u8, 40u8, 194u8, 170u8, 139u8, 192u8, 214u8, 61u8, - 107u8, 132u8, 89u8, 122u8, 58u8, 12u8, 11u8, 231u8, 186u8, 73u8, 106u8, - 99u8, 134u8, 216u8, 206u8, 118u8, 221u8, 223u8, 187u8, 206u8, 246u8, - 255u8, - ], - ) + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Place a bid."] + #[doc = ""] + #[doc = "Origin must be Signed, and account must have at least `amount` in free balance."] + #[doc = ""] + #[doc = "- `amount`: The amount of the bid; these funds will be reserved, and if/when"] + #[doc = " consolidated, removed. Must be at least `MinBid`."] + #[doc = "- `duration`: The number of periods before which the newly consolidated bid may be"] + #[doc = " thawed. Must be greater than 1 and no more than `QueueCount`."] + #[doc = ""] + #[doc = "Complexities:"] + #[doc = "- `Queues[duration].len()` (just take max)."] + pub fn place_bid( + &self, + amount: super::place_bid::Amount, + duration: super::place_bid::Duration, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Nis", + "place_bid", + super::PlaceBid { amount, duration }, + [ + 138u8, 214u8, 63u8, 53u8, 233u8, 95u8, 186u8, 83u8, 235u8, 121u8, + 4u8, 41u8, 210u8, 214u8, 35u8, 196u8, 89u8, 102u8, 115u8, 130u8, + 151u8, 212u8, 13u8, 34u8, 198u8, 103u8, 160u8, 39u8, 22u8, 151u8, + 216u8, 243u8, + ], + ) + } + #[doc = "Retract a previously placed bid."] + #[doc = ""] + #[doc = "Origin must be Signed, and the account should have previously issued a still-active bid"] + #[doc = "of `amount` for `duration`."] + #[doc = ""] + #[doc = "- `amount`: The amount of the previous bid."] + #[doc = "- `duration`: The duration of the previous bid."] + pub fn retract_bid( + &self, + amount: super::retract_bid::Amount, + duration: super::retract_bid::Duration, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Nis", + "retract_bid", + super::RetractBid { amount, duration }, + [ + 156u8, 140u8, 160u8, 45u8, 107u8, 72u8, 2u8, 129u8, 149u8, 89u8, + 103u8, 95u8, 189u8, 42u8, 0u8, 21u8, 51u8, 236u8, 113u8, 33u8, + 136u8, 115u8, 93u8, 223u8, 72u8, 139u8, 46u8, 76u8, 128u8, 134u8, + 209u8, 252u8, + ], + ) + } + #[doc = "Ensure we have sufficient funding for all potential payouts."] + #[doc = ""] + #[doc = "- `origin`: Must be accepted by `FundOrigin`."] + pub fn fund_deficit( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Nis", + "fund_deficit", + super::FundDeficit {}, + [ + 49u8, 183u8, 23u8, 249u8, 232u8, 74u8, 238u8, 100u8, 165u8, 242u8, + 42u8, 6u8, 58u8, 91u8, 28u8, 229u8, 5u8, 180u8, 108u8, 164u8, 63u8, + 20u8, 92u8, 122u8, 222u8, 149u8, 190u8, 194u8, 64u8, 114u8, 22u8, + 176u8, + ], + ) + } + #[doc = "Reduce or remove an outstanding receipt, placing the according proportion of funds into"] + #[doc = "the account of the owner."] + #[doc = ""] + #[doc = "- `origin`: Must be Signed and the account must be the owner of the receipt `index` as"] + #[doc = " well as any fungible counterpart."] + #[doc = "- `index`: The index of the receipt."] + #[doc = "- `portion`: If `Some`, then only the given portion of the receipt should be thawed. If"] + #[doc = " `None`, then all of it should be."] + pub fn thaw_private( + &self, + index: super::thaw_private::Index, + maybe_proportion: super::thaw_private::MaybeProportion, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Nis", + "thaw_private", + super::ThawPrivate { + index, + maybe_proportion, + }, + [ + 202u8, 131u8, 103u8, 88u8, 165u8, 203u8, 191u8, 48u8, 99u8, 26u8, + 1u8, 133u8, 8u8, 139u8, 216u8, 195u8, 22u8, 91u8, 240u8, 188u8, + 228u8, 54u8, 140u8, 156u8, 66u8, 13u8, 53u8, 184u8, 157u8, 177u8, + 227u8, 52u8, + ], + ) + } + #[doc = "Reduce or remove an outstanding receipt, placing the according proportion of funds into"] + #[doc = "the account of the owner."] + #[doc = ""] + #[doc = "- `origin`: Must be Signed and the account must be the owner of the fungible counterpart"] + #[doc = " for receipt `index`."] + #[doc = "- `index`: The index of the receipt."] + pub fn thaw_communal( + &self, + index: super::thaw_communal::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Nis", + "thaw_communal", + super::ThawCommunal { index }, + [ + 106u8, 64u8, 53u8, 173u8, 59u8, 135u8, 254u8, 38u8, 119u8, 2u8, + 4u8, 109u8, 21u8, 220u8, 218u8, 220u8, 34u8, 10u8, 86u8, 248u8, + 166u8, 226u8, 183u8, 117u8, 211u8, 16u8, 53u8, 236u8, 0u8, 187u8, + 140u8, 221u8, + ], + ) + } + #[doc = "Make a private receipt communal and create fungible counterparts for its owner."] + pub fn communify( + &self, + index: super::communify::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Nis", + "communify", + super::Communify { index }, + [ + 206u8, 141u8, 231u8, 98u8, 101u8, 34u8, 101u8, 190u8, 22u8, 246u8, + 238u8, 30u8, 48u8, 104u8, 128u8, 115u8, 49u8, 78u8, 30u8, 230u8, + 59u8, 173u8, 70u8, 89u8, 82u8, 212u8, 105u8, 236u8, 86u8, 244u8, + 248u8, 144u8, + ], + ) + } + #[doc = "Make a communal receipt private and burn fungible counterparts from its owner."] + pub fn privatize( + &self, + index: super::privatize::Index, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Nis", + "privatize", + super::Privatize { index }, + [ + 228u8, 215u8, 197u8, 40u8, 194u8, 170u8, 139u8, 192u8, 214u8, 61u8, + 107u8, 132u8, 89u8, 122u8, 58u8, 12u8, 11u8, 231u8, 186u8, 73u8, + 106u8, 99u8, 134u8, 216u8, 206u8, 118u8, 221u8, 223u8, 187u8, + 206u8, 246u8, 255u8, + ], + ) + } } } } @@ -29007,12 +29577,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A bid was successfully placed."] pub struct BidPlaced { pub who: bid_placed::Who, @@ -29021,21 +29591,26 @@ pub mod api { } pub mod bid_placed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; pub type Duration = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BidPlaced { - const PALLET: &'static str = "Nis"; - const EVENT: &'static str = "BidPlaced"; + impl BidPlaced { + const PALLET_NAME: &'static str = "Nis"; + const EVENT_NAME: &'static str = "BidPlaced"; + } + impl ::subxt::events::DecodeAsEvent for BidPlaced { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A bid was successfully removed (before being accepted)."] pub struct BidRetracted { pub who: bid_retracted::Who, @@ -29044,21 +29619,26 @@ pub mod api { } pub mod bid_retracted { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; pub type Duration = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BidRetracted { - const PALLET: &'static str = "Nis"; - const EVENT: &'static str = "BidRetracted"; + impl BidRetracted { + const PALLET_NAME: &'static str = "Nis"; + const EVENT_NAME: &'static str = "BidRetracted"; + } + impl ::subxt::events::DecodeAsEvent for BidRetracted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A bid was dropped from a queue because of another, more substantial, bid was present."] pub struct BidDropped { pub who: bid_dropped::Who, @@ -29067,21 +29647,26 @@ pub mod api { } pub mod bid_dropped { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; pub type Duration = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BidDropped { - const PALLET: &'static str = "Nis"; - const EVENT: &'static str = "BidDropped"; + impl BidDropped { + const PALLET_NAME: &'static str = "Nis"; + const EVENT_NAME: &'static str = "BidDropped"; + } + impl ::subxt::events::DecodeAsEvent for BidDropped { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A bid was accepted. The balance may not be released until expiry."] pub struct Issued { pub index: issued::Index, @@ -29094,21 +29679,26 @@ pub mod api { use super::runtime_types; pub type Index = ::core::primitive::u32; pub type Expiry = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Proportion = runtime_types::sp_arithmetic::per_things::Perquintill; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Issued { - const PALLET: &'static str = "Nis"; - const EVENT: &'static str = "Issued"; + impl Issued { + const PALLET_NAME: &'static str = "Nis"; + const EVENT_NAME: &'static str = "Issued"; + } + impl ::subxt::events::DecodeAsEvent for Issued { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An receipt has been (at least partially) thawed."] pub struct Thawed { pub index: thawed::Index, @@ -29120,22 +29710,27 @@ pub mod api { pub mod thawed { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Proportion = runtime_types::sp_arithmetic::per_things::Perquintill; pub type Amount = ::core::primitive::u128; pub type Dropped = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Thawed { - const PALLET: &'static str = "Nis"; - const EVENT: &'static str = "Thawed"; + impl Thawed { + const PALLET_NAME: &'static str = "Nis"; + const EVENT_NAME: &'static str = "Thawed"; + } + impl ::subxt::events::DecodeAsEvent for Thawed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An automatic funding of the deficit was made."] pub struct Funded { pub deficit: funded::Deficit, @@ -29144,17 +29739,22 @@ pub mod api { use super::runtime_types; pub type Deficit = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Funded { - const PALLET: &'static str = "Nis"; - const EVENT: &'static str = "Funded"; + impl Funded { + const PALLET_NAME: &'static str = "Nis"; + const EVENT_NAME: &'static str = "Funded"; + } + impl ::subxt::events::DecodeAsEvent for Funded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A receipt was transferred."] pub struct Transferred { pub from: transferred::From, @@ -29163,13 +29763,18 @@ pub mod api { } pub mod transferred { use super::runtime_types; - pub type From = ::subxt::ext::subxt_core::utils::AccountId32; - pub type To = ::subxt::ext::subxt_core::utils::AccountId32; + pub type From = ::subxt::utils::AccountId32; + pub type To = ::subxt::utils::AccountId32; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Transferred { - const PALLET: &'static str = "Nis"; - const EVENT: &'static str = "Transferred"; + impl Transferred { + const PALLET_NAME: &'static str = "Nis"; + const EVENT_NAME: &'static str = "Transferred"; + } + impl ::subxt::events::DecodeAsEvent for Transferred { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -29184,12 +29789,9 @@ pub mod api { #[doc = " whose duration is one `Period` would be storage `0`."] pub fn queue_totals( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - queue_totals::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), queue_totals::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Nis", "QueueTotals", [ @@ -29202,12 +29804,12 @@ pub mod api { #[doc = " The queues of bids. Indexed by duration (in `Period`s)."] pub fn queues( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (queues::Param0,), - queues::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (queues::input::Param0,), + queues::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Nis", "Queues", [ @@ -29220,12 +29822,9 @@ pub mod api { #[doc = " Summary information over the general state."] pub fn summary( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - summary::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), summary::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Nis", "Summary", [ @@ -29238,12 +29837,12 @@ pub mod api { #[doc = " The currently outstanding receipts, indexed according to the order of creation."] pub fn receipts( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (receipts::Param0,), - receipts::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (receipts::input::Param0,), + receipts::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Nis", "Receipts", [ @@ -29257,50 +29856,51 @@ pub mod api { pub mod queue_totals { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - (::core::primitive::u32, ::core::primitive::u128), - >; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u32, + ::core::primitive::u128, + )>; } pub mod queues { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_nis::pallet::Bid< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; + pub type Param0 = ::core::primitive::u32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_nis::pallet::Bid< + ::core::primitive::u128, + ::subxt::utils::AccountId32, + >, + >; } pub mod summary { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_nis::pallet::SummaryRecord< - ::core::primitive::u32, - ::core::primitive::u128, - >; } + pub type Output = runtime_types::pallet_nis::pallet::SummaryRecord< + ::core::primitive::u32, + ::core::primitive::u128, + >; } pub mod receipts { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_nis::pallet::ReceiptRecord< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - ::core::primitive::u128, - >; + pub type Param0 = ::core::primitive::u32; } + pub type Output = runtime_types::pallet_nis::pallet::ReceiptRecord< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + ::core::primitive::u128, + >; } } pub mod constants { @@ -29310,10 +29910,9 @@ pub mod api { #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] pub fn pallet_id( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress + { + ::subxt::constants::StaticAddress::new_static( "Nis", "PalletId", [ @@ -29327,10 +29926,8 @@ pub mod api { #[doc = " this value multiplied by `Period`."] pub fn queue_count( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Nis", "QueueCount", [ @@ -29346,10 +29943,8 @@ pub mod api { #[doc = " Must be larger than zero."] pub fn max_queue_len( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Nis", "MaxQueueLen", [ @@ -29365,10 +29960,8 @@ pub mod api { #[doc = " Must be no greater than `MaxQueueLen`."] pub fn fifo_queue_len( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Nis", "FifoQueueLen", [ @@ -29383,10 +29976,8 @@ pub mod api { #[doc = " supported freezing durations that can be bid upon."] pub fn base_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Nis", "BasePeriod", [ @@ -29405,10 +29996,8 @@ pub mod api { #[doc = " or queue-filling attack."] pub fn min_bid( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Nis", "MinBid", [ @@ -29422,10 +30011,10 @@ pub mod api { #[doc = " receipt."] pub fn min_receipt( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< runtime_types::sp_arithmetic::per_things::Perquintill, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "Nis", "MinReceipt", [ @@ -29442,10 +30031,8 @@ pub mod api { #[doc = " the target."] pub fn intake_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Nis", "IntakePeriod", [ @@ -29461,10 +30048,9 @@ pub mod api { #[doc = " glut of bids."] pub fn max_intake_weight( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_weights::weight_v2::Weight, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress + { + ::subxt::constants::StaticAddress::new_static( "Nis", "MaxIntakeWeight", [ @@ -29478,11 +30064,11 @@ pub mod api { #[doc = " The maximum proportion which may be thawed and the period over which it is reset."] pub fn thaw_throttle( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress<( + ) -> ::subxt::constants::StaticAddress<( runtime_types::sp_arithmetic::per_things::Perquintill, ::core::primitive::u32, )> { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "Nis", "ThawThrottle", [ @@ -29505,742 +30091,775 @@ pub mod api { pub type Call = runtime_types::pallet_balances::pallet::Call; pub mod calls { use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer some liquid free balance to another account."] - #[doc = ""] - #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] - #[doc = "If the sender's account is below the existential deposit as a result"] - #[doc = "of the transfer, the account will be reaped."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] - pub struct TransferAllowDeath { - pub dest: transfer_allow_death::Dest, - #[codec(compact)] - pub value: transfer_allow_death::Value, - } - pub mod transfer_allow_death { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Value = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAllowDeath { - const PALLET: &'static str = "NisCounterpartBalances"; - const CALL: &'static str = "transfer_allow_death"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] - #[doc = "may be specified."] - pub struct ForceTransfer { - pub source: force_transfer::Source, - pub dest: force_transfer::Dest, - #[codec(compact)] - pub value: force_transfer::Value, - } - pub mod force_transfer { - use super::runtime_types; - pub type Source = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Value = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceTransfer { - const PALLET: &'static str = "NisCounterpartBalances"; - const CALL: &'static str = "force_transfer"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] - #[doc = "kill the origin account."] - #[doc = ""] - #[doc = "99% of the time you want [`transfer_allow_death`] instead."] - #[doc = ""] - #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] - pub struct TransferKeepAlive { - pub dest: transfer_keep_alive::Dest, - #[codec(compact)] - pub value: transfer_keep_alive::Value, - } - pub mod transfer_keep_alive { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Value = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferKeepAlive { - const PALLET: &'static str = "NisCounterpartBalances"; - const CALL: &'static str = "transfer_keep_alive"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer the entire transferable balance from the caller account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] - #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] - #[doc = " keep the sender account alive (true)."] - pub struct TransferAll { - pub dest: transfer_all::Dest, - pub keep_alive: transfer_all::KeepAlive, - } - pub mod transfer_all { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type KeepAlive = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAll { - const PALLET: &'static str = "NisCounterpartBalances"; - const CALL: &'static str = "transfer_all"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Unreserve some balance from a user by force."] - #[doc = ""] - #[doc = "Can only be called by ROOT."] - pub struct ForceUnreserve { - pub who: force_unreserve::Who, - pub amount: force_unreserve::Amount, - } - pub mod force_unreserve { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceUnreserve { - const PALLET: &'static str = "NisCounterpartBalances"; - const CALL: &'static str = "force_unreserve"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Upgrade a specified account."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed`."] - #[doc = "- `who`: The account to be upgraded."] - #[doc = ""] - #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] - #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] - #[doc = "possibility of churn)."] - pub struct UpgradeAccounts { - pub who: upgrade_accounts::Who, - } - pub mod upgrade_accounts { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UpgradeAccounts { - const PALLET: &'static str = "NisCounterpartBalances"; - const CALL: &'static str = "upgrade_accounts"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the regular balance of a given account."] - #[doc = ""] - #[doc = "The dispatch origin for this call is `root`."] - pub struct ForceSetBalance { - pub who: force_set_balance::Who, - #[codec(compact)] - pub new_free: force_set_balance::NewFree, - } - pub mod force_set_balance { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type NewFree = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetBalance { - const PALLET: &'static str = "NisCounterpartBalances"; - const CALL: &'static str = "force_set_balance"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Adjust the total issuance in a saturating way."] - #[doc = ""] - #[doc = "Can only be called by root and always needs a positive `delta`."] - #[doc = ""] - #[doc = "# Example"] - pub struct ForceAdjustTotalIssuance { - pub direction: force_adjust_total_issuance::Direction, - #[codec(compact)] - pub delta: force_adjust_total_issuance::Delta, - } - pub mod force_adjust_total_issuance { - use super::runtime_types; - pub type Direction = runtime_types::pallet_balances::types::AdjustmentDirection; - pub type Delta = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceAdjustTotalIssuance { - const PALLET: &'static str = "NisCounterpartBalances"; - const CALL: &'static str = "force_adjust_total_issuance"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Burn the specified liquid free balance from the origin account."] - #[doc = ""] - #[doc = "If the origin's account ends up below the existential deposit as a result"] - #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] - #[doc = ""] - #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] - #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] - pub struct Burn { - #[codec(compact)] - pub value: burn::Value, - pub keep_alive: burn::KeepAlive, - } - pub mod burn { - use super::runtime_types; - pub type Value = ::core::primitive::u128; - pub type KeepAlive = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Burn { - const PALLET: &'static str = "NisCounterpartBalances"; - const CALL: &'static str = "burn"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Transfer some liquid free balance to another account."] - #[doc = ""] - #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] - #[doc = "If the sender's account is below the existential deposit as a result"] - #[doc = "of the transfer, the account will be reaped."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] - pub fn transfer_allow_death( - &self, - dest: types::transfer_allow_death::Dest, - value: types::transfer_allow_death::Value, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "NisCounterpartBalances", - "transfer_allow_death", - types::TransferAllowDeath { dest, value }, - [ - 51u8, 166u8, 195u8, 10u8, 139u8, 218u8, 55u8, 130u8, 6u8, 194u8, 35u8, - 140u8, 27u8, 205u8, 214u8, 222u8, 102u8, 43u8, 143u8, 145u8, 86u8, - 219u8, 210u8, 147u8, 13u8, 39u8, 51u8, 21u8, 237u8, 179u8, 132u8, - 130u8, - ], - ) - } - #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] - #[doc = "may be specified."] - pub fn force_transfer( - &self, - source: types::force_transfer::Source, - dest: types::force_transfer::Dest, - value: types::force_transfer::Value, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "NisCounterpartBalances", - "force_transfer", - types::ForceTransfer { - source, - dest, - value, - }, - [ - 154u8, 93u8, 222u8, 27u8, 12u8, 248u8, 63u8, 213u8, 224u8, 86u8, 250u8, - 153u8, 249u8, 102u8, 83u8, 160u8, 79u8, 125u8, 105u8, 222u8, 77u8, - 180u8, 90u8, 105u8, 81u8, 217u8, 60u8, 25u8, 213u8, 51u8, 185u8, 96u8, - ], - ) - } - #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] - #[doc = "kill the origin account."] - #[doc = ""] - #[doc = "99% of the time you want [`transfer_allow_death`] instead."] - #[doc = ""] - #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] - pub fn transfer_keep_alive( - &self, - dest: types::transfer_keep_alive::Dest, - value: types::transfer_keep_alive::Value, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "NisCounterpartBalances", - "transfer_keep_alive", - types::TransferKeepAlive { dest, value }, - [ - 245u8, 14u8, 190u8, 193u8, 32u8, 210u8, 74u8, 92u8, 25u8, 182u8, 76u8, - 55u8, 247u8, 83u8, 114u8, 75u8, 143u8, 236u8, 117u8, 25u8, 54u8, 157u8, - 208u8, 207u8, 233u8, 89u8, 70u8, 161u8, 235u8, 242u8, 222u8, 59u8, - ], - ) - } - #[doc = "Transfer the entire transferable balance from the caller account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] - #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] - #[doc = " keep the sender account alive (true)."] - pub fn transfer_all( - &self, - dest: types::transfer_all::Dest, - keep_alive: types::transfer_all::KeepAlive, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "NisCounterpartBalances", - "transfer_all", - types::TransferAll { dest, keep_alive }, - [ - 105u8, 132u8, 49u8, 144u8, 195u8, 250u8, 34u8, 46u8, 213u8, 248u8, - 112u8, 188u8, 81u8, 228u8, 136u8, 18u8, 67u8, 172u8, 37u8, 38u8, 238u8, - 9u8, 34u8, 15u8, 67u8, 34u8, 148u8, 195u8, 223u8, 29u8, 154u8, 6u8, - ], - ) - } - #[doc = "Unreserve some balance from a user by force."] - #[doc = ""] - #[doc = "Can only be called by ROOT."] - pub fn force_unreserve( - &self, - who: types::force_unreserve::Who, - amount: types::force_unreserve::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "NisCounterpartBalances", - "force_unreserve", - types::ForceUnreserve { who, amount }, - [ - 142u8, 151u8, 64u8, 205u8, 46u8, 64u8, 62u8, 122u8, 108u8, 49u8, 223u8, - 140u8, 120u8, 153u8, 35u8, 165u8, 187u8, 38u8, 157u8, 200u8, 123u8, - 199u8, 198u8, 168u8, 208u8, 159u8, 39u8, 134u8, 92u8, 103u8, 84u8, - 171u8, - ], - ) - } - #[doc = "Upgrade a specified account."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed`."] - #[doc = "- `who`: The account to be upgraded."] - #[doc = ""] - #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] - #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] - #[doc = "possibility of churn)."] - pub fn upgrade_accounts( - &self, - who: types::upgrade_accounts::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "NisCounterpartBalances", - "upgrade_accounts", - types::UpgradeAccounts { who }, - [ - 66u8, 200u8, 179u8, 104u8, 65u8, 2u8, 101u8, 56u8, 130u8, 161u8, 224u8, - 233u8, 255u8, 124u8, 70u8, 122u8, 8u8, 49u8, 103u8, 178u8, 68u8, 47u8, - 214u8, 166u8, 217u8, 116u8, 178u8, 50u8, 212u8, 164u8, 98u8, 226u8, - ], - ) - } - #[doc = "Set the regular balance of a given account."] - #[doc = ""] - #[doc = "The dispatch origin for this call is `root`."] - pub fn force_set_balance( - &self, - who: types::force_set_balance::Who, - new_free: types::force_set_balance::NewFree, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "NisCounterpartBalances", - "force_set_balance", - types::ForceSetBalance { who, new_free }, - [ - 114u8, 229u8, 59u8, 204u8, 180u8, 83u8, 17u8, 4u8, 59u8, 4u8, 55u8, - 39u8, 151u8, 196u8, 124u8, 60u8, 209u8, 65u8, 193u8, 11u8, 44u8, 164u8, - 116u8, 93u8, 169u8, 30u8, 199u8, 165u8, 55u8, 231u8, 223u8, 43u8, - ], - ) - } - #[doc = "Adjust the total issuance in a saturating way."] - #[doc = ""] - #[doc = "Can only be called by root and always needs a positive `delta`."] - #[doc = ""] - #[doc = "# Example"] - pub fn force_adjust_total_issuance( - &self, - direction: types::force_adjust_total_issuance::Direction, - delta: types::force_adjust_total_issuance::Delta, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceAdjustTotalIssuance, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "NisCounterpartBalances", - "force_adjust_total_issuance", - types::ForceAdjustTotalIssuance { direction, delta }, - [ - 208u8, 134u8, 56u8, 133u8, 232u8, 164u8, 10u8, 213u8, 53u8, 193u8, - 190u8, 63u8, 236u8, 186u8, 96u8, 122u8, 104u8, 87u8, 173u8, 38u8, 58u8, - 176u8, 21u8, 78u8, 42u8, 106u8, 46u8, 248u8, 251u8, 190u8, 150u8, - 202u8, - ], - ) - } - #[doc = "Burn the specified liquid free balance from the origin account."] - #[doc = ""] - #[doc = "If the origin's account ends up below the existential deposit as a result"] - #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] - #[doc = ""] - #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] - #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] - pub fn burn( - &self, - value: types::burn::Value, - keep_alive: types::burn::KeepAlive, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "NisCounterpartBalances", - "burn", - types::Burn { value, keep_alive }, - [ - 176u8, 64u8, 7u8, 109u8, 16u8, 44u8, 145u8, 125u8, 147u8, 152u8, 130u8, - 114u8, 221u8, 201u8, 150u8, 162u8, 118u8, 71u8, 52u8, 92u8, 240u8, - 116u8, 203u8, 98u8, 5u8, 22u8, 43u8, 102u8, 94u8, 208u8, 101u8, 57u8, - ], - ) - } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_balances::pallet::Event; - pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An account was created with some free balance."] - pub struct Endowed { - pub account: endowed::Account, - pub free_balance: endowed::FreeBalance, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + pub struct TransferAllowDeath { + pub dest: transfer_allow_death::Dest, + #[codec(compact)] + pub value: transfer_allow_death::Value, } - pub mod endowed { + pub mod transfer_allow_death { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - pub type FreeBalance = ::core::primitive::u128; + pub type Dest = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Value = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Endowed { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Endowed"; + impl TransferAllowDeath { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const CALL_NAME: &'static str = "transfer_allow_death"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for TransferAllowDeath { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] - #[doc = "resulting in an outright loss."] - pub struct DustLost { - pub account: dust_lost::Account, - pub amount: dust_lost::Amount, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] + #[doc = "may be specified."] + pub struct ForceTransfer { + pub source: force_transfer::Source, + pub dest: force_transfer::Dest, + #[codec(compact)] + pub value: force_transfer::Value, } - pub mod dust_lost { + pub mod force_transfer { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type Source = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Dest = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Value = ::core::primitive::u128; + } + impl ForceTransfer { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const CALL_NAME: &'static str = "force_transfer"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DustLost { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "DustLost"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceTransfer { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Transfer succeeded."] - pub struct Transfer { - pub from: transfer::From, - pub to: transfer::To, - pub amount: transfer::Amount, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] + #[doc = "kill the origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer_allow_death`] instead."] + #[doc = ""] + #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] + pub struct TransferKeepAlive { + pub dest: transfer_keep_alive::Dest, + #[codec(compact)] + pub value: transfer_keep_alive::Value, } - pub mod transfer { + pub mod transfer_keep_alive { use super::runtime_types; - pub type From = ::subxt::ext::subxt_core::utils::AccountId32; - pub type To = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type Dest = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Value = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Transfer { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Transfer"; + impl TransferKeepAlive { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const CALL_NAME: &'static str = "transfer_keep_alive"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for TransferKeepAlive { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A balance was set by root."] - pub struct BalanceSet { - pub who: balance_set::Who, - pub free: balance_set::Free, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true)."] + pub struct TransferAll { + pub dest: transfer_all::Dest, + pub keep_alive: transfer_all::KeepAlive, } - pub mod balance_set { + pub mod transfer_all { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Free = ::core::primitive::u128; + pub type Dest = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type KeepAlive = ::core::primitive::bool; + } + impl TransferAll { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const CALL_NAME: &'static str = "transfer_all"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BalanceSet { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "BalanceSet"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for TransferAll { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some balance was reserved (moved from free to reserved)."] - pub struct Reserved { - pub who: reserved::Who, - pub amount: reserved::Amount, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + pub struct ForceUnreserve { + pub who: force_unreserve::Who, + pub amount: force_unreserve::Amount, } - pub mod reserved { + pub mod force_unreserve { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Reserved { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Reserved"; + impl ForceUnreserve { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const CALL_NAME: &'static str = "force_unreserve"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceUnreserve { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some balance was unreserved (moved from reserved to free)."] - pub struct Unreserved { - pub who: unreserved::Who, - pub amount: unreserved::Amount, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Upgrade a specified account."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `who`: The account to be upgraded."] + #[doc = ""] + #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] + #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] + #[doc = "possibility of churn)."] + pub struct UpgradeAccounts { + pub who: upgrade_accounts::Who, } - pub mod unreserved { + pub mod upgrade_accounts { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type Who = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + } + impl UpgradeAccounts { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const CALL_NAME: &'static str = "upgrade_accounts"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Unreserved { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Unreserved"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for UpgradeAccounts { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some balance was moved from the reserve of the first account to the second account."] - #[doc = "Final argument indicates the destination balance type."] - pub struct ReserveRepatriated { - pub from: reserve_repatriated::From, - pub to: reserve_repatriated::To, - pub amount: reserve_repatriated::Amount, - pub destination_status: reserve_repatriated::DestinationStatus, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the regular balance of a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + pub struct ForceSetBalance { + pub who: force_set_balance::Who, + #[codec(compact)] + pub new_free: force_set_balance::NewFree, } - pub mod reserve_repatriated { + pub mod force_set_balance { use super::runtime_types; - pub type From = ::subxt::ext::subxt_core::utils::AccountId32; - pub type To = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - pub type DestinationStatus = - runtime_types::frame_support::traits::tokens::misc::BalanceStatus; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type NewFree = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ReserveRepatriated { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "ReserveRepatriated"; + impl ForceSetBalance { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const CALL_NAME: &'static str = "force_set_balance"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceSetBalance { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some amount was deposited (e.g. for transaction fees)."] - pub struct Deposit { - pub who: deposit::Who, - pub amount: deposit::Amount, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Adjust the total issuance in a saturating way."] + #[doc = ""] + #[doc = "Can only be called by root and always needs a positive `delta`."] + #[doc = ""] + #[doc = "# Example"] + pub struct ForceAdjustTotalIssuance { + pub direction: force_adjust_total_issuance::Direction, + #[codec(compact)] + pub delta: force_adjust_total_issuance::Delta, } - pub mod deposit { + pub mod force_adjust_total_issuance { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type Direction = runtime_types::pallet_balances::types::AdjustmentDirection; + pub type Delta = ::core::primitive::u128; + } + impl ForceAdjustTotalIssuance { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const CALL_NAME: &'static str = "force_adjust_total_issuance"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Deposit { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Deposit"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceAdjustTotalIssuance { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] - pub struct Withdraw { - pub who: withdraw::Who, - pub amount: withdraw::Amount, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Burn the specified liquid free balance from the origin account."] + #[doc = ""] + #[doc = "If the origin's account ends up below the existential deposit as a result"] + #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] + #[doc = ""] + #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] + #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] + pub struct Burn { + #[codec(compact)] + pub value: burn::Value, + pub keep_alive: burn::KeepAlive, + } + pub mod burn { + use super::runtime_types; + pub type Value = ::core::primitive::u128; + pub type KeepAlive = ::core::primitive::bool; + } + impl Burn { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const CALL_NAME: &'static str = "burn"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Burn { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + pub fn transfer_allow_death( + &self, + dest: super::transfer_allow_death::Dest, + value: super::transfer_allow_death::Value, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "NisCounterpartBalances", + "transfer_allow_death", + super::TransferAllowDeath { dest, value }, + [ + 51u8, 166u8, 195u8, 10u8, 139u8, 218u8, 55u8, 130u8, 6u8, 194u8, + 35u8, 140u8, 27u8, 205u8, 214u8, 222u8, 102u8, 43u8, 143u8, 145u8, + 86u8, 219u8, 210u8, 147u8, 13u8, 39u8, 51u8, 21u8, 237u8, 179u8, + 132u8, 130u8, + ], + ) + } + #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] + #[doc = "may be specified."] + pub fn force_transfer( + &self, + source: super::force_transfer::Source, + dest: super::force_transfer::Dest, + value: super::force_transfer::Value, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "NisCounterpartBalances", + "force_transfer", + super::ForceTransfer { + source, + dest, + value, + }, + [ + 154u8, 93u8, 222u8, 27u8, 12u8, 248u8, 63u8, 213u8, 224u8, 86u8, + 250u8, 153u8, 249u8, 102u8, 83u8, 160u8, 79u8, 125u8, 105u8, 222u8, + 77u8, 180u8, 90u8, 105u8, 81u8, 217u8, 60u8, 25u8, 213u8, 51u8, + 185u8, 96u8, + ], + ) + } + #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] + #[doc = "kill the origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer_allow_death`] instead."] + #[doc = ""] + #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] + pub fn transfer_keep_alive( + &self, + dest: super::transfer_keep_alive::Dest, + value: super::transfer_keep_alive::Value, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "NisCounterpartBalances", + "transfer_keep_alive", + super::TransferKeepAlive { dest, value }, + [ + 245u8, 14u8, 190u8, 193u8, 32u8, 210u8, 74u8, 92u8, 25u8, 182u8, + 76u8, 55u8, 247u8, 83u8, 114u8, 75u8, 143u8, 236u8, 117u8, 25u8, + 54u8, 157u8, 208u8, 207u8, 233u8, 89u8, 70u8, 161u8, 235u8, 242u8, + 222u8, 59u8, + ], + ) + } + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true)."] + pub fn transfer_all( + &self, + dest: super::transfer_all::Dest, + keep_alive: super::transfer_all::KeepAlive, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "NisCounterpartBalances", + "transfer_all", + super::TransferAll { dest, keep_alive }, + [ + 105u8, 132u8, 49u8, 144u8, 195u8, 250u8, 34u8, 46u8, 213u8, 248u8, + 112u8, 188u8, 81u8, 228u8, 136u8, 18u8, 67u8, 172u8, 37u8, 38u8, + 238u8, 9u8, 34u8, 15u8, 67u8, 34u8, 148u8, 195u8, 223u8, 29u8, + 154u8, 6u8, + ], + ) + } + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + pub fn force_unreserve( + &self, + who: super::force_unreserve::Who, + amount: super::force_unreserve::Amount, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "NisCounterpartBalances", + "force_unreserve", + super::ForceUnreserve { who, amount }, + [ + 142u8, 151u8, 64u8, 205u8, 46u8, 64u8, 62u8, 122u8, 108u8, 49u8, + 223u8, 140u8, 120u8, 153u8, 35u8, 165u8, 187u8, 38u8, 157u8, 200u8, + 123u8, 199u8, 198u8, 168u8, 208u8, 159u8, 39u8, 134u8, 92u8, 103u8, + 84u8, 171u8, + ], + ) + } + #[doc = "Upgrade a specified account."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `who`: The account to be upgraded."] + #[doc = ""] + #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] + #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] + #[doc = "possibility of churn)."] + pub fn upgrade_accounts( + &self, + who: super::upgrade_accounts::Who, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "NisCounterpartBalances", + "upgrade_accounts", + super::UpgradeAccounts { who }, + [ + 66u8, 200u8, 179u8, 104u8, 65u8, 2u8, 101u8, 56u8, 130u8, 161u8, + 224u8, 233u8, 255u8, 124u8, 70u8, 122u8, 8u8, 49u8, 103u8, 178u8, + 68u8, 47u8, 214u8, 166u8, 217u8, 116u8, 178u8, 50u8, 212u8, 164u8, + 98u8, 226u8, + ], + ) + } + #[doc = "Set the regular balance of a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + pub fn force_set_balance( + &self, + who: super::force_set_balance::Who, + new_free: super::force_set_balance::NewFree, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "NisCounterpartBalances", + "force_set_balance", + super::ForceSetBalance { who, new_free }, + [ + 114u8, 229u8, 59u8, 204u8, 180u8, 83u8, 17u8, 4u8, 59u8, 4u8, 55u8, + 39u8, 151u8, 196u8, 124u8, 60u8, 209u8, 65u8, 193u8, 11u8, 44u8, + 164u8, 116u8, 93u8, 169u8, 30u8, 199u8, 165u8, 55u8, 231u8, 223u8, + 43u8, + ], + ) + } + #[doc = "Adjust the total issuance in a saturating way."] + #[doc = ""] + #[doc = "Can only be called by root and always needs a positive `delta`."] + #[doc = ""] + #[doc = "# Example"] + pub fn force_adjust_total_issuance( + &self, + direction: super::force_adjust_total_issuance::Direction, + delta: super::force_adjust_total_issuance::Delta, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "NisCounterpartBalances", + "force_adjust_total_issuance", + super::ForceAdjustTotalIssuance { direction, delta }, + [ + 208u8, 134u8, 56u8, 133u8, 232u8, 164u8, 10u8, 213u8, 53u8, 193u8, + 190u8, 63u8, 236u8, 186u8, 96u8, 122u8, 104u8, 87u8, 173u8, 38u8, + 58u8, 176u8, 21u8, 78u8, 42u8, 106u8, 46u8, 248u8, 251u8, 190u8, + 150u8, 202u8, + ], + ) + } + #[doc = "Burn the specified liquid free balance from the origin account."] + #[doc = ""] + #[doc = "If the origin's account ends up below the existential deposit as a result"] + #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] + #[doc = ""] + #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] + #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] + pub fn burn( + &self, + value: super::burn::Value, + keep_alive: super::burn::KeepAlive, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "NisCounterpartBalances", + "burn", + super::Burn { value, keep_alive }, + [ + 176u8, 64u8, 7u8, 109u8, 16u8, 44u8, 145u8, 125u8, 147u8, 152u8, + 130u8, 114u8, 221u8, 201u8, 150u8, 162u8, 118u8, 71u8, 52u8, 92u8, + 240u8, 116u8, 203u8, 98u8, 5u8, 22u8, 43u8, 102u8, 94u8, 208u8, + 101u8, 57u8, + ], + ) + } + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_balances::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "An account was created with some free balance."] + pub struct Endowed { + pub account: endowed::Account, + pub free_balance: endowed::FreeBalance, + } + pub mod endowed { + use super::runtime_types; + pub type Account = ::subxt::utils::AccountId32; + pub type FreeBalance = ::core::primitive::u128; + } + impl Endowed { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Endowed"; + } + impl ::subxt::events::DecodeAsEvent for Endowed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] + #[doc = "resulting in an outright loss."] + pub struct DustLost { + pub account: dust_lost::Account, + pub amount: dust_lost::Amount, + } + pub mod dust_lost { + use super::runtime_types; + pub type Account = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl DustLost { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "DustLost"; + } + impl ::subxt::events::DecodeAsEvent for DustLost { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transfer succeeded."] + pub struct Transfer { + pub from: transfer::From, + pub to: transfer::To, + pub amount: transfer::Amount, + } + pub mod transfer { + use super::runtime_types; + pub type From = ::subxt::utils::AccountId32; + pub type To = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl Transfer { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Transfer"; + } + impl ::subxt::events::DecodeAsEvent for Transfer { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A balance was set by root."] + pub struct BalanceSet { + pub who: balance_set::Who, + pub free: balance_set::Free, + } + pub mod balance_set { + use super::runtime_types; + pub type Who = ::subxt::utils::AccountId32; + pub type Free = ::core::primitive::u128; + } + impl BalanceSet { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "BalanceSet"; + } + impl ::subxt::events::DecodeAsEvent for BalanceSet { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Some balance was reserved (moved from free to reserved)."] + pub struct Reserved { + pub who: reserved::Who, + pub amount: reserved::Amount, + } + pub mod reserved { + use super::runtime_types; + pub type Who = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl Reserved { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Reserved"; + } + impl ::subxt::events::DecodeAsEvent for Reserved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Some balance was unreserved (moved from reserved to free)."] + pub struct Unreserved { + pub who: unreserved::Who, + pub amount: unreserved::Amount, + } + pub mod unreserved { + use super::runtime_types; + pub type Who = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl Unreserved { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Unreserved"; + } + impl ::subxt::events::DecodeAsEvent for Unreserved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Some balance was moved from the reserve of the first account to the second account."] + #[doc = "Final argument indicates the destination balance type."] + pub struct ReserveRepatriated { + pub from: reserve_repatriated::From, + pub to: reserve_repatriated::To, + pub amount: reserve_repatriated::Amount, + pub destination_status: reserve_repatriated::DestinationStatus, + } + pub mod reserve_repatriated { + use super::runtime_types; + pub type From = ::subxt::utils::AccountId32; + pub type To = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + pub type DestinationStatus = + runtime_types::frame_support::traits::tokens::misc::BalanceStatus; + } + impl ReserveRepatriated { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "ReserveRepatriated"; + } + impl ::subxt::events::DecodeAsEvent for ReserveRepatriated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Some amount was deposited (e.g. for transaction fees)."] + pub struct Deposit { + pub who: deposit::Who, + pub amount: deposit::Amount, + } + pub mod deposit { + use super::runtime_types; + pub type Who = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl Deposit { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Deposit"; + } + impl ::subxt::events::DecodeAsEvent for Deposit { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] + pub struct Withdraw { + pub who: withdraw::Who, + pub amount: withdraw::Amount, } pub mod withdraw { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Withdraw { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Withdraw"; + impl Withdraw { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Withdraw"; + } + impl ::subxt::events::DecodeAsEvent for Withdraw { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] pub struct Slashed { pub who: slashed::Who, @@ -30248,20 +30867,25 @@ pub mod api { } pub mod slashed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Slashed { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Slashed"; + impl Slashed { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Slashed"; + } + impl ::subxt::events::DecodeAsEvent for Slashed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was minted into an account."] pub struct Minted { pub who: minted::Who, @@ -30269,20 +30893,25 @@ pub mod api { } pub mod minted { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Minted { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Minted"; + impl Minted { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Minted"; + } + impl ::subxt::events::DecodeAsEvent for Minted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some credit was balanced and added to the TotalIssuance."] pub struct MintedCredit { pub amount: minted_credit::Amount, @@ -30291,17 +30920,22 @@ pub mod api { use super::runtime_types; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MintedCredit { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "MintedCredit"; + impl MintedCredit { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "MintedCredit"; + } + impl ::subxt::events::DecodeAsEvent for MintedCredit { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was burned from an account."] pub struct Burned { pub who: burned::Who, @@ -30309,20 +30943,25 @@ pub mod api { } pub mod burned { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Burned"; + impl Burned { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Burned"; + } + impl ::subxt::events::DecodeAsEvent for Burned { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some debt has been dropped from the Total Issuance."] pub struct BurnedDebt { pub amount: burned_debt::Amount, @@ -30331,17 +30970,22 @@ pub mod api { use super::runtime_types; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BurnedDebt { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "BurnedDebt"; + impl BurnedDebt { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "BurnedDebt"; + } + impl ::subxt::events::DecodeAsEvent for BurnedDebt { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was suspended from an account (it can be restored later)."] pub struct Suspended { pub who: suspended::Who, @@ -30349,20 +30993,25 @@ pub mod api { } pub mod suspended { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Suspended { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Suspended"; + impl Suspended { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Suspended"; + } + impl ::subxt::events::DecodeAsEvent for Suspended { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some amount was restored into an account."] pub struct Restored { pub who: restored::Who, @@ -30370,39 +31019,49 @@ pub mod api { } pub mod restored { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Restored { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Restored"; + impl Restored { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Restored"; + } + impl ::subxt::events::DecodeAsEvent for Restored { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An account was upgraded."] pub struct Upgraded { pub who: upgraded::Who, } pub mod upgraded { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; + } + impl Upgraded { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Upgraded"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Upgraded { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Upgraded"; + impl ::subxt::events::DecodeAsEvent for Upgraded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Total issuance was increased by `amount`, creating a credit to be balanced."] pub struct Issued { pub amount: issued::Amount, @@ -30411,17 +31070,22 @@ pub mod api { use super::runtime_types; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Issued { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Issued"; + impl Issued { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Issued"; + } + impl ::subxt::events::DecodeAsEvent for Issued { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Total issuance was decreased by `amount`, creating a debt to be balanced."] pub struct Rescinded { pub amount: rescinded::Amount, @@ -30430,17 +31094,22 @@ pub mod api { use super::runtime_types; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rescinded { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Rescinded"; + impl Rescinded { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Rescinded"; + } + impl ::subxt::events::DecodeAsEvent for Rescinded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was locked."] pub struct Locked { pub who: locked::Who, @@ -30448,20 +31117,25 @@ pub mod api { } pub mod locked { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Locked { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Locked"; + impl Locked { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Locked"; + } + impl ::subxt::events::DecodeAsEvent for Locked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was unlocked."] pub struct Unlocked { pub who: unlocked::Who, @@ -30469,20 +31143,25 @@ pub mod api { } pub mod unlocked { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Unlocked { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Unlocked"; + impl Unlocked { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Unlocked"; + } + impl ::subxt::events::DecodeAsEvent for Unlocked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was frozen."] pub struct Frozen { pub who: frozen::Who, @@ -30490,20 +31169,25 @@ pub mod api { } pub mod frozen { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Frozen { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Frozen"; + impl Frozen { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Frozen"; + } + impl ::subxt::events::DecodeAsEvent for Frozen { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was thawed."] pub struct Thawed { pub who: thawed::Who, @@ -30511,20 +31195,25 @@ pub mod api { } pub mod thawed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Thawed { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Thawed"; + impl Thawed { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Thawed"; + } + impl ::subxt::events::DecodeAsEvent for Thawed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `TotalIssuance` was forcefully changed."] pub struct TotalIssuanceForced { pub old: total_issuance_forced::Old, @@ -30535,17 +31224,22 @@ pub mod api { pub type Old = ::core::primitive::u128; pub type New = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TotalIssuanceForced { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "TotalIssuanceForced"; + impl TotalIssuanceForced { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "TotalIssuanceForced"; + } + impl ::subxt::events::DecodeAsEvent for TotalIssuanceForced { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some balance was placed on hold."] pub struct Held { pub reason: held::Reason, @@ -30555,20 +31249,25 @@ pub mod api { pub mod held { use super::runtime_types; pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Held { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Held"; + impl Held { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Held"; + } + impl ::subxt::events::DecodeAsEvent for Held { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Held balance was burned from an account."] pub struct BurnedHeld { pub reason: burned_held::Reason, @@ -30578,2380 +31277,2429 @@ pub mod api { pub mod burned_held { use super::runtime_types; pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for BurnedHeld { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "BurnedHeld"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A transfer of `amount` on hold from `source` to `dest` was initiated."] - pub struct TransferOnHold { - pub reason: transfer_on_hold::Reason, - pub source: transfer_on_hold::Source, - pub dest: transfer_on_hold::Dest, - pub amount: transfer_on_hold::Amount, - } - pub mod transfer_on_hold { - use super::runtime_types; - pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; - pub type Source = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Dest = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransferOnHold { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "TransferOnHold"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The `transferred` balance is placed on hold at the `dest` account."] - pub struct TransferAndHold { - pub reason: transfer_and_hold::Reason, - pub source: transfer_and_hold::Source, - pub dest: transfer_and_hold::Dest, - pub transferred: transfer_and_hold::Transferred, - } - pub mod transfer_and_hold { - use super::runtime_types; - pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; - pub type Source = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Dest = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Transferred = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransferAndHold { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "TransferAndHold"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some balance was released from hold."] - pub struct Released { - pub reason: released::Reason, - pub who: released::Who, - pub amount: released::Amount, - } - pub mod released { - use super::runtime_types; - pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Released { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Released"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An unexpected/defensive event was triggered."] - pub struct Unexpected(pub unexpected::Field0); - pub mod unexpected { - use super::runtime_types; - pub type Field0 = runtime_types::pallet_balances::pallet::UnexpectedKind; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Unexpected { - const PALLET: &'static str = "NisCounterpartBalances"; - const EVENT: &'static str = "Unexpected"; - } - } - pub mod storage { - use super::root_mod; - use super::runtime_types; - pub struct StorageApi; - impl StorageApi { - #[doc = " The total units issued in the system."] - pub fn total_issuance( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - total_issuance::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "TotalIssuance", - [ - 138u8, 120u8, 138u8, 119u8, 4u8, 166u8, 22u8, 216u8, 227u8, 249u8, - 161u8, 193u8, 54u8, 68u8, 55u8, 74u8, 230u8, 68u8, 131u8, 253u8, 146u8, - 73u8, 54u8, 85u8, 212u8, 83u8, 162u8, 188u8, 171u8, 5u8, 232u8, 21u8, - ], - ) - } - #[doc = " The total units of outstanding deactivated balance in the system."] - pub fn inactive_issuance( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - inactive_issuance::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "InactiveIssuance", - [ - 97u8, 194u8, 82u8, 3u8, 40u8, 108u8, 109u8, 245u8, 175u8, 189u8, 212u8, - 193u8, 229u8, 82u8, 107u8, 169u8, 9u8, 176u8, 124u8, 102u8, 151u8, - 98u8, 87u8, 194u8, 82u8, 130u8, 41u8, 137u8, 3u8, 230u8, 145u8, 58u8, - ], - ) - } - #[doc = " The Balances pallet example of storing the balance of an account."] - #[doc = ""] - #[doc = " # Example"] - #[doc = ""] - #[doc = " ```nocompile"] - #[doc = " impl pallet_balances::Config for Runtime {"] - #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] - #[doc = " }"] - #[doc = " ```"] - #[doc = ""] - #[doc = " You can also store the balance of an account in the `System` pallet."] - #[doc = ""] - #[doc = " # Example"] - #[doc = ""] - #[doc = " ```nocompile"] - #[doc = " impl pallet_balances::Config for Runtime {"] - #[doc = " type AccountStore = System"] - #[doc = " }"] - #[doc = " ```"] - #[doc = ""] - #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] - #[doc = " `frame_system` data alongside the account data contrary to storing account balances in the"] - #[doc = " `Balances` pallet, which uses a `StorageMap` to store balances data only."] - #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] - pub fn account( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (account::Param0,), - account::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "Account", - [ - 14u8, 88u8, 174u8, 192u8, 241u8, 142u8, 159u8, 255u8, 178u8, 117u8, - 55u8, 78u8, 218u8, 161u8, 146u8, 139u8, 170u8, 180u8, 187u8, 177u8, - 89u8, 157u8, 91u8, 225u8, 90u8, 174u8, 247u8, 47u8, 47u8, 23u8, 234u8, - 50u8, - ], - ) - } - #[doc = " Any liquidity locks on some account balances."] - #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] - #[doc = ""] - #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] - pub fn locks( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (locks::Param0,), - locks::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "Locks", - [ - 201u8, 50u8, 65u8, 126u8, 43u8, 153u8, 207u8, 145u8, 240u8, 59u8, - 160u8, 111u8, 144u8, 245u8, 193u8, 13u8, 227u8, 118u8, 72u8, 168u8, - 37u8, 147u8, 139u8, 221u8, 36u8, 177u8, 202u8, 209u8, 152u8, 122u8, - 250u8, 89u8, - ], - ) - } - #[doc = " Named reserves on some account balances."] - #[doc = ""] - #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] - pub fn reserves( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (reserves::Param0,), - reserves::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "Reserves", - [ - 76u8, 220u8, 133u8, 100u8, 127u8, 174u8, 237u8, 103u8, 211u8, 104u8, - 140u8, 100u8, 49u8, 169u8, 114u8, 112u8, 193u8, 115u8, 234u8, 160u8, - 97u8, 104u8, 194u8, 47u8, 119u8, 136u8, 132u8, 196u8, 136u8, 121u8, - 45u8, 161u8, - ], - ) - } - #[doc = " Holds on account balances."] - pub fn holds( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (holds::Param0,), - holds::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "Holds", - [ - 243u8, 190u8, 61u8, 27u8, 177u8, 143u8, 74u8, 255u8, 22u8, 109u8, - 167u8, 85u8, 179u8, 42u8, 42u8, 37u8, 8u8, 190u8, 38u8, 60u8, 158u8, - 138u8, 66u8, 201u8, 131u8, 136u8, 85u8, 160u8, 98u8, 110u8, 33u8, 50u8, - ], - ) - } - #[doc = " Freeze locks on account balances."] - pub fn freezes( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (freezes::Param0,), - freezes::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "Freezes", - [ - 41u8, 196u8, 69u8, 26u8, 201u8, 141u8, 252u8, 255u8, 78u8, 216u8, - 102u8, 207u8, 133u8, 185u8, 86u8, 18u8, 79u8, 137u8, 132u8, 92u8, - 228u8, 237u8, 91u8, 125u8, 25u8, 111u8, 127u8, 212u8, 215u8, 114u8, - 219u8, 72u8, - ], - ) - } - } - pub mod total_issuance { - use super::root_mod; - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u128; - } - } - pub mod inactive_issuance { - use super::root_mod; - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u128; - } - } - pub mod account { - use super::root_mod; - use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { - use super::runtime_types; - pub type Output = - runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>; - } - } - pub mod locks { - use super::root_mod; - use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { - use super::runtime_types; - pub type Output = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< - runtime_types::pallet_balances::types::BalanceLock< - ::core::primitive::u128, - >, - >; - } - } - pub mod reserves { - use super::root_mod; - use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_balances::types::ReserveData< - [::core::primitive::u8; 8usize], - ::core::primitive::u128, - >, - >; - } - } - pub mod holds { - use super::root_mod; - use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::frame_support::traits::tokens::misc::IdAmount< - runtime_types::rococo_runtime::RuntimeHoldReason, - ::core::primitive::u128, - >, - >; - } - } - pub mod freezes { - use super::root_mod; - use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::frame_support::traits::tokens::misc::IdAmount< - (), - ::core::primitive::u128, - >, - >; - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO!"] - #[doc = ""] - #[doc = " If you *really* need it to be zero, you can enable the feature `insecure_zero_ed` for"] - #[doc = " this pallet. However, you do so at your own risk: this will open up a major DoS vector."] - #[doc = " In case you have multiple sources of provider references, you may also get unexpected"] - #[doc = " behaviour if you set this to zero."] - #[doc = ""] - #[doc = " Bottom line: Do yourself a favour and make it at least one!"] - pub fn existential_deposit( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "NisCounterpartBalances", - "ExistentialDeposit", - [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ], - ) - } - #[doc = " The maximum number of locks that should exist on an account."] - #[doc = " Not strictly enforced, but used for weight estimation."] - #[doc = ""] - #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] - pub fn max_locks( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "NisCounterpartBalances", - "MaxLocks", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The maximum number of named reserves that can exist on an account."] - #[doc = ""] - #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] - pub fn max_reserves( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "NisCounterpartBalances", - "MaxReserves", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The maximum number of individual freeze locks that can exist on an account at any time."] - pub fn max_freezes( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "NisCounterpartBalances", - "MaxFreezes", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - } - } - } - pub mod parachains_origin { - use super::root_mod; - use super::runtime_types; - } - pub mod configuration { - use super::root_mod; - use super::runtime_types; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::polkadot_runtime_parachains::configuration::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::polkadot_runtime_parachains::configuration::pallet::Call; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the validation upgrade cooldown."] - pub struct SetValidationUpgradeCooldown { - pub new: set_validation_upgrade_cooldown::New, - } - pub mod set_validation_upgrade_cooldown { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetValidationUpgradeCooldown { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_validation_upgrade_cooldown"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the validation upgrade delay."] - pub struct SetValidationUpgradeDelay { - pub new: set_validation_upgrade_delay::New, - } - pub mod set_validation_upgrade_delay { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetValidationUpgradeDelay { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_validation_upgrade_delay"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the acceptance period for an included candidate."] - pub struct SetCodeRetentionPeriod { - pub new: set_code_retention_period::New, - } - pub mod set_code_retention_period { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetCodeRetentionPeriod { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_code_retention_period"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the max validation code size for incoming upgrades."] - pub struct SetMaxCodeSize { - pub new: set_max_code_size::New, - } - pub mod set_max_code_size { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxCodeSize { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_max_code_size"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the max POV block size for incoming upgrades."] - pub struct SetMaxPovSize { - pub new: set_max_pov_size::New, - } - pub mod set_max_pov_size { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxPovSize { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_max_pov_size"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the max head data size for paras."] - pub struct SetMaxHeadDataSize { - pub new: set_max_head_data_size::New, - } - pub mod set_max_head_data_size { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxHeadDataSize { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_max_head_data_size"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the number of coretime execution cores."] - #[doc = ""] - #[doc = "NOTE: that this configuration is managed by the coretime chain. Only manually change"] - #[doc = "this, if you really know what you are doing!"] - pub struct SetCoretimeCores { - pub new: set_coretime_cores::New, - } - pub mod set_coretime_cores { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetCoretimeCores { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_coretime_cores"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the parachain validator-group rotation frequency"] - pub struct SetGroupRotationFrequency { - pub new: set_group_rotation_frequency::New, - } - pub mod set_group_rotation_frequency { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetGroupRotationFrequency { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_group_rotation_frequency"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the availability period for paras."] - pub struct SetParasAvailabilityPeriod { - pub new: set_paras_availability_period::New, - } - pub mod set_paras_availability_period { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetParasAvailabilityPeriod { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_paras_availability_period"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] - pub struct SetSchedulingLookahead { - pub new: set_scheduling_lookahead::New, - } - pub mod set_scheduling_lookahead { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetSchedulingLookahead { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_scheduling_lookahead"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the maximum number of validators to assign to any core."] - pub struct SetMaxValidatorsPerCore { - pub new: set_max_validators_per_core::New, - } - pub mod set_max_validators_per_core { - use super::runtime_types; - pub type New = ::core::option::Option<::core::primitive::u32>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxValidatorsPerCore { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_max_validators_per_core"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the maximum number of validators to use in parachain consensus."] - pub struct SetMaxValidators { - pub new: set_max_validators::New, - } - pub mod set_max_validators { - use super::runtime_types; - pub type New = ::core::option::Option<::core::primitive::u32>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxValidators { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_max_validators"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the dispute period, in number of sessions to keep for disputes."] - pub struct SetDisputePeriod { - pub new: set_dispute_period::New, - } - pub mod set_dispute_period { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetDisputePeriod { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_dispute_period"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the dispute post conclusion acceptance period."] - pub struct SetDisputePostConclusionAcceptancePeriod { - pub new: set_dispute_post_conclusion_acceptance_period::New, - } - pub mod set_dispute_post_conclusion_acceptance_period { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic - for SetDisputePostConclusionAcceptancePeriod - { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_dispute_post_conclusion_acceptance_period"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the no show slots, in number of number of consensus slots."] - #[doc = "Must be at least 1."] - pub struct SetNoShowSlots { - pub new: set_no_show_slots::New, - } - pub mod set_no_show_slots { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetNoShowSlots { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_no_show_slots"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the total number of delay tranches."] - pub struct SetNDelayTranches { - pub new: set_n_delay_tranches::New, - } - pub mod set_n_delay_tranches { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetNDelayTranches { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_n_delay_tranches"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the zeroth delay tranche width."] - pub struct SetZerothDelayTrancheWidth { - pub new: set_zeroth_delay_tranche_width::New, - } - pub mod set_zeroth_delay_tranche_width { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetZerothDelayTrancheWidth { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_zeroth_delay_tranche_width"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the number of validators needed to approve a block."] - pub struct SetNeededApprovals { - pub new: set_needed_approvals::New, - } - pub mod set_needed_approvals { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetNeededApprovals { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_needed_approvals"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] - pub struct SetRelayVrfModuloSamples { - pub new: set_relay_vrf_modulo_samples::New, - } - pub mod set_relay_vrf_modulo_samples { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRelayVrfModuloSamples { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_relay_vrf_modulo_samples"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] - pub struct SetMaxUpwardQueueCount { - pub new: set_max_upward_queue_count::New, - } - pub mod set_max_upward_queue_count { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxUpwardQueueCount { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_max_upward_queue_count"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at"] - #[doc = "once."] - pub struct SetMaxUpwardQueueSize { - pub new: set_max_upward_queue_size::New, - } - pub mod set_max_upward_queue_size { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxUpwardQueueSize { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_max_upward_queue_size"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the critical downward message size."] - pub struct SetMaxDownwardMessageSize { - pub new: set_max_downward_message_size::New, - } - pub mod set_max_downward_message_size { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxDownwardMessageSize { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_max_downward_message_size"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] - pub struct SetMaxUpwardMessageSize { - pub new: set_max_upward_message_size::New, - } - pub mod set_max_upward_message_size { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxUpwardMessageSize { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_max_upward_message_size"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the maximum number of messages that a candidate can contain."] - pub struct SetMaxUpwardMessageNumPerCandidate { - pub new: set_max_upward_message_num_per_candidate::New, - } - pub mod set_max_upward_message_num_per_candidate { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxUpwardMessageNumPerCandidate { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_max_upward_message_num_per_candidate"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] - pub struct SetHrmpOpenRequestTtl { - pub new: set_hrmp_open_request_ttl::New, - } - pub mod set_hrmp_open_request_ttl { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHrmpOpenRequestTtl { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_hrmp_open_request_ttl"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] - pub struct SetHrmpSenderDeposit { - pub new: set_hrmp_sender_deposit::New, - } - pub mod set_hrmp_sender_deposit { - use super::runtime_types; - pub type New = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHrmpSenderDeposit { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_hrmp_sender_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] - #[doc = "channel."] - pub struct SetHrmpRecipientDeposit { - pub new: set_hrmp_recipient_deposit::New, - } - pub mod set_hrmp_recipient_deposit { - use super::runtime_types; - pub type New = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHrmpRecipientDeposit { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_hrmp_recipient_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] - pub struct SetHrmpChannelMaxCapacity { - pub new: set_hrmp_channel_max_capacity::New, - } - pub mod set_hrmp_channel_max_capacity { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHrmpChannelMaxCapacity { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_hrmp_channel_max_capacity"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] - pub struct SetHrmpChannelMaxTotalSize { - pub new: set_hrmp_channel_max_total_size::New, - } - pub mod set_hrmp_channel_max_total_size { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHrmpChannelMaxTotalSize { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_hrmp_channel_max_total_size"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] - pub struct SetHrmpMaxParachainInboundChannels { - pub new: set_hrmp_max_parachain_inbound_channels::New, - } - pub mod set_hrmp_max_parachain_inbound_channels { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHrmpMaxParachainInboundChannels { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_hrmp_max_parachain_inbound_channels"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] - pub struct SetHrmpChannelMaxMessageSize { - pub new: set_hrmp_channel_max_message_size::New, - } - pub mod set_hrmp_channel_max_message_size { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHrmpChannelMaxMessageSize { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_hrmp_channel_max_message_size"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] - pub struct SetHrmpMaxParachainOutboundChannels { - pub new: set_hrmp_max_parachain_outbound_channels::New, - } - pub mod set_hrmp_max_parachain_outbound_channels { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHrmpMaxParachainOutboundChannels { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_hrmp_max_parachain_outbound_channels"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] - pub struct SetHrmpMaxMessageNumPerCandidate { - pub new: set_hrmp_max_message_num_per_candidate::New, - } - pub mod set_hrmp_max_message_num_per_candidate { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHrmpMaxMessageNumPerCandidate { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_hrmp_max_message_num_per_candidate"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] - pub struct SetPvfVotingTtl { - pub new: set_pvf_voting_ttl::New, - } - pub mod set_pvf_voting_ttl { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetPvfVotingTtl { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_pvf_voting_ttl"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] - #[doc = "upgrade taking place."] - #[doc = ""] - #[doc = "See the field documentation for information and constraints for the new value."] - pub struct SetMinimumValidationUpgradeDelay { - pub new: set_minimum_validation_upgrade_delay::New, - } - pub mod set_minimum_validation_upgrade_delay { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMinimumValidationUpgradeDelay { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_minimum_validation_upgrade_delay"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Setting this to true will disable consistency checks for the configuration setters."] - #[doc = "Use with caution."] - pub struct SetBypassConsistencyCheck { - pub new: set_bypass_consistency_check::New, - } - pub mod set_bypass_consistency_check { - use super::runtime_types; - pub type New = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetBypassConsistencyCheck { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_bypass_consistency_check"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the asynchronous backing parameters."] - pub struct SetAsyncBackingParams { - pub new: set_async_backing_params::New, - } - pub mod set_async_backing_params { - use super::runtime_types; - pub type New = - runtime_types::polkadot_primitives::v9::async_backing::AsyncBackingParams; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetAsyncBackingParams { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_async_backing_params"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set PVF executor parameters."] - pub struct SetExecutorParams { - pub new: set_executor_params::New, - } - pub mod set_executor_params { - use super::runtime_types; - pub type New = - runtime_types::polkadot_primitives::v9::executor_params::ExecutorParams; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetExecutorParams { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_executor_params"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the on demand (parathreads) base fee."] - pub struct SetOnDemandBaseFee { - pub new: set_on_demand_base_fee::New, - } - pub mod set_on_demand_base_fee { - use super::runtime_types; - pub type New = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetOnDemandBaseFee { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_on_demand_base_fee"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the on demand (parathreads) fee variability."] - pub struct SetOnDemandFeeVariability { - pub new: set_on_demand_fee_variability::New, - } - pub mod set_on_demand_fee_variability { - use super::runtime_types; - pub type New = runtime_types::sp_arithmetic::per_things::Perbill; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetOnDemandFeeVariability { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_on_demand_fee_variability"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the on demand (parathreads) queue max size."] - pub struct SetOnDemandQueueMaxSize { - pub new: set_on_demand_queue_max_size::New, - } - pub mod set_on_demand_queue_max_size { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetOnDemandQueueMaxSize { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_on_demand_queue_max_size"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the on demand (parathreads) fee variability."] - pub struct SetOnDemandTargetQueueUtilization { - pub new: set_on_demand_target_queue_utilization::New, - } - pub mod set_on_demand_target_queue_utilization { - use super::runtime_types; - pub type New = runtime_types::sp_arithmetic::per_things::Perbill; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetOnDemandTargetQueueUtilization { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_on_demand_target_queue_utilization"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the minimum backing votes threshold."] - pub struct SetMinimumBackingVotes { - pub new: set_minimum_backing_votes::New, - } - pub mod set_minimum_backing_votes { - use super::runtime_types; - pub type New = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMinimumBackingVotes { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_minimum_backing_votes"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set/Unset a node feature."] - pub struct SetNodeFeature { - pub index: set_node_feature::Index, - pub value: set_node_feature::Value, - } - pub mod set_node_feature { - use super::runtime_types; - pub type Index = ::core::primitive::u8; - pub type Value = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetNodeFeature { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_node_feature"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set approval-voting-params."] - pub struct SetApprovalVotingParams { - pub new: set_approval_voting_params::New, - } - pub mod set_approval_voting_params { - use super::runtime_types; - pub type New = runtime_types::polkadot_primitives::v9::ApprovalVotingParams; + pub type Who = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl BurnedHeld { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "BurnedHeld"; + } + impl ::subxt::events::DecodeAsEvent for BurnedHeld { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetApprovalVotingParams { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_approval_voting_params"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A transfer of `amount` on hold from `source` to `dest` was initiated."] + pub struct TransferOnHold { + pub reason: transfer_on_hold::Reason, + pub source: transfer_on_hold::Source, + pub dest: transfer_on_hold::Dest, + pub amount: transfer_on_hold::Amount, + } + pub mod transfer_on_hold { + use super::runtime_types; + pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; + pub type Source = ::subxt::utils::AccountId32; + pub type Dest = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl TransferOnHold { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "TransferOnHold"; + } + impl ::subxt::events::DecodeAsEvent for TransferOnHold { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set scheduler-params."] - pub struct SetSchedulerParams { - pub new: set_scheduler_params::New, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "The `transferred` balance is placed on hold at the `dest` account."] + pub struct TransferAndHold { + pub reason: transfer_and_hold::Reason, + pub source: transfer_and_hold::Source, + pub dest: transfer_and_hold::Dest, + pub transferred: transfer_and_hold::Transferred, + } + pub mod transfer_and_hold { + use super::runtime_types; + pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; + pub type Source = ::subxt::utils::AccountId32; + pub type Dest = ::subxt::utils::AccountId32; + pub type Transferred = ::core::primitive::u128; + } + impl TransferAndHold { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "TransferAndHold"; + } + impl ::subxt::events::DecodeAsEvent for TransferAndHold { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME } - pub mod set_scheduler_params { - use super::runtime_types; - pub type New = runtime_types::polkadot_primitives::v9::SchedulerParams< - ::core::primitive::u32, - >; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Some balance was released from hold."] + pub struct Released { + pub reason: released::Reason, + pub who: released::Who, + pub amount: released::Amount, + } + pub mod released { + use super::runtime_types; + pub type Reason = runtime_types::rococo_runtime::RuntimeHoldReason; + pub type Who = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl Released { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Released"; + } + impl ::subxt::events::DecodeAsEvent for Released { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetSchedulerParams { - const PALLET: &'static str = "Configuration"; - const CALL: &'static str = "set_scheduler_params"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "An unexpected/defensive event was triggered."] + pub struct Unexpected(pub unexpected::Field0); + pub mod unexpected { + use super::runtime_types; + pub type Field0 = runtime_types::pallet_balances::pallet::UnexpectedKind; + } + impl Unexpected { + const PALLET_NAME: &'static str = "NisCounterpartBalances"; + const EVENT_NAME: &'static str = "Unexpected"; + } + impl ::subxt::events::DecodeAsEvent for Unexpected { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Set the validation upgrade cooldown."] - pub fn set_validation_upgrade_cooldown( + } + pub mod storage { + use super::root_mod; + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The total units issued in the system."] + pub fn total_issuance( &self, - new: types::set_validation_upgrade_cooldown::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetValidationUpgradeCooldown, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_validation_upgrade_cooldown", - types::SetValidationUpgradeCooldown { new }, + ) -> ::subxt::storage::StaticAddress<(), total_issuance::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( + "NisCounterpartBalances", + "TotalIssuance", [ - 233u8, 224u8, 19u8, 198u8, 27u8, 104u8, 64u8, 248u8, 223u8, 51u8, - 175u8, 162u8, 183u8, 43u8, 108u8, 246u8, 162u8, 210u8, 53u8, 56u8, - 174u8, 203u8, 79u8, 143u8, 13u8, 101u8, 100u8, 11u8, 127u8, 76u8, 71u8, - 228u8, + 138u8, 120u8, 138u8, 119u8, 4u8, 166u8, 22u8, 216u8, 227u8, 249u8, + 161u8, 193u8, 54u8, 68u8, 55u8, 74u8, 230u8, 68u8, 131u8, 253u8, 146u8, + 73u8, 54u8, 85u8, 212u8, 83u8, 162u8, 188u8, 171u8, 5u8, 232u8, 21u8, ], ) } - #[doc = "Set the validation upgrade delay."] - pub fn set_validation_upgrade_delay( + #[doc = " The total units of outstanding deactivated balance in the system."] + pub fn inactive_issuance( &self, - new: types::set_validation_upgrade_delay::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetValidationUpgradeDelay, + ) -> ::subxt::storage::StaticAddress< + (), + inactive_issuance::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_validation_upgrade_delay", - types::SetValidationUpgradeDelay { new }, + ::subxt::storage::StaticAddress::new_static( + "NisCounterpartBalances", + "InactiveIssuance", [ - 13u8, 139u8, 210u8, 115u8, 20u8, 121u8, 55u8, 118u8, 101u8, 236u8, - 95u8, 79u8, 46u8, 44u8, 129u8, 129u8, 60u8, 198u8, 13u8, 17u8, 115u8, - 187u8, 181u8, 37u8, 75u8, 153u8, 13u8, 196u8, 49u8, 204u8, 26u8, 198u8, + 97u8, 194u8, 82u8, 3u8, 40u8, 108u8, 109u8, 245u8, 175u8, 189u8, 212u8, + 193u8, 229u8, 82u8, 107u8, 169u8, 9u8, 176u8, 124u8, 102u8, 151u8, + 98u8, 87u8, 194u8, 82u8, 130u8, 41u8, 137u8, 3u8, 230u8, 145u8, 58u8, ], ) } - #[doc = "Set the acceptance period for an included candidate."] - pub fn set_code_retention_period( + #[doc = " The Balances pallet example of storing the balance of an account."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " You can also store the balance of an account in the `System` pallet."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = System"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] + #[doc = " `frame_system` data alongside the account data contrary to storing account balances in the"] + #[doc = " `Balances` pallet, which uses a `StorageMap` to store balances data only."] + #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] + pub fn account( &self, - new: types::set_code_retention_period::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetCodeRetentionPeriod, + ) -> ::subxt::storage::StaticAddress< + (account::input::Param0,), + account::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_code_retention_period", - types::SetCodeRetentionPeriod { new }, - [ - 169u8, 77u8, 107u8, 175u8, 172u8, 177u8, 169u8, 194u8, 219u8, 6u8, - 192u8, 40u8, 55u8, 241u8, 128u8, 111u8, 95u8, 67u8, 173u8, 247u8, - 220u8, 66u8, 45u8, 76u8, 108u8, 137u8, 220u8, 194u8, 86u8, 41u8, 245u8, - 226u8, - ], - ) - } - #[doc = "Set the max validation code size for incoming upgrades."] - pub fn set_max_code_size( - &self, - new: types::set_max_code_size::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_max_code_size", - types::SetMaxCodeSize { new }, - [ - 122u8, 74u8, 244u8, 226u8, 89u8, 175u8, 191u8, 163u8, 34u8, 79u8, - 118u8, 254u8, 236u8, 215u8, 8u8, 182u8, 71u8, 180u8, 224u8, 165u8, - 226u8, 242u8, 124u8, 34u8, 38u8, 27u8, 29u8, 140u8, 187u8, 93u8, 131u8, - 168u8, - ], - ) - } - #[doc = "Set the max POV block size for incoming upgrades."] - pub fn set_max_pov_size( - &self, - new: types::set_max_pov_size::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_max_pov_size", - types::SetMaxPovSize { new }, - [ - 170u8, 106u8, 163u8, 4u8, 27u8, 72u8, 250u8, 59u8, 133u8, 128u8, 177u8, - 209u8, 22u8, 42u8, 230u8, 40u8, 192u8, 198u8, 56u8, 195u8, 31u8, 20u8, - 35u8, 196u8, 119u8, 183u8, 141u8, 38u8, 52u8, 54u8, 31u8, 122u8, - ], - ) - } - #[doc = "Set the max head data size for paras."] - pub fn set_max_head_data_size( - &self, - new: types::set_max_head_data_size::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_max_head_data_size", - types::SetMaxHeadDataSize { new }, + ::subxt::storage::StaticAddress::new_static( + "NisCounterpartBalances", + "Account", [ - 216u8, 146u8, 104u8, 253u8, 123u8, 192u8, 123u8, 82u8, 149u8, 22u8, - 31u8, 107u8, 67u8, 102u8, 163u8, 239u8, 57u8, 183u8, 93u8, 20u8, 126u8, - 39u8, 36u8, 242u8, 252u8, 68u8, 150u8, 121u8, 147u8, 186u8, 39u8, - 181u8, + 14u8, 88u8, 174u8, 192u8, 241u8, 142u8, 159u8, 255u8, 178u8, 117u8, + 55u8, 78u8, 218u8, 161u8, 146u8, 139u8, 170u8, 180u8, 187u8, 177u8, + 89u8, 157u8, 91u8, 225u8, 90u8, 174u8, 247u8, 47u8, 47u8, 23u8, 234u8, + 50u8, ], ) } - #[doc = "Set the number of coretime execution cores."] + #[doc = " Any liquidity locks on some account balances."] + #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] #[doc = ""] - #[doc = "NOTE: that this configuration is managed by the coretime chain. Only manually change"] - #[doc = "this, if you really know what you are doing!"] - pub fn set_coretime_cores( - &self, - new: types::set_coretime_cores::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_coretime_cores", - types::SetCoretimeCores { new }, - [ - 179u8, 131u8, 211u8, 152u8, 167u8, 6u8, 108u8, 94u8, 179u8, 97u8, 87u8, - 227u8, 57u8, 120u8, 133u8, 130u8, 59u8, 243u8, 224u8, 2u8, 11u8, 86u8, - 251u8, 77u8, 159u8, 177u8, 145u8, 34u8, 117u8, 93u8, 28u8, 52u8, - ], - ) - } - #[doc = "Set the parachain validator-group rotation frequency"] - pub fn set_group_rotation_frequency( + #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] + pub fn locks( &self, - new: types::set_group_rotation_frequency::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetGroupRotationFrequency, + ) -> ::subxt::storage::StaticAddress< + (locks::input::Param0,), + locks::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_group_rotation_frequency", - types::SetGroupRotationFrequency { new }, + ::subxt::storage::StaticAddress::new_static( + "NisCounterpartBalances", + "Locks", [ - 33u8, 142u8, 63u8, 205u8, 128u8, 109u8, 157u8, 33u8, 122u8, 91u8, 57u8, - 223u8, 134u8, 80u8, 108u8, 187u8, 147u8, 120u8, 104u8, 170u8, 32u8, - 135u8, 102u8, 38u8, 82u8, 20u8, 123u8, 211u8, 245u8, 91u8, 134u8, 44u8, + 201u8, 50u8, 65u8, 126u8, 43u8, 153u8, 207u8, 145u8, 240u8, 59u8, + 160u8, 111u8, 144u8, 245u8, 193u8, 13u8, 227u8, 118u8, 72u8, 168u8, + 37u8, 147u8, 139u8, 221u8, 36u8, 177u8, 202u8, 209u8, 152u8, 122u8, + 250u8, 89u8, ], ) } - #[doc = "Set the availability period for paras."] - pub fn set_paras_availability_period( + #[doc = " Named reserves on some account balances."] + #[doc = ""] + #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] + pub fn reserves( &self, - new: types::set_paras_availability_period::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetParasAvailabilityPeriod, + ) -> ::subxt::storage::StaticAddress< + (reserves::input::Param0,), + reserves::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_paras_availability_period", - types::SetParasAvailabilityPeriod { new }, + ::subxt::storage::StaticAddress::new_static( + "NisCounterpartBalances", + "Reserves", [ - 83u8, 171u8, 219u8, 129u8, 231u8, 54u8, 45u8, 19u8, 167u8, 21u8, 232u8, - 205u8, 166u8, 83u8, 234u8, 101u8, 205u8, 248u8, 74u8, 39u8, 130u8, - 15u8, 92u8, 39u8, 239u8, 111u8, 215u8, 165u8, 149u8, 11u8, 89u8, 119u8, + 76u8, 220u8, 133u8, 100u8, 127u8, 174u8, 237u8, 103u8, 211u8, 104u8, + 140u8, 100u8, 49u8, 169u8, 114u8, 112u8, 193u8, 115u8, 234u8, 160u8, + 97u8, 104u8, 194u8, 47u8, 119u8, 136u8, 132u8, 196u8, 136u8, 121u8, + 45u8, 161u8, ], ) } - #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] - pub fn set_scheduling_lookahead( + #[doc = " Holds on account balances."] + pub fn holds( &self, - new: types::set_scheduling_lookahead::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetSchedulingLookahead, + ) -> ::subxt::storage::StaticAddress< + (holds::input::Param0,), + holds::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_scheduling_lookahead", - types::SetSchedulingLookahead { new }, + ::subxt::storage::StaticAddress::new_static( + "NisCounterpartBalances", + "Holds", [ - 176u8, 115u8, 251u8, 197u8, 19u8, 106u8, 253u8, 224u8, 149u8, 96u8, - 238u8, 106u8, 19u8, 19u8, 89u8, 249u8, 186u8, 89u8, 144u8, 116u8, - 251u8, 30u8, 157u8, 237u8, 125u8, 153u8, 86u8, 6u8, 251u8, 170u8, 73u8, - 216u8, + 243u8, 190u8, 61u8, 27u8, 177u8, 143u8, 74u8, 255u8, 22u8, 109u8, + 167u8, 85u8, 179u8, 42u8, 42u8, 37u8, 8u8, 190u8, 38u8, 60u8, 158u8, + 138u8, 66u8, 201u8, 131u8, 136u8, 85u8, 160u8, 98u8, 110u8, 33u8, 50u8, ], ) } - #[doc = "Set the maximum number of validators to assign to any core."] - pub fn set_max_validators_per_core( + #[doc = " Freeze locks on account balances."] + pub fn freezes( &self, - new: types::set_max_validators_per_core::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetMaxValidatorsPerCore, + ) -> ::subxt::storage::StaticAddress< + (freezes::input::Param0,), + freezes::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_max_validators_per_core", - types::SetMaxValidatorsPerCore { new }, + ::subxt::storage::StaticAddress::new_static( + "NisCounterpartBalances", + "Freezes", [ - 152u8, 112u8, 244u8, 133u8, 209u8, 166u8, 55u8, 155u8, 12u8, 216u8, - 62u8, 111u8, 81u8, 52u8, 194u8, 121u8, 172u8, 201u8, 204u8, 139u8, - 198u8, 238u8, 9u8, 49u8, 119u8, 236u8, 46u8, 0u8, 179u8, 234u8, 92u8, - 45u8, + 41u8, 196u8, 69u8, 26u8, 201u8, 141u8, 252u8, 255u8, 78u8, 216u8, + 102u8, 207u8, 133u8, 185u8, 86u8, 18u8, 79u8, 137u8, 132u8, 92u8, + 228u8, 237u8, 91u8, 125u8, 25u8, 111u8, 127u8, 212u8, 215u8, 114u8, + 219u8, 72u8, ], ) } - #[doc = "Set the maximum number of validators to use in parachain consensus."] - pub fn set_max_validators( - &self, - new: types::set_max_validators::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_max_validators", - types::SetMaxValidators { new }, - [ - 219u8, 76u8, 191u8, 139u8, 250u8, 154u8, 232u8, 176u8, 248u8, 154u8, - 185u8, 89u8, 135u8, 151u8, 183u8, 132u8, 72u8, 63u8, 101u8, 183u8, - 142u8, 169u8, 163u8, 226u8, 24u8, 139u8, 78u8, 155u8, 3u8, 136u8, - 142u8, 137u8, - ], - ) + } + pub mod total_issuance { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; } - #[doc = "Set the dispute period, in number of sessions to keep for disputes."] - pub fn set_dispute_period( - &self, - new: types::set_dispute_period::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_dispute_period", - types::SetDisputePeriod { new }, - [ - 104u8, 229u8, 235u8, 207u8, 136u8, 207u8, 181u8, 99u8, 0u8, 84u8, - 200u8, 244u8, 220u8, 52u8, 64u8, 26u8, 232u8, 212u8, 242u8, 190u8, - 67u8, 180u8, 171u8, 200u8, 181u8, 23u8, 32u8, 240u8, 231u8, 217u8, - 23u8, 146u8, - ], - ) + pub type Output = ::core::primitive::u128; + } + pub mod inactive_issuance { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; } - #[doc = "Set the dispute post conclusion acceptance period."] - pub fn set_dispute_post_conclusion_acceptance_period( - &self, - new: types::set_dispute_post_conclusion_acceptance_period::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetDisputePostConclusionAcceptancePeriod, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_dispute_post_conclusion_acceptance_period", - types::SetDisputePostConclusionAcceptancePeriod { new }, - [ - 251u8, 176u8, 139u8, 76u8, 7u8, 246u8, 198u8, 190u8, 39u8, 249u8, 95u8, - 226u8, 53u8, 186u8, 112u8, 101u8, 229u8, 80u8, 240u8, 185u8, 108u8, - 228u8, 91u8, 103u8, 128u8, 218u8, 231u8, 210u8, 164u8, 197u8, 84u8, - 149u8, - ], - ) + pub type Output = ::core::primitive::u128; + } + pub mod account { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; + pub type Param0 = ::subxt::utils::AccountId32; } - #[doc = "Set the no show slots, in number of number of consensus slots."] - #[doc = "Must be at least 1."] - pub fn set_no_show_slots( - &self, - new: types::set_no_show_slots::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_no_show_slots", - types::SetNoShowSlots { new }, - [ - 123u8, 204u8, 253u8, 222u8, 224u8, 215u8, 247u8, 154u8, 225u8, 79u8, - 29u8, 171u8, 107u8, 216u8, 215u8, 14u8, 8u8, 230u8, 49u8, 97u8, 20u8, - 84u8, 70u8, 33u8, 254u8, 63u8, 186u8, 7u8, 184u8, 135u8, 74u8, 139u8, - ], - ) + pub type Output = + runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>; + } + pub mod locks { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; + pub type Param0 = ::subxt::utils::AccountId32; + } + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + runtime_types::pallet_balances::types::BalanceLock<::core::primitive::u128>, + >; + } + pub mod reserves { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; + pub type Param0 = ::subxt::utils::AccountId32; + } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_balances::types::ReserveData< + [::core::primitive::u8; 8usize], + ::core::primitive::u128, + >, + >; + } + pub mod holds { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; + pub type Param0 = ::subxt::utils::AccountId32; + } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::frame_support::traits::tokens::misc::IdAmount< + runtime_types::rococo_runtime::RuntimeHoldReason, + ::core::primitive::u128, + >, + >; + } + pub mod freezes { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; + pub type Param0 = ::subxt::utils::AccountId32; } - #[doc = "Set the total number of delay tranches."] - pub fn set_n_delay_tranches( + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::frame_support::traits::tokens::misc::IdAmount< + (), + ::core::primitive::u128, + >, + >; + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO!"] + #[doc = ""] + #[doc = " If you *really* need it to be zero, you can enable the feature `insecure_zero_ed` for"] + #[doc = " this pallet. However, you do so at your own risk: this will open up a major DoS vector."] + #[doc = " In case you have multiple sources of provider references, you may also get unexpected"] + #[doc = " behaviour if you set this to zero."] + #[doc = ""] + #[doc = " Bottom line: Do yourself a favour and make it at least one!"] + pub fn existential_deposit( &self, - new: types::set_n_delay_tranches::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_n_delay_tranches", - types::SetNDelayTranches { new }, + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( + "NisCounterpartBalances", + "ExistentialDeposit", [ - 157u8, 177u8, 251u8, 227u8, 118u8, 250u8, 129u8, 254u8, 33u8, 250u8, - 61u8, 148u8, 189u8, 92u8, 49u8, 119u8, 107u8, 40u8, 255u8, 119u8, - 241u8, 188u8, 109u8, 240u8, 229u8, 169u8, 31u8, 62u8, 174u8, 14u8, - 247u8, 235u8, + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, ], ) } - #[doc = "Set the zeroth delay tranche width."] - pub fn set_zeroth_delay_tranche_width( + #[doc = " The maximum number of locks that should exist on an account."] + #[doc = " Not strictly enforced, but used for weight estimation."] + #[doc = ""] + #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] + pub fn max_locks( &self, - new: types::set_zeroth_delay_tranche_width::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetZerothDelayTrancheWidth, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_zeroth_delay_tranche_width", - types::SetZerothDelayTrancheWidth { new }, + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( + "NisCounterpartBalances", + "MaxLocks", [ - 30u8, 195u8, 15u8, 51u8, 210u8, 159u8, 254u8, 207u8, 121u8, 172u8, - 107u8, 241u8, 55u8, 100u8, 159u8, 55u8, 76u8, 47u8, 86u8, 93u8, 221u8, - 34u8, 136u8, 97u8, 224u8, 141u8, 46u8, 181u8, 246u8, 137u8, 79u8, 57u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = "Set the number of validators needed to approve a block."] - pub fn set_needed_approvals( + #[doc = " The maximum number of named reserves that can exist on an account."] + #[doc = ""] + #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] + pub fn max_reserves( &self, - new: types::set_needed_approvals::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_needed_approvals", - types::SetNeededApprovals { new }, + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( + "NisCounterpartBalances", + "MaxReserves", [ - 245u8, 105u8, 16u8, 120u8, 28u8, 231u8, 6u8, 50u8, 143u8, 102u8, 1u8, - 97u8, 224u8, 232u8, 187u8, 164u8, 200u8, 31u8, 129u8, 139u8, 79u8, - 170u8, 14u8, 147u8, 117u8, 13u8, 98u8, 16u8, 64u8, 169u8, 46u8, 41u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] - pub fn set_relay_vrf_modulo_samples( + #[doc = " The maximum number of individual freeze locks that can exist on an account at any time."] + pub fn max_freezes( &self, - new: types::set_relay_vrf_modulo_samples::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetRelayVrfModuloSamples, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_relay_vrf_modulo_samples", - types::SetRelayVrfModuloSamples { new }, + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( + "NisCounterpartBalances", + "MaxFreezes", [ - 96u8, 100u8, 42u8, 61u8, 244u8, 226u8, 135u8, 187u8, 56u8, 193u8, - 247u8, 236u8, 38u8, 40u8, 242u8, 222u8, 176u8, 209u8, 211u8, 217u8, - 178u8, 32u8, 160u8, 56u8, 23u8, 60u8, 222u8, 166u8, 134u8, 72u8, 153u8, - 14u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] - pub fn set_max_upward_queue_count( - &self, - new: types::set_max_upward_queue_count::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetMaxUpwardQueueCount, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_max_upward_queue_count", - types::SetMaxUpwardQueueCount { new }, - [ - 187u8, 102u8, 178u8, 141u8, 245u8, 8u8, 221u8, 174u8, 128u8, 239u8, - 104u8, 120u8, 202u8, 220u8, 46u8, 27u8, 175u8, 26u8, 1u8, 170u8, 193u8, - 70u8, 176u8, 13u8, 223u8, 57u8, 153u8, 161u8, 228u8, 175u8, 226u8, - 202u8, - ], - ) + } + } + } + pub mod parachains_origin { + use super::root_mod; + use super::runtime_types; + } + pub mod configuration { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::polkadot_runtime_parachains::configuration::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::polkadot_runtime_parachains::configuration::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the validation upgrade cooldown."] + pub struct SetValidationUpgradeCooldown { + pub new: set_validation_upgrade_cooldown::New, + } + pub mod set_validation_upgrade_cooldown { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetValidationUpgradeCooldown { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_validation_upgrade_cooldown"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetValidationUpgradeCooldown { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the validation upgrade delay."] + pub struct SetValidationUpgradeDelay { + pub new: set_validation_upgrade_delay::New, + } + pub mod set_validation_upgrade_delay { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetValidationUpgradeDelay { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_validation_upgrade_delay"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetValidationUpgradeDelay { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the acceptance period for an included candidate."] + pub struct SetCodeRetentionPeriod { + pub new: set_code_retention_period::New, + } + pub mod set_code_retention_period { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetCodeRetentionPeriod { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_code_retention_period"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetCodeRetentionPeriod { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the max validation code size for incoming upgrades."] + pub struct SetMaxCodeSize { + pub new: set_max_code_size::New, + } + pub mod set_max_code_size { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetMaxCodeSize { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_max_code_size"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxCodeSize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the max POV block size for incoming upgrades."] + pub struct SetMaxPovSize { + pub new: set_max_pov_size::New, + } + pub mod set_max_pov_size { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetMaxPovSize { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_max_pov_size"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxPovSize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the max head data size for paras."] + pub struct SetMaxHeadDataSize { + pub new: set_max_head_data_size::New, + } + pub mod set_max_head_data_size { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetMaxHeadDataSize { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_max_head_data_size"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxHeadDataSize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the number of coretime execution cores."] + #[doc = ""] + #[doc = "NOTE: that this configuration is managed by the coretime chain. Only manually change"] + #[doc = "this, if you really know what you are doing!"] + pub struct SetCoretimeCores { + pub new: set_coretime_cores::New, + } + pub mod set_coretime_cores { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetCoretimeCores { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_coretime_cores"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetCoretimeCores { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the parachain validator-group rotation frequency"] + pub struct SetGroupRotationFrequency { + pub new: set_group_rotation_frequency::New, + } + pub mod set_group_rotation_frequency { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetGroupRotationFrequency { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_group_rotation_frequency"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetGroupRotationFrequency { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the availability period for paras."] + pub struct SetParasAvailabilityPeriod { + pub new: set_paras_availability_period::New, + } + pub mod set_paras_availability_period { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetParasAvailabilityPeriod { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_paras_availability_period"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetParasAvailabilityPeriod { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] + pub struct SetSchedulingLookahead { + pub new: set_scheduling_lookahead::New, + } + pub mod set_scheduling_lookahead { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetSchedulingLookahead { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_scheduling_lookahead"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetSchedulingLookahead { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the maximum number of validators to assign to any core."] + pub struct SetMaxValidatorsPerCore { + pub new: set_max_validators_per_core::New, + } + pub mod set_max_validators_per_core { + use super::runtime_types; + pub type New = ::core::option::Option<::core::primitive::u32>; + } + impl SetMaxValidatorsPerCore { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_max_validators_per_core"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxValidatorsPerCore { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the maximum number of validators to use in parachain consensus."] + pub struct SetMaxValidators { + pub new: set_max_validators::New, + } + pub mod set_max_validators { + use super::runtime_types; + pub type New = ::core::option::Option<::core::primitive::u32>; + } + impl SetMaxValidators { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_max_validators"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxValidators { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the dispute period, in number of sessions to keep for disputes."] + pub struct SetDisputePeriod { + pub new: set_dispute_period::New, + } + pub mod set_dispute_period { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetDisputePeriod { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_dispute_period"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetDisputePeriod { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the dispute post conclusion acceptance period."] + pub struct SetDisputePostConclusionAcceptancePeriod { + pub new: set_dispute_post_conclusion_acceptance_period::New, + } + pub mod set_dispute_post_conclusion_acceptance_period { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetDisputePostConclusionAcceptancePeriod { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_dispute_post_conclusion_acceptance_period"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetDisputePostConclusionAcceptancePeriod { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the no show slots, in number of number of consensus slots."] + #[doc = "Must be at least 1."] + pub struct SetNoShowSlots { + pub new: set_no_show_slots::New, + } + pub mod set_no_show_slots { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetNoShowSlots { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_no_show_slots"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetNoShowSlots { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the total number of delay tranches."] + pub struct SetNDelayTranches { + pub new: set_n_delay_tranches::New, + } + pub mod set_n_delay_tranches { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetNDelayTranches { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_n_delay_tranches"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetNDelayTranches { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the zeroth delay tranche width."] + pub struct SetZerothDelayTrancheWidth { + pub new: set_zeroth_delay_tranche_width::New, + } + pub mod set_zeroth_delay_tranche_width { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetZerothDelayTrancheWidth { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_zeroth_delay_tranche_width"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetZerothDelayTrancheWidth { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the number of validators needed to approve a block."] + pub struct SetNeededApprovals { + pub new: set_needed_approvals::New, + } + pub mod set_needed_approvals { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetNeededApprovals { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_needed_approvals"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetNeededApprovals { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] + pub struct SetRelayVrfModuloSamples { + pub new: set_relay_vrf_modulo_samples::New, + } + pub mod set_relay_vrf_modulo_samples { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetRelayVrfModuloSamples { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_relay_vrf_modulo_samples"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetRelayVrfModuloSamples { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] + pub struct SetMaxUpwardQueueCount { + pub new: set_max_upward_queue_count::New, + } + pub mod set_max_upward_queue_count { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetMaxUpwardQueueCount { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_max_upward_queue_count"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxUpwardQueueCount { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at"] - #[doc = "once."] - pub fn set_max_upward_queue_size( - &self, - new: types::set_max_upward_queue_size::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetMaxUpwardQueueSize, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_max_upward_queue_size", - types::SetMaxUpwardQueueSize { new }, - [ - 245u8, 234u8, 151u8, 232u8, 49u8, 193u8, 60u8, 21u8, 103u8, 238u8, - 194u8, 73u8, 238u8, 160u8, 48u8, 88u8, 143u8, 197u8, 110u8, 230u8, - 213u8, 149u8, 171u8, 94u8, 77u8, 6u8, 139u8, 191u8, 158u8, 62u8, 181u8, - 32u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at"] + #[doc = "once."] + pub struct SetMaxUpwardQueueSize { + pub new: set_max_upward_queue_size::New, + } + pub mod set_max_upward_queue_size { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetMaxUpwardQueueSize { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_max_upward_queue_size"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxUpwardQueueSize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the critical downward message size."] - pub fn set_max_downward_message_size( - &self, - new: types::set_max_downward_message_size::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetMaxDownwardMessageSize, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_max_downward_message_size", - types::SetMaxDownwardMessageSize { new }, - [ - 63u8, 112u8, 231u8, 193u8, 226u8, 6u8, 119u8, 35u8, 60u8, 34u8, 85u8, - 15u8, 168u8, 16u8, 176u8, 116u8, 169u8, 114u8, 42u8, 208u8, 89u8, - 188u8, 22u8, 145u8, 248u8, 87u8, 74u8, 168u8, 0u8, 202u8, 112u8, 13u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the critical downward message size."] + pub struct SetMaxDownwardMessageSize { + pub new: set_max_downward_message_size::New, + } + pub mod set_max_downward_message_size { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetMaxDownwardMessageSize { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_max_downward_message_size"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxDownwardMessageSize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] - pub fn set_max_upward_message_size( - &self, - new: types::set_max_upward_message_size::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetMaxUpwardMessageSize, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_max_upward_message_size", - types::SetMaxUpwardMessageSize { new }, - [ - 237u8, 108u8, 33u8, 245u8, 65u8, 209u8, 201u8, 97u8, 126u8, 194u8, - 195u8, 8u8, 144u8, 223u8, 148u8, 242u8, 97u8, 214u8, 38u8, 231u8, - 123u8, 143u8, 34u8, 199u8, 100u8, 183u8, 211u8, 111u8, 250u8, 245u8, - 10u8, 38u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] + pub struct SetMaxUpwardMessageSize { + pub new: set_max_upward_message_size::New, + } + pub mod set_max_upward_message_size { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetMaxUpwardMessageSize { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_max_upward_message_size"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxUpwardMessageSize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the maximum number of messages that a candidate can contain."] - pub fn set_max_upward_message_num_per_candidate( - &self, - new: types::set_max_upward_message_num_per_candidate::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetMaxUpwardMessageNumPerCandidate, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_max_upward_message_num_per_candidate", - types::SetMaxUpwardMessageNumPerCandidate { new }, - [ - 183u8, 121u8, 87u8, 193u8, 8u8, 160u8, 107u8, 80u8, 50u8, 8u8, 75u8, - 185u8, 195u8, 248u8, 75u8, 174u8, 210u8, 108u8, 149u8, 20u8, 66u8, - 153u8, 20u8, 203u8, 92u8, 99u8, 27u8, 69u8, 212u8, 212u8, 35u8, 49u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the maximum number of messages that a candidate can contain."] + pub struct SetMaxUpwardMessageNumPerCandidate { + pub new: set_max_upward_message_num_per_candidate::New, + } + pub mod set_max_upward_message_num_per_candidate { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetMaxUpwardMessageNumPerCandidate { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_max_upward_message_num_per_candidate"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxUpwardMessageNumPerCandidate { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] - pub fn set_hrmp_open_request_ttl( - &self, - new: types::set_hrmp_open_request_ttl::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetHrmpOpenRequestTtl, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_hrmp_open_request_ttl", - types::SetHrmpOpenRequestTtl { new }, - [ - 233u8, 46u8, 165u8, 59u8, 196u8, 77u8, 161u8, 124u8, 252u8, 98u8, 8u8, - 52u8, 80u8, 17u8, 12u8, 50u8, 25u8, 127u8, 143u8, 252u8, 230u8, 10u8, - 193u8, 251u8, 167u8, 73u8, 40u8, 63u8, 203u8, 119u8, 208u8, 254u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] + pub struct SetHrmpOpenRequestTtl { + pub new: set_hrmp_open_request_ttl::New, + } + pub mod set_hrmp_open_request_ttl { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetHrmpOpenRequestTtl { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_hrmp_open_request_ttl"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetHrmpOpenRequestTtl { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] - pub fn set_hrmp_sender_deposit( - &self, - new: types::set_hrmp_sender_deposit::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_hrmp_sender_deposit", - types::SetHrmpSenderDeposit { new }, - [ - 4u8, 141u8, 15u8, 87u8, 237u8, 39u8, 225u8, 108u8, 159u8, 240u8, 121u8, - 212u8, 225u8, 155u8, 168u8, 28u8, 61u8, 119u8, 232u8, 216u8, 194u8, - 172u8, 147u8, 16u8, 50u8, 100u8, 146u8, 146u8, 69u8, 252u8, 94u8, 47u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] + pub struct SetHrmpSenderDeposit { + pub new: set_hrmp_sender_deposit::New, + } + pub mod set_hrmp_sender_deposit { + use super::runtime_types; + pub type New = ::core::primitive::u128; + } + impl SetHrmpSenderDeposit { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_hrmp_sender_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetHrmpSenderDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] - #[doc = "channel."] - pub fn set_hrmp_recipient_deposit( - &self, - new: types::set_hrmp_recipient_deposit::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetHrmpRecipientDeposit, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_hrmp_recipient_deposit", - types::SetHrmpRecipientDeposit { new }, - [ - 242u8, 193u8, 202u8, 91u8, 69u8, 252u8, 101u8, 52u8, 162u8, 107u8, - 165u8, 69u8, 90u8, 150u8, 62u8, 239u8, 167u8, 2u8, 221u8, 3u8, 231u8, - 252u8, 82u8, 125u8, 212u8, 174u8, 47u8, 216u8, 219u8, 237u8, 242u8, - 144u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] + #[doc = "channel."] + pub struct SetHrmpRecipientDeposit { + pub new: set_hrmp_recipient_deposit::New, + } + pub mod set_hrmp_recipient_deposit { + use super::runtime_types; + pub type New = ::core::primitive::u128; + } + impl SetHrmpRecipientDeposit { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_hrmp_recipient_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetHrmpRecipientDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] - pub fn set_hrmp_channel_max_capacity( - &self, - new: types::set_hrmp_channel_max_capacity::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetHrmpChannelMaxCapacity, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_hrmp_channel_max_capacity", - types::SetHrmpChannelMaxCapacity { new }, - [ - 140u8, 138u8, 197u8, 45u8, 144u8, 102u8, 150u8, 172u8, 110u8, 6u8, - 99u8, 130u8, 62u8, 217u8, 119u8, 110u8, 180u8, 132u8, 102u8, 161u8, - 78u8, 59u8, 209u8, 44u8, 120u8, 183u8, 13u8, 88u8, 89u8, 15u8, 224u8, - 224u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] + pub struct SetHrmpChannelMaxCapacity { + pub new: set_hrmp_channel_max_capacity::New, + } + pub mod set_hrmp_channel_max_capacity { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetHrmpChannelMaxCapacity { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_hrmp_channel_max_capacity"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetHrmpChannelMaxCapacity { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] - pub fn set_hrmp_channel_max_total_size( - &self, - new: types::set_hrmp_channel_max_total_size::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetHrmpChannelMaxTotalSize, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_hrmp_channel_max_total_size", - types::SetHrmpChannelMaxTotalSize { new }, - [ - 149u8, 21u8, 229u8, 107u8, 125u8, 28u8, 17u8, 155u8, 45u8, 230u8, 50u8, - 64u8, 16u8, 171u8, 24u8, 58u8, 246u8, 57u8, 247u8, 20u8, 34u8, 217u8, - 206u8, 157u8, 40u8, 205u8, 187u8, 205u8, 199u8, 24u8, 115u8, 214u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] + pub struct SetHrmpChannelMaxTotalSize { + pub new: set_hrmp_channel_max_total_size::New, + } + pub mod set_hrmp_channel_max_total_size { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetHrmpChannelMaxTotalSize { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_hrmp_channel_max_total_size"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetHrmpChannelMaxTotalSize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] - pub fn set_hrmp_max_parachain_inbound_channels( - &self, - new: types::set_hrmp_max_parachain_inbound_channels::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetHrmpMaxParachainInboundChannels, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_hrmp_max_parachain_inbound_channels", - types::SetHrmpMaxParachainInboundChannels { new }, - [ - 203u8, 10u8, 55u8, 21u8, 21u8, 254u8, 74u8, 97u8, 34u8, 117u8, 160u8, - 183u8, 168u8, 235u8, 11u8, 9u8, 137u8, 141u8, 150u8, 80u8, 32u8, 41u8, - 118u8, 40u8, 28u8, 74u8, 155u8, 7u8, 63u8, 217u8, 39u8, 104u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] + pub struct SetHrmpMaxParachainInboundChannels { + pub new: set_hrmp_max_parachain_inbound_channels::New, + } + pub mod set_hrmp_max_parachain_inbound_channels { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetHrmpMaxParachainInboundChannels { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_hrmp_max_parachain_inbound_channels"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetHrmpMaxParachainInboundChannels { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] - pub fn set_hrmp_channel_max_message_size( - &self, - new: types::set_hrmp_channel_max_message_size::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetHrmpChannelMaxMessageSize, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_hrmp_channel_max_message_size", - types::SetHrmpChannelMaxMessageSize { new }, - [ - 153u8, 216u8, 55u8, 31u8, 189u8, 173u8, 23u8, 6u8, 213u8, 103u8, 205u8, - 154u8, 115u8, 105u8, 84u8, 133u8, 94u8, 254u8, 47u8, 128u8, 130u8, - 114u8, 227u8, 102u8, 214u8, 146u8, 215u8, 183u8, 179u8, 151u8, 43u8, - 187u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] + pub struct SetHrmpChannelMaxMessageSize { + pub new: set_hrmp_channel_max_message_size::New, + } + pub mod set_hrmp_channel_max_message_size { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetHrmpChannelMaxMessageSize { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_hrmp_channel_max_message_size"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetHrmpChannelMaxMessageSize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] - pub fn set_hrmp_max_parachain_outbound_channels( - &self, - new: types::set_hrmp_max_parachain_outbound_channels::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetHrmpMaxParachainOutboundChannels, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_hrmp_max_parachain_outbound_channels", - types::SetHrmpMaxParachainOutboundChannels { new }, - [ - 91u8, 100u8, 158u8, 17u8, 123u8, 31u8, 6u8, 92u8, 80u8, 92u8, 83u8, - 195u8, 234u8, 207u8, 55u8, 88u8, 75u8, 81u8, 219u8, 131u8, 234u8, 5u8, - 75u8, 236u8, 57u8, 93u8, 70u8, 145u8, 255u8, 171u8, 25u8, 174u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] + pub struct SetHrmpMaxParachainOutboundChannels { + pub new: set_hrmp_max_parachain_outbound_channels::New, + } + pub mod set_hrmp_max_parachain_outbound_channels { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetHrmpMaxParachainOutboundChannels { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_hrmp_max_parachain_outbound_channels"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetHrmpMaxParachainOutboundChannels { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] - pub fn set_hrmp_max_message_num_per_candidate( - &self, - new: types::set_hrmp_max_message_num_per_candidate::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetHrmpMaxMessageNumPerCandidate, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_hrmp_max_message_num_per_candidate", - types::SetHrmpMaxMessageNumPerCandidate { new }, - [ - 179u8, 44u8, 231u8, 12u8, 166u8, 160u8, 223u8, 164u8, 218u8, 173u8, - 157u8, 49u8, 16u8, 220u8, 0u8, 224u8, 67u8, 194u8, 210u8, 207u8, 237u8, - 96u8, 96u8, 24u8, 71u8, 237u8, 30u8, 152u8, 105u8, 245u8, 157u8, 218u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] + pub struct SetHrmpMaxMessageNumPerCandidate { + pub new: set_hrmp_max_message_num_per_candidate::New, + } + pub mod set_hrmp_max_message_num_per_candidate { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetHrmpMaxMessageNumPerCandidate { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_hrmp_max_message_num_per_candidate"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetHrmpMaxMessageNumPerCandidate { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] - pub fn set_pvf_voting_ttl( - &self, - new: types::set_pvf_voting_ttl::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_pvf_voting_ttl", - types::SetPvfVotingTtl { new }, - [ - 115u8, 135u8, 76u8, 222u8, 214u8, 80u8, 103u8, 250u8, 194u8, 34u8, - 129u8, 245u8, 216u8, 69u8, 166u8, 247u8, 138u8, 94u8, 135u8, 228u8, - 90u8, 145u8, 2u8, 244u8, 73u8, 178u8, 61u8, 251u8, 21u8, 197u8, 202u8, - 246u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] + pub struct SetPvfVotingTtl { + pub new: set_pvf_voting_ttl::New, + } + pub mod set_pvf_voting_ttl { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetPvfVotingTtl { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_pvf_voting_ttl"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetPvfVotingTtl { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] - #[doc = "upgrade taking place."] - #[doc = ""] - #[doc = "See the field documentation for information and constraints for the new value."] - pub fn set_minimum_validation_upgrade_delay( - &self, - new: types::set_minimum_validation_upgrade_delay::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetMinimumValidationUpgradeDelay, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_minimum_validation_upgrade_delay", - types::SetMinimumValidationUpgradeDelay { new }, - [ - 143u8, 217u8, 201u8, 206u8, 206u8, 244u8, 116u8, 118u8, 13u8, 169u8, - 132u8, 125u8, 253u8, 178u8, 196u8, 12u8, 251u8, 32u8, 201u8, 133u8, - 50u8, 59u8, 37u8, 169u8, 198u8, 112u8, 136u8, 47u8, 205u8, 141u8, - 191u8, 212u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] + #[doc = "upgrade taking place."] + #[doc = ""] + #[doc = "See the field documentation for information and constraints for the new value."] + pub struct SetMinimumValidationUpgradeDelay { + pub new: set_minimum_validation_upgrade_delay::New, + } + pub mod set_minimum_validation_upgrade_delay { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetMinimumValidationUpgradeDelay { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_minimum_validation_upgrade_delay"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMinimumValidationUpgradeDelay { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Setting this to true will disable consistency checks for the configuration setters."] - #[doc = "Use with caution."] - pub fn set_bypass_consistency_check( - &self, - new: types::set_bypass_consistency_check::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetBypassConsistencyCheck, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_bypass_consistency_check", - types::SetBypassConsistencyCheck { new }, - [ - 11u8, 211u8, 68u8, 221u8, 178u8, 108u8, 101u8, 55u8, 107u8, 135u8, - 203u8, 112u8, 173u8, 161u8, 23u8, 104u8, 95u8, 200u8, 46u8, 231u8, - 114u8, 3u8, 8u8, 89u8, 147u8, 141u8, 55u8, 65u8, 125u8, 45u8, 218u8, - 78u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Setting this to true will disable consistency checks for the configuration setters."] + #[doc = "Use with caution."] + pub struct SetBypassConsistencyCheck { + pub new: set_bypass_consistency_check::New, + } + pub mod set_bypass_consistency_check { + use super::runtime_types; + pub type New = ::core::primitive::bool; + } + impl SetBypassConsistencyCheck { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_bypass_consistency_check"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetBypassConsistencyCheck { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the asynchronous backing parameters."] - pub fn set_async_backing_params( - &self, - new: types::set_async_backing_params::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetAsyncBackingParams, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_async_backing_params", - types::SetAsyncBackingParams { new }, - [ - 28u8, 148u8, 243u8, 41u8, 68u8, 91u8, 113u8, 162u8, 126u8, 115u8, - 122u8, 220u8, 126u8, 19u8, 119u8, 236u8, 20u8, 112u8, 181u8, 76u8, - 191u8, 225u8, 44u8, 207u8, 85u8, 246u8, 10u8, 167u8, 132u8, 211u8, - 14u8, 83u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the asynchronous backing parameters."] + pub struct SetAsyncBackingParams { + pub new: set_async_backing_params::New, + } + pub mod set_async_backing_params { + use super::runtime_types; + pub type New = + runtime_types::polkadot_primitives::v9::async_backing::AsyncBackingParams; + } + impl SetAsyncBackingParams { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_async_backing_params"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetAsyncBackingParams { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set PVF executor parameters."] - pub fn set_executor_params( - &self, - new: types::set_executor_params::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_executor_params", - types::SetExecutorParams { new }, - [ - 79u8, 167u8, 242u8, 14u8, 22u8, 177u8, 240u8, 134u8, 154u8, 77u8, - 233u8, 188u8, 110u8, 223u8, 25u8, 52u8, 58u8, 241u8, 226u8, 255u8, 2u8, - 26u8, 8u8, 241u8, 125u8, 33u8, 63u8, 204u8, 93u8, 31u8, 229u8, 0u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set PVF executor parameters."] + pub struct SetExecutorParams { + pub new: set_executor_params::New, + } + pub mod set_executor_params { + use super::runtime_types; + pub type New = + runtime_types::polkadot_primitives::v9::executor_params::ExecutorParams; + } + impl SetExecutorParams { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_executor_params"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetExecutorParams { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the on demand (parathreads) base fee."] - pub fn set_on_demand_base_fee( - &self, - new: types::set_on_demand_base_fee::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_on_demand_base_fee", - types::SetOnDemandBaseFee { new }, - [ - 181u8, 205u8, 34u8, 186u8, 152u8, 91u8, 76u8, 55u8, 128u8, 116u8, 44u8, - 32u8, 71u8, 33u8, 247u8, 146u8, 134u8, 15u8, 181u8, 229u8, 105u8, 67u8, - 148u8, 214u8, 211u8, 84u8, 93u8, 122u8, 235u8, 204u8, 63u8, 13u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the on demand (parathreads) base fee."] + pub struct SetOnDemandBaseFee { + pub new: set_on_demand_base_fee::New, + } + pub mod set_on_demand_base_fee { + use super::runtime_types; + pub type New = ::core::primitive::u128; + } + impl SetOnDemandBaseFee { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_on_demand_base_fee"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetOnDemandBaseFee { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the on demand (parathreads) fee variability."] - pub fn set_on_demand_fee_variability( - &self, - new: types::set_on_demand_fee_variability::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetOnDemandFeeVariability, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_on_demand_fee_variability", - types::SetOnDemandFeeVariability { new }, - [ - 255u8, 132u8, 238u8, 200u8, 152u8, 248u8, 89u8, 87u8, 160u8, 38u8, - 38u8, 7u8, 137u8, 178u8, 176u8, 10u8, 63u8, 250u8, 95u8, 68u8, 39u8, - 147u8, 5u8, 214u8, 223u8, 44u8, 225u8, 10u8, 233u8, 155u8, 202u8, - 232u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the on demand (parathreads) fee variability."] + pub struct SetOnDemandFeeVariability { + pub new: set_on_demand_fee_variability::New, + } + pub mod set_on_demand_fee_variability { + use super::runtime_types; + pub type New = runtime_types::sp_arithmetic::per_things::Perbill; + } + impl SetOnDemandFeeVariability { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_on_demand_fee_variability"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetOnDemandFeeVariability { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the on demand (parathreads) queue max size."] - pub fn set_on_demand_queue_max_size( - &self, - new: types::set_on_demand_queue_max_size::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetOnDemandQueueMaxSize, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_on_demand_queue_max_size", - types::SetOnDemandQueueMaxSize { new }, - [ - 207u8, 222u8, 29u8, 91u8, 8u8, 250u8, 0u8, 153u8, 230u8, 206u8, 87u8, - 4u8, 248u8, 28u8, 120u8, 55u8, 24u8, 45u8, 103u8, 75u8, 25u8, 239u8, - 61u8, 238u8, 11u8, 63u8, 82u8, 219u8, 154u8, 27u8, 130u8, 173u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the on demand (parathreads) queue max size."] + pub struct SetOnDemandQueueMaxSize { + pub new: set_on_demand_queue_max_size::New, + } + pub mod set_on_demand_queue_max_size { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetOnDemandQueueMaxSize { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_on_demand_queue_max_size"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetOnDemandQueueMaxSize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the on demand (parathreads) fee variability."] - pub fn set_on_demand_target_queue_utilization( - &self, - new: types::set_on_demand_target_queue_utilization::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetOnDemandTargetQueueUtilization, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_on_demand_target_queue_utilization", - types::SetOnDemandTargetQueueUtilization { new }, - [ - 78u8, 98u8, 234u8, 149u8, 254u8, 231u8, 174u8, 232u8, 246u8, 16u8, - 218u8, 142u8, 156u8, 247u8, 70u8, 214u8, 144u8, 159u8, 71u8, 241u8, - 178u8, 102u8, 251u8, 153u8, 208u8, 222u8, 121u8, 139u8, 66u8, 146u8, - 94u8, 147u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the on demand (parathreads) fee variability."] + pub struct SetOnDemandTargetQueueUtilization { + pub new: set_on_demand_target_queue_utilization::New, + } + pub mod set_on_demand_target_queue_utilization { + use super::runtime_types; + pub type New = runtime_types::sp_arithmetic::per_things::Perbill; + } + impl SetOnDemandTargetQueueUtilization { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_on_demand_target_queue_utilization"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetOnDemandTargetQueueUtilization { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the minimum backing votes threshold."] - pub fn set_minimum_backing_votes( - &self, - new: types::set_minimum_backing_votes::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetMinimumBackingVotes, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_minimum_backing_votes", - types::SetMinimumBackingVotes { new }, - [ - 55u8, 209u8, 98u8, 156u8, 31u8, 150u8, 61u8, 19u8, 3u8, 55u8, 113u8, - 209u8, 171u8, 143u8, 241u8, 93u8, 178u8, 169u8, 39u8, 241u8, 98u8, - 53u8, 12u8, 148u8, 175u8, 50u8, 164u8, 38u8, 34u8, 183u8, 105u8, 178u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the minimum backing votes threshold."] + pub struct SetMinimumBackingVotes { + pub new: set_minimum_backing_votes::New, + } + pub mod set_minimum_backing_votes { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl SetMinimumBackingVotes { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_minimum_backing_votes"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMinimumBackingVotes { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set/Unset a node feature."] - pub fn set_node_feature( - &self, - index: types::set_node_feature::Index, - value: types::set_node_feature::Value, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_node_feature", - types::SetNodeFeature { index, value }, - [ - 255u8, 19u8, 208u8, 76u8, 122u8, 6u8, 42u8, 182u8, 118u8, 151u8, 245u8, - 80u8, 162u8, 243u8, 45u8, 57u8, 122u8, 148u8, 98u8, 170u8, 157u8, 40u8, - 92u8, 234u8, 12u8, 141u8, 54u8, 80u8, 97u8, 249u8, 115u8, 27u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set/Unset a node feature."] + pub struct SetNodeFeature { + pub index: set_node_feature::Index, + pub value: set_node_feature::Value, + } + pub mod set_node_feature { + use super::runtime_types; + pub type Index = ::core::primitive::u8; + pub type Value = ::core::primitive::bool; + } + impl SetNodeFeature { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_node_feature"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetNodeFeature { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set approval-voting-params."] - pub fn set_approval_voting_params( - &self, - new: types::set_approval_voting_params::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SetApprovalVotingParams, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_approval_voting_params", - types::SetApprovalVotingParams { new }, - [ - 248u8, 81u8, 74u8, 103u8, 28u8, 108u8, 190u8, 177u8, 201u8, 252u8, - 87u8, 236u8, 20u8, 189u8, 192u8, 173u8, 40u8, 160u8, 170u8, 187u8, - 42u8, 108u8, 184u8, 131u8, 120u8, 237u8, 229u8, 240u8, 128u8, 49u8, - 163u8, 11u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set approval-voting-params."] + pub struct SetApprovalVotingParams { + pub new: set_approval_voting_params::New, + } + pub mod set_approval_voting_params { + use super::runtime_types; + pub type New = runtime_types::polkadot_primitives::v9::ApprovalVotingParams; + } + impl SetApprovalVotingParams { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_approval_voting_params"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetApprovalVotingParams { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set scheduler-params."] - pub fn set_scheduler_params( - &self, - new: types::set_scheduler_params::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Configuration", - "set_scheduler_params", - types::SetSchedulerParams { new }, - [ - 191u8, 87u8, 235u8, 71u8, 143u8, 46u8, 2u8, 88u8, 111u8, 15u8, 251u8, - 230u8, 241u8, 172u8, 183u8, 110u8, 33u8, 26u8, 43u8, 119u8, 74u8, 62u8, - 200u8, 226u8, 83u8, 180u8, 123u8, 132u8, 171u8, 65u8, 30u8, 13u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set scheduler-params."] + pub struct SetSchedulerParams { + pub new: set_scheduler_params::New, + } + pub mod set_scheduler_params { + use super::runtime_types; + pub type New = + runtime_types::polkadot_primitives::v9::SchedulerParams<::core::primitive::u32>; + } + impl SetSchedulerParams { + const PALLET_NAME: &'static str = "Configuration"; + const CALL_NAME: &'static str = "set_scheduler_params"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetSchedulerParams { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the validation upgrade cooldown."] + pub fn set_validation_upgrade_cooldown( + &self, + new: super::set_validation_upgrade_cooldown::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_validation_upgrade_cooldown", + super::SetValidationUpgradeCooldown { new }, + [ + 233u8, 224u8, 19u8, 198u8, 27u8, 104u8, 64u8, 248u8, 223u8, 51u8, + 175u8, 162u8, 183u8, 43u8, 108u8, 246u8, 162u8, 210u8, 53u8, 56u8, + 174u8, 203u8, 79u8, 143u8, 13u8, 101u8, 100u8, 11u8, 127u8, 76u8, + 71u8, 228u8, + ], + ) + } + #[doc = "Set the validation upgrade delay."] + pub fn set_validation_upgrade_delay( + &self, + new: super::set_validation_upgrade_delay::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_validation_upgrade_delay", + super::SetValidationUpgradeDelay { new }, + [ + 13u8, 139u8, 210u8, 115u8, 20u8, 121u8, 55u8, 118u8, 101u8, 236u8, + 95u8, 79u8, 46u8, 44u8, 129u8, 129u8, 60u8, 198u8, 13u8, 17u8, + 115u8, 187u8, 181u8, 37u8, 75u8, 153u8, 13u8, 196u8, 49u8, 204u8, + 26u8, 198u8, + ], + ) + } + #[doc = "Set the acceptance period for an included candidate."] + pub fn set_code_retention_period( + &self, + new: super::set_code_retention_period::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_code_retention_period", + super::SetCodeRetentionPeriod { new }, + [ + 169u8, 77u8, 107u8, 175u8, 172u8, 177u8, 169u8, 194u8, 219u8, 6u8, + 192u8, 40u8, 55u8, 241u8, 128u8, 111u8, 95u8, 67u8, 173u8, 247u8, + 220u8, 66u8, 45u8, 76u8, 108u8, 137u8, 220u8, 194u8, 86u8, 41u8, + 245u8, 226u8, + ], + ) + } + #[doc = "Set the max validation code size for incoming upgrades."] + pub fn set_max_code_size( + &self, + new: super::set_max_code_size::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_max_code_size", + super::SetMaxCodeSize { new }, + [ + 122u8, 74u8, 244u8, 226u8, 89u8, 175u8, 191u8, 163u8, 34u8, 79u8, + 118u8, 254u8, 236u8, 215u8, 8u8, 182u8, 71u8, 180u8, 224u8, 165u8, + 226u8, 242u8, 124u8, 34u8, 38u8, 27u8, 29u8, 140u8, 187u8, 93u8, + 131u8, 168u8, + ], + ) + } + #[doc = "Set the max POV block size for incoming upgrades."] + pub fn set_max_pov_size( + &self, + new: super::set_max_pov_size::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_max_pov_size", + super::SetMaxPovSize { new }, + [ + 170u8, 106u8, 163u8, 4u8, 27u8, 72u8, 250u8, 59u8, 133u8, 128u8, + 177u8, 209u8, 22u8, 42u8, 230u8, 40u8, 192u8, 198u8, 56u8, 195u8, + 31u8, 20u8, 35u8, 196u8, 119u8, 183u8, 141u8, 38u8, 52u8, 54u8, + 31u8, 122u8, + ], + ) + } + #[doc = "Set the max head data size for paras."] + pub fn set_max_head_data_size( + &self, + new: super::set_max_head_data_size::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_max_head_data_size", + super::SetMaxHeadDataSize { new }, + [ + 216u8, 146u8, 104u8, 253u8, 123u8, 192u8, 123u8, 82u8, 149u8, 22u8, + 31u8, 107u8, 67u8, 102u8, 163u8, 239u8, 57u8, 183u8, 93u8, 20u8, + 126u8, 39u8, 36u8, 242u8, 252u8, 68u8, 150u8, 121u8, 147u8, 186u8, + 39u8, 181u8, + ], + ) + } + #[doc = "Set the number of coretime execution cores."] + #[doc = ""] + #[doc = "NOTE: that this configuration is managed by the coretime chain. Only manually change"] + #[doc = "this, if you really know what you are doing!"] + pub fn set_coretime_cores( + &self, + new: super::set_coretime_cores::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_coretime_cores", + super::SetCoretimeCores { new }, + [ + 179u8, 131u8, 211u8, 152u8, 167u8, 6u8, 108u8, 94u8, 179u8, 97u8, + 87u8, 227u8, 57u8, 120u8, 133u8, 130u8, 59u8, 243u8, 224u8, 2u8, + 11u8, 86u8, 251u8, 77u8, 159u8, 177u8, 145u8, 34u8, 117u8, 93u8, + 28u8, 52u8, + ], + ) + } + #[doc = "Set the parachain validator-group rotation frequency"] + pub fn set_group_rotation_frequency( + &self, + new: super::set_group_rotation_frequency::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_group_rotation_frequency", + super::SetGroupRotationFrequency { new }, + [ + 33u8, 142u8, 63u8, 205u8, 128u8, 109u8, 157u8, 33u8, 122u8, 91u8, + 57u8, 223u8, 134u8, 80u8, 108u8, 187u8, 147u8, 120u8, 104u8, 170u8, + 32u8, 135u8, 102u8, 38u8, 82u8, 20u8, 123u8, 211u8, 245u8, 91u8, + 134u8, 44u8, + ], + ) + } + #[doc = "Set the availability period for paras."] + pub fn set_paras_availability_period( + &self, + new: super::set_paras_availability_period::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_paras_availability_period", + super::SetParasAvailabilityPeriod { new }, + [ + 83u8, 171u8, 219u8, 129u8, 231u8, 54u8, 45u8, 19u8, 167u8, 21u8, + 232u8, 205u8, 166u8, 83u8, 234u8, 101u8, 205u8, 248u8, 74u8, 39u8, + 130u8, 15u8, 92u8, 39u8, 239u8, 111u8, 215u8, 165u8, 149u8, 11u8, + 89u8, 119u8, + ], + ) + } + #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] + pub fn set_scheduling_lookahead( + &self, + new: super::set_scheduling_lookahead::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_scheduling_lookahead", + super::SetSchedulingLookahead { new }, + [ + 176u8, 115u8, 251u8, 197u8, 19u8, 106u8, 253u8, 224u8, 149u8, 96u8, + 238u8, 106u8, 19u8, 19u8, 89u8, 249u8, 186u8, 89u8, 144u8, 116u8, + 251u8, 30u8, 157u8, 237u8, 125u8, 153u8, 86u8, 6u8, 251u8, 170u8, + 73u8, 216u8, + ], + ) + } + #[doc = "Set the maximum number of validators to assign to any core."] + pub fn set_max_validators_per_core( + &self, + new: super::set_max_validators_per_core::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_max_validators_per_core", + super::SetMaxValidatorsPerCore { new }, + [ + 152u8, 112u8, 244u8, 133u8, 209u8, 166u8, 55u8, 155u8, 12u8, 216u8, + 62u8, 111u8, 81u8, 52u8, 194u8, 121u8, 172u8, 201u8, 204u8, 139u8, + 198u8, 238u8, 9u8, 49u8, 119u8, 236u8, 46u8, 0u8, 179u8, 234u8, + 92u8, 45u8, + ], + ) + } + #[doc = "Set the maximum number of validators to use in parachain consensus."] + pub fn set_max_validators( + &self, + new: super::set_max_validators::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_max_validators", + super::SetMaxValidators { new }, + [ + 219u8, 76u8, 191u8, 139u8, 250u8, 154u8, 232u8, 176u8, 248u8, + 154u8, 185u8, 89u8, 135u8, 151u8, 183u8, 132u8, 72u8, 63u8, 101u8, + 183u8, 142u8, 169u8, 163u8, 226u8, 24u8, 139u8, 78u8, 155u8, 3u8, + 136u8, 142u8, 137u8, + ], + ) + } + #[doc = "Set the dispute period, in number of sessions to keep for disputes."] + pub fn set_dispute_period( + &self, + new: super::set_dispute_period::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_dispute_period", + super::SetDisputePeriod { new }, + [ + 104u8, 229u8, 235u8, 207u8, 136u8, 207u8, 181u8, 99u8, 0u8, 84u8, + 200u8, 244u8, 220u8, 52u8, 64u8, 26u8, 232u8, 212u8, 242u8, 190u8, + 67u8, 180u8, 171u8, 200u8, 181u8, 23u8, 32u8, 240u8, 231u8, 217u8, + 23u8, 146u8, + ], + ) + } + #[doc = "Set the dispute post conclusion acceptance period."] + pub fn set_dispute_post_conclusion_acceptance_period( + &self, + new: super::set_dispute_post_conclusion_acceptance_period::New, + ) -> ::subxt::transactions::StaticPayload< + super::SetDisputePostConclusionAcceptancePeriod, + > { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_dispute_post_conclusion_acceptance_period", + super::SetDisputePostConclusionAcceptancePeriod { new }, + [ + 251u8, 176u8, 139u8, 76u8, 7u8, 246u8, 198u8, 190u8, 39u8, 249u8, + 95u8, 226u8, 53u8, 186u8, 112u8, 101u8, 229u8, 80u8, 240u8, 185u8, + 108u8, 228u8, 91u8, 103u8, 128u8, 218u8, 231u8, 210u8, 164u8, + 197u8, 84u8, 149u8, + ], + ) + } + #[doc = "Set the no show slots, in number of number of consensus slots."] + #[doc = "Must be at least 1."] + pub fn set_no_show_slots( + &self, + new: super::set_no_show_slots::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_no_show_slots", + super::SetNoShowSlots { new }, + [ + 123u8, 204u8, 253u8, 222u8, 224u8, 215u8, 247u8, 154u8, 225u8, + 79u8, 29u8, 171u8, 107u8, 216u8, 215u8, 14u8, 8u8, 230u8, 49u8, + 97u8, 20u8, 84u8, 70u8, 33u8, 254u8, 63u8, 186u8, 7u8, 184u8, + 135u8, 74u8, 139u8, + ], + ) + } + #[doc = "Set the total number of delay tranches."] + pub fn set_n_delay_tranches( + &self, + new: super::set_n_delay_tranches::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_n_delay_tranches", + super::SetNDelayTranches { new }, + [ + 157u8, 177u8, 251u8, 227u8, 118u8, 250u8, 129u8, 254u8, 33u8, + 250u8, 61u8, 148u8, 189u8, 92u8, 49u8, 119u8, 107u8, 40u8, 255u8, + 119u8, 241u8, 188u8, 109u8, 240u8, 229u8, 169u8, 31u8, 62u8, 174u8, + 14u8, 247u8, 235u8, + ], + ) + } + #[doc = "Set the zeroth delay tranche width."] + pub fn set_zeroth_delay_tranche_width( + &self, + new: super::set_zeroth_delay_tranche_width::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_zeroth_delay_tranche_width", + super::SetZerothDelayTrancheWidth { new }, + [ + 30u8, 195u8, 15u8, 51u8, 210u8, 159u8, 254u8, 207u8, 121u8, 172u8, + 107u8, 241u8, 55u8, 100u8, 159u8, 55u8, 76u8, 47u8, 86u8, 93u8, + 221u8, 34u8, 136u8, 97u8, 224u8, 141u8, 46u8, 181u8, 246u8, 137u8, + 79u8, 57u8, + ], + ) + } + #[doc = "Set the number of validators needed to approve a block."] + pub fn set_needed_approvals( + &self, + new: super::set_needed_approvals::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_needed_approvals", + super::SetNeededApprovals { new }, + [ + 245u8, 105u8, 16u8, 120u8, 28u8, 231u8, 6u8, 50u8, 143u8, 102u8, + 1u8, 97u8, 224u8, 232u8, 187u8, 164u8, 200u8, 31u8, 129u8, 139u8, + 79u8, 170u8, 14u8, 147u8, 117u8, 13u8, 98u8, 16u8, 64u8, 169u8, + 46u8, 41u8, + ], + ) + } + #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] + pub fn set_relay_vrf_modulo_samples( + &self, + new: super::set_relay_vrf_modulo_samples::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_relay_vrf_modulo_samples", + super::SetRelayVrfModuloSamples { new }, + [ + 96u8, 100u8, 42u8, 61u8, 244u8, 226u8, 135u8, 187u8, 56u8, 193u8, + 247u8, 236u8, 38u8, 40u8, 242u8, 222u8, 176u8, 209u8, 211u8, 217u8, + 178u8, 32u8, 160u8, 56u8, 23u8, 60u8, 222u8, 166u8, 134u8, 72u8, + 153u8, 14u8, + ], + ) + } + #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] + pub fn set_max_upward_queue_count( + &self, + new: super::set_max_upward_queue_count::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_max_upward_queue_count", + super::SetMaxUpwardQueueCount { new }, + [ + 187u8, 102u8, 178u8, 141u8, 245u8, 8u8, 221u8, 174u8, 128u8, 239u8, + 104u8, 120u8, 202u8, 220u8, 46u8, 27u8, 175u8, 26u8, 1u8, 170u8, + 193u8, 70u8, 176u8, 13u8, 223u8, 57u8, 153u8, 161u8, 228u8, 175u8, + 226u8, 202u8, + ], + ) + } + #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at"] + #[doc = "once."] + pub fn set_max_upward_queue_size( + &self, + new: super::set_max_upward_queue_size::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_max_upward_queue_size", + super::SetMaxUpwardQueueSize { new }, + [ + 245u8, 234u8, 151u8, 232u8, 49u8, 193u8, 60u8, 21u8, 103u8, 238u8, + 194u8, 73u8, 238u8, 160u8, 48u8, 88u8, 143u8, 197u8, 110u8, 230u8, + 213u8, 149u8, 171u8, 94u8, 77u8, 6u8, 139u8, 191u8, 158u8, 62u8, + 181u8, 32u8, + ], + ) + } + #[doc = "Set the critical downward message size."] + pub fn set_max_downward_message_size( + &self, + new: super::set_max_downward_message_size::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_max_downward_message_size", + super::SetMaxDownwardMessageSize { new }, + [ + 63u8, 112u8, 231u8, 193u8, 226u8, 6u8, 119u8, 35u8, 60u8, 34u8, + 85u8, 15u8, 168u8, 16u8, 176u8, 116u8, 169u8, 114u8, 42u8, 208u8, + 89u8, 188u8, 22u8, 145u8, 248u8, 87u8, 74u8, 168u8, 0u8, 202u8, + 112u8, 13u8, + ], + ) + } + #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] + pub fn set_max_upward_message_size( + &self, + new: super::set_max_upward_message_size::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_max_upward_message_size", + super::SetMaxUpwardMessageSize { new }, + [ + 237u8, 108u8, 33u8, 245u8, 65u8, 209u8, 201u8, 97u8, 126u8, 194u8, + 195u8, 8u8, 144u8, 223u8, 148u8, 242u8, 97u8, 214u8, 38u8, 231u8, + 123u8, 143u8, 34u8, 199u8, 100u8, 183u8, 211u8, 111u8, 250u8, + 245u8, 10u8, 38u8, + ], + ) + } + #[doc = "Sets the maximum number of messages that a candidate can contain."] + pub fn set_max_upward_message_num_per_candidate( + &self, + new: super::set_max_upward_message_num_per_candidate::New, + ) -> ::subxt::transactions::StaticPayload< + super::SetMaxUpwardMessageNumPerCandidate, + > { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_max_upward_message_num_per_candidate", + super::SetMaxUpwardMessageNumPerCandidate { new }, + [ + 183u8, 121u8, 87u8, 193u8, 8u8, 160u8, 107u8, 80u8, 50u8, 8u8, + 75u8, 185u8, 195u8, 248u8, 75u8, 174u8, 210u8, 108u8, 149u8, 20u8, + 66u8, 153u8, 20u8, 203u8, 92u8, 99u8, 27u8, 69u8, 212u8, 212u8, + 35u8, 49u8, + ], + ) + } + #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] + pub fn set_hrmp_open_request_ttl( + &self, + new: super::set_hrmp_open_request_ttl::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_hrmp_open_request_ttl", + super::SetHrmpOpenRequestTtl { new }, + [ + 233u8, 46u8, 165u8, 59u8, 196u8, 77u8, 161u8, 124u8, 252u8, 98u8, + 8u8, 52u8, 80u8, 17u8, 12u8, 50u8, 25u8, 127u8, 143u8, 252u8, + 230u8, 10u8, 193u8, 251u8, 167u8, 73u8, 40u8, 63u8, 203u8, 119u8, + 208u8, 254u8, + ], + ) + } + #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] + pub fn set_hrmp_sender_deposit( + &self, + new: super::set_hrmp_sender_deposit::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_hrmp_sender_deposit", + super::SetHrmpSenderDeposit { new }, + [ + 4u8, 141u8, 15u8, 87u8, 237u8, 39u8, 225u8, 108u8, 159u8, 240u8, + 121u8, 212u8, 225u8, 155u8, 168u8, 28u8, 61u8, 119u8, 232u8, 216u8, + 194u8, 172u8, 147u8, 16u8, 50u8, 100u8, 146u8, 146u8, 69u8, 252u8, + 94u8, 47u8, + ], + ) + } + #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] + #[doc = "channel."] + pub fn set_hrmp_recipient_deposit( + &self, + new: super::set_hrmp_recipient_deposit::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_hrmp_recipient_deposit", + super::SetHrmpRecipientDeposit { new }, + [ + 242u8, 193u8, 202u8, 91u8, 69u8, 252u8, 101u8, 52u8, 162u8, 107u8, + 165u8, 69u8, 90u8, 150u8, 62u8, 239u8, 167u8, 2u8, 221u8, 3u8, + 231u8, 252u8, 82u8, 125u8, 212u8, 174u8, 47u8, 216u8, 219u8, 237u8, + 242u8, 144u8, + ], + ) + } + #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] + pub fn set_hrmp_channel_max_capacity( + &self, + new: super::set_hrmp_channel_max_capacity::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_hrmp_channel_max_capacity", + super::SetHrmpChannelMaxCapacity { new }, + [ + 140u8, 138u8, 197u8, 45u8, 144u8, 102u8, 150u8, 172u8, 110u8, 6u8, + 99u8, 130u8, 62u8, 217u8, 119u8, 110u8, 180u8, 132u8, 102u8, 161u8, + 78u8, 59u8, 209u8, 44u8, 120u8, 183u8, 13u8, 88u8, 89u8, 15u8, + 224u8, 224u8, + ], + ) + } + #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] + pub fn set_hrmp_channel_max_total_size( + &self, + new: super::set_hrmp_channel_max_total_size::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_hrmp_channel_max_total_size", + super::SetHrmpChannelMaxTotalSize { new }, + [ + 149u8, 21u8, 229u8, 107u8, 125u8, 28u8, 17u8, 155u8, 45u8, 230u8, + 50u8, 64u8, 16u8, 171u8, 24u8, 58u8, 246u8, 57u8, 247u8, 20u8, + 34u8, 217u8, 206u8, 157u8, 40u8, 205u8, 187u8, 205u8, 199u8, 24u8, + 115u8, 214u8, + ], + ) + } + #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] + pub fn set_hrmp_max_parachain_inbound_channels( + &self, + new: super::set_hrmp_max_parachain_inbound_channels::New, + ) -> ::subxt::transactions::StaticPayload< + super::SetHrmpMaxParachainInboundChannels, + > { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_hrmp_max_parachain_inbound_channels", + super::SetHrmpMaxParachainInboundChannels { new }, + [ + 203u8, 10u8, 55u8, 21u8, 21u8, 254u8, 74u8, 97u8, 34u8, 117u8, + 160u8, 183u8, 168u8, 235u8, 11u8, 9u8, 137u8, 141u8, 150u8, 80u8, + 32u8, 41u8, 118u8, 40u8, 28u8, 74u8, 155u8, 7u8, 63u8, 217u8, 39u8, + 104u8, + ], + ) + } + #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] + pub fn set_hrmp_channel_max_message_size( + &self, + new: super::set_hrmp_channel_max_message_size::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_hrmp_channel_max_message_size", + super::SetHrmpChannelMaxMessageSize { new }, + [ + 153u8, 216u8, 55u8, 31u8, 189u8, 173u8, 23u8, 6u8, 213u8, 103u8, + 205u8, 154u8, 115u8, 105u8, 84u8, 133u8, 94u8, 254u8, 47u8, 128u8, + 130u8, 114u8, 227u8, 102u8, 214u8, 146u8, 215u8, 183u8, 179u8, + 151u8, 43u8, 187u8, + ], + ) + } + #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] + pub fn set_hrmp_max_parachain_outbound_channels( + &self, + new: super::set_hrmp_max_parachain_outbound_channels::New, + ) -> ::subxt::transactions::StaticPayload< + super::SetHrmpMaxParachainOutboundChannels, + > { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_hrmp_max_parachain_outbound_channels", + super::SetHrmpMaxParachainOutboundChannels { new }, + [ + 91u8, 100u8, 158u8, 17u8, 123u8, 31u8, 6u8, 92u8, 80u8, 92u8, 83u8, + 195u8, 234u8, 207u8, 55u8, 88u8, 75u8, 81u8, 219u8, 131u8, 234u8, + 5u8, 75u8, 236u8, 57u8, 93u8, 70u8, 145u8, 255u8, 171u8, 25u8, + 174u8, + ], + ) + } + #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] + pub fn set_hrmp_max_message_num_per_candidate( + &self, + new: super::set_hrmp_max_message_num_per_candidate::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_hrmp_max_message_num_per_candidate", + super::SetHrmpMaxMessageNumPerCandidate { new }, + [ + 179u8, 44u8, 231u8, 12u8, 166u8, 160u8, 223u8, 164u8, 218u8, 173u8, + 157u8, 49u8, 16u8, 220u8, 0u8, 224u8, 67u8, 194u8, 210u8, 207u8, + 237u8, 96u8, 96u8, 24u8, 71u8, 237u8, 30u8, 152u8, 105u8, 245u8, + 157u8, 218u8, + ], + ) + } + #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] + pub fn set_pvf_voting_ttl( + &self, + new: super::set_pvf_voting_ttl::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_pvf_voting_ttl", + super::SetPvfVotingTtl { new }, + [ + 115u8, 135u8, 76u8, 222u8, 214u8, 80u8, 103u8, 250u8, 194u8, 34u8, + 129u8, 245u8, 216u8, 69u8, 166u8, 247u8, 138u8, 94u8, 135u8, 228u8, + 90u8, 145u8, 2u8, 244u8, 73u8, 178u8, 61u8, 251u8, 21u8, 197u8, + 202u8, 246u8, + ], + ) + } + #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] + #[doc = "upgrade taking place."] + #[doc = ""] + #[doc = "See the field documentation for information and constraints for the new value."] + pub fn set_minimum_validation_upgrade_delay( + &self, + new: super::set_minimum_validation_upgrade_delay::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_minimum_validation_upgrade_delay", + super::SetMinimumValidationUpgradeDelay { new }, + [ + 143u8, 217u8, 201u8, 206u8, 206u8, 244u8, 116u8, 118u8, 13u8, + 169u8, 132u8, 125u8, 253u8, 178u8, 196u8, 12u8, 251u8, 32u8, 201u8, + 133u8, 50u8, 59u8, 37u8, 169u8, 198u8, 112u8, 136u8, 47u8, 205u8, + 141u8, 191u8, 212u8, + ], + ) + } + #[doc = "Setting this to true will disable consistency checks for the configuration setters."] + #[doc = "Use with caution."] + pub fn set_bypass_consistency_check( + &self, + new: super::set_bypass_consistency_check::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_bypass_consistency_check", + super::SetBypassConsistencyCheck { new }, + [ + 11u8, 211u8, 68u8, 221u8, 178u8, 108u8, 101u8, 55u8, 107u8, 135u8, + 203u8, 112u8, 173u8, 161u8, 23u8, 104u8, 95u8, 200u8, 46u8, 231u8, + 114u8, 3u8, 8u8, 89u8, 147u8, 141u8, 55u8, 65u8, 125u8, 45u8, + 218u8, 78u8, + ], + ) + } + #[doc = "Set the asynchronous backing parameters."] + pub fn set_async_backing_params( + &self, + new: super::set_async_backing_params::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_async_backing_params", + super::SetAsyncBackingParams { new }, + [ + 28u8, 148u8, 243u8, 41u8, 68u8, 91u8, 113u8, 162u8, 126u8, 115u8, + 122u8, 220u8, 126u8, 19u8, 119u8, 236u8, 20u8, 112u8, 181u8, 76u8, + 191u8, 225u8, 44u8, 207u8, 85u8, 246u8, 10u8, 167u8, 132u8, 211u8, + 14u8, 83u8, + ], + ) + } + #[doc = "Set PVF executor parameters."] + pub fn set_executor_params( + &self, + new: super::set_executor_params::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_executor_params", + super::SetExecutorParams { new }, + [ + 79u8, 167u8, 242u8, 14u8, 22u8, 177u8, 240u8, 134u8, 154u8, 77u8, + 233u8, 188u8, 110u8, 223u8, 25u8, 52u8, 58u8, 241u8, 226u8, 255u8, + 2u8, 26u8, 8u8, 241u8, 125u8, 33u8, 63u8, 204u8, 93u8, 31u8, 229u8, + 0u8, + ], + ) + } + #[doc = "Set the on demand (parathreads) base fee."] + pub fn set_on_demand_base_fee( + &self, + new: super::set_on_demand_base_fee::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_on_demand_base_fee", + super::SetOnDemandBaseFee { new }, + [ + 181u8, 205u8, 34u8, 186u8, 152u8, 91u8, 76u8, 55u8, 128u8, 116u8, + 44u8, 32u8, 71u8, 33u8, 247u8, 146u8, 134u8, 15u8, 181u8, 229u8, + 105u8, 67u8, 148u8, 214u8, 211u8, 84u8, 93u8, 122u8, 235u8, 204u8, + 63u8, 13u8, + ], + ) + } + #[doc = "Set the on demand (parathreads) fee variability."] + pub fn set_on_demand_fee_variability( + &self, + new: super::set_on_demand_fee_variability::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_on_demand_fee_variability", + super::SetOnDemandFeeVariability { new }, + [ + 255u8, 132u8, 238u8, 200u8, 152u8, 248u8, 89u8, 87u8, 160u8, 38u8, + 38u8, 7u8, 137u8, 178u8, 176u8, 10u8, 63u8, 250u8, 95u8, 68u8, + 39u8, 147u8, 5u8, 214u8, 223u8, 44u8, 225u8, 10u8, 233u8, 155u8, + 202u8, 232u8, + ], + ) + } + #[doc = "Set the on demand (parathreads) queue max size."] + pub fn set_on_demand_queue_max_size( + &self, + new: super::set_on_demand_queue_max_size::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_on_demand_queue_max_size", + super::SetOnDemandQueueMaxSize { new }, + [ + 207u8, 222u8, 29u8, 91u8, 8u8, 250u8, 0u8, 153u8, 230u8, 206u8, + 87u8, 4u8, 248u8, 28u8, 120u8, 55u8, 24u8, 45u8, 103u8, 75u8, 25u8, + 239u8, 61u8, 238u8, 11u8, 63u8, 82u8, 219u8, 154u8, 27u8, 130u8, + 173u8, + ], + ) + } + #[doc = "Set the on demand (parathreads) fee variability."] + pub fn set_on_demand_target_queue_utilization( + &self, + new: super::set_on_demand_target_queue_utilization::New, + ) -> ::subxt::transactions::StaticPayload< + super::SetOnDemandTargetQueueUtilization, + > { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_on_demand_target_queue_utilization", + super::SetOnDemandTargetQueueUtilization { new }, + [ + 78u8, 98u8, 234u8, 149u8, 254u8, 231u8, 174u8, 232u8, 246u8, 16u8, + 218u8, 142u8, 156u8, 247u8, 70u8, 214u8, 144u8, 159u8, 71u8, 241u8, + 178u8, 102u8, 251u8, 153u8, 208u8, 222u8, 121u8, 139u8, 66u8, + 146u8, 94u8, 147u8, + ], + ) + } + #[doc = "Set the minimum backing votes threshold."] + pub fn set_minimum_backing_votes( + &self, + new: super::set_minimum_backing_votes::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_minimum_backing_votes", + super::SetMinimumBackingVotes { new }, + [ + 55u8, 209u8, 98u8, 156u8, 31u8, 150u8, 61u8, 19u8, 3u8, 55u8, + 113u8, 209u8, 171u8, 143u8, 241u8, 93u8, 178u8, 169u8, 39u8, 241u8, + 98u8, 53u8, 12u8, 148u8, 175u8, 50u8, 164u8, 38u8, 34u8, 183u8, + 105u8, 178u8, + ], + ) + } + #[doc = "Set/Unset a node feature."] + pub fn set_node_feature( + &self, + index: super::set_node_feature::Index, + value: super::set_node_feature::Value, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_node_feature", + super::SetNodeFeature { index, value }, + [ + 255u8, 19u8, 208u8, 76u8, 122u8, 6u8, 42u8, 182u8, 118u8, 151u8, + 245u8, 80u8, 162u8, 243u8, 45u8, 57u8, 122u8, 148u8, 98u8, 170u8, + 157u8, 40u8, 92u8, 234u8, 12u8, 141u8, 54u8, 80u8, 97u8, 249u8, + 115u8, 27u8, + ], + ) + } + #[doc = "Set approval-voting-params."] + pub fn set_approval_voting_params( + &self, + new: super::set_approval_voting_params::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_approval_voting_params", + super::SetApprovalVotingParams { new }, + [ + 248u8, 81u8, 74u8, 103u8, 28u8, 108u8, 190u8, 177u8, 201u8, 252u8, + 87u8, 236u8, 20u8, 189u8, 192u8, 173u8, 40u8, 160u8, 170u8, 187u8, + 42u8, 108u8, 184u8, 131u8, 120u8, 237u8, 229u8, 240u8, 128u8, 49u8, + 163u8, 11u8, + ], + ) + } + #[doc = "Set scheduler-params."] + pub fn set_scheduler_params( + &self, + new: super::set_scheduler_params::New, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Configuration", + "set_scheduler_params", + super::SetSchedulerParams { new }, + [ + 191u8, 87u8, 235u8, 71u8, 143u8, 46u8, 2u8, 88u8, 111u8, 15u8, + 251u8, 230u8, 241u8, 172u8, 183u8, 110u8, 33u8, 26u8, 43u8, 119u8, + 74u8, 62u8, 200u8, 226u8, 83u8, 180u8, 123u8, 132u8, 171u8, 65u8, + 30u8, 13u8, + ], + ) + } } } } @@ -32963,12 +33711,9 @@ pub mod api { #[doc = " The active configuration for the current session."] pub fn active_config( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - active_config::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), active_config::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Configuration", "ActiveConfig", [ @@ -32988,12 +33733,9 @@ pub mod api { #[doc = " 2 items: for the next session and for the `scheduled_session`."] pub fn pending_configs( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - pending_configs::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), pending_configs::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Configuration", "PendingConfigs", [ @@ -33007,12 +33749,12 @@ pub mod api { #[doc = " is meant to be used only as the last resort."] pub fn bypass_consistency_check( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - bypass_consistency_check::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + bypass_consistency_check::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Configuration", "BypassConsistencyCheck", [ @@ -33026,26 +33768,34 @@ pub mod api { pub mod active_config { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ; } + pub type Output = + runtime_types::polkadot_runtime_parachains::configuration::HostConfiguration< + ::core::primitive::u32, + >; } pub mod pending_configs { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < (:: core :: primitive :: u32 , runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ,) > ; } + pub type Output = ::subxt::alloc::vec::Vec<( + ::core::primitive::u32, + runtime_types::polkadot_runtime_parachains::configuration::HostConfiguration< + ::core::primitive::u32, + >, + )>; } pub mod bypass_consistency_check { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::bool; } + pub type Output = ::core::primitive::bool; } } } @@ -33057,12 +33807,10 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; + pub mod api { + pub struct TransactionApi; + impl TransactionApi {} } - pub struct TransactionApi; - impl TransactionApi {} } pub mod storage { use super::root_mod; @@ -33072,12 +33820,12 @@ pub mod api { #[doc = " The current session index."] pub fn current_session_index( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - current_session_index::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + current_session_index::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParasShared", "CurrentSessionIndex", [ @@ -33091,12 +33839,12 @@ pub mod api { #[doc = " Indices are into the broader validator set."] pub fn active_validator_indices( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - active_validator_indices::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + active_validator_indices::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParasShared", "ActiveValidatorIndices", [ @@ -33110,12 +33858,12 @@ pub mod api { #[doc = " consensus. This should be the same length as `ActiveValidatorIndices`."] pub fn active_validator_keys( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - active_validator_keys::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + active_validator_keys::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParasShared", "ActiveValidatorKeys", [ @@ -33128,12 +33876,12 @@ pub mod api { #[doc = " All allowed relay-parents."] pub fn allowed_relay_parents( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - allowed_relay_parents::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + allowed_relay_parents::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParasShared", "AllowedRelayParents", [ @@ -33148,38 +33896,42 @@ pub mod api { pub mod current_session_index { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod active_validator_indices { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::ValidatorIndex, - >; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::ValidatorIndex, + >; } pub mod active_validator_keys { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::validator_app::Public, - >; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::validator_app::Public, + >; } pub mod allowed_relay_parents { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_runtime_parachains :: shared :: AllowedRelayParentsTracker < :: subxt :: ext :: subxt_core :: utils :: H256 , :: core :: primitive :: u32 > ; } + pub type Output = + runtime_types::polkadot_runtime_parachains::shared::AllowedRelayParentsTracker< + ::subxt::utils::H256, + ::core::primitive::u32, + >; } } } @@ -33193,24 +33945,22 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; + pub mod api { + pub struct TransactionApi; + impl TransactionApi {} } - pub struct TransactionApi; - impl TransactionApi {} } #[doc = "The `Event` enum of this pallet"] pub type Event = runtime_types::polkadot_runtime_parachains::inclusion::pallet::Event; pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A candidate was backed. `[candidate, head_data]`"] pub struct CandidateBacked( pub candidate_backed::Field0, @@ -33221,24 +33971,29 @@ pub mod api { pub mod candidate_backed { use super::runtime_types; pub type Field0 = runtime_types::polkadot_primitives::v9::CandidateReceiptV2< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >; pub type Field1 = runtime_types::polkadot_parachain_primitives::primitives::HeadData; pub type Field2 = runtime_types::polkadot_primitives::v9::CoreIndex; pub type Field3 = runtime_types::polkadot_primitives::v9::GroupIndex; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CandidateBacked { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateBacked"; + impl CandidateBacked { + const PALLET_NAME: &'static str = "ParaInclusion"; + const EVENT_NAME: &'static str = "CandidateBacked"; + } + impl ::subxt::events::DecodeAsEvent for CandidateBacked { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A candidate was included. `[candidate, head_data]`"] pub struct CandidateIncluded( pub candidate_included::Field0, @@ -33249,24 +34004,29 @@ pub mod api { pub mod candidate_included { use super::runtime_types; pub type Field0 = runtime_types::polkadot_primitives::v9::CandidateReceiptV2< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >; pub type Field1 = runtime_types::polkadot_parachain_primitives::primitives::HeadData; pub type Field2 = runtime_types::polkadot_primitives::v9::CoreIndex; pub type Field3 = runtime_types::polkadot_primitives::v9::GroupIndex; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CandidateIncluded { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateIncluded"; + impl CandidateIncluded { + const PALLET_NAME: &'static str = "ParaInclusion"; + const EVENT_NAME: &'static str = "CandidateIncluded"; + } + impl ::subxt::events::DecodeAsEvent for CandidateIncluded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A candidate timed out. `[candidate, head_data]`"] pub struct CandidateTimedOut( pub candidate_timed_out::Field0, @@ -33276,23 +34036,28 @@ pub mod api { pub mod candidate_timed_out { use super::runtime_types; pub type Field0 = runtime_types::polkadot_primitives::v9::CandidateReceiptV2< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >; pub type Field1 = runtime_types::polkadot_parachain_primitives::primitives::HeadData; pub type Field2 = runtime_types::polkadot_primitives::v9::CoreIndex; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CandidateTimedOut { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateTimedOut"; + impl CandidateTimedOut { + const PALLET_NAME: &'static str = "ParaInclusion"; + const EVENT_NAME: &'static str = "CandidateTimedOut"; + } + impl ::subxt::events::DecodeAsEvent for CandidateTimedOut { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some upward messages have been received and will be processed."] pub struct UpwardMessagesReceived { pub from: upward_messages_received::From, @@ -33303,9 +34068,14 @@ pub mod api { pub type From = runtime_types::polkadot_parachain_primitives::primitives::Id; pub type Count = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UpwardMessagesReceived { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "UpwardMessagesReceived"; + impl UpwardMessagesReceived { + const PALLET_NAME: &'static str = "ParaInclusion"; + const EVENT_NAME: &'static str = "UpwardMessagesReceived"; + } + impl ::subxt::events::DecodeAsEvent for UpwardMessagesReceived { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -33320,12 +34090,12 @@ pub mod api { #[doc = " the migration."] pub fn v1( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (v1::Param0,), - v1::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (v1::input::Param0,), + v1::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParaInclusion", "V1", [ @@ -33339,11 +34109,11 @@ pub mod api { pub mod v1 { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: ext :: subxt_core :: utils :: H256 , :: core :: primitive :: u32 > > ; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = :: subxt :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: utils :: H256 , :: core :: primitive :: u32 > > ; } } } @@ -33357,53 +34127,52 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] + pub struct Enter { + pub data: enter::Data, + } + pub mod enter { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] - pub struct Enter { - pub data: enter::Data, - } - pub mod enter { - use super::runtime_types; - pub type Data = runtime_types::polkadot_primitives::v9::InherentData< - runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Enter { - const PALLET: &'static str = "ParaInherent"; - const CALL: &'static str = "enter"; - } + pub type Data = runtime_types::polkadot_primitives::v9::InherentData< + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, + >; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] - pub fn enter( - &self, - data: types::enter::Data, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ParaInherent", - "enter", - types::Enter { data }, - [ - 114u8, 11u8, 29u8, 115u8, 182u8, 217u8, 229u8, 138u8, 140u8, 35u8, - 241u8, 16u8, 118u8, 196u8, 206u8, 209u8, 82u8, 253u8, 75u8, 243u8, 1u8, - 251u8, 4u8, 141u8, 246u8, 107u8, 153u8, 196u8, 228u8, 8u8, 40u8, 8u8, - ], - ) + impl Enter { + const PALLET_NAME: &'static str = "ParaInherent"; + const CALL_NAME: &'static str = "enter"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Enter { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] + pub fn enter( + &self, + data: super::enter::Data, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "ParaInherent", + "enter", + super::Enter { data }, + [ + 114u8, 11u8, 29u8, 115u8, 182u8, 217u8, 229u8, 138u8, 140u8, 35u8, + 241u8, 16u8, 118u8, 196u8, 206u8, 209u8, 82u8, 253u8, 75u8, 243u8, + 1u8, 251u8, 4u8, 141u8, 246u8, 107u8, 153u8, 196u8, 228u8, 8u8, + 40u8, 8u8, + ], + ) + } } } } @@ -33420,12 +34189,9 @@ pub mod api { #[doc = " If this is `None` at the end of the block, we panic and render the block invalid."] pub fn included( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - included::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), included::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "ParaInherent", "Included", [ @@ -33438,12 +34204,9 @@ pub mod api { #[doc = " Scraped on chain data for extracting resolved disputes as well as backing votes."] pub fn on_chain_votes( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - on_chain_votes::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), on_chain_votes::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "ParaInherent", "OnChainVotes", [ @@ -33457,20 +34220,20 @@ pub mod api { pub mod included { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (); } + pub type Output = (); } pub mod on_chain_votes { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::polkadot_primitives::v9::ScrapedOnChainVotes< - ::subxt::ext::subxt_core::utils::H256, - >; } + pub type Output = runtime_types::polkadot_primitives::v9::ScrapedOnChainVotes< + ::subxt::utils::H256, + >; } } } @@ -33491,12 +34254,12 @@ pub mod api { #[doc = " upper bound at 10k."] pub fn validator_groups( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - validator_groups::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + validator_groups::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParaScheduler", "ValidatorGroups", [ @@ -33516,12 +34279,12 @@ pub mod api { #[doc = " block following the session change, block number of which we save in this storage value."] pub fn session_start_block( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - session_start_block::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + session_start_block::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParaScheduler", "SessionStartBlock", [ @@ -33535,12 +34298,9 @@ pub mod api { #[doc = " scheduled on that core."] pub fn claim_queue( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - claim_queue::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), claim_queue::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "ParaScheduler", "ClaimQueue", [ @@ -33554,30 +34314,35 @@ pub mod api { pub mod validator_groups { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::ValidatorIndex, - >, - >; } + pub type Output = ::subxt::alloc::vec::Vec< + ::subxt::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::ValidatorIndex, + >, + >; } pub mod session_start_block { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod claim_queue { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = :: subxt :: ext :: subxt_core :: utils :: KeyedVec < runtime_types :: polkadot_primitives :: v9 :: CoreIndex , :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: common :: Assignment > > ; } + pub type Output = ::subxt::utils::KeyedVec< + runtime_types::polkadot_primitives::v9::CoreIndex, + ::subxt::alloc::vec::Vec< + runtime_types::polkadot_runtime_parachains::scheduler::common::Assignment, + >, + >; } } } @@ -33591,619 +34356,630 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the storage for the parachain validation code immediately."] + pub struct ForceSetCurrentCode { + pub para: force_set_current_code::Para, + pub new_code: force_set_current_code::NewCode, + } + pub mod force_set_current_code { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the storage for the parachain validation code immediately."] - pub struct ForceSetCurrentCode { - pub para: force_set_current_code::Para, - pub new_code: force_set_current_code::NewCode, - } - pub mod force_set_current_code { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type NewCode = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetCurrentCode { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "force_set_current_code"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the storage for the current parachain head data immediately."] - pub struct ForceSetCurrentHead { - pub para: force_set_current_head::Para, - pub new_head: force_set_current_head::NewHead, - } - pub mod force_set_current_head { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type NewHead = - runtime_types::polkadot_parachain_primitives::primitives::HeadData; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetCurrentHead { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "force_set_current_head"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] - pub struct ForceScheduleCodeUpgrade { - pub para: force_schedule_code_upgrade::Para, - pub new_code: force_schedule_code_upgrade::NewCode, - pub relay_parent_number: force_schedule_code_upgrade::RelayParentNumber, - } - pub mod force_schedule_code_upgrade { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type NewCode = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; - pub type RelayParentNumber = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceScheduleCodeUpgrade { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "force_schedule_code_upgrade"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Note a new block head for para within the context of the current block."] - pub struct ForceNoteNewHead { - pub para: force_note_new_head::Para, - pub new_head: force_note_new_head::NewHead, - } - pub mod force_note_new_head { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type NewHead = - runtime_types::polkadot_parachain_primitives::primitives::HeadData; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceNoteNewHead { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "force_note_new_head"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Put a parachain directly into the next session's action queue."] - #[doc = "We can't queue it any sooner than this without going into the"] - #[doc = "initializer..."] - pub struct ForceQueueAction { - pub para: force_queue_action::Para, - } - pub mod force_queue_action { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceQueueAction { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "force_queue_action"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Adds the validation code to the storage."] - #[doc = ""] - #[doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] - #[doc = "is running for that code, it will be instantly accepted."] - #[doc = ""] - #[doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] - #[doc = "into storage with reference count 0. This is to account the fact that there are no users"] - #[doc = "for this code yet. The caller will have to make sure that this code eventually gets"] - #[doc = "used by some parachain or removed from the storage to avoid storage leaks. For the"] - #[doc = "latter prefer to use the `poke_unused_validation_code` dispatchable to raw storage"] - #[doc = "manipulation."] - #[doc = ""] - #[doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] - #[doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] - pub struct AddTrustedValidationCode { - pub validation_code: add_trusted_validation_code::ValidationCode, - } - pub mod add_trusted_validation_code { - use super::runtime_types; - pub type ValidationCode = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddTrustedValidationCode { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "add_trusted_validation_code"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove the validation code from the storage iff the reference count is 0."] - #[doc = ""] - #[doc = "This is better than removing the storage directly, because it will not remove the code"] - #[doc = "that was suddenly got used by some parachain while this dispatchable was pending"] - #[doc = "dispatching."] - pub struct PokeUnusedValidationCode { - pub validation_code_hash: poke_unused_validation_code::ValidationCodeHash, - } - pub mod poke_unused_validation_code { - use super::runtime_types; - pub type ValidationCodeHash = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeUnusedValidationCode { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "poke_unused_validation_code"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] - #[doc = "enacts the results if that was the last vote before achieving the supermajority."] - pub struct IncludePvfCheckStatement { - pub stmt: include_pvf_check_statement::Stmt, - pub signature: include_pvf_check_statement::Signature, - } - pub mod include_pvf_check_statement { - use super::runtime_types; - pub type Stmt = runtime_types::polkadot_primitives::v9::PvfCheckStatement; - pub type Signature = - runtime_types::polkadot_primitives::v9::validator_app::Signature; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for IncludePvfCheckStatement { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "include_pvf_check_statement"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the storage for the current parachain head data immediately."] - pub struct ForceSetMostRecentContext { - pub para: force_set_most_recent_context::Para, - pub context: force_set_most_recent_context::Context, - } - pub mod force_set_most_recent_context { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Context = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetMostRecentContext { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "force_set_most_recent_context"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove an upgrade cooldown for a parachain."] - #[doc = ""] - #[doc = "The cost for removing the cooldown earlier depends on the time left for the cooldown"] - #[doc = "multiplied by [`Config::CooldownRemovalMultiplier`]. The paid tokens are burned."] - pub struct RemoveUpgradeCooldown { - pub para: remove_upgrade_cooldown::Para, - } - pub mod remove_upgrade_cooldown { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveUpgradeCooldown { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "remove_upgrade_cooldown"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the storage for the authorized current code hash of the parachain."] - #[doc = "If not applied, it will be removed at the `System::block_number() + valid_period` block."] - #[doc = ""] - #[doc = "This can be useful, when triggering `Paras::force_set_current_code(para, code)`"] - #[doc = "from a different chain than the one where the `Paras` pallet is deployed."] - #[doc = ""] - #[doc = "The main purpose is to avoid transferring the entire `code` Wasm blob between chains."] - #[doc = "Instead, we authorize `code_hash` with `root`, which can later be applied by"] - #[doc = "`Paras::apply_authorized_force_set_current_code(para, code)` by anyone."] - #[doc = ""] - #[doc = "Authorizations are stored in an **overwriting manner**."] - pub struct AuthorizeForceSetCurrentCodeHash { - pub para: authorize_force_set_current_code_hash::Para, - pub new_code_hash: authorize_force_set_current_code_hash::NewCodeHash, - pub valid_period: authorize_force_set_current_code_hash::ValidPeriod, - } - pub mod authorize_force_set_current_code_hash { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type NewCodeHash = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; - pub type ValidPeriod = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AuthorizeForceSetCurrentCodeHash { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "authorize_force_set_current_code_hash"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Applies the already authorized current code for the parachain,"] - #[doc = "triggering the same functionality as `force_set_current_code`."] - pub struct ApplyAuthorizedForceSetCurrentCode { - pub para: apply_authorized_force_set_current_code::Para, - pub new_code: apply_authorized_force_set_current_code::NewCode, - } - pub mod apply_authorized_force_set_current_code { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type NewCode = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApplyAuthorizedForceSetCurrentCode { - const PALLET: &'static str = "Paras"; - const CALL: &'static str = "apply_authorized_force_set_current_code"; - } + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type NewCode = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Set the storage for the parachain validation code immediately."] - pub fn force_set_current_code( - &self, - para: types::force_set_current_code::Para, - new_code: types::force_set_current_code::NewCode, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "force_set_current_code", - types::ForceSetCurrentCode { para, new_code }, - [ - 204u8, 159u8, 184u8, 235u8, 65u8, 225u8, 223u8, 130u8, 139u8, 140u8, - 219u8, 58u8, 142u8, 253u8, 236u8, 239u8, 148u8, 190u8, 27u8, 234u8, - 165u8, 125u8, 129u8, 235u8, 98u8, 33u8, 172u8, 71u8, 90u8, 41u8, 182u8, - 80u8, - ], - ) + impl ForceSetCurrentCode { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "force_set_current_code"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceSetCurrentCode { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the storage for the current parachain head data immediately."] - pub fn force_set_current_head( - &self, - para: types::force_set_current_head::Para, - new_head: types::force_set_current_head::NewHead, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "force_set_current_head", - types::ForceSetCurrentHead { para, new_head }, - [ - 184u8, 247u8, 184u8, 248u8, 89u8, 64u8, 18u8, 193u8, 254u8, 71u8, - 220u8, 195u8, 124u8, 212u8, 178u8, 169u8, 155u8, 189u8, 11u8, 135u8, - 247u8, 39u8, 253u8, 196u8, 111u8, 242u8, 189u8, 91u8, 226u8, 219u8, - 232u8, 238u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the storage for the current parachain head data immediately."] + pub struct ForceSetCurrentHead { + pub para: force_set_current_head::Para, + pub new_head: force_set_current_head::NewHead, + } + pub mod force_set_current_head { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type NewHead = + runtime_types::polkadot_parachain_primitives::primitives::HeadData; + } + impl ForceSetCurrentHead { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "force_set_current_head"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceSetCurrentHead { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] - pub fn force_schedule_code_upgrade( - &self, - para: types::force_schedule_code_upgrade::Para, - new_code: types::force_schedule_code_upgrade::NewCode, - relay_parent_number: types::force_schedule_code_upgrade::RelayParentNumber, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceScheduleCodeUpgrade, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "force_schedule_code_upgrade", - types::ForceScheduleCodeUpgrade { - para, - new_code, - relay_parent_number, - }, - [ - 131u8, 179u8, 138u8, 151u8, 167u8, 191u8, 2u8, 68u8, 85u8, 111u8, - 166u8, 65u8, 67u8, 52u8, 201u8, 41u8, 132u8, 128u8, 35u8, 177u8, 91u8, - 185u8, 114u8, 2u8, 123u8, 133u8, 164u8, 121u8, 170u8, 243u8, 223u8, - 61u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] + pub struct ForceScheduleCodeUpgrade { + pub para: force_schedule_code_upgrade::Para, + pub new_code: force_schedule_code_upgrade::NewCode, + pub relay_parent_number: force_schedule_code_upgrade::RelayParentNumber, + } + pub mod force_schedule_code_upgrade { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type NewCode = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; + pub type RelayParentNumber = ::core::primitive::u32; + } + impl ForceScheduleCodeUpgrade { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "force_schedule_code_upgrade"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceScheduleCodeUpgrade { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Note a new block head for para within the context of the current block."] - pub fn force_note_new_head( - &self, - para: types::force_note_new_head::Para, - new_head: types::force_note_new_head::NewHead, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "force_note_new_head", - types::ForceNoteNewHead { para, new_head }, - [ - 215u8, 12u8, 228u8, 208u8, 7u8, 24u8, 207u8, 60u8, 183u8, 241u8, 212u8, - 203u8, 139u8, 149u8, 9u8, 236u8, 77u8, 15u8, 242u8, 70u8, 62u8, 204u8, - 187u8, 91u8, 110u8, 73u8, 210u8, 2u8, 8u8, 118u8, 182u8, 171u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Note a new block head for para within the context of the current block."] + pub struct ForceNoteNewHead { + pub para: force_note_new_head::Para, + pub new_head: force_note_new_head::NewHead, + } + pub mod force_note_new_head { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type NewHead = + runtime_types::polkadot_parachain_primitives::primitives::HeadData; + } + impl ForceNoteNewHead { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "force_note_new_head"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceNoteNewHead { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Put a parachain directly into the next session's action queue."] - #[doc = "We can't queue it any sooner than this without going into the"] - #[doc = "initializer..."] - pub fn force_queue_action( - &self, - para: types::force_queue_action::Para, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "force_queue_action", - types::ForceQueueAction { para }, - [ - 112u8, 247u8, 239u8, 8u8, 91u8, 23u8, 111u8, 84u8, 179u8, 61u8, 235u8, - 49u8, 140u8, 110u8, 40u8, 226u8, 150u8, 253u8, 146u8, 193u8, 136u8, - 133u8, 100u8, 127u8, 38u8, 165u8, 159u8, 17u8, 205u8, 190u8, 6u8, - 117u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Put a parachain directly into the next session's action queue."] + #[doc = "We can't queue it any sooner than this without going into the"] + #[doc = "initializer..."] + pub struct ForceQueueAction { + pub para: force_queue_action::Para, + } + pub mod force_queue_action { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl ForceQueueAction { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "force_queue_action"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceQueueAction { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Adds the validation code to the storage."] - #[doc = ""] - #[doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] - #[doc = "is running for that code, it will be instantly accepted."] - #[doc = ""] - #[doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] - #[doc = "into storage with reference count 0. This is to account the fact that there are no users"] - #[doc = "for this code yet. The caller will have to make sure that this code eventually gets"] - #[doc = "used by some parachain or removed from the storage to avoid storage leaks. For the"] - #[doc = "latter prefer to use the `poke_unused_validation_code` dispatchable to raw storage"] - #[doc = "manipulation."] - #[doc = ""] - #[doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] - #[doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] - pub fn add_trusted_validation_code( - &self, - validation_code: types::add_trusted_validation_code::ValidationCode, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::AddTrustedValidationCode, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "add_trusted_validation_code", - types::AddTrustedValidationCode { validation_code }, - [ - 196u8, 123u8, 133u8, 223u8, 3u8, 205u8, 127u8, 23u8, 82u8, 201u8, - 107u8, 47u8, 23u8, 75u8, 139u8, 198u8, 178u8, 171u8, 160u8, 61u8, - 132u8, 250u8, 76u8, 110u8, 3u8, 144u8, 90u8, 253u8, 89u8, 141u8, 162u8, - 135u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Adds the validation code to the storage."] + #[doc = ""] + #[doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] + #[doc = "is running for that code, it will be instantly accepted."] + #[doc = ""] + #[doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] + #[doc = "into storage with reference count 0. This is to account the fact that there are no users"] + #[doc = "for this code yet. The caller will have to make sure that this code eventually gets"] + #[doc = "used by some parachain or removed from the storage to avoid storage leaks. For the"] + #[doc = "latter prefer to use the `poke_unused_validation_code` dispatchable to raw storage"] + #[doc = "manipulation."] + #[doc = ""] + #[doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] + #[doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] + pub struct AddTrustedValidationCode { + pub validation_code: add_trusted_validation_code::ValidationCode, + } + pub mod add_trusted_validation_code { + use super::runtime_types; + pub type ValidationCode = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; + } + impl AddTrustedValidationCode { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "add_trusted_validation_code"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AddTrustedValidationCode { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove the validation code from the storage iff the reference count is 0."] - #[doc = ""] - #[doc = "This is better than removing the storage directly, because it will not remove the code"] - #[doc = "that was suddenly got used by some parachain while this dispatchable was pending"] - #[doc = "dispatching."] - pub fn poke_unused_validation_code( - &self, - validation_code_hash: types::poke_unused_validation_code::ValidationCodeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::PokeUnusedValidationCode, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "poke_unused_validation_code", - types::PokeUnusedValidationCode { - validation_code_hash, - }, - [ - 180u8, 53u8, 213u8, 27u8, 150u8, 195u8, 50u8, 1u8, 62u8, 246u8, 244u8, - 229u8, 115u8, 202u8, 55u8, 140u8, 108u8, 28u8, 245u8, 66u8, 165u8, - 128u8, 105u8, 221u8, 7u8, 87u8, 242u8, 19u8, 88u8, 132u8, 36u8, 32u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove the validation code from the storage iff the reference count is 0."] + #[doc = ""] + #[doc = "This is better than removing the storage directly, because it will not remove the code"] + #[doc = "that was suddenly got used by some parachain while this dispatchable was pending"] + #[doc = "dispatching."] + pub struct PokeUnusedValidationCode { + pub validation_code_hash: poke_unused_validation_code::ValidationCodeHash, + } + pub mod poke_unused_validation_code { + use super::runtime_types; + pub type ValidationCodeHash = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; + } + impl PokeUnusedValidationCode { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "poke_unused_validation_code"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PokeUnusedValidationCode { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] - #[doc = "enacts the results if that was the last vote before achieving the supermajority."] - pub fn include_pvf_check_statement( - &self, - stmt: types::include_pvf_check_statement::Stmt, - signature: types::include_pvf_check_statement::Signature, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::IncludePvfCheckStatement, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "include_pvf_check_statement", - types::IncludePvfCheckStatement { stmt, signature }, - [ - 207u8, 92u8, 120u8, 222u8, 183u8, 105u8, 82u8, 155u8, 62u8, 41u8, 87u8, - 66u8, 240u8, 71u8, 160u8, 114u8, 99u8, 195u8, 247u8, 190u8, 40u8, - 132u8, 71u8, 161u8, 109u8, 207u8, 9u8, 163u8, 125u8, 98u8, 71u8, 107u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] + #[doc = "enacts the results if that was the last vote before achieving the supermajority."] + pub struct IncludePvfCheckStatement { + pub stmt: include_pvf_check_statement::Stmt, + pub signature: include_pvf_check_statement::Signature, + } + pub mod include_pvf_check_statement { + use super::runtime_types; + pub type Stmt = runtime_types::polkadot_primitives::v9::PvfCheckStatement; + pub type Signature = + runtime_types::polkadot_primitives::v9::validator_app::Signature; + } + impl IncludePvfCheckStatement { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "include_pvf_check_statement"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for IncludePvfCheckStatement { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the storage for the current parachain head data immediately."] - pub fn force_set_most_recent_context( - &self, - para: types::force_set_most_recent_context::Para, - context: types::force_set_most_recent_context::Context, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceSetMostRecentContext, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "force_set_most_recent_context", - types::ForceSetMostRecentContext { para, context }, - [ - 243u8, 17u8, 20u8, 229u8, 91u8, 87u8, 42u8, 159u8, 119u8, 61u8, 201u8, - 246u8, 79u8, 151u8, 209u8, 183u8, 35u8, 31u8, 2u8, 210u8, 187u8, 105u8, - 66u8, 106u8, 119u8, 241u8, 63u8, 63u8, 233u8, 68u8, 244u8, 137u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the storage for the current parachain head data immediately."] + pub struct ForceSetMostRecentContext { + pub para: force_set_most_recent_context::Para, + pub context: force_set_most_recent_context::Context, + } + pub mod force_set_most_recent_context { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Context = ::core::primitive::u32; + } + impl ForceSetMostRecentContext { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "force_set_most_recent_context"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceSetMostRecentContext { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove an upgrade cooldown for a parachain."] - #[doc = ""] - #[doc = "The cost for removing the cooldown earlier depends on the time left for the cooldown"] - #[doc = "multiplied by [`Config::CooldownRemovalMultiplier`]. The paid tokens are burned."] - pub fn remove_upgrade_cooldown( - &self, - para: types::remove_upgrade_cooldown::Para, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RemoveUpgradeCooldown, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "remove_upgrade_cooldown", - types::RemoveUpgradeCooldown { para }, - [ - 97u8, 182u8, 203u8, 33u8, 194u8, 209u8, 1u8, 8u8, 237u8, 63u8, 156u8, - 50u8, 23u8, 179u8, 171u8, 89u8, 74u8, 73u8, 191u8, 28u8, 102u8, 166u8, - 89u8, 180u8, 166u8, 219u8, 110u8, 170u8, 77u8, 170u8, 151u8, 87u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove an upgrade cooldown for a parachain."] + #[doc = ""] + #[doc = "The cost for removing the cooldown earlier depends on the time left for the cooldown"] + #[doc = "multiplied by [`Config::CooldownRemovalMultiplier`]. The paid tokens are burned."] + pub struct RemoveUpgradeCooldown { + pub para: remove_upgrade_cooldown::Para, + } + pub mod remove_upgrade_cooldown { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl RemoveUpgradeCooldown { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "remove_upgrade_cooldown"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveUpgradeCooldown { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the storage for the authorized current code hash of the parachain."] - #[doc = "If not applied, it will be removed at the `System::block_number() + valid_period` block."] - #[doc = ""] - #[doc = "This can be useful, when triggering `Paras::force_set_current_code(para, code)`"] - #[doc = "from a different chain than the one where the `Paras` pallet is deployed."] - #[doc = ""] - #[doc = "The main purpose is to avoid transferring the entire `code` Wasm blob between chains."] - #[doc = "Instead, we authorize `code_hash` with `root`, which can later be applied by"] - #[doc = "`Paras::apply_authorized_force_set_current_code(para, code)` by anyone."] - #[doc = ""] - #[doc = "Authorizations are stored in an **overwriting manner**."] - pub fn authorize_force_set_current_code_hash( - &self, - para: types::authorize_force_set_current_code_hash::Para, - new_code_hash: types::authorize_force_set_current_code_hash::NewCodeHash, - valid_period: types::authorize_force_set_current_code_hash::ValidPeriod, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::AuthorizeForceSetCurrentCodeHash, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "authorize_force_set_current_code_hash", - types::AuthorizeForceSetCurrentCodeHash { - para, - new_code_hash, - valid_period, - }, - [ - 58u8, 211u8, 30u8, 92u8, 73u8, 11u8, 68u8, 77u8, 96u8, 192u8, 34u8, - 32u8, 13u8, 63u8, 34u8, 80u8, 193u8, 56u8, 218u8, 241u8, 64u8, 9u8, - 91u8, 130u8, 73u8, 246u8, 233u8, 65u8, 225u8, 244u8, 22u8, 60u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the storage for the authorized current code hash of the parachain."] + #[doc = "If not applied, it will be removed at the `System::block_number() + valid_period` block."] + #[doc = ""] + #[doc = "This can be useful, when triggering `Paras::force_set_current_code(para, code)`"] + #[doc = "from a different chain than the one where the `Paras` pallet is deployed."] + #[doc = ""] + #[doc = "The main purpose is to avoid transferring the entire `code` Wasm blob between chains."] + #[doc = "Instead, we authorize `code_hash` with `root`, which can later be applied by"] + #[doc = "`Paras::apply_authorized_force_set_current_code(para, code)` by anyone."] + #[doc = ""] + #[doc = "Authorizations are stored in an **overwriting manner**."] + pub struct AuthorizeForceSetCurrentCodeHash { + pub para: authorize_force_set_current_code_hash::Para, + pub new_code_hash: authorize_force_set_current_code_hash::NewCodeHash, + pub valid_period: authorize_force_set_current_code_hash::ValidPeriod, + } + pub mod authorize_force_set_current_code_hash { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type NewCodeHash = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; + pub type ValidPeriod = ::core::primitive::u32; + } + impl AuthorizeForceSetCurrentCodeHash { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "authorize_force_set_current_code_hash"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AuthorizeForceSetCurrentCodeHash { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Applies the already authorized current code for the parachain,"] - #[doc = "triggering the same functionality as `force_set_current_code`."] - pub fn apply_authorized_force_set_current_code( - &self, - para: types::apply_authorized_force_set_current_code::Para, - new_code: types::apply_authorized_force_set_current_code::NewCode, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ApplyAuthorizedForceSetCurrentCode, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Paras", - "apply_authorized_force_set_current_code", - types::ApplyAuthorizedForceSetCurrentCode { para, new_code }, - [ - 214u8, 157u8, 64u8, 213u8, 9u8, 144u8, 81u8, 217u8, 8u8, 212u8, 12u8, - 39u8, 87u8, 21u8, 255u8, 6u8, 131u8, 104u8, 92u8, 81u8, 140u8, 104u8, - 185u8, 225u8, 90u8, 4u8, 50u8, 42u8, 175u8, 243u8, 78u8, 62u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Applies the already authorized current code for the parachain,"] + #[doc = "triggering the same functionality as `force_set_current_code`."] + pub struct ApplyAuthorizedForceSetCurrentCode { + pub para: apply_authorized_force_set_current_code::Para, + pub new_code: apply_authorized_force_set_current_code::NewCode, + } + pub mod apply_authorized_force_set_current_code { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type NewCode = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; + } + impl ApplyAuthorizedForceSetCurrentCode { + const PALLET_NAME: &'static str = "Paras"; + const CALL_NAME: &'static str = "apply_authorized_force_set_current_code"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ApplyAuthorizedForceSetCurrentCode { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the storage for the parachain validation code immediately."] + pub fn force_set_current_code( + &self, + para: super::force_set_current_code::Para, + new_code: super::force_set_current_code::NewCode, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "force_set_current_code", + super::ForceSetCurrentCode { para, new_code }, + [ + 204u8, 159u8, 184u8, 235u8, 65u8, 225u8, 223u8, 130u8, 139u8, + 140u8, 219u8, 58u8, 142u8, 253u8, 236u8, 239u8, 148u8, 190u8, 27u8, + 234u8, 165u8, 125u8, 129u8, 235u8, 98u8, 33u8, 172u8, 71u8, 90u8, + 41u8, 182u8, 80u8, + ], + ) + } + #[doc = "Set the storage for the current parachain head data immediately."] + pub fn force_set_current_head( + &self, + para: super::force_set_current_head::Para, + new_head: super::force_set_current_head::NewHead, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "force_set_current_head", + super::ForceSetCurrentHead { para, new_head }, + [ + 184u8, 247u8, 184u8, 248u8, 89u8, 64u8, 18u8, 193u8, 254u8, 71u8, + 220u8, 195u8, 124u8, 212u8, 178u8, 169u8, 155u8, 189u8, 11u8, + 135u8, 247u8, 39u8, 253u8, 196u8, 111u8, 242u8, 189u8, 91u8, 226u8, + 219u8, 232u8, 238u8, + ], + ) + } + #[doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] + pub fn force_schedule_code_upgrade( + &self, + para: super::force_schedule_code_upgrade::Para, + new_code: super::force_schedule_code_upgrade::NewCode, + relay_parent_number: super::force_schedule_code_upgrade::RelayParentNumber, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "force_schedule_code_upgrade", + super::ForceScheduleCodeUpgrade { + para, + new_code, + relay_parent_number, + }, + [ + 131u8, 179u8, 138u8, 151u8, 167u8, 191u8, 2u8, 68u8, 85u8, 111u8, + 166u8, 65u8, 67u8, 52u8, 201u8, 41u8, 132u8, 128u8, 35u8, 177u8, + 91u8, 185u8, 114u8, 2u8, 123u8, 133u8, 164u8, 121u8, 170u8, 243u8, + 223u8, 61u8, + ], + ) + } + #[doc = "Note a new block head for para within the context of the current block."] + pub fn force_note_new_head( + &self, + para: super::force_note_new_head::Para, + new_head: super::force_note_new_head::NewHead, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "force_note_new_head", + super::ForceNoteNewHead { para, new_head }, + [ + 215u8, 12u8, 228u8, 208u8, 7u8, 24u8, 207u8, 60u8, 183u8, 241u8, + 212u8, 203u8, 139u8, 149u8, 9u8, 236u8, 77u8, 15u8, 242u8, 70u8, + 62u8, 204u8, 187u8, 91u8, 110u8, 73u8, 210u8, 2u8, 8u8, 118u8, + 182u8, 171u8, + ], + ) + } + #[doc = "Put a parachain directly into the next session's action queue."] + #[doc = "We can't queue it any sooner than this without going into the"] + #[doc = "initializer..."] + pub fn force_queue_action( + &self, + para: super::force_queue_action::Para, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "force_queue_action", + super::ForceQueueAction { para }, + [ + 112u8, 247u8, 239u8, 8u8, 91u8, 23u8, 111u8, 84u8, 179u8, 61u8, + 235u8, 49u8, 140u8, 110u8, 40u8, 226u8, 150u8, 253u8, 146u8, 193u8, + 136u8, 133u8, 100u8, 127u8, 38u8, 165u8, 159u8, 17u8, 205u8, 190u8, + 6u8, 117u8, + ], + ) + } + #[doc = "Adds the validation code to the storage."] + #[doc = ""] + #[doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] + #[doc = "is running for that code, it will be instantly accepted."] + #[doc = ""] + #[doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] + #[doc = "into storage with reference count 0. This is to account the fact that there are no users"] + #[doc = "for this code yet. The caller will have to make sure that this code eventually gets"] + #[doc = "used by some parachain or removed from the storage to avoid storage leaks. For the"] + #[doc = "latter prefer to use the `poke_unused_validation_code` dispatchable to raw storage"] + #[doc = "manipulation."] + #[doc = ""] + #[doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] + #[doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] + pub fn add_trusted_validation_code( + &self, + validation_code: super::add_trusted_validation_code::ValidationCode, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "add_trusted_validation_code", + super::AddTrustedValidationCode { validation_code }, + [ + 196u8, 123u8, 133u8, 223u8, 3u8, 205u8, 127u8, 23u8, 82u8, 201u8, + 107u8, 47u8, 23u8, 75u8, 139u8, 198u8, 178u8, 171u8, 160u8, 61u8, + 132u8, 250u8, 76u8, 110u8, 3u8, 144u8, 90u8, 253u8, 89u8, 141u8, + 162u8, 135u8, + ], + ) + } + #[doc = "Remove the validation code from the storage iff the reference count is 0."] + #[doc = ""] + #[doc = "This is better than removing the storage directly, because it will not remove the code"] + #[doc = "that was suddenly got used by some parachain while this dispatchable was pending"] + #[doc = "dispatching."] + pub fn poke_unused_validation_code( + &self, + validation_code_hash : super :: poke_unused_validation_code :: ValidationCodeHash, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "poke_unused_validation_code", + super::PokeUnusedValidationCode { + validation_code_hash, + }, + [ + 180u8, 53u8, 213u8, 27u8, 150u8, 195u8, 50u8, 1u8, 62u8, 246u8, + 244u8, 229u8, 115u8, 202u8, 55u8, 140u8, 108u8, 28u8, 245u8, 66u8, + 165u8, 128u8, 105u8, 221u8, 7u8, 87u8, 242u8, 19u8, 88u8, 132u8, + 36u8, 32u8, + ], + ) + } + #[doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] + #[doc = "enacts the results if that was the last vote before achieving the supermajority."] + pub fn include_pvf_check_statement( + &self, + stmt: super::include_pvf_check_statement::Stmt, + signature: super::include_pvf_check_statement::Signature, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "include_pvf_check_statement", + super::IncludePvfCheckStatement { stmt, signature }, + [ + 207u8, 92u8, 120u8, 222u8, 183u8, 105u8, 82u8, 155u8, 62u8, 41u8, + 87u8, 66u8, 240u8, 71u8, 160u8, 114u8, 99u8, 195u8, 247u8, 190u8, + 40u8, 132u8, 71u8, 161u8, 109u8, 207u8, 9u8, 163u8, 125u8, 98u8, + 71u8, 107u8, + ], + ) + } + #[doc = "Set the storage for the current parachain head data immediately."] + pub fn force_set_most_recent_context( + &self, + para: super::force_set_most_recent_context::Para, + context: super::force_set_most_recent_context::Context, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "force_set_most_recent_context", + super::ForceSetMostRecentContext { para, context }, + [ + 243u8, 17u8, 20u8, 229u8, 91u8, 87u8, 42u8, 159u8, 119u8, 61u8, + 201u8, 246u8, 79u8, 151u8, 209u8, 183u8, 35u8, 31u8, 2u8, 210u8, + 187u8, 105u8, 66u8, 106u8, 119u8, 241u8, 63u8, 63u8, 233u8, 68u8, + 244u8, 137u8, + ], + ) + } + #[doc = "Remove an upgrade cooldown for a parachain."] + #[doc = ""] + #[doc = "The cost for removing the cooldown earlier depends on the time left for the cooldown"] + #[doc = "multiplied by [`Config::CooldownRemovalMultiplier`]. The paid tokens are burned."] + pub fn remove_upgrade_cooldown( + &self, + para: super::remove_upgrade_cooldown::Para, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "remove_upgrade_cooldown", + super::RemoveUpgradeCooldown { para }, + [ + 97u8, 182u8, 203u8, 33u8, 194u8, 209u8, 1u8, 8u8, 237u8, 63u8, + 156u8, 50u8, 23u8, 179u8, 171u8, 89u8, 74u8, 73u8, 191u8, 28u8, + 102u8, 166u8, 89u8, 180u8, 166u8, 219u8, 110u8, 170u8, 77u8, 170u8, + 151u8, 87u8, + ], + ) + } + #[doc = "Sets the storage for the authorized current code hash of the parachain."] + #[doc = "If not applied, it will be removed at the `System::block_number() + valid_period` block."] + #[doc = ""] + #[doc = "This can be useful, when triggering `Paras::force_set_current_code(para, code)`"] + #[doc = "from a different chain than the one where the `Paras` pallet is deployed."] + #[doc = ""] + #[doc = "The main purpose is to avoid transferring the entire `code` Wasm blob between chains."] + #[doc = "Instead, we authorize `code_hash` with `root`, which can later be applied by"] + #[doc = "`Paras::apply_authorized_force_set_current_code(para, code)` by anyone."] + #[doc = ""] + #[doc = "Authorizations are stored in an **overwriting manner**."] + pub fn authorize_force_set_current_code_hash( + &self, + para: super::authorize_force_set_current_code_hash::Para, + new_code_hash: super::authorize_force_set_current_code_hash::NewCodeHash, + valid_period: super::authorize_force_set_current_code_hash::ValidPeriod, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "authorize_force_set_current_code_hash", + super::AuthorizeForceSetCurrentCodeHash { + para, + new_code_hash, + valid_period, + }, + [ + 58u8, 211u8, 30u8, 92u8, 73u8, 11u8, 68u8, 77u8, 96u8, 192u8, 34u8, + 32u8, 13u8, 63u8, 34u8, 80u8, 193u8, 56u8, 218u8, 241u8, 64u8, 9u8, + 91u8, 130u8, 73u8, 246u8, 233u8, 65u8, 225u8, 244u8, 22u8, 60u8, + ], + ) + } + #[doc = "Applies the already authorized current code for the parachain,"] + #[doc = "triggering the same functionality as `force_set_current_code`."] + pub fn apply_authorized_force_set_current_code( + &self, + para: super::apply_authorized_force_set_current_code::Para, + new_code: super::apply_authorized_force_set_current_code::NewCode, + ) -> ::subxt::transactions::StaticPayload< + super::ApplyAuthorizedForceSetCurrentCode, + > { + ::subxt::transactions::StaticPayload::new_static( + "Paras", + "apply_authorized_force_set_current_code", + super::ApplyAuthorizedForceSetCurrentCode { para, new_code }, + [ + 214u8, 157u8, 64u8, 213u8, 9u8, 144u8, 81u8, 217u8, 8u8, 212u8, + 12u8, 39u8, 87u8, 21u8, 255u8, 6u8, 131u8, 104u8, 92u8, 81u8, + 140u8, 104u8, 185u8, 225u8, 90u8, 4u8, 50u8, 42u8, 175u8, 243u8, + 78u8, 62u8, + ], + ) + } } } } @@ -34212,80 +34988,100 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Current code has been updated for a Para. `para_id`"] pub struct CurrentCodeUpdated(pub current_code_updated::Field0); pub mod current_code_updated { use super::runtime_types; pub type Field0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CurrentCodeUpdated { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "CurrentCodeUpdated"; + impl CurrentCodeUpdated { + const PALLET_NAME: &'static str = "Paras"; + const EVENT_NAME: &'static str = "CurrentCodeUpdated"; + } + impl ::subxt::events::DecodeAsEvent for CurrentCodeUpdated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Current head has been updated for a Para. `para_id`"] pub struct CurrentHeadUpdated(pub current_head_updated::Field0); pub mod current_head_updated { use super::runtime_types; pub type Field0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CurrentHeadUpdated { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "CurrentHeadUpdated"; + impl CurrentHeadUpdated { + const PALLET_NAME: &'static str = "Paras"; + const EVENT_NAME: &'static str = "CurrentHeadUpdated"; + } + impl ::subxt::events::DecodeAsEvent for CurrentHeadUpdated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A code upgrade has been scheduled for a Para. `para_id`"] pub struct CodeUpgradeScheduled(pub code_upgrade_scheduled::Field0); pub mod code_upgrade_scheduled { use super::runtime_types; pub type Field0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CodeUpgradeScheduled { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "CodeUpgradeScheduled"; + impl CodeUpgradeScheduled { + const PALLET_NAME: &'static str = "Paras"; + const EVENT_NAME: &'static str = "CodeUpgradeScheduled"; + } + impl ::subxt::events::DecodeAsEvent for CodeUpgradeScheduled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A new head has been noted for a Para. `para_id`"] pub struct NewHeadNoted(pub new_head_noted::Field0); pub mod new_head_noted { use super::runtime_types; pub type Field0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NewHeadNoted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "NewHeadNoted"; + impl NewHeadNoted { + const PALLET_NAME: &'static str = "Paras"; + const EVENT_NAME: &'static str = "NewHeadNoted"; + } + impl ::subxt::events::DecodeAsEvent for NewHeadNoted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A para has been queued to execute pending actions. `para_id`"] pub struct ActionQueued(pub action_queued::Field0, pub action_queued::Field1); pub mod action_queued { @@ -34293,17 +35089,22 @@ pub mod api { pub type Field0 = runtime_types::polkadot_parachain_primitives::primitives::Id; pub type Field1 = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ActionQueued { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "ActionQueued"; + impl ActionQueued { + const PALLET_NAME: &'static str = "Paras"; + const EVENT_NAME: &'static str = "ActionQueued"; + } + impl ::subxt::events::DecodeAsEvent for ActionQueued { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The given para either initiated or subscribed to a PVF check for the given validation"] #[doc = "code. `code_hash` `para_id`"] pub struct PvfCheckStarted( @@ -34316,17 +35117,22 @@ pub mod api { runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; pub type Field1 = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PvfCheckStarted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckStarted"; + impl PvfCheckStarted { + const PALLET_NAME: &'static str = "Paras"; + const EVENT_NAME: &'static str = "PvfCheckStarted"; + } + impl ::subxt::events::DecodeAsEvent for PvfCheckStarted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The given validation code was accepted by the PVF pre-checking vote."] #[doc = "`code_hash` `para_id`"] pub struct PvfCheckAccepted( @@ -34339,17 +35145,22 @@ pub mod api { runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; pub type Field1 = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PvfCheckAccepted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckAccepted"; + impl PvfCheckAccepted { + const PALLET_NAME: &'static str = "Paras"; + const EVENT_NAME: &'static str = "PvfCheckAccepted"; + } + impl ::subxt::events::DecodeAsEvent for PvfCheckAccepted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The given validation code was rejected by the PVF pre-checking vote."] #[doc = "`code_hash` `para_id`"] pub struct PvfCheckRejected( @@ -34362,17 +35173,22 @@ pub mod api { runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; pub type Field1 = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PvfCheckRejected { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckRejected"; + impl PvfCheckRejected { + const PALLET_NAME: &'static str = "Paras"; + const EVENT_NAME: &'static str = "PvfCheckRejected"; + } + impl ::subxt::events::DecodeAsEvent for PvfCheckRejected { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The upgrade cooldown was removed."] pub struct UpgradeCooldownRemoved { pub para_id: upgrade_cooldown_removed::ParaId, @@ -34381,17 +35197,22 @@ pub mod api { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UpgradeCooldownRemoved { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "UpgradeCooldownRemoved"; + impl UpgradeCooldownRemoved { + const PALLET_NAME: &'static str = "Paras"; + const EVENT_NAME: &'static str = "UpgradeCooldownRemoved"; + } + impl ::subxt::events::DecodeAsEvent for UpgradeCooldownRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A new code hash has been authorized for a Para."] pub struct CodeAuthorized { pub para_id: code_authorized::ParaId, @@ -34405,9 +35226,14 @@ pub mod api { runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; pub type ExpireAt = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CodeAuthorized { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "CodeAuthorized"; + impl CodeAuthorized { + const PALLET_NAME: &'static str = "Paras"; + const EVENT_NAME: &'static str = "CodeAuthorized"; + } + impl ::subxt::events::DecodeAsEvent for CodeAuthorized { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -34421,12 +35247,12 @@ pub mod api { #[doc = " - There are no PVF pre-checking votes that exists in list but not in the set and vice versa."] pub fn pvf_active_vote_map( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (pvf_active_vote_map::Param0,), - pvf_active_vote_map::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (pvf_active_vote_map::input::Param0,), + pvf_active_vote_map::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "PvfActiveVoteMap", [ @@ -34440,12 +35266,12 @@ pub mod api { #[doc = " The list of all currently active PVF votes. Auxiliary to `PvfActiveVoteMap`."] pub fn pvf_active_vote_list( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - pvf_active_vote_list::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + pvf_active_vote_list::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "PvfActiveVoteList", [ @@ -34462,12 +35288,9 @@ pub mod api { #[doc = " Consider using the [`ParachainsCache`] type of modifying."] pub fn parachains( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - parachains::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), parachains::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Paras", "Parachains", [ @@ -34481,12 +35304,12 @@ pub mod api { #[doc = " The current lifecycle of a all known Para IDs."] pub fn para_lifecycles( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (para_lifecycles::Param0,), - para_lifecycles::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (para_lifecycles::input::Param0,), + para_lifecycles::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "ParaLifecycles", [ @@ -34499,12 +35322,12 @@ pub mod api { #[doc = " The head-data of every registered para."] pub fn heads( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (heads::Param0,), - heads::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (heads::input::Param0,), + heads::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "Heads", [ @@ -34518,12 +35341,12 @@ pub mod api { #[doc = " The context (relay-chain block number) of the most recent parachain head."] pub fn most_recent_context( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (most_recent_context::Param0,), - most_recent_context::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (most_recent_context::input::Param0,), + most_recent_context::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "MostRecentContext", [ @@ -34538,12 +35361,12 @@ pub mod api { #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] pub fn current_code_hash( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (current_code_hash::Param0,), - current_code_hash::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (current_code_hash::input::Param0,), + current_code_hash::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "CurrentCodeHash", [ @@ -34560,12 +35383,12 @@ pub mod api { #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] pub fn past_code_hash( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (past_code_hash::Param0,), - past_code_hash::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (past_code_hash::input::Param0,), + past_code_hash::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "PastCodeHash", [ @@ -34580,12 +35403,12 @@ pub mod api { #[doc = " to keep it available for approval checkers."] pub fn past_code_meta( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (past_code_meta::Param0,), - past_code_meta::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (past_code_meta::input::Param0,), + past_code_meta::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "PastCodeMeta", [ @@ -34604,12 +35427,12 @@ pub mod api { #[doc = " Multiple entries for a single para are permitted. Ordered ascending by block number."] pub fn past_code_pruning( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - past_code_pruning::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + past_code_pruning::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "PastCodePruning", [ @@ -34626,12 +35449,12 @@ pub mod api { #[doc = " in the context of a relay chain block with a number >= `expected_at`."] pub fn future_code_upgrades( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (future_code_upgrades::Param0,), - future_code_upgrades::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (future_code_upgrades::input::Param0,), + future_code_upgrades::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "FutureCodeUpgrades", [ @@ -34651,12 +35474,12 @@ pub mod api { #[doc = " Ordered ascending by block number."] pub fn future_code_upgrades_at( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - future_code_upgrades_at::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + future_code_upgrades_at::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "FutureCodeUpgradesAt", [ @@ -34671,12 +35494,12 @@ pub mod api { #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] pub fn future_code_hash( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (future_code_hash::Param0,), - future_code_hash::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (future_code_hash::input::Param0,), + future_code_hash::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "FutureCodeHash", [ @@ -34689,12 +35512,12 @@ pub mod api { #[doc = " The code hash authorizations for a para which will expire `expire_at` `BlockNumberFor`."] pub fn authorized_code_hash( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (authorized_code_hash::Param0,), - authorized_code_hash::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (authorized_code_hash::input::Param0,), + authorized_code_hash::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "AuthorizedCodeHash", [ @@ -34717,12 +35540,12 @@ pub mod api { #[doc = " the format will require migration of parachains."] pub fn upgrade_go_ahead_signal( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (upgrade_go_ahead_signal::Param0,), - upgrade_go_ahead_signal::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (upgrade_go_ahead_signal::input::Param0,), + upgrade_go_ahead_signal::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "UpgradeGoAheadSignal", [ @@ -34744,12 +35567,12 @@ pub mod api { #[doc = " the format will require migration of parachains."] pub fn upgrade_restriction_signal( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (upgrade_restriction_signal::Param0,), - upgrade_restriction_signal::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (upgrade_restriction_signal::input::Param0,), + upgrade_restriction_signal::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "UpgradeRestrictionSignal", [ @@ -34765,12 +35588,12 @@ pub mod api { #[doc = " Ordered ascending by block number."] pub fn upgrade_cooldowns( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - upgrade_cooldowns::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + upgrade_cooldowns::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "UpgradeCooldowns", [ @@ -34788,12 +35611,12 @@ pub mod api { #[doc = " Ordered ascending by block number."] pub fn upcoming_upgrades( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - upcoming_upgrades::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + upcoming_upgrades::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "UpcomingUpgrades", [ @@ -34806,12 +35629,12 @@ pub mod api { #[doc = " The actions to perform during the start of a specific session index."] pub fn actions_queue( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (actions_queue::Param0,), - actions_queue::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (actions_queue::input::Param0,), + actions_queue::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "ActionsQueue", [ @@ -34828,12 +35651,12 @@ pub mod api { #[doc = " to empty. Instead, the code will be saved into the storage right away via `CodeByHash`."] pub fn upcoming_paras_genesis( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (upcoming_paras_genesis::Param0,), - upcoming_paras_genesis::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (upcoming_paras_genesis::input::Param0,), + upcoming_paras_genesis::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "UpcomingParasGenesis", [ @@ -34847,12 +35670,12 @@ pub mod api { #[doc = " The number of reference on the validation code in [`CodeByHash`] storage."] pub fn code_by_hash_refs( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (code_by_hash_refs::Param0,), - code_by_hash_refs::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (code_by_hash_refs::input::Param0,), + code_by_hash_refs::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "CodeByHashRefs", [ @@ -34869,12 +35692,12 @@ pub mod api { #[doc = " [`PastCodeHash`]."] pub fn code_by_hash( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (code_by_hash::Param0,), - code_by_hash::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (code_by_hash::input::Param0,), + code_by_hash::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Paras", "CodeByHash", [ @@ -34889,226 +35712,230 @@ pub mod api { pub mod pvf_active_vote_map { use super::root_mod; use super::runtime_types; - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_runtime_parachains::paras::PvfCheckActiveVoteState< - ::core::primitive::u32, - >; + pub type Param0 = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; } + pub type Output = + runtime_types::polkadot_runtime_parachains::paras::PvfCheckActiveVoteState< + ::core::primitive::u32, + >; } pub mod pvf_active_vote_list { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash > ; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash, + >; } pub mod parachains { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; } pub mod para_lifecycles { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle; } pub mod heads { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_parachain_primitives::primitives::HeadData; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = + runtime_types::polkadot_parachain_primitives::primitives::HeadData; } pub mod most_recent_context { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::core::primitive::u32; } pub mod current_code_hash { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; } pub mod past_code_hash { use super::root_mod; use super::runtime_types; - pub type Param0 = ( - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u32, - ); - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; + pub type Param0 = ( + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u32, + ); } + pub type Output = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; } pub mod past_code_meta { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< - ::core::primitive::u32, - >; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = + runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< + ::core::primitive::u32, + >; } pub mod past_code_pruning { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u32, - )>; } + pub type Output = ::subxt::alloc::vec::Vec<( + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u32, + )>; } pub mod future_code_upgrades { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::core::primitive::u32; } pub mod future_code_upgrades_at { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u32, - )>; } + pub type Output = ::subxt::alloc::vec::Vec<( + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u32, + )>; } pub mod future_code_hash { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; } pub mod authorized_code_hash { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_runtime_parachains :: paras :: AuthorizedCodeHashAndExpiry < :: core :: primitive :: u32 > ; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = + runtime_types::polkadot_runtime_parachains::paras::AuthorizedCodeHashAndExpiry< + ::core::primitive::u32, + >; } pub mod upgrade_go_ahead_signal { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::polkadot_primitives::v9::UpgradeGoAhead; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = runtime_types::polkadot_primitives::v9::UpgradeGoAhead; } pub mod upgrade_restriction_signal { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::polkadot_primitives::v9::UpgradeRestriction; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = runtime_types::polkadot_primitives::v9::UpgradeRestriction; } pub mod upgrade_cooldowns { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u32, - )>; } + pub type Output = ::subxt::alloc::vec::Vec<( + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u32, + )>; } pub mod upcoming_upgrades { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u32, - )>; } + pub type Output = ::subxt::alloc::vec::Vec<( + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u32, + )>; } pub mod actions_queue { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; } pub mod upcoming_paras_genesis { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = + runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs; } pub mod code_by_hash_refs { use super::root_mod; use super::runtime_types; - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; } + pub type Output = ::core::primitive::u32; } pub mod code_by_hash { use super::root_mod; use super::runtime_types; - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; + pub type Param0 = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; } + pub type Output = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; } } pub mod constants { @@ -35117,10 +35944,8 @@ pub mod api { impl ConstantsApi { pub fn unsigned_priority( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u64> { + ::subxt::constants::StaticAddress::new_static( "Paras", "UnsignedPriority", [ @@ -35142,56 +35967,55 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] + #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] + #[doc = "chain are valid and should be finalized."] + pub struct ForceApprove { + pub up_to: force_approve::UpTo, + } + pub mod force_approve { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] - #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] - #[doc = "chain are valid and should be finalized."] - pub struct ForceApprove { - pub up_to: force_approve::UpTo, - } - pub mod force_approve { - use super::runtime_types; - pub type UpTo = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceApprove { - const PALLET: &'static str = "Initializer"; - const CALL: &'static str = "force_approve"; - } + pub type UpTo = ::core::primitive::u32; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] - #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] - #[doc = "chain are valid and should be finalized."] - pub fn force_approve( - &self, - up_to: types::force_approve::UpTo, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Initializer", - "force_approve", - types::ForceApprove { up_to }, - [ - 232u8, 166u8, 27u8, 229u8, 157u8, 240u8, 18u8, 137u8, 5u8, 159u8, - 179u8, 239u8, 218u8, 41u8, 181u8, 42u8, 159u8, 243u8, 246u8, 214u8, - 227u8, 77u8, 58u8, 70u8, 241u8, 114u8, 175u8, 124u8, 77u8, 102u8, - 105u8, 199u8, - ], - ) + impl ForceApprove { + const PALLET_NAME: &'static str = "Initializer"; + const CALL_NAME: &'static str = "force_approve"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceApprove { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] + #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] + #[doc = "chain are valid and should be finalized."] + pub fn force_approve( + &self, + up_to: super::force_approve::UpTo, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Initializer", + "force_approve", + super::ForceApprove { up_to }, + [ + 232u8, 166u8, 27u8, 229u8, 157u8, 240u8, 18u8, 137u8, 5u8, 159u8, + 179u8, 239u8, 218u8, 41u8, 181u8, 42u8, 159u8, 243u8, 246u8, 214u8, + 227u8, 77u8, 58u8, 70u8, 241u8, 114u8, 175u8, 124u8, 77u8, 102u8, + 105u8, 199u8, + ], + ) + } } } } @@ -35210,12 +36034,9 @@ pub mod api { #[doc = " for the semantics of this variable."] pub fn has_initialized( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - has_initialized::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), has_initialized::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Initializer", "HasInitialized", [ @@ -35235,12 +36056,12 @@ pub mod api { #[doc = " upgrade boundaries or if governance intervenes."] pub fn buffered_session_changes( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - buffered_session_changes::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + buffered_session_changes::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Initializer", "BufferedSessionChanges", [ @@ -35254,18 +36075,20 @@ pub mod api { pub mod has_initialized { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (); } + pub type Output = (); } pub mod buffered_session_changes { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > ; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_runtime_parachains::initializer::BufferedSessionChange, + >; } } } @@ -35280,12 +36103,12 @@ pub mod api { #[doc = " The downward messages addressed for a certain para."] pub fn downward_message_queues( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (downward_message_queues::Param0,), - downward_message_queues::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (downward_message_queues::input::Param0,), + downward_message_queues::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Dmp", "DownwardMessageQueues", [ @@ -35305,12 +36128,12 @@ pub mod api { #[doc = " - `H(M)`: is the hash of the message being appended."] pub fn downward_message_queue_heads( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (downward_message_queue_heads::Param0,), - downward_message_queue_heads::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (downward_message_queue_heads::input::Param0,), + downward_message_queue_heads::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Dmp", "DownwardMessageQueueHeads", [ @@ -35323,12 +36146,12 @@ pub mod api { #[doc = " The factor to multiply the base delivery fee by."] pub fn delivery_fee_factor( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (delivery_fee_factor::Param0,), - delivery_fee_factor::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (delivery_fee_factor::input::Param0,), + delivery_fee_factor::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Dmp", "DeliveryFeeFactor", [ @@ -35342,33 +36165,33 @@ pub mod api { pub mod downward_message_queues { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_core_primitives::InboundDownwardMessage< - ::core::primitive::u32, - >, - >; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_core_primitives::InboundDownwardMessage< + ::core::primitive::u32, + >, + >; } pub mod downward_message_queue_heads { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::H256; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::subxt::utils::H256; } pub mod delivery_fee_factor { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_arithmetic::fixed_point::FixedU128; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = runtime_types::sp_arithmetic::fixed_point::FixedU128; } } } @@ -35382,661 +36205,668 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] + #[doc = "parameters."] + #[doc = ""] + #[doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] + #[doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] + #[doc = ""] + #[doc = "These numbers are a subject to the relay-chain configuration limits."] + #[doc = ""] + #[doc = "The channel can be opened only after the recipient confirms it and only on a session"] + #[doc = "change."] + pub struct HrmpInitOpenChannel { + pub recipient: hrmp_init_open_channel::Recipient, + pub proposed_max_capacity: hrmp_init_open_channel::ProposedMaxCapacity, + pub proposed_max_message_size: hrmp_init_open_channel::ProposedMaxMessageSize, + } + pub mod hrmp_init_open_channel { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] - #[doc = "parameters."] - #[doc = ""] - #[doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] - #[doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] - #[doc = ""] - #[doc = "These numbers are a subject to the relay-chain configuration limits."] - #[doc = ""] - #[doc = "The channel can be opened only after the recipient confirms it and only on a session"] - #[doc = "change."] - pub struct HrmpInitOpenChannel { - pub recipient: hrmp_init_open_channel::Recipient, - pub proposed_max_capacity: hrmp_init_open_channel::ProposedMaxCapacity, - pub proposed_max_message_size: hrmp_init_open_channel::ProposedMaxMessageSize, - } - pub mod hrmp_init_open_channel { - use super::runtime_types; - pub type Recipient = - runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type ProposedMaxCapacity = ::core::primitive::u32; - pub type ProposedMaxMessageSize = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for HrmpInitOpenChannel { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "hrmp_init_open_channel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Accept a pending open channel request from the given sender."] - #[doc = ""] - #[doc = "The channel will be opened only on the next session boundary."] - pub struct HrmpAcceptOpenChannel { - pub sender: hrmp_accept_open_channel::Sender, - } - pub mod hrmp_accept_open_channel { - use super::runtime_types; - pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for HrmpAcceptOpenChannel { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "hrmp_accept_open_channel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] - #[doc = "recipient in the channel being closed."] - #[doc = ""] - #[doc = "The closure can only happen on a session change."] - pub struct HrmpCloseChannel { - pub channel_id: hrmp_close_channel::ChannelId, - } - pub mod hrmp_close_channel { - use super::runtime_types; - pub type ChannelId = - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for HrmpCloseChannel { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "hrmp_close_channel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "This extrinsic triggers the cleanup of all the HRMP storage items that a para may have."] - #[doc = "Normally this happens once per session, but this allows you to trigger the cleanup"] - #[doc = "immediately for a specific parachain."] - #[doc = ""] - #[doc = "Number of inbound and outbound channels for `para` must be provided as witness data."] - #[doc = ""] - #[doc = "Origin must be the `ChannelManager`."] - pub struct ForceCleanHrmp { - pub para: force_clean_hrmp::Para, - pub num_inbound: force_clean_hrmp::NumInbound, - pub num_outbound: force_clean_hrmp::NumOutbound, - } - pub mod force_clean_hrmp { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type NumInbound = ::core::primitive::u32; - pub type NumOutbound = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCleanHrmp { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "force_clean_hrmp"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force process HRMP open channel requests."] - #[doc = ""] - #[doc = "If there are pending HRMP open channel requests, you can use this function to process"] - #[doc = "all of those requests immediately."] - #[doc = ""] - #[doc = "Total number of opening channels must be provided as witness data."] - #[doc = ""] - #[doc = "Origin must be the `ChannelManager`."] - pub struct ForceProcessHrmpOpen { - pub channels: force_process_hrmp_open::Channels, - } - pub mod force_process_hrmp_open { - use super::runtime_types; - pub type Channels = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceProcessHrmpOpen { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "force_process_hrmp_open"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force process HRMP close channel requests."] - #[doc = ""] - #[doc = "If there are pending HRMP close channel requests, you can use this function to process"] - #[doc = "all of those requests immediately."] - #[doc = ""] - #[doc = "Total number of closing channels must be provided as witness data."] - #[doc = ""] - #[doc = "Origin must be the `ChannelManager`."] - pub struct ForceProcessHrmpClose { - pub channels: force_process_hrmp_close::Channels, - } - pub mod force_process_hrmp_close { - use super::runtime_types; - pub type Channels = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceProcessHrmpClose { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "force_process_hrmp_close"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] - #[doc = "or the recipient for that request. The origin must be either of those."] - #[doc = ""] - #[doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] - #[doc = "already accepted."] - #[doc = ""] - #[doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] - #[doc = "witness data."] - pub struct HrmpCancelOpenRequest { - pub channel_id: hrmp_cancel_open_request::ChannelId, - pub open_requests: hrmp_cancel_open_request::OpenRequests, - } - pub mod hrmp_cancel_open_request { - use super::runtime_types; - pub type ChannelId = - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; - pub type OpenRequests = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for HrmpCancelOpenRequest { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "hrmp_cancel_open_request"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Open a channel from a `sender` to a `recipient` `ParaId`. Although opened by governance,"] - #[doc = "the `max_capacity` and `max_message_size` are still subject to the Relay Chain's"] - #[doc = "configured limits."] - #[doc = ""] - #[doc = "Expected use is when one (and only one) of the `ParaId`s involved in the channel is"] - #[doc = "governed by the system, e.g. a system parachain."] - #[doc = ""] - #[doc = "Origin must be the `ChannelManager`."] - pub struct ForceOpenHrmpChannel { - pub sender: force_open_hrmp_channel::Sender, - pub recipient: force_open_hrmp_channel::Recipient, - pub max_capacity: force_open_hrmp_channel::MaxCapacity, - pub max_message_size: force_open_hrmp_channel::MaxMessageSize, - } - pub mod force_open_hrmp_channel { - use super::runtime_types; - pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Recipient = - runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type MaxCapacity = ::core::primitive::u32; - pub type MaxMessageSize = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceOpenHrmpChannel { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "force_open_hrmp_channel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Establish an HRMP channel between two system chains. If the channel does not already"] - #[doc = "exist, the transaction fees will be refunded to the caller. The system does not take"] - #[doc = "deposits for channels between system chains, and automatically sets the message number"] - #[doc = "and size limits to the maximum allowed by the network's configuration."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = ""] - #[doc = "- `sender`: A system chain, `ParaId`."] - #[doc = "- `recipient`: A system chain, `ParaId`."] - #[doc = ""] - #[doc = "Any signed origin can call this function, but _both_ inputs MUST be system chains. If"] - #[doc = "the channel does not exist yet, there is no fee."] - pub struct EstablishSystemChannel { - pub sender: establish_system_channel::Sender, - pub recipient: establish_system_channel::Recipient, - } - pub mod establish_system_channel { - use super::runtime_types; - pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Recipient = - runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for EstablishSystemChannel { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "establish_system_channel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Update the deposits held for an HRMP channel to the latest `Configuration`. Channels"] - #[doc = "with system chains do not require a deposit."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = ""] - #[doc = "- `sender`: A chain, `ParaId`."] - #[doc = "- `recipient`: A chain, `ParaId`."] - #[doc = ""] - #[doc = "Any signed origin can call this function."] - pub struct PokeChannelDeposits { - pub sender: poke_channel_deposits::Sender, - pub recipient: poke_channel_deposits::Recipient, - } - pub mod poke_channel_deposits { - use super::runtime_types; - pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Recipient = - runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeChannelDeposits { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "poke_channel_deposits"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Establish a bidirectional HRMP channel between a parachain and a system chain."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = ""] - #[doc = "- `target_system_chain`: A system chain, `ParaId`."] - #[doc = ""] - #[doc = "The origin needs to be the parachain origin."] - pub struct EstablishChannelWithSystem { - pub target_system_chain: establish_channel_with_system::TargetSystemChain, - } - pub mod establish_channel_with_system { - use super::runtime_types; - pub type TargetSystemChain = - runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for EstablishChannelWithSystem { - const PALLET: &'static str = "Hrmp"; - const CALL: &'static str = "establish_channel_with_system"; - } + pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type ProposedMaxCapacity = ::core::primitive::u32; + pub type ProposedMaxMessageSize = ::core::primitive::u32; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] - #[doc = "parameters."] - #[doc = ""] - #[doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] - #[doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] - #[doc = ""] - #[doc = "These numbers are a subject to the relay-chain configuration limits."] - #[doc = ""] - #[doc = "The channel can be opened only after the recipient confirms it and only on a session"] - #[doc = "change."] - pub fn hrmp_init_open_channel( - &self, - recipient: types::hrmp_init_open_channel::Recipient, - proposed_max_capacity: types::hrmp_init_open_channel::ProposedMaxCapacity, - proposed_max_message_size : types :: hrmp_init_open_channel :: ProposedMaxMessageSize, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "hrmp_init_open_channel", - types::HrmpInitOpenChannel { - recipient, - proposed_max_capacity, - proposed_max_message_size, - }, - [ - 89u8, 39u8, 43u8, 191u8, 235u8, 40u8, 253u8, 129u8, 174u8, 108u8, 26u8, - 206u8, 7u8, 146u8, 206u8, 56u8, 53u8, 104u8, 138u8, 203u8, 108u8, - 195u8, 190u8, 231u8, 223u8, 33u8, 32u8, 157u8, 148u8, 235u8, 67u8, - 82u8, - ], - ) + impl HrmpInitOpenChannel { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "hrmp_init_open_channel"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for HrmpInitOpenChannel { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Accept a pending open channel request from the given sender."] - #[doc = ""] - #[doc = "The channel will be opened only on the next session boundary."] - pub fn hrmp_accept_open_channel( - &self, - sender: types::hrmp_accept_open_channel::Sender, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::HrmpAcceptOpenChannel, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "hrmp_accept_open_channel", - types::HrmpAcceptOpenChannel { sender }, - [ - 133u8, 77u8, 88u8, 40u8, 47u8, 81u8, 95u8, 206u8, 165u8, 41u8, 191u8, - 241u8, 130u8, 244u8, 70u8, 227u8, 69u8, 80u8, 130u8, 126u8, 34u8, 69u8, - 214u8, 81u8, 7u8, 199u8, 249u8, 162u8, 234u8, 233u8, 195u8, 156u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Accept a pending open channel request from the given sender."] + #[doc = ""] + #[doc = "The channel will be opened only on the next session boundary."] + pub struct HrmpAcceptOpenChannel { + pub sender: hrmp_accept_open_channel::Sender, + } + pub mod hrmp_accept_open_channel { + use super::runtime_types; + pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl HrmpAcceptOpenChannel { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "hrmp_accept_open_channel"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for HrmpAcceptOpenChannel { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] - #[doc = "recipient in the channel being closed."] - #[doc = ""] - #[doc = "The closure can only happen on a session change."] - pub fn hrmp_close_channel( - &self, - channel_id: types::hrmp_close_channel::ChannelId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "hrmp_close_channel", - types::HrmpCloseChannel { channel_id }, - [ - 174u8, 225u8, 93u8, 69u8, 133u8, 145u8, 156u8, 94u8, 185u8, 254u8, - 60u8, 209u8, 232u8, 79u8, 237u8, 173u8, 180u8, 45u8, 117u8, 165u8, - 202u8, 195u8, 84u8, 68u8, 241u8, 164u8, 151u8, 216u8, 96u8, 20u8, 7u8, - 45u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] + #[doc = "recipient in the channel being closed."] + #[doc = ""] + #[doc = "The closure can only happen on a session change."] + pub struct HrmpCloseChannel { + pub channel_id: hrmp_close_channel::ChannelId, + } + pub mod hrmp_close_channel { + use super::runtime_types; + pub type ChannelId = + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; + } + impl HrmpCloseChannel { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "hrmp_close_channel"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for HrmpCloseChannel { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "This extrinsic triggers the cleanup of all the HRMP storage items that a para may have."] - #[doc = "Normally this happens once per session, but this allows you to trigger the cleanup"] - #[doc = "immediately for a specific parachain."] - #[doc = ""] - #[doc = "Number of inbound and outbound channels for `para` must be provided as witness data."] - #[doc = ""] - #[doc = "Origin must be the `ChannelManager`."] - pub fn force_clean_hrmp( - &self, - para: types::force_clean_hrmp::Para, - num_inbound: types::force_clean_hrmp::NumInbound, - num_outbound: types::force_clean_hrmp::NumOutbound, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "force_clean_hrmp", - types::ForceCleanHrmp { - para, - num_inbound, - num_outbound, - }, - [ - 0u8, 184u8, 199u8, 44u8, 26u8, 150u8, 124u8, 255u8, 40u8, 63u8, 74u8, - 31u8, 133u8, 22u8, 241u8, 84u8, 44u8, 184u8, 128u8, 54u8, 175u8, 127u8, - 255u8, 232u8, 239u8, 26u8, 50u8, 27u8, 81u8, 223u8, 136u8, 110u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "This extrinsic triggers the cleanup of all the HRMP storage items that a para may have."] + #[doc = "Normally this happens once per session, but this allows you to trigger the cleanup"] + #[doc = "immediately for a specific parachain."] + #[doc = ""] + #[doc = "Number of inbound and outbound channels for `para` must be provided as witness data."] + #[doc = ""] + #[doc = "Origin must be the `ChannelManager`."] + pub struct ForceCleanHrmp { + pub para: force_clean_hrmp::Para, + pub num_inbound: force_clean_hrmp::NumInbound, + pub num_outbound: force_clean_hrmp::NumOutbound, + } + pub mod force_clean_hrmp { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type NumInbound = ::core::primitive::u32; + pub type NumOutbound = ::core::primitive::u32; + } + impl ForceCleanHrmp { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "force_clean_hrmp"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceCleanHrmp { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Force process HRMP open channel requests."] - #[doc = ""] - #[doc = "If there are pending HRMP open channel requests, you can use this function to process"] - #[doc = "all of those requests immediately."] - #[doc = ""] - #[doc = "Total number of opening channels must be provided as witness data."] - #[doc = ""] - #[doc = "Origin must be the `ChannelManager`."] - pub fn force_process_hrmp_open( - &self, - channels: types::force_process_hrmp_open::Channels, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "force_process_hrmp_open", - types::ForceProcessHrmpOpen { channels }, - [ - 66u8, 138u8, 220u8, 119u8, 251u8, 148u8, 72u8, 167u8, 49u8, 156u8, - 227u8, 174u8, 153u8, 145u8, 190u8, 195u8, 192u8, 183u8, 41u8, 213u8, - 134u8, 8u8, 114u8, 30u8, 191u8, 81u8, 208u8, 54u8, 120u8, 36u8, 195u8, - 246u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Force process HRMP open channel requests."] + #[doc = ""] + #[doc = "If there are pending HRMP open channel requests, you can use this function to process"] + #[doc = "all of those requests immediately."] + #[doc = ""] + #[doc = "Total number of opening channels must be provided as witness data."] + #[doc = ""] + #[doc = "Origin must be the `ChannelManager`."] + pub struct ForceProcessHrmpOpen { + pub channels: force_process_hrmp_open::Channels, + } + pub mod force_process_hrmp_open { + use super::runtime_types; + pub type Channels = ::core::primitive::u32; + } + impl ForceProcessHrmpOpen { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "force_process_hrmp_open"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceProcessHrmpOpen { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Force process HRMP close channel requests."] - #[doc = ""] - #[doc = "If there are pending HRMP close channel requests, you can use this function to process"] - #[doc = "all of those requests immediately."] - #[doc = ""] - #[doc = "Total number of closing channels must be provided as witness data."] - #[doc = ""] - #[doc = "Origin must be the `ChannelManager`."] - pub fn force_process_hrmp_close( - &self, - channels: types::force_process_hrmp_close::Channels, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceProcessHrmpClose, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "force_process_hrmp_close", - types::ForceProcessHrmpClose { channels }, - [ - 22u8, 60u8, 113u8, 94u8, 199u8, 101u8, 204u8, 34u8, 158u8, 77u8, 228u8, - 29u8, 180u8, 249u8, 46u8, 103u8, 206u8, 155u8, 164u8, 229u8, 70u8, - 189u8, 218u8, 171u8, 173u8, 22u8, 210u8, 73u8, 232u8, 99u8, 225u8, - 176u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Force process HRMP close channel requests."] + #[doc = ""] + #[doc = "If there are pending HRMP close channel requests, you can use this function to process"] + #[doc = "all of those requests immediately."] + #[doc = ""] + #[doc = "Total number of closing channels must be provided as witness data."] + #[doc = ""] + #[doc = "Origin must be the `ChannelManager`."] + pub struct ForceProcessHrmpClose { + pub channels: force_process_hrmp_close::Channels, + } + pub mod force_process_hrmp_close { + use super::runtime_types; + pub type Channels = ::core::primitive::u32; + } + impl ForceProcessHrmpClose { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "force_process_hrmp_close"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceProcessHrmpClose { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] - #[doc = "or the recipient for that request. The origin must be either of those."] - #[doc = ""] - #[doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] - #[doc = "already accepted."] - #[doc = ""] - #[doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] - #[doc = "witness data."] - pub fn hrmp_cancel_open_request( - &self, - channel_id: types::hrmp_cancel_open_request::ChannelId, - open_requests: types::hrmp_cancel_open_request::OpenRequests, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::HrmpCancelOpenRequest, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "hrmp_cancel_open_request", - types::HrmpCancelOpenRequest { - channel_id, - open_requests, - }, - [ - 10u8, 192u8, 79u8, 120u8, 6u8, 88u8, 139u8, 75u8, 87u8, 32u8, 125u8, - 47u8, 178u8, 132u8, 156u8, 232u8, 28u8, 123u8, 74u8, 10u8, 180u8, 90u8, - 145u8, 123u8, 40u8, 89u8, 235u8, 25u8, 237u8, 137u8, 114u8, 173u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] + #[doc = "or the recipient for that request. The origin must be either of those."] + #[doc = ""] + #[doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] + #[doc = "already accepted."] + #[doc = ""] + #[doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] + #[doc = "witness data."] + pub struct HrmpCancelOpenRequest { + pub channel_id: hrmp_cancel_open_request::ChannelId, + pub open_requests: hrmp_cancel_open_request::OpenRequests, + } + pub mod hrmp_cancel_open_request { + use super::runtime_types; + pub type ChannelId = + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; + pub type OpenRequests = ::core::primitive::u32; + } + impl HrmpCancelOpenRequest { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "hrmp_cancel_open_request"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for HrmpCancelOpenRequest { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Open a channel from a `sender` to a `recipient` `ParaId`. Although opened by governance,"] - #[doc = "the `max_capacity` and `max_message_size` are still subject to the Relay Chain's"] - #[doc = "configured limits."] - #[doc = ""] - #[doc = "Expected use is when one (and only one) of the `ParaId`s involved in the channel is"] - #[doc = "governed by the system, e.g. a system parachain."] - #[doc = ""] - #[doc = "Origin must be the `ChannelManager`."] - pub fn force_open_hrmp_channel( - &self, - sender: types::force_open_hrmp_channel::Sender, - recipient: types::force_open_hrmp_channel::Recipient, - max_capacity: types::force_open_hrmp_channel::MaxCapacity, - max_message_size: types::force_open_hrmp_channel::MaxMessageSize, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "force_open_hrmp_channel", - types::ForceOpenHrmpChannel { - sender, - recipient, - max_capacity, - max_message_size, - }, - [ - 37u8, 251u8, 1u8, 201u8, 129u8, 217u8, 193u8, 179u8, 98u8, 153u8, - 226u8, 139u8, 107u8, 222u8, 3u8, 76u8, 104u8, 248u8, 31u8, 241u8, 90u8, - 189u8, 56u8, 92u8, 118u8, 68u8, 177u8, 70u8, 5u8, 44u8, 234u8, 27u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Open a channel from a `sender` to a `recipient` `ParaId`. Although opened by governance,"] + #[doc = "the `max_capacity` and `max_message_size` are still subject to the Relay Chain's"] + #[doc = "configured limits."] + #[doc = ""] + #[doc = "Expected use is when one (and only one) of the `ParaId`s involved in the channel is"] + #[doc = "governed by the system, e.g. a system parachain."] + #[doc = ""] + #[doc = "Origin must be the `ChannelManager`."] + pub struct ForceOpenHrmpChannel { + pub sender: force_open_hrmp_channel::Sender, + pub recipient: force_open_hrmp_channel::Recipient, + pub max_capacity: force_open_hrmp_channel::MaxCapacity, + pub max_message_size: force_open_hrmp_channel::MaxMessageSize, + } + pub mod force_open_hrmp_channel { + use super::runtime_types; + pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type MaxCapacity = ::core::primitive::u32; + pub type MaxMessageSize = ::core::primitive::u32; + } + impl ForceOpenHrmpChannel { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "force_open_hrmp_channel"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceOpenHrmpChannel { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Establish an HRMP channel between two system chains. If the channel does not already"] - #[doc = "exist, the transaction fees will be refunded to the caller. The system does not take"] - #[doc = "deposits for channels between system chains, and automatically sets the message number"] - #[doc = "and size limits to the maximum allowed by the network's configuration."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = ""] - #[doc = "- `sender`: A system chain, `ParaId`."] - #[doc = "- `recipient`: A system chain, `ParaId`."] - #[doc = ""] - #[doc = "Any signed origin can call this function, but _both_ inputs MUST be system chains. If"] - #[doc = "the channel does not exist yet, there is no fee."] - pub fn establish_system_channel( - &self, - sender: types::establish_system_channel::Sender, - recipient: types::establish_system_channel::Recipient, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::EstablishSystemChannel, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "establish_system_channel", - types::EstablishSystemChannel { sender, recipient }, - [ - 179u8, 12u8, 66u8, 57u8, 24u8, 114u8, 175u8, 141u8, 80u8, 157u8, 204u8, - 122u8, 116u8, 139u8, 35u8, 51u8, 68u8, 36u8, 61u8, 135u8, 221u8, 40u8, - 135u8, 21u8, 91u8, 60u8, 51u8, 51u8, 32u8, 224u8, 71u8, 182u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Establish an HRMP channel between two system chains. If the channel does not already"] + #[doc = "exist, the transaction fees will be refunded to the caller. The system does not take"] + #[doc = "deposits for channels between system chains, and automatically sets the message number"] + #[doc = "and size limits to the maximum allowed by the network's configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = ""] + #[doc = "- `sender`: A system chain, `ParaId`."] + #[doc = "- `recipient`: A system chain, `ParaId`."] + #[doc = ""] + #[doc = "Any signed origin can call this function, but _both_ inputs MUST be system chains. If"] + #[doc = "the channel does not exist yet, there is no fee."] + pub struct EstablishSystemChannel { + pub sender: establish_system_channel::Sender, + pub recipient: establish_system_channel::Recipient, + } + pub mod establish_system_channel { + use super::runtime_types; + pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl EstablishSystemChannel { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "establish_system_channel"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for EstablishSystemChannel { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Update the deposits held for an HRMP channel to the latest `Configuration`. Channels"] - #[doc = "with system chains do not require a deposit."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = ""] - #[doc = "- `sender`: A chain, `ParaId`."] - #[doc = "- `recipient`: A chain, `ParaId`."] - #[doc = ""] - #[doc = "Any signed origin can call this function."] - pub fn poke_channel_deposits( - &self, - sender: types::poke_channel_deposits::Sender, - recipient: types::poke_channel_deposits::Recipient, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "poke_channel_deposits", - types::PokeChannelDeposits { sender, recipient }, - [ - 93u8, 153u8, 50u8, 127u8, 136u8, 255u8, 6u8, 155u8, 73u8, 216u8, 145u8, - 229u8, 200u8, 75u8, 94u8, 39u8, 117u8, 188u8, 62u8, 172u8, 210u8, - 212u8, 37u8, 11u8, 166u8, 31u8, 101u8, 129u8, 29u8, 229u8, 200u8, 16u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Update the deposits held for an HRMP channel to the latest `Configuration`. Channels"] + #[doc = "with system chains do not require a deposit."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = ""] + #[doc = "- `sender`: A chain, `ParaId`."] + #[doc = "- `recipient`: A chain, `ParaId`."] + #[doc = ""] + #[doc = "Any signed origin can call this function."] + pub struct PokeChannelDeposits { + pub sender: poke_channel_deposits::Sender, + pub recipient: poke_channel_deposits::Recipient, + } + pub mod poke_channel_deposits { + use super::runtime_types; + pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl PokeChannelDeposits { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "poke_channel_deposits"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PokeChannelDeposits { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Establish a bidirectional HRMP channel between a parachain and a system chain."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = ""] - #[doc = "- `target_system_chain`: A system chain, `ParaId`."] - #[doc = ""] - #[doc = "The origin needs to be the parachain origin."] - pub fn establish_channel_with_system( - &self, - target_system_chain: types::establish_channel_with_system::TargetSystemChain, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::EstablishChannelWithSystem, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Hrmp", - "establish_channel_with_system", - types::EstablishChannelWithSystem { - target_system_chain, - }, - [ - 97u8, 88u8, 72u8, 195u8, 37u8, 11u8, 77u8, 206u8, 254u8, 81u8, 104u8, - 73u8, 220u8, 240u8, 187u8, 154u8, 131u8, 146u8, 128u8, 116u8, 223u8, - 35u8, 105u8, 236u8, 208u8, 99u8, 233u8, 74u8, 115u8, 166u8, 5u8, 205u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Establish a bidirectional HRMP channel between a parachain and a system chain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = ""] + #[doc = "- `target_system_chain`: A system chain, `ParaId`."] + #[doc = ""] + #[doc = "The origin needs to be the parachain origin."] + pub struct EstablishChannelWithSystem { + pub target_system_chain: establish_channel_with_system::TargetSystemChain, + } + pub mod establish_channel_with_system { + use super::runtime_types; + pub type TargetSystemChain = + runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl EstablishChannelWithSystem { + const PALLET_NAME: &'static str = "Hrmp"; + const CALL_NAME: &'static str = "establish_channel_with_system"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for EstablishChannelWithSystem { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] + #[doc = "parameters."] + #[doc = ""] + #[doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] + #[doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] + #[doc = ""] + #[doc = "These numbers are a subject to the relay-chain configuration limits."] + #[doc = ""] + #[doc = "The channel can be opened only after the recipient confirms it and only on a session"] + #[doc = "change."] + pub fn hrmp_init_open_channel( + &self, + recipient: super::hrmp_init_open_channel::Recipient, + proposed_max_capacity: super::hrmp_init_open_channel::ProposedMaxCapacity, + proposed_max_message_size : super :: hrmp_init_open_channel :: ProposedMaxMessageSize, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "hrmp_init_open_channel", + super::HrmpInitOpenChannel { + recipient, + proposed_max_capacity, + proposed_max_message_size, + }, + [ + 89u8, 39u8, 43u8, 191u8, 235u8, 40u8, 253u8, 129u8, 174u8, 108u8, + 26u8, 206u8, 7u8, 146u8, 206u8, 56u8, 53u8, 104u8, 138u8, 203u8, + 108u8, 195u8, 190u8, 231u8, 223u8, 33u8, 32u8, 157u8, 148u8, 235u8, + 67u8, 82u8, + ], + ) + } + #[doc = "Accept a pending open channel request from the given sender."] + #[doc = ""] + #[doc = "The channel will be opened only on the next session boundary."] + pub fn hrmp_accept_open_channel( + &self, + sender: super::hrmp_accept_open_channel::Sender, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "hrmp_accept_open_channel", + super::HrmpAcceptOpenChannel { sender }, + [ + 133u8, 77u8, 88u8, 40u8, 47u8, 81u8, 95u8, 206u8, 165u8, 41u8, + 191u8, 241u8, 130u8, 244u8, 70u8, 227u8, 69u8, 80u8, 130u8, 126u8, + 34u8, 69u8, 214u8, 81u8, 7u8, 199u8, 249u8, 162u8, 234u8, 233u8, + 195u8, 156u8, + ], + ) + } + #[doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] + #[doc = "recipient in the channel being closed."] + #[doc = ""] + #[doc = "The closure can only happen on a session change."] + pub fn hrmp_close_channel( + &self, + channel_id: super::hrmp_close_channel::ChannelId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "hrmp_close_channel", + super::HrmpCloseChannel { channel_id }, + [ + 174u8, 225u8, 93u8, 69u8, 133u8, 145u8, 156u8, 94u8, 185u8, 254u8, + 60u8, 209u8, 232u8, 79u8, 237u8, 173u8, 180u8, 45u8, 117u8, 165u8, + 202u8, 195u8, 84u8, 68u8, 241u8, 164u8, 151u8, 216u8, 96u8, 20u8, + 7u8, 45u8, + ], + ) + } + #[doc = "This extrinsic triggers the cleanup of all the HRMP storage items that a para may have."] + #[doc = "Normally this happens once per session, but this allows you to trigger the cleanup"] + #[doc = "immediately for a specific parachain."] + #[doc = ""] + #[doc = "Number of inbound and outbound channels for `para` must be provided as witness data."] + #[doc = ""] + #[doc = "Origin must be the `ChannelManager`."] + pub fn force_clean_hrmp( + &self, + para: super::force_clean_hrmp::Para, + num_inbound: super::force_clean_hrmp::NumInbound, + num_outbound: super::force_clean_hrmp::NumOutbound, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "force_clean_hrmp", + super::ForceCleanHrmp { + para, + num_inbound, + num_outbound, + }, + [ + 0u8, 184u8, 199u8, 44u8, 26u8, 150u8, 124u8, 255u8, 40u8, 63u8, + 74u8, 31u8, 133u8, 22u8, 241u8, 84u8, 44u8, 184u8, 128u8, 54u8, + 175u8, 127u8, 255u8, 232u8, 239u8, 26u8, 50u8, 27u8, 81u8, 223u8, + 136u8, 110u8, + ], + ) + } + #[doc = "Force process HRMP open channel requests."] + #[doc = ""] + #[doc = "If there are pending HRMP open channel requests, you can use this function to process"] + #[doc = "all of those requests immediately."] + #[doc = ""] + #[doc = "Total number of opening channels must be provided as witness data."] + #[doc = ""] + #[doc = "Origin must be the `ChannelManager`."] + pub fn force_process_hrmp_open( + &self, + channels: super::force_process_hrmp_open::Channels, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "force_process_hrmp_open", + super::ForceProcessHrmpOpen { channels }, + [ + 66u8, 138u8, 220u8, 119u8, 251u8, 148u8, 72u8, 167u8, 49u8, 156u8, + 227u8, 174u8, 153u8, 145u8, 190u8, 195u8, 192u8, 183u8, 41u8, + 213u8, 134u8, 8u8, 114u8, 30u8, 191u8, 81u8, 208u8, 54u8, 120u8, + 36u8, 195u8, 246u8, + ], + ) + } + #[doc = "Force process HRMP close channel requests."] + #[doc = ""] + #[doc = "If there are pending HRMP close channel requests, you can use this function to process"] + #[doc = "all of those requests immediately."] + #[doc = ""] + #[doc = "Total number of closing channels must be provided as witness data."] + #[doc = ""] + #[doc = "Origin must be the `ChannelManager`."] + pub fn force_process_hrmp_close( + &self, + channels: super::force_process_hrmp_close::Channels, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "force_process_hrmp_close", + super::ForceProcessHrmpClose { channels }, + [ + 22u8, 60u8, 113u8, 94u8, 199u8, 101u8, 204u8, 34u8, 158u8, 77u8, + 228u8, 29u8, 180u8, 249u8, 46u8, 103u8, 206u8, 155u8, 164u8, 229u8, + 70u8, 189u8, 218u8, 171u8, 173u8, 22u8, 210u8, 73u8, 232u8, 99u8, + 225u8, 176u8, + ], + ) + } + #[doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] + #[doc = "or the recipient for that request. The origin must be either of those."] + #[doc = ""] + #[doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] + #[doc = "already accepted."] + #[doc = ""] + #[doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] + #[doc = "witness data."] + pub fn hrmp_cancel_open_request( + &self, + channel_id: super::hrmp_cancel_open_request::ChannelId, + open_requests: super::hrmp_cancel_open_request::OpenRequests, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "hrmp_cancel_open_request", + super::HrmpCancelOpenRequest { + channel_id, + open_requests, + }, + [ + 10u8, 192u8, 79u8, 120u8, 6u8, 88u8, 139u8, 75u8, 87u8, 32u8, + 125u8, 47u8, 178u8, 132u8, 156u8, 232u8, 28u8, 123u8, 74u8, 10u8, + 180u8, 90u8, 145u8, 123u8, 40u8, 89u8, 235u8, 25u8, 237u8, 137u8, + 114u8, 173u8, + ], + ) + } + #[doc = "Open a channel from a `sender` to a `recipient` `ParaId`. Although opened by governance,"] + #[doc = "the `max_capacity` and `max_message_size` are still subject to the Relay Chain's"] + #[doc = "configured limits."] + #[doc = ""] + #[doc = "Expected use is when one (and only one) of the `ParaId`s involved in the channel is"] + #[doc = "governed by the system, e.g. a system parachain."] + #[doc = ""] + #[doc = "Origin must be the `ChannelManager`."] + pub fn force_open_hrmp_channel( + &self, + sender: super::force_open_hrmp_channel::Sender, + recipient: super::force_open_hrmp_channel::Recipient, + max_capacity: super::force_open_hrmp_channel::MaxCapacity, + max_message_size: super::force_open_hrmp_channel::MaxMessageSize, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "force_open_hrmp_channel", + super::ForceOpenHrmpChannel { + sender, + recipient, + max_capacity, + max_message_size, + }, + [ + 37u8, 251u8, 1u8, 201u8, 129u8, 217u8, 193u8, 179u8, 98u8, 153u8, + 226u8, 139u8, 107u8, 222u8, 3u8, 76u8, 104u8, 248u8, 31u8, 241u8, + 90u8, 189u8, 56u8, 92u8, 118u8, 68u8, 177u8, 70u8, 5u8, 44u8, + 234u8, 27u8, + ], + ) + } + #[doc = "Establish an HRMP channel between two system chains. If the channel does not already"] + #[doc = "exist, the transaction fees will be refunded to the caller. The system does not take"] + #[doc = "deposits for channels between system chains, and automatically sets the message number"] + #[doc = "and size limits to the maximum allowed by the network's configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = ""] + #[doc = "- `sender`: A system chain, `ParaId`."] + #[doc = "- `recipient`: A system chain, `ParaId`."] + #[doc = ""] + #[doc = "Any signed origin can call this function, but _both_ inputs MUST be system chains. If"] + #[doc = "the channel does not exist yet, there is no fee."] + pub fn establish_system_channel( + &self, + sender: super::establish_system_channel::Sender, + recipient: super::establish_system_channel::Recipient, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "establish_system_channel", + super::EstablishSystemChannel { sender, recipient }, + [ + 179u8, 12u8, 66u8, 57u8, 24u8, 114u8, 175u8, 141u8, 80u8, 157u8, + 204u8, 122u8, 116u8, 139u8, 35u8, 51u8, 68u8, 36u8, 61u8, 135u8, + 221u8, 40u8, 135u8, 21u8, 91u8, 60u8, 51u8, 51u8, 32u8, 224u8, + 71u8, 182u8, + ], + ) + } + #[doc = "Update the deposits held for an HRMP channel to the latest `Configuration`. Channels"] + #[doc = "with system chains do not require a deposit."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = ""] + #[doc = "- `sender`: A chain, `ParaId`."] + #[doc = "- `recipient`: A chain, `ParaId`."] + #[doc = ""] + #[doc = "Any signed origin can call this function."] + pub fn poke_channel_deposits( + &self, + sender: super::poke_channel_deposits::Sender, + recipient: super::poke_channel_deposits::Recipient, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "poke_channel_deposits", + super::PokeChannelDeposits { sender, recipient }, + [ + 93u8, 153u8, 50u8, 127u8, 136u8, 255u8, 6u8, 155u8, 73u8, 216u8, + 145u8, 229u8, 200u8, 75u8, 94u8, 39u8, 117u8, 188u8, 62u8, 172u8, + 210u8, 212u8, 37u8, 11u8, 166u8, 31u8, 101u8, 129u8, 29u8, 229u8, + 200u8, 16u8, + ], + ) + } + #[doc = "Establish a bidirectional HRMP channel between a parachain and a system chain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = ""] + #[doc = "- `target_system_chain`: A system chain, `ParaId`."] + #[doc = ""] + #[doc = "The origin needs to be the parachain origin."] + pub fn establish_channel_with_system( + &self, + target_system_chain : super :: establish_channel_with_system :: TargetSystemChain, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Hrmp", + "establish_channel_with_system", + super::EstablishChannelWithSystem { + target_system_chain, + }, + [ + 97u8, 88u8, 72u8, 195u8, 37u8, 11u8, 77u8, 206u8, 254u8, 81u8, + 104u8, 73u8, 220u8, 240u8, 187u8, 154u8, 131u8, 146u8, 128u8, + 116u8, 223u8, 35u8, 105u8, 236u8, 208u8, 99u8, 233u8, 74u8, 115u8, + 166u8, 5u8, 205u8, + ], + ) + } } } } @@ -36045,12 +36875,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Open HRMP channel requested."] pub struct OpenChannelRequested { pub sender: open_channel_requested::Sender, @@ -36065,17 +36895,22 @@ pub mod api { pub type ProposedMaxCapacity = ::core::primitive::u32; pub type ProposedMaxMessageSize = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for OpenChannelRequested { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelRequested"; + impl OpenChannelRequested { + const PALLET_NAME: &'static str = "Hrmp"; + const EVENT_NAME: &'static str = "OpenChannelRequested"; + } + impl ::subxt::events::DecodeAsEvent for OpenChannelRequested { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An HRMP channel request sent by the receiver was canceled by either party."] pub struct OpenChannelCanceled { pub by_parachain: open_channel_canceled::ByParachain, @@ -36087,17 +36922,22 @@ pub mod api { pub type ChannelId = runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; } - impl ::subxt::ext::subxt_core::events::StaticEvent for OpenChannelCanceled { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelCanceled"; + impl OpenChannelCanceled { + const PALLET_NAME: &'static str = "Hrmp"; + const EVENT_NAME: &'static str = "OpenChannelCanceled"; + } + impl ::subxt::events::DecodeAsEvent for OpenChannelCanceled { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Open HRMP channel accepted."] pub struct OpenChannelAccepted { pub sender: open_channel_accepted::Sender, @@ -36108,17 +36948,22 @@ pub mod api { pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for OpenChannelAccepted { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelAccepted"; + impl OpenChannelAccepted { + const PALLET_NAME: &'static str = "Hrmp"; + const EVENT_NAME: &'static str = "OpenChannelAccepted"; + } + impl ::subxt::events::DecodeAsEvent for OpenChannelAccepted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "HRMP channel closed."] pub struct ChannelClosed { pub by_parachain: channel_closed::ByParachain, @@ -36130,17 +36975,22 @@ pub mod api { pub type ChannelId = runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ChannelClosed { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "ChannelClosed"; + impl ChannelClosed { + const PALLET_NAME: &'static str = "Hrmp"; + const EVENT_NAME: &'static str = "ChannelClosed"; + } + impl ::subxt::events::DecodeAsEvent for ChannelClosed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An HRMP channel was opened via Root origin."] pub struct HrmpChannelForceOpened { pub sender: hrmp_channel_force_opened::Sender, @@ -36155,17 +37005,22 @@ pub mod api { pub type ProposedMaxCapacity = ::core::primitive::u32; pub type ProposedMaxMessageSize = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for HrmpChannelForceOpened { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "HrmpChannelForceOpened"; + impl HrmpChannelForceOpened { + const PALLET_NAME: &'static str = "Hrmp"; + const EVENT_NAME: &'static str = "HrmpChannelForceOpened"; + } + impl ::subxt::events::DecodeAsEvent for HrmpChannelForceOpened { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An HRMP channel was opened with a system chain."] pub struct HrmpSystemChannelOpened { pub sender: hrmp_system_channel_opened::Sender, @@ -36180,17 +37035,22 @@ pub mod api { pub type ProposedMaxCapacity = ::core::primitive::u32; pub type ProposedMaxMessageSize = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for HrmpSystemChannelOpened { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "HrmpSystemChannelOpened"; + impl HrmpSystemChannelOpened { + const PALLET_NAME: &'static str = "Hrmp"; + const EVENT_NAME: &'static str = "HrmpSystemChannelOpened"; + } + impl ::subxt::events::DecodeAsEvent for HrmpSystemChannelOpened { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An HRMP channel's deposits were updated."] pub struct OpenChannelDepositsUpdated { pub sender: open_channel_deposits_updated::Sender, @@ -36201,9 +37061,14 @@ pub mod api { pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for OpenChannelDepositsUpdated { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelDepositsUpdated"; + impl OpenChannelDepositsUpdated { + const PALLET_NAME: &'static str = "Hrmp"; + const EVENT_NAME: &'static str = "OpenChannelDepositsUpdated"; + } + impl ::subxt::events::DecodeAsEvent for OpenChannelDepositsUpdated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -36219,12 +37084,12 @@ pub mod api { #[doc = " - There are no channels that exists in list but not in the set and vice versa."] pub fn hrmp_open_channel_requests( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (hrmp_open_channel_requests::Param0,), - hrmp_open_channel_requests::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (hrmp_open_channel_requests::input::Param0,), + hrmp_open_channel_requests::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpOpenChannelRequests", [ @@ -36236,12 +37101,12 @@ pub mod api { } pub fn hrmp_open_channel_requests_list( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - hrmp_open_channel_requests_list::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + hrmp_open_channel_requests_list::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpOpenChannelRequestsList", [ @@ -36256,12 +37121,12 @@ pub mod api { #[doc = " `(X, _)` as the number of `HrmpOpenChannelRequestCount` for `X`."] pub fn hrmp_open_channel_request_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (hrmp_open_channel_request_count::Param0,), - hrmp_open_channel_request_count::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (hrmp_open_channel_request_count::input::Param0,), + hrmp_open_channel_request_count::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpOpenChannelRequestCount", [ @@ -36277,12 +37142,12 @@ pub mod api { #[doc = " `confirmed` set to true, as the number of `HrmpAcceptedChannelRequestCount` for `X`."] pub fn hrmp_accepted_channel_request_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (hrmp_accepted_channel_request_count::Param0,), - hrmp_accepted_channel_request_count::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (hrmp_accepted_channel_request_count::input::Param0,), + hrmp_accepted_channel_request_count::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpAcceptedChannelRequestCount", [ @@ -36302,12 +37167,12 @@ pub mod api { #[doc = " - There are no channels that exists in list but not in the set and vice versa."] pub fn hrmp_close_channel_requests( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (hrmp_close_channel_requests::Param0,), - hrmp_close_channel_requests::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (hrmp_close_channel_requests::input::Param0,), + hrmp_close_channel_requests::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpCloseChannelRequests", [ @@ -36319,12 +37184,12 @@ pub mod api { } pub fn hrmp_close_channel_requests_list( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - hrmp_close_channel_requests_list::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + hrmp_close_channel_requests_list::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpCloseChannelRequestsList", [ @@ -36341,12 +37206,12 @@ pub mod api { #[doc = " session."] pub fn hrmp_watermarks( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (hrmp_watermarks::Param0,), - hrmp_watermarks::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (hrmp_watermarks::input::Param0,), + hrmp_watermarks::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpWatermarks", [ @@ -36361,12 +37226,12 @@ pub mod api { #[doc = " - each participant in the channel should satisfy `Paras::is_valid_para(P)` within a session."] pub fn hrmp_channels( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (hrmp_channels::Param0,), - hrmp_channels::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (hrmp_channels::input::Param0,), + hrmp_channels::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpChannels", [ @@ -36391,12 +37256,12 @@ pub mod api { #[doc = " - the vectors are sorted."] pub fn hrmp_ingress_channels_index( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (hrmp_ingress_channels_index::Param0,), - hrmp_ingress_channels_index::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (hrmp_ingress_channels_index::input::Param0,), + hrmp_ingress_channels_index::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpIngressChannelsIndex", [ @@ -36409,12 +37274,12 @@ pub mod api { } pub fn hrmp_egress_channels_index( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (hrmp_egress_channels_index::Param0,), - hrmp_egress_channels_index::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (hrmp_egress_channels_index::input::Param0,), + hrmp_egress_channels_index::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpEgressChannelsIndex", [ @@ -36429,12 +37294,12 @@ pub mod api { #[doc = " Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`."] pub fn hrmp_channel_contents( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (hrmp_channel_contents::Param0,), - hrmp_channel_contents::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (hrmp_channel_contents::input::Param0,), + hrmp_channel_contents::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpChannelContents", [ @@ -36452,12 +37317,12 @@ pub mod api { #[doc = " same block number."] pub fn hrmp_channel_digests( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (hrmp_channel_digests::Param0,), - hrmp_channel_digests::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (hrmp_channel_digests::input::Param0,), + hrmp_channel_digests::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Hrmp", "HrmpChannelDigests", [ @@ -36471,130 +37336,130 @@ pub mod api { pub mod hrmp_open_channel_requests { use super::root_mod; use super::runtime_types; - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest; + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; } + pub type Output = + runtime_types::polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest; } pub mod hrmp_open_channel_requests_list { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId, - >; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId, + >; } pub mod hrmp_open_channel_request_count { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::core::primitive::u32; } pub mod hrmp_accepted_channel_request_count { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::core::primitive::u32; } pub mod hrmp_close_channel_requests { use super::root_mod; use super::runtime_types; - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (); + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; } + pub type Output = (); } pub mod hrmp_close_channel_requests_list { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId, - >; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId, + >; } pub mod hrmp_watermarks { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::core::primitive::u32; } pub mod hrmp_channels { use super::root_mod; use super::runtime_types; - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel; + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; } + pub type Output = runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel; } pub mod hrmp_ingress_channels_index { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; } pub mod hrmp_egress_channels_index { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; } pub mod hrmp_channel_contents { use super::root_mod; use super::runtime_types; - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_core_primitives::InboundHrmpMessage< - ::core::primitive::u32, - >, - >; + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_core_primitives::InboundHrmpMessage< + ::core::primitive::u32, + >, + >; } pub mod hrmp_channel_digests { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u32, - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >, - )>; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::subxt::alloc::vec::Vec<( + ::core::primitive::u32, + ::subxt::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >, + )>; } } } @@ -36611,12 +37476,12 @@ pub mod api { #[doc = " When in doubt, use `Sessions` API instead."] pub fn assignment_keys_unsafe( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - assignment_keys_unsafe::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + assignment_keys_unsafe::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParaSessionInfo", "AssignmentKeysUnsafe", [ @@ -36630,12 +37495,12 @@ pub mod api { #[doc = " The earliest session for which previous session info is stored."] pub fn earliest_stored_session( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - earliest_stored_session::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + earliest_stored_session::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParaSessionInfo", "EarliestStoredSession", [ @@ -36651,12 +37516,12 @@ pub mod api { #[doc = " Does not have any entries before the session index in the first session change notification."] pub fn sessions( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (sessions::Param0,), - sessions::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (sessions::input::Param0,), + sessions::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParaSessionInfo", "Sessions", [ @@ -36670,12 +37535,12 @@ pub mod api { #[doc = " The validator account keys of the validators actively participating in parachain consensus."] pub fn account_keys( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (account_keys::Param0,), - account_keys::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (account_keys::input::Param0,), + account_keys::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParaSessionInfo", "AccountKeys", [ @@ -36689,12 +37554,12 @@ pub mod api { #[doc = " Executor parameter set for a given session index"] pub fn session_executor_params( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (session_executor_params::Param0,), - session_executor_params::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (session_executor_params::input::Param0,), + session_executor_params::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParaSessionInfo", "SessionExecutorParams", [ @@ -36709,50 +37574,48 @@ pub mod api { pub mod assignment_keys_unsafe { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::assignment_app::Public, - >; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::assignment_app::Public, + >; } pub mod earliest_stored_session { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod sessions { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::polkadot_primitives::v9::SessionInfo; + pub type Param0 = ::core::primitive::u32; } + pub type Output = runtime_types::polkadot_primitives::v9::SessionInfo; } pub mod account_keys { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; } pub mod session_executor_params { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_primitives::v9::executor_params::ExecutorParams; + pub type Param0 = ::core::primitive::u32; } + pub type Output = + runtime_types::polkadot_primitives::v9::executor_params::ExecutorParams; } } } @@ -36766,42 +37629,42 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ForceUnfreeze; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceUnfreeze { - const PALLET: &'static str = "ParasDisputes"; - const CALL: &'static str = "force_unfreeze"; - } - } - pub struct TransactionApi; - impl TransactionApi { - pub fn force_unfreeze( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ParasDisputes", - "force_unfreeze", - types::ForceUnfreeze {}, - [ - 148u8, 19u8, 139u8, 154u8, 111u8, 166u8, 74u8, 136u8, 127u8, 157u8, - 20u8, 47u8, 220u8, 108u8, 152u8, 108u8, 24u8, 232u8, 11u8, 53u8, 26u8, - 4u8, 23u8, 58u8, 195u8, 61u8, 159u8, 6u8, 139u8, 7u8, 197u8, 88u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct ForceUnfreeze; + impl ForceUnfreeze { + const PALLET_NAME: &'static str = "ParasDisputes"; + const CALL_NAME: &'static str = "force_unfreeze"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceUnfreeze { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + pub fn force_unfreeze( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ParasDisputes", + "force_unfreeze", + super::ForceUnfreeze {}, + [ + 148u8, 19u8, 139u8, 154u8, 111u8, 166u8, 74u8, 136u8, 127u8, 157u8, + 20u8, 47u8, 220u8, 108u8, 152u8, 108u8, 24u8, 232u8, 11u8, 53u8, + 26u8, 4u8, 23u8, 58u8, 195u8, 61u8, 159u8, 6u8, 139u8, 7u8, 197u8, + 88u8, + ], + ) + } } } } @@ -36810,12 +37673,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A dispute has been initiated. \\[candidate hash, dispute location\\]"] pub struct DisputeInitiated( pub dispute_initiated::Field0, @@ -36827,17 +37690,22 @@ pub mod api { pub type Field1 = runtime_types::polkadot_runtime_parachains::disputes::DisputeLocation; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DisputeInitiated { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "DisputeInitiated"; + impl DisputeInitiated { + const PALLET_NAME: &'static str = "ParasDisputes"; + const EVENT_NAME: &'static str = "DisputeInitiated"; + } + impl ::subxt::events::DecodeAsEvent for DisputeInitiated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A dispute has concluded for or against a candidate."] #[doc = "`\\[para id, candidate hash, dispute result\\]`"] pub struct DisputeConcluded( @@ -36850,17 +37718,22 @@ pub mod api { pub type Field1 = runtime_types::polkadot_runtime_parachains::disputes::DisputeResult; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DisputeConcluded { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "DisputeConcluded"; + impl DisputeConcluded { + const PALLET_NAME: &'static str = "ParasDisputes"; + const EVENT_NAME: &'static str = "DisputeConcluded"; + } + impl ::subxt::events::DecodeAsEvent for DisputeConcluded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A dispute has concluded with supermajority against a candidate."] #[doc = "Block authors should no longer build on top of this head and should"] #[doc = "instead revert the block at the given height. This should be the"] @@ -36870,9 +37743,14 @@ pub mod api { use super::runtime_types; pub type Field0 = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Revert { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "Revert"; + impl Revert { + const PALLET_NAME: &'static str = "ParasDisputes"; + const EVENT_NAME: &'static str = "Revert"; + } + impl ::subxt::events::DecodeAsEvent for Revert { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -36884,12 +37762,12 @@ pub mod api { #[doc = " references sessions."] pub fn last_pruned_session( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - last_pruned_session::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + last_pruned_session::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParasDisputes", "LastPrunedSession", [ @@ -36902,12 +37780,12 @@ pub mod api { #[doc = " All ongoing or concluded disputes for the last several sessions."] pub fn disputes( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (disputes::Param0, disputes::Param1), - disputes::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (disputes::input::Param0, disputes::input::Param1), + disputes::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParasDisputes", "Disputes", [ @@ -36922,12 +37800,15 @@ pub mod api { #[doc = " This storage is used for slashing."] pub fn backers_on_disputes( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (backers_on_disputes::Param0, backers_on_disputes::Param1), - backers_on_disputes::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + ( + backers_on_disputes::input::Param0, + backers_on_disputes::input::Param1, + ), + backers_on_disputes::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParasDisputes", "BackersOnDisputes", [ @@ -36942,12 +37823,12 @@ pub mod api { #[doc = " should be reverted back to if the candidate is disputed and determined to be invalid."] pub fn included( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (included::Param0, included::Param1), - included::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (included::input::Param0, included::input::Param1), + included::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParasDisputes", "Included", [ @@ -36964,12 +37845,9 @@ pub mod api { #[doc = " It can only be set back to `None` by governance intervention."] pub fn frozen( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - frozen::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), frozen::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "ParasDisputes", "Frozen", [ @@ -36984,52 +37862,51 @@ pub mod api { pub mod last_pruned_session { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod disputes { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::polkadot_primitives::v9::DisputeState< - ::core::primitive::u32, - >; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; } + pub type Output = + runtime_types::polkadot_primitives::v9::DisputeState<::core::primitive::u32>; } pub mod backers_on_disputes { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::ValidatorIndex, - >; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::ValidatorIndex, + >; } pub mod included { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; } + pub type Output = ::core::primitive::u32; } pub mod frozen { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::option::Option<::core::primitive::u32>; } + pub type Output = ::core::option::Option<::core::primitive::u32>; } } } @@ -37045,61 +37922,57 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ReportDisputeLostUnsigned { - pub dispute_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_dispute_lost_unsigned::DisputeProof, - >, - pub key_owner_proof: report_dispute_lost_unsigned::KeyOwnerProof, - } - pub mod report_dispute_lost_unsigned { - use super::runtime_types; - pub type DisputeProof = - runtime_types::polkadot_primitives::v9::slashing::DisputeProof; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportDisputeLostUnsigned { - const PALLET: &'static str = "ParasSlashing"; - const CALL: &'static str = "report_dispute_lost_unsigned"; - } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct ReportDisputeLostUnsigned { + pub dispute_proof: + ::subxt::alloc::boxed::Box, + pub key_owner_proof: report_dispute_lost_unsigned::KeyOwnerProof, } - pub struct TransactionApi; - impl TransactionApi { - pub fn report_dispute_lost_unsigned( - &self, - dispute_proof: types::report_dispute_lost_unsigned::DisputeProof, - key_owner_proof: types::report_dispute_lost_unsigned::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ReportDisputeLostUnsigned, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ParasSlashing", - "report_dispute_lost_unsigned", - types::ReportDisputeLostUnsigned { - dispute_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - dispute_proof, - ), - key_owner_proof, - }, - [ - 56u8, 151u8, 214u8, 24u8, 108u8, 55u8, 217u8, 144u8, 199u8, 113u8, - 42u8, 100u8, 246u8, 216u8, 82u8, 85u8, 242u8, 84u8, 191u8, 22u8, 246u8, - 30u8, 54u8, 184u8, 90u8, 172u8, 233u8, 243u8, 87u8, 243u8, 219u8, 71u8, - ], - ) + pub mod report_dispute_lost_unsigned { + use super::runtime_types; + pub type DisputeProof = + runtime_types::polkadot_primitives::v9::slashing::DisputeProof; + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + impl ReportDisputeLostUnsigned { + const PALLET_NAME: &'static str = "ParasSlashing"; + const CALL_NAME: &'static str = "report_dispute_lost_unsigned"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportDisputeLostUnsigned { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + pub fn report_dispute_lost_unsigned( + &self, + dispute_proof: super::report_dispute_lost_unsigned::DisputeProof, + key_owner_proof: super::report_dispute_lost_unsigned::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ParasSlashing", + "report_dispute_lost_unsigned", + super::ReportDisputeLostUnsigned { + dispute_proof: ::subxt::alloc::boxed::Box::new(dispute_proof), + key_owner_proof, + }, + [ + 56u8, 151u8, 214u8, 24u8, 108u8, 55u8, 217u8, 144u8, 199u8, 113u8, + 42u8, 100u8, 246u8, 216u8, 82u8, 85u8, 242u8, 84u8, 191u8, 22u8, + 246u8, 30u8, 54u8, 184u8, 90u8, 172u8, 233u8, 243u8, 87u8, 243u8, + 219u8, 71u8, + ], + ) + } } } } @@ -37111,12 +37984,15 @@ pub mod api { #[doc = " Validators pending dispute slashes."] pub fn unapplied_slashes( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (unapplied_slashes::Param0, unapplied_slashes::Param1), - unapplied_slashes::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + ( + unapplied_slashes::input::Param0, + unapplied_slashes::input::Param1, + ), + unapplied_slashes::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParasSlashing", "UnappliedSlashes", [ @@ -37129,12 +38005,12 @@ pub mod api { #[doc = " `ValidatorSetCount` per session."] pub fn validator_set_counts( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (validator_set_counts::Param0,), - validator_set_counts::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (validator_set_counts::input::Param0,), + validator_set_counts::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ParasSlashing", "ValidatorSetCounts", [ @@ -37148,22 +38024,21 @@ pub mod api { pub mod unapplied_slashes { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_primitives::v9::slashing::PendingSlashes; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; } + pub type Output = runtime_types::polkadot_primitives::v9::slashing::PendingSlashes; } pub mod validator_set_counts { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } } } @@ -37177,136 +38052,138 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove a page which has no more messages remaining to be processed or is stale."] + pub struct ReapPage { + pub message_origin: reap_page::MessageOrigin, + pub page_index: reap_page::PageIndex, + } + pub mod reap_page { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove a page which has no more messages remaining to be processed or is stale."] - pub struct ReapPage { - pub message_origin: reap_page::MessageOrigin, - pub page_index: reap_page::PageIndex, - } - pub mod reap_page { - use super::runtime_types; - pub type MessageOrigin = runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin ; - pub type PageIndex = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReapPage { - const PALLET: &'static str = "MessageQueue"; - const CALL: &'static str = "reap_page"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Execute an overweight message."] - #[doc = ""] - #[doc = "Temporary processing errors will be propagated whereas permanent errors are treated"] - #[doc = "as success condition."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed`."] - #[doc = "- `message_origin`: The origin from which the message to be executed arrived."] - #[doc = "- `page`: The page in the queue in which the message to be executed is sitting."] - #[doc = "- `index`: The index into the queue of the message to be executed."] - #[doc = "- `weight_limit`: The maximum amount of weight allowed to be consumed in the execution"] - #[doc = " of the message."] - #[doc = ""] - #[doc = "Benchmark complexity considerations: O(index + weight_limit)."] - pub struct ExecuteOverweight { - pub message_origin: execute_overweight::MessageOrigin, - pub page: execute_overweight::Page, - pub index: execute_overweight::Index, - pub weight_limit: execute_overweight::WeightLimit, - } - pub mod execute_overweight { - use super::runtime_types; - pub type MessageOrigin = runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin ; - pub type Page = ::core::primitive::u32; - pub type Index = ::core::primitive::u32; - pub type WeightLimit = runtime_types::sp_weights::weight_v2::Weight; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExecuteOverweight { - const PALLET: &'static str = "MessageQueue"; - const CALL: &'static str = "execute_overweight"; - } + pub type MessageOrigin = + runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin; + pub type PageIndex = ::core::primitive::u32; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Remove a page which has no more messages remaining to be processed or is stale."] - pub fn reap_page( - &self, - message_origin: types::reap_page::MessageOrigin, - page_index: types::reap_page::PageIndex, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MessageQueue", - "reap_page", - types::ReapPage { - message_origin, - page_index, - }, - [ - 217u8, 3u8, 106u8, 158u8, 151u8, 194u8, 234u8, 4u8, 254u8, 4u8, 200u8, - 201u8, 107u8, 140u8, 220u8, 201u8, 245u8, 14u8, 23u8, 156u8, 41u8, - 106u8, 39u8, 90u8, 214u8, 1u8, 183u8, 45u8, 3u8, 83u8, 242u8, 30u8, - ], - ) + impl ReapPage { + const PALLET_NAME: &'static str = "MessageQueue"; + const CALL_NAME: &'static str = "reap_page"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReapPage { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Execute an overweight message."] - #[doc = ""] - #[doc = "Temporary processing errors will be propagated whereas permanent errors are treated"] - #[doc = "as success condition."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed`."] - #[doc = "- `message_origin`: The origin from which the message to be executed arrived."] - #[doc = "- `page`: The page in the queue in which the message to be executed is sitting."] - #[doc = "- `index`: The index into the queue of the message to be executed."] - #[doc = "- `weight_limit`: The maximum amount of weight allowed to be consumed in the execution"] - #[doc = " of the message."] - #[doc = ""] - #[doc = "Benchmark complexity considerations: O(index + weight_limit)."] - pub fn execute_overweight( - &self, - message_origin: types::execute_overweight::MessageOrigin, - page: types::execute_overweight::Page, - index: types::execute_overweight::Index, - weight_limit: types::execute_overweight::WeightLimit, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MessageQueue", - "execute_overweight", - types::ExecuteOverweight { - message_origin, - page, - index, - weight_limit, - }, - [ - 101u8, 2u8, 86u8, 225u8, 217u8, 229u8, 143u8, 214u8, 146u8, 190u8, - 182u8, 102u8, 251u8, 18u8, 179u8, 187u8, 113u8, 29u8, 182u8, 24u8, - 34u8, 179u8, 64u8, 249u8, 139u8, 76u8, 50u8, 238u8, 132u8, 167u8, - 115u8, 141u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Execute an overweight message."] + #[doc = ""] + #[doc = "Temporary processing errors will be propagated whereas permanent errors are treated"] + #[doc = "as success condition."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `message_origin`: The origin from which the message to be executed arrived."] + #[doc = "- `page`: The page in the queue in which the message to be executed is sitting."] + #[doc = "- `index`: The index into the queue of the message to be executed."] + #[doc = "- `weight_limit`: The maximum amount of weight allowed to be consumed in the execution"] + #[doc = " of the message."] + #[doc = ""] + #[doc = "Benchmark complexity considerations: O(index + weight_limit)."] + pub struct ExecuteOverweight { + pub message_origin: execute_overweight::MessageOrigin, + pub page: execute_overweight::Page, + pub index: execute_overweight::Index, + pub weight_limit: execute_overweight::WeightLimit, + } + pub mod execute_overweight { + use super::runtime_types; + pub type MessageOrigin = + runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin; + pub type Page = ::core::primitive::u32; + pub type Index = ::core::primitive::u32; + pub type WeightLimit = runtime_types::sp_weights::weight_v2::Weight; + } + impl ExecuteOverweight { + const PALLET_NAME: &'static str = "MessageQueue"; + const CALL_NAME: &'static str = "execute_overweight"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ExecuteOverweight { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Remove a page which has no more messages remaining to be processed or is stale."] + pub fn reap_page( + &self, + message_origin: super::reap_page::MessageOrigin, + page_index: super::reap_page::PageIndex, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "MessageQueue", + "reap_page", + super::ReapPage { + message_origin, + page_index, + }, + [ + 217u8, 3u8, 106u8, 158u8, 151u8, 194u8, 234u8, 4u8, 254u8, 4u8, + 200u8, 201u8, 107u8, 140u8, 220u8, 201u8, 245u8, 14u8, 23u8, 156u8, + 41u8, 106u8, 39u8, 90u8, 214u8, 1u8, 183u8, 45u8, 3u8, 83u8, 242u8, + 30u8, + ], + ) + } + #[doc = "Execute an overweight message."] + #[doc = ""] + #[doc = "Temporary processing errors will be propagated whereas permanent errors are treated"] + #[doc = "as success condition."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `message_origin`: The origin from which the message to be executed arrived."] + #[doc = "- `page`: The page in the queue in which the message to be executed is sitting."] + #[doc = "- `index`: The index into the queue of the message to be executed."] + #[doc = "- `weight_limit`: The maximum amount of weight allowed to be consumed in the execution"] + #[doc = " of the message."] + #[doc = ""] + #[doc = "Benchmark complexity considerations: O(index + weight_limit)."] + pub fn execute_overweight( + &self, + message_origin: super::execute_overweight::MessageOrigin, + page: super::execute_overweight::Page, + index: super::execute_overweight::Index, + weight_limit: super::execute_overweight::WeightLimit, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "MessageQueue", + "execute_overweight", + super::ExecuteOverweight { + message_origin, + page, + index, + weight_limit, + }, + [ + 101u8, 2u8, 86u8, 225u8, 217u8, 229u8, 143u8, 214u8, 146u8, 190u8, + 182u8, 102u8, 251u8, 18u8, 179u8, 187u8, 113u8, 29u8, 182u8, 24u8, + 34u8, 179u8, 64u8, 249u8, 139u8, 76u8, 50u8, 238u8, 132u8, 167u8, + 115u8, 141u8, + ], + ) + } } } } @@ -37315,12 +38192,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Message discarded due to an error in the `MessageProcessor` (usually a format error)."] pub struct ProcessingFailed { pub id: processing_failed::Id, @@ -37329,23 +38206,28 @@ pub mod api { } pub mod processing_failed { use super::runtime_types; - pub type Id = ::subxt::ext::subxt_core::utils::H256; + pub type Id = ::subxt::utils::H256; pub type Origin = runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin; pub type Error = runtime_types::frame_support::traits::messages::ProcessMessageError; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ProcessingFailed { - const PALLET: &'static str = "MessageQueue"; - const EVENT: &'static str = "ProcessingFailed"; + impl ProcessingFailed { + const PALLET_NAME: &'static str = "MessageQueue"; + const EVENT_NAME: &'static str = "ProcessingFailed"; + } + impl ::subxt::events::DecodeAsEvent for ProcessingFailed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Message is processed."] pub struct Processed { pub id: processed::Id, @@ -37355,23 +38237,28 @@ pub mod api { } pub mod processed { use super::runtime_types; - pub type Id = ::subxt::ext::subxt_core::utils::H256; + pub type Id = ::subxt::utils::H256; pub type Origin = runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin; pub type WeightUsed = runtime_types::sp_weights::weight_v2::Weight; pub type Success = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Processed { - const PALLET: &'static str = "MessageQueue"; - const EVENT: &'static str = "Processed"; + impl Processed { + const PALLET_NAME: &'static str = "MessageQueue"; + const EVENT_NAME: &'static str = "Processed"; + } + impl ::subxt::events::DecodeAsEvent for Processed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Message placed in overweight queue."] pub struct OverweightEnqueued { pub id: overweight_enqueued::Id, @@ -37387,17 +38274,22 @@ pub mod api { pub type PageIndex = ::core::primitive::u32; pub type MessageIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for OverweightEnqueued { - const PALLET: &'static str = "MessageQueue"; - const EVENT: &'static str = "OverweightEnqueued"; + impl OverweightEnqueued { + const PALLET_NAME: &'static str = "MessageQueue"; + const EVENT_NAME: &'static str = "OverweightEnqueued"; + } + impl ::subxt::events::DecodeAsEvent for OverweightEnqueued { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "This page was reaped."] pub struct PageReaped { pub origin: page_reaped::Origin, @@ -37409,9 +38301,14 @@ pub mod api { runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PageReaped { - const PALLET: &'static str = "MessageQueue"; - const EVENT: &'static str = "PageReaped"; + impl PageReaped { + const PALLET_NAME: &'static str = "MessageQueue"; + const EVENT_NAME: &'static str = "PageReaped"; + } + impl ::subxt::events::DecodeAsEvent for PageReaped { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -37422,12 +38319,12 @@ pub mod api { #[doc = " The index of the first and last (non-empty) pages."] pub fn book_state_for( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (book_state_for::Param0,), - book_state_for::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (book_state_for::input::Param0,), + book_state_for::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "MessageQueue", "BookStateFor", [ @@ -37440,12 +38337,9 @@ pub mod api { #[doc = " The origin at which we should begin servicing."] pub fn service_head( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - service_head::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), service_head::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "MessageQueue", "ServiceHead", [ @@ -37458,12 +38352,12 @@ pub mod api { #[doc = " The map of page indices to pages."] pub fn pages( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (pages::Param0, pages::Param1), - pages::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (pages::input::Param0, pages::input::Param1), + pages::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "MessageQueue", "Pages", [ @@ -37478,32 +38372,32 @@ pub mod api { pub mod book_state_for { use super::root_mod; use super::runtime_types; - pub type Param0 = - runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: pallet_message_queue :: BookState < runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin > ; + pub type Param0 = runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin ; } + pub type Output = runtime_types::pallet_message_queue::BookState< + runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin, + >; } pub mod service_head { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin ; } + pub type Output = + runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin; } pub mod pages { use super::root_mod; use super::runtime_types; - pub type Param0 = - runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin; - pub type Param1 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::pallet_message_queue::Page<::core::primitive::u32>; + pub type Param0 = runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin ; + pub type Param1 = ::core::primitive::u32; } + pub type Output = runtime_types::pallet_message_queue::Page<::core::primitive::u32>; } } pub mod constants { @@ -37517,10 +38411,8 @@ pub mod api { #[doc = " size is slightly lower than this as defined by [`MaxMessageLenOf`]."] pub fn heap_size( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "MessageQueue", "HeapSize", [ @@ -37536,10 +38428,8 @@ pub mod api { #[doc = " dropped, even if they contain unprocessed overweight messages."] pub fn max_stale( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "MessageQueue", "MaxStale", [ @@ -37558,10 +38448,10 @@ pub mod api { #[doc = " it run in `on_idle`."] pub fn service_weight( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< ::core::option::Option, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "MessageQueue", "ServiceWeight", [ @@ -37578,10 +38468,10 @@ pub mod api { #[doc = " If `None`, it will not call `ServiceQueues::service_queues` in `on_idle`."] pub fn idle_max_service_weight( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< ::core::option::Option, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "MessageQueue", "IdleMaxServiceWeight", [ @@ -37604,240 +38494,241 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Create a single on demand core order."] + #[doc = "Will use the spot price for the current block and will reap the account if needed."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: The sender of the call, funds will be withdrawn from this account."] + #[doc = "- `max_amount`: The maximum balance to withdraw from the origin to place an order."] + #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] + #[doc = ""] + #[doc = "Errors:"] + #[doc = "- `InsufficientBalance`: from the Currency implementation"] + #[doc = "- `QueueFull`"] + #[doc = "- `SpotPriceHigherThanMaxAmount`"] + #[doc = ""] + #[doc = "Events:"] + #[doc = "- `OnDemandOrderPlaced`"] + pub struct PlaceOrderAllowDeath { + pub max_amount: place_order_allow_death::MaxAmount, + pub para_id: place_order_allow_death::ParaId, + } + pub mod place_order_allow_death { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create a single on demand core order."] - #[doc = "Will use the spot price for the current block and will reap the account if needed."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: The sender of the call, funds will be withdrawn from this account."] - #[doc = "- `max_amount`: The maximum balance to withdraw from the origin to place an order."] - #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] - #[doc = ""] - #[doc = "Errors:"] - #[doc = "- `InsufficientBalance`: from the Currency implementation"] - #[doc = "- `QueueFull`"] - #[doc = "- `SpotPriceHigherThanMaxAmount`"] - #[doc = ""] - #[doc = "Events:"] - #[doc = "- `OnDemandOrderPlaced`"] - pub struct PlaceOrderAllowDeath { - pub max_amount: place_order_allow_death::MaxAmount, - pub para_id: place_order_allow_death::ParaId, - } - pub mod place_order_allow_death { - use super::runtime_types; - pub type MaxAmount = ::core::primitive::u128; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceOrderAllowDeath { - const PALLET: &'static str = "OnDemandAssignmentProvider"; - const CALL: &'static str = "place_order_allow_death"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Same as the [`place_order_allow_death`](Self::place_order_allow_death) call , but with a"] - #[doc = "check that placing the order will not reap the account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: The sender of the call, funds will be withdrawn from this account."] - #[doc = "- `max_amount`: The maximum balance to withdraw from the origin to place an order."] - #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] - #[doc = ""] - #[doc = "Errors:"] - #[doc = "- `InsufficientBalance`: from the Currency implementation"] - #[doc = "- `QueueFull`"] - #[doc = "- `SpotPriceHigherThanMaxAmount`"] - #[doc = ""] - #[doc = "Events:"] - #[doc = "- `OnDemandOrderPlaced`"] - pub struct PlaceOrderKeepAlive { - pub max_amount: place_order_keep_alive::MaxAmount, - pub para_id: place_order_keep_alive::ParaId, - } - pub mod place_order_keep_alive { - use super::runtime_types; - pub type MaxAmount = ::core::primitive::u128; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceOrderKeepAlive { - const PALLET: &'static str = "OnDemandAssignmentProvider"; - const CALL: &'static str = "place_order_keep_alive"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create a single on demand core order with credits."] - #[doc = "Will charge the owner's on-demand credit account the spot price for the current block."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: The sender of the call, on-demand credits will be withdrawn from this"] - #[doc = " account."] - #[doc = "- `max_amount`: The maximum number of credits to spend from the origin to place an"] - #[doc = " order."] - #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] - #[doc = ""] - #[doc = "Errors:"] - #[doc = "- `InsufficientCredits`"] - #[doc = "- `QueueFull`"] - #[doc = "- `SpotPriceHigherThanMaxAmount`"] - #[doc = ""] - #[doc = "Events:"] - #[doc = "- `OnDemandOrderPlaced`"] - pub struct PlaceOrderWithCredits { - pub max_amount: place_order_with_credits::MaxAmount, - pub para_id: place_order_with_credits::ParaId, - } - pub mod place_order_with_credits { - use super::runtime_types; - pub type MaxAmount = ::core::primitive::u128; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceOrderWithCredits { - const PALLET: &'static str = "OnDemandAssignmentProvider"; - const CALL: &'static str = "place_order_with_credits"; + pub type MaxAmount = ::core::primitive::u128; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl PlaceOrderAllowDeath { + const PALLET_NAME: &'static str = "OnDemandAssignmentProvider"; + const CALL_NAME: &'static str = "place_order_allow_death"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PlaceOrderAllowDeath { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Create a single on demand core order."] - #[doc = "Will use the spot price for the current block and will reap the account if needed."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: The sender of the call, funds will be withdrawn from this account."] - #[doc = "- `max_amount`: The maximum balance to withdraw from the origin to place an order."] - #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] - #[doc = ""] - #[doc = "Errors:"] - #[doc = "- `InsufficientBalance`: from the Currency implementation"] - #[doc = "- `QueueFull`"] - #[doc = "- `SpotPriceHigherThanMaxAmount`"] - #[doc = ""] - #[doc = "Events:"] - #[doc = "- `OnDemandOrderPlaced`"] - pub fn place_order_allow_death( - &self, - max_amount: types::place_order_allow_death::MaxAmount, - para_id: types::place_order_allow_death::ParaId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "OnDemandAssignmentProvider", - "place_order_allow_death", - types::PlaceOrderAllowDeath { - max_amount, - para_id, - }, - [ - 42u8, 115u8, 192u8, 118u8, 20u8, 174u8, 114u8, 94u8, 177u8, 195u8, - 175u8, 214u8, 175u8, 25u8, 167u8, 135u8, 194u8, 251u8, 186u8, 185u8, - 218u8, 153u8, 182u8, 166u8, 28u8, 238u8, 72u8, 64u8, 115u8, 67u8, 58u8, - 165u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Same as the [`place_order_allow_death`](Self::place_order_allow_death) call , but with a"] + #[doc = "check that placing the order will not reap the account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: The sender of the call, funds will be withdrawn from this account."] + #[doc = "- `max_amount`: The maximum balance to withdraw from the origin to place an order."] + #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] + #[doc = ""] + #[doc = "Errors:"] + #[doc = "- `InsufficientBalance`: from the Currency implementation"] + #[doc = "- `QueueFull`"] + #[doc = "- `SpotPriceHigherThanMaxAmount`"] + #[doc = ""] + #[doc = "Events:"] + #[doc = "- `OnDemandOrderPlaced`"] + pub struct PlaceOrderKeepAlive { + pub max_amount: place_order_keep_alive::MaxAmount, + pub para_id: place_order_keep_alive::ParaId, + } + pub mod place_order_keep_alive { + use super::runtime_types; + pub type MaxAmount = ::core::primitive::u128; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl PlaceOrderKeepAlive { + const PALLET_NAME: &'static str = "OnDemandAssignmentProvider"; + const CALL_NAME: &'static str = "place_order_keep_alive"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PlaceOrderKeepAlive { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Same as the [`place_order_allow_death`](Self::place_order_allow_death) call , but with a"] - #[doc = "check that placing the order will not reap the account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: The sender of the call, funds will be withdrawn from this account."] - #[doc = "- `max_amount`: The maximum balance to withdraw from the origin to place an order."] - #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] - #[doc = ""] - #[doc = "Errors:"] - #[doc = "- `InsufficientBalance`: from the Currency implementation"] - #[doc = "- `QueueFull`"] - #[doc = "- `SpotPriceHigherThanMaxAmount`"] - #[doc = ""] - #[doc = "Events:"] - #[doc = "- `OnDemandOrderPlaced`"] - pub fn place_order_keep_alive( - &self, - max_amount: types::place_order_keep_alive::MaxAmount, - para_id: types::place_order_keep_alive::ParaId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "OnDemandAssignmentProvider", - "place_order_keep_alive", - types::PlaceOrderKeepAlive { - max_amount, - para_id, - }, - [ - 112u8, 56u8, 202u8, 218u8, 85u8, 138u8, 45u8, 213u8, 119u8, 36u8, 62u8, - 138u8, 217u8, 95u8, 25u8, 86u8, 119u8, 192u8, 57u8, 245u8, 34u8, 225u8, - 247u8, 116u8, 114u8, 230u8, 130u8, 180u8, 163u8, 190u8, 106u8, 5u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Create a single on demand core order with credits."] + #[doc = "Will charge the owner's on-demand credit account the spot price for the current block."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: The sender of the call, on-demand credits will be withdrawn from this"] + #[doc = " account."] + #[doc = "- `max_amount`: The maximum number of credits to spend from the origin to place an"] + #[doc = " order."] + #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] + #[doc = ""] + #[doc = "Errors:"] + #[doc = "- `InsufficientCredits`"] + #[doc = "- `QueueFull`"] + #[doc = "- `SpotPriceHigherThanMaxAmount`"] + #[doc = ""] + #[doc = "Events:"] + #[doc = "- `OnDemandOrderPlaced`"] + pub struct PlaceOrderWithCredits { + pub max_amount: place_order_with_credits::MaxAmount, + pub para_id: place_order_with_credits::ParaId, + } + pub mod place_order_with_credits { + use super::runtime_types; + pub type MaxAmount = ::core::primitive::u128; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl PlaceOrderWithCredits { + const PALLET_NAME: &'static str = "OnDemandAssignmentProvider"; + const CALL_NAME: &'static str = "place_order_with_credits"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PlaceOrderWithCredits { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Create a single on demand core order with credits."] - #[doc = "Will charge the owner's on-demand credit account the spot price for the current block."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: The sender of the call, on-demand credits will be withdrawn from this"] - #[doc = " account."] - #[doc = "- `max_amount`: The maximum number of credits to spend from the origin to place an"] - #[doc = " order."] - #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] - #[doc = ""] - #[doc = "Errors:"] - #[doc = "- `InsufficientCredits`"] - #[doc = "- `QueueFull`"] - #[doc = "- `SpotPriceHigherThanMaxAmount`"] - #[doc = ""] - #[doc = "Events:"] - #[doc = "- `OnDemandOrderPlaced`"] - pub fn place_order_with_credits( - &self, - max_amount: types::place_order_with_credits::MaxAmount, - para_id: types::place_order_with_credits::ParaId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::PlaceOrderWithCredits, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "OnDemandAssignmentProvider", - "place_order_with_credits", - types::PlaceOrderWithCredits { - max_amount, - para_id, - }, - [ - 147u8, 242u8, 40u8, 204u8, 93u8, 215u8, 107u8, 99u8, 143u8, 35u8, - 227u8, 5u8, 137u8, 4u8, 66u8, 71u8, 143u8, 170u8, 120u8, 147u8, 65u8, - 224u8, 149u8, 254u8, 243u8, 23u8, 87u8, 102u8, 218u8, 167u8, 203u8, - 237u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Create a single on demand core order."] + #[doc = "Will use the spot price for the current block and will reap the account if needed."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: The sender of the call, funds will be withdrawn from this account."] + #[doc = "- `max_amount`: The maximum balance to withdraw from the origin to place an order."] + #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] + #[doc = ""] + #[doc = "Errors:"] + #[doc = "- `InsufficientBalance`: from the Currency implementation"] + #[doc = "- `QueueFull`"] + #[doc = "- `SpotPriceHigherThanMaxAmount`"] + #[doc = ""] + #[doc = "Events:"] + #[doc = "- `OnDemandOrderPlaced`"] + pub fn place_order_allow_death( + &self, + max_amount: super::place_order_allow_death::MaxAmount, + para_id: super::place_order_allow_death::ParaId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "OnDemandAssignmentProvider", + "place_order_allow_death", + super::PlaceOrderAllowDeath { + max_amount, + para_id, + }, + [ + 42u8, 115u8, 192u8, 118u8, 20u8, 174u8, 114u8, 94u8, 177u8, 195u8, + 175u8, 214u8, 175u8, 25u8, 167u8, 135u8, 194u8, 251u8, 186u8, + 185u8, 218u8, 153u8, 182u8, 166u8, 28u8, 238u8, 72u8, 64u8, 115u8, + 67u8, 58u8, 165u8, + ], + ) + } + #[doc = "Same as the [`place_order_allow_death`](Self::place_order_allow_death) call , but with a"] + #[doc = "check that placing the order will not reap the account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: The sender of the call, funds will be withdrawn from this account."] + #[doc = "- `max_amount`: The maximum balance to withdraw from the origin to place an order."] + #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] + #[doc = ""] + #[doc = "Errors:"] + #[doc = "- `InsufficientBalance`: from the Currency implementation"] + #[doc = "- `QueueFull`"] + #[doc = "- `SpotPriceHigherThanMaxAmount`"] + #[doc = ""] + #[doc = "Events:"] + #[doc = "- `OnDemandOrderPlaced`"] + pub fn place_order_keep_alive( + &self, + max_amount: super::place_order_keep_alive::MaxAmount, + para_id: super::place_order_keep_alive::ParaId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "OnDemandAssignmentProvider", + "place_order_keep_alive", + super::PlaceOrderKeepAlive { + max_amount, + para_id, + }, + [ + 112u8, 56u8, 202u8, 218u8, 85u8, 138u8, 45u8, 213u8, 119u8, 36u8, + 62u8, 138u8, 217u8, 95u8, 25u8, 86u8, 119u8, 192u8, 57u8, 245u8, + 34u8, 225u8, 247u8, 116u8, 114u8, 230u8, 130u8, 180u8, 163u8, + 190u8, 106u8, 5u8, + ], + ) + } + #[doc = "Create a single on demand core order with credits."] + #[doc = "Will charge the owner's on-demand credit account the spot price for the current block."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: The sender of the call, on-demand credits will be withdrawn from this"] + #[doc = " account."] + #[doc = "- `max_amount`: The maximum number of credits to spend from the origin to place an"] + #[doc = " order."] + #[doc = "- `para_id`: A `ParaId` the origin wants to provide blockspace for."] + #[doc = ""] + #[doc = "Errors:"] + #[doc = "- `InsufficientCredits`"] + #[doc = "- `QueueFull`"] + #[doc = "- `SpotPriceHigherThanMaxAmount`"] + #[doc = ""] + #[doc = "Events:"] + #[doc = "- `OnDemandOrderPlaced`"] + pub fn place_order_with_credits( + &self, + max_amount: super::place_order_with_credits::MaxAmount, + para_id: super::place_order_with_credits::ParaId, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "OnDemandAssignmentProvider", + "place_order_with_credits", + super::PlaceOrderWithCredits { + max_amount, + para_id, + }, + [ + 147u8, 242u8, 40u8, 204u8, 93u8, 215u8, 107u8, 99u8, 143u8, 35u8, + 227u8, 5u8, 137u8, 4u8, 66u8, 71u8, 143u8, 170u8, 120u8, 147u8, + 65u8, 224u8, 149u8, 254u8, 243u8, 23u8, 87u8, 102u8, 218u8, 167u8, + 203u8, 237u8, + ], + ) + } } } } @@ -37846,12 +38737,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An order was placed at some spot price amount by orderer ordered_by"] pub struct OnDemandOrderPlaced { pub para_id: on_demand_order_placed::ParaId, @@ -37862,19 +38753,24 @@ pub mod api { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; pub type SpotPrice = ::core::primitive::u128; - pub type OrderedBy = ::subxt::ext::subxt_core::utils::AccountId32; + pub type OrderedBy = ::subxt::utils::AccountId32; + } + impl OnDemandOrderPlaced { + const PALLET_NAME: &'static str = "OnDemandAssignmentProvider"; + const EVENT_NAME: &'static str = "OnDemandOrderPlaced"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for OnDemandOrderPlaced { - const PALLET: &'static str = "OnDemandAssignmentProvider"; - const EVENT: &'static str = "OnDemandOrderPlaced"; + impl ::subxt::events::DecodeAsEvent for OnDemandOrderPlaced { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The value of the spot price has likely changed"] pub struct SpotPriceSet { pub spot_price: spot_price_set::SpotPrice, @@ -37883,17 +38779,22 @@ pub mod api { use super::runtime_types; pub type SpotPrice = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SpotPriceSet { - const PALLET: &'static str = "OnDemandAssignmentProvider"; - const EVENT: &'static str = "SpotPriceSet"; + impl SpotPriceSet { + const PALLET_NAME: &'static str = "OnDemandAssignmentProvider"; + const EVENT_NAME: &'static str = "SpotPriceSet"; + } + impl ::subxt::events::DecodeAsEvent for SpotPriceSet { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An account was given credits."] pub struct AccountCredited { pub who: account_credited::Who, @@ -37901,12 +38802,17 @@ pub mod api { } pub mod account_credited { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AccountCredited { - const PALLET: &'static str = "OnDemandAssignmentProvider"; - const EVENT: &'static str = "AccountCredited"; + impl AccountCredited { + const PALLET_NAME: &'static str = "OnDemandAssignmentProvider"; + const EVENT_NAME: &'static str = "AccountCredited"; + } + impl ::subxt::events::DecodeAsEvent for AccountCredited { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -37919,12 +38825,12 @@ pub mod api { #[doc = " `ParaId` on two or more `CoreIndex`es."] pub fn para_id_affinity( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (para_id_affinity::Param0,), - para_id_affinity::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (para_id_affinity::input::Param0,), + para_id_affinity::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "OnDemandAssignmentProvider", "ParaIdAffinity", [ @@ -37937,13 +38843,10 @@ pub mod api { } #[doc = " Overall status of queue (both free + affinity entries)"] pub fn queue_status( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - queue_status::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + &self, + ) -> ::subxt::storage::StaticAddress<(), queue_status::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "OnDemandAssignmentProvider", "QueueStatus", [ @@ -37957,12 +38860,9 @@ pub mod api { #[doc = " Priority queue for all orders which don't yet (or not any more) have any core affinity."] pub fn free_entries( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - free_entries::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), free_entries::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "OnDemandAssignmentProvider", "FreeEntries", [ @@ -37975,12 +38875,12 @@ pub mod api { #[doc = " Queue entries that are currently bound to a particular core due to core affinity."] pub fn affinity_entries( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (affinity_entries::Param0,), - affinity_entries::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (affinity_entries::input::Param0,), + affinity_entries::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "OnDemandAssignmentProvider", "AffinityEntries", [ @@ -37993,12 +38893,9 @@ pub mod api { #[doc = " Keeps track of accumulated revenue from on demand order sales."] pub fn revenue( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - revenue::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), revenue::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "OnDemandAssignmentProvider", "Revenue", [ @@ -38011,12 +38908,12 @@ pub mod api { #[doc = " Keeps track of credits owned by each account."] pub fn credits( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (credits::Param0,), - credits::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (credits::input::Param0,), + credits::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "OnDemandAssignmentProvider", "Credits", [ @@ -38030,59 +38927,61 @@ pub mod api { pub mod para_id_affinity { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: CoreAffinityCount ; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = + runtime_types::polkadot_runtime_parachains::on_demand::types::CoreAffinityCount; } pub mod queue_status { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: QueueStatusType ; } + pub type Output = + runtime_types::polkadot_runtime_parachains::on_demand::types::QueueStatusType; } pub mod free_entries { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_runtime_parachains::on_demand::types::EnqueuedOrder, - >; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_runtime_parachains::on_demand::types::EnqueuedOrder, + >; } pub mod affinity_entries { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_primitives::v9::CoreIndex; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_runtime_parachains::on_demand::types::EnqueuedOrder, - >; + pub type Param0 = runtime_types::polkadot_primitives::v9::CoreIndex; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_runtime_parachains::on_demand::types::EnqueuedOrder, + >; } pub mod revenue { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u128, - >; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u128, + >; } pub mod credits { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u128; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = ::core::primitive::u128; } } pub mod constants { @@ -38092,10 +38991,10 @@ pub mod api { #[doc = " The default value for the spot traffic multiplier."] pub fn traffic_default_value( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< runtime_types::sp_arithmetic::fixed_point::FixedU128, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "OnDemandAssignmentProvider", "TrafficDefaultValue", [ @@ -38110,10 +39009,8 @@ pub mod api { #[doc = " information stored for."] pub fn max_historical_revenue( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "OnDemandAssignmentProvider", "MaxHistoricalRevenue", [ @@ -38127,10 +39024,9 @@ pub mod api { #[doc = " Identifier for the internal revenue balance."] pub fn pallet_id( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress + { + ::subxt::constants::StaticAddress::new_static( "OnDemandAssignmentProvider", "PalletId", [ @@ -38160,12 +39056,12 @@ pub mod api { #[doc = " reached (and replace whatever was in there before)."] pub fn core_schedules( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (core_schedules::Param0,), - core_schedules::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (core_schedules::input::Param0,), + core_schedules::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "CoretimeAssignmentProvider", "CoreSchedules", [ @@ -38181,12 +39077,12 @@ pub mod api { #[doc = " `PendingAssignments`."] pub fn core_descriptors( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (core_descriptors::Param0,), - core_descriptors::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (core_descriptors::input::Param0,), + core_descriptors::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "CoretimeAssignmentProvider", "CoreDescriptors", [ @@ -38201,26 +39097,29 @@ pub mod api { pub mod core_schedules { use super::root_mod; use super::runtime_types; - pub type Param0 = ( - ::core::primitive::u32, - runtime_types::polkadot_primitives::v9::CoreIndex, - ); - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_runtime_parachains::assigner_coretime::Schedule< - ::core::primitive::u32, - >; + pub type Param0 = ( + ::core::primitive::u32, + runtime_types::polkadot_primitives::v9::CoreIndex, + ); } + pub type Output = + runtime_types::polkadot_runtime_parachains::assigner_coretime::Schedule< + ::core::primitive::u32, + >; } pub mod core_descriptors { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_primitives::v9::CoreIndex; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: CoreDescriptor < :: core :: primitive :: u32 > ; + pub type Param0 = runtime_types::polkadot_primitives::v9::CoreIndex; } + pub type Output = + runtime_types::polkadot_runtime_parachains::assigner_coretime::CoreDescriptor< + ::core::primitive::u32, + >; } } } @@ -38234,559 +39133,565 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Register head data and validation code for a reserved Para Id."] + #[doc = ""] + #[doc = "## Arguments"] + #[doc = "- `origin`: Must be called by a `Signed` origin."] + #[doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] + #[doc = "- `genesis_head`: The genesis head data of the parachain/thread."] + #[doc = "- `validation_code`: The initial validation code of the parachain/thread."] + #[doc = ""] + #[doc = "## Deposits/Fees"] + #[doc = "The account with the originating signature must reserve a deposit."] + #[doc = ""] + #[doc = "The deposit is required to cover the costs associated with storing the genesis head"] + #[doc = "data and the validation code."] + #[doc = "This accounts for the potential to store validation code of a size up to the"] + #[doc = "`max_code_size`, as defined in the configuration pallet"] + #[doc = ""] + #[doc = "Anything already reserved previously for this para ID is accounted for."] + #[doc = ""] + #[doc = "## Events"] + #[doc = "The `Registered` event is emitted in case of success."] + pub struct Register { + pub id: register::Id, + pub genesis_head: register::GenesisHead, + pub validation_code: register::ValidationCode, + } + pub mod register { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Register head data and validation code for a reserved Para Id."] - #[doc = ""] - #[doc = "## Arguments"] - #[doc = "- `origin`: Must be called by a `Signed` origin."] - #[doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] - #[doc = "- `genesis_head`: The genesis head data of the parachain/thread."] - #[doc = "- `validation_code`: The initial validation code of the parachain/thread."] - #[doc = ""] - #[doc = "## Deposits/Fees"] - #[doc = "The account with the originating signature must reserve a deposit."] - #[doc = ""] - #[doc = "The deposit is required to cover the costs associated with storing the genesis head"] - #[doc = "data and the validation code."] - #[doc = "This accounts for the potential to store validation code of a size up to the"] - #[doc = "`max_code_size`, as defined in the configuration pallet"] - #[doc = ""] - #[doc = "Anything already reserved previously for this para ID is accounted for."] - #[doc = ""] - #[doc = "## Events"] - #[doc = "The `Registered` event is emitted in case of success."] - pub struct Register { - pub id: register::Id, - pub genesis_head: register::GenesisHead, - pub validation_code: register::ValidationCode, - } - pub mod register { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type GenesisHead = - runtime_types::polkadot_parachain_primitives::primitives::HeadData; - pub type ValidationCode = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Register { - const PALLET: &'static str = "Registrar"; - const CALL: &'static str = "register"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force the registration of a Para Id on the relay chain."] - #[doc = ""] - #[doc = "This function must be called by a Root origin."] - #[doc = ""] - #[doc = "The deposit taken can be specified for this registration. Any `ParaId`"] - #[doc = "can be registered, including sub-1000 IDs which are System Parachains."] - pub struct ForceRegister { - pub who: force_register::Who, - pub deposit: force_register::Deposit, - pub id: force_register::Id, - pub genesis_head: force_register::GenesisHead, - pub validation_code: force_register::ValidationCode, - } - pub mod force_register { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Deposit = ::core::primitive::u128; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type GenesisHead = - runtime_types::polkadot_parachain_primitives::primitives::HeadData; - pub type ValidationCode = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceRegister { - const PALLET: &'static str = "Registrar"; - const CALL: &'static str = "force_register"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Deregister a Para Id, freeing all data and returning any deposit."] - #[doc = ""] - #[doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be an"] - #[doc = "on-demand parachain."] - pub struct Deregister { - pub id: deregister::Id, - } - pub mod deregister { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Deregister { - const PALLET: &'static str = "Registrar"; - const CALL: &'static str = "deregister"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Swap a lease holding parachain with another parachain, either on-demand or lease"] - #[doc = "holding."] - #[doc = ""] - #[doc = "The origin must be Root, the `para` owner, or the `para` itself."] - #[doc = ""] - #[doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] - #[doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] - #[doc = ""] - #[doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] - #[doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] - #[doc = "scheduling info (i.e. whether they're an on-demand parachain or lease holding"] - #[doc = "parachain), auction information and the auction deposit are switched."] - pub struct Swap { - pub id: swap::Id, - pub other: swap::Other, - } - pub mod swap { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Other = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Swap { - const PALLET: &'static str = "Registrar"; - const CALL: &'static str = "swap"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove a manager lock from a para. This will allow the manager of a"] - #[doc = "previously locked para to deregister or swap a para without using governance."] - #[doc = ""] - #[doc = "Can only be called by the Root origin or the parachain."] - pub struct RemoveLock { - pub para: remove_lock::Para, - } - pub mod remove_lock { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveLock { - const PALLET: &'static str = "Registrar"; - const CALL: &'static str = "remove_lock"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Reserve a Para Id on the relay chain."] - #[doc = ""] - #[doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] - #[doc = "The origin account is able to register head data and validation code using `register` to"] - #[doc = "create an on-demand parachain. Using the Slots pallet, an on-demand parachain can then"] - #[doc = "be upgraded to a lease holding parachain."] - #[doc = ""] - #[doc = "## Arguments"] - #[doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new"] - #[doc = " para ID."] - #[doc = ""] - #[doc = "## Deposits/Fees"] - #[doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] - #[doc = ""] - #[doc = "## Events"] - #[doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for"] - #[doc = "use."] - pub struct Reserve; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Reserve { - const PALLET: &'static str = "Registrar"; - const CALL: &'static str = "reserve"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Add a manager lock from a para. This will prevent the manager of a"] - #[doc = "para to deregister or swap a para."] - #[doc = ""] - #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] - #[doc = "unlocked."] - pub struct AddLock { - pub para: add_lock::Para, - } - pub mod add_lock { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddLock { - const PALLET: &'static str = "Registrar"; - const CALL: &'static str = "add_lock"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule a parachain upgrade."] - #[doc = ""] - #[doc = "This will kick off a check of `new_code` by all validators. After the majority of the"] - #[doc = "validators have reported on the validity of the code, the code will either be enacted"] - #[doc = "or the upgrade will be rejected. If the code will be enacted, the current code of the"] - #[doc = "parachain will be overwritten directly. This means that any PoV will be checked by this"] - #[doc = "new code. The parachain itself will not be informed explicitly that the validation code"] - #[doc = "has changed."] - #[doc = ""] - #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] - #[doc = "unlocked."] - pub struct ScheduleCodeUpgrade { - pub para: schedule_code_upgrade::Para, - pub new_code: schedule_code_upgrade::NewCode, - } - pub mod schedule_code_upgrade { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type NewCode = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleCodeUpgrade { - const PALLET: &'static str = "Registrar"; - const CALL: &'static str = "schedule_code_upgrade"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the parachain's current head."] - #[doc = ""] - #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] - #[doc = "unlocked."] - pub struct SetCurrentHead { - pub para: set_current_head::Para, - pub new_head: set_current_head::NewHead, - } - pub mod set_current_head { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type NewHead = - runtime_types::polkadot_parachain_primitives::primitives::HeadData; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetCurrentHead { - const PALLET: &'static str = "Registrar"; - const CALL: &'static str = "set_current_head"; + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type GenesisHead = + runtime_types::polkadot_parachain_primitives::primitives::HeadData; + pub type ValidationCode = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; + } + impl Register { + const PALLET_NAME: &'static str = "Registrar"; + const CALL_NAME: &'static str = "register"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Register { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Register head data and validation code for a reserved Para Id."] - #[doc = ""] - #[doc = "## Arguments"] - #[doc = "- `origin`: Must be called by a `Signed` origin."] - #[doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] - #[doc = "- `genesis_head`: The genesis head data of the parachain/thread."] - #[doc = "- `validation_code`: The initial validation code of the parachain/thread."] - #[doc = ""] - #[doc = "## Deposits/Fees"] - #[doc = "The account with the originating signature must reserve a deposit."] - #[doc = ""] - #[doc = "The deposit is required to cover the costs associated with storing the genesis head"] - #[doc = "data and the validation code."] - #[doc = "This accounts for the potential to store validation code of a size up to the"] - #[doc = "`max_code_size`, as defined in the configuration pallet"] - #[doc = ""] - #[doc = "Anything already reserved previously for this para ID is accounted for."] - #[doc = ""] - #[doc = "## Events"] - #[doc = "The `Registered` event is emitted in case of success."] - pub fn register( - &self, - id: types::register::Id, - genesis_head: types::register::GenesisHead, - validation_code: types::register::ValidationCode, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Registrar", - "register", - types::Register { - id, - genesis_head, - validation_code, - }, - [ - 208u8, 1u8, 38u8, 95u8, 53u8, 67u8, 148u8, 138u8, 189u8, 212u8, 250u8, - 160u8, 99u8, 220u8, 231u8, 55u8, 220u8, 21u8, 188u8, 81u8, 162u8, - 219u8, 93u8, 136u8, 255u8, 22u8, 5u8, 147u8, 40u8, 46u8, 141u8, 77u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Force the registration of a Para Id on the relay chain."] + #[doc = ""] + #[doc = "This function must be called by a Root origin."] + #[doc = ""] + #[doc = "The deposit taken can be specified for this registration. Any `ParaId`"] + #[doc = "can be registered, including sub-1000 IDs which are System Parachains."] + pub struct ForceRegister { + pub who: force_register::Who, + pub deposit: force_register::Deposit, + pub id: force_register::Id, + pub genesis_head: force_register::GenesisHead, + pub validation_code: force_register::ValidationCode, + } + pub mod force_register { + use super::runtime_types; + pub type Who = ::subxt::utils::AccountId32; + pub type Deposit = ::core::primitive::u128; + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type GenesisHead = + runtime_types::polkadot_parachain_primitives::primitives::HeadData; + pub type ValidationCode = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; + } + impl ForceRegister { + const PALLET_NAME: &'static str = "Registrar"; + const CALL_NAME: &'static str = "force_register"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceRegister { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Force the registration of a Para Id on the relay chain."] - #[doc = ""] - #[doc = "This function must be called by a Root origin."] - #[doc = ""] - #[doc = "The deposit taken can be specified for this registration. Any `ParaId`"] - #[doc = "can be registered, including sub-1000 IDs which are System Parachains."] - pub fn force_register( - &self, - who: types::force_register::Who, - deposit: types::force_register::Deposit, - id: types::force_register::Id, - genesis_head: types::force_register::GenesisHead, - validation_code: types::force_register::ValidationCode, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Registrar", - "force_register", - types::ForceRegister { - who, - deposit, - id, - genesis_head, - validation_code, - }, - [ - 73u8, 118u8, 161u8, 95u8, 234u8, 106u8, 174u8, 143u8, 34u8, 235u8, - 140u8, 166u8, 210u8, 101u8, 53u8, 191u8, 194u8, 17u8, 189u8, 187u8, - 86u8, 91u8, 112u8, 248u8, 109u8, 208u8, 37u8, 70u8, 26u8, 195u8, 90u8, - 207u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Deregister a Para Id, freeing all data and returning any deposit."] + #[doc = ""] + #[doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be an"] + #[doc = "on-demand parachain."] + pub struct Deregister { + pub id: deregister::Id, + } + pub mod deregister { + use super::runtime_types; + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl Deregister { + const PALLET_NAME: &'static str = "Registrar"; + const CALL_NAME: &'static str = "deregister"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Deregister { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Deregister a Para Id, freeing all data and returning any deposit."] - #[doc = ""] - #[doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be an"] - #[doc = "on-demand parachain."] - pub fn deregister( - &self, - id: types::deregister::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Registrar", - "deregister", - types::Deregister { id }, - [ - 212u8, 38u8, 98u8, 234u8, 146u8, 188u8, 71u8, 244u8, 238u8, 255u8, 3u8, - 89u8, 52u8, 242u8, 126u8, 187u8, 185u8, 193u8, 174u8, 187u8, 196u8, - 3u8, 66u8, 77u8, 173u8, 115u8, 52u8, 210u8, 69u8, 221u8, 109u8, 112u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Swap a lease holding parachain with another parachain, either on-demand or lease"] + #[doc = "holding."] + #[doc = ""] + #[doc = "The origin must be Root, the `para` owner, or the `para` itself."] + #[doc = ""] + #[doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] + #[doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] + #[doc = ""] + #[doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] + #[doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] + #[doc = "scheduling info (i.e. whether they're an on-demand parachain or lease holding"] + #[doc = "parachain), auction information and the auction deposit are switched."] + pub struct Swap { + pub id: swap::Id, + pub other: swap::Other, + } + pub mod swap { + use super::runtime_types; + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Other = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl Swap { + const PALLET_NAME: &'static str = "Registrar"; + const CALL_NAME: &'static str = "swap"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Swap { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Swap a lease holding parachain with another parachain, either on-demand or lease"] - #[doc = "holding."] - #[doc = ""] - #[doc = "The origin must be Root, the `para` owner, or the `para` itself."] - #[doc = ""] - #[doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] - #[doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] - #[doc = ""] - #[doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] - #[doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] - #[doc = "scheduling info (i.e. whether they're an on-demand parachain or lease holding"] - #[doc = "parachain), auction information and the auction deposit are switched."] - pub fn swap( - &self, - id: types::swap::Id, - other: types::swap::Other, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Registrar", - "swap", - types::Swap { id, other }, - [ - 235u8, 169u8, 16u8, 199u8, 107u8, 54u8, 35u8, 160u8, 219u8, 156u8, - 177u8, 205u8, 83u8, 45u8, 30u8, 233u8, 8u8, 143u8, 27u8, 123u8, 156u8, - 65u8, 128u8, 233u8, 218u8, 230u8, 98u8, 206u8, 231u8, 95u8, 224u8, - 35u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove a manager lock from a para. This will allow the manager of a"] + #[doc = "previously locked para to deregister or swap a para without using governance."] + #[doc = ""] + #[doc = "Can only be called by the Root origin or the parachain."] + pub struct RemoveLock { + pub para: remove_lock::Para, + } + pub mod remove_lock { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl RemoveLock { + const PALLET_NAME: &'static str = "Registrar"; + const CALL_NAME: &'static str = "remove_lock"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveLock { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove a manager lock from a para. This will allow the manager of a"] - #[doc = "previously locked para to deregister or swap a para without using governance."] - #[doc = ""] - #[doc = "Can only be called by the Root origin or the parachain."] - pub fn remove_lock( - &self, - para: types::remove_lock::Para, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Registrar", - "remove_lock", - types::RemoveLock { para }, - [ - 239u8, 207u8, 248u8, 246u8, 244u8, 128u8, 113u8, 114u8, 6u8, 232u8, - 218u8, 123u8, 241u8, 190u8, 255u8, 48u8, 26u8, 248u8, 33u8, 86u8, 87u8, - 219u8, 65u8, 104u8, 66u8, 68u8, 34u8, 201u8, 43u8, 159u8, 141u8, 100u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Reserve a Para Id on the relay chain."] + #[doc = ""] + #[doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] + #[doc = "The origin account is able to register head data and validation code using `register` to"] + #[doc = "create an on-demand parachain. Using the Slots pallet, an on-demand parachain can then"] + #[doc = "be upgraded to a lease holding parachain."] + #[doc = ""] + #[doc = "## Arguments"] + #[doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new"] + #[doc = " para ID."] + #[doc = ""] + #[doc = "## Deposits/Fees"] + #[doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] + #[doc = ""] + #[doc = "## Events"] + #[doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for"] + #[doc = "use."] + pub struct Reserve; + impl Reserve { + const PALLET_NAME: &'static str = "Registrar"; + const CALL_NAME: &'static str = "reserve"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Reserve { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Reserve a Para Id on the relay chain."] - #[doc = ""] - #[doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] - #[doc = "The origin account is able to register head data and validation code using `register` to"] - #[doc = "create an on-demand parachain. Using the Slots pallet, an on-demand parachain can then"] - #[doc = "be upgraded to a lease holding parachain."] - #[doc = ""] - #[doc = "## Arguments"] - #[doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new"] - #[doc = " para ID."] - #[doc = ""] - #[doc = "## Deposits/Fees"] - #[doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] - #[doc = ""] - #[doc = "## Events"] - #[doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for"] - #[doc = "use."] - pub fn reserve( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Registrar", - "reserve", - types::Reserve {}, - [ - 50u8, 72u8, 218u8, 145u8, 224u8, 93u8, 219u8, 220u8, 121u8, 35u8, - 104u8, 11u8, 139u8, 114u8, 171u8, 101u8, 40u8, 13u8, 33u8, 39u8, 245u8, - 146u8, 138u8, 159u8, 245u8, 236u8, 26u8, 0u8, 20u8, 243u8, 128u8, 81u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Add a manager lock from a para. This will prevent the manager of a"] + #[doc = "para to deregister or swap a para."] + #[doc = ""] + #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] + #[doc = "unlocked."] + pub struct AddLock { + pub para: add_lock::Para, + } + pub mod add_lock { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl AddLock { + const PALLET_NAME: &'static str = "Registrar"; + const CALL_NAME: &'static str = "add_lock"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AddLock { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Add a manager lock from a para. This will prevent the manager of a"] - #[doc = "para to deregister or swap a para."] - #[doc = ""] - #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] - #[doc = "unlocked."] - pub fn add_lock( - &self, - para: types::add_lock::Para, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Registrar", - "add_lock", - types::AddLock { para }, - [ - 158u8, 27u8, 55u8, 53u8, 71u8, 221u8, 37u8, 73u8, 23u8, 165u8, 129u8, - 17u8, 167u8, 79u8, 112u8, 35u8, 231u8, 8u8, 241u8, 151u8, 207u8, 235u8, - 224u8, 104u8, 102u8, 108u8, 10u8, 244u8, 33u8, 67u8, 45u8, 13u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Schedule a parachain upgrade."] + #[doc = ""] + #[doc = "This will kick off a check of `new_code` by all validators. After the majority of the"] + #[doc = "validators have reported on the validity of the code, the code will either be enacted"] + #[doc = "or the upgrade will be rejected. If the code will be enacted, the current code of the"] + #[doc = "parachain will be overwritten directly. This means that any PoV will be checked by this"] + #[doc = "new code. The parachain itself will not be informed explicitly that the validation code"] + #[doc = "has changed."] + #[doc = ""] + #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] + #[doc = "unlocked."] + pub struct ScheduleCodeUpgrade { + pub para: schedule_code_upgrade::Para, + pub new_code: schedule_code_upgrade::NewCode, + } + pub mod schedule_code_upgrade { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type NewCode = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; + } + impl ScheduleCodeUpgrade { + const PALLET_NAME: &'static str = "Registrar"; + const CALL_NAME: &'static str = "schedule_code_upgrade"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ScheduleCodeUpgrade { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Schedule a parachain upgrade."] - #[doc = ""] - #[doc = "This will kick off a check of `new_code` by all validators. After the majority of the"] - #[doc = "validators have reported on the validity of the code, the code will either be enacted"] - #[doc = "or the upgrade will be rejected. If the code will be enacted, the current code of the"] - #[doc = "parachain will be overwritten directly. This means that any PoV will be checked by this"] - #[doc = "new code. The parachain itself will not be informed explicitly that the validation code"] - #[doc = "has changed."] - #[doc = ""] - #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] - #[doc = "unlocked."] - pub fn schedule_code_upgrade( - &self, - para: types::schedule_code_upgrade::Para, - new_code: types::schedule_code_upgrade::NewCode, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Registrar", - "schedule_code_upgrade", - types::ScheduleCodeUpgrade { para, new_code }, - [ - 234u8, 22u8, 133u8, 175u8, 218u8, 250u8, 119u8, 175u8, 23u8, 250u8, - 175u8, 48u8, 247u8, 208u8, 235u8, 167u8, 24u8, 248u8, 247u8, 236u8, - 239u8, 9u8, 78u8, 195u8, 146u8, 172u8, 41u8, 105u8, 183u8, 253u8, 1u8, - 170u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the parachain's current head."] + #[doc = ""] + #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] + #[doc = "unlocked."] + pub struct SetCurrentHead { + pub para: set_current_head::Para, + pub new_head: set_current_head::NewHead, + } + pub mod set_current_head { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type NewHead = + runtime_types::polkadot_parachain_primitives::primitives::HeadData; + } + impl SetCurrentHead { + const PALLET_NAME: &'static str = "Registrar"; + const CALL_NAME: &'static str = "set_current_head"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetCurrentHead { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the parachain's current head."] - #[doc = ""] - #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] - #[doc = "unlocked."] - pub fn set_current_head( - &self, - para: types::set_current_head::Para, - new_head: types::set_current_head::NewHead, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Registrar", - "set_current_head", - types::SetCurrentHead { para, new_head }, - [ - 201u8, 49u8, 104u8, 135u8, 80u8, 233u8, 154u8, 193u8, 143u8, 209u8, - 10u8, 209u8, 234u8, 252u8, 142u8, 216u8, 220u8, 249u8, 23u8, 252u8, - 73u8, 169u8, 204u8, 242u8, 59u8, 19u8, 18u8, 35u8, 115u8, 209u8, 79u8, - 112u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Register head data and validation code for a reserved Para Id."] + #[doc = ""] + #[doc = "## Arguments"] + #[doc = "- `origin`: Must be called by a `Signed` origin."] + #[doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] + #[doc = "- `genesis_head`: The genesis head data of the parachain/thread."] + #[doc = "- `validation_code`: The initial validation code of the parachain/thread."] + #[doc = ""] + #[doc = "## Deposits/Fees"] + #[doc = "The account with the originating signature must reserve a deposit."] + #[doc = ""] + #[doc = "The deposit is required to cover the costs associated with storing the genesis head"] + #[doc = "data and the validation code."] + #[doc = "This accounts for the potential to store validation code of a size up to the"] + #[doc = "`max_code_size`, as defined in the configuration pallet"] + #[doc = ""] + #[doc = "Anything already reserved previously for this para ID is accounted for."] + #[doc = ""] + #[doc = "## Events"] + #[doc = "The `Registered` event is emitted in case of success."] + pub fn register( + &self, + id: super::register::Id, + genesis_head: super::register::GenesisHead, + validation_code: super::register::ValidationCode, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Registrar", + "register", + super::Register { + id, + genesis_head, + validation_code, + }, + [ + 208u8, 1u8, 38u8, 95u8, 53u8, 67u8, 148u8, 138u8, 189u8, 212u8, + 250u8, 160u8, 99u8, 220u8, 231u8, 55u8, 220u8, 21u8, 188u8, 81u8, + 162u8, 219u8, 93u8, 136u8, 255u8, 22u8, 5u8, 147u8, 40u8, 46u8, + 141u8, 77u8, + ], + ) + } + #[doc = "Force the registration of a Para Id on the relay chain."] + #[doc = ""] + #[doc = "This function must be called by a Root origin."] + #[doc = ""] + #[doc = "The deposit taken can be specified for this registration. Any `ParaId`"] + #[doc = "can be registered, including sub-1000 IDs which are System Parachains."] + pub fn force_register( + &self, + who: super::force_register::Who, + deposit: super::force_register::Deposit, + id: super::force_register::Id, + genesis_head: super::force_register::GenesisHead, + validation_code: super::force_register::ValidationCode, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Registrar", + "force_register", + super::ForceRegister { + who, + deposit, + id, + genesis_head, + validation_code, + }, + [ + 73u8, 118u8, 161u8, 95u8, 234u8, 106u8, 174u8, 143u8, 34u8, 235u8, + 140u8, 166u8, 210u8, 101u8, 53u8, 191u8, 194u8, 17u8, 189u8, 187u8, + 86u8, 91u8, 112u8, 248u8, 109u8, 208u8, 37u8, 70u8, 26u8, 195u8, + 90u8, 207u8, + ], + ) + } + #[doc = "Deregister a Para Id, freeing all data and returning any deposit."] + #[doc = ""] + #[doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be an"] + #[doc = "on-demand parachain."] + pub fn deregister( + &self, + id: super::deregister::Id, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Registrar", + "deregister", + super::Deregister { id }, + [ + 212u8, 38u8, 98u8, 234u8, 146u8, 188u8, 71u8, 244u8, 238u8, 255u8, + 3u8, 89u8, 52u8, 242u8, 126u8, 187u8, 185u8, 193u8, 174u8, 187u8, + 196u8, 3u8, 66u8, 77u8, 173u8, 115u8, 52u8, 210u8, 69u8, 221u8, + 109u8, 112u8, + ], + ) + } + #[doc = "Swap a lease holding parachain with another parachain, either on-demand or lease"] + #[doc = "holding."] + #[doc = ""] + #[doc = "The origin must be Root, the `para` owner, or the `para` itself."] + #[doc = ""] + #[doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] + #[doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] + #[doc = ""] + #[doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] + #[doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] + #[doc = "scheduling info (i.e. whether they're an on-demand parachain or lease holding"] + #[doc = "parachain), auction information and the auction deposit are switched."] + pub fn swap( + &self, + id: super::swap::Id, + other: super::swap::Other, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Registrar", + "swap", + super::Swap { id, other }, + [ + 235u8, 169u8, 16u8, 199u8, 107u8, 54u8, 35u8, 160u8, 219u8, 156u8, + 177u8, 205u8, 83u8, 45u8, 30u8, 233u8, 8u8, 143u8, 27u8, 123u8, + 156u8, 65u8, 128u8, 233u8, 218u8, 230u8, 98u8, 206u8, 231u8, 95u8, + 224u8, 35u8, + ], + ) + } + #[doc = "Remove a manager lock from a para. This will allow the manager of a"] + #[doc = "previously locked para to deregister or swap a para without using governance."] + #[doc = ""] + #[doc = "Can only be called by the Root origin or the parachain."] + pub fn remove_lock( + &self, + para: super::remove_lock::Para, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Registrar", + "remove_lock", + super::RemoveLock { para }, + [ + 239u8, 207u8, 248u8, 246u8, 244u8, 128u8, 113u8, 114u8, 6u8, 232u8, + 218u8, 123u8, 241u8, 190u8, 255u8, 48u8, 26u8, 248u8, 33u8, 86u8, + 87u8, 219u8, 65u8, 104u8, 66u8, 68u8, 34u8, 201u8, 43u8, 159u8, + 141u8, 100u8, + ], + ) + } + #[doc = "Reserve a Para Id on the relay chain."] + #[doc = ""] + #[doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] + #[doc = "The origin account is able to register head data and validation code using `register` to"] + #[doc = "create an on-demand parachain. Using the Slots pallet, an on-demand parachain can then"] + #[doc = "be upgraded to a lease holding parachain."] + #[doc = ""] + #[doc = "## Arguments"] + #[doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new"] + #[doc = " para ID."] + #[doc = ""] + #[doc = "## Deposits/Fees"] + #[doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] + #[doc = ""] + #[doc = "## Events"] + #[doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for"] + #[doc = "use."] + pub fn reserve(&self) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Registrar", + "reserve", + super::Reserve {}, + [ + 50u8, 72u8, 218u8, 145u8, 224u8, 93u8, 219u8, 220u8, 121u8, 35u8, + 104u8, 11u8, 139u8, 114u8, 171u8, 101u8, 40u8, 13u8, 33u8, 39u8, + 245u8, 146u8, 138u8, 159u8, 245u8, 236u8, 26u8, 0u8, 20u8, 243u8, + 128u8, 81u8, + ], + ) + } + #[doc = "Add a manager lock from a para. This will prevent the manager of a"] + #[doc = "para to deregister or swap a para."] + #[doc = ""] + #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] + #[doc = "unlocked."] + pub fn add_lock( + &self, + para: super::add_lock::Para, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Registrar", + "add_lock", + super::AddLock { para }, + [ + 158u8, 27u8, 55u8, 53u8, 71u8, 221u8, 37u8, 73u8, 23u8, 165u8, + 129u8, 17u8, 167u8, 79u8, 112u8, 35u8, 231u8, 8u8, 241u8, 151u8, + 207u8, 235u8, 224u8, 104u8, 102u8, 108u8, 10u8, 244u8, 33u8, 67u8, + 45u8, 13u8, + ], + ) + } + #[doc = "Schedule a parachain upgrade."] + #[doc = ""] + #[doc = "This will kick off a check of `new_code` by all validators. After the majority of the"] + #[doc = "validators have reported on the validity of the code, the code will either be enacted"] + #[doc = "or the upgrade will be rejected. If the code will be enacted, the current code of the"] + #[doc = "parachain will be overwritten directly. This means that any PoV will be checked by this"] + #[doc = "new code. The parachain itself will not be informed explicitly that the validation code"] + #[doc = "has changed."] + #[doc = ""] + #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] + #[doc = "unlocked."] + pub fn schedule_code_upgrade( + &self, + para: super::schedule_code_upgrade::Para, + new_code: super::schedule_code_upgrade::NewCode, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Registrar", + "schedule_code_upgrade", + super::ScheduleCodeUpgrade { para, new_code }, + [ + 234u8, 22u8, 133u8, 175u8, 218u8, 250u8, 119u8, 175u8, 23u8, 250u8, + 175u8, 48u8, 247u8, 208u8, 235u8, 167u8, 24u8, 248u8, 247u8, 236u8, + 239u8, 9u8, 78u8, 195u8, 146u8, 172u8, 41u8, 105u8, 183u8, 253u8, + 1u8, 170u8, + ], + ) + } + #[doc = "Set the parachain's current head."] + #[doc = ""] + #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] + #[doc = "unlocked."] + pub fn set_current_head( + &self, + para: super::set_current_head::Para, + new_head: super::set_current_head::NewHead, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Registrar", + "set_current_head", + super::SetCurrentHead { para, new_head }, + [ + 201u8, 49u8, 104u8, 135u8, 80u8, 233u8, 154u8, 193u8, 143u8, 209u8, + 10u8, 209u8, 234u8, 252u8, 142u8, 216u8, 220u8, 249u8, 23u8, 252u8, + 73u8, 169u8, 204u8, 242u8, 59u8, 19u8, 18u8, 35u8, 115u8, 209u8, + 79u8, 112u8, + ], + ) + } } } } @@ -38795,12 +39700,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Registered { pub para_id: registered::ParaId, pub manager: registered::Manager, @@ -38808,19 +39713,24 @@ pub mod api { pub mod registered { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Manager = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Manager = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Registered { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Registered"; + impl Registered { + const PALLET_NAME: &'static str = "Registrar"; + const EVENT_NAME: &'static str = "Registered"; + } + impl ::subxt::events::DecodeAsEvent for Registered { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Deregistered { pub para_id: deregistered::ParaId, } @@ -38828,17 +39738,22 @@ pub mod api { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Deregistered { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Deregistered"; + impl Deregistered { + const PALLET_NAME: &'static str = "Registrar"; + const EVENT_NAME: &'static str = "Deregistered"; + } + impl ::subxt::events::DecodeAsEvent for Deregistered { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Reserved { pub para_id: reserved::ParaId, pub who: reserved::Who, @@ -38846,19 +39761,24 @@ pub mod api { pub mod reserved { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Reserved { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Reserved"; + impl Reserved { + const PALLET_NAME: &'static str = "Registrar"; + const EVENT_NAME: &'static str = "Reserved"; + } + impl ::subxt::events::DecodeAsEvent for Reserved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Swapped { pub para_id: swapped::ParaId, pub other_id: swapped::OtherId, @@ -38868,9 +39788,14 @@ pub mod api { pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; pub type OtherId = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Swapped { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Swapped"; + impl Swapped { + const PALLET_NAME: &'static str = "Registrar"; + const EVENT_NAME: &'static str = "Swapped"; + } + impl ::subxt::events::DecodeAsEvent for Swapped { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -38881,12 +39806,12 @@ pub mod api { #[doc = " Pending swap operations."] pub fn pending_swap( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (pending_swap::Param0,), - pending_swap::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (pending_swap::input::Param0,), + pending_swap::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Registrar", "PendingSwap", [ @@ -38903,12 +39828,12 @@ pub mod api { #[doc = " only do so if it isn't yet registered. (After that, it's up to governance to do so.)"] pub fn paras( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (paras::Param0,), - paras::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (paras::input::Param0,), + paras::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Registrar", "Paras", [ @@ -38922,12 +39847,12 @@ pub mod api { #[doc = " The next free `ParaId`."] pub fn next_free_para_id( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - next_free_para_id::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + next_free_para_id::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Registrar", "NextFreeParaId", [ @@ -38941,32 +39866,31 @@ pub mod api { pub mod pending_swap { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = runtime_types::polkadot_parachain_primitives::primitives::Id; } pub mod paras { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< + ::subxt::utils::AccountId32, + ::core::primitive::u128, + >; } pub mod next_free_para_id { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = runtime_types::polkadot_parachain_primitives::primitives::Id; } } pub mod constants { @@ -38977,10 +39901,8 @@ pub mod api { #[doc = " This should include the cost for storing the genesis head and validation code."] pub fn para_deposit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Registrar", "ParaDeposit", [ @@ -38993,10 +39915,8 @@ pub mod api { #[doc = " The deposit to be paid per byte stored on chain."] pub fn data_deposit_per_byte( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Registrar", "DataDepositPerByte", [ @@ -39019,172 +39939,175 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to"] - #[doc = "happen independently of any other on-chain mechanism to use it."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - pub struct ForceLease { - pub para: force_lease::Para, - pub leaser: force_lease::Leaser, - pub amount: force_lease::Amount, - pub period_begin: force_lease::PeriodBegin, - pub period_count: force_lease::PeriodCount, - } - pub mod force_lease { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Leaser = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - pub type PeriodBegin = ::core::primitive::u32; - pub type PeriodCount = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceLease { - const PALLET: &'static str = "Slots"; - const CALL: &'static str = "force_lease"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - pub struct ClearAllLeases { - pub para: clear_all_leases::Para, - } - pub mod clear_all_leases { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClearAllLeases { - const PALLET: &'static str = "Slots"; - const CALL: &'static str = "clear_all_leases"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Try to onboard a parachain that has a lease for the current lease period."] - #[doc = ""] - #[doc = "This function can be useful if there was some state issue with a para that should"] - #[doc = "have onboarded, but was unable to. As long as they have a lease period, we can"] - #[doc = "let them onboard from here."] - #[doc = ""] - #[doc = "Origin must be signed, but can be called by anyone."] - pub struct TriggerOnboard { - pub para: trigger_onboard::Para, - } - pub mod trigger_onboard { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TriggerOnboard { - const PALLET: &'static str = "Slots"; - const CALL: &'static str = "trigger_onboard"; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to"] + #[doc = "happen independently of any other on-chain mechanism to use it."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + pub struct ForceLease { + pub para: force_lease::Para, + pub leaser: force_lease::Leaser, + pub amount: force_lease::Amount, + pub period_begin: force_lease::PeriodBegin, + pub period_count: force_lease::PeriodCount, + } + pub mod force_lease { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Leaser = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + pub type PeriodBegin = ::core::primitive::u32; + pub type PeriodCount = ::core::primitive::u32; + } + impl ForceLease { + const PALLET_NAME: &'static str = "Slots"; + const CALL_NAME: &'static str = "force_lease"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceLease { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to"] - #[doc = "happen independently of any other on-chain mechanism to use it."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - pub fn force_lease( - &self, - para: types::force_lease::Para, - leaser: types::force_lease::Leaser, - amount: types::force_lease::Amount, - period_begin: types::force_lease::PeriodBegin, - period_count: types::force_lease::PeriodCount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Slots", - "force_lease", - types::ForceLease { - para, - leaser, - amount, - period_begin, - period_count, - }, - [ - 27u8, 203u8, 227u8, 16u8, 65u8, 135u8, 140u8, 244u8, 218u8, 231u8, - 78u8, 190u8, 169u8, 156u8, 233u8, 31u8, 20u8, 119u8, 158u8, 34u8, - 130u8, 51u8, 38u8, 176u8, 142u8, 139u8, 152u8, 139u8, 26u8, 184u8, - 238u8, 227u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + pub struct ClearAllLeases { + pub para: clear_all_leases::Para, + } + pub mod clear_all_leases { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl ClearAllLeases { + const PALLET_NAME: &'static str = "Slots"; + const CALL_NAME: &'static str = "clear_all_leases"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ClearAllLeases { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - pub fn clear_all_leases( - &self, - para: types::clear_all_leases::Para, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Slots", - "clear_all_leases", - types::ClearAllLeases { para }, - [ - 201u8, 71u8, 106u8, 50u8, 65u8, 107u8, 191u8, 41u8, 52u8, 106u8, 51u8, - 87u8, 19u8, 199u8, 244u8, 93u8, 104u8, 148u8, 116u8, 198u8, 169u8, - 137u8, 28u8, 78u8, 54u8, 230u8, 161u8, 16u8, 79u8, 248u8, 28u8, 183u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Try to onboard a parachain that has a lease for the current lease period."] + #[doc = ""] + #[doc = "This function can be useful if there was some state issue with a para that should"] + #[doc = "have onboarded, but was unable to. As long as they have a lease period, we can"] + #[doc = "let them onboard from here."] + #[doc = ""] + #[doc = "Origin must be signed, but can be called by anyone."] + pub struct TriggerOnboard { + pub para: trigger_onboard::Para, + } + pub mod trigger_onboard { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl TriggerOnboard { + const PALLET_NAME: &'static str = "Slots"; + const CALL_NAME: &'static str = "trigger_onboard"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for TriggerOnboard { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Try to onboard a parachain that has a lease for the current lease period."] - #[doc = ""] - #[doc = "This function can be useful if there was some state issue with a para that should"] - #[doc = "have onboarded, but was unable to. As long as they have a lease period, we can"] - #[doc = "let them onboard from here."] - #[doc = ""] - #[doc = "Origin must be signed, but can be called by anyone."] - pub fn trigger_onboard( - &self, - para: types::trigger_onboard::Para, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Slots", - "trigger_onboard", - types::TriggerOnboard { para }, - [ - 192u8, 239u8, 65u8, 186u8, 200u8, 27u8, 23u8, 235u8, 2u8, 229u8, 230u8, - 192u8, 240u8, 51u8, 62u8, 80u8, 253u8, 105u8, 178u8, 134u8, 252u8, 2u8, - 153u8, 29u8, 235u8, 249u8, 92u8, 246u8, 136u8, 169u8, 109u8, 4u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to"] + #[doc = "happen independently of any other on-chain mechanism to use it."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + pub fn force_lease( + &self, + para: super::force_lease::Para, + leaser: super::force_lease::Leaser, + amount: super::force_lease::Amount, + period_begin: super::force_lease::PeriodBegin, + period_count: super::force_lease::PeriodCount, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Slots", + "force_lease", + super::ForceLease { + para, + leaser, + amount, + period_begin, + period_count, + }, + [ + 27u8, 203u8, 227u8, 16u8, 65u8, 135u8, 140u8, 244u8, 218u8, 231u8, + 78u8, 190u8, 169u8, 156u8, 233u8, 31u8, 20u8, 119u8, 158u8, 34u8, + 130u8, 51u8, 38u8, 176u8, 142u8, 139u8, 152u8, 139u8, 26u8, 184u8, + 238u8, 227u8, + ], + ) + } + #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + pub fn clear_all_leases( + &self, + para: super::clear_all_leases::Para, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Slots", + "clear_all_leases", + super::ClearAllLeases { para }, + [ + 201u8, 71u8, 106u8, 50u8, 65u8, 107u8, 191u8, 41u8, 52u8, 106u8, + 51u8, 87u8, 19u8, 199u8, 244u8, 93u8, 104u8, 148u8, 116u8, 198u8, + 169u8, 137u8, 28u8, 78u8, 54u8, 230u8, 161u8, 16u8, 79u8, 248u8, + 28u8, 183u8, + ], + ) + } + #[doc = "Try to onboard a parachain that has a lease for the current lease period."] + #[doc = ""] + #[doc = "This function can be useful if there was some state issue with a para that should"] + #[doc = "have onboarded, but was unable to. As long as they have a lease period, we can"] + #[doc = "let them onboard from here."] + #[doc = ""] + #[doc = "Origin must be signed, but can be called by anyone."] + pub fn trigger_onboard( + &self, + para: super::trigger_onboard::Para, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Slots", + "trigger_onboard", + super::TriggerOnboard { para }, + [ + 192u8, 239u8, 65u8, 186u8, 200u8, 27u8, 23u8, 235u8, 2u8, 229u8, + 230u8, 192u8, 240u8, 51u8, 62u8, 80u8, 253u8, 105u8, 178u8, 134u8, + 252u8, 2u8, 153u8, 29u8, 235u8, 249u8, 92u8, 246u8, 136u8, 169u8, + 109u8, 4u8, + ], + ) + } } } } @@ -39193,12 +40116,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A new `[lease_period]` is beginning."] pub struct NewLeasePeriod { pub lease_period: new_lease_period::LeasePeriod, @@ -39207,17 +40130,22 @@ pub mod api { use super::runtime_types; pub type LeasePeriod = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NewLeasePeriod { - const PALLET: &'static str = "Slots"; - const EVENT: &'static str = "NewLeasePeriod"; + impl NewLeasePeriod { + const PALLET_NAME: &'static str = "Slots"; + const EVENT_NAME: &'static str = "NewLeasePeriod"; + } + impl ::subxt::events::DecodeAsEvent for NewLeasePeriod { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A para has won the right to a continuous set of lease periods as a parachain."] #[doc = "First balance is any extra amount reserved on top of the para's existing deposit."] #[doc = "Second balance is the total amount reserved."] @@ -39232,15 +40160,20 @@ pub mod api { pub mod leased { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Leaser = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Leaser = ::subxt::utils::AccountId32; pub type PeriodBegin = ::core::primitive::u32; pub type PeriodCount = ::core::primitive::u32; pub type ExtraReserved = ::core::primitive::u128; pub type TotalAmount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Leased { - const PALLET: &'static str = "Slots"; - const EVENT: &'static str = "Leased"; + impl Leased { + const PALLET_NAME: &'static str = "Slots"; + const EVENT_NAME: &'static str = "Leased"; + } + impl ::subxt::events::DecodeAsEvent for Leased { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -39266,12 +40199,12 @@ pub mod api { #[doc = " It is illegal for a `None` value to trail in the list."] pub fn leases( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (leases::Param0,), - leases::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (leases::input::Param0,), + leases::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Slots", "Leases", [ @@ -39286,16 +40219,13 @@ pub mod api { pub mod leases { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::core::option::Option<( - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - )>, - >; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = ::subxt::alloc::vec::Vec< + ::core::option::Option<(::subxt::utils::AccountId32, ::core::primitive::u128)>, + >; } } pub mod constants { @@ -39305,10 +40235,8 @@ pub mod api { #[doc = " The number of blocks over which a single period lasts."] pub fn lease_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Slots", "LeasePeriod", [ @@ -39322,10 +40250,8 @@ pub mod api { #[doc = " The number of blocks to offset each lease period by."] pub fn lease_offset( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Slots", "LeaseOffset", [ @@ -39349,198 +40275,200 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Create a new auction."] + #[doc = ""] + #[doc = "This can only happen when there isn't already an auction in progress and may only be"] + #[doc = "called by the root origin. Accepts the `duration` of this auction and the"] + #[doc = "`lease_period_index` of the initial lease period of the four that are to be auctioned."] + pub struct NewAuction { + #[codec(compact)] + pub duration: new_auction::Duration, + #[codec(compact)] + pub lease_period_index: new_auction::LeasePeriodIndex, + } + pub mod new_auction { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create a new auction."] - #[doc = ""] - #[doc = "This can only happen when there isn't already an auction in progress and may only be"] - #[doc = "called by the root origin. Accepts the `duration` of this auction and the"] - #[doc = "`lease_period_index` of the initial lease period of the four that are to be auctioned."] - pub struct NewAuction { - #[codec(compact)] - pub duration: new_auction::Duration, - #[codec(compact)] - pub lease_period_index: new_auction::LeasePeriodIndex, - } - pub mod new_auction { - use super::runtime_types; - pub type Duration = ::core::primitive::u32; - pub type LeasePeriodIndex = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NewAuction { - const PALLET: &'static str = "Auctions"; - const CALL: &'static str = "new_auction"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] - #[doc = "parachain."] - #[doc = ""] - #[doc = "Multiple simultaneous bids from the same bidder are allowed only as long as all active"] - #[doc = "bids overlap each other (i.e. are mutually exclusive). Bids cannot be redacted."] - #[doc = ""] - #[doc = "- `sub` is the sub-bidder ID, allowing for multiple competing bids to be made by (and"] - #[doc = "funded by) the same account."] - #[doc = "- `auction_index` is the index of the auction to bid on. Should just be the present"] - #[doc = "value of `AuctionCounter`."] - #[doc = "- `first_slot` is the first lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `last_slot` is the last lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `amount` is the amount to bid to be held as deposit for the parachain should the"] - #[doc = "bid win. This amount is held throughout the range."] - pub struct Bid { - #[codec(compact)] - pub para: bid::Para, - #[codec(compact)] - pub auction_index: bid::AuctionIndex, - #[codec(compact)] - pub first_slot: bid::FirstSlot, - #[codec(compact)] - pub last_slot: bid::LastSlot, - #[codec(compact)] - pub amount: bid::Amount, - } - pub mod bid { - use super::runtime_types; - pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type AuctionIndex = ::core::primitive::u32; - pub type FirstSlot = ::core::primitive::u32; - pub type LastSlot = ::core::primitive::u32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Bid { - const PALLET: &'static str = "Auctions"; - const CALL: &'static str = "bid"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an in-progress auction."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - pub struct CancelAuction; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelAuction { - const PALLET: &'static str = "Auctions"; - const CALL: &'static str = "cancel_auction"; - } + pub type Duration = ::core::primitive::u32; + pub type LeasePeriodIndex = ::core::primitive::u32; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Create a new auction."] - #[doc = ""] - #[doc = "This can only happen when there isn't already an auction in progress and may only be"] - #[doc = "called by the root origin. Accepts the `duration` of this auction and the"] - #[doc = "`lease_period_index` of the initial lease period of the four that are to be auctioned."] - pub fn new_auction( - &self, - duration: types::new_auction::Duration, - lease_period_index: types::new_auction::LeasePeriodIndex, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Auctions", - "new_auction", - types::NewAuction { - duration, - lease_period_index, - }, - [ - 116u8, 2u8, 215u8, 191u8, 69u8, 99u8, 218u8, 198u8, 71u8, 228u8, 88u8, - 144u8, 139u8, 206u8, 214u8, 58u8, 106u8, 117u8, 138u8, 115u8, 109u8, - 253u8, 210u8, 135u8, 189u8, 190u8, 86u8, 189u8, 8u8, 168u8, 142u8, - 181u8, - ], - ) + impl NewAuction { + const PALLET_NAME: &'static str = "Auctions"; + const CALL_NAME: &'static str = "new_auction"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for NewAuction { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] - #[doc = "parachain."] - #[doc = ""] - #[doc = "Multiple simultaneous bids from the same bidder are allowed only as long as all active"] - #[doc = "bids overlap each other (i.e. are mutually exclusive). Bids cannot be redacted."] - #[doc = ""] - #[doc = "- `sub` is the sub-bidder ID, allowing for multiple competing bids to be made by (and"] - #[doc = "funded by) the same account."] - #[doc = "- `auction_index` is the index of the auction to bid on. Should just be the present"] - #[doc = "value of `AuctionCounter`."] - #[doc = "- `first_slot` is the first lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `last_slot` is the last lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `amount` is the amount to bid to be held as deposit for the parachain should the"] - #[doc = "bid win. This amount is held throughout the range."] - pub fn bid( - &self, - para: types::bid::Para, - auction_index: types::bid::AuctionIndex, - first_slot: types::bid::FirstSlot, - last_slot: types::bid::LastSlot, - amount: types::bid::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Auctions", - "bid", - types::Bid { - para, - auction_index, - first_slot, - last_slot, - amount, - }, - [ - 203u8, 71u8, 160u8, 55u8, 95u8, 152u8, 111u8, 30u8, 86u8, 113u8, 213u8, - 217u8, 140u8, 9u8, 138u8, 150u8, 90u8, 229u8, 17u8, 95u8, 141u8, 150u8, - 183u8, 171u8, 45u8, 110u8, 47u8, 91u8, 159u8, 91u8, 214u8, 132u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] + #[doc = "parachain."] + #[doc = ""] + #[doc = "Multiple simultaneous bids from the same bidder are allowed only as long as all active"] + #[doc = "bids overlap each other (i.e. are mutually exclusive). Bids cannot be redacted."] + #[doc = ""] + #[doc = "- `sub` is the sub-bidder ID, allowing for multiple competing bids to be made by (and"] + #[doc = "funded by) the same account."] + #[doc = "- `auction_index` is the index of the auction to bid on. Should just be the present"] + #[doc = "value of `AuctionCounter`."] + #[doc = "- `first_slot` is the first lease period index of the range to bid on. This is the"] + #[doc = "absolute lease period index value, not an auction-specific offset."] + #[doc = "- `last_slot` is the last lease period index of the range to bid on. This is the"] + #[doc = "absolute lease period index value, not an auction-specific offset."] + #[doc = "- `amount` is the amount to bid to be held as deposit for the parachain should the"] + #[doc = "bid win. This amount is held throughout the range."] + pub struct Bid { + #[codec(compact)] + pub para: bid::Para, + #[codec(compact)] + pub auction_index: bid::AuctionIndex, + #[codec(compact)] + pub first_slot: bid::FirstSlot, + #[codec(compact)] + pub last_slot: bid::LastSlot, + #[codec(compact)] + pub amount: bid::Amount, + } + pub mod bid { + use super::runtime_types; + pub type Para = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type AuctionIndex = ::core::primitive::u32; + pub type FirstSlot = ::core::primitive::u32; + pub type LastSlot = ::core::primitive::u32; + pub type Amount = ::core::primitive::u128; + } + impl Bid { + const PALLET_NAME: &'static str = "Auctions"; + const CALL_NAME: &'static str = "bid"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Bid { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Cancel an in-progress auction."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - pub fn cancel_auction( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Auctions", - "cancel_auction", - types::CancelAuction {}, - [ - 122u8, 231u8, 136u8, 184u8, 194u8, 4u8, 244u8, 62u8, 253u8, 134u8, 9u8, - 240u8, 75u8, 227u8, 74u8, 195u8, 113u8, 247u8, 127u8, 17u8, 90u8, - 228u8, 251u8, 88u8, 4u8, 29u8, 254u8, 71u8, 177u8, 103u8, 66u8, 224u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Cancel an in-progress auction."] + #[doc = ""] + #[doc = "Can only be called by Root origin."] + pub struct CancelAuction; + impl CancelAuction { + const PALLET_NAME: &'static str = "Auctions"; + const CALL_NAME: &'static str = "cancel_auction"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CancelAuction { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Create a new auction."] + #[doc = ""] + #[doc = "This can only happen when there isn't already an auction in progress and may only be"] + #[doc = "called by the root origin. Accepts the `duration` of this auction and the"] + #[doc = "`lease_period_index` of the initial lease period of the four that are to be auctioned."] + pub fn new_auction( + &self, + duration: super::new_auction::Duration, + lease_period_index: super::new_auction::LeasePeriodIndex, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Auctions", + "new_auction", + super::NewAuction { + duration, + lease_period_index, + }, + [ + 116u8, 2u8, 215u8, 191u8, 69u8, 99u8, 218u8, 198u8, 71u8, 228u8, + 88u8, 144u8, 139u8, 206u8, 214u8, 58u8, 106u8, 117u8, 138u8, 115u8, + 109u8, 253u8, 210u8, 135u8, 189u8, 190u8, 86u8, 189u8, 8u8, 168u8, + 142u8, 181u8, + ], + ) + } + #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] + #[doc = "parachain."] + #[doc = ""] + #[doc = "Multiple simultaneous bids from the same bidder are allowed only as long as all active"] + #[doc = "bids overlap each other (i.e. are mutually exclusive). Bids cannot be redacted."] + #[doc = ""] + #[doc = "- `sub` is the sub-bidder ID, allowing for multiple competing bids to be made by (and"] + #[doc = "funded by) the same account."] + #[doc = "- `auction_index` is the index of the auction to bid on. Should just be the present"] + #[doc = "value of `AuctionCounter`."] + #[doc = "- `first_slot` is the first lease period index of the range to bid on. This is the"] + #[doc = "absolute lease period index value, not an auction-specific offset."] + #[doc = "- `last_slot` is the last lease period index of the range to bid on. This is the"] + #[doc = "absolute lease period index value, not an auction-specific offset."] + #[doc = "- `amount` is the amount to bid to be held as deposit for the parachain should the"] + #[doc = "bid win. This amount is held throughout the range."] + pub fn bid( + &self, + para: super::bid::Para, + auction_index: super::bid::AuctionIndex, + first_slot: super::bid::FirstSlot, + last_slot: super::bid::LastSlot, + amount: super::bid::Amount, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Auctions", + "bid", + super::Bid { + para, + auction_index, + first_slot, + last_slot, + amount, + }, + [ + 203u8, 71u8, 160u8, 55u8, 95u8, 152u8, 111u8, 30u8, 86u8, 113u8, + 213u8, 217u8, 140u8, 9u8, 138u8, 150u8, 90u8, 229u8, 17u8, 95u8, + 141u8, 150u8, 183u8, 171u8, 45u8, 110u8, 47u8, 91u8, 159u8, 91u8, + 214u8, 132u8, + ], + ) + } + #[doc = "Cancel an in-progress auction."] + #[doc = ""] + #[doc = "Can only be called by Root origin."] + pub fn cancel_auction( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Auctions", + "cancel_auction", + super::CancelAuction {}, + [ + 122u8, 231u8, 136u8, 184u8, 194u8, 4u8, 244u8, 62u8, 253u8, 134u8, + 9u8, 240u8, 75u8, 227u8, 74u8, 195u8, 113u8, 247u8, 127u8, 17u8, + 90u8, 228u8, 251u8, 88u8, 4u8, 29u8, 254u8, 71u8, 177u8, 103u8, + 66u8, 224u8, + ], + ) + } } } } @@ -39549,12 +40477,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An auction started. Provides its index and the block number where it will begin to"] #[doc = "close and the first lease period of the quadruplet that is auctioned."] pub struct AuctionStarted { @@ -39568,17 +40496,22 @@ pub mod api { pub type LeasePeriod = ::core::primitive::u32; pub type Ending = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AuctionStarted { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "AuctionStarted"; + impl AuctionStarted { + const PALLET_NAME: &'static str = "Auctions"; + const EVENT_NAME: &'static str = "AuctionStarted"; + } + impl ::subxt::events::DecodeAsEvent for AuctionStarted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An auction ended. All funds become unreserved."] pub struct AuctionClosed { pub auction_index: auction_closed::AuctionIndex, @@ -39587,17 +40520,22 @@ pub mod api { use super::runtime_types; pub type AuctionIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AuctionClosed { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "AuctionClosed"; + impl AuctionClosed { + const PALLET_NAME: &'static str = "Auctions"; + const EVENT_NAME: &'static str = "AuctionClosed"; + } + impl ::subxt::events::DecodeAsEvent for AuctionClosed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Funds were reserved for a winning bid. First balance is the extra amount reserved."] #[doc = "Second is the total."] pub struct Reserved { @@ -39607,21 +40545,26 @@ pub mod api { } pub mod reserved { use super::runtime_types; - pub type Bidder = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Bidder = ::subxt::utils::AccountId32; pub type ExtraReserved = ::core::primitive::u128; pub type TotalAmount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Reserved { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "Reserved"; + impl Reserved { + const PALLET_NAME: &'static str = "Auctions"; + const EVENT_NAME: &'static str = "Reserved"; + } + impl ::subxt::events::DecodeAsEvent for Reserved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Funds were unreserved since bidder is no longer active. `[bidder, amount]`"] pub struct Unreserved { pub bidder: unreserved::Bidder, @@ -39629,20 +40572,25 @@ pub mod api { } pub mod unreserved { use super::runtime_types; - pub type Bidder = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Bidder = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Unreserved { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "Unreserved"; + impl Unreserved { + const PALLET_NAME: &'static str = "Auctions"; + const EVENT_NAME: &'static str = "Unreserved"; + } + impl ::subxt::events::DecodeAsEvent for Unreserved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Someone attempted to lease the same slot twice for a parachain. The amount is held in"] #[doc = "reserve but no parachain slot has been leased."] pub struct ReserveConfiscated { @@ -39653,20 +40601,25 @@ pub mod api { pub mod reserve_confiscated { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Leaser = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Leaser = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ReserveConfiscated { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "ReserveConfiscated"; + impl ReserveConfiscated { + const PALLET_NAME: &'static str = "Auctions"; + const EVENT_NAME: &'static str = "ReserveConfiscated"; + } + impl ::subxt::events::DecodeAsEvent for ReserveConfiscated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A new bid has been accepted as the current winner."] pub struct BidAccepted { pub bidder: bid_accepted::Bidder, @@ -39677,23 +40630,28 @@ pub mod api { } pub mod bid_accepted { use super::runtime_types; - pub type Bidder = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Bidder = ::subxt::utils::AccountId32; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; pub type Amount = ::core::primitive::u128; pub type FirstSlot = ::core::primitive::u32; pub type LastSlot = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BidAccepted { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "BidAccepted"; + impl BidAccepted { + const PALLET_NAME: &'static str = "Auctions"; + const EVENT_NAME: &'static str = "BidAccepted"; + } + impl ::subxt::events::DecodeAsEvent for BidAccepted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The winning offset was chosen for an auction. This will map into the `Winning` storage"] #[doc = "map."] pub struct WinningOffset { @@ -39705,9 +40663,14 @@ pub mod api { pub type AuctionIndex = ::core::primitive::u32; pub type BlockNumber = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for WinningOffset { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "WinningOffset"; + impl WinningOffset { + const PALLET_NAME: &'static str = "Auctions"; + const EVENT_NAME: &'static str = "WinningOffset"; + } + impl ::subxt::events::DecodeAsEvent for WinningOffset { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -39718,12 +40681,9 @@ pub mod api { #[doc = " Number of auctions started so far."] pub fn auction_counter( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - auction_counter::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), auction_counter::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Auctions", "AuctionCounter", [ @@ -39740,12 +40700,9 @@ pub mod api { #[doc = " auction will \"begin to end\", i.e. the first block of the Ending Period of the auction."] pub fn auction_info( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - auction_info::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), auction_info::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Auctions", "AuctionInfo", [ @@ -39759,12 +40716,12 @@ pub mod api { #[doc = " (sub-)ranges."] pub fn reserved_amounts( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (reserved_amounts::Param0,), - reserved_amounts::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (reserved_amounts::input::Param0,), + reserved_amounts::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Auctions", "ReservedAmounts", [ @@ -39780,12 +40737,12 @@ pub mod api { #[doc = " first sample of the ending period is 0; the last is `Sample Size - 1`."] pub fn winning( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (winning::Param0,), - winning::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (winning::input::Param0,), + winning::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Auctions", "Winning", [ @@ -39799,43 +40756,43 @@ pub mod api { pub mod auction_counter { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod auction_info { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (::core::primitive::u32, ::core::primitive::u32); } + pub type Output = (::core::primitive::u32, ::core::primitive::u32); } pub mod reserved_amounts { use super::root_mod; use super::runtime_types; - pub type Param0 = ( - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::polkadot_parachain_primitives::primitives::Id, - ); - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u128; + pub type Param0 = ( + ::subxt::utils::AccountId32, + runtime_types::polkadot_parachain_primitives::primitives::Id, + ); } + pub type Output = ::core::primitive::u128; } pub mod winning { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = [::core::option::Option<( - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u128, - )>; 36usize]; + pub type Param0 = ::core::primitive::u32; } + pub type Output = [::core::option::Option<( + ::subxt::utils::AccountId32, + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u128, + )>; 36usize]; } } pub mod constants { @@ -39845,10 +40802,8 @@ pub mod api { #[doc = " The number of blocks over which an auction may be retroactively ended."] pub fn ending_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Auctions", "EndingPeriod", [ @@ -39864,10 +40819,8 @@ pub mod api { #[doc = " `EndingPeriod` / `SampleLength` = Total # of Samples"] pub fn sample_length( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Auctions", "SampleLength", [ @@ -39880,10 +40833,8 @@ pub mod api { } pub fn slot_range_count( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Auctions", "SlotRangeCount", [ @@ -39896,10 +40847,8 @@ pub mod api { } pub fn lease_periods_per_slot( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Auctions", "LeasePeriodsPerSlot", [ @@ -39923,526 +40872,527 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period"] + #[doc = "range."] + #[doc = ""] + #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] + #[doc = "by the parachain manager."] + pub struct Create { + #[codec(compact)] + pub index: create::Index, + #[codec(compact)] + pub cap: create::Cap, + #[codec(compact)] + pub first_period: create::FirstPeriod, + #[codec(compact)] + pub last_period: create::LastPeriod, + #[codec(compact)] + pub end: create::End, + pub verifier: create::Verifier, + } + pub mod create { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period"] - #[doc = "range."] - #[doc = ""] - #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] - #[doc = "by the parachain manager."] - pub struct Create { - #[codec(compact)] - pub index: create::Index, - #[codec(compact)] - pub cap: create::Cap, - #[codec(compact)] - pub first_period: create::FirstPeriod, - #[codec(compact)] - pub last_period: create::LastPeriod, - #[codec(compact)] - pub end: create::End, - pub verifier: create::Verifier, - } - pub mod create { - use super::runtime_types; - pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Cap = ::core::primitive::u128; - pub type FirstPeriod = ::core::primitive::u32; - pub type LastPeriod = ::core::primitive::u32; - pub type End = ::core::primitive::u32; - pub type Verifier = - ::core::option::Option; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Create { - const PALLET: &'static str = "Crowdloan"; - const CALL: &'static str = "create"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] - #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] - pub struct Contribute { - #[codec(compact)] - pub index: contribute::Index, - #[codec(compact)] - pub value: contribute::Value, - pub signature: contribute::Signature, - } - pub mod contribute { - use super::runtime_types; - pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Value = ::core::primitive::u128; - pub type Signature = - ::core::option::Option; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Contribute { - const PALLET: &'static str = "Crowdloan"; - const CALL: &'static str = "contribute"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Withdraw full balance of a specific contributor."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - #[doc = ""] - #[doc = "The fund must be either in, or ready for, retirement. For a fund to be *in* retirement,"] - #[doc = "then the retirement flag must be set. For a fund to be ready for retirement, then:"] - #[doc = "- it must not already be in retirement;"] - #[doc = "- the amount of raised funds must be bigger than the _free_ balance of the account;"] - #[doc = "- and either:"] - #[doc = " - the block number must be at least `end`; or"] - #[doc = " - the current lease period must be greater than the fund's `last_period`."] - #[doc = ""] - #[doc = "In this case, the fund's retirement flag is set and its `end` is reset to the current"] - #[doc = "block number."] - #[doc = ""] - #[doc = "- `who`: The account whose contribution should be withdrawn."] - #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] - pub struct Withdraw { - pub who: withdraw::Who, - #[codec(compact)] - pub index: withdraw::Index, - } - pub mod withdraw { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Withdraw { - const PALLET: &'static str = "Crowdloan"; - const CALL: &'static str = "withdraw"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Automatically refund contributors of an ended crowdloan."] - #[doc = "Due to weight restrictions, this function may need to be called multiple"] - #[doc = "times to fully refund all users. We will refund `RemoveKeysLimit` users at a time."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - pub struct Refund { - #[codec(compact)] - pub index: refund::Index, - } - pub mod refund { - use super::runtime_types; - pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Refund { - const PALLET: &'static str = "Crowdloan"; - const CALL: &'static str = "refund"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] - pub struct Dissolve { - #[codec(compact)] - pub index: dissolve::Index, - } - pub mod dissolve { - use super::runtime_types; - pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Dissolve { - const PALLET: &'static str = "Crowdloan"; - const CALL: &'static str = "dissolve"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Edit the configuration for an in-progress crowdloan."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - pub struct Edit { - #[codec(compact)] - pub index: edit::Index, - #[codec(compact)] - pub cap: edit::Cap, - #[codec(compact)] - pub first_period: edit::FirstPeriod, - #[codec(compact)] - pub last_period: edit::LastPeriod, - #[codec(compact)] - pub end: edit::End, - pub verifier: edit::Verifier, - } - pub mod edit { - use super::runtime_types; - pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Cap = ::core::primitive::u128; - pub type FirstPeriod = ::core::primitive::u32; - pub type LastPeriod = ::core::primitive::u32; - pub type End = ::core::primitive::u32; - pub type Verifier = - ::core::option::Option; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Edit { - const PALLET: &'static str = "Crowdloan"; - const CALL: &'static str = "edit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Add an optional memo to an existing crowdloan contribution."] - #[doc = ""] - #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] - pub struct AddMemo { - pub index: add_memo::Index, - pub memo: add_memo::Memo, - } - pub mod add_memo { - use super::runtime_types; - pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Memo = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddMemo { - const PALLET: &'static str = "Crowdloan"; - const CALL: &'static str = "add_memo"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Poke the fund into `NewRaise`"] - #[doc = ""] - #[doc = "Origin must be Signed, and the fund has non-zero raise."] - pub struct Poke { - pub index: poke::Index, - } - pub mod poke { - use super::runtime_types; - pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Poke { - const PALLET: &'static str = "Crowdloan"; - const CALL: &'static str = "poke"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of"] - #[doc = "a user over to fund a parachain slot. It will be withdrawable when the crowdloan has"] - #[doc = "ended and the funds are unused."] - pub struct ContributeAll { - #[codec(compact)] - pub index: contribute_all::Index, - pub signature: contribute_all::Signature, - } - pub mod contribute_all { - use super::runtime_types; - pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Signature = - ::core::option::Option; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ContributeAll { - const PALLET: &'static str = "Crowdloan"; - const CALL: &'static str = "contribute_all"; - } + pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Cap = ::core::primitive::u128; + pub type FirstPeriod = ::core::primitive::u32; + pub type LastPeriod = ::core::primitive::u32; + pub type End = ::core::primitive::u32; + pub type Verifier = ::core::option::Option; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period"] - #[doc = "range."] - #[doc = ""] - #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] - #[doc = "by the parachain manager."] - pub fn create( - &self, - index: types::create::Index, - cap: types::create::Cap, - first_period: types::create::FirstPeriod, - last_period: types::create::LastPeriod, - end: types::create::End, - verifier: types::create::Verifier, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Crowdloan", - "create", - types::Create { - index, - cap, - first_period, - last_period, - end, - verifier, - }, - [ - 103u8, 223u8, 147u8, 177u8, 231u8, 94u8, 252u8, 101u8, 23u8, 49u8, - 62u8, 80u8, 63u8, 247u8, 158u8, 125u8, 61u8, 209u8, 222u8, 226u8, 68u8, - 107u8, 206u8, 202u8, 102u8, 86u8, 198u8, 150u8, 219u8, 233u8, 156u8, - 67u8, - ], - ) + impl Create { + const PALLET_NAME: &'static str = "Crowdloan"; + const CALL_NAME: &'static str = "create"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Create { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] - #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] - pub fn contribute( - &self, - index: types::contribute::Index, - value: types::contribute::Value, - signature: types::contribute::Signature, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Crowdloan", - "contribute", - types::Contribute { - index, - value, - signature, - }, - [ - 218u8, 206u8, 153u8, 122u8, 215u8, 191u8, 59u8, 203u8, 171u8, 209u8, - 54u8, 123u8, 15u8, 113u8, 171u8, 40u8, 14u8, 111u8, 99u8, 197u8, 29u8, - 89u8, 181u8, 206u8, 36u8, 240u8, 184u8, 18u8, 228u8, 127u8, 19u8, 51u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] + #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] + pub struct Contribute { + #[codec(compact)] + pub index: contribute::Index, + #[codec(compact)] + pub value: contribute::Value, + pub signature: contribute::Signature, + } + pub mod contribute { + use super::runtime_types; + pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Value = ::core::primitive::u128; + pub type Signature = + ::core::option::Option; + } + impl Contribute { + const PALLET_NAME: &'static str = "Crowdloan"; + const CALL_NAME: &'static str = "contribute"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Contribute { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Withdraw full balance of a specific contributor."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - #[doc = ""] - #[doc = "The fund must be either in, or ready for, retirement. For a fund to be *in* retirement,"] - #[doc = "then the retirement flag must be set. For a fund to be ready for retirement, then:"] - #[doc = "- it must not already be in retirement;"] - #[doc = "- the amount of raised funds must be bigger than the _free_ balance of the account;"] - #[doc = "- and either:"] - #[doc = " - the block number must be at least `end`; or"] - #[doc = " - the current lease period must be greater than the fund's `last_period`."] - #[doc = ""] - #[doc = "In this case, the fund's retirement flag is set and its `end` is reset to the current"] - #[doc = "block number."] - #[doc = ""] - #[doc = "- `who`: The account whose contribution should be withdrawn."] - #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] - pub fn withdraw( - &self, - who: types::withdraw::Who, - index: types::withdraw::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Crowdloan", - "withdraw", - types::Withdraw { who, index }, - [ - 148u8, 23u8, 138u8, 161u8, 248u8, 235u8, 138u8, 156u8, 209u8, 236u8, - 235u8, 81u8, 207u8, 212u8, 232u8, 126u8, 221u8, 46u8, 34u8, 39u8, 44u8, - 42u8, 75u8, 134u8, 12u8, 247u8, 84u8, 203u8, 48u8, 133u8, 72u8, 254u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Withdraw full balance of a specific contributor."] + #[doc = ""] + #[doc = "Origin must be signed, but can come from anyone."] + #[doc = ""] + #[doc = "The fund must be either in, or ready for, retirement. For a fund to be *in* retirement,"] + #[doc = "then the retirement flag must be set. For a fund to be ready for retirement, then:"] + #[doc = "- it must not already be in retirement;"] + #[doc = "- the amount of raised funds must be bigger than the _free_ balance of the account;"] + #[doc = "- and either:"] + #[doc = " - the block number must be at least `end`; or"] + #[doc = " - the current lease period must be greater than the fund's `last_period`."] + #[doc = ""] + #[doc = "In this case, the fund's retirement flag is set and its `end` is reset to the current"] + #[doc = "block number."] + #[doc = ""] + #[doc = "- `who`: The account whose contribution should be withdrawn."] + #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] + pub struct Withdraw { + pub who: withdraw::Who, + #[codec(compact)] + pub index: withdraw::Index, + } + pub mod withdraw { + use super::runtime_types; + pub type Who = ::subxt::utils::AccountId32; + pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl Withdraw { + const PALLET_NAME: &'static str = "Crowdloan"; + const CALL_NAME: &'static str = "withdraw"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Withdraw { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Automatically refund contributors of an ended crowdloan."] - #[doc = "Due to weight restrictions, this function may need to be called multiple"] - #[doc = "times to fully refund all users. We will refund `RemoveKeysLimit` users at a time."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - pub fn refund( - &self, - index: types::refund::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Crowdloan", - "refund", - types::Refund { index }, - [ - 245u8, 75u8, 215u8, 28u8, 141u8, 138u8, 201u8, 125u8, 21u8, 214u8, - 57u8, 23u8, 33u8, 41u8, 57u8, 227u8, 119u8, 212u8, 234u8, 227u8, 230u8, - 144u8, 249u8, 100u8, 198u8, 125u8, 106u8, 253u8, 93u8, 177u8, 247u8, - 5u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Automatically refund contributors of an ended crowdloan."] + #[doc = "Due to weight restrictions, this function may need to be called multiple"] + #[doc = "times to fully refund all users. We will refund `RemoveKeysLimit` users at a time."] + #[doc = ""] + #[doc = "Origin must be signed, but can come from anyone."] + pub struct Refund { + #[codec(compact)] + pub index: refund::Index, + } + pub mod refund { + use super::runtime_types; + pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl Refund { + const PALLET_NAME: &'static str = "Crowdloan"; + const CALL_NAME: &'static str = "refund"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Refund { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] - pub fn dissolve( - &self, - index: types::dissolve::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Crowdloan", - "dissolve", - types::Dissolve { index }, - [ - 60u8, 225u8, 93u8, 234u8, 160u8, 90u8, 185u8, 188u8, 163u8, 72u8, - 241u8, 46u8, 62u8, 176u8, 236u8, 175u8, 147u8, 95u8, 45u8, 235u8, - 253u8, 76u8, 127u8, 190u8, 149u8, 54u8, 108u8, 78u8, 149u8, 161u8, - 39u8, 14u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] + pub struct Dissolve { + #[codec(compact)] + pub index: dissolve::Index, + } + pub mod dissolve { + use super::runtime_types; + pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl Dissolve { + const PALLET_NAME: &'static str = "Crowdloan"; + const CALL_NAME: &'static str = "dissolve"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Dissolve { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Edit the configuration for an in-progress crowdloan."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - pub fn edit( - &self, - index: types::edit::Index, - cap: types::edit::Cap, - first_period: types::edit::FirstPeriod, - last_period: types::edit::LastPeriod, - end: types::edit::End, - verifier: types::edit::Verifier, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Crowdloan", - "edit", - types::Edit { - index, - cap, - first_period, - last_period, - end, - verifier, - }, - [ - 153u8, 64u8, 100u8, 70u8, 99u8, 127u8, 97u8, 231u8, 9u8, 64u8, 159u8, - 130u8, 97u8, 118u8, 163u8, 178u8, 93u8, 159u8, 203u8, 251u8, 238u8, - 116u8, 3u8, 177u8, 40u8, 153u8, 158u8, 95u8, 9u8, 129u8, 130u8, 196u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Edit the configuration for an in-progress crowdloan."] + #[doc = ""] + #[doc = "Can only be called by Root origin."] + pub struct Edit { + #[codec(compact)] + pub index: edit::Index, + #[codec(compact)] + pub cap: edit::Cap, + #[codec(compact)] + pub first_period: edit::FirstPeriod, + #[codec(compact)] + pub last_period: edit::LastPeriod, + #[codec(compact)] + pub end: edit::End, + pub verifier: edit::Verifier, + } + pub mod edit { + use super::runtime_types; + pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Cap = ::core::primitive::u128; + pub type FirstPeriod = ::core::primitive::u32; + pub type LastPeriod = ::core::primitive::u32; + pub type End = ::core::primitive::u32; + pub type Verifier = ::core::option::Option; + } + impl Edit { + const PALLET_NAME: &'static str = "Crowdloan"; + const CALL_NAME: &'static str = "edit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Edit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Add an optional memo to an existing crowdloan contribution."] - #[doc = ""] - #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] - pub fn add_memo( - &self, - index: types::add_memo::Index, - memo: types::add_memo::Memo, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Crowdloan", - "add_memo", - types::AddMemo { index, memo }, - [ - 190u8, 99u8, 225u8, 54u8, 136u8, 238u8, 210u8, 44u8, 103u8, 198u8, - 225u8, 254u8, 245u8, 12u8, 238u8, 112u8, 143u8, 169u8, 8u8, 193u8, - 29u8, 0u8, 159u8, 25u8, 112u8, 237u8, 194u8, 17u8, 111u8, 192u8, 219u8, - 50u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Add an optional memo to an existing crowdloan contribution."] + #[doc = ""] + #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] + pub struct AddMemo { + pub index: add_memo::Index, + pub memo: add_memo::Memo, + } + pub mod add_memo { + use super::runtime_types; + pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Memo = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + } + impl AddMemo { + const PALLET_NAME: &'static str = "Crowdloan"; + const CALL_NAME: &'static str = "add_memo"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AddMemo { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Poke the fund into `NewRaise`"] - #[doc = ""] - #[doc = "Origin must be Signed, and the fund has non-zero raise."] - pub fn poke( - &self, - index: types::poke::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Crowdloan", - "poke", - types::Poke { index }, - [ - 180u8, 81u8, 211u8, 12u8, 54u8, 204u8, 105u8, 118u8, 139u8, 209u8, - 182u8, 227u8, 174u8, 192u8, 64u8, 200u8, 212u8, 101u8, 3u8, 252u8, - 195u8, 110u8, 182u8, 121u8, 218u8, 193u8, 87u8, 38u8, 212u8, 151u8, - 213u8, 56u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Poke the fund into `NewRaise`"] + #[doc = ""] + #[doc = "Origin must be Signed, and the fund has non-zero raise."] + pub struct Poke { + pub index: poke::Index, + } + pub mod poke { + use super::runtime_types; + pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl Poke { + const PALLET_NAME: &'static str = "Crowdloan"; + const CALL_NAME: &'static str = "poke"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Poke { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of"] - #[doc = "a user over to fund a parachain slot. It will be withdrawable when the crowdloan has"] - #[doc = "ended and the funds are unused."] - pub fn contribute_all( - &self, - index: types::contribute_all::Index, - signature: types::contribute_all::Signature, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Crowdloan", - "contribute_all", - types::ContributeAll { index, signature }, - [ - 48u8, 210u8, 250u8, 216u8, 240u8, 112u8, 145u8, 223u8, 107u8, 58u8, - 46u8, 162u8, 17u8, 241u8, 56u8, 72u8, 122u8, 192u8, 248u8, 72u8, 3u8, - 29u8, 185u8, 12u8, 147u8, 170u8, 238u8, 50u8, 82u8, 97u8, 171u8, 23u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of"] + #[doc = "a user over to fund a parachain slot. It will be withdrawable when the crowdloan has"] + #[doc = "ended and the funds are unused."] + pub struct ContributeAll { + #[codec(compact)] + pub index: contribute_all::Index, + pub signature: contribute_all::Signature, + } + pub mod contribute_all { + use super::runtime_types; + pub type Index = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Signature = + ::core::option::Option; + } + impl ContributeAll { + const PALLET_NAME: &'static str = "Crowdloan"; + const CALL_NAME: &'static str = "contribute_all"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ContributeAll { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period"] + #[doc = "range."] + #[doc = ""] + #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] + #[doc = "by the parachain manager."] + pub fn create( + &self, + index: super::create::Index, + cap: super::create::Cap, + first_period: super::create::FirstPeriod, + last_period: super::create::LastPeriod, + end: super::create::End, + verifier: super::create::Verifier, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Crowdloan", + "create", + super::Create { + index, + cap, + first_period, + last_period, + end, + verifier, + }, + [ + 103u8, 223u8, 147u8, 177u8, 231u8, 94u8, 252u8, 101u8, 23u8, 49u8, + 62u8, 80u8, 63u8, 247u8, 158u8, 125u8, 61u8, 209u8, 222u8, 226u8, + 68u8, 107u8, 206u8, 202u8, 102u8, 86u8, 198u8, 150u8, 219u8, 233u8, + 156u8, 67u8, + ], + ) + } + #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] + #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] + pub fn contribute( + &self, + index: super::contribute::Index, + value: super::contribute::Value, + signature: super::contribute::Signature, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Crowdloan", + "contribute", + super::Contribute { + index, + value, + signature, + }, + [ + 218u8, 206u8, 153u8, 122u8, 215u8, 191u8, 59u8, 203u8, 171u8, + 209u8, 54u8, 123u8, 15u8, 113u8, 171u8, 40u8, 14u8, 111u8, 99u8, + 197u8, 29u8, 89u8, 181u8, 206u8, 36u8, 240u8, 184u8, 18u8, 228u8, + 127u8, 19u8, 51u8, + ], + ) + } + #[doc = "Withdraw full balance of a specific contributor."] + #[doc = ""] + #[doc = "Origin must be signed, but can come from anyone."] + #[doc = ""] + #[doc = "The fund must be either in, or ready for, retirement. For a fund to be *in* retirement,"] + #[doc = "then the retirement flag must be set. For a fund to be ready for retirement, then:"] + #[doc = "- it must not already be in retirement;"] + #[doc = "- the amount of raised funds must be bigger than the _free_ balance of the account;"] + #[doc = "- and either:"] + #[doc = " - the block number must be at least `end`; or"] + #[doc = " - the current lease period must be greater than the fund's `last_period`."] + #[doc = ""] + #[doc = "In this case, the fund's retirement flag is set and its `end` is reset to the current"] + #[doc = "block number."] + #[doc = ""] + #[doc = "- `who`: The account whose contribution should be withdrawn."] + #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] + pub fn withdraw( + &self, + who: super::withdraw::Who, + index: super::withdraw::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Crowdloan", + "withdraw", + super::Withdraw { who, index }, + [ + 148u8, 23u8, 138u8, 161u8, 248u8, 235u8, 138u8, 156u8, 209u8, + 236u8, 235u8, 81u8, 207u8, 212u8, 232u8, 126u8, 221u8, 46u8, 34u8, + 39u8, 44u8, 42u8, 75u8, 134u8, 12u8, 247u8, 84u8, 203u8, 48u8, + 133u8, 72u8, 254u8, + ], + ) + } + #[doc = "Automatically refund contributors of an ended crowdloan."] + #[doc = "Due to weight restrictions, this function may need to be called multiple"] + #[doc = "times to fully refund all users. We will refund `RemoveKeysLimit` users at a time."] + #[doc = ""] + #[doc = "Origin must be signed, but can come from anyone."] + pub fn refund( + &self, + index: super::refund::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Crowdloan", + "refund", + super::Refund { index }, + [ + 245u8, 75u8, 215u8, 28u8, 141u8, 138u8, 201u8, 125u8, 21u8, 214u8, + 57u8, 23u8, 33u8, 41u8, 57u8, 227u8, 119u8, 212u8, 234u8, 227u8, + 230u8, 144u8, 249u8, 100u8, 198u8, 125u8, 106u8, 253u8, 93u8, + 177u8, 247u8, 5u8, + ], + ) + } + #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] + pub fn dissolve( + &self, + index: super::dissolve::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Crowdloan", + "dissolve", + super::Dissolve { index }, + [ + 60u8, 225u8, 93u8, 234u8, 160u8, 90u8, 185u8, 188u8, 163u8, 72u8, + 241u8, 46u8, 62u8, 176u8, 236u8, 175u8, 147u8, 95u8, 45u8, 235u8, + 253u8, 76u8, 127u8, 190u8, 149u8, 54u8, 108u8, 78u8, 149u8, 161u8, + 39u8, 14u8, + ], + ) + } + #[doc = "Edit the configuration for an in-progress crowdloan."] + #[doc = ""] + #[doc = "Can only be called by Root origin."] + pub fn edit( + &self, + index: super::edit::Index, + cap: super::edit::Cap, + first_period: super::edit::FirstPeriod, + last_period: super::edit::LastPeriod, + end: super::edit::End, + verifier: super::edit::Verifier, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Crowdloan", + "edit", + super::Edit { + index, + cap, + first_period, + last_period, + end, + verifier, + }, + [ + 153u8, 64u8, 100u8, 70u8, 99u8, 127u8, 97u8, 231u8, 9u8, 64u8, + 159u8, 130u8, 97u8, 118u8, 163u8, 178u8, 93u8, 159u8, 203u8, 251u8, + 238u8, 116u8, 3u8, 177u8, 40u8, 153u8, 158u8, 95u8, 9u8, 129u8, + 130u8, 196u8, + ], + ) + } + #[doc = "Add an optional memo to an existing crowdloan contribution."] + #[doc = ""] + #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] + pub fn add_memo( + &self, + index: super::add_memo::Index, + memo: super::add_memo::Memo, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Crowdloan", + "add_memo", + super::AddMemo { index, memo }, + [ + 190u8, 99u8, 225u8, 54u8, 136u8, 238u8, 210u8, 44u8, 103u8, 198u8, + 225u8, 254u8, 245u8, 12u8, 238u8, 112u8, 143u8, 169u8, 8u8, 193u8, + 29u8, 0u8, 159u8, 25u8, 112u8, 237u8, 194u8, 17u8, 111u8, 192u8, + 219u8, 50u8, + ], + ) + } + #[doc = "Poke the fund into `NewRaise`"] + #[doc = ""] + #[doc = "Origin must be Signed, and the fund has non-zero raise."] + pub fn poke( + &self, + index: super::poke::Index, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Crowdloan", + "poke", + super::Poke { index }, + [ + 180u8, 81u8, 211u8, 12u8, 54u8, 204u8, 105u8, 118u8, 139u8, 209u8, + 182u8, 227u8, 174u8, 192u8, 64u8, 200u8, 212u8, 101u8, 3u8, 252u8, + 195u8, 110u8, 182u8, 121u8, 218u8, 193u8, 87u8, 38u8, 212u8, 151u8, + 213u8, 56u8, + ], + ) + } + #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of"] + #[doc = "a user over to fund a parachain slot. It will be withdrawable when the crowdloan has"] + #[doc = "ended and the funds are unused."] + pub fn contribute_all( + &self, + index: super::contribute_all::Index, + signature: super::contribute_all::Signature, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Crowdloan", + "contribute_all", + super::ContributeAll { index, signature }, + [ + 48u8, 210u8, 250u8, 216u8, 240u8, 112u8, 145u8, 223u8, 107u8, 58u8, + 46u8, 162u8, 17u8, 241u8, 56u8, 72u8, 122u8, 192u8, 248u8, 72u8, + 3u8, 29u8, 185u8, 12u8, 147u8, 170u8, 238u8, 50u8, 82u8, 97u8, + 171u8, 23u8, + ], + ) + } } } } @@ -40451,12 +41401,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Create a new crowdloaning campaign."] pub struct Created { pub para_id: created::ParaId, @@ -40465,17 +41415,22 @@ pub mod api { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Created { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Created"; + impl Created { + const PALLET_NAME: &'static str = "Crowdloan"; + const EVENT_NAME: &'static str = "Created"; + } + impl ::subxt::events::DecodeAsEvent for Created { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contributed to a crowd sale."] pub struct Contributed { pub who: contributed::Who, @@ -40484,21 +41439,26 @@ pub mod api { } pub mod contributed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type FundIndex = runtime_types::polkadot_parachain_primitives::primitives::Id; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Contributed { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Contributed"; + impl Contributed { + const PALLET_NAME: &'static str = "Crowdloan"; + const EVENT_NAME: &'static str = "Contributed"; + } + impl ::subxt::events::DecodeAsEvent for Contributed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Withdrew full balance of a contributor."] pub struct Withdrew { pub who: withdrew::Who, @@ -40507,21 +41467,26 @@ pub mod api { } pub mod withdrew { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type FundIndex = runtime_types::polkadot_parachain_primitives::primitives::Id; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Withdrew { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Withdrew"; + impl Withdrew { + const PALLET_NAME: &'static str = "Crowdloan"; + const EVENT_NAME: &'static str = "Withdrew"; + } + impl ::subxt::events::DecodeAsEvent for Withdrew { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The loans in a fund have been partially dissolved, i.e. there are some left"] #[doc = "over child keys that still need to be killed."] pub struct PartiallyRefunded { @@ -40531,17 +41496,22 @@ pub mod api { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PartiallyRefunded { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "PartiallyRefunded"; + impl PartiallyRefunded { + const PALLET_NAME: &'static str = "Crowdloan"; + const EVENT_NAME: &'static str = "PartiallyRefunded"; + } + impl ::subxt::events::DecodeAsEvent for PartiallyRefunded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "All loans in a fund have been refunded."] pub struct AllRefunded { pub para_id: all_refunded::ParaId, @@ -40550,17 +41520,22 @@ pub mod api { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AllRefunded { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "AllRefunded"; + impl AllRefunded { + const PALLET_NAME: &'static str = "Crowdloan"; + const EVENT_NAME: &'static str = "AllRefunded"; + } + impl ::subxt::events::DecodeAsEvent for AllRefunded { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Fund is dissolved."] pub struct Dissolved { pub para_id: dissolved::ParaId, @@ -40569,17 +41544,22 @@ pub mod api { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Dissolved { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Dissolved"; + impl Dissolved { + const PALLET_NAME: &'static str = "Crowdloan"; + const EVENT_NAME: &'static str = "Dissolved"; + } + impl ::subxt::events::DecodeAsEvent for Dissolved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The result of trying to submit a new bid to the Slots pallet."] pub struct HandleBidResult { pub para_id: handle_bid_result::ParaId, @@ -40591,17 +41571,22 @@ pub mod api { pub type Result = ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for HandleBidResult { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "HandleBidResult"; + impl HandleBidResult { + const PALLET_NAME: &'static str = "Crowdloan"; + const EVENT_NAME: &'static str = "HandleBidResult"; + } + impl ::subxt::events::DecodeAsEvent for HandleBidResult { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The configuration to a crowdloan has been edited."] pub struct Edited { pub para_id: edited::ParaId, @@ -40610,17 +41595,22 @@ pub mod api { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Edited { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Edited"; + impl Edited { + const PALLET_NAME: &'static str = "Crowdloan"; + const EVENT_NAME: &'static str = "Edited"; + } + impl ::subxt::events::DecodeAsEvent for Edited { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A memo has been updated."] pub struct MemoUpdated { pub who: memo_updated::Who, @@ -40629,21 +41619,26 @@ pub mod api { } pub mod memo_updated { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Memo = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Memo = ::subxt::alloc::vec::Vec<::core::primitive::u8>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemoUpdated { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "MemoUpdated"; + impl MemoUpdated { + const PALLET_NAME: &'static str = "Crowdloan"; + const EVENT_NAME: &'static str = "MemoUpdated"; + } + impl ::subxt::events::DecodeAsEvent for MemoUpdated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A parachain has been moved to `NewRaise`"] pub struct AddedToNewRaise { pub para_id: added_to_new_raise::ParaId, @@ -40652,9 +41647,14 @@ pub mod api { use super::runtime_types; pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AddedToNewRaise { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "AddedToNewRaise"; + impl AddedToNewRaise { + const PALLET_NAME: &'static str = "Crowdloan"; + const EVENT_NAME: &'static str = "AddedToNewRaise"; + } + impl ::subxt::events::DecodeAsEvent for AddedToNewRaise { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -40665,12 +41665,12 @@ pub mod api { #[doc = " Info on all of the funds."] pub fn funds( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (funds::Param0,), - funds::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (funds::input::Param0,), + funds::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Crowdloan", "Funds", [ @@ -40684,12 +41684,9 @@ pub mod api { #[doc = " in order to determine which funds should submit new or updated bids."] pub fn new_raise( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - new_raise::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), new_raise::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Crowdloan", "NewRaise", [ @@ -40703,12 +41700,9 @@ pub mod api { #[doc = " The number of auctions that have entered into their ending period so far."] pub fn endings_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - endings_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), endings_count::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Crowdloan", "EndingsCount", [ @@ -40721,12 +41715,9 @@ pub mod api { #[doc = " Tracker for the next available fund index"] pub fn next_fund_index( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - next_fund_index::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), next_fund_index::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Crowdloan", "NextFundIndex", [ @@ -40740,42 +41731,42 @@ pub mod api { pub mod funds { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::polkadot_runtime_common::crowdloan::FundInfo< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ::core::primitive::u32, - >; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = runtime_types::polkadot_runtime_common::crowdloan::FundInfo< + ::subxt::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::core::primitive::u32, + >; } pub mod new_raise { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; } + pub type Output = ::subxt::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; } pub mod endings_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod next_fund_index { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } } pub mod constants { @@ -40786,10 +41777,9 @@ pub mod api { #[doc = " `PalletId(*b\"py/cfund\")`"] pub fn pallet_id( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress + { + ::subxt::constants::StaticAddress::new_static( "Crowdloan", "PalletId", [ @@ -40803,10 +41793,8 @@ pub mod api { #[doc = " at least `ExistentialDeposit`."] pub fn min_contribution( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u128> { + ::subxt::constants::StaticAddress::new_static( "Crowdloan", "MinContribution", [ @@ -40819,10 +41807,8 @@ pub mod api { #[doc = " Max number of storage keys to remove per extrinsic call."] pub fn remove_keys_limit( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Crowdloan", "RemoveKeysLimit", [ @@ -40846,224 +41832,227 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Request the configuration to be updated with the specified number of cores. Warning:"] + #[doc = "Since this only schedules a configuration update, it takes two sessions to come into"] + #[doc = "effect."] + #[doc = ""] + #[doc = "- `origin`: Root or the Coretime Chain"] + #[doc = "- `count`: total number of cores"] + pub struct RequestCoreCount { + pub count: request_core_count::Count, + } + pub mod request_core_count { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Request the configuration to be updated with the specified number of cores. Warning:"] - #[doc = "Since this only schedules a configuration update, it takes two sessions to come into"] - #[doc = "effect."] - #[doc = ""] - #[doc = "- `origin`: Root or the Coretime Chain"] - #[doc = "- `count`: total number of cores"] - pub struct RequestCoreCount { - pub count: request_core_count::Count, - } - pub mod request_core_count { - use super::runtime_types; - pub type Count = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RequestCoreCount { - const PALLET: &'static str = "Coretime"; - const CALL: &'static str = "request_core_count"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Request to claim the instantaneous coretime sales revenue starting from the block it was"] - #[doc = "last claimed until and up to the block specified. The claimed amount value is sent back"] - #[doc = "to the Coretime chain in a `notify_revenue` message. At the same time, the amount is"] - #[doc = "teleported to the Coretime chain."] - pub struct RequestRevenueAt { - pub when: request_revenue_at::When, - } - pub mod request_revenue_at { - use super::runtime_types; - pub type When = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RequestRevenueAt { - const PALLET: &'static str = "Coretime"; - const CALL: &'static str = "request_revenue_at"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CreditAccount { - pub who: credit_account::Who, - pub amount: credit_account::Amount, - } - pub mod credit_account { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreditAccount { - const PALLET: &'static str = "Coretime"; - const CALL: &'static str = "credit_account"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Receive instructions from the `ExternalBrokerOrigin`, detailing how a specific core is"] - #[doc = "to be used."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "-`origin`: The `ExternalBrokerOrigin`, assumed to be the coretime chain."] - #[doc = "-`core`: The core that should be scheduled."] - #[doc = "-`begin`: The starting blockheight of the instruction."] - #[doc = "-`assignment`: How the blockspace should be utilised."] - #[doc = "-`end_hint`: An optional hint as to when this particular set of instructions will end."] - pub struct AssignCore { - pub core: assign_core::Core, - pub begin: assign_core::Begin, - pub assignment: assign_core::Assignment, - pub end_hint: assign_core::EndHint, - } - pub mod assign_core { - use super::runtime_types; - pub type Core = ::core::primitive::u16; - pub type Begin = ::core::primitive::u32; - pub type Assignment = ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::pallet_broker::coretime_interface::CoreAssignment, - runtime_types::polkadot_runtime_parachains::assigner_coretime::PartsOf57600, - )>; - pub type EndHint = ::core::option::Option<::core::primitive::u32>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AssignCore { - const PALLET: &'static str = "Coretime"; - const CALL: &'static str = "assign_core"; - } + pub type Count = ::core::primitive::u16; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Request the configuration to be updated with the specified number of cores. Warning:"] - #[doc = "Since this only schedules a configuration update, it takes two sessions to come into"] - #[doc = "effect."] - #[doc = ""] - #[doc = "- `origin`: Root or the Coretime Chain"] - #[doc = "- `count`: total number of cores"] - pub fn request_core_count( - &self, - count: types::request_core_count::Count, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Coretime", - "request_core_count", - types::RequestCoreCount { count }, - [ - 8u8, 225u8, 74u8, 162u8, 188u8, 3u8, 191u8, 45u8, 167u8, 21u8, 227u8, - 200u8, 65u8, 221u8, 49u8, 212u8, 12u8, 229u8, 160u8, 178u8, 136u8, - 13u8, 131u8, 42u8, 220u8, 3u8, 151u8, 241u8, 210u8, 158u8, 218u8, - 217u8, - ], - ) + impl RequestCoreCount { + const PALLET_NAME: &'static str = "Coretime"; + const CALL_NAME: &'static str = "request_core_count"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RequestCoreCount { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Request to claim the instantaneous coretime sales revenue starting from the block it was"] - #[doc = "last claimed until and up to the block specified. The claimed amount value is sent back"] - #[doc = "to the Coretime chain in a `notify_revenue` message. At the same time, the amount is"] - #[doc = "teleported to the Coretime chain."] - pub fn request_revenue_at( - &self, - when: types::request_revenue_at::When, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Coretime", - "request_revenue_at", - types::RequestRevenueAt { when }, - [ - 177u8, 11u8, 232u8, 159u8, 238u8, 12u8, 176u8, 8u8, 83u8, 20u8, 36u8, - 223u8, 1u8, 202u8, 138u8, 236u8, 120u8, 161u8, 17u8, 161u8, 112u8, - 108u8, 79u8, 35u8, 141u8, 123u8, 166u8, 107u8, 220u8, 139u8, 167u8, - 67u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Request to claim the instantaneous coretime sales revenue starting from the block it was"] + #[doc = "last claimed until and up to the block specified. The claimed amount value is sent back"] + #[doc = "to the Coretime chain in a `notify_revenue` message. At the same time, the amount is"] + #[doc = "teleported to the Coretime chain."] + pub struct RequestRevenueAt { + pub when: request_revenue_at::When, + } + pub mod request_revenue_at { + use super::runtime_types; + pub type When = ::core::primitive::u32; + } + impl RequestRevenueAt { + const PALLET_NAME: &'static str = "Coretime"; + const CALL_NAME: &'static str = "request_revenue_at"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RequestRevenueAt { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub fn credit_account( - &self, - who: types::credit_account::Who, - amount: types::credit_account::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Coretime", - "credit_account", - types::CreditAccount { who, amount }, - [ - 218u8, 143u8, 215u8, 50u8, 177u8, 173u8, 184u8, 29u8, 216u8, 40u8, - 183u8, 87u8, 189u8, 25u8, 102u8, 105u8, 225u8, 164u8, 193u8, 113u8, - 128u8, 86u8, 127u8, 152u8, 246u8, 149u8, 74u8, 163u8, 88u8, 193u8, - 43u8, 94u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct CreditAccount { + pub who: credit_account::Who, + pub amount: credit_account::Amount, + } + pub mod credit_account { + use super::runtime_types; + pub type Who = ::subxt::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl CreditAccount { + const PALLET_NAME: &'static str = "Coretime"; + const CALL_NAME: &'static str = "credit_account"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for CreditAccount { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Receive instructions from the `ExternalBrokerOrigin`, detailing how a specific core is"] - #[doc = "to be used."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "-`origin`: The `ExternalBrokerOrigin`, assumed to be the coretime chain."] - #[doc = "-`core`: The core that should be scheduled."] - #[doc = "-`begin`: The starting blockheight of the instruction."] - #[doc = "-`assignment`: How the blockspace should be utilised."] - #[doc = "-`end_hint`: An optional hint as to when this particular set of instructions will end."] - pub fn assign_core( - &self, - core: types::assign_core::Core, - begin: types::assign_core::Begin, - assignment: types::assign_core::Assignment, - end_hint: types::assign_core::EndHint, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Coretime", - "assign_core", - types::AssignCore { - core, - begin, - assignment, - end_hint, - }, - [ - 113u8, 133u8, 153u8, 202u8, 209u8, 53u8, 168u8, 214u8, 153u8, 232u8, - 170u8, 35u8, 63u8, 87u8, 5u8, 108u8, 188u8, 55u8, 111u8, 55u8, 22u8, - 1u8, 190u8, 216u8, 233u8, 185u8, 135u8, 172u8, 15u8, 254u8, 91u8, 92u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Receive instructions from the `ExternalBrokerOrigin`, detailing how a specific core is"] + #[doc = "to be used."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "-`origin`: The `ExternalBrokerOrigin`, assumed to be the coretime chain."] + #[doc = "-`core`: The core that should be scheduled."] + #[doc = "-`begin`: The starting blockheight of the instruction."] + #[doc = "-`assignment`: How the blockspace should be utilised."] + #[doc = "-`end_hint`: An optional hint as to when this particular set of instructions will end."] + pub struct AssignCore { + pub core: assign_core::Core, + pub begin: assign_core::Begin, + pub assignment: assign_core::Assignment, + pub end_hint: assign_core::EndHint, + } + pub mod assign_core { + use super::runtime_types; + pub type Core = ::core::primitive::u16; + pub type Begin = ::core::primitive::u32; + pub type Assignment = ::subxt::alloc::vec::Vec<( + runtime_types::pallet_broker::coretime_interface::CoreAssignment, + runtime_types::polkadot_runtime_parachains::assigner_coretime::PartsOf57600, + )>; + pub type EndHint = ::core::option::Option<::core::primitive::u32>; + } + impl AssignCore { + const PALLET_NAME: &'static str = "Coretime"; + const CALL_NAME: &'static str = "assign_core"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AssignCore { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Request the configuration to be updated with the specified number of cores. Warning:"] + #[doc = "Since this only schedules a configuration update, it takes two sessions to come into"] + #[doc = "effect."] + #[doc = ""] + #[doc = "- `origin`: Root or the Coretime Chain"] + #[doc = "- `count`: total number of cores"] + pub fn request_core_count( + &self, + count: super::request_core_count::Count, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Coretime", + "request_core_count", + super::RequestCoreCount { count }, + [ + 8u8, 225u8, 74u8, 162u8, 188u8, 3u8, 191u8, 45u8, 167u8, 21u8, + 227u8, 200u8, 65u8, 221u8, 49u8, 212u8, 12u8, 229u8, 160u8, 178u8, + 136u8, 13u8, 131u8, 42u8, 220u8, 3u8, 151u8, 241u8, 210u8, 158u8, + 218u8, 217u8, + ], + ) + } + #[doc = "Request to claim the instantaneous coretime sales revenue starting from the block it was"] + #[doc = "last claimed until and up to the block specified. The claimed amount value is sent back"] + #[doc = "to the Coretime chain in a `notify_revenue` message. At the same time, the amount is"] + #[doc = "teleported to the Coretime chain."] + pub fn request_revenue_at( + &self, + when: super::request_revenue_at::When, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Coretime", + "request_revenue_at", + super::RequestRevenueAt { when }, + [ + 177u8, 11u8, 232u8, 159u8, 238u8, 12u8, 176u8, 8u8, 83u8, 20u8, + 36u8, 223u8, 1u8, 202u8, 138u8, 236u8, 120u8, 161u8, 17u8, 161u8, + 112u8, 108u8, 79u8, 35u8, 141u8, 123u8, 166u8, 107u8, 220u8, 139u8, + 167u8, 67u8, + ], + ) + } + pub fn credit_account( + &self, + who: super::credit_account::Who, + amount: super::credit_account::Amount, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Coretime", + "credit_account", + super::CreditAccount { who, amount }, + [ + 218u8, 143u8, 215u8, 50u8, 177u8, 173u8, 184u8, 29u8, 216u8, 40u8, + 183u8, 87u8, 189u8, 25u8, 102u8, 105u8, 225u8, 164u8, 193u8, 113u8, + 128u8, 86u8, 127u8, 152u8, 246u8, 149u8, 74u8, 163u8, 88u8, 193u8, + 43u8, 94u8, + ], + ) + } + #[doc = "Receive instructions from the `ExternalBrokerOrigin`, detailing how a specific core is"] + #[doc = "to be used."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "-`origin`: The `ExternalBrokerOrigin`, assumed to be the coretime chain."] + #[doc = "-`core`: The core that should be scheduled."] + #[doc = "-`begin`: The starting blockheight of the instruction."] + #[doc = "-`assignment`: How the blockspace should be utilised."] + #[doc = "-`end_hint`: An optional hint as to when this particular set of instructions will end."] + pub fn assign_core( + &self, + core: super::assign_core::Core, + begin: super::assign_core::Begin, + assignment: super::assign_core::Assignment, + end_hint: super::assign_core::EndHint, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Coretime", + "assign_core", + super::AssignCore { + core, + begin, + assignment, + end_hint, + }, + [ + 113u8, 133u8, 153u8, 202u8, 209u8, 53u8, 168u8, 214u8, 153u8, + 232u8, 170u8, 35u8, 63u8, 87u8, 5u8, 108u8, 188u8, 55u8, 111u8, + 55u8, 22u8, 1u8, 190u8, 216u8, 233u8, 185u8, 135u8, 172u8, 15u8, + 254u8, 91u8, 92u8, + ], + ) + } } } } @@ -41072,12 +42061,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The broker chain has asked for revenue information for a specific block."] pub struct RevenueInfoRequested { pub when: revenue_info_requested::When, @@ -41086,17 +42075,22 @@ pub mod api { use super::runtime_types; pub type When = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RevenueInfoRequested { - const PALLET: &'static str = "Coretime"; - const EVENT: &'static str = "RevenueInfoRequested"; + impl RevenueInfoRequested { + const PALLET_NAME: &'static str = "Coretime"; + const EVENT_NAME: &'static str = "RevenueInfoRequested"; + } + impl ::subxt::events::DecodeAsEvent for RevenueInfoRequested { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A core has received a new assignment from the broker chain."] pub struct CoreAssigned { pub core: core_assigned::Core, @@ -41105,9 +42099,14 @@ pub mod api { use super::runtime_types; pub type Core = runtime_types::polkadot_primitives::v9::CoreIndex; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CoreAssigned { - const PALLET: &'static str = "Coretime"; - const EVENT: &'static str = "CoreAssigned"; + impl CoreAssigned { + const PALLET_NAME: &'static str = "Coretime"; + const EVENT_NAME: &'static str = "CoreAssigned"; + } + impl ::subxt::events::DecodeAsEvent for CoreAssigned { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod constants { @@ -41117,10 +42116,8 @@ pub mod api { #[doc = " The ParaId of the coretime chain."] pub fn broker_id( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Coretime", "BrokerId", [ @@ -41134,10 +42131,10 @@ pub mod api { #[doc = " The coretime chain pot location."] pub fn broker_pot_location( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< runtime_types::staging_xcm::v5::junctions::Junctions, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "Coretime", "BrokerPotLocation", [ @@ -41161,1844 +42158,1849 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Allows root to set a cursor to forcefully start, stop or forward the migration process."] + #[doc = ""] + #[doc = "Should normally not be needed and is only in place as emergency measure. Note that"] + #[doc = "restarting the migration process in this manner will not call the"] + #[doc = "[`MigrationStatusHandler::started`] hook or emit an `UpgradeStarted` event."] + pub struct ForceSetCursor { + pub cursor: force_set_cursor::Cursor, + } + pub mod force_set_cursor { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allows root to set a cursor to forcefully start, stop or forward the migration process."] - #[doc = ""] - #[doc = "Should normally not be needed and is only in place as emergency measure. Note that"] - #[doc = "restarting the migration process in this manner will not call the"] - #[doc = "[`MigrationStatusHandler::started`] hook or emit an `UpgradeStarted` event."] - pub struct ForceSetCursor { - pub cursor: force_set_cursor::Cursor, - } - pub mod force_set_cursor { - use super::runtime_types; - pub type Cursor = ::core::option::Option< - runtime_types::pallet_migrations::MigrationCursor< - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ::core::primitive::u32, - >, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetCursor { - const PALLET: &'static str = "MultiBlockMigrations"; - const CALL: &'static str = "force_set_cursor"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allows root to set an active cursor to forcefully start/forward the migration process."] - #[doc = ""] - #[doc = "This is an edge-case version of [`Self::force_set_cursor`] that allows to set the"] - #[doc = "`started_at` value to the next block number. Otherwise this would not be possible, since"] - #[doc = "`force_set_cursor` takes an absolute block number. Setting `started_at` to `None`"] - #[doc = "indicates that the current block number plus one should be used."] - pub struct ForceSetActiveCursor { - pub index: force_set_active_cursor::Index, - pub inner_cursor: force_set_active_cursor::InnerCursor, - pub started_at: force_set_active_cursor::StartedAt, - } - pub mod force_set_active_cursor { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type InnerCursor = ::core::option::Option< - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - >; - pub type StartedAt = ::core::option::Option<::core::primitive::u32>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetActiveCursor { - const PALLET: &'static str = "MultiBlockMigrations"; - const CALL: &'static str = "force_set_active_cursor"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Forces the onboarding of the migrations."] - #[doc = ""] - #[doc = "This process happens automatically on a runtime upgrade. It is in place as an emergency"] - #[doc = "measurement. The cursor needs to be `None` for this to succeed."] - pub struct ForceOnboardMbms; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceOnboardMbms { - const PALLET: &'static str = "MultiBlockMigrations"; - const CALL: &'static str = "force_onboard_mbms"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clears the `Historic` set."] - #[doc = ""] - #[doc = "`map_cursor` must be set to the last value that was returned by the"] - #[doc = "`HistoricCleared` event. The first time `None` can be used. `limit` must be chosen in a"] - #[doc = "way that will result in a sensible weight."] - pub struct ClearHistoric { - pub selector: clear_historic::Selector, - } - pub mod clear_historic { - use super::runtime_types; - pub type Selector = runtime_types::pallet_migrations::HistoricCleanupSelector< + pub type Cursor = ::core::option::Option< + runtime_types::pallet_migrations::MigrationCursor< runtime_types::bounded_collections::bounded_vec::BoundedVec< ::core::primitive::u8, >, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClearHistoric { - const PALLET: &'static str = "MultiBlockMigrations"; - const CALL: &'static str = "clear_historic"; - } + ::core::primitive::u32, + >, + >; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Allows root to set a cursor to forcefully start, stop or forward the migration process."] - #[doc = ""] - #[doc = "Should normally not be needed and is only in place as emergency measure. Note that"] - #[doc = "restarting the migration process in this manner will not call the"] - #[doc = "[`MigrationStatusHandler::started`] hook or emit an `UpgradeStarted` event."] - pub fn force_set_cursor( - &self, - cursor: types::force_set_cursor::Cursor, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MultiBlockMigrations", - "force_set_cursor", - types::ForceSetCursor { cursor }, - [ - 19u8, 44u8, 153u8, 100u8, 215u8, 46u8, 69u8, 184u8, 161u8, 215u8, 80u8, - 229u8, 65u8, 166u8, 63u8, 102u8, 97u8, 214u8, 112u8, 219u8, 227u8, - 213u8, 16u8, 50u8, 246u8, 54u8, 69u8, 172u8, 105u8, 216u8, 197u8, - 184u8, - ], - ) - } - #[doc = "Allows root to set an active cursor to forcefully start/forward the migration process."] - #[doc = ""] - #[doc = "This is an edge-case version of [`Self::force_set_cursor`] that allows to set the"] - #[doc = "`started_at` value to the next block number. Otherwise this would not be possible, since"] - #[doc = "`force_set_cursor` takes an absolute block number. Setting `started_at` to `None`"] - #[doc = "indicates that the current block number plus one should be used."] - pub fn force_set_active_cursor( - &self, - index: types::force_set_active_cursor::Index, - inner_cursor: types::force_set_active_cursor::InnerCursor, - started_at: types::force_set_active_cursor::StartedAt, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MultiBlockMigrations", - "force_set_active_cursor", - types::ForceSetActiveCursor { - index, - inner_cursor, - started_at, - }, - [ - 171u8, 245u8, 214u8, 230u8, 7u8, 61u8, 186u8, 60u8, 43u8, 235u8, 110u8, - 188u8, 30u8, 215u8, 48u8, 194u8, 249u8, 215u8, 224u8, 229u8, 89u8, - 179u8, 189u8, 70u8, 62u8, 162u8, 245u8, 199u8, 3u8, 234u8, 154u8, 9u8, - ], - ) - } - #[doc = "Forces the onboarding of the migrations."] - #[doc = ""] - #[doc = "This process happens automatically on a runtime upgrade. It is in place as an emergency"] - #[doc = "measurement. The cursor needs to be `None` for this to succeed."] - pub fn force_onboard_mbms( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MultiBlockMigrations", - "force_onboard_mbms", - types::ForceOnboardMbms {}, - [ - 201u8, 148u8, 226u8, 128u8, 88u8, 120u8, 31u8, 159u8, 78u8, 5u8, 148u8, - 189u8, 71u8, 195u8, 136u8, 24u8, 131u8, 107u8, 56u8, 17u8, 26u8, 25u8, - 189u8, 102u8, 220u8, 148u8, 44u8, 92u8, 79u8, 232u8, 236u8, 86u8, - ], - ) - } - #[doc = "Clears the `Historic` set."] - #[doc = ""] - #[doc = "`map_cursor` must be set to the last value that was returned by the"] - #[doc = "`HistoricCleared` event. The first time `None` can be used. `limit` must be chosen in a"] - #[doc = "way that will result in a sensible weight."] - pub fn clear_historic( - &self, - selector: types::clear_historic::Selector, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MultiBlockMigrations", - "clear_historic", - types::ClearHistoric { selector }, - [ - 160u8, 68u8, 166u8, 164u8, 115u8, 190u8, 214u8, 167u8, 171u8, 238u8, - 176u8, 191u8, 30u8, 228u8, 237u8, 125u8, 183u8, 147u8, 186u8, 246u8, - 59u8, 186u8, 40u8, 193u8, 13u8, 252u8, 99u8, 199u8, 207u8, 149u8, 20u8, - 95u8, - ], - ) + impl ForceSetCursor { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const CALL_NAME: &'static str = "force_set_cursor"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceSetCursor { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_migrations::pallet::Event; - pub mod events { - use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A Runtime upgrade started."] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Allows root to set an active cursor to forcefully start/forward the migration process."] #[doc = ""] - #[doc = "Its end is indicated by `UpgradeCompleted` or `UpgradeFailed`."] - pub struct UpgradeStarted { - pub migrations: upgrade_started::Migrations, + #[doc = "This is an edge-case version of [`Self::force_set_cursor`] that allows to set the"] + #[doc = "`started_at` value to the next block number. Otherwise this would not be possible, since"] + #[doc = "`force_set_cursor` takes an absolute block number. Setting `started_at` to `None`"] + #[doc = "indicates that the current block number plus one should be used."] + pub struct ForceSetActiveCursor { + pub index: force_set_active_cursor::Index, + pub inner_cursor: force_set_active_cursor::InnerCursor, + pub started_at: force_set_active_cursor::StartedAt, } - pub mod upgrade_started { + pub mod force_set_active_cursor { use super::runtime_types; - pub type Migrations = ::core::primitive::u32; + pub type Index = ::core::primitive::u32; + pub type InnerCursor = ::core::option::Option< + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >; + pub type StartedAt = ::core::option::Option<::core::primitive::u32>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UpgradeStarted { - const PALLET: &'static str = "MultiBlockMigrations"; - const EVENT: &'static str = "UpgradeStarted"; + impl ForceSetActiveCursor { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const CALL_NAME: &'static str = "force_set_active_cursor"; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The current runtime upgrade completed."] - #[doc = ""] - #[doc = "This implies that all of its migrations completed successfully as well."] - pub struct UpgradeCompleted; - impl ::subxt::ext::subxt_core::events::StaticEvent for UpgradeCompleted { - const PALLET: &'static str = "MultiBlockMigrations"; - const EVENT: &'static str = "UpgradeCompleted"; + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceSetActiveCursor { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Runtime upgrade failed."] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Forces the onboarding of the migrations."] #[doc = ""] - #[doc = "This is very bad and will require governance intervention."] - pub struct UpgradeFailed; - impl ::subxt::ext::subxt_core::events::StaticEvent for UpgradeFailed { - const PALLET: &'static str = "MultiBlockMigrations"; - const EVENT: &'static str = "UpgradeFailed"; + #[doc = "This process happens automatically on a runtime upgrade. It is in place as an emergency"] + #[doc = "measurement. The cursor needs to be `None` for this to succeed."] + pub struct ForceOnboardMbms; + impl ForceOnboardMbms { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const CALL_NAME: &'static str = "force_onboard_mbms"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceOnboardMbms { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A migration was skipped since it was already executed in the past."] - pub struct MigrationSkipped { - pub index: migration_skipped::Index, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Clears the `Historic` set."] + #[doc = ""] + #[doc = "`map_cursor` must be set to the last value that was returned by the"] + #[doc = "`HistoricCleared` event. The first time `None` can be used. `limit` must be chosen in a"] + #[doc = "way that will result in a sensible weight."] + pub struct ClearHistoric { + pub selector: clear_historic::Selector, } - pub mod migration_skipped { + pub mod clear_historic { use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MigrationSkipped { - const PALLET: &'static str = "MultiBlockMigrations"; - const EVENT: &'static str = "MigrationSkipped"; + pub type Selector = runtime_types::pallet_migrations::HistoricCleanupSelector< + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A migration progressed."] - pub struct MigrationAdvanced { - pub index: migration_advanced::Index, - pub took: migration_advanced::Took, + impl ClearHistoric { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const CALL_NAME: &'static str = "clear_historic"; } - pub mod migration_advanced { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Took = ::core::primitive::u32; + impl ::subxt::extrinsics::DecodeAsExtrinsic for ClearHistoric { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } } - impl ::subxt::ext::subxt_core::events::StaticEvent for MigrationAdvanced { - const PALLET: &'static str = "MultiBlockMigrations"; - const EVENT: &'static str = "MigrationAdvanced"; + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Allows root to set a cursor to forcefully start, stop or forward the migration process."] + #[doc = ""] + #[doc = "Should normally not be needed and is only in place as emergency measure. Note that"] + #[doc = "restarting the migration process in this manner will not call the"] + #[doc = "[`MigrationStatusHandler::started`] hook or emit an `UpgradeStarted` event."] + pub fn force_set_cursor( + &self, + cursor: super::force_set_cursor::Cursor, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "MultiBlockMigrations", + "force_set_cursor", + super::ForceSetCursor { cursor }, + [ + 19u8, 44u8, 153u8, 100u8, 215u8, 46u8, 69u8, 184u8, 161u8, 215u8, + 80u8, 229u8, 65u8, 166u8, 63u8, 102u8, 97u8, 214u8, 112u8, 219u8, + 227u8, 213u8, 16u8, 50u8, 246u8, 54u8, 69u8, 172u8, 105u8, 216u8, + 197u8, 184u8, + ], + ) + } + #[doc = "Allows root to set an active cursor to forcefully start/forward the migration process."] + #[doc = ""] + #[doc = "This is an edge-case version of [`Self::force_set_cursor`] that allows to set the"] + #[doc = "`started_at` value to the next block number. Otherwise this would not be possible, since"] + #[doc = "`force_set_cursor` takes an absolute block number. Setting `started_at` to `None`"] + #[doc = "indicates that the current block number plus one should be used."] + pub fn force_set_active_cursor( + &self, + index: super::force_set_active_cursor::Index, + inner_cursor: super::force_set_active_cursor::InnerCursor, + started_at: super::force_set_active_cursor::StartedAt, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "MultiBlockMigrations", + "force_set_active_cursor", + super::ForceSetActiveCursor { + index, + inner_cursor, + started_at, + }, + [ + 171u8, 245u8, 214u8, 230u8, 7u8, 61u8, 186u8, 60u8, 43u8, 235u8, + 110u8, 188u8, 30u8, 215u8, 48u8, 194u8, 249u8, 215u8, 224u8, 229u8, + 89u8, 179u8, 189u8, 70u8, 62u8, 162u8, 245u8, 199u8, 3u8, 234u8, + 154u8, 9u8, + ], + ) + } + #[doc = "Forces the onboarding of the migrations."] + #[doc = ""] + #[doc = "This process happens automatically on a runtime upgrade. It is in place as an emergency"] + #[doc = "measurement. The cursor needs to be `None` for this to succeed."] + pub fn force_onboard_mbms( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "MultiBlockMigrations", + "force_onboard_mbms", + super::ForceOnboardMbms {}, + [ + 201u8, 148u8, 226u8, 128u8, 88u8, 120u8, 31u8, 159u8, 78u8, 5u8, + 148u8, 189u8, 71u8, 195u8, 136u8, 24u8, 131u8, 107u8, 56u8, 17u8, + 26u8, 25u8, 189u8, 102u8, 220u8, 148u8, 44u8, 92u8, 79u8, 232u8, + 236u8, 86u8, + ], + ) + } + #[doc = "Clears the `Historic` set."] + #[doc = ""] + #[doc = "`map_cursor` must be set to the last value that was returned by the"] + #[doc = "`HistoricCleared` event. The first time `None` can be used. `limit` must be chosen in a"] + #[doc = "way that will result in a sensible weight."] + pub fn clear_historic( + &self, + selector: super::clear_historic::Selector, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "MultiBlockMigrations", + "clear_historic", + super::ClearHistoric { selector }, + [ + 160u8, 68u8, 166u8, 164u8, 115u8, 190u8, 214u8, 167u8, 171u8, + 238u8, 176u8, 191u8, 30u8, 228u8, 237u8, 125u8, 183u8, 147u8, + 186u8, 246u8, 59u8, 186u8, 40u8, 193u8, 13u8, 252u8, 99u8, 199u8, + 207u8, 149u8, 20u8, 95u8, + ], + ) + } + } } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_migrations::pallet::Event; + pub mod events { + use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A Migration completed."] - pub struct MigrationCompleted { - pub index: migration_completed::Index, - pub took: migration_completed::Took, + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A Runtime upgrade started."] + #[doc = ""] + #[doc = "Its end is indicated by `UpgradeCompleted` or `UpgradeFailed`."] + pub struct UpgradeStarted { + pub migrations: upgrade_started::Migrations, } - pub mod migration_completed { + pub mod upgrade_started { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Took = ::core::primitive::u32; + pub type Migrations = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MigrationCompleted { - const PALLET: &'static str = "MultiBlockMigrations"; - const EVENT: &'static str = "MigrationCompleted"; + impl UpgradeStarted { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const EVENT_NAME: &'static str = "UpgradeStarted"; + } + impl ::subxt::events::DecodeAsEvent for UpgradeStarted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A Migration failed."] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "The current runtime upgrade completed."] #[doc = ""] - #[doc = "This implies that the whole upgrade failed and governance intervention is required."] - pub struct MigrationFailed { - pub index: migration_failed::Index, - pub took: migration_failed::Took, - } - pub mod migration_failed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Took = ::core::primitive::u32; + #[doc = "This implies that all of its migrations completed successfully as well."] + pub struct UpgradeCompleted; + impl UpgradeCompleted { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const EVENT_NAME: &'static str = "UpgradeCompleted"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MigrationFailed { - const PALLET: &'static str = "MultiBlockMigrations"; - const EVENT: &'static str = "MigrationFailed"; + impl ::subxt::events::DecodeAsEvent for UpgradeCompleted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The set of historical migrations has been cleared."] - pub struct HistoricCleared { - pub next_cursor: historic_cleared::NextCursor, - } - pub mod historic_cleared { - use super::runtime_types; - pub type NextCursor = ::core::option::Option< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for HistoricCleared { - const PALLET: &'static str = "MultiBlockMigrations"; - const EVENT: &'static str = "HistoricCleared"; - } - } - pub mod storage { - use super::root_mod; - use super::runtime_types; - pub struct StorageApi; - impl StorageApi { - #[doc = " The currently active migration to run and its cursor."] - #[doc = ""] - #[doc = " `None` indicates that no migration is running."] - pub fn cursor( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - cursor::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MultiBlockMigrations", - "Cursor", - [ - 81u8, 213u8, 47u8, 72u8, 45u8, 251u8, 36u8, 119u8, 24u8, 100u8, 98u8, - 254u8, 99u8, 6u8, 156u8, 56u8, 39u8, 28u8, 206u8, 104u8, 177u8, 168u8, - 73u8, 253u8, 198u8, 146u8, 17u8, 226u8, 223u8, 160u8, 230u8, 79u8, - ], - ) - } - #[doc = " Set of all successfully executed migrations."] - #[doc = ""] - #[doc = " This is used as blacklist, to not re-execute migrations that have not been removed from the"] - #[doc = " codebase yet. Governance can regularly clear this out via `clear_historic`."] - pub fn historic( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (historic::Param0,), - historic::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MultiBlockMigrations", - "Historic", - [ - 140u8, 21u8, 108u8, 63u8, 56u8, 168u8, 238u8, 231u8, 162u8, 233u8, - 219u8, 234u8, 72u8, 81u8, 17u8, 115u8, 53u8, 174u8, 8u8, 254u8, 135u8, - 79u8, 27u8, 81u8, 88u8, 20u8, 71u8, 116u8, 181u8, 98u8, 118u8, 46u8, - ], - ) - } - } - pub mod cursor { - use super::root_mod; - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::pallet_migrations::MigrationCursor< - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ::core::primitive::u32, - >; - } - } - pub mod historic { - use super::root_mod; - use super::runtime_types; - pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub mod output { - use super::runtime_types; - pub type Output = (); - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The maximal length of an encoded cursor."] - #[doc = ""] - #[doc = " A good default needs to selected such that no migration will ever have a cursor with MEL"] - #[doc = " above this limit. This is statically checked in `integrity_test`."] - pub fn cursor_max_len( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MultiBlockMigrations", - "CursorMaxLen", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The maximal length of an encoded identifier."] - #[doc = ""] - #[doc = " A good default needs to selected such that no migration will ever have an identifier"] - #[doc = " with MEL above this limit. This is statically checked in `integrity_test`."] - pub fn identifier_max_len( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MultiBlockMigrations", - "IdentifierMaxLen", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Runtime upgrade failed."] + #[doc = ""] + #[doc = "This is very bad and will require governance intervention."] + pub struct UpgradeFailed; + impl UpgradeFailed { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const EVENT_NAME: &'static str = "UpgradeFailed"; } - } - } - pub mod xcm_pallet { - use super::root_mod; - use super::runtime_types; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_xcm::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_xcm::pallet::Call; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Send { - pub dest: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub message: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod send { - use super::runtime_types; - pub type Dest = runtime_types::xcm::VersionedLocation; - pub type Message = runtime_types::xcm::VersionedXcm; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Send { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "send"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "**This function is deprecated: Use `limited_teleport_assets` instead.**"] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] - #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] - #[doc = " relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] - #[doc = " generally be an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` chain."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - pub struct TeleportAssets { - pub dest: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub beneficiary: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub assets: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub fee_asset_item: teleport_assets::FeeAssetItem, - } - pub mod teleport_assets { - use super::runtime_types; - pub type Dest = runtime_types::xcm::VersionedLocation; - pub type Beneficiary = runtime_types::xcm::VersionedLocation; - pub type Assets = runtime_types::xcm::VersionedAssets; - pub type FeeAssetItem = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TeleportAssets { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "teleport_assets"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] - #[doc = "destination or remote reserve."] - #[doc = ""] - #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] - #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] - #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] - #[doc = " assets to `beneficiary`."] - #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] - #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] - #[doc = " deposit them to `beneficiary`."] - #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] - #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] - #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] - #[doc = ""] - #[doc = "**This function is deprecated: Use `limited_reserve_transfer_assets` instead.**"] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] - #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] - #[doc = " relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] - #[doc = " generally be an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` (and possibly reserve) chains."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - pub struct ReserveTransferAssets { - pub dest: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box< - reserve_transfer_assets::Beneficiary, - >, - pub assets: ::subxt::ext::subxt_core::alloc::boxed::Box< - reserve_transfer_assets::Assets, - >, - pub fee_asset_item: reserve_transfer_assets::FeeAssetItem, - } - pub mod reserve_transfer_assets { - use super::runtime_types; - pub type Dest = runtime_types::xcm::VersionedLocation; - pub type Beneficiary = runtime_types::xcm::VersionedLocation; - pub type Assets = runtime_types::xcm::VersionedAssets; - pub type FeeAssetItem = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReserveTransferAssets { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "reserve_transfer_assets"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Execute an XCM message from a local, signed, origin."] - #[doc = ""] - #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] - #[doc = "partially."] - #[doc = ""] - #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than"] - #[doc = "the maximum amount of weight that the message could take to be executed, then no"] - #[doc = "execution attempt will be made."] - pub struct Execute { - pub message: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub max_weight: execute::MaxWeight, - } - pub mod execute { - use super::runtime_types; - pub type Message = runtime_types::xcm::VersionedXcm; - pub type MaxWeight = runtime_types::sp_weights::weight_v2::Weight; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Execute { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "execute"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Extoll that a particular destination can be communicated with through a particular"] - #[doc = "version of XCM."] - #[doc = ""] - #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] - #[doc = "- `location`: The destination that is being described."] - #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] - pub struct ForceXcmVersion { - pub location: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub version: force_xcm_version::Version, - } - pub mod force_xcm_version { - use super::runtime_types; - pub type Location = runtime_types::staging_xcm::v5::location::Location; - pub type Version = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "force_xcm_version"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] - #[doc = "version a destination can accept is unknown)."] - #[doc = ""] - #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] - #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] - pub struct ForceDefaultXcmVersion { - pub maybe_xcm_version: force_default_xcm_version::MaybeXcmVersion, - } - pub mod force_default_xcm_version { - use super::runtime_types; - pub type MaybeXcmVersion = ::core::option::Option<::core::primitive::u32>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceDefaultXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "force_default_xcm_version"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] - #[doc = ""] - #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] - #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] - pub struct ForceSubscribeVersionNotify { - pub location: ::subxt::ext::subxt_core::alloc::boxed::Box< - force_subscribe_version_notify::Location, - >, - } - pub mod force_subscribe_version_notify { - use super::runtime_types; - pub type Location = runtime_types::xcm::VersionedLocation; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSubscribeVersionNotify { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "force_subscribe_version_notify"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] - #[doc = "version changes."] - #[doc = ""] - #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] - #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] - #[doc = " notifications which we no longer desire."] - pub struct ForceUnsubscribeVersionNotify { - pub location: ::subxt::ext::subxt_core::alloc::boxed::Box< - force_unsubscribe_version_notify::Location, - >, - } - pub mod force_unsubscribe_version_notify { - use super::runtime_types; - pub type Location = runtime_types::xcm::VersionedLocation; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceUnsubscribeVersionNotify { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "force_unsubscribe_version_notify"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] - #[doc = "destination or remote reserve."] - #[doc = ""] - #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] - #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] - #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] - #[doc = " assets to `beneficiary`."] - #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] - #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] - #[doc = " deposit them to `beneficiary`."] - #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] - #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] - #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] - #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] - #[doc = " relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] - #[doc = " generally be an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` (and possibly reserve) chains."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub struct LimitedReserveTransferAssets { - pub dest: ::subxt::ext::subxt_core::alloc::boxed::Box< - limited_reserve_transfer_assets::Dest, - >, - pub beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box< - limited_reserve_transfer_assets::Beneficiary, - >, - pub assets: ::subxt::ext::subxt_core::alloc::boxed::Box< - limited_reserve_transfer_assets::Assets, - >, - pub fee_asset_item: limited_reserve_transfer_assets::FeeAssetItem, - pub weight_limit: limited_reserve_transfer_assets::WeightLimit, - } - pub mod limited_reserve_transfer_assets { - use super::runtime_types; - pub type Dest = runtime_types::xcm::VersionedLocation; - pub type Beneficiary = runtime_types::xcm::VersionedLocation; - pub type Assets = runtime_types::xcm::VersionedAssets; - pub type FeeAssetItem = ::core::primitive::u32; - pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for LimitedReserveTransferAssets { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "limited_reserve_transfer_assets"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] - #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] - #[doc = " relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] - #[doc = " generally be an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` chain."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub struct LimitedTeleportAssets { - pub dest: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box< - limited_teleport_assets::Beneficiary, - >, - pub assets: ::subxt::ext::subxt_core::alloc::boxed::Box< - limited_teleport_assets::Assets, - >, - pub fee_asset_item: limited_teleport_assets::FeeAssetItem, - pub weight_limit: limited_teleport_assets::WeightLimit, - } - pub mod limited_teleport_assets { - use super::runtime_types; - pub type Dest = runtime_types::xcm::VersionedLocation; - pub type Beneficiary = runtime_types::xcm::VersionedLocation; - pub type Assets = runtime_types::xcm::VersionedAssets; - pub type FeeAssetItem = ::core::primitive::u32; - pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for LimitedTeleportAssets { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "limited_teleport_assets"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set or unset the global suspension state of the XCM executor."] - #[doc = ""] - #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] - #[doc = "- `suspended`: `true` to suspend, `false` to resume."] - pub struct ForceSuspension { - pub suspended: force_suspension::Suspended, - } - pub mod force_suspension { - use super::runtime_types; - pub type Suspended = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSuspension { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "force_suspension"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] - #[doc = "destination or remote reserve, or through teleports."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item` (hence referred to as `fees`), up to enough to pay for"] - #[doc = "`weight_limit` of weight. If more weight is needed than `weight_limit`, then the"] - #[doc = "operation will fail and the sent assets may be at risk."] - #[doc = ""] - #[doc = "`assets` (excluding `fees`) must have same reserve location or otherwise be teleportable"] - #[doc = "to `dest`, no limitations imposed on `fees`."] - #[doc = " - for local reserve: transfer assets to sovereign account of destination chain and"] - #[doc = " forward a notification XCM to `dest` to mint and deposit reserve-based assets to"] - #[doc = " `beneficiary`."] - #[doc = " - for destination reserve: burn local assets and forward a notification to `dest` chain"] - #[doc = " to withdraw the reserve assets from this chain's sovereign account and deposit them"] - #[doc = " to `beneficiary`."] - #[doc = " - for remote reserve: burn local assets, forward XCM to reserve chain to move reserves"] - #[doc = " from this chain's SA to `dest` chain's SA, and forward another XCM to `dest` to mint"] - #[doc = " and deposit reserve-based assets to `beneficiary`."] - #[doc = " - for teleports: burn local assets and forward XCM to `dest` chain to mint/teleport"] - #[doc = " assets and deposit them to `beneficiary`."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent,"] - #[doc = " Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send"] - #[doc = " from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] - #[doc = " generally be an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` (and possibly reserve) chains."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub struct TransferAssets { - pub dest: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub beneficiary: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub assets: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub fee_asset_item: transfer_assets::FeeAssetItem, - pub weight_limit: transfer_assets::WeightLimit, - } - pub mod transfer_assets { - use super::runtime_types; - pub type Dest = runtime_types::xcm::VersionedLocation; - pub type Beneficiary = runtime_types::xcm::VersionedLocation; - pub type Assets = runtime_types::xcm::VersionedAssets; - pub type FeeAssetItem = ::core::primitive::u32; - pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAssets { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "transfer_assets"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Claims assets trapped on this pallet because of leftover assets during XCM execution."] - #[doc = ""] - #[doc = "- `origin`: Anyone can call this extrinsic."] - #[doc = "- `assets`: The exact assets that were trapped. Use the version to specify what version"] - #[doc = "was the latest when they were trapped."] - #[doc = "- `beneficiary`: The location/account where the claimed assets will be deposited."] - pub struct ClaimAssets { - pub assets: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub beneficiary: - ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod claim_assets { - use super::runtime_types; - pub type Assets = runtime_types::xcm::VersionedAssets; - pub type Beneficiary = runtime_types::xcm::VersionedLocation; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimAssets { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "claim_assets"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer assets from the local chain to the destination chain using explicit transfer"] - #[doc = "types for assets and fees."] - #[doc = ""] - #[doc = "`assets` must have same reserve location or may be teleportable to `dest`. Caller must"] - #[doc = "provide the `assets_transfer_type` to be used for `assets`:"] - #[doc = " - `TransferType::LocalReserve`: transfer assets to sovereign account of destination"] - #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] - #[doc = " assets to `beneficiary`."] - #[doc = " - `TransferType::DestinationReserve`: burn local assets and forward a notification to"] - #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] - #[doc = " deposit them to `beneficiary`."] - #[doc = " - `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM to `reserve`"] - #[doc = " chain to move reserves from this chain's SA to `dest` chain's SA, and forward another"] - #[doc = " XCM to `dest` to mint and deposit reserve-based assets to `beneficiary`. Typically"] - #[doc = " the remote `reserve` is Asset Hub."] - #[doc = " - `TransferType::Teleport`: burn local assets and forward XCM to `dest` chain to"] - #[doc = " mint/teleport assets and deposit them to `beneficiary`."] - #[doc = ""] - #[doc = "On the destination chain, as well as any intermediary hops, `BuyExecution` is used to"] - #[doc = "buy execution using transferred `assets` identified by `remote_fees_id`."] - #[doc = "Make sure enough of the specified `remote_fees_id` asset is included in the given list"] - #[doc = "of `assets`. `remote_fees_id` should be enough to pay for `weight_limit`. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "`remote_fees_id` may use different transfer type than rest of `assets` and can be"] - #[doc = "specified through `fees_transfer_type`."] - #[doc = ""] - #[doc = "The caller needs to specify what should happen to the transferred assets once they reach"] - #[doc = "the `dest` chain. This is done through the `custom_xcm_on_dest` parameter, which"] - #[doc = "contains the instructions to execute on `dest` as a final step."] - #[doc = " This is usually as simple as:"] - #[doc = " `Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])`,"] - #[doc = " but could be something more exotic like sending the `assets` even further."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] - #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] - #[doc = " relay to parachain, or `(parents: 2, (GlobalConsensus(..), ..))` to send from"] - #[doc = " parachain across a bridge to another ecosystem destination."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` (and possibly reserve) chains."] - #[doc = "- `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`."] - #[doc = "- `remote_fees_id`: One of the included `assets` to be used to pay fees."] - #[doc = "- `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets."] - #[doc = "- `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the"] - #[doc = " transfer, which also determines what happens to the assets on the destination chain."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub struct TransferAssetsUsingTypeAndThen { - pub dest: ::subxt::ext::subxt_core::alloc::boxed::Box< - transfer_assets_using_type_and_then::Dest, - >, - pub assets: ::subxt::ext::subxt_core::alloc::boxed::Box< - transfer_assets_using_type_and_then::Assets, - >, - pub assets_transfer_type: ::subxt::ext::subxt_core::alloc::boxed::Box< - transfer_assets_using_type_and_then::AssetsTransferType, - >, - pub remote_fees_id: ::subxt::ext::subxt_core::alloc::boxed::Box< - transfer_assets_using_type_and_then::RemoteFeesId, - >, - pub fees_transfer_type: ::subxt::ext::subxt_core::alloc::boxed::Box< - transfer_assets_using_type_and_then::FeesTransferType, - >, - pub custom_xcm_on_dest: ::subxt::ext::subxt_core::alloc::boxed::Box< - transfer_assets_using_type_and_then::CustomXcmOnDest, - >, - pub weight_limit: transfer_assets_using_type_and_then::WeightLimit, - } - pub mod transfer_assets_using_type_and_then { - use super::runtime_types; - pub type Dest = runtime_types::xcm::VersionedLocation; - pub type Assets = runtime_types::xcm::VersionedAssets; - pub type AssetsTransferType = - runtime_types::staging_xcm_executor::traits::asset_transfer::TransferType; - pub type RemoteFeesId = runtime_types::xcm::VersionedAssetId; - pub type FeesTransferType = - runtime_types::staging_xcm_executor::traits::asset_transfer::TransferType; - pub type CustomXcmOnDest = runtime_types::xcm::VersionedXcm; - pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAssetsUsingTypeAndThen { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "transfer_assets_using_type_and_then"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Authorize another `aliaser` location to alias into the local `origin` making this call."] - #[doc = "The `aliaser` is only authorized until the provided `expiry` block number."] - #[doc = "The call can also be used for a previously authorized alias in order to update its"] - #[doc = "`expiry` block number."] - #[doc = ""] - #[doc = "Usually useful to allow your local account to be aliased into from a remote location"] - #[doc = "also under your control (like your account on another chain)."] - #[doc = ""] - #[doc = "WARNING: make sure the caller `origin` (you) trusts the `aliaser` location to act in"] - #[doc = "their/your name. Once authorized using this call, the `aliaser` can freely impersonate"] - #[doc = "`origin` in XCM programs executed on the local chain."] - pub struct AddAuthorizedAlias { - pub aliaser: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub expires: add_authorized_alias::Expires, - } - pub mod add_authorized_alias { - use super::runtime_types; - pub type Aliaser = runtime_types::xcm::VersionedLocation; - pub type Expires = ::core::option::Option<::core::primitive::u64>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddAuthorizedAlias { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "add_authorized_alias"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove a previously authorized `aliaser` from the list of locations that can alias into"] - #[doc = "the local `origin` making this call."] - pub struct RemoveAuthorizedAlias { - pub aliaser: ::subxt::ext::subxt_core::alloc::boxed::Box< - remove_authorized_alias::Aliaser, - >, + impl ::subxt::events::DecodeAsEvent for UpgradeFailed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME } - pub mod remove_authorized_alias { - use super::runtime_types; - pub type Aliaser = runtime_types::xcm::VersionedLocation; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A migration was skipped since it was already executed in the past."] + pub struct MigrationSkipped { + pub index: migration_skipped::Index, + } + pub mod migration_skipped { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl MigrationSkipped { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const EVENT_NAME: &'static str = "MigrationSkipped"; + } + impl ::subxt::events::DecodeAsEvent for MigrationSkipped { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveAuthorizedAlias { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "remove_authorized_alias"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A migration progressed."] + pub struct MigrationAdvanced { + pub index: migration_advanced::Index, + pub took: migration_advanced::Took, + } + pub mod migration_advanced { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Took = ::core::primitive::u32; + } + impl MigrationAdvanced { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const EVENT_NAME: &'static str = "MigrationAdvanced"; + } + impl ::subxt::events::DecodeAsEvent for MigrationAdvanced { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove all previously authorized `aliaser`s that can alias into the local `origin`"] - #[doc = "making this call."] - pub struct RemoveAllAuthorizedAliases; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveAllAuthorizedAliases { - const PALLET: &'static str = "XcmPallet"; - const CALL: &'static str = "remove_all_authorized_aliases"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A Migration completed."] + pub struct MigrationCompleted { + pub index: migration_completed::Index, + pub took: migration_completed::Took, + } + pub mod migration_completed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Took = ::core::primitive::u32; + } + impl MigrationCompleted { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const EVENT_NAME: &'static str = "MigrationCompleted"; + } + impl ::subxt::events::DecodeAsEvent for MigrationCompleted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME } } - pub struct TransactionApi; - impl TransactionApi { - pub fn send( - &self, - dest: types::send::Dest, - message: types::send::Message, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "send", - types::Send { - dest: ::subxt::ext::subxt_core::alloc::boxed::Box::new(dest), - message: ::subxt::ext::subxt_core::alloc::boxed::Box::new(message), - }, - [ - 209u8, 111u8, 170u8, 6u8, 115u8, 11u8, 18u8, 171u8, 249u8, 3u8, 67u8, - 107u8, 212u8, 16u8, 140u8, 96u8, 29u8, 157u8, 20u8, 1u8, 21u8, 19u8, - 105u8, 188u8, 10u8, 5u8, 87u8, 67u8, 71u8, 188u8, 35u8, 66u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A Migration failed."] + #[doc = ""] + #[doc = "This implies that the whole upgrade failed and governance intervention is required."] + pub struct MigrationFailed { + pub index: migration_failed::Index, + pub took: migration_failed::Took, + } + pub mod migration_failed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Took = ::core::primitive::u32; + } + impl MigrationFailed { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const EVENT_NAME: &'static str = "MigrationFailed"; + } + impl ::subxt::events::DecodeAsEvent for MigrationFailed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME } - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "**This function is deprecated: Use `limited_teleport_assets` instead.**"] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "The set of historical migrations has been cleared."] + pub struct HistoricCleared { + pub next_cursor: historic_cleared::NextCursor, + } + pub mod historic_cleared { + use super::runtime_types; + pub type NextCursor = + ::core::option::Option<::subxt::alloc::vec::Vec<::core::primitive::u8>>; + } + impl HistoricCleared { + const PALLET_NAME: &'static str = "MultiBlockMigrations"; + const EVENT_NAME: &'static str = "HistoricCleared"; + } + impl ::subxt::events::DecodeAsEvent for HistoricCleared { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } + } + } + pub mod storage { + use super::root_mod; + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The currently active migration to run and its cursor."] #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] - #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] - #[doc = " relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] - #[doc = " generally be an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` chain."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - pub fn teleport_assets( - &self, - dest: types::teleport_assets::Dest, - beneficiary: types::teleport_assets::Beneficiary, - assets: types::teleport_assets::Assets, - fee_asset_item: types::teleport_assets::FeeAssetItem, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + #[doc = " `None` indicates that no migration is running."] + pub fn cursor( + &self, + ) -> ::subxt::storage::StaticAddress<(), cursor::Output, ::subxt::utils::Yes> { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "teleport_assets", - types::TeleportAssets { - dest: ::subxt::ext::subxt_core::alloc::boxed::Box::new(dest), - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - beneficiary, - ), - assets: ::subxt::ext::subxt_core::alloc::boxed::Box::new(assets), - fee_asset_item, - }, + ::subxt::storage::StaticAddress::new_static( + "MultiBlockMigrations", + "Cursor", [ - 31u8, 60u8, 0u8, 220u8, 157u8, 38u8, 28u8, 140u8, 79u8, 243u8, 182u8, - 229u8, 158u8, 45u8, 213u8, 132u8, 149u8, 196u8, 212u8, 239u8, 23u8, - 19u8, 69u8, 27u8, 250u8, 110u8, 193u8, 60u8, 227u8, 252u8, 174u8, 35u8, + 81u8, 213u8, 47u8, 72u8, 45u8, 251u8, 36u8, 119u8, 24u8, 100u8, 98u8, + 254u8, 99u8, 6u8, 156u8, 56u8, 39u8, 28u8, 206u8, 104u8, 177u8, 168u8, + 73u8, 253u8, 198u8, 146u8, 17u8, 226u8, 223u8, 160u8, 230u8, 79u8, ], ) } - #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] - #[doc = "destination or remote reserve."] - #[doc = ""] - #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] - #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] - #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] - #[doc = " assets to `beneficiary`."] - #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] - #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] - #[doc = " deposit them to `beneficiary`."] - #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] - #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] - #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] - #[doc = ""] - #[doc = "**This function is deprecated: Use `limited_reserve_transfer_assets` instead.**"] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] + #[doc = " Set of all successfully executed migrations."] #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] - #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] - #[doc = " relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] - #[doc = " generally be an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` (and possibly reserve) chains."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - pub fn reserve_transfer_assets( - &self, - dest: types::reserve_transfer_assets::Dest, - beneficiary: types::reserve_transfer_assets::Beneficiary, - assets: types::reserve_transfer_assets::Assets, - fee_asset_item: types::reserve_transfer_assets::FeeAssetItem, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ReserveTransferAssets, + #[doc = " This is used as blacklist, to not re-execute migrations that have not been removed from the"] + #[doc = " codebase yet. Governance can regularly clear this out via `clear_historic`."] + pub fn historic( + &self, + ) -> ::subxt::storage::StaticAddress< + (historic::input::Param0,), + historic::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "reserve_transfer_assets", - types::ReserveTransferAssets { - dest: ::subxt::ext::subxt_core::alloc::boxed::Box::new(dest), - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - beneficiary, - ), - assets: ::subxt::ext::subxt_core::alloc::boxed::Box::new(assets), - fee_asset_item, - }, + ::subxt::storage::StaticAddress::new_static( + "MultiBlockMigrations", + "Historic", [ - 76u8, 122u8, 201u8, 193u8, 160u8, 210u8, 58u8, 150u8, 236u8, 130u8, - 225u8, 28u8, 35u8, 9u8, 206u8, 235u8, 14u8, 101u8, 193u8, 118u8, 145u8, - 230u8, 112u8, 65u8, 172u8, 251u8, 62u8, 64u8, 130u8, 223u8, 153u8, - 139u8, + 140u8, 21u8, 108u8, 63u8, 56u8, 168u8, 238u8, 231u8, 162u8, 233u8, + 219u8, 234u8, 72u8, 81u8, 17u8, 115u8, 53u8, 174u8, 8u8, 254u8, 135u8, + 79u8, 27u8, 81u8, 88u8, 20u8, 71u8, 116u8, 181u8, 98u8, 118u8, 46u8, ], ) } - #[doc = "Execute an XCM message from a local, signed, origin."] - #[doc = ""] - #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] - #[doc = "partially."] - #[doc = ""] - #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than"] - #[doc = "the maximum amount of weight that the message could take to be executed, then no"] - #[doc = "execution attempt will be made."] - pub fn execute( - &self, - message: types::execute::Message, - max_weight: types::execute::MaxWeight, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "execute", - types::Execute { - message: ::subxt::ext::subxt_core::alloc::boxed::Box::new(message), - max_weight, - }, - [ - 122u8, 9u8, 129u8, 102u8, 188u8, 214u8, 143u8, 187u8, 175u8, 221u8, - 157u8, 67u8, 208u8, 30u8, 97u8, 133u8, 171u8, 14u8, 144u8, 97u8, 18u8, - 124u8, 196u8, 254u8, 70u8, 31u8, 175u8, 197u8, 230u8, 36u8, 147u8, - 211u8, - ], - ) + } + pub mod cursor { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; } - #[doc = "Extoll that a particular destination can be communicated with through a particular"] - #[doc = "version of XCM."] - #[doc = ""] - #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] - #[doc = "- `location`: The destination that is being described."] - #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] - pub fn force_xcm_version( - &self, - location: types::force_xcm_version::Location, - version: types::force_xcm_version::Version, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "force_xcm_version", - types::ForceXcmVersion { - location: ::subxt::ext::subxt_core::alloc::boxed::Box::new(location), - version, - }, - [ - 136u8, 43u8, 72u8, 5u8, 164u8, 97u8, 177u8, 61u8, 8u8, 112u8, 148u8, - 43u8, 0u8, 23u8, 134u8, 21u8, 173u8, 181u8, 207u8, 249u8, 98u8, 122u8, - 74u8, 131u8, 172u8, 12u8, 146u8, 124u8, 220u8, 97u8, 126u8, 253u8, - ], - ) + pub type Output = runtime_types::pallet_migrations::MigrationCursor< + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ::core::primitive::u32, + >; + } + pub mod historic { + use super::root_mod; + use super::runtime_types; + pub mod input { + use super::runtime_types; + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; } - #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] - #[doc = "version a destination can accept is unknown)."] + pub type Output = (); + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The maximal length of an encoded cursor."] #[doc = ""] - #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] - #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] - pub fn force_default_xcm_version( + #[doc = " A good default needs to selected such that no migration will ever have a cursor with MEL"] + #[doc = " above this limit. This is statically checked in `integrity_test`."] + pub fn cursor_max_len( &self, - maybe_xcm_version: types::force_default_xcm_version::MaybeXcmVersion, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceDefaultXcmVersion, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "force_default_xcm_version", - types::ForceDefaultXcmVersion { maybe_xcm_version }, + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( + "MultiBlockMigrations", + "CursorMaxLen", [ - 43u8, 114u8, 102u8, 104u8, 209u8, 234u8, 108u8, 173u8, 109u8, 188u8, - 94u8, 214u8, 136u8, 43u8, 153u8, 75u8, 161u8, 192u8, 76u8, 12u8, 221u8, - 237u8, 158u8, 247u8, 41u8, 193u8, 35u8, 174u8, 183u8, 207u8, 79u8, - 213u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] + #[doc = " The maximal length of an encoded identifier."] #[doc = ""] - #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] - #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] - pub fn force_subscribe_version_notify( + #[doc = " A good default needs to selected such that no migration will ever have an identifier"] + #[doc = " with MEL above this limit. This is statically checked in `integrity_test`."] + pub fn identifier_max_len( &self, - location: types::force_subscribe_version_notify::Location, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceSubscribeVersionNotify, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "force_subscribe_version_notify", - types::ForceSubscribeVersionNotify { - location: ::subxt::ext::subxt_core::alloc::boxed::Box::new(location), - }, + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( + "MultiBlockMigrations", + "IdentifierMaxLen", [ - 51u8, 103u8, 204u8, 180u8, 35u8, 50u8, 212u8, 76u8, 243u8, 161u8, 5u8, - 180u8, 61u8, 194u8, 181u8, 13u8, 209u8, 18u8, 182u8, 26u8, 138u8, - 139u8, 205u8, 98u8, 62u8, 185u8, 194u8, 240u8, 5u8, 60u8, 245u8, 91u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] - #[doc = "version changes."] - #[doc = ""] - #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] - #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] - #[doc = " notifications which we no longer desire."] - pub fn force_unsubscribe_version_notify( - &self, - location: types::force_unsubscribe_version_notify::Location, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceUnsubscribeVersionNotify, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "force_unsubscribe_version_notify", - types::ForceUnsubscribeVersionNotify { - location: ::subxt::ext::subxt_core::alloc::boxed::Box::new(location), - }, - [ - 80u8, 153u8, 123u8, 155u8, 105u8, 164u8, 139u8, 252u8, 89u8, 174u8, - 54u8, 14u8, 99u8, 172u8, 85u8, 239u8, 45u8, 141u8, 84u8, 69u8, 47u8, - 18u8, 173u8, 201u8, 137u8, 186u8, 217u8, 105u8, 105u8, 20u8, 6u8, - 198u8, - ], - ) + } + } + } + pub mod xcm_pallet { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_xcm::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_xcm::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct Send { + pub dest: ::subxt::alloc::boxed::Box, + pub message: ::subxt::alloc::boxed::Box, + } + pub mod send { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Message = runtime_types::xcm::VersionedXcm; + } + impl Send { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "send"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Send { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] - #[doc = "destination or remote reserve."] - #[doc = ""] - #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] - #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] - #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] - #[doc = " assets to `beneficiary`."] - #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] - #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] - #[doc = " deposit them to `beneficiary`."] - #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] - #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] - #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] - #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] - #[doc = " relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] - #[doc = " generally be an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` (and possibly reserve) chains."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub fn limited_reserve_transfer_assets( - &self, - dest: types::limited_reserve_transfer_assets::Dest, - beneficiary: types::limited_reserve_transfer_assets::Beneficiary, - assets: types::limited_reserve_transfer_assets::Assets, - fee_asset_item: types::limited_reserve_transfer_assets::FeeAssetItem, - weight_limit: types::limited_reserve_transfer_assets::WeightLimit, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::LimitedReserveTransferAssets, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "limited_reserve_transfer_assets", - types::LimitedReserveTransferAssets { - dest: ::subxt::ext::subxt_core::alloc::boxed::Box::new(dest), - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - beneficiary, - ), - assets: ::subxt::ext::subxt_core::alloc::boxed::Box::new(assets), - fee_asset_item, - weight_limit, - }, - [ - 72u8, 168u8, 103u8, 54u8, 253u8, 3u8, 152u8, 167u8, 60u8, 214u8, 24u8, - 47u8, 179u8, 36u8, 251u8, 15u8, 213u8, 191u8, 95u8, 128u8, 93u8, 42u8, - 205u8, 37u8, 214u8, 170u8, 241u8, 71u8, 176u8, 11u8, 43u8, 74u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "**This function is deprecated: Use `limited_teleport_assets` instead.**"] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` chain."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + pub struct TeleportAssets { + pub dest: ::subxt::alloc::boxed::Box, + pub beneficiary: ::subxt::alloc::boxed::Box, + pub assets: ::subxt::alloc::boxed::Box, + pub fee_asset_item: teleport_assets::FeeAssetItem, + } + pub mod teleport_assets { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type FeeAssetItem = ::core::primitive::u32; + } + impl TeleportAssets { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "teleport_assets"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for TeleportAssets { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] - #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] - #[doc = " relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] - #[doc = " generally be an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` chain."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub fn limited_teleport_assets( - &self, - dest: types::limited_teleport_assets::Dest, - beneficiary: types::limited_teleport_assets::Beneficiary, - assets: types::limited_teleport_assets::Assets, - fee_asset_item: types::limited_teleport_assets::FeeAssetItem, - weight_limit: types::limited_teleport_assets::WeightLimit, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::LimitedTeleportAssets, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "limited_teleport_assets", - types::LimitedTeleportAssets { - dest: ::subxt::ext::subxt_core::alloc::boxed::Box::new(dest), - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - beneficiary, - ), - assets: ::subxt::ext::subxt_core::alloc::boxed::Box::new(assets), - fee_asset_item, - weight_limit, - }, - [ - 56u8, 190u8, 251u8, 133u8, 34u8, 100u8, 32u8, 57u8, 114u8, 73u8, 153u8, - 74u8, 178u8, 228u8, 239u8, 87u8, 242u8, 202u8, 56u8, 66u8, 22u8, 216u8, - 113u8, 25u8, 233u8, 238u8, 164u8, 76u8, 144u8, 204u8, 219u8, 91u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve."] + #[doc = ""] + #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] + #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] + #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] + #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] + #[doc = ""] + #[doc = "**This function is deprecated: Use `limited_reserve_transfer_assets` instead.**"] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + pub struct ReserveTransferAssets { + pub dest: ::subxt::alloc::boxed::Box, + pub beneficiary: ::subxt::alloc::boxed::Box, + pub assets: ::subxt::alloc::boxed::Box, + pub fee_asset_item: reserve_transfer_assets::FeeAssetItem, + } + pub mod reserve_transfer_assets { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type FeeAssetItem = ::core::primitive::u32; + } + impl ReserveTransferAssets { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "reserve_transfer_assets"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReserveTransferAssets { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set or unset the global suspension state of the XCM executor."] - #[doc = ""] - #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] - #[doc = "- `suspended`: `true` to suspend, `false` to resume."] - pub fn force_suspension( - &self, - suspended: types::force_suspension::Suspended, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "force_suspension", - types::ForceSuspension { suspended }, - [ - 78u8, 125u8, 93u8, 55u8, 129u8, 44u8, 36u8, 227u8, 75u8, 46u8, 68u8, - 202u8, 81u8, 127u8, 111u8, 92u8, 149u8, 38u8, 225u8, 185u8, 183u8, - 154u8, 89u8, 159u8, 79u8, 10u8, 229u8, 1u8, 226u8, 243u8, 65u8, 238u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Execute an XCM message from a local, signed, origin."] + #[doc = ""] + #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] + #[doc = "partially."] + #[doc = ""] + #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than"] + #[doc = "the maximum amount of weight that the message could take to be executed, then no"] + #[doc = "execution attempt will be made."] + pub struct Execute { + pub message: ::subxt::alloc::boxed::Box, + pub max_weight: execute::MaxWeight, + } + pub mod execute { + use super::runtime_types; + pub type Message = runtime_types::xcm::VersionedXcm; + pub type MaxWeight = runtime_types::sp_weights::weight_v2::Weight; + } + impl Execute { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "execute"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Execute { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] - #[doc = "destination or remote reserve, or through teleports."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item` (hence referred to as `fees`), up to enough to pay for"] - #[doc = "`weight_limit` of weight. If more weight is needed than `weight_limit`, then the"] - #[doc = "operation will fail and the sent assets may be at risk."] - #[doc = ""] - #[doc = "`assets` (excluding `fees`) must have same reserve location or otherwise be teleportable"] - #[doc = "to `dest`, no limitations imposed on `fees`."] - #[doc = " - for local reserve: transfer assets to sovereign account of destination chain and"] - #[doc = " forward a notification XCM to `dest` to mint and deposit reserve-based assets to"] - #[doc = " `beneficiary`."] - #[doc = " - for destination reserve: burn local assets and forward a notification to `dest` chain"] - #[doc = " to withdraw the reserve assets from this chain's sovereign account and deposit them"] - #[doc = " to `beneficiary`."] - #[doc = " - for remote reserve: burn local assets, forward XCM to reserve chain to move reserves"] - #[doc = " from this chain's SA to `dest` chain's SA, and forward another XCM to `dest` to mint"] - #[doc = " and deposit reserve-based assets to `beneficiary`."] - #[doc = " - for teleports: burn local assets and forward XCM to `dest` chain to mint/teleport"] - #[doc = " assets and deposit them to `beneficiary`."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent,"] - #[doc = " Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send"] - #[doc = " from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] - #[doc = " generally be an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` (and possibly reserve) chains."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub fn transfer_assets( - &self, - dest: types::transfer_assets::Dest, - beneficiary: types::transfer_assets::Beneficiary, - assets: types::transfer_assets::Assets, - fee_asset_item: types::transfer_assets::FeeAssetItem, - weight_limit: types::transfer_assets::WeightLimit, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "transfer_assets", - types::TransferAssets { - dest: ::subxt::ext::subxt_core::alloc::boxed::Box::new(dest), - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - beneficiary, - ), - assets: ::subxt::ext::subxt_core::alloc::boxed::Box::new(assets), - fee_asset_item, - weight_limit, - }, - [ - 204u8, 118u8, 44u8, 144u8, 51u8, 77u8, 235u8, 235u8, 86u8, 166u8, 92u8, - 106u8, 197u8, 151u8, 154u8, 136u8, 137u8, 206u8, 111u8, 118u8, 94u8, - 22u8, 7u8, 21u8, 13u8, 169u8, 214u8, 87u8, 84u8, 140u8, 6u8, 54u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Extoll that a particular destination can be communicated with through a particular"] + #[doc = "version of XCM."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The destination that is being described."] + #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] + pub struct ForceXcmVersion { + pub location: ::subxt::alloc::boxed::Box, + pub version: force_xcm_version::Version, + } + pub mod force_xcm_version { + use super::runtime_types; + pub type Location = runtime_types::staging_xcm::v5::location::Location; + pub type Version = ::core::primitive::u32; + } + impl ForceXcmVersion { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "force_xcm_version"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceXcmVersion { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Claims assets trapped on this pallet because of leftover assets during XCM execution."] - #[doc = ""] - #[doc = "- `origin`: Anyone can call this extrinsic."] - #[doc = "- `assets`: The exact assets that were trapped. Use the version to specify what version"] - #[doc = "was the latest when they were trapped."] - #[doc = "- `beneficiary`: The location/account where the claimed assets will be deposited."] - pub fn claim_assets( - &self, - assets: types::claim_assets::Assets, - beneficiary: types::claim_assets::Beneficiary, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "claim_assets", - types::ClaimAssets { - assets: ::subxt::ext::subxt_core::alloc::boxed::Box::new(assets), - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - beneficiary, - ), - }, - [ - 7u8, 158u8, 80u8, 180u8, 145u8, 151u8, 34u8, 132u8, 236u8, 243u8, 77u8, - 177u8, 66u8, 172u8, 57u8, 182u8, 226u8, 110u8, 246u8, 159u8, 61u8, - 31u8, 167u8, 210u8, 226u8, 215u8, 103u8, 234u8, 16u8, 95u8, 92u8, - 248u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] + #[doc = "version a destination can accept is unknown)."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] + pub struct ForceDefaultXcmVersion { + pub maybe_xcm_version: force_default_xcm_version::MaybeXcmVersion, + } + pub mod force_default_xcm_version { + use super::runtime_types; + pub type MaybeXcmVersion = ::core::option::Option<::core::primitive::u32>; + } + impl ForceDefaultXcmVersion { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "force_default_xcm_version"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceDefaultXcmVersion { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Transfer assets from the local chain to the destination chain using explicit transfer"] - #[doc = "types for assets and fees."] - #[doc = ""] - #[doc = "`assets` must have same reserve location or may be teleportable to `dest`. Caller must"] - #[doc = "provide the `assets_transfer_type` to be used for `assets`:"] - #[doc = " - `TransferType::LocalReserve`: transfer assets to sovereign account of destination"] - #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] - #[doc = " assets to `beneficiary`."] - #[doc = " - `TransferType::DestinationReserve`: burn local assets and forward a notification to"] - #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] - #[doc = " deposit them to `beneficiary`."] - #[doc = " - `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM to `reserve`"] - #[doc = " chain to move reserves from this chain's SA to `dest` chain's SA, and forward another"] - #[doc = " XCM to `dest` to mint and deposit reserve-based assets to `beneficiary`. Typically"] - #[doc = " the remote `reserve` is Asset Hub."] - #[doc = " - `TransferType::Teleport`: burn local assets and forward XCM to `dest` chain to"] - #[doc = " mint/teleport assets and deposit them to `beneficiary`."] - #[doc = ""] - #[doc = "On the destination chain, as well as any intermediary hops, `BuyExecution` is used to"] - #[doc = "buy execution using transferred `assets` identified by `remote_fees_id`."] - #[doc = "Make sure enough of the specified `remote_fees_id` asset is included in the given list"] - #[doc = "of `assets`. `remote_fees_id` should be enough to pay for `weight_limit`. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "`remote_fees_id` may use different transfer type than rest of `assets` and can be"] - #[doc = "specified through `fees_transfer_type`."] - #[doc = ""] - #[doc = "The caller needs to specify what should happen to the transferred assets once they reach"] - #[doc = "the `dest` chain. This is done through the `custom_xcm_on_dest` parameter, which"] - #[doc = "contains the instructions to execute on `dest` as a final step."] - #[doc = " This is usually as simple as:"] - #[doc = " `Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])`,"] - #[doc = " but could be something more exotic like sending the `assets` even further."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] - #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] - #[doc = " relay to parachain, or `(parents: 2, (GlobalConsensus(..), ..))` to send from"] - #[doc = " parachain across a bridge to another ecosystem destination."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] - #[doc = " fee on the `dest` (and possibly reserve) chains."] - #[doc = "- `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`."] - #[doc = "- `remote_fees_id`: One of the included `assets` to be used to pay fees."] - #[doc = "- `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets."] - #[doc = "- `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the"] - #[doc = " transfer, which also determines what happens to the assets on the destination chain."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub fn transfer_assets_using_type_and_then( - &self, - dest: types::transfer_assets_using_type_and_then::Dest, - assets: types::transfer_assets_using_type_and_then::Assets, - assets_transfer_type : types :: transfer_assets_using_type_and_then :: AssetsTransferType, - remote_fees_id: types::transfer_assets_using_type_and_then::RemoteFeesId, - fees_transfer_type : types :: transfer_assets_using_type_and_then :: FeesTransferType, - custom_xcm_on_dest: types::transfer_assets_using_type_and_then::CustomXcmOnDest, - weight_limit: types::transfer_assets_using_type_and_then::WeightLimit, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::TransferAssetsUsingTypeAndThen, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "transfer_assets_using_type_and_then", - types::TransferAssetsUsingTypeAndThen { - dest: ::subxt::ext::subxt_core::alloc::boxed::Box::new(dest), - assets: ::subxt::ext::subxt_core::alloc::boxed::Box::new(assets), - assets_transfer_type: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - assets_transfer_type, - ), - remote_fees_id: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - remote_fees_id, - ), - fees_transfer_type: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - fees_transfer_type, - ), - custom_xcm_on_dest: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - custom_xcm_on_dest, - ), - weight_limit, - }, - [ - 199u8, 248u8, 143u8, 192u8, 39u8, 87u8, 220u8, 150u8, 207u8, 131u8, - 122u8, 214u8, 240u8, 15u8, 201u8, 146u8, 166u8, 101u8, 154u8, 151u8, - 218u8, 25u8, 195u8, 200u8, 96u8, 141u8, 210u8, 113u8, 16u8, 238u8, - 208u8, 192u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] + pub struct ForceSubscribeVersionNotify { + pub location: ::subxt::alloc::boxed::Box, + } + pub mod force_subscribe_version_notify { + use super::runtime_types; + pub type Location = runtime_types::xcm::VersionedLocation; + } + impl ForceSubscribeVersionNotify { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "force_subscribe_version_notify"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceSubscribeVersionNotify { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Authorize another `aliaser` location to alias into the local `origin` making this call."] - #[doc = "The `aliaser` is only authorized until the provided `expiry` block number."] - #[doc = "The call can also be used for a previously authorized alias in order to update its"] - #[doc = "`expiry` block number."] - #[doc = ""] - #[doc = "Usually useful to allow your local account to be aliased into from a remote location"] - #[doc = "also under your control (like your account on another chain)."] - #[doc = ""] - #[doc = "WARNING: make sure the caller `origin` (you) trusts the `aliaser` location to act in"] - #[doc = "their/your name. Once authorized using this call, the `aliaser` can freely impersonate"] - #[doc = "`origin` in XCM programs executed on the local chain."] - pub fn add_authorized_alias( - &self, - aliaser: types::add_authorized_alias::Aliaser, - expires: types::add_authorized_alias::Expires, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "add_authorized_alias", - types::AddAuthorizedAlias { - aliaser: ::subxt::ext::subxt_core::alloc::boxed::Box::new(aliaser), - expires, - }, - [ - 223u8, 55u8, 95u8, 81u8, 3u8, 249u8, 197u8, 169u8, 247u8, 139u8, 84u8, - 142u8, 87u8, 70u8, 51u8, 169u8, 137u8, 190u8, 116u8, 253u8, 220u8, - 101u8, 221u8, 132u8, 245u8, 23u8, 0u8, 212u8, 3u8, 54u8, 60u8, 78u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] + #[doc = "version changes."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] + #[doc = " notifications which we no longer desire."] + pub struct ForceUnsubscribeVersionNotify { + pub location: + ::subxt::alloc::boxed::Box, + } + pub mod force_unsubscribe_version_notify { + use super::runtime_types; + pub type Location = runtime_types::xcm::VersionedLocation; + } + impl ForceUnsubscribeVersionNotify { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "force_unsubscribe_version_notify"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceUnsubscribeVersionNotify { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove a previously authorized `aliaser` from the list of locations that can alias into"] - #[doc = "the local `origin` making this call."] - pub fn remove_authorized_alias( - &self, - aliaser: types::remove_authorized_alias::Aliaser, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RemoveAuthorizedAlias, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "remove_authorized_alias", - types::RemoveAuthorizedAlias { - aliaser: ::subxt::ext::subxt_core::alloc::boxed::Box::new(aliaser), - }, - [ - 210u8, 231u8, 143u8, 176u8, 120u8, 169u8, 22u8, 200u8, 5u8, 41u8, 51u8, - 229u8, 158u8, 72u8, 19u8, 54u8, 204u8, 207u8, 191u8, 47u8, 145u8, 71u8, - 204u8, 235u8, 75u8, 245u8, 190u8, 106u8, 119u8, 203u8, 66u8, 0u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve."] + #[doc = ""] + #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] + #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] + #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] + #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub struct LimitedReserveTransferAssets { + pub dest: ::subxt::alloc::boxed::Box, + pub beneficiary: + ::subxt::alloc::boxed::Box, + pub assets: ::subxt::alloc::boxed::Box, + pub fee_asset_item: limited_reserve_transfer_assets::FeeAssetItem, + pub weight_limit: limited_reserve_transfer_assets::WeightLimit, + } + pub mod limited_reserve_transfer_assets { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type FeeAssetItem = ::core::primitive::u32; + pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; + } + impl LimitedReserveTransferAssets { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "limited_reserve_transfer_assets"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for LimitedReserveTransferAssets { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Remove all previously authorized `aliaser`s that can alias into the local `origin`"] - #[doc = "making this call."] - pub fn remove_all_authorized_aliases( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RemoveAllAuthorizedAliases, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "XcmPallet", - "remove_all_authorized_aliases", - types::RemoveAllAuthorizedAliases {}, - [ - 223u8, 17u8, 58u8, 180u8, 190u8, 164u8, 106u8, 17u8, 237u8, 243u8, - 160u8, 39u8, 13u8, 103u8, 166u8, 51u8, 192u8, 73u8, 193u8, 21u8, 69u8, - 170u8, 101u8, 195u8, 42u8, 123u8, 56u8, 90u8, 8u8, 109u8, 15u8, 110u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` chain."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub struct LimitedTeleportAssets { + pub dest: ::subxt::alloc::boxed::Box, + pub beneficiary: ::subxt::alloc::boxed::Box, + pub assets: ::subxt::alloc::boxed::Box, + pub fee_asset_item: limited_teleport_assets::FeeAssetItem, + pub weight_limit: limited_teleport_assets::WeightLimit, + } + pub mod limited_teleport_assets { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type FeeAssetItem = ::core::primitive::u32; + pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; + } + impl LimitedTeleportAssets { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "limited_teleport_assets"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for LimitedTeleportAssets { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set or unset the global suspension state of the XCM executor."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `suspended`: `true` to suspend, `false` to resume."] + pub struct ForceSuspension { + pub suspended: force_suspension::Suspended, + } + pub mod force_suspension { + use super::runtime_types; + pub type Suspended = ::core::primitive::bool; + } + impl ForceSuspension { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "force_suspension"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceSuspension { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve, or through teleports."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item` (hence referred to as `fees`), up to enough to pay for"] + #[doc = "`weight_limit` of weight. If more weight is needed than `weight_limit`, then the"] + #[doc = "operation will fail and the sent assets may be at risk."] + #[doc = ""] + #[doc = "`assets` (excluding `fees`) must have same reserve location or otherwise be teleportable"] + #[doc = "to `dest`, no limitations imposed on `fees`."] + #[doc = " - for local reserve: transfer assets to sovereign account of destination chain and"] + #[doc = " forward a notification XCM to `dest` to mint and deposit reserve-based assets to"] + #[doc = " `beneficiary`."] + #[doc = " - for destination reserve: burn local assets and forward a notification to `dest` chain"] + #[doc = " to withdraw the reserve assets from this chain's sovereign account and deposit them"] + #[doc = " to `beneficiary`."] + #[doc = " - for remote reserve: burn local assets, forward XCM to reserve chain to move reserves"] + #[doc = " from this chain's SA to `dest` chain's SA, and forward another XCM to `dest` to mint"] + #[doc = " and deposit reserve-based assets to `beneficiary`."] + #[doc = " - for teleports: burn local assets and forward XCM to `dest` chain to mint/teleport"] + #[doc = " assets and deposit them to `beneficiary`."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent,"] + #[doc = " Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send"] + #[doc = " from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub struct TransferAssets { + pub dest: ::subxt::alloc::boxed::Box, + pub beneficiary: ::subxt::alloc::boxed::Box, + pub assets: ::subxt::alloc::boxed::Box, + pub fee_asset_item: transfer_assets::FeeAssetItem, + pub weight_limit: transfer_assets::WeightLimit, + } + pub mod transfer_assets { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type FeeAssetItem = ::core::primitive::u32; + pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; + } + impl TransferAssets { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "transfer_assets"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for TransferAssets { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Claims assets trapped on this pallet because of leftover assets during XCM execution."] + #[doc = ""] + #[doc = "- `origin`: Anyone can call this extrinsic."] + #[doc = "- `assets`: The exact assets that were trapped. Use the version to specify what version"] + #[doc = "was the latest when they were trapped."] + #[doc = "- `beneficiary`: The location/account where the claimed assets will be deposited."] + pub struct ClaimAssets { + pub assets: ::subxt::alloc::boxed::Box, + pub beneficiary: ::subxt::alloc::boxed::Box, + } + pub mod claim_assets { + use super::runtime_types; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + } + impl ClaimAssets { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "claim_assets"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ClaimAssets { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Transfer assets from the local chain to the destination chain using explicit transfer"] + #[doc = "types for assets and fees."] + #[doc = ""] + #[doc = "`assets` must have same reserve location or may be teleportable to `dest`. Caller must"] + #[doc = "provide the `assets_transfer_type` to be used for `assets`:"] + #[doc = " - `TransferType::LocalReserve`: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `TransferType::DestinationReserve`: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM to `reserve`"] + #[doc = " chain to move reserves from this chain's SA to `dest` chain's SA, and forward another"] + #[doc = " XCM to `dest` to mint and deposit reserve-based assets to `beneficiary`. Typically"] + #[doc = " the remote `reserve` is Asset Hub."] + #[doc = " - `TransferType::Teleport`: burn local assets and forward XCM to `dest` chain to"] + #[doc = " mint/teleport assets and deposit them to `beneficiary`."] + #[doc = ""] + #[doc = "On the destination chain, as well as any intermediary hops, `BuyExecution` is used to"] + #[doc = "buy execution using transferred `assets` identified by `remote_fees_id`."] + #[doc = "Make sure enough of the specified `remote_fees_id` asset is included in the given list"] + #[doc = "of `assets`. `remote_fees_id` should be enough to pay for `weight_limit`. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "`remote_fees_id` may use different transfer type than rest of `assets` and can be"] + #[doc = "specified through `fees_transfer_type`."] + #[doc = ""] + #[doc = "The caller needs to specify what should happen to the transferred assets once they reach"] + #[doc = "the `dest` chain. This is done through the `custom_xcm_on_dest` parameter, which"] + #[doc = "contains the instructions to execute on `dest` as a final step."] + #[doc = " This is usually as simple as:"] + #[doc = " `Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])`,"] + #[doc = " but could be something more exotic like sending the `assets` even further."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain, or `(parents: 2, (GlobalConsensus(..), ..))` to send from"] + #[doc = " parachain across a bridge to another ecosystem destination."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`."] + #[doc = "- `remote_fees_id`: One of the included `assets` to be used to pay fees."] + #[doc = "- `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets."] + #[doc = "- `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the"] + #[doc = " transfer, which also determines what happens to the assets on the destination chain."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub struct TransferAssetsUsingTypeAndThen { + pub dest: ::subxt::alloc::boxed::Box, + pub assets: ::subxt::alloc::boxed::Box, + pub assets_transfer_type: ::subxt::alloc::boxed::Box< + transfer_assets_using_type_and_then::AssetsTransferType, + >, + pub remote_fees_id: + ::subxt::alloc::boxed::Box, + pub fees_transfer_type: ::subxt::alloc::boxed::Box< + transfer_assets_using_type_and_then::FeesTransferType, + >, + pub custom_xcm_on_dest: ::subxt::alloc::boxed::Box< + transfer_assets_using_type_and_then::CustomXcmOnDest, + >, + pub weight_limit: transfer_assets_using_type_and_then::WeightLimit, + } + pub mod transfer_assets_using_type_and_then { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type AssetsTransferType = + runtime_types::staging_xcm_executor::traits::asset_transfer::TransferType; + pub type RemoteFeesId = runtime_types::xcm::VersionedAssetId; + pub type FeesTransferType = + runtime_types::staging_xcm_executor::traits::asset_transfer::TransferType; + pub type CustomXcmOnDest = runtime_types::xcm::VersionedXcm; + pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; + } + impl TransferAssetsUsingTypeAndThen { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "transfer_assets_using_type_and_then"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for TransferAssetsUsingTypeAndThen { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Authorize another `aliaser` location to alias into the local `origin` making this call."] + #[doc = "The `aliaser` is only authorized until the provided `expiry` block number."] + #[doc = "The call can also be used for a previously authorized alias in order to update its"] + #[doc = "`expiry` block number."] + #[doc = ""] + #[doc = "Usually useful to allow your local account to be aliased into from a remote location"] + #[doc = "also under your control (like your account on another chain)."] + #[doc = ""] + #[doc = "WARNING: make sure the caller `origin` (you) trusts the `aliaser` location to act in"] + #[doc = "their/your name. Once authorized using this call, the `aliaser` can freely impersonate"] + #[doc = "`origin` in XCM programs executed on the local chain."] + pub struct AddAuthorizedAlias { + pub aliaser: ::subxt::alloc::boxed::Box, + pub expires: add_authorized_alias::Expires, + } + pub mod add_authorized_alias { + use super::runtime_types; + pub type Aliaser = runtime_types::xcm::VersionedLocation; + pub type Expires = ::core::option::Option<::core::primitive::u64>; + } + impl AddAuthorizedAlias { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "add_authorized_alias"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AddAuthorizedAlias { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove a previously authorized `aliaser` from the list of locations that can alias into"] + #[doc = "the local `origin` making this call."] + pub struct RemoveAuthorizedAlias { + pub aliaser: ::subxt::alloc::boxed::Box, + } + pub mod remove_authorized_alias { + use super::runtime_types; + pub type Aliaser = runtime_types::xcm::VersionedLocation; + } + impl RemoveAuthorizedAlias { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "remove_authorized_alias"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveAuthorizedAlias { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove all previously authorized `aliaser`s that can alias into the local `origin`"] + #[doc = "making this call."] + pub struct RemoveAllAuthorizedAliases; + impl RemoveAllAuthorizedAliases { + const PALLET_NAME: &'static str = "XcmPallet"; + const CALL_NAME: &'static str = "remove_all_authorized_aliases"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveAllAuthorizedAliases { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + pub fn send( + &self, + dest: super::send::Dest, + message: super::send::Message, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "send", + super::Send { + dest: ::subxt::alloc::boxed::Box::new(dest), + message: ::subxt::alloc::boxed::Box::new(message), + }, + [ + 209u8, 111u8, 170u8, 6u8, 115u8, 11u8, 18u8, 171u8, 249u8, 3u8, + 67u8, 107u8, 212u8, 16u8, 140u8, 96u8, 29u8, 157u8, 20u8, 1u8, + 21u8, 19u8, 105u8, 188u8, 10u8, 5u8, 87u8, 67u8, 71u8, 188u8, 35u8, + 66u8, + ], + ) + } + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "**This function is deprecated: Use `limited_teleport_assets` instead.**"] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` chain."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + pub fn teleport_assets( + &self, + dest: super::teleport_assets::Dest, + beneficiary: super::teleport_assets::Beneficiary, + assets: super::teleport_assets::Assets, + fee_asset_item: super::teleport_assets::FeeAssetItem, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "teleport_assets", + super::TeleportAssets { + dest: ::subxt::alloc::boxed::Box::new(dest), + beneficiary: ::subxt::alloc::boxed::Box::new(beneficiary), + assets: ::subxt::alloc::boxed::Box::new(assets), + fee_asset_item, + }, + [ + 31u8, 60u8, 0u8, 220u8, 157u8, 38u8, 28u8, 140u8, 79u8, 243u8, + 182u8, 229u8, 158u8, 45u8, 213u8, 132u8, 149u8, 196u8, 212u8, + 239u8, 23u8, 19u8, 69u8, 27u8, 250u8, 110u8, 193u8, 60u8, 227u8, + 252u8, 174u8, 35u8, + ], + ) + } + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve."] + #[doc = ""] + #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] + #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] + #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] + #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] + #[doc = ""] + #[doc = "**This function is deprecated: Use `limited_reserve_transfer_assets` instead.**"] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + pub fn reserve_transfer_assets( + &self, + dest: super::reserve_transfer_assets::Dest, + beneficiary: super::reserve_transfer_assets::Beneficiary, + assets: super::reserve_transfer_assets::Assets, + fee_asset_item: super::reserve_transfer_assets::FeeAssetItem, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "reserve_transfer_assets", + super::ReserveTransferAssets { + dest: ::subxt::alloc::boxed::Box::new(dest), + beneficiary: ::subxt::alloc::boxed::Box::new(beneficiary), + assets: ::subxt::alloc::boxed::Box::new(assets), + fee_asset_item, + }, + [ + 76u8, 122u8, 201u8, 193u8, 160u8, 210u8, 58u8, 150u8, 236u8, 130u8, + 225u8, 28u8, 35u8, 9u8, 206u8, 235u8, 14u8, 101u8, 193u8, 118u8, + 145u8, 230u8, 112u8, 65u8, 172u8, 251u8, 62u8, 64u8, 130u8, 223u8, + 153u8, 139u8, + ], + ) + } + #[doc = "Execute an XCM message from a local, signed, origin."] + #[doc = ""] + #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] + #[doc = "partially."] + #[doc = ""] + #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than"] + #[doc = "the maximum amount of weight that the message could take to be executed, then no"] + #[doc = "execution attempt will be made."] + pub fn execute( + &self, + message: super::execute::Message, + max_weight: super::execute::MaxWeight, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "execute", + super::Execute { + message: ::subxt::alloc::boxed::Box::new(message), + max_weight, + }, + [ + 122u8, 9u8, 129u8, 102u8, 188u8, 214u8, 143u8, 187u8, 175u8, 221u8, + 157u8, 67u8, 208u8, 30u8, 97u8, 133u8, 171u8, 14u8, 144u8, 97u8, + 18u8, 124u8, 196u8, 254u8, 70u8, 31u8, 175u8, 197u8, 230u8, 36u8, + 147u8, 211u8, + ], + ) + } + #[doc = "Extoll that a particular destination can be communicated with through a particular"] + #[doc = "version of XCM."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The destination that is being described."] + #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] + pub fn force_xcm_version( + &self, + location: super::force_xcm_version::Location, + version: super::force_xcm_version::Version, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "force_xcm_version", + super::ForceXcmVersion { + location: ::subxt::alloc::boxed::Box::new(location), + version, + }, + [ + 136u8, 43u8, 72u8, 5u8, 164u8, 97u8, 177u8, 61u8, 8u8, 112u8, + 148u8, 43u8, 0u8, 23u8, 134u8, 21u8, 173u8, 181u8, 207u8, 249u8, + 98u8, 122u8, 74u8, 131u8, 172u8, 12u8, 146u8, 124u8, 220u8, 97u8, + 126u8, 253u8, + ], + ) + } + #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] + #[doc = "version a destination can accept is unknown)."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] + pub fn force_default_xcm_version( + &self, + maybe_xcm_version: super::force_default_xcm_version::MaybeXcmVersion, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "force_default_xcm_version", + super::ForceDefaultXcmVersion { maybe_xcm_version }, + [ + 43u8, 114u8, 102u8, 104u8, 209u8, 234u8, 108u8, 173u8, 109u8, + 188u8, 94u8, 214u8, 136u8, 43u8, 153u8, 75u8, 161u8, 192u8, 76u8, + 12u8, 221u8, 237u8, 158u8, 247u8, 41u8, 193u8, 35u8, 174u8, 183u8, + 207u8, 79u8, 213u8, + ], + ) + } + #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] + pub fn force_subscribe_version_notify( + &self, + location: super::force_subscribe_version_notify::Location, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "force_subscribe_version_notify", + super::ForceSubscribeVersionNotify { + location: ::subxt::alloc::boxed::Box::new(location), + }, + [ + 51u8, 103u8, 204u8, 180u8, 35u8, 50u8, 212u8, 76u8, 243u8, 161u8, + 5u8, 180u8, 61u8, 194u8, 181u8, 13u8, 209u8, 18u8, 182u8, 26u8, + 138u8, 139u8, 205u8, 98u8, 62u8, 185u8, 194u8, 240u8, 5u8, 60u8, + 245u8, 91u8, + ], + ) + } + #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] + #[doc = "version changes."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] + #[doc = " notifications which we no longer desire."] + pub fn force_unsubscribe_version_notify( + &self, + location: super::force_unsubscribe_version_notify::Location, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "force_unsubscribe_version_notify", + super::ForceUnsubscribeVersionNotify { + location: ::subxt::alloc::boxed::Box::new(location), + }, + [ + 80u8, 153u8, 123u8, 155u8, 105u8, 164u8, 139u8, 252u8, 89u8, 174u8, + 54u8, 14u8, 99u8, 172u8, 85u8, 239u8, 45u8, 141u8, 84u8, 69u8, + 47u8, 18u8, 173u8, 201u8, 137u8, 186u8, 217u8, 105u8, 105u8, 20u8, + 6u8, 198u8, + ], + ) + } + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve."] + #[doc = ""] + #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] + #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] + #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] + #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub fn limited_reserve_transfer_assets( + &self, + dest: super::limited_reserve_transfer_assets::Dest, + beneficiary: super::limited_reserve_transfer_assets::Beneficiary, + assets: super::limited_reserve_transfer_assets::Assets, + fee_asset_item: super::limited_reserve_transfer_assets::FeeAssetItem, + weight_limit: super::limited_reserve_transfer_assets::WeightLimit, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "limited_reserve_transfer_assets", + super::LimitedReserveTransferAssets { + dest: ::subxt::alloc::boxed::Box::new(dest), + beneficiary: ::subxt::alloc::boxed::Box::new(beneficiary), + assets: ::subxt::alloc::boxed::Box::new(assets), + fee_asset_item, + weight_limit, + }, + [ + 72u8, 168u8, 103u8, 54u8, 253u8, 3u8, 152u8, 167u8, 60u8, 214u8, + 24u8, 47u8, 179u8, 36u8, 251u8, 15u8, 213u8, 191u8, 95u8, 128u8, + 93u8, 42u8, 205u8, 37u8, 214u8, 170u8, 241u8, 71u8, 176u8, 11u8, + 43u8, 74u8, + ], + ) + } + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` chain."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub fn limited_teleport_assets( + &self, + dest: super::limited_teleport_assets::Dest, + beneficiary: super::limited_teleport_assets::Beneficiary, + assets: super::limited_teleport_assets::Assets, + fee_asset_item: super::limited_teleport_assets::FeeAssetItem, + weight_limit: super::limited_teleport_assets::WeightLimit, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "limited_teleport_assets", + super::LimitedTeleportAssets { + dest: ::subxt::alloc::boxed::Box::new(dest), + beneficiary: ::subxt::alloc::boxed::Box::new(beneficiary), + assets: ::subxt::alloc::boxed::Box::new(assets), + fee_asset_item, + weight_limit, + }, + [ + 56u8, 190u8, 251u8, 133u8, 34u8, 100u8, 32u8, 57u8, 114u8, 73u8, + 153u8, 74u8, 178u8, 228u8, 239u8, 87u8, 242u8, 202u8, 56u8, 66u8, + 22u8, 216u8, 113u8, 25u8, 233u8, 238u8, 164u8, 76u8, 144u8, 204u8, + 219u8, 91u8, + ], + ) + } + #[doc = "Set or unset the global suspension state of the XCM executor."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `suspended`: `true` to suspend, `false` to resume."] + pub fn force_suspension( + &self, + suspended: super::force_suspension::Suspended, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "force_suspension", + super::ForceSuspension { suspended }, + [ + 78u8, 125u8, 93u8, 55u8, 129u8, 44u8, 36u8, 227u8, 75u8, 46u8, + 68u8, 202u8, 81u8, 127u8, 111u8, 92u8, 149u8, 38u8, 225u8, 185u8, + 183u8, 154u8, 89u8, 159u8, 79u8, 10u8, 229u8, 1u8, 226u8, 243u8, + 65u8, 238u8, + ], + ) + } + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve, or through teleports."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item` (hence referred to as `fees`), up to enough to pay for"] + #[doc = "`weight_limit` of weight. If more weight is needed than `weight_limit`, then the"] + #[doc = "operation will fail and the sent assets may be at risk."] + #[doc = ""] + #[doc = "`assets` (excluding `fees`) must have same reserve location or otherwise be teleportable"] + #[doc = "to `dest`, no limitations imposed on `fees`."] + #[doc = " - for local reserve: transfer assets to sovereign account of destination chain and"] + #[doc = " forward a notification XCM to `dest` to mint and deposit reserve-based assets to"] + #[doc = " `beneficiary`."] + #[doc = " - for destination reserve: burn local assets and forward a notification to `dest` chain"] + #[doc = " to withdraw the reserve assets from this chain's sovereign account and deposit them"] + #[doc = " to `beneficiary`."] + #[doc = " - for remote reserve: burn local assets, forward XCM to reserve chain to move reserves"] + #[doc = " from this chain's SA to `dest` chain's SA, and forward another XCM to `dest` to mint"] + #[doc = " and deposit reserve-based assets to `beneficiary`."] + #[doc = " - for teleports: burn local assets and forward XCM to `dest` chain to mint/teleport"] + #[doc = " assets and deposit them to `beneficiary`."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent,"] + #[doc = " Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send"] + #[doc = " from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub fn transfer_assets( + &self, + dest: super::transfer_assets::Dest, + beneficiary: super::transfer_assets::Beneficiary, + assets: super::transfer_assets::Assets, + fee_asset_item: super::transfer_assets::FeeAssetItem, + weight_limit: super::transfer_assets::WeightLimit, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "transfer_assets", + super::TransferAssets { + dest: ::subxt::alloc::boxed::Box::new(dest), + beneficiary: ::subxt::alloc::boxed::Box::new(beneficiary), + assets: ::subxt::alloc::boxed::Box::new(assets), + fee_asset_item, + weight_limit, + }, + [ + 204u8, 118u8, 44u8, 144u8, 51u8, 77u8, 235u8, 235u8, 86u8, 166u8, + 92u8, 106u8, 197u8, 151u8, 154u8, 136u8, 137u8, 206u8, 111u8, + 118u8, 94u8, 22u8, 7u8, 21u8, 13u8, 169u8, 214u8, 87u8, 84u8, + 140u8, 6u8, 54u8, + ], + ) + } + #[doc = "Claims assets trapped on this pallet because of leftover assets during XCM execution."] + #[doc = ""] + #[doc = "- `origin`: Anyone can call this extrinsic."] + #[doc = "- `assets`: The exact assets that were trapped. Use the version to specify what version"] + #[doc = "was the latest when they were trapped."] + #[doc = "- `beneficiary`: The location/account where the claimed assets will be deposited."] + pub fn claim_assets( + &self, + assets: super::claim_assets::Assets, + beneficiary: super::claim_assets::Beneficiary, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "claim_assets", + super::ClaimAssets { + assets: ::subxt::alloc::boxed::Box::new(assets), + beneficiary: ::subxt::alloc::boxed::Box::new(beneficiary), + }, + [ + 7u8, 158u8, 80u8, 180u8, 145u8, 151u8, 34u8, 132u8, 236u8, 243u8, + 77u8, 177u8, 66u8, 172u8, 57u8, 182u8, 226u8, 110u8, 246u8, 159u8, + 61u8, 31u8, 167u8, 210u8, 226u8, 215u8, 103u8, 234u8, 16u8, 95u8, + 92u8, 248u8, + ], + ) + } + #[doc = "Transfer assets from the local chain to the destination chain using explicit transfer"] + #[doc = "types for assets and fees."] + #[doc = ""] + #[doc = "`assets` must have same reserve location or may be teleportable to `dest`. Caller must"] + #[doc = "provide the `assets_transfer_type` to be used for `assets`:"] + #[doc = " - `TransferType::LocalReserve`: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `TransferType::DestinationReserve`: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM to `reserve`"] + #[doc = " chain to move reserves from this chain's SA to `dest` chain's SA, and forward another"] + #[doc = " XCM to `dest` to mint and deposit reserve-based assets to `beneficiary`. Typically"] + #[doc = " the remote `reserve` is Asset Hub."] + #[doc = " - `TransferType::Teleport`: burn local assets and forward XCM to `dest` chain to"] + #[doc = " mint/teleport assets and deposit them to `beneficiary`."] + #[doc = ""] + #[doc = "On the destination chain, as well as any intermediary hops, `BuyExecution` is used to"] + #[doc = "buy execution using transferred `assets` identified by `remote_fees_id`."] + #[doc = "Make sure enough of the specified `remote_fees_id` asset is included in the given list"] + #[doc = "of `assets`. `remote_fees_id` should be enough to pay for `weight_limit`. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "`remote_fees_id` may use different transfer type than rest of `assets` and can be"] + #[doc = "specified through `fees_transfer_type`."] + #[doc = ""] + #[doc = "The caller needs to specify what should happen to the transferred assets once they reach"] + #[doc = "the `dest` chain. This is done through the `custom_xcm_on_dest` parameter, which"] + #[doc = "contains the instructions to execute on `dest` as a final step."] + #[doc = " This is usually as simple as:"] + #[doc = " `Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])`,"] + #[doc = " but could be something more exotic like sending the `assets` even further."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain, or `(parents: 2, (GlobalConsensus(..), ..))` to send from"] + #[doc = " parachain across a bridge to another ecosystem destination."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`."] + #[doc = "- `remote_fees_id`: One of the included `assets` to be used to pay fees."] + #[doc = "- `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets."] + #[doc = "- `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the"] + #[doc = " transfer, which also determines what happens to the assets on the destination chain."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub fn transfer_assets_using_type_and_then( + &self, + dest: super::transfer_assets_using_type_and_then::Dest, + assets: super::transfer_assets_using_type_and_then::Assets, + assets_transfer_type : super :: transfer_assets_using_type_and_then :: AssetsTransferType, + remote_fees_id: super::transfer_assets_using_type_and_then::RemoteFeesId, + fees_transfer_type : super :: transfer_assets_using_type_and_then :: FeesTransferType, + custom_xcm_on_dest : super :: transfer_assets_using_type_and_then :: CustomXcmOnDest, + weight_limit: super::transfer_assets_using_type_and_then::WeightLimit, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "transfer_assets_using_type_and_then", + super::TransferAssetsUsingTypeAndThen { + dest: ::subxt::alloc::boxed::Box::new(dest), + assets: ::subxt::alloc::boxed::Box::new(assets), + assets_transfer_type: ::subxt::alloc::boxed::Box::new( + assets_transfer_type, + ), + remote_fees_id: ::subxt::alloc::boxed::Box::new(remote_fees_id), + fees_transfer_type: ::subxt::alloc::boxed::Box::new( + fees_transfer_type, + ), + custom_xcm_on_dest: ::subxt::alloc::boxed::Box::new( + custom_xcm_on_dest, + ), + weight_limit, + }, + [ + 199u8, 248u8, 143u8, 192u8, 39u8, 87u8, 220u8, 150u8, 207u8, 131u8, + 122u8, 214u8, 240u8, 15u8, 201u8, 146u8, 166u8, 101u8, 154u8, + 151u8, 218u8, 25u8, 195u8, 200u8, 96u8, 141u8, 210u8, 113u8, 16u8, + 238u8, 208u8, 192u8, + ], + ) + } + #[doc = "Authorize another `aliaser` location to alias into the local `origin` making this call."] + #[doc = "The `aliaser` is only authorized until the provided `expiry` block number."] + #[doc = "The call can also be used for a previously authorized alias in order to update its"] + #[doc = "`expiry` block number."] + #[doc = ""] + #[doc = "Usually useful to allow your local account to be aliased into from a remote location"] + #[doc = "also under your control (like your account on another chain)."] + #[doc = ""] + #[doc = "WARNING: make sure the caller `origin` (you) trusts the `aliaser` location to act in"] + #[doc = "their/your name. Once authorized using this call, the `aliaser` can freely impersonate"] + #[doc = "`origin` in XCM programs executed on the local chain."] + pub fn add_authorized_alias( + &self, + aliaser: super::add_authorized_alias::Aliaser, + expires: super::add_authorized_alias::Expires, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "add_authorized_alias", + super::AddAuthorizedAlias { + aliaser: ::subxt::alloc::boxed::Box::new(aliaser), + expires, + }, + [ + 223u8, 55u8, 95u8, 81u8, 3u8, 249u8, 197u8, 169u8, 247u8, 139u8, + 84u8, 142u8, 87u8, 70u8, 51u8, 169u8, 137u8, 190u8, 116u8, 253u8, + 220u8, 101u8, 221u8, 132u8, 245u8, 23u8, 0u8, 212u8, 3u8, 54u8, + 60u8, 78u8, + ], + ) + } + #[doc = "Remove a previously authorized `aliaser` from the list of locations that can alias into"] + #[doc = "the local `origin` making this call."] + pub fn remove_authorized_alias( + &self, + aliaser: super::remove_authorized_alias::Aliaser, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "remove_authorized_alias", + super::RemoveAuthorizedAlias { + aliaser: ::subxt::alloc::boxed::Box::new(aliaser), + }, + [ + 210u8, 231u8, 143u8, 176u8, 120u8, 169u8, 22u8, 200u8, 5u8, 41u8, + 51u8, 229u8, 158u8, 72u8, 19u8, 54u8, 204u8, 207u8, 191u8, 47u8, + 145u8, 71u8, 204u8, 235u8, 75u8, 245u8, 190u8, 106u8, 119u8, 203u8, + 66u8, 0u8, + ], + ) + } + #[doc = "Remove all previously authorized `aliaser`s that can alias into the local `origin`"] + #[doc = "making this call."] + pub fn remove_all_authorized_aliases( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "XcmPallet", + "remove_all_authorized_aliases", + super::RemoveAllAuthorizedAliases {}, + [ + 223u8, 17u8, 58u8, 180u8, 190u8, 164u8, 106u8, 17u8, 237u8, 243u8, + 160u8, 39u8, 13u8, 103u8, 166u8, 51u8, 192u8, 73u8, 193u8, 21u8, + 69u8, 170u8, 101u8, 195u8, 42u8, 123u8, 56u8, 90u8, 8u8, 109u8, + 15u8, 110u8, + ], + ) + } } } } @@ -43007,12 +44009,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Execution of an XCM message was attempted."] pub struct Attempted { pub outcome: attempted::Outcome, @@ -43021,17 +44023,22 @@ pub mod api { use super::runtime_types; pub type Outcome = runtime_types::staging_xcm::v5::traits::Outcome; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Attempted { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "Attempted"; + impl Attempted { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "Attempted"; + } + impl ::subxt::events::DecodeAsEvent for Attempted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An XCM message was sent."] pub struct Sent { pub origin: sent::Origin, @@ -43046,17 +44053,22 @@ pub mod api { pub type Message = runtime_types::staging_xcm::v5::Xcm; pub type MessageId = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Sent { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "Sent"; + impl Sent { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "Sent"; + } + impl ::subxt::events::DecodeAsEvent for Sent { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An XCM message failed to send."] pub struct SendFailed { pub origin: send_failed::Origin, @@ -43071,17 +44083,22 @@ pub mod api { pub type Error = runtime_types::xcm::v3::traits::SendError; pub type MessageId = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SendFailed { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "SendFailed"; + impl SendFailed { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "SendFailed"; + } + impl ::subxt::events::DecodeAsEvent for SendFailed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An XCM message failed to process."] pub struct ProcessXcmError { pub origin: process_xcm_error::Origin, @@ -43094,17 +44111,22 @@ pub mod api { pub type Error = runtime_types::xcm::v5::traits::Error; pub type MessageId = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ProcessXcmError { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "ProcessXcmError"; + impl ProcessXcmError { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "ProcessXcmError"; + } + impl ::subxt::events::DecodeAsEvent for ProcessXcmError { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Query response received which does not match a registered query. This may be because a"] #[doc = "matching query was never registered, it may be because it is a duplicate response, or"] #[doc = "because the query timed out."] @@ -43117,17 +44139,22 @@ pub mod api { pub type Origin = runtime_types::staging_xcm::v5::location::Location; pub type QueryId = ::core::primitive::u64; } - impl ::subxt::ext::subxt_core::events::StaticEvent for UnexpectedResponse { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "UnexpectedResponse"; + impl UnexpectedResponse { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "UnexpectedResponse"; + } + impl ::subxt::events::DecodeAsEvent for UnexpectedResponse { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Query response has been received and is ready for taking with `take_response`. There is"] #[doc = "no registered notification call."] pub struct ResponseReady { @@ -43139,17 +44166,22 @@ pub mod api { pub type QueryId = ::core::primitive::u64; pub type Response = runtime_types::staging_xcm::v5::Response; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ResponseReady { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "ResponseReady"; + impl ResponseReady { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "ResponseReady"; + } + impl ::subxt::events::DecodeAsEvent for ResponseReady { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Query response has been received and query is removed. The registered notification has"] #[doc = "been dispatched and executed successfully."] pub struct Notified { @@ -43163,17 +44195,22 @@ pub mod api { pub type PalletIndex = ::core::primitive::u8; pub type CallIndex = ::core::primitive::u8; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Notified { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "Notified"; + impl Notified { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "Notified"; + } + impl ::subxt::events::DecodeAsEvent for Notified { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Query response has been received and query is removed. The registered notification"] #[doc = "could not be dispatched because the dispatch weight is greater than the maximum weight"] #[doc = "originally budgeted by this runtime for the query result."] @@ -43192,17 +44229,22 @@ pub mod api { pub type ActualWeight = runtime_types::sp_weights::weight_v2::Weight; pub type MaxBudgetedWeight = runtime_types::sp_weights::weight_v2::Weight; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NotifyOverweight { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyOverweight"; + impl NotifyOverweight { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "NotifyOverweight"; + } + impl ::subxt::events::DecodeAsEvent for NotifyOverweight { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Query response has been received and query is removed. There was a general error with"] #[doc = "dispatching the notification call."] pub struct NotifyDispatchError { @@ -43216,17 +44258,22 @@ pub mod api { pub type PalletIndex = ::core::primitive::u8; pub type CallIndex = ::core::primitive::u8; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NotifyDispatchError { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyDispatchError"; + impl NotifyDispatchError { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "NotifyDispatchError"; + } + impl ::subxt::events::DecodeAsEvent for NotifyDispatchError { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Query response has been received and query is removed. The dispatch was unable to be"] #[doc = "decoded into a `Call`; this might be due to dispatch function having a signature which"] #[doc = "is not `(origin, QueryId, Response)`."] @@ -43241,17 +44288,22 @@ pub mod api { pub type PalletIndex = ::core::primitive::u8; pub type CallIndex = ::core::primitive::u8; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NotifyDecodeFailed { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyDecodeFailed"; + impl NotifyDecodeFailed { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "NotifyDecodeFailed"; + } + impl ::subxt::events::DecodeAsEvent for NotifyDecodeFailed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Expected query response has been received but the origin location of the response does"] #[doc = "not match that expected. The query remains registered for a later, valid, response to"] #[doc = "be received and acted upon."] @@ -43267,17 +44319,22 @@ pub mod api { pub type ExpectedLocation = ::core::option::Option; } - impl ::subxt::ext::subxt_core::events::StaticEvent for InvalidResponder { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "InvalidResponder"; + impl InvalidResponder { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "InvalidResponder"; + } + impl ::subxt::events::DecodeAsEvent for InvalidResponder { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Expected query response has been received but the expected origin location placed in"] #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] #[doc = ""] @@ -43294,17 +44351,22 @@ pub mod api { pub type Origin = runtime_types::staging_xcm::v5::location::Location; pub type QueryId = ::core::primitive::u64; } - impl ::subxt::ext::subxt_core::events::StaticEvent for InvalidResponderVersion { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "InvalidResponderVersion"; + impl InvalidResponderVersion { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "InvalidResponderVersion"; + } + impl ::subxt::events::DecodeAsEvent for InvalidResponderVersion { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Received query response has been read and removed."] pub struct ResponseTaken { pub query_id: response_taken::QueryId, @@ -43313,17 +44375,22 @@ pub mod api { use super::runtime_types; pub type QueryId = ::core::primitive::u64; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ResponseTaken { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "ResponseTaken"; + impl ResponseTaken { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "ResponseTaken"; + } + impl ::subxt::events::DecodeAsEvent for ResponseTaken { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some assets have been placed in an asset trap."] pub struct AssetsTrapped { pub hash: assets_trapped::Hash, @@ -43332,21 +44399,26 @@ pub mod api { } pub mod assets_trapped { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Hash = ::subxt::utils::H256; pub type Origin = runtime_types::staging_xcm::v5::location::Location; pub type Assets = runtime_types::xcm::VersionedAssets; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetsTrapped { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "AssetsTrapped"; + impl AssetsTrapped { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "AssetsTrapped"; + } + impl ::subxt::events::DecodeAsEvent for AssetsTrapped { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An XCM version change notification message has been attempted to be sent."] #[doc = ""] #[doc = "The cost of sending it (borne by the chain) is included."] @@ -43363,17 +44435,22 @@ pub mod api { pub type Cost = runtime_types::staging_xcm::v5::asset::Assets; pub type MessageId = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VersionChangeNotified { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "VersionChangeNotified"; + impl VersionChangeNotified { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "VersionChangeNotified"; + } + impl ::subxt::events::DecodeAsEvent for VersionChangeNotified { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The supported version of a location has been changed. This might be through an"] #[doc = "automatic notification or a manual intervention."] pub struct SupportedVersionChanged { @@ -43385,17 +44462,22 @@ pub mod api { pub type Location = runtime_types::staging_xcm::v5::location::Location; pub type Version = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SupportedVersionChanged { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "SupportedVersionChanged"; + impl SupportedVersionChanged { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "SupportedVersionChanged"; + } + impl ::subxt::events::DecodeAsEvent for SupportedVersionChanged { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A given location which had a version change subscription was dropped owing to an error"] #[doc = "sending the notification to it."] pub struct NotifyTargetSendFail { @@ -43409,17 +44491,22 @@ pub mod api { pub type QueryId = ::core::primitive::u64; pub type Error = runtime_types::xcm::v5::traits::Error; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NotifyTargetSendFail { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyTargetSendFail"; + impl NotifyTargetSendFail { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "NotifyTargetSendFail"; + } + impl ::subxt::events::DecodeAsEvent for NotifyTargetSendFail { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A given location which had a version change subscription was dropped owing to an error"] #[doc = "migrating the location to our new XCM format."] pub struct NotifyTargetMigrationFail { @@ -43431,17 +44518,22 @@ pub mod api { pub type Location = runtime_types::xcm::VersionedLocation; pub type QueryId = ::core::primitive::u64; } - impl ::subxt::ext::subxt_core::events::StaticEvent for NotifyTargetMigrationFail { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyTargetMigrationFail"; + impl NotifyTargetMigrationFail { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "NotifyTargetMigrationFail"; + } + impl ::subxt::events::DecodeAsEvent for NotifyTargetMigrationFail { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Expected query response has been received but the expected querier location placed in"] #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] #[doc = ""] @@ -43458,17 +44550,22 @@ pub mod api { pub type Origin = runtime_types::staging_xcm::v5::location::Location; pub type QueryId = ::core::primitive::u64; } - impl ::subxt::ext::subxt_core::events::StaticEvent for InvalidQuerierVersion { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "InvalidQuerierVersion"; + impl InvalidQuerierVersion { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "InvalidQuerierVersion"; + } + impl ::subxt::events::DecodeAsEvent for InvalidQuerierVersion { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Expected query response has been received but the querier location of the response does"] #[doc = "not match the expected. The query remains registered for a later, valid, response to"] #[doc = "be received and acted upon."] @@ -43486,17 +44583,22 @@ pub mod api { pub type MaybeActualQuerier = ::core::option::Option; } - impl ::subxt::ext::subxt_core::events::StaticEvent for InvalidQuerier { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "InvalidQuerier"; + impl InvalidQuerier { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "InvalidQuerier"; + } + impl ::subxt::events::DecodeAsEvent for InvalidQuerier { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A remote has requested XCM version change notification from us and we have honored it."] #[doc = "A version information message is sent to them and its cost is included."] pub struct VersionNotifyStarted { @@ -43510,17 +44612,22 @@ pub mod api { pub type Cost = runtime_types::staging_xcm::v5::asset::Assets; pub type MessageId = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VersionNotifyStarted { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "VersionNotifyStarted"; + impl VersionNotifyStarted { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "VersionNotifyStarted"; + } + impl ::subxt::events::DecodeAsEvent for VersionNotifyStarted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "We have requested that a remote chain send us XCM version change notifications."] pub struct VersionNotifyRequested { pub destination: version_notify_requested::Destination, @@ -43533,17 +44640,22 @@ pub mod api { pub type Cost = runtime_types::staging_xcm::v5::asset::Assets; pub type MessageId = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VersionNotifyRequested { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "VersionNotifyRequested"; + impl VersionNotifyRequested { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "VersionNotifyRequested"; + } + impl ::subxt::events::DecodeAsEvent for VersionNotifyRequested { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "We have requested that a remote chain stops sending us XCM version change"] #[doc = "notifications."] pub struct VersionNotifyUnrequested { @@ -43557,17 +44669,22 @@ pub mod api { pub type Cost = runtime_types::staging_xcm::v5::asset::Assets; pub type MessageId = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VersionNotifyUnrequested { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "VersionNotifyUnrequested"; + impl VersionNotifyUnrequested { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "VersionNotifyUnrequested"; + } + impl ::subxt::events::DecodeAsEvent for VersionNotifyUnrequested { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Fees were paid from a location for an operation (often for using `SendXcm`)."] pub struct FeesPaid { pub paying: fees_paid::Paying, @@ -43578,17 +44695,22 @@ pub mod api { pub type Paying = runtime_types::staging_xcm::v5::location::Location; pub type Fees = runtime_types::staging_xcm::v5::asset::Assets; } - impl ::subxt::ext::subxt_core::events::StaticEvent for FeesPaid { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "FeesPaid"; + impl FeesPaid { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "FeesPaid"; + } + impl ::subxt::events::DecodeAsEvent for FeesPaid { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some assets have been claimed from an asset trap"] pub struct AssetsClaimed { pub hash: assets_claimed::Hash, @@ -43597,21 +44719,26 @@ pub mod api { } pub mod assets_claimed { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Hash = ::subxt::utils::H256; pub type Origin = runtime_types::staging_xcm::v5::location::Location; pub type Assets = runtime_types::xcm::VersionedAssets; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetsClaimed { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "AssetsClaimed"; + impl AssetsClaimed { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "AssetsClaimed"; + } + impl ::subxt::events::DecodeAsEvent for AssetsClaimed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A XCM version migration finished."] pub struct VersionMigrationFinished { pub version: version_migration_finished::Version, @@ -43620,17 +44747,22 @@ pub mod api { use super::runtime_types; pub type Version = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VersionMigrationFinished { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "VersionMigrationFinished"; + impl VersionMigrationFinished { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "VersionMigrationFinished"; + } + impl ::subxt::events::DecodeAsEvent for VersionMigrationFinished { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "An `aliaser` location was authorized by `target` to alias it, authorization valid until"] #[doc = "`expiry` block number."] pub struct AliasAuthorized { @@ -43644,17 +44776,22 @@ pub mod api { pub type Target = runtime_types::staging_xcm::v5::location::Location; pub type Expiry = ::core::option::Option<::core::primitive::u64>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AliasAuthorized { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "AliasAuthorized"; + impl AliasAuthorized { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "AliasAuthorized"; + } + impl ::subxt::events::DecodeAsEvent for AliasAuthorized { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "`target` removed alias authorization for `aliaser`."] pub struct AliasAuthorizationRemoved { pub aliaser: alias_authorization_removed::Aliaser, @@ -43665,17 +44802,22 @@ pub mod api { pub type Aliaser = runtime_types::staging_xcm::v5::location::Location; pub type Target = runtime_types::staging_xcm::v5::location::Location; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AliasAuthorizationRemoved { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "AliasAuthorizationRemoved"; + impl AliasAuthorizationRemoved { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "AliasAuthorizationRemoved"; + } + impl ::subxt::events::DecodeAsEvent for AliasAuthorizationRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "`target` removed all alias authorizations."] pub struct AliasesAuthorizationsRemoved { pub target: aliases_authorizations_removed::Target, @@ -43684,9 +44826,14 @@ pub mod api { use super::runtime_types; pub type Target = runtime_types::staging_xcm::v5::location::Location; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AliasesAuthorizationsRemoved { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "AliasesAuthorizationsRemoved"; + impl AliasesAuthorizationsRemoved { + const PALLET_NAME: &'static str = "XcmPallet"; + const EVENT_NAME: &'static str = "AliasesAuthorizationsRemoved"; + } + impl ::subxt::events::DecodeAsEvent for AliasesAuthorizationsRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -43697,12 +44844,9 @@ pub mod api { #[doc = " The latest available query index."] pub fn query_counter( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - query_counter::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), query_counter::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "QueryCounter", [ @@ -43715,12 +44859,12 @@ pub mod api { #[doc = " The ongoing queries."] pub fn queries( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (queries::Param0,), - queries::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (queries::input::Param0,), + queries::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "Queries", [ @@ -43737,12 +44881,12 @@ pub mod api { #[doc = " times this pair has been trapped (usually just 1 if it exists at all)."] pub fn asset_traps( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (asset_traps::Param0,), - asset_traps::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (asset_traps::input::Param0,), + asset_traps::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "AssetTraps", [ @@ -43756,12 +44900,12 @@ pub mod api { #[doc = " then the destinations whose XCM version is unknown are considered unreachable."] pub fn safe_xcm_version( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - safe_xcm_version::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + safe_xcm_version::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "SafeXcmVersion", [ @@ -43774,12 +44918,15 @@ pub mod api { #[doc = " The Latest versions that we know various locations support."] pub fn supported_version( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (supported_version::Param0, supported_version::Param1), - supported_version::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + ( + supported_version::input::Param0, + supported_version::input::Param1, + ), + supported_version::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "SupportedVersion", [ @@ -43793,12 +44940,15 @@ pub mod api { #[doc = " All locations that we have requested version notifications from."] pub fn version_notifiers( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (version_notifiers::Param0, version_notifiers::Param1), - version_notifiers::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + ( + version_notifiers::input::Param0, + version_notifiers::input::Param1, + ), + version_notifiers::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "VersionNotifiers", [ @@ -43813,15 +44963,15 @@ pub mod api { #[doc = " of our versions we informed them of."] pub fn version_notify_targets( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< ( - version_notify_targets::Param0, - version_notify_targets::Param1, + version_notify_targets::input::Param0, + version_notify_targets::input::Param1, ), - version_notify_targets::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + version_notify_targets::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "VersionNotifyTargets", [ @@ -43836,12 +44986,12 @@ pub mod api { #[doc = " which is used as a prioritization."] pub fn version_discovery_queue( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - version_discovery_queue::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + version_discovery_queue::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "VersionDiscoveryQueue", [ @@ -43855,12 +45005,12 @@ pub mod api { #[doc = " The current migration's stage, if any."] pub fn current_migration( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - current_migration::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + current_migration::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "CurrentMigration", [ @@ -43873,16 +45023,16 @@ pub mod api { #[doc = " Fungible assets which we know are locked on a remote chain."] pub fn remote_locked_fungibles( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< ( - remote_locked_fungibles::Param0, - remote_locked_fungibles::Param1, - remote_locked_fungibles::Param2, + remote_locked_fungibles::input::Param0, + remote_locked_fungibles::input::Param1, + remote_locked_fungibles::input::Param2, ), - remote_locked_fungibles::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + remote_locked_fungibles::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "RemoteLockedFungibles", [ @@ -43895,12 +45045,12 @@ pub mod api { #[doc = " Fungible assets which we know are locked on this chain."] pub fn locked_fungibles( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (locked_fungibles::Param0,), - locked_fungibles::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (locked_fungibles::input::Param0,), + locked_fungibles::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "LockedFungibles", [ @@ -43914,12 +45064,12 @@ pub mod api { #[doc = " Global suspension state of the XCM executor."] pub fn xcm_execution_suspended( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - xcm_execution_suspended::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + xcm_execution_suspended::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "XcmExecutionSuspended", [ @@ -43938,12 +45088,12 @@ pub mod api { #[doc = " implementation in the XCM executor configuration."] pub fn should_record_xcm( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - should_record_xcm::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + should_record_xcm::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "ShouldRecordXcm", [ @@ -43961,12 +45111,9 @@ pub mod api { #[doc = " implementation in the XCM executor configuration."] pub fn recorded_xcm( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - recorded_xcm::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), recorded_xcm::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "RecordedXcm", [ @@ -43982,12 +45129,12 @@ pub mod api { #[doc = " block number."] pub fn authorized_aliases( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (authorized_aliases::Param0,), - authorized_aliases::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (authorized_aliases::input::Param0,), + authorized_aliases::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "XcmPallet", "AuthorizedAliases", [ @@ -44001,152 +45148,149 @@ pub mod api { pub mod query_counter { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u64; } + pub type Output = ::core::primitive::u64; } pub mod queries { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u64; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::pallet_xcm::pallet::QueryStatus<::core::primitive::u32>; + pub type Param0 = ::core::primitive::u64; } + pub type Output = + runtime_types::pallet_xcm::pallet::QueryStatus<::core::primitive::u32>; } pub mod asset_traps { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::subxt::utils::H256; } + pub type Output = ::core::primitive::u32; } pub mod safe_xcm_version { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod supported_version { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::xcm::VersionedLocation; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::xcm::VersionedLocation; } + pub type Output = ::core::primitive::u32; } pub mod version_notifiers { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::xcm::VersionedLocation; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u64; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::xcm::VersionedLocation; } + pub type Output = ::core::primitive::u64; } pub mod version_notify_targets { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::xcm::VersionedLocation; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ( - ::core::primitive::u64, - runtime_types::sp_weights::weight_v2::Weight, - ::core::primitive::u32, - ); + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::xcm::VersionedLocation; } + pub type Output = ( + ::core::primitive::u64, + runtime_types::sp_weights::weight_v2::Weight, + ::core::primitive::u32, + ); } pub mod version_discovery_queue { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - runtime_types::xcm::VersionedLocation, - ::core::primitive::u32, - )>; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec<( + runtime_types::xcm::VersionedLocation, + ::core::primitive::u32, + )>; } pub mod current_migration { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_xcm::pallet::VersionMigrationStage; } + pub type Output = runtime_types::pallet_xcm::pallet::VersionMigrationStage; } pub mod remote_locked_fungibles { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param2 = runtime_types::xcm::VersionedAssetId; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::pallet_xcm::pallet::RemoteLockedFungibleRecord<()>; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::utils::AccountId32; + pub type Param2 = runtime_types::xcm::VersionedAssetId; } + pub type Output = runtime_types::pallet_xcm::pallet::RemoteLockedFungibleRecord<()>; } pub mod locked_fungibles { use super::root_mod; use super::runtime_types; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u128, - runtime_types::xcm::VersionedLocation, - )>; + pub type Param0 = ::subxt::utils::AccountId32; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u128, + runtime_types::xcm::VersionedLocation, + )>; } pub mod xcm_execution_suspended { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::bool; } + pub type Output = ::core::primitive::bool; } pub mod should_record_xcm { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::bool; } + pub type Output = ::core::primitive::bool; } pub mod recorded_xcm { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::staging_xcm::v5::Xcm; } + pub type Output = runtime_types::staging_xcm::v5::Xcm; } pub mod authorized_aliases { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::xcm::VersionedLocation; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::pallet_xcm::AuthorizedAliasesEntry< - runtime_types::frame_support::traits::storage::Disabled, - runtime_types::pallet_xcm::pallet::MaxAuthorizedAliases, - >; + pub type Param0 = runtime_types::xcm::VersionedLocation; } + pub type Output = runtime_types::pallet_xcm::AuthorizedAliasesEntry< + runtime_types::frame_support::traits::storage::Disabled, + runtime_types::pallet_xcm::pallet::MaxAuthorizedAliases, + >; } } pub mod constants { @@ -44156,10 +45300,10 @@ pub mod api { #[doc = " This chain's Universal Location."] pub fn universal_location( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ) -> ::subxt::constants::StaticAddress< runtime_types::staging_xcm::v5::junctions::Junctions, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::constants::StaticAddress::new_static( "XcmPallet", "UniversalLocation", [ @@ -44174,10 +45318,8 @@ pub mod api { #[doc = " `pallet_xcm::CurrentXcmVersion`."] pub fn advertised_xcm_version( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "XcmPallet", "AdvertisedXcmVersion", [ @@ -44191,10 +45333,8 @@ pub mod api { #[doc = " The maximum number of local XCM locks that a single account may have."] pub fn max_lockers( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "XcmPallet", "MaxLockers", [ @@ -44208,10 +45348,8 @@ pub mod api { #[doc = " The maximum number of consumers a single remote lock may have."] pub fn max_remote_lock_consumers( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "XcmPallet", "MaxRemoteLockConsumers", [ @@ -44235,451 +45373,446 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + pub struct ReportDoubleVoting { + pub equivocation_proof: + ::subxt::alloc::boxed::Box, + pub key_owner_proof: report_double_voting::KeyOwnerProof, + } + pub mod report_double_voting { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - pub struct ReportDoubleVoting { - pub equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_double_voting::EquivocationProof, - >, - pub key_owner_proof: report_double_voting::KeyOwnerProof, - } - pub mod report_double_voting { - use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_beefy::DoubleVotingProof< - ::core::primitive::u32, - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - runtime_types::sp_consensus_beefy::ecdsa_crypto::Signature, - >; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportDoubleVoting { - const PALLET: &'static str = "Beefy"; - const CALL: &'static str = "report_double_voting"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub struct ReportDoubleVotingUnsigned { - pub equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_double_voting_unsigned::EquivocationProof, - >, - pub key_owner_proof: report_double_voting_unsigned::KeyOwnerProof, - } - pub mod report_double_voting_unsigned { - use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_beefy::DoubleVotingProof< - ::core::primitive::u32, - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - runtime_types::sp_consensus_beefy::ecdsa_crypto::Signature, - >; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportDoubleVotingUnsigned { - const PALLET: &'static str = "Beefy"; - const CALL: &'static str = "report_double_voting_unsigned"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Reset BEEFY consensus by setting a new BEEFY genesis at `delay_in_blocks` blocks in the"] - #[doc = "future."] - #[doc = ""] - #[doc = "Note: `delay_in_blocks` has to be at least 1."] - pub struct SetNewGenesis { - pub delay_in_blocks: set_new_genesis::DelayInBlocks, - } - pub mod set_new_genesis { - use super::runtime_types; - pub type DelayInBlocks = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetNewGenesis { - const PALLET: &'static str = "Beefy"; - const CALL: &'static str = "set_new_genesis"; + pub type EquivocationProof = runtime_types::sp_consensus_beefy::DoubleVotingProof< + ::core::primitive::u32, + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + runtime_types::sp_consensus_beefy::ecdsa_crypto::Signature, + >; + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + impl ReportDoubleVoting { + const PALLET_NAME: &'static str = "Beefy"; + const CALL_NAME: &'static str = "report_double_voting"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportDoubleVoting { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Report fork voting equivocation. This method will verify the equivocation proof"] - #[doc = "and validate the given key ownership proof against the extracted offender."] - #[doc = "If both are valid, the offence will be reported."] - pub struct ReportForkVoting { - pub equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_fork_voting::EquivocationProof, - >, - pub key_owner_proof: report_fork_voting::KeyOwnerProof, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub struct ReportDoubleVotingUnsigned { + pub equivocation_proof: + ::subxt::alloc::boxed::Box, + pub key_owner_proof: report_double_voting_unsigned::KeyOwnerProof, + } + pub mod report_double_voting_unsigned { + use super::runtime_types; + pub type EquivocationProof = runtime_types::sp_consensus_beefy::DoubleVotingProof< + ::core::primitive::u32, + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + runtime_types::sp_consensus_beefy::ecdsa_crypto::Signature, + >; + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + impl ReportDoubleVotingUnsigned { + const PALLET_NAME: &'static str = "Beefy"; + const CALL_NAME: &'static str = "report_double_voting_unsigned"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportDoubleVotingUnsigned { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod report_fork_voting { - use super::runtime_types; - pub type EquivocationProof = runtime_types::sp_consensus_beefy::ForkVotingProof< - runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - runtime_types::sp_mmr_primitives::AncestryProof< - ::subxt::ext::subxt_core::utils::H256, - >, - >; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Reset BEEFY consensus by setting a new BEEFY genesis at `delay_in_blocks` blocks in the"] + #[doc = "future."] + #[doc = ""] + #[doc = "Note: `delay_in_blocks` has to be at least 1."] + pub struct SetNewGenesis { + pub delay_in_blocks: set_new_genesis::DelayInBlocks, + } + pub mod set_new_genesis { + use super::runtime_types; + pub type DelayInBlocks = ::core::primitive::u32; + } + impl SetNewGenesis { + const PALLET_NAME: &'static str = "Beefy"; + const CALL_NAME: &'static str = "set_new_genesis"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetNewGenesis { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportForkVoting { - const PALLET: &'static str = "Beefy"; - const CALL: &'static str = "report_fork_voting"; + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Report fork voting equivocation. This method will verify the equivocation proof"] + #[doc = "and validate the given key ownership proof against the extracted offender."] + #[doc = "If both are valid, the offence will be reported."] + pub struct ReportForkVoting { + pub equivocation_proof: + ::subxt::alloc::boxed::Box, + pub key_owner_proof: report_fork_voting::KeyOwnerProof, + } + pub mod report_fork_voting { + use super::runtime_types; + pub type EquivocationProof = runtime_types::sp_consensus_beefy::ForkVotingProof< + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + runtime_types::sp_mmr_primitives::AncestryProof<::subxt::utils::H256>, + >; + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + impl ReportForkVoting { + const PALLET_NAME: &'static str = "Beefy"; + const CALL_NAME: &'static str = "report_fork_voting"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportForkVoting { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Report fork voting equivocation. This method will verify the equivocation proof"] - #[doc = "and validate the given key ownership proof against the extracted offender."] - #[doc = "If both are valid, the offence will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub struct ReportForkVotingUnsigned { - pub equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_fork_voting_unsigned::EquivocationProof, - >, - pub key_owner_proof: report_fork_voting_unsigned::KeyOwnerProof, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Report fork voting equivocation. This method will verify the equivocation proof"] + #[doc = "and validate the given key ownership proof against the extracted offender."] + #[doc = "If both are valid, the offence will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub struct ReportForkVotingUnsigned { + pub equivocation_proof: + ::subxt::alloc::boxed::Box, + pub key_owner_proof: report_fork_voting_unsigned::KeyOwnerProof, + } + pub mod report_fork_voting_unsigned { + use super::runtime_types; + pub type EquivocationProof = runtime_types::sp_consensus_beefy::ForkVotingProof< + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + runtime_types::sp_mmr_primitives::AncestryProof<::subxt::utils::H256>, + >; + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + impl ReportForkVotingUnsigned { + const PALLET_NAME: &'static str = "Beefy"; + const CALL_NAME: &'static str = "report_fork_voting_unsigned"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportForkVotingUnsigned { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub mod report_fork_voting_unsigned { - use super::runtime_types; - pub type EquivocationProof = runtime_types::sp_consensus_beefy::ForkVotingProof< - runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Report future block voting equivocation. This method will verify the equivocation proof"] + #[doc = "and validate the given key ownership proof against the extracted offender."] + #[doc = "If both are valid, the offence will be reported."] + pub struct ReportFutureBlockVoting { + pub equivocation_proof: + ::subxt::alloc::boxed::Box, + pub key_owner_proof: report_future_block_voting::KeyOwnerProof, + } + pub mod report_future_block_voting { + use super::runtime_types; + pub type EquivocationProof = + runtime_types::sp_consensus_beefy::FutureBlockVotingProof< + ::core::primitive::u32, runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - runtime_types::sp_mmr_primitives::AncestryProof< - ::subxt::ext::subxt_core::utils::H256, - >, >; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportForkVotingUnsigned { - const PALLET: &'static str = "Beefy"; - const CALL: &'static str = "report_fork_voting_unsigned"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Report future block voting equivocation. This method will verify the equivocation proof"] - #[doc = "and validate the given key ownership proof against the extracted offender."] - #[doc = "If both are valid, the offence will be reported."] - pub struct ReportFutureBlockVoting { - pub equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_future_block_voting::EquivocationProof, - >, - pub key_owner_proof: report_future_block_voting::KeyOwnerProof, - } - pub mod report_future_block_voting { - use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_beefy::FutureBlockVotingProof< - ::core::primitive::u32, - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - >; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportFutureBlockVoting { - const PALLET: &'static str = "Beefy"; - const CALL: &'static str = "report_future_block_voting"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Report future block voting equivocation. This method will verify the equivocation proof"] - #[doc = "and validate the given key ownership proof against the extracted offender."] - #[doc = "If both are valid, the offence will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub struct ReportFutureBlockVotingUnsigned { - pub equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< - report_future_block_voting_unsigned::EquivocationProof, - >, - pub key_owner_proof: report_future_block_voting_unsigned::KeyOwnerProof, - } - pub mod report_future_block_voting_unsigned { - use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_beefy::FutureBlockVotingProof< - ::core::primitive::u32, - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - >; - pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReportFutureBlockVotingUnsigned { - const PALLET: &'static str = "Beefy"; - const CALL: &'static str = "report_future_block_voting_unsigned"; - } + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - pub fn report_double_voting( - &self, - equivocation_proof: types::report_double_voting::EquivocationProof, - key_owner_proof: types::report_double_voting::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Beefy", - "report_double_voting", - types::ReportDoubleVoting { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }, - [ - 191u8, 103u8, 205u8, 53u8, 2u8, 139u8, 97u8, 160u8, 39u8, 60u8, 235u8, - 187u8, 152u8, 245u8, 107u8, 55u8, 254u8, 113u8, 243u8, 116u8, 173u8, - 138u8, 229u8, 141u8, 9u8, 14u8, 113u8, 35u8, 47u8, 56u8, 34u8, 211u8, - ], - ) - } - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub fn report_double_voting_unsigned( - &self, - equivocation_proof: types::report_double_voting_unsigned::EquivocationProof, - key_owner_proof: types::report_double_voting_unsigned::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ReportDoubleVotingUnsigned, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Beefy", - "report_double_voting_unsigned", - types::ReportDoubleVotingUnsigned { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }, - [ - 160u8, 71u8, 106u8, 163u8, 14u8, 55u8, 54u8, 11u8, 239u8, 189u8, 185u8, - 175u8, 229u8, 60u8, 58u8, 164u8, 213u8, 195u8, 135u8, 216u8, 244u8, - 44u8, 23u8, 22u8, 67u8, 236u8, 253u8, 154u8, 170u8, 40u8, 46u8, 201u8, - ], - ) - } - #[doc = "Reset BEEFY consensus by setting a new BEEFY genesis at `delay_in_blocks` blocks in the"] - #[doc = "future."] - #[doc = ""] - #[doc = "Note: `delay_in_blocks` has to be at least 1."] - pub fn set_new_genesis( - &self, - delay_in_blocks: types::set_new_genesis::DelayInBlocks, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Beefy", - "set_new_genesis", - types::SetNewGenesis { delay_in_blocks }, - [ - 147u8, 6u8, 252u8, 43u8, 77u8, 91u8, 170u8, 45u8, 112u8, 155u8, 158u8, - 79u8, 1u8, 116u8, 162u8, 146u8, 181u8, 9u8, 171u8, 48u8, 198u8, 210u8, - 243u8, 64u8, 229u8, 35u8, 28u8, 177u8, 144u8, 22u8, 165u8, 163u8, - ], - ) - } - #[doc = "Report fork voting equivocation. This method will verify the equivocation proof"] - #[doc = "and validate the given key ownership proof against the extracted offender."] - #[doc = "If both are valid, the offence will be reported."] - pub fn report_fork_voting( - &self, - equivocation_proof: types::report_fork_voting::EquivocationProof, - key_owner_proof: types::report_fork_voting::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Beefy", - "report_fork_voting", - types::ReportForkVoting { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }, - [ - 103u8, 233u8, 45u8, 138u8, 239u8, 186u8, 23u8, 196u8, 43u8, 210u8, - 208u8, 15u8, 198u8, 49u8, 171u8, 183u8, 142u8, 163u8, 253u8, 226u8, - 207u8, 106u8, 84u8, 184u8, 12u8, 130u8, 78u8, 114u8, 195u8, 249u8, - 81u8, 84u8, - ], - ) - } - #[doc = "Report fork voting equivocation. This method will verify the equivocation proof"] - #[doc = "and validate the given key ownership proof against the extracted offender."] - #[doc = "If both are valid, the offence will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub fn report_fork_voting_unsigned( - &self, - equivocation_proof: types::report_fork_voting_unsigned::EquivocationProof, - key_owner_proof: types::report_fork_voting_unsigned::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ReportForkVotingUnsigned, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Beefy", - "report_fork_voting_unsigned", - types::ReportForkVotingUnsigned { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }, - [ - 211u8, 251u8, 231u8, 187u8, 27u8, 149u8, 165u8, 149u8, 133u8, 206u8, - 161u8, 106u8, 127u8, 114u8, 11u8, 99u8, 115u8, 165u8, 75u8, 25u8, 58u8, - 10u8, 100u8, 20u8, 27u8, 215u8, 53u8, 91u8, 180u8, 234u8, 146u8, 173u8, - ], - ) + impl ReportFutureBlockVoting { + const PALLET_NAME: &'static str = "Beefy"; + const CALL_NAME: &'static str = "report_future_block_voting"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportFutureBlockVoting { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Report future block voting equivocation. This method will verify the equivocation proof"] - #[doc = "and validate the given key ownership proof against the extracted offender."] - #[doc = "If both are valid, the offence will be reported."] - pub fn report_future_block_voting( - &self, - equivocation_proof: types::report_future_block_voting::EquivocationProof, - key_owner_proof: types::report_future_block_voting::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ReportFutureBlockVoting, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Beefy", - "report_future_block_voting", - types::ReportFutureBlockVoting { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }, - [ - 120u8, 166u8, 30u8, 87u8, 193u8, 115u8, 177u8, 199u8, 41u8, 88u8, - 241u8, 216u8, 207u8, 172u8, 220u8, 224u8, 39u8, 59u8, 233u8, 52u8, - 124u8, 180u8, 214u8, 243u8, 202u8, 101u8, 159u8, 95u8, 38u8, 141u8, - 177u8, 178u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Report future block voting equivocation. This method will verify the equivocation proof"] + #[doc = "and validate the given key ownership proof against the extracted offender."] + #[doc = "If both are valid, the offence will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub struct ReportFutureBlockVotingUnsigned { + pub equivocation_proof: ::subxt::alloc::boxed::Box< + report_future_block_voting_unsigned::EquivocationProof, + >, + pub key_owner_proof: report_future_block_voting_unsigned::KeyOwnerProof, + } + pub mod report_future_block_voting_unsigned { + use super::runtime_types; + pub type EquivocationProof = + runtime_types::sp_consensus_beefy::FutureBlockVotingProof< + ::core::primitive::u32, + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + >; + pub type KeyOwnerProof = runtime_types::sp_session::MembershipProof; + } + impl ReportFutureBlockVotingUnsigned { + const PALLET_NAME: &'static str = "Beefy"; + const CALL_NAME: &'static str = "report_future_block_voting_unsigned"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReportFutureBlockVotingUnsigned { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Report future block voting equivocation. This method will verify the equivocation proof"] - #[doc = "and validate the given key ownership proof against the extracted offender."] - #[doc = "If both are valid, the offence will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub fn report_future_block_voting_unsigned( - &self, - equivocation_proof : types :: report_future_block_voting_unsigned :: EquivocationProof, - key_owner_proof: types::report_future_block_voting_unsigned::KeyOwnerProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ReportFutureBlockVotingUnsigned, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Beefy", - "report_future_block_voting_unsigned", - types::ReportFutureBlockVotingUnsigned { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }, - [ - 138u8, 158u8, 33u8, 65u8, 55u8, 98u8, 124u8, 63u8, 104u8, 90u8, 211u8, - 249u8, 40u8, 126u8, 37u8, 101u8, 210u8, 168u8, 56u8, 209u8, 20u8, 26u8, - 166u8, 55u8, 4u8, 207u8, 49u8, 70u8, 110u8, 210u8, 239u8, 74u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + pub fn report_double_voting( + &self, + equivocation_proof: super::report_double_voting::EquivocationProof, + key_owner_proof: super::report_double_voting::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Beefy", + "report_double_voting", + super::ReportDoubleVoting { + equivocation_proof: ::subxt::alloc::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }, + [ + 191u8, 103u8, 205u8, 53u8, 2u8, 139u8, 97u8, 160u8, 39u8, 60u8, + 235u8, 187u8, 152u8, 245u8, 107u8, 55u8, 254u8, 113u8, 243u8, + 116u8, 173u8, 138u8, 229u8, 141u8, 9u8, 14u8, 113u8, 35u8, 47u8, + 56u8, 34u8, 211u8, + ], + ) + } + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub fn report_double_voting_unsigned( + &self, + equivocation_proof: super::report_double_voting_unsigned::EquivocationProof, + key_owner_proof: super::report_double_voting_unsigned::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Beefy", + "report_double_voting_unsigned", + super::ReportDoubleVotingUnsigned { + equivocation_proof: ::subxt::alloc::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }, + [ + 160u8, 71u8, 106u8, 163u8, 14u8, 55u8, 54u8, 11u8, 239u8, 189u8, + 185u8, 175u8, 229u8, 60u8, 58u8, 164u8, 213u8, 195u8, 135u8, 216u8, + 244u8, 44u8, 23u8, 22u8, 67u8, 236u8, 253u8, 154u8, 170u8, 40u8, + 46u8, 201u8, + ], + ) + } + #[doc = "Reset BEEFY consensus by setting a new BEEFY genesis at `delay_in_blocks` blocks in the"] + #[doc = "future."] + #[doc = ""] + #[doc = "Note: `delay_in_blocks` has to be at least 1."] + pub fn set_new_genesis( + &self, + delay_in_blocks: super::set_new_genesis::DelayInBlocks, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Beefy", + "set_new_genesis", + super::SetNewGenesis { delay_in_blocks }, + [ + 147u8, 6u8, 252u8, 43u8, 77u8, 91u8, 170u8, 45u8, 112u8, 155u8, + 158u8, 79u8, 1u8, 116u8, 162u8, 146u8, 181u8, 9u8, 171u8, 48u8, + 198u8, 210u8, 243u8, 64u8, 229u8, 35u8, 28u8, 177u8, 144u8, 22u8, + 165u8, 163u8, + ], + ) + } + #[doc = "Report fork voting equivocation. This method will verify the equivocation proof"] + #[doc = "and validate the given key ownership proof against the extracted offender."] + #[doc = "If both are valid, the offence will be reported."] + pub fn report_fork_voting( + &self, + equivocation_proof: super::report_fork_voting::EquivocationProof, + key_owner_proof: super::report_fork_voting::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Beefy", + "report_fork_voting", + super::ReportForkVoting { + equivocation_proof: ::subxt::alloc::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }, + [ + 103u8, 233u8, 45u8, 138u8, 239u8, 186u8, 23u8, 196u8, 43u8, 210u8, + 208u8, 15u8, 198u8, 49u8, 171u8, 183u8, 142u8, 163u8, 253u8, 226u8, + 207u8, 106u8, 84u8, 184u8, 12u8, 130u8, 78u8, 114u8, 195u8, 249u8, + 81u8, 84u8, + ], + ) + } + #[doc = "Report fork voting equivocation. This method will verify the equivocation proof"] + #[doc = "and validate the given key ownership proof against the extracted offender."] + #[doc = "If both are valid, the offence will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub fn report_fork_voting_unsigned( + &self, + equivocation_proof: super::report_fork_voting_unsigned::EquivocationProof, + key_owner_proof: super::report_fork_voting_unsigned::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Beefy", + "report_fork_voting_unsigned", + super::ReportForkVotingUnsigned { + equivocation_proof: ::subxt::alloc::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }, + [ + 211u8, 251u8, 231u8, 187u8, 27u8, 149u8, 165u8, 149u8, 133u8, + 206u8, 161u8, 106u8, 127u8, 114u8, 11u8, 99u8, 115u8, 165u8, 75u8, + 25u8, 58u8, 10u8, 100u8, 20u8, 27u8, 215u8, 53u8, 91u8, 180u8, + 234u8, 146u8, 173u8, + ], + ) + } + #[doc = "Report future block voting equivocation. This method will verify the equivocation proof"] + #[doc = "and validate the given key ownership proof against the extracted offender."] + #[doc = "If both are valid, the offence will be reported."] + pub fn report_future_block_voting( + &self, + equivocation_proof: super::report_future_block_voting::EquivocationProof, + key_owner_proof: super::report_future_block_voting::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Beefy", + "report_future_block_voting", + super::ReportFutureBlockVoting { + equivocation_proof: ::subxt::alloc::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }, + [ + 120u8, 166u8, 30u8, 87u8, 193u8, 115u8, 177u8, 199u8, 41u8, 88u8, + 241u8, 216u8, 207u8, 172u8, 220u8, 224u8, 39u8, 59u8, 233u8, 52u8, + 124u8, 180u8, 214u8, 243u8, 202u8, 101u8, 159u8, 95u8, 38u8, 141u8, + 177u8, 178u8, + ], + ) + } + #[doc = "Report future block voting equivocation. This method will verify the equivocation proof"] + #[doc = "and validate the given key ownership proof against the extracted offender."] + #[doc = "If both are valid, the offence will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub fn report_future_block_voting_unsigned( + &self, + equivocation_proof : super :: report_future_block_voting_unsigned :: EquivocationProof, + key_owner_proof: super::report_future_block_voting_unsigned::KeyOwnerProof, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Beefy", + "report_future_block_voting_unsigned", + super::ReportFutureBlockVotingUnsigned { + equivocation_proof: ::subxt::alloc::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }, + [ + 138u8, 158u8, 33u8, 65u8, 55u8, 98u8, 124u8, 63u8, 104u8, 90u8, + 211u8, 249u8, 40u8, 126u8, 37u8, 101u8, 210u8, 168u8, 56u8, 209u8, + 20u8, 26u8, 166u8, 55u8, 4u8, 207u8, 49u8, 70u8, 110u8, 210u8, + 239u8, 74u8, + ], + ) + } } } } @@ -44691,12 +45824,9 @@ pub mod api { #[doc = " The current authorities set"] pub fn authorities( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - authorities::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), authorities::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Beefy", "Authorities", [ @@ -44709,12 +45839,12 @@ pub mod api { #[doc = " The current validator set id"] pub fn validator_set_id( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - validator_set_id::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + validator_set_id::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Beefy", "ValidatorSetId", [ @@ -44728,12 +45858,12 @@ pub mod api { #[doc = " Authorities set scheduled to be used with the next session"] pub fn next_authorities( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - next_authorities::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + next_authorities::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Beefy", "NextAuthorities", [ @@ -44756,12 +45886,12 @@ pub mod api { #[doc = " TWOX-NOTE: `ValidatorSetId` is not under user control."] pub fn set_id_session( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (set_id_session::Param0,), - set_id_session::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (set_id_session::input::Param0,), + set_id_session::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Beefy", "SetIdSession", [ @@ -44777,12 +45907,9 @@ pub mod api { #[doc = " restarted from the newly set block number."] pub fn genesis_block( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - genesis_block::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), genesis_block::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Beefy", "GenesisBlock", [ @@ -44796,47 +45923,47 @@ pub mod api { pub mod authorities { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - >; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + >; } pub mod validator_set_id { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u64; } + pub type Output = ::core::primitive::u64; } pub mod next_authorities { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - >; } + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + >; } pub mod set_id_session { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u64; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u64; } + pub type Output = ::core::primitive::u32; } pub mod genesis_block { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::option::Option<::core::primitive::u32>; } + pub type Output = ::core::option::Option<::core::primitive::u32>; } } pub mod constants { @@ -44846,10 +45973,8 @@ pub mod api { #[doc = " The maximum number of authorities that can be added."] pub fn max_authorities( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Beefy", "MaxAuthorities", [ @@ -44863,10 +45988,8 @@ pub mod api { #[doc = " The maximum number of nominators for each validator."] pub fn max_nominators( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "Beefy", "MaxNominators", [ @@ -44885,10 +46008,8 @@ pub mod api { #[doc = " can be zero."] pub fn max_set_id_session_entries( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u64> { + ::subxt::constants::StaticAddress::new_static( "Beefy", "MaxSetIdSessionEntries", [ @@ -44913,12 +46034,9 @@ pub mod api { #[doc = " Latest MMR Root hash."] pub fn root_hash( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - root_hash::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), root_hash::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Mmr", "RootHash", [ @@ -44931,12 +46049,12 @@ pub mod api { #[doc = " Current size of the MMR (number of leaves)."] pub fn number_of_leaves( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - number_of_leaves::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + number_of_leaves::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Mmr", "NumberOfLeaves", [ @@ -44952,12 +46070,12 @@ pub mod api { #[doc = " are pruned and only stored in the Offchain DB."] pub fn nodes( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (nodes::Param0,), - nodes::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (nodes::input::Param0,), + nodes::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "Mmr", "Nodes", [ @@ -44972,27 +46090,27 @@ pub mod api { pub mod root_hash { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::H256; } + pub type Output = ::subxt::utils::H256; } pub mod number_of_leaves { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u64; } + pub type Output = ::core::primitive::u64; } pub mod nodes { use super::root_mod; use super::runtime_types; - pub type Param0 = ::core::primitive::u64; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::H256; + pub type Param0 = ::core::primitive::u64; } + pub type Output = ::subxt::utils::H256; } } } @@ -45007,12 +46125,12 @@ pub mod api { #[doc = " Details of current BEEFY authority set."] pub fn beefy_authorities( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - beefy_authorities::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + beefy_authorities::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "MmrLeaf", "BeefyAuthorities", [ @@ -45027,12 +46145,12 @@ pub mod api { #[doc = " This storage entry is used as cache for calls to `update_beefy_next_authority_set`."] pub fn beefy_next_authorities( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - beefy_next_authorities::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + beefy_next_authorities::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "MmrLeaf", "BeefyNextAuthorities", [ @@ -45046,22 +46164,20 @@ pub mod api { pub mod beefy_authorities { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< - ::subxt::ext::subxt_core::utils::H256, - >; } + pub type Output = + runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet<::subxt::utils::H256>; } pub mod beefy_next_authorities { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< - ::subxt::ext::subxt_core::utils::H256, - >; } + pub type Output = + runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet<::subxt::utils::H256>; } } } @@ -45073,97 +46189,97 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Reap the `IdentityInfo` of `who` from the Identity pallet of `T`, unreserving any"] + #[doc = "deposits held and removing storage items associated with `who`."] + pub struct ReapIdentity { + pub who: reap_identity::Who, + } + pub mod reap_identity { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Reap the `IdentityInfo` of `who` from the Identity pallet of `T`, unreserving any"] - #[doc = "deposits held and removing storage items associated with `who`."] - pub struct ReapIdentity { - pub who: reap_identity::Who, - } - pub mod reap_identity { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ReapIdentity { - const PALLET: &'static str = "IdentityMigrator"; - const CALL: &'static str = "reap_identity"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Update the deposit of `who`. Meant to be called by the system with an XCM `Transact`"] - #[doc = "Instruction."] - pub struct PokeDeposit { - pub who: poke_deposit::Who, - } - pub mod poke_deposit { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { - const PALLET: &'static str = "IdentityMigrator"; - const CALL: &'static str = "poke_deposit"; - } + pub type Who = ::subxt::utils::AccountId32; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Reap the `IdentityInfo` of `who` from the Identity pallet of `T`, unreserving any"] - #[doc = "deposits held and removing storage items associated with `who`."] - pub fn reap_identity( - &self, - who: types::reap_identity::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "IdentityMigrator", - "reap_identity", - types::ReapIdentity { who }, - [ - 187u8, 110u8, 202u8, 220u8, 54u8, 240u8, 242u8, 171u8, 5u8, 83u8, - 129u8, 93u8, 213u8, 208u8, 21u8, 236u8, 121u8, 128u8, 127u8, 121u8, - 153u8, 118u8, 232u8, 44u8, 20u8, 124u8, 214u8, 185u8, 249u8, 182u8, - 136u8, 96u8, - ], - ) + impl ReapIdentity { + const PALLET_NAME: &'static str = "IdentityMigrator"; + const CALL_NAME: &'static str = "reap_identity"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ReapIdentity { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Update the deposit of `who`. Meant to be called by the system with an XCM `Transact`"] - #[doc = "Instruction."] - pub fn poke_deposit( - &self, - who: types::poke_deposit::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "IdentityMigrator", - "poke_deposit", - types::PokeDeposit { who }, - [ - 42u8, 67u8, 168u8, 124u8, 75u8, 32u8, 143u8, 173u8, 14u8, 28u8, 76u8, - 35u8, 196u8, 255u8, 250u8, 33u8, 128u8, 159u8, 132u8, 124u8, 51u8, - 243u8, 166u8, 55u8, 208u8, 101u8, 188u8, 133u8, 36u8, 18u8, 119u8, - 146u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Update the deposit of `who`. Meant to be called by the system with an XCM `Transact`"] + #[doc = "Instruction."] + pub struct PokeDeposit { + pub who: poke_deposit::Who, + } + pub mod poke_deposit { + use super::runtime_types; + pub type Who = ::subxt::utils::AccountId32; + } + impl PokeDeposit { + const PALLET_NAME: &'static str = "IdentityMigrator"; + const CALL_NAME: &'static str = "poke_deposit"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for PokeDeposit { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Reap the `IdentityInfo` of `who` from the Identity pallet of `T`, unreserving any"] + #[doc = "deposits held and removing storage items associated with `who`."] + pub fn reap_identity( + &self, + who: super::reap_identity::Who, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "IdentityMigrator", + "reap_identity", + super::ReapIdentity { who }, + [ + 187u8, 110u8, 202u8, 220u8, 54u8, 240u8, 242u8, 171u8, 5u8, 83u8, + 129u8, 93u8, 213u8, 208u8, 21u8, 236u8, 121u8, 128u8, 127u8, 121u8, + 153u8, 118u8, 232u8, 44u8, 20u8, 124u8, 214u8, 185u8, 249u8, 182u8, + 136u8, 96u8, + ], + ) + } + #[doc = "Update the deposit of `who`. Meant to be called by the system with an XCM `Transact`"] + #[doc = "Instruction."] + pub fn poke_deposit( + &self, + who: super::poke_deposit::Who, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "IdentityMigrator", + "poke_deposit", + super::PokeDeposit { who }, + [ + 42u8, 67u8, 168u8, 124u8, 75u8, 32u8, 143u8, 173u8, 14u8, 28u8, + 76u8, 35u8, 196u8, 255u8, 250u8, 33u8, 128u8, 159u8, 132u8, 124u8, + 51u8, 243u8, 166u8, 55u8, 208u8, 101u8, 188u8, 133u8, 36u8, 18u8, + 119u8, 146u8, + ], + ) + } } } } @@ -45172,31 +46288,36 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The identity and all sub accounts were reaped for `who`."] pub struct IdentityReaped { pub who: identity_reaped::Who, } pub mod identity_reaped { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; + } + impl IdentityReaped { + const PALLET_NAME: &'static str = "IdentityMigrator"; + const EVENT_NAME: &'static str = "IdentityReaped"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for IdentityReaped { - const PALLET: &'static str = "IdentityMigrator"; - const EVENT: &'static str = "IdentityReaped"; + impl ::subxt::events::DecodeAsEvent for IdentityReaped { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The deposits held for `who` were updated. `identity` is the new deposit held for"] #[doc = "identity info, and `subs` is the new deposit held for the sub-accounts."] pub struct DepositUpdated { @@ -45206,13 +46327,18 @@ pub mod api { } pub mod deposit_updated { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Identity = ::core::primitive::u128; pub type Subs = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositUpdated { - const PALLET: &'static str = "IdentityMigrator"; - const EVENT: &'static str = "DepositUpdated"; + impl DepositUpdated { + const PALLET_NAME: &'static str = "IdentityMigrator"; + const EVENT_NAME: &'static str = "DepositUpdated"; + } + impl ::subxt::events::DecodeAsEvent for DepositUpdated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } } @@ -45226,304 +46352,304 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Schedule a para to be initialized at the start of the next session."] + #[doc = ""] + #[doc = "This should only be used for TESTING and not on PRODUCTION chains. It automatically"] + #[doc = "assigns Coretime to the chain and increases the number of cores. Thus, there is no"] + #[doc = "running coretime chain required."] + pub struct SudoScheduleParaInitialize { + pub id: sudo_schedule_para_initialize::Id, + pub genesis: sudo_schedule_para_initialize::Genesis, + } + pub mod sudo_schedule_para_initialize { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule a para to be initialized at the start of the next session."] - #[doc = ""] - #[doc = "This should only be used for TESTING and not on PRODUCTION chains. It automatically"] - #[doc = "assigns Coretime to the chain and increases the number of cores. Thus, there is no"] - #[doc = "running coretime chain required."] - pub struct SudoScheduleParaInitialize { - pub id: sudo_schedule_para_initialize::Id, - pub genesis: sudo_schedule_para_initialize::Genesis, - } - pub mod sudo_schedule_para_initialize { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Genesis = - runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SudoScheduleParaInitialize { - const PALLET: &'static str = "ParasSudoWrapper"; - const CALL: &'static str = "sudo_schedule_para_initialize"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule a para to be cleaned up at the start of the next session."] - pub struct SudoScheduleParaCleanup { - pub id: sudo_schedule_para_cleanup::Id, - } - pub mod sudo_schedule_para_cleanup { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SudoScheduleParaCleanup { - const PALLET: &'static str = "ParasSudoWrapper"; - const CALL: &'static str = "sudo_schedule_para_cleanup"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Upgrade a parathread (on-demand parachain) to a lease holding parachain"] - pub struct SudoScheduleParathreadUpgrade { - pub id: sudo_schedule_parathread_upgrade::Id, - } - pub mod sudo_schedule_parathread_upgrade { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SudoScheduleParathreadUpgrade { - const PALLET: &'static str = "ParasSudoWrapper"; - const CALL: &'static str = "sudo_schedule_parathread_upgrade"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Downgrade a lease holding parachain to an on-demand parachain"] - pub struct SudoScheduleParachainDowngrade { - pub id: sudo_schedule_parachain_downgrade::Id, - } - pub mod sudo_schedule_parachain_downgrade { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SudoScheduleParachainDowngrade { - const PALLET: &'static str = "ParasSudoWrapper"; - const CALL: &'static str = "sudo_schedule_parachain_downgrade"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Send a downward XCM to the given para."] - #[doc = ""] - #[doc = "The given parachain should exist and the payload should not exceed the preconfigured"] - #[doc = "size `config.max_downward_message_size`."] - pub struct SudoQueueDownwardXcm { - pub id: sudo_queue_downward_xcm::Id, - pub xcm: - ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod sudo_queue_downward_xcm { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Xcm = runtime_types::xcm::VersionedXcm; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SudoQueueDownwardXcm { - const PALLET: &'static str = "ParasSudoWrapper"; - const CALL: &'static str = "sudo_queue_downward_xcm"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Forcefully establish a channel from the sender to the recipient."] - #[doc = ""] - #[doc = "This is equivalent to sending an `Hrmp::hrmp_init_open_channel` extrinsic followed by"] - #[doc = "`Hrmp::hrmp_accept_open_channel`."] - pub struct SudoEstablishHrmpChannel { - pub sender: sudo_establish_hrmp_channel::Sender, - pub recipient: sudo_establish_hrmp_channel::Recipient, - pub max_capacity: sudo_establish_hrmp_channel::MaxCapacity, - pub max_message_size: sudo_establish_hrmp_channel::MaxMessageSize, - } - pub mod sudo_establish_hrmp_channel { - use super::runtime_types; - pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Recipient = - runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type MaxCapacity = ::core::primitive::u32; - pub type MaxMessageSize = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SudoEstablishHrmpChannel { - const PALLET: &'static str = "ParasSudoWrapper"; - const CALL: &'static str = "sudo_establish_hrmp_channel"; - } + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Genesis = + runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Schedule a para to be initialized at the start of the next session."] - #[doc = ""] - #[doc = "This should only be used for TESTING and not on PRODUCTION chains. It automatically"] - #[doc = "assigns Coretime to the chain and increases the number of cores. Thus, there is no"] - #[doc = "running coretime chain required."] - pub fn sudo_schedule_para_initialize( - &self, - id: types::sudo_schedule_para_initialize::Id, - genesis: types::sudo_schedule_para_initialize::Genesis, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SudoScheduleParaInitialize, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ParasSudoWrapper", - "sudo_schedule_para_initialize", - types::SudoScheduleParaInitialize { id, genesis }, - [ - 91u8, 145u8, 184u8, 83u8, 85u8, 168u8, 43u8, 14u8, 18u8, 86u8, 4u8, - 120u8, 148u8, 107u8, 139u8, 46u8, 145u8, 126u8, 255u8, 61u8, 83u8, - 140u8, 63u8, 233u8, 0u8, 47u8, 227u8, 194u8, 99u8, 7u8, 61u8, 15u8, - ], - ) + impl SudoScheduleParaInitialize { + const PALLET_NAME: &'static str = "ParasSudoWrapper"; + const CALL_NAME: &'static str = "sudo_schedule_para_initialize"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SudoScheduleParaInitialize { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Schedule a para to be cleaned up at the start of the next session."] - pub fn sudo_schedule_para_cleanup( - &self, - id: types::sudo_schedule_para_cleanup::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SudoScheduleParaCleanup, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ParasSudoWrapper", - "sudo_schedule_para_cleanup", - types::SudoScheduleParaCleanup { id }, - [ - 148u8, 0u8, 73u8, 32u8, 33u8, 214u8, 92u8, 82u8, 146u8, 97u8, 39u8, - 220u8, 147u8, 148u8, 83u8, 200u8, 36u8, 197u8, 231u8, 246u8, 159u8, - 175u8, 195u8, 46u8, 68u8, 230u8, 16u8, 240u8, 108u8, 132u8, 0u8, 188u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Schedule a para to be cleaned up at the start of the next session."] + pub struct SudoScheduleParaCleanup { + pub id: sudo_schedule_para_cleanup::Id, + } + pub mod sudo_schedule_para_cleanup { + use super::runtime_types; + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl SudoScheduleParaCleanup { + const PALLET_NAME: &'static str = "ParasSudoWrapper"; + const CALL_NAME: &'static str = "sudo_schedule_para_cleanup"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SudoScheduleParaCleanup { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Upgrade a parathread (on-demand parachain) to a lease holding parachain"] - pub fn sudo_schedule_parathread_upgrade( - &self, - id: types::sudo_schedule_parathread_upgrade::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SudoScheduleParathreadUpgrade, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ParasSudoWrapper", - "sudo_schedule_parathread_upgrade", - types::SudoScheduleParathreadUpgrade { id }, - [ - 244u8, 142u8, 128u8, 182u8, 130u8, 88u8, 113u8, 34u8, 92u8, 224u8, - 244u8, 155u8, 83u8, 212u8, 68u8, 87u8, 156u8, 80u8, 26u8, 23u8, 245u8, - 197u8, 167u8, 204u8, 14u8, 198u8, 70u8, 93u8, 227u8, 159u8, 159u8, - 88u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Upgrade a parathread (on-demand parachain) to a lease holding parachain"] + pub struct SudoScheduleParathreadUpgrade { + pub id: sudo_schedule_parathread_upgrade::Id, + } + pub mod sudo_schedule_parathread_upgrade { + use super::runtime_types; + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl SudoScheduleParathreadUpgrade { + const PALLET_NAME: &'static str = "ParasSudoWrapper"; + const CALL_NAME: &'static str = "sudo_schedule_parathread_upgrade"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SudoScheduleParathreadUpgrade { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Downgrade a lease holding parachain to an on-demand parachain"] - pub fn sudo_schedule_parachain_downgrade( - &self, - id: types::sudo_schedule_parachain_downgrade::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SudoScheduleParachainDowngrade, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ParasSudoWrapper", - "sudo_schedule_parachain_downgrade", - types::SudoScheduleParachainDowngrade { id }, - [ - 152u8, 217u8, 14u8, 138u8, 136u8, 85u8, 79u8, 255u8, 220u8, 85u8, - 248u8, 12u8, 186u8, 250u8, 206u8, 152u8, 115u8, 92u8, 143u8, 8u8, - 171u8, 46u8, 94u8, 232u8, 169u8, 79u8, 150u8, 212u8, 166u8, 191u8, - 188u8, 198u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Downgrade a lease holding parachain to an on-demand parachain"] + pub struct SudoScheduleParachainDowngrade { + pub id: sudo_schedule_parachain_downgrade::Id, + } + pub mod sudo_schedule_parachain_downgrade { + use super::runtime_types; + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl SudoScheduleParachainDowngrade { + const PALLET_NAME: &'static str = "ParasSudoWrapper"; + const CALL_NAME: &'static str = "sudo_schedule_parachain_downgrade"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SudoScheduleParachainDowngrade { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Send a downward XCM to the given para."] - #[doc = ""] - #[doc = "The given parachain should exist and the payload should not exceed the preconfigured"] - #[doc = "size `config.max_downward_message_size`."] - pub fn sudo_queue_downward_xcm( - &self, - id: types::sudo_queue_downward_xcm::Id, - xcm: types::sudo_queue_downward_xcm::Xcm, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ParasSudoWrapper", - "sudo_queue_downward_xcm", - types::SudoQueueDownwardXcm { - id, - xcm: ::subxt::ext::subxt_core::alloc::boxed::Box::new(xcm), - }, - [ - 40u8, 26u8, 205u8, 124u8, 249u8, 177u8, 41u8, 133u8, 217u8, 87u8, - 207u8, 240u8, 199u8, 51u8, 4u8, 31u8, 34u8, 216u8, 150u8, 41u8, 53u8, - 58u8, 60u8, 198u8, 62u8, 122u8, 112u8, 108u8, 86u8, 183u8, 162u8, 93u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Send a downward XCM to the given para."] + #[doc = ""] + #[doc = "The given parachain should exist and the payload should not exceed the preconfigured"] + #[doc = "size `config.max_downward_message_size`."] + pub struct SudoQueueDownwardXcm { + pub id: sudo_queue_downward_xcm::Id, + pub xcm: ::subxt::alloc::boxed::Box, + } + pub mod sudo_queue_downward_xcm { + use super::runtime_types; + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Xcm = runtime_types::xcm::VersionedXcm; + } + impl SudoQueueDownwardXcm { + const PALLET_NAME: &'static str = "ParasSudoWrapper"; + const CALL_NAME: &'static str = "sudo_queue_downward_xcm"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SudoQueueDownwardXcm { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Forcefully establish a channel from the sender to the recipient."] - #[doc = ""] - #[doc = "This is equivalent to sending an `Hrmp::hrmp_init_open_channel` extrinsic followed by"] - #[doc = "`Hrmp::hrmp_accept_open_channel`."] - pub fn sudo_establish_hrmp_channel( - &self, - sender: types::sudo_establish_hrmp_channel::Sender, - recipient: types::sudo_establish_hrmp_channel::Recipient, - max_capacity: types::sudo_establish_hrmp_channel::MaxCapacity, - max_message_size: types::sudo_establish_hrmp_channel::MaxMessageSize, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::SudoEstablishHrmpChannel, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ParasSudoWrapper", - "sudo_establish_hrmp_channel", - types::SudoEstablishHrmpChannel { - sender, - recipient, - max_capacity, - max_message_size, - }, - [ - 236u8, 105u8, 76u8, 213u8, 11u8, 105u8, 119u8, 48u8, 1u8, 103u8, 239u8, - 156u8, 66u8, 63u8, 135u8, 67u8, 226u8, 150u8, 254u8, 24u8, 169u8, 82u8, - 29u8, 75u8, 102u8, 167u8, 59u8, 66u8, 173u8, 148u8, 202u8, 50u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Forcefully establish a channel from the sender to the recipient."] + #[doc = ""] + #[doc = "This is equivalent to sending an `Hrmp::hrmp_init_open_channel` extrinsic followed by"] + #[doc = "`Hrmp::hrmp_accept_open_channel`."] + pub struct SudoEstablishHrmpChannel { + pub sender: sudo_establish_hrmp_channel::Sender, + pub recipient: sudo_establish_hrmp_channel::Recipient, + pub max_capacity: sudo_establish_hrmp_channel::MaxCapacity, + pub max_message_size: sudo_establish_hrmp_channel::MaxMessageSize, + } + pub mod sudo_establish_hrmp_channel { + use super::runtime_types; + pub type Sender = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type MaxCapacity = ::core::primitive::u32; + pub type MaxMessageSize = ::core::primitive::u32; + } + impl SudoEstablishHrmpChannel { + const PALLET_NAME: &'static str = "ParasSudoWrapper"; + const CALL_NAME: &'static str = "sudo_establish_hrmp_channel"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SudoEstablishHrmpChannel { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Schedule a para to be initialized at the start of the next session."] + #[doc = ""] + #[doc = "This should only be used for TESTING and not on PRODUCTION chains. It automatically"] + #[doc = "assigns Coretime to the chain and increases the number of cores. Thus, there is no"] + #[doc = "running coretime chain required."] + pub fn sudo_schedule_para_initialize( + &self, + id: super::sudo_schedule_para_initialize::Id, + genesis: super::sudo_schedule_para_initialize::Genesis, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ParasSudoWrapper", + "sudo_schedule_para_initialize", + super::SudoScheduleParaInitialize { id, genesis }, + [ + 91u8, 145u8, 184u8, 83u8, 85u8, 168u8, 43u8, 14u8, 18u8, 86u8, 4u8, + 120u8, 148u8, 107u8, 139u8, 46u8, 145u8, 126u8, 255u8, 61u8, 83u8, + 140u8, 63u8, 233u8, 0u8, 47u8, 227u8, 194u8, 99u8, 7u8, 61u8, 15u8, + ], + ) + } + #[doc = "Schedule a para to be cleaned up at the start of the next session."] + pub fn sudo_schedule_para_cleanup( + &self, + id: super::sudo_schedule_para_cleanup::Id, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ParasSudoWrapper", + "sudo_schedule_para_cleanup", + super::SudoScheduleParaCleanup { id }, + [ + 148u8, 0u8, 73u8, 32u8, 33u8, 214u8, 92u8, 82u8, 146u8, 97u8, 39u8, + 220u8, 147u8, 148u8, 83u8, 200u8, 36u8, 197u8, 231u8, 246u8, 159u8, + 175u8, 195u8, 46u8, 68u8, 230u8, 16u8, 240u8, 108u8, 132u8, 0u8, + 188u8, + ], + ) + } + #[doc = "Upgrade a parathread (on-demand parachain) to a lease holding parachain"] + pub fn sudo_schedule_parathread_upgrade( + &self, + id: super::sudo_schedule_parathread_upgrade::Id, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ParasSudoWrapper", + "sudo_schedule_parathread_upgrade", + super::SudoScheduleParathreadUpgrade { id }, + [ + 244u8, 142u8, 128u8, 182u8, 130u8, 88u8, 113u8, 34u8, 92u8, 224u8, + 244u8, 155u8, 83u8, 212u8, 68u8, 87u8, 156u8, 80u8, 26u8, 23u8, + 245u8, 197u8, 167u8, 204u8, 14u8, 198u8, 70u8, 93u8, 227u8, 159u8, + 159u8, 88u8, + ], + ) + } + #[doc = "Downgrade a lease holding parachain to an on-demand parachain"] + pub fn sudo_schedule_parachain_downgrade( + &self, + id: super::sudo_schedule_parachain_downgrade::Id, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ParasSudoWrapper", + "sudo_schedule_parachain_downgrade", + super::SudoScheduleParachainDowngrade { id }, + [ + 152u8, 217u8, 14u8, 138u8, 136u8, 85u8, 79u8, 255u8, 220u8, 85u8, + 248u8, 12u8, 186u8, 250u8, 206u8, 152u8, 115u8, 92u8, 143u8, 8u8, + 171u8, 46u8, 94u8, 232u8, 169u8, 79u8, 150u8, 212u8, 166u8, 191u8, + 188u8, 198u8, + ], + ) + } + #[doc = "Send a downward XCM to the given para."] + #[doc = ""] + #[doc = "The given parachain should exist and the payload should not exceed the preconfigured"] + #[doc = "size `config.max_downward_message_size`."] + pub fn sudo_queue_downward_xcm( + &self, + id: super::sudo_queue_downward_xcm::Id, + xcm: super::sudo_queue_downward_xcm::Xcm, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ParasSudoWrapper", + "sudo_queue_downward_xcm", + super::SudoQueueDownwardXcm { + id, + xcm: ::subxt::alloc::boxed::Box::new(xcm), + }, + [ + 40u8, 26u8, 205u8, 124u8, 249u8, 177u8, 41u8, 133u8, 217u8, 87u8, + 207u8, 240u8, 199u8, 51u8, 4u8, 31u8, 34u8, 216u8, 150u8, 41u8, + 53u8, 58u8, 60u8, 198u8, 62u8, 122u8, 112u8, 108u8, 86u8, 183u8, + 162u8, 93u8, + ], + ) + } + #[doc = "Forcefully establish a channel from the sender to the recipient."] + #[doc = ""] + #[doc = "This is equivalent to sending an `Hrmp::hrmp_init_open_channel` extrinsic followed by"] + #[doc = "`Hrmp::hrmp_accept_open_channel`."] + pub fn sudo_establish_hrmp_channel( + &self, + sender: super::sudo_establish_hrmp_channel::Sender, + recipient: super::sudo_establish_hrmp_channel::Recipient, + max_capacity: super::sudo_establish_hrmp_channel::MaxCapacity, + max_message_size: super::sudo_establish_hrmp_channel::MaxMessageSize, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ParasSudoWrapper", + "sudo_establish_hrmp_channel", + super::SudoEstablishHrmpChannel { + sender, + recipient, + max_capacity, + max_message_size, + }, + [ + 236u8, 105u8, 76u8, 213u8, 11u8, 105u8, 119u8, 48u8, 1u8, 103u8, + 239u8, 156u8, 66u8, 63u8, 135u8, 67u8, 226u8, 150u8, 254u8, 24u8, + 169u8, 82u8, 29u8, 75u8, 102u8, 167u8, 59u8, 66u8, 173u8, 148u8, + 202u8, 50u8, + ], + ) + } } } } @@ -45538,227 +46664,230 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Assign a permanent parachain slot and immediately create a lease for it."] + pub struct AssignPermParachainSlot { + pub id: assign_perm_parachain_slot::Id, + } + pub mod assign_perm_parachain_slot { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Assign a permanent parachain slot and immediately create a lease for it."] - pub struct AssignPermParachainSlot { - pub id: assign_perm_parachain_slot::Id, - } - pub mod assign_perm_parachain_slot { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AssignPermParachainSlot { - const PALLET: &'static str = "AssignedSlots"; - const CALL: &'static str = "assign_perm_parachain_slot"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Assign a temporary parachain slot. The function tries to create a lease for it"] - #[doc = "immediately if `SlotLeasePeriodStart::Current` is specified, and if the number"] - #[doc = "of currently active temporary slots is below `MaxTemporarySlotPerLeasePeriod`."] - pub struct AssignTempParachainSlot { - pub id: assign_temp_parachain_slot::Id, - pub lease_period_start: assign_temp_parachain_slot::LeasePeriodStart, - } - pub mod assign_temp_parachain_slot { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type LeasePeriodStart = runtime_types :: polkadot_runtime_common :: assigned_slots :: SlotLeasePeriodStart ; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AssignTempParachainSlot { - const PALLET: &'static str = "AssignedSlots"; - const CALL: &'static str = "assign_temp_parachain_slot"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Unassign a permanent or temporary parachain slot"] - pub struct UnassignParachainSlot { - pub id: unassign_parachain_slot::Id, - } - pub mod unassign_parachain_slot { - use super::runtime_types; - pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnassignParachainSlot { - const PALLET: &'static str = "AssignedSlots"; - const CALL: &'static str = "unassign_parachain_slot"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the storage value [`MaxPermanentSlots`]."] - pub struct SetMaxPermanentSlots { - pub slots: set_max_permanent_slots::Slots, - } - pub mod set_max_permanent_slots { - use super::runtime_types; - pub type Slots = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxPermanentSlots { - const PALLET: &'static str = "AssignedSlots"; - const CALL: &'static str = "set_max_permanent_slots"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the storage value [`MaxTemporarySlots`]."] - pub struct SetMaxTemporarySlots { - pub slots: set_max_temporary_slots::Slots, - } - pub mod set_max_temporary_slots { - use super::runtime_types; - pub type Slots = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMaxTemporarySlots { - const PALLET: &'static str = "AssignedSlots"; - const CALL: &'static str = "set_max_temporary_slots"; - } + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Assign a permanent parachain slot and immediately create a lease for it."] - pub fn assign_perm_parachain_slot( - &self, - id: types::assign_perm_parachain_slot::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::AssignPermParachainSlot, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "AssignedSlots", - "assign_perm_parachain_slot", - types::AssignPermParachainSlot { id }, - [ - 174u8, 53u8, 0u8, 157u8, 42u8, 160u8, 60u8, 36u8, 68u8, 7u8, 86u8, - 60u8, 126u8, 71u8, 118u8, 95u8, 139u8, 208u8, 57u8, 118u8, 183u8, - 111u8, 59u8, 37u8, 186u8, 193u8, 92u8, 145u8, 39u8, 21u8, 237u8, 31u8, - ], - ) + impl AssignPermParachainSlot { + const PALLET_NAME: &'static str = "AssignedSlots"; + const CALL_NAME: &'static str = "assign_perm_parachain_slot"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AssignPermParachainSlot { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Assign a temporary parachain slot. The function tries to create a lease for it"] - #[doc = "immediately if `SlotLeasePeriodStart::Current` is specified, and if the number"] - #[doc = "of currently active temporary slots is below `MaxTemporarySlotPerLeasePeriod`."] - pub fn assign_temp_parachain_slot( - &self, - id: types::assign_temp_parachain_slot::Id, - lease_period_start: types::assign_temp_parachain_slot::LeasePeriodStart, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::AssignTempParachainSlot, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "AssignedSlots", - "assign_temp_parachain_slot", - types::AssignTempParachainSlot { - id, - lease_period_start, - }, - [ - 226u8, 38u8, 224u8, 199u8, 32u8, 159u8, 245u8, 129u8, 190u8, 103u8, - 103u8, 214u8, 27u8, 215u8, 104u8, 111u8, 132u8, 186u8, 214u8, 25u8, - 110u8, 187u8, 73u8, 179u8, 101u8, 48u8, 60u8, 218u8, 248u8, 28u8, - 202u8, 66u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Assign a temporary parachain slot. The function tries to create a lease for it"] + #[doc = "immediately if `SlotLeasePeriodStart::Current` is specified, and if the number"] + #[doc = "of currently active temporary slots is below `MaxTemporarySlotPerLeasePeriod`."] + pub struct AssignTempParachainSlot { + pub id: assign_temp_parachain_slot::Id, + pub lease_period_start: assign_temp_parachain_slot::LeasePeriodStart, + } + pub mod assign_temp_parachain_slot { + use super::runtime_types; + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type LeasePeriodStart = + runtime_types::polkadot_runtime_common::assigned_slots::SlotLeasePeriodStart; + } + impl AssignTempParachainSlot { + const PALLET_NAME: &'static str = "AssignedSlots"; + const CALL_NAME: &'static str = "assign_temp_parachain_slot"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for AssignTempParachainSlot { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Unassign a permanent or temporary parachain slot"] - pub fn unassign_parachain_slot( - &self, - id: types::unassign_parachain_slot::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::UnassignParachainSlot, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "AssignedSlots", - "unassign_parachain_slot", - types::UnassignParachainSlot { id }, - [ - 235u8, 6u8, 124u8, 73u8, 72u8, 232u8, 38u8, 233u8, 103u8, 111u8, 249u8, - 235u8, 10u8, 169u8, 92u8, 251u8, 245u8, 151u8, 28u8, 78u8, 125u8, - 113u8, 201u8, 187u8, 24u8, 58u8, 18u8, 177u8, 68u8, 122u8, 167u8, - 143u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Unassign a permanent or temporary parachain slot"] + pub struct UnassignParachainSlot { + pub id: unassign_parachain_slot::Id, + } + pub mod unassign_parachain_slot { + use super::runtime_types; + pub type Id = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + impl UnassignParachainSlot { + const PALLET_NAME: &'static str = "AssignedSlots"; + const CALL_NAME: &'static str = "unassign_parachain_slot"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for UnassignParachainSlot { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the storage value [`MaxPermanentSlots`]."] - pub fn set_max_permanent_slots( - &self, - slots: types::set_max_permanent_slots::Slots, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "AssignedSlots", - "set_max_permanent_slots", - types::SetMaxPermanentSlots { slots }, - [ - 62u8, 74u8, 80u8, 101u8, 204u8, 21u8, 139u8, 67u8, 178u8, 103u8, 237u8, - 166u8, 58u8, 6u8, 201u8, 30u8, 17u8, 186u8, 220u8, 150u8, 183u8, 174u8, - 72u8, 15u8, 72u8, 166u8, 116u8, 203u8, 132u8, 237u8, 196u8, 230u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the storage value [`MaxPermanentSlots`]."] + pub struct SetMaxPermanentSlots { + pub slots: set_max_permanent_slots::Slots, + } + pub mod set_max_permanent_slots { + use super::runtime_types; + pub type Slots = ::core::primitive::u32; + } + impl SetMaxPermanentSlots { + const PALLET_NAME: &'static str = "AssignedSlots"; + const CALL_NAME: &'static str = "set_max_permanent_slots"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxPermanentSlots { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Sets the storage value [`MaxTemporarySlots`]."] - pub fn set_max_temporary_slots( - &self, - slots: types::set_max_temporary_slots::Slots, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "AssignedSlots", - "set_max_temporary_slots", - types::SetMaxTemporarySlots { slots }, - [ - 126u8, 108u8, 55u8, 12u8, 136u8, 207u8, 246u8, 65u8, 251u8, 139u8, - 150u8, 134u8, 10u8, 133u8, 106u8, 161u8, 61u8, 59u8, 15u8, 72u8, 247u8, - 33u8, 191u8, 127u8, 27u8, 89u8, 165u8, 134u8, 148u8, 140u8, 204u8, - 22u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Sets the storage value [`MaxTemporarySlots`]."] + pub struct SetMaxTemporarySlots { + pub slots: set_max_temporary_slots::Slots, + } + pub mod set_max_temporary_slots { + use super::runtime_types; + pub type Slots = ::core::primitive::u32; + } + impl SetMaxTemporarySlots { + const PALLET_NAME: &'static str = "AssignedSlots"; + const CALL_NAME: &'static str = "set_max_temporary_slots"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetMaxTemporarySlots { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Assign a permanent parachain slot and immediately create a lease for it."] + pub fn assign_perm_parachain_slot( + &self, + id: super::assign_perm_parachain_slot::Id, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "AssignedSlots", + "assign_perm_parachain_slot", + super::AssignPermParachainSlot { id }, + [ + 174u8, 53u8, 0u8, 157u8, 42u8, 160u8, 60u8, 36u8, 68u8, 7u8, 86u8, + 60u8, 126u8, 71u8, 118u8, 95u8, 139u8, 208u8, 57u8, 118u8, 183u8, + 111u8, 59u8, 37u8, 186u8, 193u8, 92u8, 145u8, 39u8, 21u8, 237u8, + 31u8, + ], + ) + } + #[doc = "Assign a temporary parachain slot. The function tries to create a lease for it"] + #[doc = "immediately if `SlotLeasePeriodStart::Current` is specified, and if the number"] + #[doc = "of currently active temporary slots is below `MaxTemporarySlotPerLeasePeriod`."] + pub fn assign_temp_parachain_slot( + &self, + id: super::assign_temp_parachain_slot::Id, + lease_period_start: super::assign_temp_parachain_slot::LeasePeriodStart, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "AssignedSlots", + "assign_temp_parachain_slot", + super::AssignTempParachainSlot { + id, + lease_period_start, + }, + [ + 226u8, 38u8, 224u8, 199u8, 32u8, 159u8, 245u8, 129u8, 190u8, 103u8, + 103u8, 214u8, 27u8, 215u8, 104u8, 111u8, 132u8, 186u8, 214u8, 25u8, + 110u8, 187u8, 73u8, 179u8, 101u8, 48u8, 60u8, 218u8, 248u8, 28u8, + 202u8, 66u8, + ], + ) + } + #[doc = "Unassign a permanent or temporary parachain slot"] + pub fn unassign_parachain_slot( + &self, + id: super::unassign_parachain_slot::Id, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "AssignedSlots", + "unassign_parachain_slot", + super::UnassignParachainSlot { id }, + [ + 235u8, 6u8, 124u8, 73u8, 72u8, 232u8, 38u8, 233u8, 103u8, 111u8, + 249u8, 235u8, 10u8, 169u8, 92u8, 251u8, 245u8, 151u8, 28u8, 78u8, + 125u8, 113u8, 201u8, 187u8, 24u8, 58u8, 18u8, 177u8, 68u8, 122u8, + 167u8, 143u8, + ], + ) + } + #[doc = "Sets the storage value [`MaxPermanentSlots`]."] + pub fn set_max_permanent_slots( + &self, + slots: super::set_max_permanent_slots::Slots, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "AssignedSlots", + "set_max_permanent_slots", + super::SetMaxPermanentSlots { slots }, + [ + 62u8, 74u8, 80u8, 101u8, 204u8, 21u8, 139u8, 67u8, 178u8, 103u8, + 237u8, 166u8, 58u8, 6u8, 201u8, 30u8, 17u8, 186u8, 220u8, 150u8, + 183u8, 174u8, 72u8, 15u8, 72u8, 166u8, 116u8, 203u8, 132u8, 237u8, + 196u8, 230u8, + ], + ) + } + #[doc = "Sets the storage value [`MaxTemporarySlots`]."] + pub fn set_max_temporary_slots( + &self, + slots: super::set_max_temporary_slots::Slots, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "AssignedSlots", + "set_max_temporary_slots", + super::SetMaxTemporarySlots { slots }, + [ + 126u8, 108u8, 55u8, 12u8, 136u8, 207u8, 246u8, 65u8, 251u8, 139u8, + 150u8, 134u8, 10u8, 133u8, 106u8, 161u8, 61u8, 59u8, 15u8, 72u8, + 247u8, 33u8, 191u8, 127u8, 27u8, 89u8, 165u8, 134u8, 148u8, 140u8, + 204u8, 22u8, + ], + ) + } } } } @@ -45767,46 +46896,56 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A parachain was assigned a permanent parachain slot"] pub struct PermanentSlotAssigned(pub permanent_slot_assigned::Field0); pub mod permanent_slot_assigned { use super::runtime_types; pub type Field0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PermanentSlotAssigned { - const PALLET: &'static str = "AssignedSlots"; - const EVENT: &'static str = "PermanentSlotAssigned"; + impl PermanentSlotAssigned { + const PALLET_NAME: &'static str = "AssignedSlots"; + const EVENT_NAME: &'static str = "PermanentSlotAssigned"; + } + impl ::subxt::events::DecodeAsEvent for PermanentSlotAssigned { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A parachain was assigned a temporary parachain slot"] pub struct TemporarySlotAssigned(pub temporary_slot_assigned::Field0); pub mod temporary_slot_assigned { use super::runtime_types; pub type Field0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TemporarySlotAssigned { - const PALLET: &'static str = "AssignedSlots"; - const EVENT: &'static str = "TemporarySlotAssigned"; + impl TemporarySlotAssigned { + const PALLET_NAME: &'static str = "AssignedSlots"; + const EVENT_NAME: &'static str = "TemporarySlotAssigned"; + } + impl ::subxt::events::DecodeAsEvent for TemporarySlotAssigned { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The maximum number of permanent slots has been changed"] pub struct MaxPermanentSlotsChanged { pub slots: max_permanent_slots_changed::Slots, @@ -45815,17 +46954,22 @@ pub mod api { use super::runtime_types; pub type Slots = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MaxPermanentSlotsChanged { - const PALLET: &'static str = "AssignedSlots"; - const EVENT: &'static str = "MaxPermanentSlotsChanged"; + impl MaxPermanentSlotsChanged { + const PALLET_NAME: &'static str = "AssignedSlots"; + const EVENT_NAME: &'static str = "MaxPermanentSlotsChanged"; + } + impl ::subxt::events::DecodeAsEvent for MaxPermanentSlotsChanged { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The maximum number of temporary slots has been changed"] pub struct MaxTemporarySlotsChanged { pub slots: max_temporary_slots_changed::Slots, @@ -45834,9 +46978,14 @@ pub mod api { use super::runtime_types; pub type Slots = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MaxTemporarySlotsChanged { - const PALLET: &'static str = "AssignedSlots"; - const EVENT: &'static str = "MaxTemporarySlotsChanged"; + impl MaxTemporarySlotsChanged { + const PALLET_NAME: &'static str = "AssignedSlots"; + const EVENT_NAME: &'static str = "MaxTemporarySlotsChanged"; + } + impl ::subxt::events::DecodeAsEvent for MaxTemporarySlotsChanged { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -45847,12 +46996,12 @@ pub mod api { #[doc = " Assigned permanent slots, with their start lease period, and duration."] pub fn permanent_slots( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (permanent_slots::Param0,), - permanent_slots::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (permanent_slots::input::Param0,), + permanent_slots::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "AssignedSlots", "PermanentSlots", [ @@ -45865,12 +47014,12 @@ pub mod api { #[doc = " Number of assigned (and active) permanent slots."] pub fn permanent_slot_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - permanent_slot_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + permanent_slot_count::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "AssignedSlots", "PermanentSlotCount", [ @@ -45883,12 +47032,12 @@ pub mod api { #[doc = " Assigned temporary slots."] pub fn temporary_slots( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (temporary_slots::Param0,), - temporary_slots::output::Output, - ::subxt::ext::subxt_core::utils::Maybe, + ) -> ::subxt::storage::StaticAddress< + (temporary_slots::input::Param0,), + temporary_slots::Output, + ::subxt::utils::Maybe, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "AssignedSlots", "TemporarySlots", [ @@ -45902,12 +47051,12 @@ pub mod api { #[doc = " Number of assigned temporary slots."] pub fn temporary_slot_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - temporary_slot_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + temporary_slot_count::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "AssignedSlots", "TemporarySlotCount", [ @@ -45921,12 +47070,12 @@ pub mod api { #[doc = " Number of active temporary slots in current slot lease period."] pub fn active_temporary_slot_count( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - active_temporary_slot_count::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + active_temporary_slot_count::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "AssignedSlots", "ActiveTemporarySlotCount", [ @@ -45940,12 +47089,12 @@ pub mod api { #[doc = " The max number of temporary slots that can be assigned."] pub fn max_temporary_slots( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - max_temporary_slots::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + max_temporary_slots::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "AssignedSlots", "MaxTemporarySlots", [ @@ -45958,12 +47107,12 @@ pub mod api { #[doc = " The max number of permanent slots that can be assigned."] pub fn max_permanent_slots( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - max_permanent_slots::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + max_permanent_slots::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "AssignedSlots", "MaxPermanentSlots", [ @@ -45978,60 +47127,64 @@ pub mod api { pub mod permanent_slots { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = (::core::primitive::u32, ::core::primitive::u32); + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = (::core::primitive::u32, ::core::primitive::u32); } pub mod permanent_slot_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod temporary_slots { use super::root_mod; use super::runtime_types; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = runtime_types :: polkadot_runtime_common :: assigned_slots :: ParachainTemporarySlot < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , :: core :: primitive :: u32 > ; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; } + pub type Output = + runtime_types::polkadot_runtime_common::assigned_slots::ParachainTemporarySlot< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >; } pub mod temporary_slot_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod active_temporary_slot_count { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod max_temporary_slots { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } pub mod max_permanent_slots { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::primitive::u32; } + pub type Output = ::core::primitive::u32; } } pub mod constants { @@ -46041,10 +47194,8 @@ pub mod api { #[doc = " The number of lease periods a permanent parachain slot lasts."] pub fn permanent_slot_lease_period_length( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "AssignedSlots", "PermanentSlotLeasePeriodLength", [ @@ -46058,10 +47209,8 @@ pub mod api { #[doc = " The number of lease periods a temporary parachain slot lasts."] pub fn temporary_slot_lease_period_length( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "AssignedSlots", "TemporarySlotLeasePeriodLength", [ @@ -46075,174 +47224,174 @@ pub mod api { #[doc = " The max number of temporary slots to be scheduled per lease periods."] pub fn max_temporary_slot_per_lease_period( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "AssignedSlots", - "MaxTemporarySlotPerLeasePeriod", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - } - } - } - pub mod validator_manager { - use super::root_mod; - use super::runtime_types; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::rococo_runtime::validator_manager::pallet::Call; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Add new validators to the set."] - #[doc = ""] - #[doc = "The new validators will be active from current session + 2."] - pub struct RegisterValidators { - pub validators: register_validators::Validators, - } - pub mod register_validators { - use super::runtime_types; - pub type Validators = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RegisterValidators { - const PALLET: &'static str = "ValidatorManager"; - const CALL: &'static str = "register_validators"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove validators from the set."] - #[doc = ""] - #[doc = "The removed validators will be deactivated from current session + 2."] - pub struct DeregisterValidators { - pub validators: deregister_validators::Validators, - } - pub mod deregister_validators { - use super::runtime_types; - pub type Validators = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DeregisterValidators { - const PALLET: &'static str = "ValidatorManager"; - const CALL: &'static str = "deregister_validators"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Add new validators to the set."] - #[doc = ""] - #[doc = "The new validators will be active from current session + 2."] - pub fn register_validators( - &self, - validators: types::register_validators::Validators, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ValidatorManager", - "register_validators", - types::RegisterValidators { validators }, - [ - 181u8, 41u8, 122u8, 3u8, 39u8, 160u8, 138u8, 83u8, 145u8, 147u8, 107u8, - 151u8, 213u8, 31u8, 237u8, 89u8, 119u8, 154u8, 14u8, 23u8, 238u8, - 247u8, 201u8, 92u8, 68u8, 127u8, 56u8, 178u8, 125u8, 152u8, 17u8, - 147u8, - ], - ) - } - #[doc = "Remove validators from the set."] - #[doc = ""] - #[doc = "The removed validators will be deactivated from current session + 2."] - pub fn deregister_validators( - &self, - validators: types::deregister_validators::Validators, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ValidatorManager", - "deregister_validators", - types::DeregisterValidators { validators }, + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( + "AssignedSlots", + "MaxTemporarySlotPerLeasePeriod", [ - 150u8, 134u8, 135u8, 215u8, 121u8, 111u8, 44u8, 52u8, 25u8, 244u8, - 130u8, 47u8, 66u8, 73u8, 243u8, 49u8, 171u8, 143u8, 34u8, 122u8, 55u8, - 234u8, 176u8, 221u8, 106u8, 61u8, 102u8, 234u8, 13u8, 233u8, 211u8, - 214u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } } } + } + pub mod validator_manager { + use super::root_mod; + use super::runtime_types; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::rococo_runtime::validator_manager::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Add new validators to the set."] + #[doc = ""] + #[doc = "The new validators will be active from current session + 2."] + pub struct RegisterValidators { + pub validators: register_validators::Validators, + } + pub mod register_validators { + use super::runtime_types; + pub type Validators = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + } + impl RegisterValidators { + const PALLET_NAME: &'static str = "ValidatorManager"; + const CALL_NAME: &'static str = "register_validators"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RegisterValidators { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Remove validators from the set."] + #[doc = ""] + #[doc = "The removed validators will be deactivated from current session + 2."] + pub struct DeregisterValidators { + pub validators: deregister_validators::Validators, + } + pub mod deregister_validators { + use super::runtime_types; + pub type Validators = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + } + impl DeregisterValidators { + const PALLET_NAME: &'static str = "ValidatorManager"; + const CALL_NAME: &'static str = "deregister_validators"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for DeregisterValidators { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME + } + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Add new validators to the set."] + #[doc = ""] + #[doc = "The new validators will be active from current session + 2."] + pub fn register_validators( + &self, + validators: super::register_validators::Validators, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ValidatorManager", + "register_validators", + super::RegisterValidators { validators }, + [ + 181u8, 41u8, 122u8, 3u8, 39u8, 160u8, 138u8, 83u8, 145u8, 147u8, + 107u8, 151u8, 213u8, 31u8, 237u8, 89u8, 119u8, 154u8, 14u8, 23u8, + 238u8, 247u8, 201u8, 92u8, 68u8, 127u8, 56u8, 178u8, 125u8, 152u8, + 17u8, 147u8, + ], + ) + } + #[doc = "Remove validators from the set."] + #[doc = ""] + #[doc = "The removed validators will be deactivated from current session + 2."] + pub fn deregister_validators( + &self, + validators: super::deregister_validators::Validators, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "ValidatorManager", + "deregister_validators", + super::DeregisterValidators { validators }, + [ + 150u8, 134u8, 135u8, 215u8, 121u8, 111u8, 44u8, 52u8, 25u8, 244u8, + 130u8, 47u8, 66u8, 73u8, 243u8, 49u8, 171u8, 143u8, 34u8, 122u8, + 55u8, 234u8, 176u8, 221u8, 106u8, 61u8, 102u8, 234u8, 13u8, 233u8, + 211u8, 214u8, + ], + ) + } + } + } + } #[doc = "The `Event` enum of this pallet"] pub type Event = runtime_types::rococo_runtime::validator_manager::pallet::Event; pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "New validators were added to the set."] pub struct ValidatorsRegistered(pub validators_registered::Field0); pub mod validators_registered { use super::runtime_types; - pub type Field0 = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; + pub type Field0 = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ValidatorsRegistered { - const PALLET: &'static str = "ValidatorManager"; - const EVENT: &'static str = "ValidatorsRegistered"; + impl ValidatorsRegistered { + const PALLET_NAME: &'static str = "ValidatorManager"; + const EVENT_NAME: &'static str = "ValidatorsRegistered"; + } + impl ::subxt::events::DecodeAsEvent for ValidatorsRegistered { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Validators were removed from the set."] pub struct ValidatorsDeregistered(pub validators_deregistered::Field0); pub mod validators_deregistered { use super::runtime_types; - pub type Field0 = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; + pub type Field0 = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; + } + impl ValidatorsDeregistered { + const PALLET_NAME: &'static str = "ValidatorManager"; + const EVENT_NAME: &'static str = "ValidatorsDeregistered"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ValidatorsDeregistered { - const PALLET: &'static str = "ValidatorManager"; - const EVENT: &'static str = "ValidatorsDeregistered"; + impl ::subxt::events::DecodeAsEvent for ValidatorsDeregistered { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -46253,12 +47402,12 @@ pub mod api { #[doc = " Validators that should be retired, because their Parachain was deregistered."] pub fn validators_to_retire( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - validators_to_retire::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + validators_to_retire::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ValidatorManager", "ValidatorsToRetire", [ @@ -46272,12 +47421,12 @@ pub mod api { #[doc = " Validators that should be added."] pub fn validators_to_add( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - validators_to_add::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + validators_to_add::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "ValidatorManager", "ValidatorsToAdd", [ @@ -46292,22 +47441,18 @@ pub mod api { pub mod validators_to_retire { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; } + pub type Output = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; } pub mod validators_to_add { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; } + pub type Output = ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>; } } } @@ -46321,370 +47466,374 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Control the automatic migration."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be [`Config::ControlOrigin`]."] + pub struct ControlAutoMigration { + pub maybe_config: control_auto_migration::MaybeConfig, + } + pub mod control_auto_migration { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Control the automatic migration."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be [`Config::ControlOrigin`]."] - pub struct ControlAutoMigration { - pub maybe_config: control_auto_migration::MaybeConfig, - } - pub mod control_auto_migration { - use super::runtime_types; - pub type MaybeConfig = ::core::option::Option< - runtime_types::pallet_state_trie_migration::pallet::MigrationLimits, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ControlAutoMigration { - const PALLET: &'static str = "StateTrieMigration"; - const CALL: &'static str = "control_auto_migration"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Continue the migration for the given `limits`."] - #[doc = ""] - #[doc = "The dispatch origin of this call can be any signed account."] - #[doc = ""] - #[doc = "This transaction has NO MONETARY INCENTIVES. calling it will not reward anyone. Albeit,"] - #[doc = "Upon successful execution, the transaction fee is returned."] - #[doc = ""] - #[doc = "The (potentially over-estimated) of the byte length of all the data read must be"] - #[doc = "provided for up-front fee-payment and weighing. In essence, the caller is guaranteeing"] - #[doc = "that executing the current `MigrationTask` with the given `limits` will not exceed"] - #[doc = "`real_size_upper` bytes of read data."] - #[doc = ""] - #[doc = "The `witness_task` is merely a helper to prevent the caller from being slashed or"] - #[doc = "generally trigger a migration that they do not intend. This parameter is just a message"] - #[doc = "from caller, saying that they believed `witness_task` was the last state of the"] - #[doc = "migration, and they only wish for their transaction to do anything, if this assumption"] - #[doc = "holds. In case `witness_task` does not match, the transaction fails."] - #[doc = ""] - #[doc = "Based on the documentation of [`MigrationTask::migrate_until_exhaustion`], the"] - #[doc = "recommended way of doing this is to pass a `limit` that only bounds `count`, as the"] - #[doc = "`size` limit can always be overwritten."] - pub struct ContinueMigrate { - pub limits: continue_migrate::Limits, - pub real_size_upper: continue_migrate::RealSizeUpper, - pub witness_task: continue_migrate::WitnessTask, - } - pub mod continue_migrate { - use super::runtime_types; - pub type Limits = - runtime_types::pallet_state_trie_migration::pallet::MigrationLimits; - pub type RealSizeUpper = ::core::primitive::u32; - pub type WitnessTask = - runtime_types::pallet_state_trie_migration::pallet::MigrationTask; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ContinueMigrate { - const PALLET: &'static str = "StateTrieMigration"; - const CALL: &'static str = "continue_migrate"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Migrate the list of top keys by iterating each of them one by one."] - #[doc = ""] - #[doc = "This does not affect the global migration process tracker ([`MigrationProcess`]), and"] - #[doc = "should only be used in case any keys are leftover due to a bug."] - pub struct MigrateCustomTop { - pub keys: migrate_custom_top::Keys, - pub witness_size: migrate_custom_top::WitnessSize, - } - pub mod migrate_custom_top { - use super::runtime_types; - pub type Keys = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >; - pub type WitnessSize = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for MigrateCustomTop { - const PALLET: &'static str = "StateTrieMigration"; - const CALL: &'static str = "migrate_custom_top"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Migrate the list of child keys by iterating each of them one by one."] - #[doc = ""] - #[doc = "All of the given child keys must be present under one `child_root`."] - #[doc = ""] - #[doc = "This does not affect the global migration process tracker ([`MigrationProcess`]), and"] - #[doc = "should only be used in case any keys are leftover due to a bug."] - pub struct MigrateCustomChild { - pub root: migrate_custom_child::Root, - pub child_keys: migrate_custom_child::ChildKeys, - pub total_size: migrate_custom_child::TotalSize, - } - pub mod migrate_custom_child { - use super::runtime_types; - pub type Root = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type ChildKeys = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >; - pub type TotalSize = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for MigrateCustomChild { - const PALLET: &'static str = "StateTrieMigration"; - const CALL: &'static str = "migrate_custom_child"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the maximum limit of the signed migration."] - pub struct SetSignedMaxLimits { - pub limits: set_signed_max_limits::Limits, - } - pub mod set_signed_max_limits { - use super::runtime_types; - pub type Limits = - runtime_types::pallet_state_trie_migration::pallet::MigrationLimits; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetSignedMaxLimits { - const PALLET: &'static str = "StateTrieMigration"; - const CALL: &'static str = "set_signed_max_limits"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Forcefully set the progress the running migration."] - #[doc = ""] - #[doc = "This is only useful in one case: the next key to migrate is too big to be migrated with"] - #[doc = "a signed account, in a parachain context, and we simply want to skip it. A reasonable"] - #[doc = "example of this would be `:code:`, which is both very expensive to migrate, and commonly"] - #[doc = "used, so probably it is already migrated."] - #[doc = ""] - #[doc = "In case you mess things up, you can also, in principle, use this to reset the migration"] - #[doc = "process."] - pub struct ForceSetProgress { - pub progress_top: force_set_progress::ProgressTop, - pub progress_child: force_set_progress::ProgressChild, - } - pub mod force_set_progress { - use super::runtime_types; - pub type ProgressTop = - runtime_types::pallet_state_trie_migration::pallet::Progress; - pub type ProgressChild = - runtime_types::pallet_state_trie_migration::pallet::Progress; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetProgress { - const PALLET: &'static str = "StateTrieMigration"; - const CALL: &'static str = "force_set_progress"; + pub type MaybeConfig = ::core::option::Option< + runtime_types::pallet_state_trie_migration::pallet::MigrationLimits, + >; + } + impl ControlAutoMigration { + const PALLET_NAME: &'static str = "StateTrieMigration"; + const CALL_NAME: &'static str = "control_auto_migration"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ControlAutoMigration { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Control the automatic migration."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be [`Config::ControlOrigin`]."] - pub fn control_auto_migration( - &self, - maybe_config: types::control_auto_migration::MaybeConfig, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "StateTrieMigration", - "control_auto_migration", - types::ControlAutoMigration { maybe_config }, - [ - 41u8, 252u8, 1u8, 4u8, 170u8, 164u8, 45u8, 147u8, 203u8, 58u8, 64u8, - 26u8, 53u8, 231u8, 170u8, 72u8, 23u8, 87u8, 32u8, 93u8, 130u8, 210u8, - 65u8, 200u8, 147u8, 232u8, 32u8, 105u8, 182u8, 213u8, 101u8, 85u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Continue the migration for the given `limits`."] + #[doc = ""] + #[doc = "The dispatch origin of this call can be any signed account."] + #[doc = ""] + #[doc = "This transaction has NO MONETARY INCENTIVES. calling it will not reward anyone. Albeit,"] + #[doc = "Upon successful execution, the transaction fee is returned."] + #[doc = ""] + #[doc = "The (potentially over-estimated) of the byte length of all the data read must be"] + #[doc = "provided for up-front fee-payment and weighing. In essence, the caller is guaranteeing"] + #[doc = "that executing the current `MigrationTask` with the given `limits` will not exceed"] + #[doc = "`real_size_upper` bytes of read data."] + #[doc = ""] + #[doc = "The `witness_task` is merely a helper to prevent the caller from being slashed or"] + #[doc = "generally trigger a migration that they do not intend. This parameter is just a message"] + #[doc = "from caller, saying that they believed `witness_task` was the last state of the"] + #[doc = "migration, and they only wish for their transaction to do anything, if this assumption"] + #[doc = "holds. In case `witness_task` does not match, the transaction fails."] + #[doc = ""] + #[doc = "Based on the documentation of [`MigrationTask::migrate_until_exhaustion`], the"] + #[doc = "recommended way of doing this is to pass a `limit` that only bounds `count`, as the"] + #[doc = "`size` limit can always be overwritten."] + pub struct ContinueMigrate { + pub limits: continue_migrate::Limits, + pub real_size_upper: continue_migrate::RealSizeUpper, + pub witness_task: continue_migrate::WitnessTask, + } + pub mod continue_migrate { + use super::runtime_types; + pub type Limits = + runtime_types::pallet_state_trie_migration::pallet::MigrationLimits; + pub type RealSizeUpper = ::core::primitive::u32; + pub type WitnessTask = + runtime_types::pallet_state_trie_migration::pallet::MigrationTask; + } + impl ContinueMigrate { + const PALLET_NAME: &'static str = "StateTrieMigration"; + const CALL_NAME: &'static str = "continue_migrate"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ContinueMigrate { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Continue the migration for the given `limits`."] - #[doc = ""] - #[doc = "The dispatch origin of this call can be any signed account."] - #[doc = ""] - #[doc = "This transaction has NO MONETARY INCENTIVES. calling it will not reward anyone. Albeit,"] - #[doc = "Upon successful execution, the transaction fee is returned."] - #[doc = ""] - #[doc = "The (potentially over-estimated) of the byte length of all the data read must be"] - #[doc = "provided for up-front fee-payment and weighing. In essence, the caller is guaranteeing"] - #[doc = "that executing the current `MigrationTask` with the given `limits` will not exceed"] - #[doc = "`real_size_upper` bytes of read data."] - #[doc = ""] - #[doc = "The `witness_task` is merely a helper to prevent the caller from being slashed or"] - #[doc = "generally trigger a migration that they do not intend. This parameter is just a message"] - #[doc = "from caller, saying that they believed `witness_task` was the last state of the"] - #[doc = "migration, and they only wish for their transaction to do anything, if this assumption"] - #[doc = "holds. In case `witness_task` does not match, the transaction fails."] - #[doc = ""] - #[doc = "Based on the documentation of [`MigrationTask::migrate_until_exhaustion`], the"] - #[doc = "recommended way of doing this is to pass a `limit` that only bounds `count`, as the"] - #[doc = "`size` limit can always be overwritten."] - pub fn continue_migrate( - &self, - limits: types::continue_migrate::Limits, - real_size_upper: types::continue_migrate::RealSizeUpper, - witness_task: types::continue_migrate::WitnessTask, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "StateTrieMigration", - "continue_migrate", - types::ContinueMigrate { - limits, - real_size_upper, - witness_task, - }, - [ - 244u8, 113u8, 101u8, 72u8, 234u8, 245u8, 21u8, 134u8, 132u8, 53u8, - 179u8, 247u8, 210u8, 42u8, 87u8, 131u8, 157u8, 133u8, 108u8, 97u8, - 12u8, 252u8, 69u8, 100u8, 236u8, 171u8, 134u8, 241u8, 68u8, 15u8, - 227u8, 23u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Migrate the list of top keys by iterating each of them one by one."] + #[doc = ""] + #[doc = "This does not affect the global migration process tracker ([`MigrationProcess`]), and"] + #[doc = "should only be used in case any keys are leftover due to a bug."] + pub struct MigrateCustomTop { + pub keys: migrate_custom_top::Keys, + pub witness_size: migrate_custom_top::WitnessSize, + } + pub mod migrate_custom_top { + use super::runtime_types; + pub type Keys = + ::subxt::alloc::vec::Vec<::subxt::alloc::vec::Vec<::core::primitive::u8>>; + pub type WitnessSize = ::core::primitive::u32; + } + impl MigrateCustomTop { + const PALLET_NAME: &'static str = "StateTrieMigration"; + const CALL_NAME: &'static str = "migrate_custom_top"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for MigrateCustomTop { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Migrate the list of top keys by iterating each of them one by one."] - #[doc = ""] - #[doc = "This does not affect the global migration process tracker ([`MigrationProcess`]), and"] - #[doc = "should only be used in case any keys are leftover due to a bug."] - pub fn migrate_custom_top( - &self, - keys: types::migrate_custom_top::Keys, - witness_size: types::migrate_custom_top::WitnessSize, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "StateTrieMigration", - "migrate_custom_top", - types::MigrateCustomTop { keys, witness_size }, - [ - 167u8, 185u8, 103u8, 14u8, 52u8, 177u8, 104u8, 139u8, 95u8, 195u8, 1u8, - 30u8, 111u8, 205u8, 10u8, 53u8, 116u8, 31u8, 104u8, 135u8, 34u8, 80u8, - 214u8, 3u8, 80u8, 101u8, 21u8, 3u8, 244u8, 62u8, 115u8, 50u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Migrate the list of child keys by iterating each of them one by one."] + #[doc = ""] + #[doc = "All of the given child keys must be present under one `child_root`."] + #[doc = ""] + #[doc = "This does not affect the global migration process tracker ([`MigrationProcess`]), and"] + #[doc = "should only be used in case any keys are leftover due to a bug."] + pub struct MigrateCustomChild { + pub root: migrate_custom_child::Root, + pub child_keys: migrate_custom_child::ChildKeys, + pub total_size: migrate_custom_child::TotalSize, + } + pub mod migrate_custom_child { + use super::runtime_types; + pub type Root = ::subxt::alloc::vec::Vec<::core::primitive::u8>; + pub type ChildKeys = + ::subxt::alloc::vec::Vec<::subxt::alloc::vec::Vec<::core::primitive::u8>>; + pub type TotalSize = ::core::primitive::u32; + } + impl MigrateCustomChild { + const PALLET_NAME: &'static str = "StateTrieMigration"; + const CALL_NAME: &'static str = "migrate_custom_child"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for MigrateCustomChild { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Migrate the list of child keys by iterating each of them one by one."] - #[doc = ""] - #[doc = "All of the given child keys must be present under one `child_root`."] - #[doc = ""] - #[doc = "This does not affect the global migration process tracker ([`MigrationProcess`]), and"] - #[doc = "should only be used in case any keys are leftover due to a bug."] - pub fn migrate_custom_child( - &self, - root: types::migrate_custom_child::Root, - child_keys: types::migrate_custom_child::ChildKeys, - total_size: types::migrate_custom_child::TotalSize, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "StateTrieMigration", - "migrate_custom_child", - types::MigrateCustomChild { - root, - child_keys, - total_size, - }, - [ - 160u8, 99u8, 211u8, 111u8, 120u8, 53u8, 188u8, 31u8, 102u8, 86u8, 94u8, - 86u8, 218u8, 181u8, 14u8, 154u8, 243u8, 49u8, 23u8, 65u8, 218u8, 160u8, - 200u8, 97u8, 208u8, 159u8, 40u8, 10u8, 110u8, 134u8, 86u8, 33u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Set the maximum limit of the signed migration."] + pub struct SetSignedMaxLimits { + pub limits: set_signed_max_limits::Limits, + } + pub mod set_signed_max_limits { + use super::runtime_types; + pub type Limits = + runtime_types::pallet_state_trie_migration::pallet::MigrationLimits; + } + impl SetSignedMaxLimits { + const PALLET_NAME: &'static str = "StateTrieMigration"; + const CALL_NAME: &'static str = "set_signed_max_limits"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetSignedMaxLimits { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Set the maximum limit of the signed migration."] - pub fn set_signed_max_limits( - &self, - limits: types::set_signed_max_limits::Limits, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "StateTrieMigration", - "set_signed_max_limits", - types::SetSignedMaxLimits { limits }, - [ - 106u8, 43u8, 66u8, 154u8, 114u8, 172u8, 120u8, 79u8, 212u8, 196u8, - 220u8, 112u8, 17u8, 42u8, 131u8, 249u8, 56u8, 91u8, 11u8, 152u8, 80u8, - 120u8, 36u8, 113u8, 51u8, 34u8, 10u8, 35u8, 135u8, 228u8, 216u8, 38u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Forcefully set the progress the running migration."] + #[doc = ""] + #[doc = "This is only useful in one case: the next key to migrate is too big to be migrated with"] + #[doc = "a signed account, in a parachain context, and we simply want to skip it. A reasonable"] + #[doc = "example of this would be `:code:`, which is both very expensive to migrate, and commonly"] + #[doc = "used, so probably it is already migrated."] + #[doc = ""] + #[doc = "In case you mess things up, you can also, in principle, use this to reset the migration"] + #[doc = "process."] + pub struct ForceSetProgress { + pub progress_top: force_set_progress::ProgressTop, + pub progress_child: force_set_progress::ProgressChild, + } + pub mod force_set_progress { + use super::runtime_types; + pub type ProgressTop = runtime_types::pallet_state_trie_migration::pallet::Progress; + pub type ProgressChild = + runtime_types::pallet_state_trie_migration::pallet::Progress; + } + impl ForceSetProgress { + const PALLET_NAME: &'static str = "StateTrieMigration"; + const CALL_NAME: &'static str = "force_set_progress"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for ForceSetProgress { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Forcefully set the progress the running migration."] - #[doc = ""] - #[doc = "This is only useful in one case: the next key to migrate is too big to be migrated with"] - #[doc = "a signed account, in a parachain context, and we simply want to skip it. A reasonable"] - #[doc = "example of this would be `:code:`, which is both very expensive to migrate, and commonly"] - #[doc = "used, so probably it is already migrated."] - #[doc = ""] - #[doc = "In case you mess things up, you can also, in principle, use this to reset the migration"] - #[doc = "process."] - pub fn force_set_progress( - &self, - progress_top: types::force_set_progress::ProgressTop, - progress_child: types::force_set_progress::ProgressChild, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "StateTrieMigration", - "force_set_progress", - types::ForceSetProgress { - progress_top, - progress_child, - }, - [ - 103u8, 70u8, 170u8, 72u8, 136u8, 4u8, 169u8, 245u8, 254u8, 93u8, 17u8, - 104u8, 19u8, 53u8, 182u8, 35u8, 205u8, 99u8, 116u8, 101u8, 102u8, - 124u8, 253u8, 206u8, 111u8, 140u8, 212u8, 12u8, 218u8, 19u8, 39u8, - 229u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Control the automatic migration."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be [`Config::ControlOrigin`]."] + pub fn control_auto_migration( + &self, + maybe_config: super::control_auto_migration::MaybeConfig, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "StateTrieMigration", + "control_auto_migration", + super::ControlAutoMigration { maybe_config }, + [ + 41u8, 252u8, 1u8, 4u8, 170u8, 164u8, 45u8, 147u8, 203u8, 58u8, + 64u8, 26u8, 53u8, 231u8, 170u8, 72u8, 23u8, 87u8, 32u8, 93u8, + 130u8, 210u8, 65u8, 200u8, 147u8, 232u8, 32u8, 105u8, 182u8, 213u8, + 101u8, 85u8, + ], + ) + } + #[doc = "Continue the migration for the given `limits`."] + #[doc = ""] + #[doc = "The dispatch origin of this call can be any signed account."] + #[doc = ""] + #[doc = "This transaction has NO MONETARY INCENTIVES. calling it will not reward anyone. Albeit,"] + #[doc = "Upon successful execution, the transaction fee is returned."] + #[doc = ""] + #[doc = "The (potentially over-estimated) of the byte length of all the data read must be"] + #[doc = "provided for up-front fee-payment and weighing. In essence, the caller is guaranteeing"] + #[doc = "that executing the current `MigrationTask` with the given `limits` will not exceed"] + #[doc = "`real_size_upper` bytes of read data."] + #[doc = ""] + #[doc = "The `witness_task` is merely a helper to prevent the caller from being slashed or"] + #[doc = "generally trigger a migration that they do not intend. This parameter is just a message"] + #[doc = "from caller, saying that they believed `witness_task` was the last state of the"] + #[doc = "migration, and they only wish for their transaction to do anything, if this assumption"] + #[doc = "holds. In case `witness_task` does not match, the transaction fails."] + #[doc = ""] + #[doc = "Based on the documentation of [`MigrationTask::migrate_until_exhaustion`], the"] + #[doc = "recommended way of doing this is to pass a `limit` that only bounds `count`, as the"] + #[doc = "`size` limit can always be overwritten."] + pub fn continue_migrate( + &self, + limits: super::continue_migrate::Limits, + real_size_upper: super::continue_migrate::RealSizeUpper, + witness_task: super::continue_migrate::WitnessTask, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "StateTrieMigration", + "continue_migrate", + super::ContinueMigrate { + limits, + real_size_upper, + witness_task, + }, + [ + 244u8, 113u8, 101u8, 72u8, 234u8, 245u8, 21u8, 134u8, 132u8, 53u8, + 179u8, 247u8, 210u8, 42u8, 87u8, 131u8, 157u8, 133u8, 108u8, 97u8, + 12u8, 252u8, 69u8, 100u8, 236u8, 171u8, 134u8, 241u8, 68u8, 15u8, + 227u8, 23u8, + ], + ) + } + #[doc = "Migrate the list of top keys by iterating each of them one by one."] + #[doc = ""] + #[doc = "This does not affect the global migration process tracker ([`MigrationProcess`]), and"] + #[doc = "should only be used in case any keys are leftover due to a bug."] + pub fn migrate_custom_top( + &self, + keys: super::migrate_custom_top::Keys, + witness_size: super::migrate_custom_top::WitnessSize, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "StateTrieMigration", + "migrate_custom_top", + super::MigrateCustomTop { keys, witness_size }, + [ + 167u8, 185u8, 103u8, 14u8, 52u8, 177u8, 104u8, 139u8, 95u8, 195u8, + 1u8, 30u8, 111u8, 205u8, 10u8, 53u8, 116u8, 31u8, 104u8, 135u8, + 34u8, 80u8, 214u8, 3u8, 80u8, 101u8, 21u8, 3u8, 244u8, 62u8, 115u8, + 50u8, + ], + ) + } + #[doc = "Migrate the list of child keys by iterating each of them one by one."] + #[doc = ""] + #[doc = "All of the given child keys must be present under one `child_root`."] + #[doc = ""] + #[doc = "This does not affect the global migration process tracker ([`MigrationProcess`]), and"] + #[doc = "should only be used in case any keys are leftover due to a bug."] + pub fn migrate_custom_child( + &self, + root: super::migrate_custom_child::Root, + child_keys: super::migrate_custom_child::ChildKeys, + total_size: super::migrate_custom_child::TotalSize, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "StateTrieMigration", + "migrate_custom_child", + super::MigrateCustomChild { + root, + child_keys, + total_size, + }, + [ + 160u8, 99u8, 211u8, 111u8, 120u8, 53u8, 188u8, 31u8, 102u8, 86u8, + 94u8, 86u8, 218u8, 181u8, 14u8, 154u8, 243u8, 49u8, 23u8, 65u8, + 218u8, 160u8, 200u8, 97u8, 208u8, 159u8, 40u8, 10u8, 110u8, 134u8, + 86u8, 33u8, + ], + ) + } + #[doc = "Set the maximum limit of the signed migration."] + pub fn set_signed_max_limits( + &self, + limits: super::set_signed_max_limits::Limits, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "StateTrieMigration", + "set_signed_max_limits", + super::SetSignedMaxLimits { limits }, + [ + 106u8, 43u8, 66u8, 154u8, 114u8, 172u8, 120u8, 79u8, 212u8, 196u8, + 220u8, 112u8, 17u8, 42u8, 131u8, 249u8, 56u8, 91u8, 11u8, 152u8, + 80u8, 120u8, 36u8, 113u8, 51u8, 34u8, 10u8, 35u8, 135u8, 228u8, + 216u8, 38u8, + ], + ) + } + #[doc = "Forcefully set the progress the running migration."] + #[doc = ""] + #[doc = "This is only useful in one case: the next key to migrate is too big to be migrated with"] + #[doc = "a signed account, in a parachain context, and we simply want to skip it. A reasonable"] + #[doc = "example of this would be `:code:`, which is both very expensive to migrate, and commonly"] + #[doc = "used, so probably it is already migrated."] + #[doc = ""] + #[doc = "In case you mess things up, you can also, in principle, use this to reset the migration"] + #[doc = "process."] + pub fn force_set_progress( + &self, + progress_top: super::force_set_progress::ProgressTop, + progress_child: super::force_set_progress::ProgressChild, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "StateTrieMigration", + "force_set_progress", + super::ForceSetProgress { + progress_top, + progress_child, + }, + [ + 103u8, 70u8, 170u8, 72u8, 136u8, 4u8, 169u8, 245u8, 254u8, 93u8, + 17u8, 104u8, 19u8, 53u8, 182u8, 35u8, 205u8, 99u8, 116u8, 101u8, + 102u8, 124u8, 253u8, 206u8, 111u8, 140u8, 212u8, 12u8, 218u8, 19u8, + 39u8, 229u8, + ], + ) + } } } } @@ -46693,12 +47842,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Given number of `(top, child)` keys were migrated respectively, with the given"] #[doc = "`compute`."] pub struct Migrated { @@ -46713,17 +47862,22 @@ pub mod api { pub type Compute = runtime_types::pallet_state_trie_migration::pallet::MigrationCompute; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Migrated { - const PALLET: &'static str = "StateTrieMigration"; - const EVENT: &'static str = "Migrated"; + impl Migrated { + const PALLET_NAME: &'static str = "StateTrieMigration"; + const EVENT_NAME: &'static str = "Migrated"; + } + impl ::subxt::events::DecodeAsEvent for Migrated { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Some account got slashed by the given amount."] pub struct Slashed { pub who: slashed::Who, @@ -46731,33 +47885,43 @@ pub mod api { } pub mod slashed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Slashed { - const PALLET: &'static str = "StateTrieMigration"; - const EVENT: &'static str = "Slashed"; + impl Slashed { + const PALLET_NAME: &'static str = "StateTrieMigration"; + const EVENT_NAME: &'static str = "Slashed"; + } + impl ::subxt::events::DecodeAsEvent for Slashed { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The auto migration task finished."] pub struct AutoMigrationFinished; - impl ::subxt::ext::subxt_core::events::StaticEvent for AutoMigrationFinished { - const PALLET: &'static str = "StateTrieMigration"; - const EVENT: &'static str = "AutoMigrationFinished"; + impl AutoMigrationFinished { + const PALLET_NAME: &'static str = "StateTrieMigration"; + const EVENT_NAME: &'static str = "AutoMigrationFinished"; + } + impl ::subxt::events::DecodeAsEvent for AutoMigrationFinished { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Migration got halted due to an error or miss-configuration."] pub struct Halted { pub error: halted::Error, @@ -46766,9 +47930,14 @@ pub mod api { use super::runtime_types; pub type Error = runtime_types::pallet_state_trie_migration::pallet::Error; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Halted { - const PALLET: &'static str = "StateTrieMigration"; - const EVENT: &'static str = "Halted"; + impl Halted { + const PALLET_NAME: &'static str = "StateTrieMigration"; + const EVENT_NAME: &'static str = "Halted"; + } + impl ::subxt::events::DecodeAsEvent for Halted { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -46782,12 +47951,12 @@ pub mod api { #[doc = " forward by any of the means provided by this pallet."] pub fn migration_process( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - migration_process::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + migration_process::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "StateTrieMigration", "MigrationProcess", [ @@ -46802,12 +47971,9 @@ pub mod api { #[doc = " If set to None, then no automatic migration happens."] pub fn auto_limits( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - auto_limits::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), auto_limits::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "StateTrieMigration", "AutoLimits", [ @@ -46823,12 +47989,12 @@ pub mod api { #[doc = " If not set, no signed submission is allowed."] pub fn signed_migration_max_limits( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ) -> ::subxt::storage::StaticAddress< (), - signed_migration_max_limits::output::Output, - ::subxt::ext::subxt_core::utils::Yes, + signed_migration_max_limits::Output, + ::subxt::utils::Yes, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ::subxt::storage::StaticAddress::new_static( "StateTrieMigration", "SignedMigrationMaxLimits", [ @@ -46843,30 +48009,29 @@ pub mod api { pub mod migration_process { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::pallet_state_trie_migration::pallet::MigrationTask; } + pub type Output = runtime_types::pallet_state_trie_migration::pallet::MigrationTask; } pub mod auto_limits { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::pallet_state_trie_migration::pallet::MigrationLimits, - >; } + pub type Output = ::core::option::Option< + runtime_types::pallet_state_trie_migration::pallet::MigrationLimits, + >; } pub mod signed_migration_max_limits { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = - runtime_types::pallet_state_trie_migration::pallet::MigrationLimits; } + pub type Output = + runtime_types::pallet_state_trie_migration::pallet::MigrationLimits; } } pub mod constants { @@ -46896,10 +48061,8 @@ pub mod api { #[doc = " "] pub fn max_key_len( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ) -> ::subxt::constants::StaticAddress<::core::primitive::u32> { + ::subxt::constants::StaticAddress::new_static( "StateTrieMigration", "MaxKeyLen", [ @@ -46921,83 +48084,84 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "A dispatch that will fill the block weight up to the given ratio."] + pub struct FillBlock { + pub ratio: fill_block::Ratio, + } + pub mod fill_block { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "A dispatch that will fill the block weight up to the given ratio."] - pub struct FillBlock { - pub ratio: fill_block::Ratio, - } - pub mod fill_block { - use super::runtime_types; - pub type Ratio = runtime_types::sp_arithmetic::per_things::Perbill; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FillBlock { - const PALLET: &'static str = "RootTesting"; - const CALL: &'static str = "fill_block"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct TriggerDefensive; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TriggerDefensive { - const PALLET: &'static str = "RootTesting"; - const CALL: &'static str = "trigger_defensive"; + pub type Ratio = runtime_types::sp_arithmetic::per_things::Perbill; + } + impl FillBlock { + const PALLET_NAME: &'static str = "RootTesting"; + const CALL_NAME: &'static str = "fill_block"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for FillBlock { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "A dispatch that will fill the block weight up to the given ratio."] - pub fn fill_block( - &self, - ratio: types::fill_block::Ratio, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "RootTesting", - "fill_block", - types::FillBlock { ratio }, - [ - 164u8, 37u8, 43u8, 91u8, 125u8, 34u8, 208u8, 126u8, 67u8, 94u8, 184u8, - 240u8, 68u8, 208u8, 41u8, 206u8, 172u8, 95u8, 111u8, 115u8, 9u8, 250u8, - 163u8, 66u8, 240u8, 0u8, 237u8, 140u8, 87u8, 57u8, 162u8, 117u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct TriggerDefensive; + impl TriggerDefensive { + const PALLET_NAME: &'static str = "RootTesting"; + const CALL_NAME: &'static str = "trigger_defensive"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for TriggerDefensive { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - pub fn trigger_defensive( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "RootTesting", - "trigger_defensive", - types::TriggerDefensive {}, - [ - 170u8, 234u8, 12u8, 158u8, 10u8, 171u8, 161u8, 144u8, 101u8, 67u8, - 150u8, 128u8, 105u8, 234u8, 223u8, 60u8, 241u8, 245u8, 112u8, 21u8, - 80u8, 216u8, 72u8, 147u8, 22u8, 125u8, 19u8, 200u8, 171u8, 153u8, 88u8, - 194u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "A dispatch that will fill the block weight up to the given ratio."] + pub fn fill_block( + &self, + ratio: super::fill_block::Ratio, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "RootTesting", + "fill_block", + super::FillBlock { ratio }, + [ + 164u8, 37u8, 43u8, 91u8, 125u8, 34u8, 208u8, 126u8, 67u8, 94u8, + 184u8, 240u8, 68u8, 208u8, 41u8, 206u8, 172u8, 95u8, 111u8, 115u8, + 9u8, 250u8, 163u8, 66u8, 240u8, 0u8, 237u8, 140u8, 87u8, 57u8, + 162u8, 117u8, + ], + ) + } + pub fn trigger_defensive( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "RootTesting", + "trigger_defensive", + super::TriggerDefensive {}, + [ + 170u8, 234u8, 12u8, 158u8, 10u8, 171u8, 161u8, 144u8, 101u8, 67u8, + 150u8, 128u8, 105u8, 234u8, 223u8, 60u8, 241u8, 245u8, 112u8, 21u8, + 80u8, 216u8, 72u8, 147u8, 22u8, 125u8, 19u8, 200u8, 171u8, 153u8, + 88u8, 194u8, + ], + ) + } } } } @@ -47006,17 +48170,22 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Event dispatched when the trigger_defensive extrinsic is called."] pub struct DefensiveTestCall; - impl ::subxt::ext::subxt_core::events::StaticEvent for DefensiveTestCall { - const PALLET: &'static str = "RootTesting"; - const EVENT: &'static str = "DefensiveTestCall"; + impl DefensiveTestCall { + const PALLET_NAME: &'static str = "RootTesting"; + const EVENT_NAME: &'static str = "DefensiveTestCall"; + } + impl ::subxt::events::DecodeAsEvent for DefensiveTestCall { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } } @@ -47030,247 +48199,243 @@ pub mod api { pub mod calls { use super::root_mod; use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + pub struct Sudo { + pub call: ::subxt::alloc::boxed::Box, + } + pub mod sudo { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] - pub struct Sudo { - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod sudo { - use super::runtime_types; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Sudo { - const PALLET: &'static str = "Sudo"; - const CALL: &'static str = "sudo"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] - #[doc = "This function does not check the weight of the call, and instead allows the"] - #[doc = "Sudo user to specify the weight of the call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub struct SudoUncheckedWeight { - pub call: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub weight: sudo_unchecked_weight::Weight, - } - pub mod sudo_unchecked_weight { - use super::runtime_types; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - pub type Weight = runtime_types::sp_weights::weight_v2::Weight; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SudoUncheckedWeight { - const PALLET: &'static str = "Sudo"; - const CALL: &'static str = "sudo_unchecked_weight"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] - #[doc = "key."] - pub struct SetKey { - pub new: set_key::New, - } - pub mod set_key { - use super::runtime_types; - pub type New = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetKey { - const PALLET: &'static str = "Sudo"; - const CALL: &'static str = "set_key"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] - #[doc = "a given account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub struct SudoAs { - pub who: sudo_as::Who, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod sudo_as { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SudoAs { - const PALLET: &'static str = "Sudo"; - const CALL: &'static str = "sudo_as"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Permanently removes the sudo key."] - #[doc = ""] - #[doc = "**This cannot be un-done.**"] - pub struct RemoveKey; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveKey { - const PALLET: &'static str = "Sudo"; - const CALL: &'static str = "remove_key"; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl Sudo { + const PALLET_NAME: &'static str = "Sudo"; + const CALL_NAME: &'static str = "sudo"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for Sudo { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] - pub fn sudo( - &self, - call: types::sudo::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Sudo", - "sudo", - types::Sudo { - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 13u8, 234u8, 7u8, 113u8, 77u8, 58u8, 175u8, 47u8, 188u8, 116u8, 191u8, - 230u8, 105u8, 100u8, 178u8, 17u8, 205u8, 162u8, 164u8, 134u8, 72u8, - 81u8, 187u8, 222u8, 240u8, 32u8, 91u8, 242u8, 209u8, 84u8, 125u8, - 116u8, - ], - ) + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Sudo user to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub struct SudoUncheckedWeight { + pub call: ::subxt::alloc::boxed::Box, + pub weight: sudo_unchecked_weight::Weight, + } + pub mod sudo_unchecked_weight { + use super::runtime_types; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + pub type Weight = runtime_types::sp_weights::weight_v2::Weight; + } + impl SudoUncheckedWeight { + const PALLET_NAME: &'static str = "Sudo"; + const CALL_NAME: &'static str = "sudo_unchecked_weight"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SudoUncheckedWeight { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] - #[doc = "This function does not check the weight of the call, and instead allows the"] - #[doc = "Sudo user to specify the weight of the call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub fn sudo_unchecked_weight( - &self, - call: types::sudo_unchecked_weight::Call, - weight: types::sudo_unchecked_weight::Weight, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Sudo", - "sudo_unchecked_weight", - types::SudoUncheckedWeight { - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - weight, - }, - [ - 186u8, 38u8, 165u8, 213u8, 119u8, 35u8, 120u8, 14u8, 212u8, 253u8, - 10u8, 71u8, 69u8, 120u8, 146u8, 26u8, 154u8, 94u8, 128u8, 79u8, 55u8, - 104u8, 246u8, 99u8, 40u8, 93u8, 228u8, 139u8, 223u8, 8u8, 90u8, 199u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] + #[doc = "key."] + pub struct SetKey { + pub new: set_key::New, + } + pub mod set_key { + use super::runtime_types; + pub type New = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + } + impl SetKey { + const PALLET_NAME: &'static str = "Sudo"; + const CALL_NAME: &'static str = "set_key"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SetKey { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] - #[doc = "key."] - pub fn set_key( - &self, - new: types::set_key::New, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Sudo", - "set_key", - types::SetKey { new }, - [ - 9u8, 73u8, 39u8, 205u8, 188u8, 127u8, 143u8, 54u8, 128u8, 94u8, 8u8, - 227u8, 197u8, 44u8, 70u8, 93u8, 228u8, 196u8, 64u8, 165u8, 226u8, - 158u8, 101u8, 192u8, 22u8, 193u8, 102u8, 84u8, 21u8, 35u8, 92u8, 198u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] + #[doc = "a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub struct SudoAs { + pub who: sudo_as::Who, + pub call: ::subxt::alloc::boxed::Box, + } + pub mod sudo_as { + use super::runtime_types; + pub type Who = ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + } + impl SudoAs { + const PALLET_NAME: &'static str = "Sudo"; + const CALL_NAME: &'static str = "sudo_as"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for SudoAs { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] - #[doc = "a given account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub fn sudo_as( - &self, - who: types::sudo_as::Who, - call: types::sudo_as::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Sudo", - "sudo_as", - types::SudoAs { - who, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 19u8, 27u8, 169u8, 165u8, 246u8, 113u8, 53u8, 175u8, 30u8, 140u8, - 153u8, 169u8, 69u8, 59u8, 43u8, 225u8, 24u8, 181u8, 222u8, 47u8, 155u8, - 17u8, 132u8, 210u8, 29u8, 50u8, 196u8, 130u8, 157u8, 94u8, 174u8, 55u8, - ], - ) + } + #[derive( + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Permanently removes the sudo key."] + #[doc = ""] + #[doc = "**This cannot be un-done.**"] + pub struct RemoveKey; + impl RemoveKey { + const PALLET_NAME: &'static str = "Sudo"; + const CALL_NAME: &'static str = "remove_key"; + } + impl ::subxt::extrinsics::DecodeAsExtrinsic for RemoveKey { + fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME } - #[doc = "Permanently removes the sudo key."] - #[doc = ""] - #[doc = "**This cannot be un-done.**"] - pub fn remove_key( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Sudo", - "remove_key", - types::RemoveKey {}, - [ - 133u8, 253u8, 54u8, 175u8, 202u8, 239u8, 5u8, 198u8, 180u8, 138u8, - 25u8, 28u8, 109u8, 40u8, 30u8, 56u8, 126u8, 100u8, 52u8, 205u8, 250u8, - 191u8, 61u8, 195u8, 172u8, 142u8, 184u8, 239u8, 247u8, 10u8, 211u8, - 79u8, - ], - ) + } + pub mod api { + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + pub fn sudo( + &self, + call: super::sudo::Call, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Sudo", + "sudo", + super::Sudo { + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 13u8, 234u8, 7u8, 113u8, 77u8, 58u8, 175u8, 47u8, 188u8, 116u8, + 191u8, 230u8, 105u8, 100u8, 178u8, 17u8, 205u8, 162u8, 164u8, + 134u8, 72u8, 81u8, 187u8, 222u8, 240u8, 32u8, 91u8, 242u8, 209u8, + 84u8, 125u8, 116u8, + ], + ) + } + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Sudo user to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub fn sudo_unchecked_weight( + &self, + call: super::sudo_unchecked_weight::Call, + weight: super::sudo_unchecked_weight::Weight, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Sudo", + "sudo_unchecked_weight", + super::SudoUncheckedWeight { + call: ::subxt::alloc::boxed::Box::new(call), + weight, + }, + [ + 186u8, 38u8, 165u8, 213u8, 119u8, 35u8, 120u8, 14u8, 212u8, 253u8, + 10u8, 71u8, 69u8, 120u8, 146u8, 26u8, 154u8, 94u8, 128u8, 79u8, + 55u8, 104u8, 246u8, 99u8, 40u8, 93u8, 228u8, 139u8, 223u8, 8u8, + 90u8, 199u8, + ], + ) + } + #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] + #[doc = "key."] + pub fn set_key( + &self, + new: super::set_key::New, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Sudo", + "set_key", + super::SetKey { new }, + [ + 9u8, 73u8, 39u8, 205u8, 188u8, 127u8, 143u8, 54u8, 128u8, 94u8, + 8u8, 227u8, 197u8, 44u8, 70u8, 93u8, 228u8, 196u8, 64u8, 165u8, + 226u8, 158u8, 101u8, 192u8, 22u8, 193u8, 102u8, 84u8, 21u8, 35u8, + 92u8, 198u8, + ], + ) + } + #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] + #[doc = "a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub fn sudo_as( + &self, + who: super::sudo_as::Who, + call: super::sudo_as::Call, + ) -> ::subxt::transactions::StaticPayload { + ::subxt::transactions::StaticPayload::new_static( + "Sudo", + "sudo_as", + super::SudoAs { + who, + call: ::subxt::alloc::boxed::Box::new(call), + }, + [ + 19u8, 27u8, 169u8, 165u8, 246u8, 113u8, 53u8, 175u8, 30u8, 140u8, + 153u8, 169u8, 69u8, 59u8, 43u8, 225u8, 24u8, 181u8, 222u8, 47u8, + 155u8, 17u8, 132u8, 210u8, 29u8, 50u8, 196u8, 130u8, 157u8, 94u8, + 174u8, 55u8, + ], + ) + } + #[doc = "Permanently removes the sudo key."] + #[doc = ""] + #[doc = "**This cannot be un-done.**"] + pub fn remove_key( + &self, + ) -> ::subxt::transactions::StaticPayload + { + ::subxt::transactions::StaticPayload::new_static( + "Sudo", + "remove_key", + super::RemoveKey {}, + [ + 133u8, 253u8, 54u8, 175u8, 202u8, 239u8, 5u8, 198u8, 180u8, 138u8, + 25u8, 28u8, 109u8, 40u8, 30u8, 56u8, 126u8, 100u8, 52u8, 205u8, + 250u8, 191u8, 61u8, 195u8, 172u8, 142u8, 184u8, 239u8, 247u8, 10u8, + 211u8, 79u8, + ], + ) + } } } } @@ -47279,12 +48444,12 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A sudo call just took place."] pub struct Sudid { pub sudo_result: sudid::SudoResult, @@ -47294,17 +48459,22 @@ pub mod api { pub type SudoResult = ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Sudid { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "Sudid"; + impl Sudid { + const PALLET_NAME: &'static str = "Sudo"; + const EVENT_NAME: &'static str = "Sudid"; + } + impl ::subxt::events::DecodeAsEvent for Sudid { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The sudo key has been updated."] pub struct KeyChanged { pub old: key_changed::Old, @@ -47312,33 +48482,43 @@ pub mod api { } pub mod key_changed { use super::runtime_types; - pub type Old = ::core::option::Option<::subxt::ext::subxt_core::utils::AccountId32>; - pub type New = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Old = ::core::option::Option<::subxt::utils::AccountId32>; + pub type New = ::subxt::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for KeyChanged { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "KeyChanged"; + impl KeyChanged { + const PALLET_NAME: &'static str = "Sudo"; + const EVENT_NAME: &'static str = "KeyChanged"; + } + impl ::subxt::events::DecodeAsEvent for KeyChanged { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The key was permanently removed."] pub struct KeyRemoved; - impl ::subxt::ext::subxt_core::events::StaticEvent for KeyRemoved { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "KeyRemoved"; + impl KeyRemoved { + const PALLET_NAME: &'static str = "Sudo"; + const EVENT_NAME: &'static str = "KeyRemoved"; + } + impl ::subxt::events::DecodeAsEvent for KeyRemoved { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "A [sudo_as](Pallet::sudo_as) call just took place."] pub struct SudoAsDone { pub sudo_result: sudo_as_done::SudoResult, @@ -47348,9 +48528,14 @@ pub mod api { pub type SudoResult = ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SudoAsDone { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "SudoAsDone"; + impl SudoAsDone { + const PALLET_NAME: &'static str = "Sudo"; + const EVENT_NAME: &'static str = "SudoAsDone"; + } + impl ::subxt::events::DecodeAsEvent for SudoAsDone { + fn is_event(pallet_name: &str, event_name: &str) -> bool { + pallet_name == Self::PALLET_NAME && event_name == Self::EVENT_NAME + } } } pub mod storage { @@ -47361,12 +48546,9 @@ pub mod api { #[doc = " The `AccountId` of the sudo key."] pub fn key( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - key::output::Output, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + ) -> ::subxt::storage::StaticAddress<(), key::Output, ::subxt::utils::Yes> + { + ::subxt::storage::StaticAddress::new_static( "Sudo", "Key", [ @@ -47381,10 +48563,10 @@ pub mod api { pub mod key { use super::root_mod; use super::runtime_types; - pub mod output { + pub mod input { use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; } + pub type Output = ::subxt::utils::AccountId32; } } } @@ -47395,43 +48577,35 @@ pub mod api { pub mod bounded_vec { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct BoundedVec<_0>(pub ::subxt::ext::subxt_core::alloc::vec::Vec<_0>); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct BoundedVec<_0>(pub ::subxt::alloc::vec::Vec<_0>); } pub mod weak_bounded_vec { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct WeakBoundedVec<_0>(pub ::subxt::ext::subxt_core::alloc::vec::Vec<_0>); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct WeakBoundedVec<_0>(pub ::subxt::alloc::vec::Vec<_0>); } } pub mod finality_grandpa { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Equivocation<_0, _1, _2> { pub round_number: ::core::primitive::u64, pub identity: _0, @@ -47439,23 +48613,23 @@ pub mod api { pub second: (_1, _2), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Precommit<_0, _1> { pub target_hash: _0, pub target_number: _1, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Prevote<_0, _1> { pub target_hash: _0, pub target_number: _1, @@ -47464,22 +48638,22 @@ pub mod api { pub mod frame_metadata_hash_extension { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CheckMetadataHash { pub mode: runtime_types::frame_metadata_hash_extension::Mode, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Mode { #[codec(index = 0)] Disabled, @@ -47492,16 +48666,12 @@ pub mod api { pub mod dispatch { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum DispatchClass { #[codec(index = 0)] Normal, @@ -47511,16 +48681,12 @@ pub mod api { Mandatory, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Pays { #[codec(index = 0)] Yes, @@ -47528,48 +48694,36 @@ pub mod api { No, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PerDispatchClass<_0> { pub normal: _0, pub operational: _0, pub mandatory: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PostDispatchInfo { pub actual_weight: ::core::option::Option, pub pays_fee: runtime_types::frame_support::dispatch::Pays, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum RawOrigin<_0> { #[codec(index = 0)] Root, @@ -47586,16 +48740,12 @@ pub mod api { pub mod messages { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ProcessMessageError { #[codec(index = 0)] BadFormat, @@ -47614,20 +48764,16 @@ pub mod api { pub mod preimages { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Bounded<_0, _1> { #[codec(index = 0)] Legacy { - hash: ::subxt::ext::subxt_core::utils::H256, + hash: ::subxt::utils::H256, }, #[codec(index = 1)] Inline( @@ -47637,7 +48783,7 @@ pub mod api { ), #[codec(index = 2)] Lookup { - hash: ::subxt::ext::subxt_core::utils::H256, + hash: ::subxt::utils::H256, len: ::core::primitive::u32, }, __Ignore(::core::marker::PhantomData<(_0, _1)>), @@ -47646,16 +48792,12 @@ pub mod api { pub mod schedule { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum DispatchTime<_0> { #[codec(index = 0)] At(_0), @@ -47666,28 +48808,20 @@ pub mod api { pub mod storage { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Disabled; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct NoDrop<_0>(pub _0); } pub mod tokens { @@ -47697,46 +48831,34 @@ pub mod api { pub mod imbalance { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Imbalance<_0> { pub amount: _0, } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct HoldConsideration(pub ::core::primitive::u128); } pub mod misc { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum BalanceStatus { #[codec(index = 0)] Free, @@ -47744,16 +48866,12 @@ pub mod api { Reserved, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct IdAmount<_0, _1> { pub id: _0, pub amount: _1, @@ -47762,12 +48880,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PalletId(pub [::core::primitive::u8; 8usize]); } pub mod frame_system { @@ -47777,168 +48895,124 @@ pub mod api { pub mod authorize_call { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AuthorizeCall; } pub mod check_genesis { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CheckGenesis; } pub mod check_mortality { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CheckMortality(pub runtime_types::sp_runtime::generic::era::Era); } pub mod check_non_zero_sender { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CheckNonZeroSender; } pub mod check_nonce { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CheckNonce(#[codec(compact)] pub ::core::primitive::u32); } pub mod check_spec_version { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CheckSpecVersion; } pub mod check_tx_version { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CheckTxVersion; } pub mod check_weight { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CheckWeight; } pub mod weight_reclaim { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct WeightReclaim; } } pub mod limits { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BlockLength { pub max: runtime_types::frame_support::dispatch::PerDispatchClass< ::core::primitive::u32, >, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BlockWeights { pub base_block: runtime_types::sp_weights::weight_v2::Weight, pub max_block: runtime_types::sp_weights::weight_v2::Weight, @@ -47947,16 +49021,12 @@ pub mod api { >, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct WeightsPerClass { pub base_extrinsic: runtime_types::sp_weights::weight_v2::Weight, pub max_extrinsic: @@ -47970,16 +49040,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -47987,7 +49053,7 @@ pub mod api { #[doc = ""] #[doc = "Can be executed by every `origin`."] remark { - remark: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + remark: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 1)] #[doc = "Set the number of pages in the WebAssembly environment's heap."] @@ -47995,7 +49061,7 @@ pub mod api { #[codec(index = 2)] #[doc = "Set the new runtime code."] set_code { - code: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + code: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 3)] #[doc = "Set the new runtime code without doing any checks of the given `code`."] @@ -48003,21 +49069,21 @@ pub mod api { #[doc = "Note that runtime upgrades will not run if this is called with a not-increasing spec"] #[doc = "version!"] set_code_without_checks { - code: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + code: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 4)] #[doc = "Set some items of storage."] set_storage { - items: ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + items: ::subxt::alloc::vec::Vec<( + ::subxt::alloc::vec::Vec<::core::primitive::u8>, + ::subxt::alloc::vec::Vec<::core::primitive::u8>, )>, }, #[codec(index = 5)] #[doc = "Kill some items from storage."] kill_storage { - keys: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + keys: ::subxt::alloc::vec::Vec< + ::subxt::alloc::vec::Vec<::core::primitive::u8>, >, }, #[codec(index = 6)] @@ -48026,22 +49092,20 @@ pub mod api { #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] #[doc = "the prefix we are removing to accurately calculate the weight of this function."] kill_prefix { - prefix: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + prefix: ::subxt::alloc::vec::Vec<::core::primitive::u8>, subkeys: ::core::primitive::u32, }, #[codec(index = 7)] #[doc = "Make some on-chain remark and emit event."] remark_with_event { - remark: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + remark: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 9)] #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] #[doc = "later."] #[doc = ""] #[doc = "This call requires Root origin."] - authorize_upgrade { - code_hash: ::subxt::ext::subxt_core::utils::H256, - }, + authorize_upgrade { code_hash: ::subxt::utils::H256 }, #[codec(index = 10)] #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] #[doc = "later."] @@ -48051,9 +49115,7 @@ pub mod api { #[doc = "recommended for normal use. Use `authorize_upgrade` instead."] #[doc = ""] #[doc = "This call requires Root origin."] - authorize_upgrade_without_checks { - code_hash: ::subxt::ext::subxt_core::utils::H256, - }, + authorize_upgrade_without_checks { code_hash: ::subxt::utils::H256 }, #[codec(index = 11)] #[doc = "Provide the preimage (runtime binary) `code` for an upgrade that has been authorized."] #[doc = ""] @@ -48065,20 +49127,16 @@ pub mod api { #[doc = ""] #[doc = "All origins are allowed."] apply_authorized_upgrade { - code: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + code: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Error for the System pallet"] pub enum Error { #[codec(index = 0)] @@ -48114,16 +49172,12 @@ pub mod api { Unauthorized, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Event for the System pallet."] pub enum Event { #[codec(index = 0)] @@ -48143,40 +49197,40 @@ pub mod api { #[codec(index = 3)] #[doc = "A new account was created."] NewAccount { - account: ::subxt::ext::subxt_core::utils::AccountId32, + account: ::subxt::utils::AccountId32, }, #[codec(index = 4)] #[doc = "An account was reaped."] KilledAccount { - account: ::subxt::ext::subxt_core::utils::AccountId32, + account: ::subxt::utils::AccountId32, }, #[codec(index = 5)] #[doc = "On on-chain remark happened."] Remarked { - sender: ::subxt::ext::subxt_core::utils::AccountId32, - hash: ::subxt::ext::subxt_core::utils::H256, + sender: ::subxt::utils::AccountId32, + hash: ::subxt::utils::H256, }, #[codec(index = 6)] #[doc = "An upgrade was authorized."] UpgradeAuthorized { - code_hash: ::subxt::ext::subxt_core::utils::H256, + code_hash: ::subxt::utils::H256, check_version: ::core::primitive::bool, }, #[codec(index = 7)] #[doc = "An invalid authorized upgrade was rejected while trying to apply it."] RejectedInvalidAuthorizedUpgrade { - code_hash: ::subxt::ext::subxt_core::utils::H256, + code_hash: ::subxt::utils::H256, error: runtime_types::sp_runtime::DispatchError, }, } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AccountInfo<_0, _1> { pub nonce: _0, pub consumers: ::core::primitive::u32, @@ -48185,59 +49239,59 @@ pub mod api { pub data: _1, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CodeUpgradeAuthorization { - pub code_hash: ::subxt::ext::subxt_core::utils::H256, + pub code_hash: ::subxt::utils::H256, pub check_version: ::core::primitive::bool, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct DispatchEventInfo { pub weight: runtime_types::sp_weights::weight_v2::Weight, pub class: runtime_types::frame_support::dispatch::DispatchClass, pub pays_fee: runtime_types::frame_support::dispatch::Pays, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct EventRecord<_0, _1> { pub phase: runtime_types::frame_system::Phase, pub event: _0, - pub topics: ::subxt::ext::subxt_core::alloc::vec::Vec<_1>, + pub topics: ::subxt::alloc::vec::Vec<_1>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct LastRuntimeUpgradeInfo { #[codec(compact)] pub spec_version: ::core::primitive::u32, - pub spec_name: ::subxt::ext::subxt_core::alloc::string::String, + pub spec_name: ::subxt::alloc::string::String, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Phase { #[codec(index = 0)] ApplyExtrinsic(::core::primitive::u32), @@ -48252,16 +49306,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -48270,7 +49320,7 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- O(1)"] create { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box< + asset_kind: ::subxt::alloc::boxed::Box< runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset, >, rate: runtime_types::sp_arithmetic::fixed_point::FixedU128, @@ -48281,7 +49331,7 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- O(1)"] update { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box< + asset_kind: ::subxt::alloc::boxed::Box< runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset, >, rate: runtime_types::sp_arithmetic::fixed_point::FixedU128, @@ -48292,22 +49342,18 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- O(1)"] remove { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box< + asset_kind: ::subxt::alloc::boxed::Box< runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset, >, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -48321,16 +49367,12 @@ pub mod api { Overflow, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -48359,16 +49401,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -48377,7 +49415,7 @@ pub mod api { #[doc = "against the extracted offender. If both are valid, the offence will"] #[doc = "be reported."] report_equivocation { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + equivocation_proof: ::subxt::alloc::boxed::Box< runtime_types::sp_consensus_slots::EquivocationProof< runtime_types::sp_runtime::generic::header::Header< ::core::primitive::u32, @@ -48397,7 +49435,7 @@ pub mod api { #[doc = "if the block author is defined it will be defined as the equivocation"] #[doc = "reporter."] report_equivocation_unsigned { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + equivocation_proof: ::subxt::alloc::boxed::Box< runtime_types::sp_consensus_slots::EquivocationProof< runtime_types::sp_runtime::generic::header::Header< ::core::primitive::u32, @@ -48417,16 +49455,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -48449,16 +49483,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -48470,10 +49500,7 @@ pub mod api { #[doc = ""] #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] transfer_allow_death { - dest: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + dest: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, #[codec(compact)] value: ::core::primitive::u128, }, @@ -48481,14 +49508,8 @@ pub mod api { #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] #[doc = "may be specified."] force_transfer { - source: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - dest: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + source: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + dest: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, #[codec(compact)] value: ::core::primitive::u128, }, @@ -48500,10 +49521,7 @@ pub mod api { #[doc = ""] #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] transfer_keep_alive { - dest: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + dest: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, #[codec(compact)] value: ::core::primitive::u128, }, @@ -48524,10 +49542,7 @@ pub mod api { #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] #[doc = " keep the sender account alive (true)."] transfer_all { - dest: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + dest: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, keep_alive: ::core::primitive::bool, }, #[codec(index = 5)] @@ -48535,10 +49550,7 @@ pub mod api { #[doc = ""] #[doc = "Can only be called by ROOT."] force_unreserve { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, amount: ::core::primitive::u128, }, #[codec(index = 6)] @@ -48551,19 +49563,14 @@ pub mod api { #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] #[doc = "possibility of churn)."] upgrade_accounts { - who: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, + who: ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, }, #[codec(index = 8)] #[doc = "Set the regular balance of a given account."] #[doc = ""] #[doc = "The dispatch origin for this call is `root`."] force_set_balance { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, #[codec(compact)] new_free: ::core::primitive::u128, }, @@ -48593,16 +49600,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -48643,62 +49646,58 @@ pub mod api { DeltaZero, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "An account was created with some free balance."] Endowed { - account: ::subxt::ext::subxt_core::utils::AccountId32, + account: ::subxt::utils::AccountId32, free_balance: ::core::primitive::u128, }, #[codec(index = 1)] #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] #[doc = "resulting in an outright loss."] DustLost { - account: ::subxt::ext::subxt_core::utils::AccountId32, + account: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 2)] #[doc = "Transfer succeeded."] Transfer { - from: ::subxt::ext::subxt_core::utils::AccountId32, - to: ::subxt::ext::subxt_core::utils::AccountId32, + from: ::subxt::utils::AccountId32, + to: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 3)] #[doc = "A balance was set by root."] BalanceSet { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, free: ::core::primitive::u128, }, #[codec(index = 4)] #[doc = "Some balance was reserved (moved from free to reserved)."] Reserved { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 5)] #[doc = "Some balance was unreserved (moved from reserved to free)."] Unreserved { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 6)] #[doc = "Some balance was moved from the reserve of the first account to the second account."] #[doc = "Final argument indicates the destination balance type."] ReserveRepatriated { - from: ::subxt::ext::subxt_core::utils::AccountId32, - to: ::subxt::ext::subxt_core::utils::AccountId32, + from: ::subxt::utils::AccountId32, + to: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, destination_status: runtime_types::frame_support::traits::tokens::misc::BalanceStatus, @@ -48706,25 +49705,25 @@ pub mod api { #[codec(index = 7)] #[doc = "Some amount was deposited (e.g. for transaction fees)."] Deposit { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 8)] #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] Withdraw { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 9)] #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] Slashed { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 10)] #[doc = "Some amount was minted into an account."] Minted { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 11)] @@ -48733,7 +49732,7 @@ pub mod api { #[codec(index = 12)] #[doc = "Some amount was burned from an account."] Burned { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 13)] @@ -48742,20 +49741,18 @@ pub mod api { #[codec(index = 14)] #[doc = "Some amount was suspended from an account (it can be restored later)."] Suspended { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 15)] #[doc = "Some amount was restored into an account."] Restored { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 16)] #[doc = "An account was upgraded."] - Upgraded { - who: ::subxt::ext::subxt_core::utils::AccountId32, - }, + Upgraded { who: ::subxt::utils::AccountId32 }, #[codec(index = 17)] #[doc = "Total issuance was increased by `amount`, creating a credit to be balanced."] Issued { amount: ::core::primitive::u128 }, @@ -48765,25 +49762,25 @@ pub mod api { #[codec(index = 19)] #[doc = "Some balance was locked."] Locked { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 20)] #[doc = "Some balance was unlocked."] Unlocked { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 21)] #[doc = "Some balance was frozen."] Frozen { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 22)] #[doc = "Some balance was thawed."] Thawed { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 23)] @@ -48796,37 +49793,37 @@ pub mod api { #[doc = "Some balance was placed on hold."] Held { reason: runtime_types::rococo_runtime::RuntimeHoldReason, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 25)] #[doc = "Held balance was burned from an account."] BurnedHeld { reason: runtime_types::rococo_runtime::RuntimeHoldReason, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 26)] #[doc = "A transfer of `amount` on hold from `source` to `dest` was initiated."] TransferOnHold { reason: runtime_types::rococo_runtime::RuntimeHoldReason, - source: ::subxt::ext::subxt_core::utils::AccountId32, - dest: ::subxt::ext::subxt_core::utils::AccountId32, + source: ::subxt::utils::AccountId32, + dest: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 27)] #[doc = "The `transferred` balance is placed on hold at the `dest` account."] TransferAndHold { reason: runtime_types::rococo_runtime::RuntimeHoldReason, - source: ::subxt::ext::subxt_core::utils::AccountId32, - dest: ::subxt::ext::subxt_core::utils::AccountId32, + source: ::subxt::utils::AccountId32, + dest: ::subxt::utils::AccountId32, transferred: ::core::primitive::u128, }, #[codec(index = 28)] #[doc = "Some balance was released from hold."] Released { reason: runtime_types::rococo_runtime::RuntimeHoldReason, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 29)] @@ -48834,16 +49831,12 @@ pub mod api { Unexpected(runtime_types::pallet_balances::pallet::UnexpectedKind), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum UnexpectedKind { #[codec(index = 0)] BalanceUpdated, @@ -48854,16 +49847,12 @@ pub mod api { pub mod types { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AccountData<_0> { pub free: _0, pub reserved: _0, @@ -48871,16 +49860,12 @@ pub mod api { pub flags: runtime_types::pallet_balances::types::ExtraFlags, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AdjustmentDirection { #[codec(index = 0)] Increase, @@ -48888,44 +49873,32 @@ pub mod api { Decrease, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BalanceLock<_0> { pub id: [::core::primitive::u8; 8usize], pub amount: _0, pub reasons: runtime_types::pallet_balances::types::Reasons, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ExtraFlags(pub ::core::primitive::u128); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Reasons { #[codec(index = 0)] Fee, @@ -48935,16 +49908,12 @@ pub mod api { All, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ReserveData<_0, _1> { pub id: _0, pub amount: _1, @@ -48956,16 +49925,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -48974,7 +49939,7 @@ pub mod api { #[doc = "against the extracted offender. If both are valid, the offence"] #[doc = "will be reported."] report_double_voting { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + equivocation_proof: ::subxt::alloc::boxed::Box< runtime_types::sp_consensus_beefy::DoubleVotingProof< ::core::primitive::u32, runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, @@ -48994,7 +49959,7 @@ pub mod api { #[doc = "if the block author is defined it will be defined as the equivocation"] #[doc = "reporter."] report_double_voting_unsigned { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + equivocation_proof: ::subxt::alloc::boxed::Box< runtime_types::sp_consensus_beefy::DoubleVotingProof< ::core::primitive::u32, runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, @@ -49016,14 +49981,14 @@ pub mod api { #[doc = "and validate the given key ownership proof against the extracted offender."] #[doc = "If both are valid, the offence will be reported."] report_fork_voting { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + equivocation_proof: ::subxt::alloc::boxed::Box< runtime_types::sp_consensus_beefy::ForkVotingProof< runtime_types::sp_runtime::generic::header::Header< ::core::primitive::u32, >, runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, runtime_types::sp_mmr_primitives::AncestryProof< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >, >, >, @@ -49039,14 +50004,14 @@ pub mod api { #[doc = "if the block author is defined it will be defined as the equivocation"] #[doc = "reporter."] report_fork_voting_unsigned { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + equivocation_proof: ::subxt::alloc::boxed::Box< runtime_types::sp_consensus_beefy::ForkVotingProof< runtime_types::sp_runtime::generic::header::Header< ::core::primitive::u32, >, runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, runtime_types::sp_mmr_primitives::AncestryProof< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >, >, >, @@ -49057,7 +50022,7 @@ pub mod api { #[doc = "and validate the given key ownership proof against the extracted offender."] #[doc = "If both are valid, the offence will be reported."] report_future_block_voting { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + equivocation_proof: ::subxt::alloc::boxed::Box< runtime_types::sp_consensus_beefy::FutureBlockVotingProof< ::core::primitive::u32, runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, @@ -49075,7 +50040,7 @@ pub mod api { #[doc = "if the block author is defined it will be defined as the equivocation"] #[doc = "reporter."] report_future_block_voting_unsigned { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + equivocation_proof: ::subxt::alloc::boxed::Box< runtime_types::sp_consensus_beefy::FutureBlockVotingProof< ::core::primitive::u32, runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, @@ -49085,16 +50050,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -49129,16 +50090,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -49157,8 +50114,7 @@ pub mod api { propose_bounty { #[codec(compact)] value: ::core::primitive::u128, - description: - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + description: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 1)] #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] @@ -49182,10 +50138,7 @@ pub mod api { propose_curator { #[codec(compact)] bounty_id: ::core::primitive::u32, - curator: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + curator: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, #[codec(compact)] fee: ::core::primitive::u128, }, @@ -49237,10 +50190,7 @@ pub mod api { award_bounty { #[codec(compact)] bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + beneficiary: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 6)] #[doc = "Claim the payout from an awarded bounty after payout delay."] @@ -49282,7 +50232,7 @@ pub mod api { extend_bounty_expiry { #[codec(compact)] bounty_id: ::core::primitive::u32, - remark: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + remark: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 9)] #[doc = "Approve bountry and propose a curator simultaneously."] @@ -49299,10 +50249,7 @@ pub mod api { approve_bounty_with_curator { #[codec(compact)] bounty_id: ::core::primitive::u32, - curator: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + curator: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, #[codec(compact)] fee: ::core::primitive::u128, }, @@ -49328,16 +50275,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -49379,16 +50322,12 @@ pub mod api { NotProposer, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -49407,14 +50346,14 @@ pub mod api { #[doc = "A bounty is awarded to a beneficiary."] BountyAwarded { index: ::core::primitive::u32, - beneficiary: ::subxt::ext::subxt_core::utils::AccountId32, + beneficiary: ::subxt::utils::AccountId32, }, #[codec(index = 4)] #[doc = "A bounty is claimed by beneficiary."] BountyClaimed { index: ::core::primitive::u32, payout: ::core::primitive::u128, - beneficiary: ::subxt::ext::subxt_core::utils::AccountId32, + beneficiary: ::subxt::utils::AccountId32, }, #[codec(index = 5)] #[doc = "A bounty is cancelled."] @@ -49429,7 +50368,7 @@ pub mod api { #[doc = "A bounty curator is proposed."] CuratorProposed { bounty_id: ::core::primitive::u32, - curator: ::subxt::ext::subxt_core::utils::AccountId32, + curator: ::subxt::utils::AccountId32, }, #[codec(index = 9)] #[doc = "A bounty curator is unassigned."] @@ -49438,25 +50377,25 @@ pub mod api { #[doc = "A bounty curator is accepted."] CuratorAccepted { bounty_id: ::core::primitive::u32, - curator: ::subxt::ext::subxt_core::utils::AccountId32, + curator: ::subxt::utils::AccountId32, }, #[codec(index = 11)] #[doc = "A bounty deposit has been poked."] DepositPoked { bounty_id: ::core::primitive::u32, - proposer: ::subxt::ext::subxt_core::utils::AccountId32, + proposer: ::subxt::utils::AccountId32, old_deposit: ::core::primitive::u128, new_deposit: ::core::primitive::u128, }, } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Bounty<_0, _1, _2> { pub proposer: _0, pub value: _1, @@ -49466,12 +50405,12 @@ pub mod api { pub status: runtime_types::pallet_bounties::BountyStatus<_0, _2>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum BountyStatus<_0, _1> { #[codec(index = 0)] Proposed, @@ -49498,16 +50437,12 @@ pub mod api { pub mod coretime_interface { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum CoreAssignment { #[codec(index = 0)] Idle, @@ -49523,16 +50458,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -49560,8 +50491,7 @@ pub mod api { parent_bounty_id: ::core::primitive::u32, #[codec(compact)] value: ::core::primitive::u128, - description: - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + description: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 1)] #[doc = "Propose curator for funded child-bounty."] @@ -49584,10 +50514,7 @@ pub mod api { parent_bounty_id: ::core::primitive::u32, #[codec(compact)] child_bounty_id: ::core::primitive::u32, - curator: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + curator: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, #[codec(compact)] fee: ::core::primitive::u128, }, @@ -49681,10 +50608,7 @@ pub mod api { parent_bounty_id: ::core::primitive::u32, #[codec(compact)] child_bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + beneficiary: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 5)] #[doc = "Claim the payout from an awarded child-bounty after payout delay."] @@ -49740,16 +50664,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -49763,16 +50683,12 @@ pub mod api { TooManyChildBounties, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -49786,7 +50702,7 @@ pub mod api { Awarded { index: ::core::primitive::u32, child_index: ::core::primitive::u32, - beneficiary: ::subxt::ext::subxt_core::utils::AccountId32, + beneficiary: ::subxt::utils::AccountId32, }, #[codec(index = 2)] #[doc = "A child-bounty is claimed by beneficiary."] @@ -49794,7 +50710,7 @@ pub mod api { index: ::core::primitive::u32, child_index: ::core::primitive::u32, payout: ::core::primitive::u128, - beneficiary: ::subxt::ext::subxt_core::utils::AccountId32, + beneficiary: ::subxt::utils::AccountId32, }, #[codec(index = 3)] #[doc = "A child-bounty is cancelled."] @@ -49805,12 +50721,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ChildBounty<_0, _1, _2> { pub parent_bounty: ::core::primitive::u32, pub value: _1, @@ -49819,12 +50735,12 @@ pub mod api { pub status: runtime_types::pallet_child_bounties::ChildBountyStatus<_0, _2>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ChildBountyStatus<_0, _1> { #[codec(index = 0)] Added, @@ -49845,16 +50761,12 @@ pub mod api { pub mod conviction { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Conviction { #[codec(index = 0)] None, @@ -49875,16 +50787,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -49930,10 +50838,7 @@ pub mod api { #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] delegate { class: ::core::primitive::u16, - to: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + to: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, conviction: runtime_types::pallet_conviction_voting::conviction::Conviction, balance: ::core::primitive::u128, }, @@ -49965,10 +50870,7 @@ pub mod api { #[doc = "Weight: `O(R)` with R number of vote of target."] unlock { class: ::core::primitive::u16, - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + target: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 4)] #[doc = "Remove a vote for a poll."] @@ -50022,25 +50924,18 @@ pub mod api { #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] #[doc = " Weight is calculated for the maximum number of vote."] remove_other_vote { - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + target: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, class: ::core::primitive::u16, index: ::core::primitive::u32, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -50082,35 +50977,28 @@ pub mod api { BadClass, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "An account has delegated their vote to another account. \\[who, target\\]"] Delegated( - ::subxt::ext::subxt_core::utils::AccountId32, - ::subxt::ext::subxt_core::utils::AccountId32, + ::subxt::utils::AccountId32, + ::subxt::utils::AccountId32, ::core::primitive::u16, ), #[codec(index = 1)] #[doc = "An \\[account\\] has cancelled a previous delegation operation."] - Undelegated( - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u16, - ), + Undelegated(::subxt::utils::AccountId32, ::core::primitive::u16), #[codec(index = 2)] #[doc = "An account has voted"] Voted { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, vote: runtime_types::pallet_conviction_voting::vote::AccountVote< ::core::primitive::u128, >, @@ -50119,7 +51007,7 @@ pub mod api { #[codec(index = 3)] #[doc = "A vote has been removed"] VoteRemoved { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, vote: runtime_types::pallet_conviction_voting::vote::AccountVote< ::core::primitive::u128, >, @@ -50128,7 +51016,7 @@ pub mod api { #[codec(index = 4)] #[doc = "The lockup period of a conviction vote expired, and the funds have been unlocked."] VoteUnlocked { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, class: ::core::primitive::u16, }, } @@ -50136,31 +51024,23 @@ pub mod api { pub mod types { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Delegations<_0> { pub votes: _0, pub capital: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Tally<_0> { pub ayes: _0, pub nays: _0, @@ -50170,16 +51050,12 @@ pub mod api { pub mod vote { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AccountVote<_0> { #[codec(index = 0)] Standard { @@ -50192,16 +51068,12 @@ pub mod api { SplitAbstain { aye: _0, nay: _0, abstain: _0 }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Casting<_0, _1, _2> { pub votes: runtime_types::bounded_collections::bounded_vec::BoundedVec<( _1, @@ -50214,16 +51086,12 @@ pub mod api { pub __ignore: ::core::marker::PhantomData<_2>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Delegating<_0, _1, _2> { pub balance: _0, pub target: _1, @@ -50233,40 +51101,28 @@ pub mod api { pub prior: runtime_types::pallet_conviction_voting::vote::PriorLock<_2, _0>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PriorLock<_0, _1>(pub _0, pub _1); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Vote(pub ::core::primitive::u8); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Voting<_0, _1, _2, _3> { #[codec(index = 0)] Casting(runtime_types::pallet_conviction_voting::vote::Casting<_0, _2, _2>), @@ -50283,16 +51139,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -50301,9 +51153,9 @@ pub mod api { #[doc = "against the extracted offender. If both are valid, the offence"] #[doc = "will be reported."] report_equivocation { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + equivocation_proof: ::subxt::alloc::boxed::Box< runtime_types::sp_consensus_grandpa::EquivocationProof< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, ::core::primitive::u32, >, >, @@ -50320,9 +51172,9 @@ pub mod api { #[doc = "if the block author is defined it will be defined as the equivocation"] #[doc = "reporter."] report_equivocation_unsigned { - equivocation_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + equivocation_proof: ::subxt::alloc::boxed::Box< runtime_types::sp_consensus_grandpa::EquivocationProof< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, ::core::primitive::u32, >, >, @@ -50347,16 +51199,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -50384,22 +51232,18 @@ pub mod api { DuplicateOffenceReport, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "New authority set has been applied."] NewAuthorities { - authority_set: ::subxt::ext::subxt_core::alloc::vec::Vec<( + authority_set: ::subxt::alloc::vec::Vec<( runtime_types::sp_consensus_grandpa::app::Public, ::core::primitive::u64, )>, @@ -50413,12 +51257,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct StoredPendingChange<_0> { pub scheduled_at: _0, pub delay: _0, @@ -50430,12 +51274,12 @@ pub mod api { pub forced: ::core::option::Option<_0>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum StoredState<_0> { #[codec(index = 0)] Live, @@ -50452,16 +51296,12 @@ pub mod api { pub mod legacy { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct IdentityInfo { pub additional: runtime_types::bounded_collections::bounded_vec::BoundedVec<( runtime_types::pallet_identity::types::Data, @@ -50480,16 +51320,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Identity pallet declaration."] pub enum Call { #[codec(index = 0)] @@ -50501,10 +51337,7 @@ pub mod api { #[doc = ""] #[doc = "Emits `RegistrarAdded` if successful."] add_registrar { - account: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + account: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 1)] #[doc = "Set an account's identity information and reserve the appropriate deposit."] @@ -50518,7 +51351,7 @@ pub mod api { #[doc = ""] #[doc = "Emits `IdentitySet` if successful."] set_identity { - info: ::subxt::ext::subxt_core::alloc::boxed::Box< + info: ::subxt::alloc::boxed::Box< runtime_types::pallet_identity::legacy::IdentityInfo, >, }, @@ -50533,8 +51366,8 @@ pub mod api { #[doc = ""] #[doc = "- `subs`: The identity's (new) sub-accounts."] set_subs { - subs: ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::subxt::ext::subxt_core::utils::AccountId32, + subs: ::subxt::alloc::vec::Vec<( + ::subxt::utils::AccountId32, runtime_types::pallet_identity::types::Data, )>, }, @@ -50608,10 +51441,7 @@ pub mod api { set_account_id { #[codec(compact)] index: ::core::primitive::u32, - new: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + new: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 8)] #[doc = "Set the field information for a registrar."] @@ -50645,14 +51475,11 @@ pub mod api { provide_judgement { #[codec(compact)] reg_index: ::core::primitive::u32, - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + target: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, judgement: runtime_types::pallet_identity::types::Judgement< ::core::primitive::u128, >, - identity: ::subxt::ext::subxt_core::utils::H256, + identity: ::subxt::utils::H256, }, #[codec(index = 10)] #[doc = "Remove an account's identity and sub-account information and slash the deposits."] @@ -50668,10 +51495,7 @@ pub mod api { #[doc = ""] #[doc = "Emits `IdentityKilled` if successful."] kill_identity { - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + target: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 11)] #[doc = "Add the given account to the sender's subs."] @@ -50682,10 +51506,7 @@ pub mod api { #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] #[doc = "sub identity of `sub`."] add_sub { - sub: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + sub: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, data: runtime_types::pallet_identity::types::Data, }, #[codec(index = 12)] @@ -50694,10 +51515,7 @@ pub mod api { #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] #[doc = "sub identity of `sub`."] rename_sub { - sub: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + sub: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, data: runtime_types::pallet_identity::types::Data, }, #[codec(index = 13)] @@ -50709,10 +51527,7 @@ pub mod api { #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] #[doc = "sub identity of `sub`."] remove_sub { - sub: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + sub: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 14)] #[doc = "Remove the sender as a sub-account."] @@ -50733,21 +51548,15 @@ pub mod api { #[doc = "change the account used to grant usernames, this call can be used with the updated"] #[doc = "parameters to overwrite the existing configuration."] add_username_authority { - authority: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - suffix: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + authority: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + suffix: ::subxt::alloc::vec::Vec<::core::primitive::u8>, allocation: ::core::primitive::u32, }, #[codec(index = 16)] #[doc = "Remove `authority` from the username authorities."] remove_username_authority { - suffix: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - authority: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + suffix: ::subxt::alloc::vec::Vec<::core::primitive::u8>, + authority: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 17)] #[doc = "Set the username for `who`. Must be called by a username authority."] @@ -50764,11 +51573,8 @@ pub mod api { #[doc = " - When combined with the suffix of the issuing authority be _less than_ the"] #[doc = " `MaxUsernameLength`."] set_username_for { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - username: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + username: ::subxt::alloc::vec::Vec<::core::primitive::u8>, signature: ::core::option::Option, use_allocation: ::core::primitive::bool, @@ -50824,16 +51630,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -50929,51 +51731,45 @@ pub mod api { InsufficientPrivileges, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "A name was set or reset (which will remove all judgements)."] - IdentitySet { - who: ::subxt::ext::subxt_core::utils::AccountId32, - }, + IdentitySet { who: ::subxt::utils::AccountId32 }, #[codec(index = 1)] #[doc = "A name was cleared, and the given balance returned."] IdentityCleared { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, deposit: ::core::primitive::u128, }, #[codec(index = 2)] #[doc = "A name was removed and the given balance slashed."] IdentityKilled { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, deposit: ::core::primitive::u128, }, #[codec(index = 3)] #[doc = "A judgement was asked from a registrar."] JudgementRequested { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, registrar_index: ::core::primitive::u32, }, #[codec(index = 4)] #[doc = "A judgement request was retracted."] JudgementUnrequested { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, registrar_index: ::core::primitive::u32, }, #[codec(index = 5)] #[doc = "A judgement was given by a registrar."] JudgementGiven { - target: ::subxt::ext::subxt_core::utils::AccountId32, + target: ::subxt::utils::AccountId32, registrar_index: ::core::primitive::u32, }, #[codec(index = 6)] @@ -50984,52 +51780,52 @@ pub mod api { #[codec(index = 7)] #[doc = "A sub-identity was added to an identity and the deposit paid."] SubIdentityAdded { - sub: ::subxt::ext::subxt_core::utils::AccountId32, - main: ::subxt::ext::subxt_core::utils::AccountId32, + sub: ::subxt::utils::AccountId32, + main: ::subxt::utils::AccountId32, deposit: ::core::primitive::u128, }, #[codec(index = 8)] #[doc = "An account's sub-identities were set (in bulk)."] SubIdentitiesSet { - main: ::subxt::ext::subxt_core::utils::AccountId32, + main: ::subxt::utils::AccountId32, number_of_subs: ::core::primitive::u32, new_deposit: ::core::primitive::u128, }, #[codec(index = 9)] #[doc = "A given sub-account's associated name was changed by its super-identity."] SubIdentityRenamed { - sub: ::subxt::ext::subxt_core::utils::AccountId32, - main: ::subxt::ext::subxt_core::utils::AccountId32, + sub: ::subxt::utils::AccountId32, + main: ::subxt::utils::AccountId32, }, #[codec(index = 10)] #[doc = "A sub-identity was removed from an identity and the deposit freed."] SubIdentityRemoved { - sub: ::subxt::ext::subxt_core::utils::AccountId32, - main: ::subxt::ext::subxt_core::utils::AccountId32, + sub: ::subxt::utils::AccountId32, + main: ::subxt::utils::AccountId32, deposit: ::core::primitive::u128, }, #[codec(index = 11)] #[doc = "A sub-identity was cleared, and the given deposit repatriated from the"] #[doc = "main identity account to the sub-identity account."] SubIdentityRevoked { - sub: ::subxt::ext::subxt_core::utils::AccountId32, - main: ::subxt::ext::subxt_core::utils::AccountId32, + sub: ::subxt::utils::AccountId32, + main: ::subxt::utils::AccountId32, deposit: ::core::primitive::u128, }, #[codec(index = 12)] #[doc = "A username authority was added."] AuthorityAdded { - authority: ::subxt::ext::subxt_core::utils::AccountId32, + authority: ::subxt::utils::AccountId32, }, #[codec(index = 13)] #[doc = "A username authority was removed."] AuthorityRemoved { - authority: ::subxt::ext::subxt_core::utils::AccountId32, + authority: ::subxt::utils::AccountId32, }, #[codec(index = 14)] #[doc = "A username was set for `who`."] UsernameSet { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, username: runtime_types::bounded_collections::bounded_vec::BoundedVec< ::core::primitive::u8, >, @@ -51037,7 +51833,7 @@ pub mod api { #[codec(index = 15)] #[doc = "A username was queued, but `who` must accept it prior to `expiration`."] UsernameQueued { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, username: runtime_types::bounded_collections::bounded_vec::BoundedVec< ::core::primitive::u8, >, @@ -51045,13 +51841,11 @@ pub mod api { }, #[codec(index = 16)] #[doc = "A queued username passed its expiration without being claimed and was removed."] - PreapprovalExpired { - whose: ::subxt::ext::subxt_core::utils::AccountId32, - }, + PreapprovalExpired { whose: ::subxt::utils::AccountId32 }, #[codec(index = 17)] #[doc = "A username was set as a primary and can be looked up from `who`."] PrimaryUsernameSet { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, username: runtime_types::bounded_collections::bounded_vec::BoundedVec< ::core::primitive::u8, >, @@ -51060,7 +51854,7 @@ pub mod api { #[doc = "A dangling username (as in, a username corresponding to an account that has removed its"] #[doc = "identity) has been removed."] DanglingUsernameRemoved { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, username: runtime_types::bounded_collections::bounded_vec::BoundedVec< ::core::primitive::u8, >, @@ -51091,31 +51885,23 @@ pub mod api { pub mod types { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AuthorityProperties<_0> { pub account_id: _0, pub allocation: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Data { #[codec(index = 0)] None, @@ -51195,16 +51981,12 @@ pub mod api { ShaThree256([::core::primitive::u8; 32usize]), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Judgement<_0> { #[codec(index = 0)] Unknown, @@ -51222,16 +52004,12 @@ pub mod api { Erroneous, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Provider<_0> { #[codec(index = 0)] Allocation, @@ -51241,32 +52019,24 @@ pub mod api { System, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct RegistrarInfo<_0, _1, _2> { pub account: _1, pub fee: _0, pub fields: _2, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Registration<_0, _2> { pub judgements: runtime_types::bounded_collections::bounded_vec::BoundedVec<( ::core::primitive::u32, @@ -51276,16 +52046,12 @@ pub mod api { pub info: _2, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct UsernameInformation<_0, _1> { pub owner: _0, pub provider: runtime_types::pallet_identity::types::Provider<_1>, @@ -51297,16 +52063,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -51337,10 +52099,7 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- `O(1)`."] transfer { - new: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + new: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, index: ::core::primitive::u32, }, #[codec(index = 2)] @@ -51372,10 +52131,7 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- `O(1)`."] force_transfer { - new: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + new: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, index: ::core::primitive::u32, freeze: ::core::primitive::bool, }, @@ -51407,16 +52163,12 @@ pub mod api { poke_deposit { index: ::core::primitive::u32 }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -51436,22 +52188,18 @@ pub mod api { Permanent, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "A account index was assigned."] IndexAssigned { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, index: ::core::primitive::u32, }, #[codec(index = 1)] @@ -51461,12 +52209,12 @@ pub mod api { #[doc = "A account index has been frozen to its current account ID."] IndexFrozen { index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, }, #[codec(index = 3)] #[doc = "A deposit to reserve an index has been poked/reconsidered."] DepositPoked { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, index: ::core::primitive::u32, old_deposit: ::core::primitive::u128, new_deposit: ::core::primitive::u128, @@ -51479,30 +52227,22 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { # [codec (index = 0)] # [doc = "Remove a page which has no more messages remaining to be processed or is stale."] reap_page { message_origin : runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin , page_index : :: core :: primitive :: u32 , } , # [codec (index = 1)] # [doc = "Execute an overweight message."] # [doc = ""] # [doc = "Temporary processing errors will be propagated whereas permanent errors are treated"] # [doc = "as success condition."] # [doc = ""] # [doc = "- `origin`: Must be `Signed`."] # [doc = "- `message_origin`: The origin from which the message to be executed arrived."] # [doc = "- `page`: The page in the queue in which the message to be executed is sitting."] # [doc = "- `index`: The index into the queue of the message to be executed."] # [doc = "- `weight_limit`: The maximum amount of weight allowed to be consumed in the execution"] # [doc = " of the message."] # [doc = ""] # [doc = "Benchmark complexity considerations: O(index + weight_limit)."] execute_overweight { message_origin : runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin , page : :: core :: primitive :: u32 , index : :: core :: primitive :: u32 , weight_limit : runtime_types :: sp_weights :: weight_v2 :: Weight , } , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -51540,27 +52280,23 @@ pub mod api { RecursiveDisallowed, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { - # [codec (index = 0)] # [doc = "Message discarded due to an error in the `MessageProcessor` (usually a format error)."] ProcessingFailed { id : :: subxt :: ext :: subxt_core :: utils :: H256 , origin : runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin , error : runtime_types :: frame_support :: traits :: messages :: ProcessMessageError , } , # [codec (index = 1)] # [doc = "Message is processed."] Processed { id : :: subxt :: ext :: subxt_core :: utils :: H256 , origin : runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin , weight_used : runtime_types :: sp_weights :: weight_v2 :: Weight , success : :: core :: primitive :: bool , } , # [codec (index = 2)] # [doc = "Message placed in overweight queue."] OverweightEnqueued { id : [:: core :: primitive :: u8 ; 32usize] , origin : runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin , page_index : :: core :: primitive :: u32 , message_index : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "This page was reaped."] PageReaped { origin : runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin , index : :: core :: primitive :: u32 , } , } + # [codec (index = 0)] # [doc = "Message discarded due to an error in the `MessageProcessor` (usually a format error)."] ProcessingFailed { id : :: subxt :: utils :: H256 , origin : runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin , error : runtime_types :: frame_support :: traits :: messages :: ProcessMessageError , } , # [codec (index = 1)] # [doc = "Message is processed."] Processed { id : :: subxt :: utils :: H256 , origin : runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin , weight_used : runtime_types :: sp_weights :: weight_v2 :: Weight , success : :: core :: primitive :: bool , } , # [codec (index = 2)] # [doc = "Message placed in overweight queue."] OverweightEnqueued { id : [:: core :: primitive :: u8 ; 32usize] , origin : runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin , page_index : :: core :: primitive :: u32 , message_index : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "This page was reaped."] PageReaped { origin : runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin , index : :: core :: primitive :: u32 , } , } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BookState<_0> { pub begin: ::core::primitive::u32, pub end: ::core::primitive::u32, @@ -51571,23 +52307,23 @@ pub mod api { pub size: ::core::primitive::u64, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Neighbours<_0> { pub prev: _0, pub next: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Page<_0> { pub remaining: _0, pub remaining_size: _0, @@ -51604,16 +52340,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -51669,16 +52401,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -51686,16 +52414,12 @@ pub mod api { Ongoing, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -51739,49 +52463,47 @@ pub mod api { #[codec(index = 7)] #[doc = "The set of historical migrations has been cleared."] HistoricCleared { - next_cursor: ::core::option::Option< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >, + next_cursor: + ::core::option::Option<::subxt::alloc::vec::Vec<::core::primitive::u8>>, }, } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ActiveCursor<_0, _1> { pub index: ::core::primitive::u32, pub inner_cursor: ::core::option::Option<_0>, pub started_at: _1, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum HistoricCleanupSelector<_0> { #[codec(index = 0)] - Specific(::subxt::ext::subxt_core::alloc::vec::Vec<_0>), + Specific(::subxt::alloc::vec::Vec<_0>), #[codec(index = 1)] Wildcard { limit: ::core::option::Option<::core::primitive::u32>, - previous_cursor: ::core::option::Option< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >, + previous_cursor: + ::core::option::Option<::subxt::alloc::vec::Vec<::core::primitive::u8>>, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum MigrationCursor<_0, _1> { #[codec(index = 0)] Active(runtime_types::pallet_migrations::ActiveCursor<_0, _1>), @@ -51794,16 +52516,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -51820,12 +52538,9 @@ pub mod api { #[doc = "## Complexity"] #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] as_multi_threshold_1 { - other_signatories: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + other_signatories: ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 1)] #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] @@ -51869,15 +52584,12 @@ pub mod api { #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] as_multi { threshold: ::core::primitive::u16, - other_signatories: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, + other_signatories: ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, >, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, max_weight: runtime_types::sp_weights::weight_v2::Weight, }, #[codec(index = 2)] @@ -51913,9 +52625,7 @@ pub mod api { #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] approve_as_multi { threshold: ::core::primitive::u16, - other_signatories: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, + other_signatories: ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, >, @@ -51946,9 +52656,7 @@ pub mod api { #[doc = "- Storage: removes one item."] cancel_as_multi { threshold: ::core::primitive::u16, - other_signatories: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, + other_signatories: ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, call_hash: [::core::primitive::u8; 32usize], @@ -51969,23 +52677,17 @@ pub mod api { #[doc = "Emits `DepositPoked` if successful."] poke_deposit { threshold: ::core::primitive::u16, - other_signatories: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, + other_signatories: ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, call_hash: [::core::primitive::u8; 32usize], }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -52033,41 +52735,37 @@ pub mod api { AlreadyStored, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "A new multisig operation has begun."] NewMultisig { - approving: ::subxt::ext::subxt_core::utils::AccountId32, - multisig: ::subxt::ext::subxt_core::utils::AccountId32, + approving: ::subxt::utils::AccountId32, + multisig: ::subxt::utils::AccountId32, call_hash: [::core::primitive::u8; 32usize], }, #[codec(index = 1)] #[doc = "A multisig operation has been approved by someone."] MultisigApproval { - approving: ::subxt::ext::subxt_core::utils::AccountId32, + approving: ::subxt::utils::AccountId32, timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - multisig: ::subxt::ext::subxt_core::utils::AccountId32, + multisig: ::subxt::utils::AccountId32, call_hash: [::core::primitive::u8; 32usize], }, #[codec(index = 2)] #[doc = "A multisig operation has been executed."] MultisigExecuted { - approving: ::subxt::ext::subxt_core::utils::AccountId32, + approving: ::subxt::utils::AccountId32, timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - multisig: ::subxt::ext::subxt_core::utils::AccountId32, + multisig: ::subxt::utils::AccountId32, call_hash: [::core::primitive::u8; 32usize], result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, @@ -52075,16 +52773,16 @@ pub mod api { #[codec(index = 3)] #[doc = "A multisig operation has been cancelled."] MultisigCancelled { - cancelling: ::subxt::ext::subxt_core::utils::AccountId32, + cancelling: ::subxt::utils::AccountId32, timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - multisig: ::subxt::ext::subxt_core::utils::AccountId32, + multisig: ::subxt::utils::AccountId32, call_hash: [::core::primitive::u8; 32usize], }, #[codec(index = 4)] #[doc = "The deposit for a multisig operation has been updated/poked."] DepositPoked { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, call_hash: [::core::primitive::u8; 32usize], old_deposit: ::core::primitive::u128, new_deposit: ::core::primitive::u128, @@ -52092,12 +52790,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Multisig<_0, _1, _2> { pub when: runtime_types::pallet_multisig::Timepoint<_0>, pub deposit: _1, @@ -52105,12 +52803,12 @@ pub mod api { pub approvals: runtime_types::bounded_collections::bounded_vec::BoundedVec<_2>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Timepoint<_0> { pub height: _0, pub index: ::core::primitive::u32, @@ -52121,31 +52819,23 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Bid<_0, _1> { pub amount: _0, pub who: _1, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -52224,16 +52914,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -52284,36 +52970,32 @@ pub mod api { AlreadyPrivate, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "A bid was successfully placed."] BidPlaced { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, duration: ::core::primitive::u32, }, #[codec(index = 1)] #[doc = "A bid was successfully removed (before being accepted)."] BidRetracted { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, duration: ::core::primitive::u32, }, #[codec(index = 2)] #[doc = "A bid was dropped from a queue because of another, more substantial, bid was present."] BidDropped { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, duration: ::core::primitive::u32, }, @@ -52322,7 +53004,7 @@ pub mod api { Issued { index: ::core::primitive::u32, expiry: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, proportion: runtime_types::sp_arithmetic::per_things::Perquintill, amount: ::core::primitive::u128, }, @@ -52330,7 +53012,7 @@ pub mod api { #[doc = "An receipt has been (at least partially) thawed."] Thawed { index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, proportion: runtime_types::sp_arithmetic::per_things::Perquintill, amount: ::core::primitive::u128, dropped: ::core::primitive::bool, @@ -52341,53 +53023,41 @@ pub mod api { #[codec(index = 6)] #[doc = "A receipt was transferred."] Transferred { - from: ::subxt::ext::subxt_core::utils::AccountId32, - to: ::subxt::ext::subxt_core::utils::AccountId32, + from: ::subxt::utils::AccountId32, + to: ::subxt::utils::AccountId32, index: ::core::primitive::u32, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum HoldReason { #[codec(index = 0)] NftReceipt, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ReceiptRecord<_0, _1, _2> { pub proportion: runtime_types::sp_arithmetic::per_things::Perquintill, pub owner: ::core::option::Option<(_0, _2)>, pub expiry: _1, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct SummaryRecord<_0, _1> { pub proportion_owed: runtime_types::sp_arithmetic::per_things::Perquintill, pub index: ::core::primitive::u32, @@ -52402,16 +53072,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Events type."] pub enum Event { #[codec(index = 0)] @@ -52420,7 +53086,7 @@ pub mod api { #[doc = "\\[kind, timeslot\\]."] Offence { kind: [::core::primitive::u8; 16usize], - timeslot: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + timeslot: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, } } @@ -52430,16 +53096,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -52452,16 +53114,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -52485,16 +53143,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -52503,7 +53157,7 @@ pub mod api { #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] note_preimage { - bytes: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + bytes: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 1)] #[doc = "Clear an unrequested preimage from the runtime storage."] @@ -52512,45 +53166,33 @@ pub mod api { #[doc = ""] #[doc = "- `hash`: The hash of the preimage to be removed from the store."] #[doc = "- `len`: The length of the preimage of `hash`."] - unnote_preimage { - hash: ::subxt::ext::subxt_core::utils::H256, - }, + unnote_preimage { hash: ::subxt::utils::H256 }, #[codec(index = 2)] #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] #[doc = ""] #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - request_preimage { - hash: ::subxt::ext::subxt_core::utils::H256, - }, + request_preimage { hash: ::subxt::utils::H256 }, #[codec(index = 3)] #[doc = "Clear a previously made request for a preimage."] #[doc = ""] #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - unrequest_preimage { - hash: ::subxt::ext::subxt_core::utils::H256, - }, + unrequest_preimage { hash: ::subxt::utils::H256 }, #[codec(index = 4)] #[doc = "Ensure that the bulk of pre-images is upgraded."] #[doc = ""] #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] ensure_updated { - hashes: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::H256, - >, + hashes: ::subxt::alloc::vec::Vec<::subxt::utils::H256>, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -52579,57 +53221,43 @@ pub mod api { TooFew, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "A preimage has been noted."] - Noted { - hash: ::subxt::ext::subxt_core::utils::H256, - }, + Noted { hash: ::subxt::utils::H256 }, #[codec(index = 1)] #[doc = "A preimage has been requested."] - Requested { - hash: ::subxt::ext::subxt_core::utils::H256, - }, + Requested { hash: ::subxt::utils::H256 }, #[codec(index = 2)] #[doc = "A preimage has ben cleared."] - Cleared { - hash: ::subxt::ext::subxt_core::utils::H256, - }, + Cleared { hash: ::subxt::utils::H256 }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum HoldReason { #[codec(index = 0)] Preimage, } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum OldRequestStatus<_0, _1> { #[codec(index = 0)] Unrequested { @@ -52644,12 +53272,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum RequestStatus<_0, _1> { #[codec(index = 0)] Unrequested { @@ -52669,16 +53297,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -52692,15 +53316,11 @@ pub mod api { #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] #[doc = "- `call`: The call to be made by the `real` account."] proxy { - real: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + real: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, force_proxy_type: ::core::option::Option, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 1)] #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] @@ -52713,10 +53333,7 @@ pub mod api { #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] #[doc = "zero."] add_proxy { - delegate: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + delegate: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, proxy_type: runtime_types::rococo_runtime::ProxyType, delay: ::core::primitive::u32, }, @@ -52729,10 +53346,7 @@ pub mod api { #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] remove_proxy { - delegate: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + delegate: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, proxy_type: runtime_types::rococo_runtime::ProxyType, delay: ::core::primitive::u32, }, @@ -52786,10 +53400,7 @@ pub mod api { #[doc = "Fails with `NoPermission` in case the caller is not a previously created pure"] #[doc = "account whose `create_pure` call has corresponding parameters."] kill_pure { - spawner: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + spawner: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, proxy_type: runtime_types::rococo_runtime::ProxyType, index: ::core::primitive::u16, #[codec(compact)] @@ -52814,11 +53425,8 @@ pub mod api { #[doc = "- `real`: The account that the proxy will make a call on behalf of."] #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] announce { - real: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - call_hash: ::subxt::ext::subxt_core::utils::H256, + real: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + call_hash: ::subxt::utils::H256, }, #[codec(index = 7)] #[doc = "Remove a given announcement."] @@ -52832,11 +53440,8 @@ pub mod api { #[doc = "- `real`: The account that the proxy will make a call on behalf of."] #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] remove_announcement { - real: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - call_hash: ::subxt::ext::subxt_core::utils::H256, + real: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + call_hash: ::subxt::utils::H256, }, #[codec(index = 8)] #[doc = "Remove the given announcement of a delegate."] @@ -52850,11 +53455,8 @@ pub mod api { #[doc = "- `delegate`: The account that previously announced the call."] #[doc = "- `call_hash`: The hash of the call to be made."] reject_announcement { - delegate: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - call_hash: ::subxt::ext::subxt_core::utils::H256, + delegate: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + call_hash: ::subxt::utils::H256, }, #[codec(index = 9)] #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] @@ -52869,19 +53471,12 @@ pub mod api { #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] #[doc = "- `call`: The call to be made by the `real` account."] proxy_announced { - delegate: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - real: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + delegate: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + real: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, force_proxy_type: ::core::option::Option, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 10)] #[doc = "Poke / Adjust deposits made for proxies and announcements based on current values."] @@ -52895,16 +53490,12 @@ pub mod api { poke_deposit, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -52933,16 +53524,12 @@ pub mod api { NoSelfProxy, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -52955,8 +53542,8 @@ pub mod api { #[doc = "A pure account has been created by new proxy with given"] #[doc = "disambiguation index and proxy type."] PureCreated { - pure: ::subxt::ext::subxt_core::utils::AccountId32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + pure: ::subxt::utils::AccountId32, + who: ::subxt::utils::AccountId32, proxy_type: runtime_types::rococo_runtime::ProxyType, disambiguation_index: ::core::primitive::u16, at: ::core::primitive::u32, @@ -52965,38 +53552,38 @@ pub mod api { #[codec(index = 2)] #[doc = "A pure proxy was killed by its spawner."] PureKilled { - pure: ::subxt::ext::subxt_core::utils::AccountId32, - spawner: ::subxt::ext::subxt_core::utils::AccountId32, + pure: ::subxt::utils::AccountId32, + spawner: ::subxt::utils::AccountId32, proxy_type: runtime_types::rococo_runtime::ProxyType, disambiguation_index: ::core::primitive::u16, }, #[codec(index = 3)] #[doc = "An announcement was placed to make a call in the future."] Announced { - real: ::subxt::ext::subxt_core::utils::AccountId32, - proxy: ::subxt::ext::subxt_core::utils::AccountId32, - call_hash: ::subxt::ext::subxt_core::utils::H256, + real: ::subxt::utils::AccountId32, + proxy: ::subxt::utils::AccountId32, + call_hash: ::subxt::utils::H256, }, #[codec(index = 4)] #[doc = "A proxy was added."] ProxyAdded { - delegator: ::subxt::ext::subxt_core::utils::AccountId32, - delegatee: ::subxt::ext::subxt_core::utils::AccountId32, + delegator: ::subxt::utils::AccountId32, + delegatee: ::subxt::utils::AccountId32, proxy_type: runtime_types::rococo_runtime::ProxyType, delay: ::core::primitive::u32, }, #[codec(index = 5)] #[doc = "A proxy was removed."] ProxyRemoved { - delegator: ::subxt::ext::subxt_core::utils::AccountId32, - delegatee: ::subxt::ext::subxt_core::utils::AccountId32, + delegator: ::subxt::utils::AccountId32, + delegatee: ::subxt::utils::AccountId32, proxy_type: runtime_types::rococo_runtime::ProxyType, delay: ::core::primitive::u32, }, #[codec(index = 6)] #[doc = "A deposit stored for proxies or announcements was poked / updated."] DepositPoked { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, kind: runtime_types::pallet_proxy::DepositKind, old_deposit: ::core::primitive::u128, new_deposit: ::core::primitive::u128, @@ -53004,24 +53591,24 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Announcement<_0, _1, _2> { pub real: _0, pub call_hash: _1, pub height: _2, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum DepositKind { #[codec(index = 0)] Proxies, @@ -53029,12 +53616,12 @@ pub mod api { Announcements, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ProxyDefinition<_0, _1, _2> { pub delegate: _0, pub proxy_type: _1, @@ -53046,16 +53633,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -53066,10 +53649,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(1)`"] add_member { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 1)] #[doc = "Increment the rank of an existing member by one."] @@ -53079,10 +53659,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(1)`"] promote_member { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 2)] #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] @@ -53093,10 +53670,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] demote_member { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 3)] #[doc = "Remove the member entirely."] @@ -53107,10 +53681,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(min_rank)`."] remove_member { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, min_rank: ::core::primitive::u16, }, #[codec(index = 4)] @@ -53151,27 +53722,17 @@ pub mod api { #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] exchange_member { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - new_who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + new_who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -53209,40 +53770,34 @@ pub mod api { TooManyMembers, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "A member `who` has been added."] - MemberAdded { - who: ::subxt::ext::subxt_core::utils::AccountId32, - }, + MemberAdded { who: ::subxt::utils::AccountId32 }, #[codec(index = 1)] #[doc = "The member `who`se rank has been changed to the given `rank`."] RankChanged { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, rank: ::core::primitive::u16, }, #[codec(index = 2)] #[doc = "The member `who` of given `rank` has been removed from the collective."] MemberRemoved { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, rank: ::core::primitive::u16, }, #[codec(index = 3)] #[doc = "The member `who` has voted for the `poll` with the given `vote` leading to an updated"] #[doc = "`tally`."] Voted { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, poll: ::core::primitive::u32, vote: runtime_types::pallet_ranked_collective::VoteRecord, tally: runtime_types::pallet_ranked_collective::Tally, @@ -53250,40 +53805,40 @@ pub mod api { #[codec(index = 4)] #[doc = "The member `who` had their `AccountId` changed to `new_who`."] MemberExchanged { - who: ::subxt::ext::subxt_core::utils::AccountId32, - new_who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, + new_who: ::subxt::utils::AccountId32, }, } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct MemberRecord { pub rank: ::core::primitive::u16, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Tally { pub bare_ayes: ::core::primitive::u32, pub ayes: ::core::primitive::u32, pub nays: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum VoteRecord { #[codec(index = 0)] Aye(::core::primitive::u32), @@ -53296,16 +53851,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -53318,13 +53869,9 @@ pub mod api { #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] #[doc = "- `call`: The call you want to make with the recovered account."] as_recovered { - account: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + account: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 1)] #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] @@ -53336,14 +53883,8 @@ pub mod api { #[doc = "- `lost`: The \"lost account\" to be recovered."] #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] set_recovered { - lost: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - rescuer: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + lost: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + rescuer: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 2)] #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] @@ -53363,9 +53904,7 @@ pub mod api { #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] #[doc = " needs to pass before the account can be recovered."] create_recovery { - friends: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, + friends: ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, threshold: ::core::primitive::u16, delay_period: ::core::primitive::u32, }, @@ -53382,10 +53921,7 @@ pub mod api { #[doc = "- `account`: The lost account that you want to recover. This account needs to be"] #[doc = " recoverable (i.e. have a recovery configuration)."] initiate_recovery { - account: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + account: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 4)] #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] @@ -53401,14 +53937,8 @@ pub mod api { #[doc = "The combination of these two parameters must point to an active recovery"] #[doc = "process."] vouch_recovery { - lost: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - rescuer: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + lost: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + rescuer: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 5)] #[doc = "Allow a successful rescuer to claim their recovered account."] @@ -53421,10 +53951,7 @@ pub mod api { #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] #[doc = " you."] claim_recovery { - account: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + account: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 6)] #[doc = "As the controller of a recoverable account, close an active recovery"] @@ -53439,10 +53966,7 @@ pub mod api { #[doc = "Parameters:"] #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] close_recovery { - rescuer: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + rescuer: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 7)] #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] @@ -53466,10 +53990,7 @@ pub mod api { #[doc = "Parameters:"] #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] cancel_recovered { - account: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + account: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 9)] #[doc = "Poke deposits for recovery configurations and / or active recoveries."] @@ -53497,24 +54018,17 @@ pub mod api { #[doc = "Multiple events may be emitted in case both types of deposits are updated."] poke_deposit { maybe_account: ::core::option::Option< - ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, >, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -53567,57 +54081,53 @@ pub mod api { BadState, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Events type."] pub enum Event { #[codec(index = 0)] #[doc = "A recovery process has been set up for an account."] RecoveryCreated { - account: ::subxt::ext::subxt_core::utils::AccountId32, + account: ::subxt::utils::AccountId32, }, #[codec(index = 1)] #[doc = "A recovery process has been initiated for lost account by rescuer account."] RecoveryInitiated { - lost_account: ::subxt::ext::subxt_core::utils::AccountId32, - rescuer_account: ::subxt::ext::subxt_core::utils::AccountId32, + lost_account: ::subxt::utils::AccountId32, + rescuer_account: ::subxt::utils::AccountId32, }, #[codec(index = 2)] #[doc = "A recovery process for lost account by rescuer account has been vouched for by sender."] RecoveryVouched { - lost_account: ::subxt::ext::subxt_core::utils::AccountId32, - rescuer_account: ::subxt::ext::subxt_core::utils::AccountId32, - sender: ::subxt::ext::subxt_core::utils::AccountId32, + lost_account: ::subxt::utils::AccountId32, + rescuer_account: ::subxt::utils::AccountId32, + sender: ::subxt::utils::AccountId32, }, #[codec(index = 3)] #[doc = "A recovery process for lost account by rescuer account has been closed."] RecoveryClosed { - lost_account: ::subxt::ext::subxt_core::utils::AccountId32, - rescuer_account: ::subxt::ext::subxt_core::utils::AccountId32, + lost_account: ::subxt::utils::AccountId32, + rescuer_account: ::subxt::utils::AccountId32, }, #[codec(index = 4)] #[doc = "Lost account has been successfully recovered by rescuer account."] AccountRecovered { - lost_account: ::subxt::ext::subxt_core::utils::AccountId32, - rescuer_account: ::subxt::ext::subxt_core::utils::AccountId32, + lost_account: ::subxt::utils::AccountId32, + rescuer_account: ::subxt::utils::AccountId32, }, #[codec(index = 5)] #[doc = "A recovery process has been removed for an account."] RecoveryRemoved { - lost_account: ::subxt::ext::subxt_core::utils::AccountId32, + lost_account: ::subxt::utils::AccountId32, }, #[codec(index = 6)] #[doc = "A deposit has been updated."] DepositPoked { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, kind: runtime_types::pallet_recovery::DepositKind< runtime_types::rococo_runtime::Runtime, >, @@ -53627,38 +54137,38 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ActiveRecovery<_0, _1, _2> { pub created: _0, pub deposit: _1, pub friends: _2, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum DepositKind<_0> { #[codec(index = 0)] RecoveryConfig, #[codec(index = 1)] - ActiveRecoveryFor(::subxt::ext::subxt_core::utils::AccountId32), + ActiveRecoveryFor(::subxt::utils::AccountId32), __Ignore(::core::marker::PhantomData<_0>), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct RecoveryConfig<_0, _1, _2> { pub delay_period: _0, pub deposit: _1, @@ -53671,16 +54181,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -53694,9 +54200,8 @@ pub mod api { #[doc = ""] #[doc = "Emits `Submitted`."] submit { - proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::OriginCaller, - >, + proposal_origin: + ::subxt::alloc::boxed::Box, proposal: runtime_types::frame_support::traits::preimages::Bounded< runtime_types::rococo_runtime::RuntimeCall, runtime_types::sp_runtime::traits::BlakeTwo256, @@ -53777,20 +54282,16 @@ pub mod api { #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] set_metadata { index: ::core::primitive::u32, - maybe_hash: ::core::option::Option<::subxt::ext::subxt_core::utils::H256>, + maybe_hash: ::core::option::Option<::subxt::utils::H256>, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -53837,16 +54338,12 @@ pub mod api { PreimageStoredWithDifferentLength, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event1 { #[codec(index = 0)] @@ -53863,20 +54360,20 @@ pub mod api { #[doc = "The decision deposit has been placed."] DecisionDepositPlaced { index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 2)] #[doc = "The decision deposit has been refunded."] DecisionDepositRefunded { index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 3)] #[doc = "A deposit has been slashed."] DepositSlashed { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 4)] @@ -53943,33 +54440,29 @@ pub mod api { #[doc = "The submission deposit has been refunded."] SubmissionDepositRefunded { index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 14)] #[doc = "Metadata for a referendum has been set."] MetadataSet { index: ::core::primitive::u32, - hash: ::subxt::ext::subxt_core::utils::H256, + hash: ::subxt::utils::H256, }, #[codec(index = 15)] #[doc = "Metadata for a referendum has been cleared."] MetadataCleared { index: ::core::primitive::u32, - hash: ::subxt::ext::subxt_core::utils::H256, + hash: ::subxt::utils::H256, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event2 { #[codec(index = 0)] @@ -53986,20 +54479,20 @@ pub mod api { #[doc = "The decision deposit has been placed."] DecisionDepositPlaced { index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 2)] #[doc = "The decision deposit has been refunded."] DecisionDepositRefunded { index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 3)] #[doc = "A deposit has been slashed."] DepositSlashed { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 4)] @@ -54054,36 +54547,32 @@ pub mod api { #[doc = "The submission deposit has been refunded."] SubmissionDepositRefunded { index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 14)] #[doc = "Metadata for a referendum has been set."] MetadataSet { index: ::core::primitive::u32, - hash: ::subxt::ext::subxt_core::utils::H256, + hash: ::subxt::utils::H256, }, #[codec(index = 15)] #[doc = "Metadata for a referendum has been cleared."] MetadataCleared { index: ::core::primitive::u32, - hash: ::subxt::ext::subxt_core::utils::H256, + hash: ::subxt::utils::H256, }, } } pub mod types { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Curve { #[codec(index = 0)] LinearDecreasing { @@ -54106,46 +54595,34 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct DecidingStatus<_0> { pub since: _0, pub confirming: ::core::option::Option<_0>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Deposit<_0, _1> { pub who: _0, pub amount: _1, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ReferendumInfo<_0, _1, _2, _3, _4, _5, _6, _7> { #[codec(index = 0)] Ongoing( @@ -54204,16 +54681,12 @@ pub mod api { Killed(_2), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ReferendumStatus<_0, _1, _2, _3, _4, _5, _6, _7> { pub track: _0, pub origin: _1, @@ -54232,16 +54705,12 @@ pub mod api { pub alarm: ::core::option::Option<(_2, _7)>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct TrackDetails<_0, _1, _2> { pub name: _2, pub max_deciding: ::core::primitive::u32, @@ -54260,16 +54729,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -54281,16 +54746,12 @@ pub mod api { trigger_defensive, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -54304,16 +54765,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -54325,9 +54782,8 @@ pub mod api { ::core::primitive::u32, )>, priority: ::core::primitive::u8, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 1)] #[doc = "Cancel a scheduled task (named or anonymous), by providing the block it is scheduled for"] @@ -54348,9 +54804,8 @@ pub mod api { ::core::primitive::u32, )>, priority: ::core::primitive::u8, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 3)] #[doc = "Cancel a named scheduled task."] @@ -54366,9 +54821,8 @@ pub mod api { ::core::primitive::u32, )>, priority: ::core::primitive::u8, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 5)] #[doc = "Schedule a named task after a delay."] @@ -54380,9 +54834,8 @@ pub mod api { ::core::primitive::u32, )>, priority: ::core::primitive::u8, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 6)] #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] @@ -54436,16 +54889,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -54465,16 +54914,12 @@ pub mod api { Named, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Events type."] pub enum Event { #[codec(index = 0)] @@ -54542,24 +54987,24 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct RetryConfig<_0> { pub total_retries: ::core::primitive::u8, pub remaining: ::core::primitive::u8, pub period: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Scheduled<_0, _1, _2, _3, _4> { pub maybe_id: ::core::option::Option<_0>, pub priority: ::core::primitive::u8, @@ -54577,16 +55022,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -54601,16 +55042,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -54625,7 +55062,7 @@ pub mod api { #[doc = " fixed."] set_keys { keys: runtime_types::rococo_runtime::SessionKeys, - proof: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + proof: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 1)] #[doc = "Removes any session key(s) of the function caller."] @@ -54643,16 +55080,12 @@ pub mod api { purge_keys, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Error for the session pallet."] pub enum Error { #[codec(index = 0)] @@ -54672,16 +55105,12 @@ pub mod api { NoAccount, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -54697,25 +55126,21 @@ pub mod api { #[codec(index = 2)] #[doc = "Validator has been disabled."] ValidatorDisabled { - validator: ::subxt::ext::subxt_core::utils::AccountId32, + validator: ::subxt::utils::AccountId32, }, #[codec(index = 3)] #[doc = "Validator has been re-enabled."] ValidatorReenabled { - validator: ::subxt::ext::subxt_core::utils::AccountId32, + validator: ::subxt::utils::AccountId32, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum HoldReason { #[codec(index = 0)] Keys, @@ -54727,16 +55152,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -54778,10 +55199,7 @@ pub mod api { #[doc = "- `tip`: Your cut of the total `value` payout when the candidate is inducted into"] #[doc = "the society. Tips larger than `value` will be saturated upon payout."] vouch { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, value: ::core::primitive::u128, tip: ::core::primitive::u128, }, @@ -54804,10 +55222,7 @@ pub mod api { #[doc = "- `approve`: A boolean which says if the candidate should be approved (`true`) or"] #[doc = " rejected (`false`)."] vote { - candidate: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + candidate: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, approve: ::core::primitive::bool, }, #[codec(index = 5)] @@ -54854,15 +55269,12 @@ pub mod api { #[doc = ""] #[doc = "Complexity: O(1)"] found_society { - founder: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + founder: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, max_members: ::core::primitive::u32, max_intake: ::core::primitive::u32, max_strikes: ::core::primitive::u32, candidate_deposit: ::core::primitive::u128, - rules: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + rules: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 9)] #[doc = "Dissolve the society and remove all members."] @@ -54887,10 +55299,7 @@ pub mod api { #[doc = "- `forgive` - A boolean representing whether the suspension judgement origin forgives"] #[doc = " (`true`) or rejects (`false`) a suspended member."] judge_suspended_member { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, forgive: ::core::primitive::bool, }, #[codec(index = 11)] @@ -54925,7 +55334,7 @@ pub mod api { #[doc = "Founder, only after the period for voting has ended and only when the candidate is not"] #[doc = "clearly rejected."] bestow_membership { - candidate: ::subxt::ext::subxt_core::utils::AccountId32, + candidate: ::subxt::utils::AccountId32, }, #[codec(index = 15)] #[doc = "Remove the candidate's application from the society. Callable only by the Signed origin"] @@ -54934,7 +55343,7 @@ pub mod api { #[doc = ""] #[doc = "Any bid deposit is lost and voucher is banned."] kick_candidate { - candidate: ::subxt::ext::subxt_core::utils::AccountId32, + candidate: ::subxt::utils::AccountId32, }, #[codec(index = 16)] #[doc = "Remove the candidate's application from the society. Callable only by the candidate."] @@ -54948,14 +55357,14 @@ pub mod api { #[doc = ""] #[doc = "The bid deposit is lost and the voucher is banned."] drop_candidate { - candidate: ::subxt::ext::subxt_core::utils::AccountId32, + candidate: ::subxt::utils::AccountId32, }, #[codec(index = 18)] #[doc = "Remove up to `max` stale votes for the given `candidate`."] #[doc = ""] #[doc = "May be called by any Signed origin, but only after the candidate's candidacy is ended."] cleanup_candidacy { - candidate: ::subxt::ext::subxt_core::utils::AccountId32, + candidate: ::subxt::utils::AccountId32, max: ::core::primitive::u32, }, #[codec(index = 19)] @@ -54977,16 +55386,12 @@ pub mod api { poke_deposit, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -55090,94 +55495,84 @@ pub mod api { NoDeposit, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "The society is founded by the given identity."] Founded { - founder: ::subxt::ext::subxt_core::utils::AccountId32, + founder: ::subxt::utils::AccountId32, }, #[codec(index = 1)] #[doc = "A membership bid just happened. The given account is the candidate's ID and their offer"] #[doc = "is the second."] Bid { - candidate_id: ::subxt::ext::subxt_core::utils::AccountId32, + candidate_id: ::subxt::utils::AccountId32, offer: ::core::primitive::u128, }, #[codec(index = 2)] #[doc = "A membership bid just happened by vouching. The given account is the candidate's ID and"] #[doc = "their offer is the second. The vouching party is the third."] Vouch { - candidate_id: ::subxt::ext::subxt_core::utils::AccountId32, + candidate_id: ::subxt::utils::AccountId32, offer: ::core::primitive::u128, - vouching: ::subxt::ext::subxt_core::utils::AccountId32, + vouching: ::subxt::utils::AccountId32, }, #[codec(index = 3)] #[doc = "A candidate was dropped (due to an excess of bids in the system)."] AutoUnbid { - candidate: ::subxt::ext::subxt_core::utils::AccountId32, + candidate: ::subxt::utils::AccountId32, }, #[codec(index = 4)] #[doc = "A candidate was dropped (by their request)."] Unbid { - candidate: ::subxt::ext::subxt_core::utils::AccountId32, + candidate: ::subxt::utils::AccountId32, }, #[codec(index = 5)] #[doc = "A candidate was dropped (by request of who vouched for them)."] Unvouch { - candidate: ::subxt::ext::subxt_core::utils::AccountId32, + candidate: ::subxt::utils::AccountId32, }, #[codec(index = 6)] #[doc = "A group of candidates have been inducted. The batch's primary is the first value, the"] #[doc = "batch in full is the second."] Inducted { - primary: ::subxt::ext::subxt_core::utils::AccountId32, - candidates: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, + primary: ::subxt::utils::AccountId32, + candidates: ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, }, #[codec(index = 7)] #[doc = "A suspended member has been judged."] SuspendedMemberJudgement { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, judged: ::core::primitive::bool, }, #[codec(index = 8)] #[doc = "A candidate has been suspended"] CandidateSuspended { - candidate: ::subxt::ext::subxt_core::utils::AccountId32, + candidate: ::subxt::utils::AccountId32, }, #[codec(index = 9)] #[doc = "A member has been suspended"] - MemberSuspended { - member: ::subxt::ext::subxt_core::utils::AccountId32, - }, + MemberSuspended { member: ::subxt::utils::AccountId32 }, #[codec(index = 10)] #[doc = "A member has been challenged"] - Challenged { - member: ::subxt::ext::subxt_core::utils::AccountId32, - }, + Challenged { member: ::subxt::utils::AccountId32 }, #[codec(index = 11)] #[doc = "A vote has been placed"] Vote { - candidate: ::subxt::ext::subxt_core::utils::AccountId32, - voter: ::subxt::ext::subxt_core::utils::AccountId32, + candidate: ::subxt::utils::AccountId32, + voter: ::subxt::utils::AccountId32, vote: ::core::primitive::bool, }, #[codec(index = 12)] #[doc = "A vote has been placed for a defending member"] DefenderVote { - voter: ::subxt::ext::subxt_core::utils::AccountId32, + voter: ::subxt::utils::AccountId32, vote: ::core::primitive::bool, }, #[codec(index = 13)] @@ -55188,7 +55583,7 @@ pub mod api { #[codec(index = 14)] #[doc = "Society is unfounded."] Unfounded { - founder: ::subxt::ext::subxt_core::utils::AccountId32, + founder: ::subxt::utils::AccountId32, }, #[codec(index = 15)] #[doc = "Some funds were deposited into the society account."] @@ -55196,37 +55591,37 @@ pub mod api { #[codec(index = 16)] #[doc = "A \\[member\\] got elevated to \\[rank\\]."] Elevated { - member: ::subxt::ext::subxt_core::utils::AccountId32, + member: ::subxt::utils::AccountId32, rank: ::core::primitive::u32, }, #[codec(index = 17)] #[doc = "A deposit was poked / adjusted."] DepositPoked { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, old_deposit: ::core::primitive::u128, new_deposit: ::core::primitive::u128, }, } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Bid<_0, _1> { pub who: _0, pub kind: runtime_types::pallet_society::BidKind<_0, _1>, pub value: _1, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum BidKind<_0, _1> { #[codec(index = 0)] Deposit(_1), @@ -55234,12 +55629,12 @@ pub mod api { Vouch(_0, _1), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Candidacy<_0, _1> { pub round: ::core::primitive::u32, pub kind: runtime_types::pallet_society::BidKind<_0, _1>, @@ -55248,12 +55643,12 @@ pub mod api { pub skeptic_struck: ::core::primitive::bool, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct GroupParams<_0> { pub max_members: ::core::primitive::u32, pub max_intake: ::core::primitive::u32, @@ -55261,24 +55656,24 @@ pub mod api { pub candidate_deposit: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct IntakeRecord<_0, _1> { pub who: _0, pub bid: _1, pub round: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct MemberRecord { pub rank: ::core::primitive::u32, pub strikes: ::core::primitive::u32, @@ -55286,45 +55681,45 @@ pub mod api { pub index: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PayoutRecord<_0, _1> { pub paid: _0, pub payouts: _1, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Tally { pub approvals: ::core::primitive::u32, pub rejections: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Vote { pub approve: ::core::primitive::bool, pub weight: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum VouchingStatus { #[codec(index = 0)] Vouching, @@ -55337,16 +55732,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -55392,8 +55783,8 @@ pub mod api { #[doc = "This does not affect the global migration process tracker ([`MigrationProcess`]), and"] #[doc = "should only be used in case any keys are leftover due to a bug."] migrate_custom_top { - keys: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + keys: ::subxt::alloc::vec::Vec< + ::subxt::alloc::vec::Vec<::core::primitive::u8>, >, witness_size: ::core::primitive::u32, }, @@ -55405,9 +55796,9 @@ pub mod api { #[doc = "This does not affect the global migration process tracker ([`MigrationProcess`]), and"] #[doc = "should only be used in case any keys are leftover due to a bug."] migrate_custom_child { - root: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - child_keys: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + root: ::subxt::alloc::vec::Vec<::core::primitive::u8>, + child_keys: ::subxt::alloc::vec::Vec< + ::subxt::alloc::vec::Vec<::core::primitive::u8>, >, total_size: ::core::primitive::u32, }, @@ -55433,16 +55824,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -55471,16 +55858,12 @@ pub mod api { BadChildRoot, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Inner events of this pallet."] pub enum Event { #[codec(index = 0)] @@ -55495,7 +55878,7 @@ pub mod api { #[codec(index = 1)] #[doc = "Some account got slashed by the given amount."] Slashed { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 2)] @@ -55508,31 +55891,23 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum HoldReason { #[codec(index = 0)] SlashForMigrate, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum MigrationCompute { #[codec(index = 0)] Signed, @@ -55540,31 +55915,23 @@ pub mod api { Auto, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct MigrationLimits { pub size: ::core::primitive::u32, pub item: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct MigrationTask { pub progress_top: runtime_types::pallet_state_trie_migration::pallet::Progress, pub progress_child: @@ -55574,16 +55941,12 @@ pub mod api { pub child_items: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Progress { #[codec(index = 0)] ToStart, @@ -55603,24 +55966,19 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] sudo { - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 1)] #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] @@ -55629,19 +55987,15 @@ pub mod api { #[doc = ""] #[doc = "The dispatch origin for this call must be _Signed_."] sudo_unchecked_weight { - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, weight: runtime_types::sp_weights::weight_v2::Weight, }, #[codec(index = 2)] #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] #[doc = "key."] set_key { - new: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + new: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 3)] #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] @@ -55649,13 +56003,9 @@ pub mod api { #[doc = ""] #[doc = "The dispatch origin for this call must be _Signed_."] sudo_as { - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + who: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 4)] #[doc = "Permanently removes the sudo key."] @@ -55664,16 +56014,12 @@ pub mod api { remove_key, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Error for the Sudo pallet."] pub enum Error { #[codec(index = 0)] @@ -55681,16 +56027,12 @@ pub mod api { RequireSudo, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -55702,8 +56044,8 @@ pub mod api { #[codec(index = 1)] #[doc = "The sudo key has been updated."] KeyChanged { - old: ::core::option::Option<::subxt::ext::subxt_core::utils::AccountId32>, - new: ::subxt::ext::subxt_core::utils::AccountId32, + old: ::core::option::Option<::subxt::utils::AccountId32>, + new: ::subxt::utils::AccountId32, }, #[codec(index = 2)] #[doc = "The key was permanently removed."] @@ -55722,16 +56064,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -55766,23 +56104,19 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,"] #[doc = "has been paid by `who`."] TransactionFeePaid { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, actual_fee: ::core::primitive::u128, tip: ::core::primitive::u128, }, @@ -55791,16 +56125,12 @@ pub mod api { pub mod types { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct FeeDetails<_0> { pub inclusion_fee: ::core::option::Option< runtime_types::pallet_transaction_payment::types::InclusionFee<_0>, @@ -55808,32 +56138,24 @@ pub mod api { pub tip: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct InclusionFee<_0> { pub base_fee: _0, pub len_fee: _0, pub adjusted_weight_fee: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct RuntimeDispatchInfo<_0, _1> { pub weight: _1, pub class: runtime_types::frame_support::dispatch::DispatchClass, @@ -55841,20 +56163,20 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ChargeTransactionPayment(#[codec(compact)] pub ::core::primitive::u128); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Releases { #[codec(index = 0)] V1Ancient, @@ -55867,16 +56189,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 3)] @@ -55900,10 +56218,7 @@ pub mod api { spend_local { #[codec(compact)] amount: ::core::primitive::u128, - beneficiary: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + beneficiary: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 4)] #[doc = "Force a previously approved proposal to be removed from the approval queue."] @@ -55959,14 +56274,13 @@ pub mod api { #[doc = ""] #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] spend { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box< + asset_kind: ::subxt::alloc::boxed::Box< runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset, >, #[codec(compact)] amount: ::core::primitive::u128, - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::xcm::VersionedLocation, - >, + beneficiary: + ::subxt::alloc::boxed::Box, valid_from: ::core::option::Option<::core::primitive::u32>, }, #[codec(index = 6)] @@ -56031,16 +56345,12 @@ pub mod api { void_spend { index: ::core::primitive::u32 }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Error for the treasury pallet."] pub enum Error { #[codec(index = 0)] @@ -56079,16 +56389,12 @@ pub mod api { Inconclusive, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -56101,7 +56407,7 @@ pub mod api { Awarded { proposal_index: ::core::primitive::u32, award: ::core::primitive::u128, - account: ::subxt::ext::subxt_core::utils::AccountId32, + account: ::subxt::utils::AccountId32, }, #[codec(index = 2)] #[doc = "Some of our funds have been burnt."] @@ -56121,7 +56427,7 @@ pub mod api { SpendApproved { proposal_index: ::core::primitive::u32, amount: ::core::primitive::u128, - beneficiary: ::subxt::ext::subxt_core::utils::AccountId32, + beneficiary: ::subxt::utils::AccountId32, }, #[codec(index = 6)] #[doc = "The inactive funds of the pallet have been updated."] @@ -56162,12 +56468,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum PaymentState<_0> { #[codec(index = 0)] Pending, @@ -56177,12 +56483,12 @@ pub mod api { Failed, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Proposal<_0, _1> { pub proposer: _0, pub value: _1, @@ -56190,12 +56496,12 @@ pub mod api { pub bond: _1, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct SpendStatus<_0, _1, _2, _3, _4> { pub asset_kind: _0, pub amount: _1, @@ -56210,16 +56516,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -56242,9 +56544,7 @@ pub mod api { #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] #[doc = "event is deposited."] batch { - calls: ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::rococo_runtime::RuntimeCall, - >, + calls: ::subxt::alloc::vec::Vec, }, #[codec(index = 1)] #[doc = "Send a call through an indexed pseudonym of the sender."] @@ -56262,9 +56562,8 @@ pub mod api { #[doc = "The dispatch origin for this call must be _Signed_."] as_derivative { index: ::core::primitive::u16, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 2)] #[doc = "Send a batch of dispatch calls and atomically execute them."] @@ -56281,9 +56580,7 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- O(C) where C is the number of calls to be batched."] batch_all { - calls: ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::rococo_runtime::RuntimeCall, - >, + calls: ::subxt::alloc::vec::Vec, }, #[codec(index = 3)] #[doc = "Dispatches a function call with a provided origin."] @@ -56293,12 +56590,10 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- O(1)."] dispatch_as { - as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::OriginCaller, - >, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + as_origin: + ::subxt::alloc::boxed::Box, + call: + ::subxt::alloc::boxed::Box, }, #[codec(index = 4)] #[doc = "Send a batch of dispatch calls."] @@ -56315,9 +56610,7 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- O(C) where C is the number of calls to be batched."] force_batch { - calls: ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::rococo_runtime::RuntimeCall, - >, + calls: ::subxt::alloc::vec::Vec, }, #[codec(index = 5)] #[doc = "Dispatch a function call with a specified weight."] @@ -56327,9 +56620,8 @@ pub mod api { #[doc = ""] #[doc = "The dispatch origin for this call must be _Root_."] with_weight { - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, weight: runtime_types::sp_weights::weight_v2::Weight, }, #[codec(index = 6)] @@ -56357,12 +56649,10 @@ pub mod api { #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] #[doc = " or both."] if_else { - main: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, - fallback: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + main: + ::subxt::alloc::boxed::Box, + fallback: + ::subxt::alloc::boxed::Box, }, #[codec(index = 7)] #[doc = "Dispatches a function call with a provided origin."] @@ -56371,25 +56661,19 @@ pub mod api { #[doc = ""] #[doc = "The dispatch origin for this call must be _Root_."] dispatch_as_fallible { - as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::OriginCaller, - >, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + as_origin: + ::subxt::alloc::boxed::Box, + call: + ::subxt::alloc::boxed::Box, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -56397,16 +56681,12 @@ pub mod api { TooManyCalls, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -56452,16 +56732,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -56488,10 +56764,7 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- `O(1)`."] vest_other { - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + target: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, }, #[codec(index = 2)] #[doc = "Create a vested transfer."] @@ -56508,10 +56781,7 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- `O(1)`."] vested_transfer { - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + target: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< ::core::primitive::u128, ::core::primitive::u32, @@ -56533,14 +56803,8 @@ pub mod api { #[doc = "## Complexity"] #[doc = "- `O(1)`."] force_vested_transfer { - source: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + source: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, + target: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< ::core::primitive::u128, ::core::primitive::u32, @@ -56580,24 +56844,17 @@ pub mod api { #[doc = "- `target`: An account that has a vesting schedule"] #[doc = "- `schedule_index`: The vesting schedule index that should be removed"] force_remove_vesting_schedule { - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + target: ::subxt::utils::MultiAddress<::subxt::utils::AccountId32, ()>, schedule_index: ::core::primitive::u32, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Error for the vesting pallet."] pub enum Error { #[codec(index = 0)] @@ -56618,51 +56875,43 @@ pub mod api { InvalidScheduleParams, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "A vesting schedule has been created."] VestingCreated { - account: ::subxt::ext::subxt_core::utils::AccountId32, + account: ::subxt::utils::AccountId32, schedule_index: ::core::primitive::u32, }, #[codec(index = 1)] #[doc = "The amount vested has been updated. This could indicate a change in funds available."] #[doc = "The balance given is the amount which is left unvested (and thus locked)."] VestingUpdated { - account: ::subxt::ext::subxt_core::utils::AccountId32, + account: ::subxt::utils::AccountId32, unvested: ::core::primitive::u128, }, #[codec(index = 2)] #[doc = "An \\[account\\] has become fully vested."] VestingCompleted { - account: ::subxt::ext::subxt_core::utils::AccountId32, + account: ::subxt::utils::AccountId32, }, } } pub mod vesting_info { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct VestingInfo<_0, _1> { pub locked: _0, pub per_block: _0, @@ -56670,12 +56919,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Releases { #[codec(index = 0)] V0, @@ -56688,50 +56937,37 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] - whitelist_call { - call_hash: ::subxt::ext::subxt_core::utils::H256, - }, + whitelist_call { call_hash: ::subxt::utils::H256 }, #[codec(index = 1)] - remove_whitelisted_call { - call_hash: ::subxt::ext::subxt_core::utils::H256, - }, + remove_whitelisted_call { call_hash: ::subxt::utils::H256 }, #[codec(index = 2)] dispatch_whitelisted_call { - call_hash: ::subxt::ext::subxt_core::utils::H256, + call_hash: ::subxt::utils::H256, call_encoded_len: ::core::primitive::u32, call_weight_witness: runtime_types::sp_weights::weight_v2::Weight, }, #[codec(index = 3)] dispatch_whitelisted_call_with_preimage { - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::rococo_runtime::RuntimeCall, - >, + call: + ::subxt::alloc::boxed::Box, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -56751,29 +56987,21 @@ pub mod api { CallAlreadyWhitelisted, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] - CallWhitelisted { - call_hash: ::subxt::ext::subxt_core::utils::H256, - }, + CallWhitelisted { call_hash: ::subxt::utils::H256 }, #[codec(index = 1)] - WhitelistedCallRemoved { - call_hash: ::subxt::ext::subxt_core::utils::H256, - }, + WhitelistedCallRemoved { call_hash: ::subxt::utils::H256 }, #[codec(index = 2)] WhitelistedCallDispatched { - call_hash: ::subxt::ext::subxt_core::utils::H256, + call_hash: ::subxt::utils::H256, result: ::core::result::Result< runtime_types::frame_support::dispatch::PostDispatchInfo, runtime_types::sp_runtime::DispatchErrorWithPostInfo< @@ -56789,16 +57017,12 @@ pub mod api { pub mod errors { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ExecutionError { #[codec(index = 0)] Overflow, @@ -56887,30 +57111,22 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { - # [codec (index = 0)] send { dest : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , message : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , } , # [codec (index = 1)] # [doc = "Teleport some assets from the local chain to some destination chain."] # [doc = ""] # [doc = "**This function is deprecated: Use `limited_teleport_assets` instead.**"] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] # [doc = "with all fees taken as needed from the asset."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` chain."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] teleport_assets { dest : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , } , # [codec (index = 2)] # [doc = "Transfer some assets from the local chain to the destination chain through their local,"] # [doc = "destination or remote reserve."] # [doc = ""] # [doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] # [doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] # [doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] # [doc = " assets to `beneficiary`."] # [doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] # [doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] # [doc = " deposit them to `beneficiary`."] # [doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] # [doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] # [doc = " to mint and deposit reserve-based assets to `beneficiary`."] # [doc = ""] # [doc = "**This function is deprecated: Use `limited_reserve_transfer_assets` instead.**"] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] # [doc = "with all fees taken as needed from the asset."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] reserve_transfer_assets { dest : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "Execute an XCM message from a local, signed, origin."] # [doc = ""] # [doc = "An event is deposited indicating whether `msg` could be executed completely or only"] # [doc = "partially."] # [doc = ""] # [doc = "No more than `max_weight` will be used in its attempted execution. If this is less than"] # [doc = "the maximum amount of weight that the message could take to be executed, then no"] # [doc = "execution attempt will be made."] execute { message : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , max_weight : runtime_types :: sp_weights :: weight_v2 :: Weight , } , # [codec (index = 4)] # [doc = "Extoll that a particular destination can be communicated with through a particular"] # [doc = "version of XCM."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `location`: The destination that is being described."] # [doc = "- `xcm_version`: The latest version of XCM that `location` supports."] force_xcm_version { location : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: staging_xcm :: v5 :: location :: Location > , version : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] # [doc = "version a destination can accept is unknown)."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] force_default_xcm_version { maybe_xcm_version : :: core :: option :: Option < :: core :: primitive :: u32 > , } , # [codec (index = 6)] # [doc = "Ask a location to notify us regarding their XCM version and any changes to it."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `location`: The location to which we should subscribe for XCM version notifications."] force_subscribe_version_notify { location : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 7)] # [doc = "Require that a particular destination should no longer notify us regarding any XCM"] # [doc = "version changes."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `location`: The location to which we are currently subscribed for XCM version"] # [doc = " notifications which we no longer desire."] force_unsubscribe_version_notify { location : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 8)] # [doc = "Transfer some assets from the local chain to the destination chain through their local,"] # [doc = "destination or remote reserve."] # [doc = ""] # [doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] # [doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] # [doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] # [doc = " assets to `beneficiary`."] # [doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] # [doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] # [doc = " deposit them to `beneficiary`."] # [doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] # [doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] # [doc = " to mint and deposit reserve-based assets to `beneficiary`."] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] # [doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] # [doc = "at risk."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] limited_reserve_transfer_assets { dest : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 9)] # [doc = "Teleport some assets from the local chain to some destination chain."] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] # [doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] # [doc = "at risk."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` chain."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] limited_teleport_assets { dest : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 10)] # [doc = "Set or unset the global suspension state of the XCM executor."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `suspended`: `true` to suspend, `false` to resume."] force_suspension { suspended : :: core :: primitive :: bool , } , # [codec (index = 11)] # [doc = "Transfer some assets from the local chain to the destination chain through their local,"] # [doc = "destination or remote reserve, or through teleports."] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item` (hence referred to as `fees`), up to enough to pay for"] # [doc = "`weight_limit` of weight. If more weight is needed than `weight_limit`, then the"] # [doc = "operation will fail and the sent assets may be at risk."] # [doc = ""] # [doc = "`assets` (excluding `fees`) must have same reserve location or otherwise be teleportable"] # [doc = "to `dest`, no limitations imposed on `fees`."] # [doc = " - for local reserve: transfer assets to sovereign account of destination chain and"] # [doc = " forward a notification XCM to `dest` to mint and deposit reserve-based assets to"] # [doc = " `beneficiary`."] # [doc = " - for destination reserve: burn local assets and forward a notification to `dest` chain"] # [doc = " to withdraw the reserve assets from this chain's sovereign account and deposit them"] # [doc = " to `beneficiary`."] # [doc = " - for remote reserve: burn local assets, forward XCM to reserve chain to move reserves"] # [doc = " from this chain's SA to `dest` chain's SA, and forward another XCM to `dest` to mint"] # [doc = " and deposit reserve-based assets to `beneficiary`."] # [doc = " - for teleports: burn local assets and forward XCM to `dest` chain to mint/teleport"] # [doc = " assets and deposit them to `beneficiary`."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent,"] # [doc = " Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send"] # [doc = " from relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] transfer_assets { dest : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 12)] # [doc = "Claims assets trapped on this pallet because of leftover assets during XCM execution."] # [doc = ""] # [doc = "- `origin`: Anyone can call this extrinsic."] # [doc = "- `assets`: The exact assets that were trapped. Use the version to specify what version"] # [doc = "was the latest when they were trapped."] # [doc = "- `beneficiary`: The location/account where the claimed assets will be deposited."] claim_assets { assets : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , beneficiary : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 13)] # [doc = "Transfer assets from the local chain to the destination chain using explicit transfer"] # [doc = "types for assets and fees."] # [doc = ""] # [doc = "`assets` must have same reserve location or may be teleportable to `dest`. Caller must"] # [doc = "provide the `assets_transfer_type` to be used for `assets`:"] # [doc = " - `TransferType::LocalReserve`: transfer assets to sovereign account of destination"] # [doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] # [doc = " assets to `beneficiary`."] # [doc = " - `TransferType::DestinationReserve`: burn local assets and forward a notification to"] # [doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] # [doc = " deposit them to `beneficiary`."] # [doc = " - `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM to `reserve`"] # [doc = " chain to move reserves from this chain's SA to `dest` chain's SA, and forward another"] # [doc = " XCM to `dest` to mint and deposit reserve-based assets to `beneficiary`. Typically"] # [doc = " the remote `reserve` is Asset Hub."] # [doc = " - `TransferType::Teleport`: burn local assets and forward XCM to `dest` chain to"] # [doc = " mint/teleport assets and deposit them to `beneficiary`."] # [doc = ""] # [doc = "On the destination chain, as well as any intermediary hops, `BuyExecution` is used to"] # [doc = "buy execution using transferred `assets` identified by `remote_fees_id`."] # [doc = "Make sure enough of the specified `remote_fees_id` asset is included in the given list"] # [doc = "of `assets`. `remote_fees_id` should be enough to pay for `weight_limit`. If more weight"] # [doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] # [doc = "at risk."] # [doc = ""] # [doc = "`remote_fees_id` may use different transfer type than rest of `assets` and can be"] # [doc = "specified through `fees_transfer_type`."] # [doc = ""] # [doc = "The caller needs to specify what should happen to the transferred assets once they reach"] # [doc = "the `dest` chain. This is done through the `custom_xcm_on_dest` parameter, which"] # [doc = "contains the instructions to execute on `dest` as a final step."] # [doc = " This is usually as simple as:"] # [doc = " `Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])`,"] # [doc = " but could be something more exotic like sending the `assets` even further."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain, or `(parents: 2, (GlobalConsensus(..), ..))` to send from"] # [doc = " parachain across a bridge to another ecosystem destination."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`."] # [doc = "- `remote_fees_id`: One of the included `assets` to be used to pay fees."] # [doc = "- `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets."] # [doc = "- `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the"] # [doc = " transfer, which also determines what happens to the assets on the destination chain."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] transfer_assets_using_type_and_then { dest : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , assets_transfer_type : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: staging_xcm_executor :: traits :: asset_transfer :: TransferType > , remote_fees_id : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssetId > , fees_transfer_type : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: staging_xcm_executor :: traits :: asset_transfer :: TransferType > , custom_xcm_on_dest : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 14)] # [doc = "Authorize another `aliaser` location to alias into the local `origin` making this call."] # [doc = "The `aliaser` is only authorized until the provided `expiry` block number."] # [doc = "The call can also be used for a previously authorized alias in order to update its"] # [doc = "`expiry` block number."] # [doc = ""] # [doc = "Usually useful to allow your local account to be aliased into from a remote location"] # [doc = "also under your control (like your account on another chain)."] # [doc = ""] # [doc = "WARNING: make sure the caller `origin` (you) trusts the `aliaser` location to act in"] # [doc = "their/your name. Once authorized using this call, the `aliaser` can freely impersonate"] # [doc = "`origin` in XCM programs executed on the local chain."] add_authorized_alias { aliaser : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , expires : :: core :: option :: Option < :: core :: primitive :: u64 > , } , # [codec (index = 15)] # [doc = "Remove a previously authorized `aliaser` from the list of locations that can alias into"] # [doc = "the local `origin` making this call."] remove_authorized_alias { aliaser : :: subxt :: ext :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 16)] # [doc = "Remove all previously authorized `aliaser`s that can alias into the local `origin`"] # [doc = "making this call."] remove_all_authorized_aliases , } + # [codec (index = 0)] send { dest : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , message : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , } , # [codec (index = 1)] # [doc = "Teleport some assets from the local chain to some destination chain."] # [doc = ""] # [doc = "**This function is deprecated: Use `limited_teleport_assets` instead.**"] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] # [doc = "with all fees taken as needed from the asset."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` chain."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] teleport_assets { dest : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , } , # [codec (index = 2)] # [doc = "Transfer some assets from the local chain to the destination chain through their local,"] # [doc = "destination or remote reserve."] # [doc = ""] # [doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] # [doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] # [doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] # [doc = " assets to `beneficiary`."] # [doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] # [doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] # [doc = " deposit them to `beneficiary`."] # [doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] # [doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] # [doc = " to mint and deposit reserve-based assets to `beneficiary`."] # [doc = ""] # [doc = "**This function is deprecated: Use `limited_reserve_transfer_assets` instead.**"] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] # [doc = "with all fees taken as needed from the asset."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] reserve_transfer_assets { dest : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "Execute an XCM message from a local, signed, origin."] # [doc = ""] # [doc = "An event is deposited indicating whether `msg` could be executed completely or only"] # [doc = "partially."] # [doc = ""] # [doc = "No more than `max_weight` will be used in its attempted execution. If this is less than"] # [doc = "the maximum amount of weight that the message could take to be executed, then no"] # [doc = "execution attempt will be made."] execute { message : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , max_weight : runtime_types :: sp_weights :: weight_v2 :: Weight , } , # [codec (index = 4)] # [doc = "Extoll that a particular destination can be communicated with through a particular"] # [doc = "version of XCM."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `location`: The destination that is being described."] # [doc = "- `xcm_version`: The latest version of XCM that `location` supports."] force_xcm_version { location : :: subxt :: alloc :: boxed :: Box < runtime_types :: staging_xcm :: v5 :: location :: Location > , version : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] # [doc = "version a destination can accept is unknown)."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] force_default_xcm_version { maybe_xcm_version : :: core :: option :: Option < :: core :: primitive :: u32 > , } , # [codec (index = 6)] # [doc = "Ask a location to notify us regarding their XCM version and any changes to it."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `location`: The location to which we should subscribe for XCM version notifications."] force_subscribe_version_notify { location : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 7)] # [doc = "Require that a particular destination should no longer notify us regarding any XCM"] # [doc = "version changes."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `location`: The location to which we are currently subscribed for XCM version"] # [doc = " notifications which we no longer desire."] force_unsubscribe_version_notify { location : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 8)] # [doc = "Transfer some assets from the local chain to the destination chain through their local,"] # [doc = "destination or remote reserve."] # [doc = ""] # [doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] # [doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] # [doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] # [doc = " assets to `beneficiary`."] # [doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] # [doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] # [doc = " deposit them to `beneficiary`."] # [doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] # [doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] # [doc = " to mint and deposit reserve-based assets to `beneficiary`."] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] # [doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] # [doc = "at risk."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] limited_reserve_transfer_assets { dest : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 9)] # [doc = "Teleport some assets from the local chain to some destination chain."] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] # [doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] # [doc = "at risk."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` chain."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] limited_teleport_assets { dest : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 10)] # [doc = "Set or unset the global suspension state of the XCM executor."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `suspended`: `true` to suspend, `false` to resume."] force_suspension { suspended : :: core :: primitive :: bool , } , # [codec (index = 11)] # [doc = "Transfer some assets from the local chain to the destination chain through their local,"] # [doc = "destination or remote reserve, or through teleports."] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item` (hence referred to as `fees`), up to enough to pay for"] # [doc = "`weight_limit` of weight. If more weight is needed than `weight_limit`, then the"] # [doc = "operation will fail and the sent assets may be at risk."] # [doc = ""] # [doc = "`assets` (excluding `fees`) must have same reserve location or otherwise be teleportable"] # [doc = "to `dest`, no limitations imposed on `fees`."] # [doc = " - for local reserve: transfer assets to sovereign account of destination chain and"] # [doc = " forward a notification XCM to `dest` to mint and deposit reserve-based assets to"] # [doc = " `beneficiary`."] # [doc = " - for destination reserve: burn local assets and forward a notification to `dest` chain"] # [doc = " to withdraw the reserve assets from this chain's sovereign account and deposit them"] # [doc = " to `beneficiary`."] # [doc = " - for remote reserve: burn local assets, forward XCM to reserve chain to move reserves"] # [doc = " from this chain's SA to `dest` chain's SA, and forward another XCM to `dest` to mint"] # [doc = " and deposit reserve-based assets to `beneficiary`."] # [doc = " - for teleports: burn local assets and forward XCM to `dest` chain to mint/teleport"] # [doc = " assets and deposit them to `beneficiary`."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent,"] # [doc = " Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send"] # [doc = " from relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] transfer_assets { dest : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 12)] # [doc = "Claims assets trapped on this pallet because of leftover assets during XCM execution."] # [doc = ""] # [doc = "- `origin`: Anyone can call this extrinsic."] # [doc = "- `assets`: The exact assets that were trapped. Use the version to specify what version"] # [doc = "was the latest when they were trapped."] # [doc = "- `beneficiary`: The location/account where the claimed assets will be deposited."] claim_assets { assets : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , beneficiary : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 13)] # [doc = "Transfer assets from the local chain to the destination chain using explicit transfer"] # [doc = "types for assets and fees."] # [doc = ""] # [doc = "`assets` must have same reserve location or may be teleportable to `dest`. Caller must"] # [doc = "provide the `assets_transfer_type` to be used for `assets`:"] # [doc = " - `TransferType::LocalReserve`: transfer assets to sovereign account of destination"] # [doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] # [doc = " assets to `beneficiary`."] # [doc = " - `TransferType::DestinationReserve`: burn local assets and forward a notification to"] # [doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] # [doc = " deposit them to `beneficiary`."] # [doc = " - `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM to `reserve`"] # [doc = " chain to move reserves from this chain's SA to `dest` chain's SA, and forward another"] # [doc = " XCM to `dest` to mint and deposit reserve-based assets to `beneficiary`. Typically"] # [doc = " the remote `reserve` is Asset Hub."] # [doc = " - `TransferType::Teleport`: burn local assets and forward XCM to `dest` chain to"] # [doc = " mint/teleport assets and deposit them to `beneficiary`."] # [doc = ""] # [doc = "On the destination chain, as well as any intermediary hops, `BuyExecution` is used to"] # [doc = "buy execution using transferred `assets` identified by `remote_fees_id`."] # [doc = "Make sure enough of the specified `remote_fees_id` asset is included in the given list"] # [doc = "of `assets`. `remote_fees_id` should be enough to pay for `weight_limit`. If more weight"] # [doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] # [doc = "at risk."] # [doc = ""] # [doc = "`remote_fees_id` may use different transfer type than rest of `assets` and can be"] # [doc = "specified through `fees_transfer_type`."] # [doc = ""] # [doc = "The caller needs to specify what should happen to the transferred assets once they reach"] # [doc = "the `dest` chain. This is done through the `custom_xcm_on_dest` parameter, which"] # [doc = "contains the instructions to execute on `dest` as a final step."] # [doc = " This is usually as simple as:"] # [doc = " `Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])`,"] # [doc = " but could be something more exotic like sending the `assets` even further."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain, or `(parents: 2, (GlobalConsensus(..), ..))` to send from"] # [doc = " parachain across a bridge to another ecosystem destination."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`."] # [doc = "- `remote_fees_id`: One of the included `assets` to be used to pay fees."] # [doc = "- `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets."] # [doc = "- `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the"] # [doc = " transfer, which also determines what happens to the assets on the destination chain."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] transfer_assets_using_type_and_then { dest : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , assets_transfer_type : :: subxt :: alloc :: boxed :: Box < runtime_types :: staging_xcm_executor :: traits :: asset_transfer :: TransferType > , remote_fees_id : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssetId > , fees_transfer_type : :: subxt :: alloc :: boxed :: Box < runtime_types :: staging_xcm_executor :: traits :: asset_transfer :: TransferType > , custom_xcm_on_dest : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 14)] # [doc = "Authorize another `aliaser` location to alias into the local `origin` making this call."] # [doc = "The `aliaser` is only authorized until the provided `expiry` block number."] # [doc = "The call can also be used for a previously authorized alias in order to update its"] # [doc = "`expiry` block number."] # [doc = ""] # [doc = "Usually useful to allow your local account to be aliased into from a remote location"] # [doc = "also under your control (like your account on another chain)."] # [doc = ""] # [doc = "WARNING: make sure the caller `origin` (you) trusts the `aliaser` location to act in"] # [doc = "their/your name. Once authorized using this call, the `aliaser` can freely impersonate"] # [doc = "`origin` in XCM programs executed on the local chain."] add_authorized_alias { aliaser : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , expires : :: core :: option :: Option < :: core :: primitive :: u64 > , } , # [codec (index = 15)] # [doc = "Remove a previously authorized `aliaser` from the list of locations that can alias into"] # [doc = "the local `origin` making this call."] remove_authorized_alias { aliaser : :: subxt :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 16)] # [doc = "Remove all previously authorized `aliaser`s that can alias into the local `origin`"] # [doc = "making this call."] remove_all_authorized_aliases , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -57006,16 +57222,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -57126,7 +57338,7 @@ pub mod api { #[codec(index = 13)] #[doc = "Some assets have been placed in an asset trap."] AssetsTrapped { - hash: ::subxt::ext::subxt_core::utils::H256, + hash: ::subxt::utils::H256, origin: runtime_types::staging_xcm::v5::location::Location, assets: runtime_types::xcm::VersionedAssets, }, @@ -57218,7 +57430,7 @@ pub mod api { #[codec(index = 24)] #[doc = "Some assets have been claimed from an asset trap"] AssetsClaimed { - hash: ::subxt::ext::subxt_core::utils::H256, + hash: ::subxt::utils::H256, origin: runtime_types::staging_xcm::v5::location::Location, assets: runtime_types::xcm::VersionedAssets, }, @@ -57246,43 +57458,31 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum HoldReason { #[codec(index = 0)] AuthorizeAlias, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct MaxAuthorizedAliases; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Origin { #[codec(index = 0)] Xcm(runtime_types::staging_xcm::v5::location::Location), @@ -57290,16 +57490,12 @@ pub mod api { Response(runtime_types::staging_xcm::v5::location::Location), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum QueryStatus<_0> { #[codec(index = 0)] Pending { @@ -57322,16 +57518,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct RemoteLockedFungibleRecord<_0> { pub amount: ::core::primitive::u128, pub owner: runtime_types::xcm::VersionedLocation, @@ -57342,16 +57534,12 @@ pub mod api { )>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum VersionMigrationStage { #[codec(index = 0)] MigrateSupportedVersion, @@ -57359,21 +57547,19 @@ pub mod api { MigrateVersionNotifiers, #[codec(index = 2)] NotifyCurrentTargets( - ::core::option::Option< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >, + ::core::option::Option<::subxt::alloc::vec::Vec<::core::primitive::u8>>, ), #[codec(index = 3)] MigrateAndNotifyOldTargets, } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AuthorizedAliasesEntry<_0, _1> { pub aliasers: runtime_types::bounded_collections::bounded_vec::BoundedVec< runtime_types::xcm_runtime_apis::authorized_aliases::OriginAliaser, @@ -57386,45 +57572,45 @@ pub mod api { pub mod polkadot_core_primitives { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct CandidateHash(pub ::subxt::ext::subxt_core::utils::H256); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct CandidateHash(pub ::subxt::utils::H256); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct InboundDownwardMessage<_0> { pub sent_at: _0, - pub msg: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub msg: ::subxt::alloc::vec::Vec<::core::primitive::u8>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct InboundHrmpMessage<_0> { pub sent_at: _0, - pub data: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub data: ::subxt::alloc::vec::Vec<::core::primitive::u8>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct OutboundHrmpMessage<_0> { pub recipient: _0, - pub data: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub data: ::subxt::alloc::vec::Vec<::core::primitive::u8>, } } pub mod polkadot_parachain_primitives { @@ -57432,72 +57618,48 @@ pub mod api { pub mod primitives { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct HeadData( - pub ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct HeadData(pub ::subxt::alloc::vec::Vec<::core::primitive::u8>); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct HrmpChannelId { pub sender: runtime_types::polkadot_parachain_primitives::primitives::Id, pub recipient: runtime_types::polkadot_parachain_primitives::primitives::Id, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Id(pub ::core::primitive::u32); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ValidationCode( - pub ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct ValidationCode(pub ::subxt::alloc::vec::Vec<::core::primitive::u8>); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ValidationCodeHash(pub ::subxt::ext::subxt_core::utils::H256); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct ValidationCodeHash(pub ::subxt::utils::H256); } } pub mod polkadot_primitives { @@ -57507,58 +57669,42 @@ pub mod api { pub mod assignment_app { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Public(pub [::core::primitive::u8; 32usize]); } pub mod async_backing { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AsyncBackingParams { pub max_candidate_depth: ::core::primitive::u32, pub allowed_ancestry_len: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct BackingState < _0 , _1 > { pub constraints : runtime_types :: polkadot_primitives :: v9 :: async_backing :: Constraints < _1 > , pub pending_availability : :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_primitives :: v9 :: async_backing :: CandidatePendingAvailability < _0 , _1 > > , } + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct BackingState < _0 , _1 > { pub constraints : runtime_types :: polkadot_primitives :: v9 :: async_backing :: Constraints < _1 > , pub pending_availability : :: subxt :: alloc :: vec :: Vec < runtime_types :: polkadot_primitives :: v9 :: async_backing :: CandidatePendingAvailability < _0 , _1 > > , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CandidatePendingAvailability<_0, _1> { pub candidate_hash: runtime_types::polkadot_core_primitives::CandidateHash, pub descriptor: @@ -57569,42 +57715,30 @@ pub mod api { pub max_pov_size: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Constraints < _0 > { pub min_relay_parent_number : _0 , pub max_pov_size : :: core :: primitive :: u32 , pub max_code_size : :: core :: primitive :: u32 , pub max_head_data_size : :: core :: primitive :: u32 , pub ump_remaining : :: core :: primitive :: u32 , pub ump_remaining_bytes : :: core :: primitive :: u32 , pub max_ump_num_per_candidate : :: core :: primitive :: u32 , pub dmp_remaining_messages : :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < _0 > , pub hrmp_inbound : runtime_types :: polkadot_primitives :: v9 :: async_backing :: InboundHrmpLimitations < _0 > , pub hrmp_channels_out : :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < (runtime_types :: polkadot_parachain_primitives :: primitives :: Id , runtime_types :: polkadot_primitives :: v9 :: async_backing :: OutboundHrmpChannelLimitations ,) > , pub max_hrmp_num_per_candidate : :: core :: primitive :: u32 , pub required_parent : runtime_types :: polkadot_parachain_primitives :: primitives :: HeadData , pub validation_code_hash : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , pub upgrade_restriction : :: core :: option :: Option < runtime_types :: polkadot_primitives :: v9 :: UpgradeRestriction > , pub future_validation_code : :: core :: option :: Option < (_0 , runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ,) > , } + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct Constraints < _0 > { pub min_relay_parent_number : _0 , pub max_pov_size : :: core :: primitive :: u32 , pub max_code_size : :: core :: primitive :: u32 , pub max_head_data_size : :: core :: primitive :: u32 , pub ump_remaining : :: core :: primitive :: u32 , pub ump_remaining_bytes : :: core :: primitive :: u32 , pub max_ump_num_per_candidate : :: core :: primitive :: u32 , pub dmp_remaining_messages : :: subxt :: alloc :: vec :: Vec < _0 > , pub hrmp_inbound : runtime_types :: polkadot_primitives :: v9 :: async_backing :: InboundHrmpLimitations < _0 > , pub hrmp_channels_out : :: subxt :: alloc :: vec :: Vec < (runtime_types :: polkadot_parachain_primitives :: primitives :: Id , runtime_types :: polkadot_primitives :: v9 :: async_backing :: OutboundHrmpChannelLimitations ,) > , pub max_hrmp_num_per_candidate : :: core :: primitive :: u32 , pub required_parent : runtime_types :: polkadot_parachain_primitives :: primitives :: HeadData , pub validation_code_hash : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , pub upgrade_restriction : :: core :: option :: Option < runtime_types :: polkadot_primitives :: v9 :: UpgradeRestriction > , pub future_validation_code : :: core :: option :: Option < (_0 , runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ,) > , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct InboundHrmpLimitations<_0> { - pub valid_watermarks: ::subxt::ext::subxt_core::alloc::vec::Vec<_0>, + pub valid_watermarks: ::subxt::alloc::vec::Vec<_0>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct OutboundHrmpChannelLimitations { pub bytes_remaining: ::core::primitive::u32, pub messages_remaining: ::core::primitive::u32, @@ -57613,31 +57747,23 @@ pub mod api { pub mod collator_app { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Public(pub [::core::primitive::u8; 32usize]); } pub mod executor_params { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ExecutorParam { #[codec(index = 1)] MaxMemoryPages(::core::primitive::u32), @@ -57661,18 +57787,14 @@ pub mod api { WasmExtBulkMemory, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ExecutorParams( - pub ::subxt::ext::subxt_core::alloc::vec::Vec< + pub ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::executor_params::ExecutorParam, >, ); @@ -57680,16 +57802,12 @@ pub mod api { pub mod signed { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct UncheckedSigned<_0, _1> { pub payload: _0, pub validator_index: runtime_types::polkadot_primitives::v9::ValidatorIndex, @@ -57702,16 +57820,12 @@ pub mod api { pub mod slashing { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct DisputeProof { pub time_slot: runtime_types::polkadot_primitives::v9::slashing::DisputesTimeSlot, @@ -57721,33 +57835,25 @@ pub mod api { runtime_types::polkadot_primitives::v9::validator_app::Public, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct DisputesTimeSlot { pub session_index: ::core::primitive::u32, pub candidate_hash: runtime_types::polkadot_core_primitives::CandidateHash, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct LegacyPendingSlashes { - pub keys: ::subxt::ext::subxt_core::utils::KeyedVec< + pub keys: ::subxt::utils::KeyedVec< runtime_types::polkadot_primitives::v9::ValidatorIndex, runtime_types::polkadot_primitives::v9::validator_app::Public, >, @@ -57755,48 +57861,36 @@ pub mod api { runtime_types::polkadot_primitives::v9::slashing::SlashingOffenceKind, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct OpaqueKeyOwnershipProof( - pub ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub ::subxt::alloc::vec::Vec<::core::primitive::u8>, ); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PendingSlashes { - pub keys: ::subxt::ext::subxt_core::utils::KeyedVec< + pub keys: ::subxt::utils::KeyedVec< runtime_types::polkadot_primitives::v9::ValidatorIndex, runtime_types::polkadot_primitives::v9::validator_app::Public, >, pub kind: runtime_types::polkadot_primitives::v9::DisputeOffenceKind, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum SlashingOffenceKind { #[codec(index = 0)] ForInvalid, @@ -57807,98 +57901,74 @@ pub mod api { pub mod validator_app { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Public(pub [::core::primitive::u8; 32usize]); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Signature(pub [::core::primitive::u8; 64usize]); } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ApprovalVotingParams { pub max_approval_coalesce_count: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AvailabilityBitfield( - pub ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >, ); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BackedCandidate<_0> { pub candidate: runtime_types::polkadot_primitives::v9::CommittedCandidateReceiptV2<_0>, - pub validity_votes: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub validity_votes: ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::ValidityAttestation, >, - pub validator_indices: ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub validator_indices: ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CandidateCommitments<_0> { pub upward_messages: runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt::alloc::vec::Vec<::core::primitive::u8>, >, pub horizontal_messages: runtime_types::bounded_collections::bounded_vec::BoundedVec< @@ -57915,28 +57985,20 @@ pub mod api { pub hrmp_watermark: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CandidateDescriptorV2 < _0 > { pub para_id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , pub relay_parent : _0 , pub version : runtime_types :: polkadot_primitives :: v9 :: InternalVersion , pub core_index : :: core :: primitive :: u16 , pub session_index : :: core :: primitive :: u32 , pub reserved1 : [:: core :: primitive :: u8 ; 25usize] , pub persisted_validation_data_hash : :: subxt :: ext :: subxt_core :: utils :: H256 , pub pov_hash : :: subxt :: ext :: subxt_core :: utils :: H256 , pub erasure_root : :: subxt :: ext :: subxt_core :: utils :: H256 , pub reserved2 : [:: core :: primitive :: u8 ; 64usize] , pub para_head : :: subxt :: ext :: subxt_core :: utils :: H256 , pub validation_code_hash : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , } + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct CandidateDescriptorV2 < _0 > { pub para_id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , pub relay_parent : _0 , pub version : runtime_types :: polkadot_primitives :: v9 :: InternalVersion , pub core_index : :: core :: primitive :: u16 , pub session_index : :: core :: primitive :: u32 , pub reserved1 : [:: core :: primitive :: u8 ; 25usize] , pub persisted_validation_data_hash : :: subxt :: utils :: H256 , pub pov_hash : :: subxt :: utils :: H256 , pub erasure_root : :: subxt :: utils :: H256 , pub reserved2 : [:: core :: primitive :: u8 ; 64usize] , pub para_head : :: subxt :: utils :: H256 , pub validation_code_hash : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum CandidateEvent<_0> { #[codec(index = 0)] CandidateBacked( @@ -57960,32 +58022,24 @@ pub mod api { ), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CandidateReceiptV2<_0> { pub descriptor: runtime_types::polkadot_primitives::v9::CandidateDescriptorV2<_0>, - pub commitments_hash: ::subxt::ext::subxt_core::utils::H256, + pub commitments_hash: ::subxt::utils::H256, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CommittedCandidateReceiptV2<_0> { pub descriptor: runtime_types::polkadot_primitives::v9::CandidateDescriptorV2<_0>, @@ -57994,28 +58048,20 @@ pub mod api { >, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CoreIndex(pub ::core::primitive::u32); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum CoreState<_0, _1> { #[codec(index = 0)] Occupied(runtime_types::polkadot_primitives::v9::OccupiedCore<_0, _1>), @@ -58025,16 +58071,12 @@ pub mod api { Free, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum DisputeOffenceKind { #[codec(index = 0)] ForInvalidBacked, @@ -58044,39 +58086,31 @@ pub mod api { ForInvalidApproved, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct DisputeState<_0> { - pub validators_for: ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub validators_for: ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >, - pub validators_against: ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub validators_against: ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >, pub start: _0, pub concluded_at: ::core::option::Option<_0>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum DisputeStatement { #[codec(index = 0)] Valid(runtime_types::polkadot_primitives::v9::ValidDisputeStatementKind), @@ -58084,134 +58118,102 @@ pub mod api { Invalid(runtime_types::polkadot_primitives::v9::InvalidDisputeStatementKind), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct DisputeStatementSet { pub candidate_hash: runtime_types::polkadot_core_primitives::CandidateHash, pub session: ::core::primitive::u32, - pub statements: ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub statements: ::subxt::alloc::vec::Vec<( runtime_types::polkadot_primitives::v9::DisputeStatement, runtime_types::polkadot_primitives::v9::ValidatorIndex, runtime_types::polkadot_primitives::v9::validator_app::Signature, )>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct GroupIndex(pub ::core::primitive::u32); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct GroupRotationInfo<_0> { pub session_start_block: _0, pub group_rotation_frequency: _0, pub now: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct IndexedVec<_0, _1>( - pub ::subxt::ext::subxt_core::alloc::vec::Vec<_1>, + pub ::subxt::alloc::vec::Vec<_1>, #[codec(skip)] pub ::core::marker::PhantomData<_0>, ); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct InherentData<_0> { - pub bitfields: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub bitfields: ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::signed::UncheckedSigned< runtime_types::polkadot_primitives::v9::AvailabilityBitfield, runtime_types::polkadot_primitives::v9::AvailabilityBitfield, >, >, - pub backed_candidates: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub backed_candidates: ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::BackedCandidate< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >, >, - pub disputes: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub disputes: ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::DisputeStatementSet, >, pub parent_header: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct InternalVersion(pub ::core::primitive::u8); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum InvalidDisputeStatementKind { #[codec(index = 0)] Explicit, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct OccupiedCore<_0, _1> { pub next_up_on_available: ::core::option::Option< runtime_types::polkadot_primitives::v9::ScheduledCore, @@ -58221,9 +58223,9 @@ pub mod api { pub next_up_on_time_out: ::core::option::Option< runtime_types::polkadot_primitives::v9::ScheduledCore, >, - pub availability: ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub availability: ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >, pub group_responsible: runtime_types::polkadot_primitives::v9::GroupIndex, pub candidate_hash: runtime_types::polkadot_core_primitives::CandidateHash, @@ -58231,16 +58233,12 @@ pub mod api { runtime_types::polkadot_primitives::v9::CandidateDescriptorV2<_0>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum OccupiedCoreAssumption { #[codec(index = 0)] Included, @@ -58250,16 +58248,12 @@ pub mod api { Free, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PersistedValidationData<_0, _1> { pub parent_head: runtime_types::polkadot_parachain_primitives::primitives::HeadData, @@ -58268,28 +58262,20 @@ pub mod api { pub max_pov_size: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PvfCheckStatement { pub accept : :: core :: primitive :: bool , pub subject : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , pub session_index : :: core :: primitive :: u32 , pub validator_index : runtime_types :: polkadot_primitives :: v9 :: ValidatorIndex , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum PvfExecKind { #[codec(index = 0)] Backing, @@ -58297,16 +58283,12 @@ pub mod api { Approval, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum PvfPrepKind { #[codec(index = 0)] Precheck, @@ -58314,16 +58296,12 @@ pub mod api { Prepare, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ScheduledCore { pub para_id: runtime_types::polkadot_parachain_primitives::primitives::Id, pub collator: ::core::option::Option< @@ -58331,16 +58309,12 @@ pub mod api { >, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct SchedulerParams<_0> { pub group_rotation_frequency: _0, pub paras_availability_period: _0, @@ -58357,43 +58331,34 @@ pub mod api { pub ttl: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ScrapedOnChainVotes<_0> { pub session: ::core::primitive::u32, - pub backing_validators_per_candidate: - ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::polkadot_primitives::v9::CandidateReceiptV2<_0>, - ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::polkadot_primitives::v9::ValidatorIndex, - runtime_types::polkadot_primitives::v9::ValidityAttestation, - )>, + pub backing_validators_per_candidate: ::subxt::alloc::vec::Vec<( + runtime_types::polkadot_primitives::v9::CandidateReceiptV2<_0>, + ::subxt::alloc::vec::Vec<( + runtime_types::polkadot_primitives::v9::ValidatorIndex, + runtime_types::polkadot_primitives::v9::ValidityAttestation, )>, - pub disputes: ::subxt::ext::subxt_core::alloc::vec::Vec< + )>, + pub disputes: ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::DisputeStatementSet, >, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct SessionInfo { - pub active_validator_indices: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub active_validator_indices: ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::ValidatorIndex, >, pub random_seed: [::core::primitive::u8; 32usize], @@ -58402,15 +58367,15 @@ pub mod api { runtime_types::polkadot_primitives::v9::ValidatorIndex, runtime_types::polkadot_primitives::v9::validator_app::Public, >, - pub discovery_keys: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub discovery_keys: ::subxt::alloc::vec::Vec< runtime_types::sp_authority_discovery::app::Public, >, - pub assignment_keys: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub assignment_keys: ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::assignment_app::Public, >, pub validator_groups: runtime_types::polkadot_primitives::v9::IndexedVec< runtime_types::polkadot_primitives::v9::GroupIndex, - ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::ValidatorIndex, >, >, @@ -58422,16 +58387,12 @@ pub mod api { pub needed_approvals: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum UpgradeGoAhead { #[codec(index = 0)] Abort, @@ -58439,70 +58400,54 @@ pub mod api { GoAhead, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum UpgradeRestriction { #[codec(index = 0)] Present, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ValidDisputeStatementKind { #[codec(index = 0)] Explicit, #[codec(index = 1)] - BackingSeconded(::subxt::ext::subxt_core::utils::H256), + BackingSeconded(::subxt::utils::H256), #[codec(index = 2)] - BackingValid(::subxt::ext::subxt_core::utils::H256), + BackingValid(::subxt::utils::H256), #[codec(index = 3)] ApprovalChecking, #[codec(index = 4)] ApprovalCheckingMultipleCandidates( - ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::alloc::vec::Vec< runtime_types::polkadot_core_primitives::CandidateHash, >, ), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ValidatorIndex(pub ::core::primitive::u32); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ValidityAttestation { #[codec(index = 1)] Implicit(runtime_types::polkadot_primitives::v9::validator_app::Signature), @@ -58518,30 +58463,22 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { # [codec (index = 0)] # [doc = "Assign a permanent parachain slot and immediately create a lease for it."] assign_perm_parachain_slot { id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 1)] # [doc = "Assign a temporary parachain slot. The function tries to create a lease for it"] # [doc = "immediately if `SlotLeasePeriodStart::Current` is specified, and if the number"] # [doc = "of currently active temporary slots is below `MaxTemporarySlotPerLeasePeriod`."] assign_temp_parachain_slot { id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , lease_period_start : runtime_types :: polkadot_runtime_common :: assigned_slots :: SlotLeasePeriodStart , } , # [codec (index = 2)] # [doc = "Unassign a permanent or temporary parachain slot"] unassign_parachain_slot { id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 3)] # [doc = "Sets the storage value [`MaxPermanentSlots`]."] set_max_permanent_slots { slots : :: core :: primitive :: u32 , } , # [codec (index = 4)] # [doc = "Sets the storage value [`MaxTemporarySlots`]."] set_max_temporary_slots { slots : :: core :: primitive :: u32 , } , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -58573,16 +58510,12 @@ pub mod api { MaxTemporarySlotsExceeded, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -58604,16 +58537,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ParachainTemporarySlot<_0, _1> { pub manager: _0, pub period_begin: _1, @@ -58622,16 +58551,12 @@ pub mod api { pub lease_count: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum SlotLeasePeriodStart { #[codec(index = 0)] Current, @@ -58644,16 +58569,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -58704,16 +58625,12 @@ pub mod api { cancel_auction, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -58739,16 +58656,12 @@ pub mod api { AlreadyLeasedOut, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -58768,14 +58681,14 @@ pub mod api { #[doc = "Funds were reserved for a winning bid. First balance is the extra amount reserved."] #[doc = "Second is the total."] Reserved { - bidder: ::subxt::ext::subxt_core::utils::AccountId32, + bidder: ::subxt::utils::AccountId32, extra_reserved: ::core::primitive::u128, total_amount: ::core::primitive::u128, }, #[codec(index = 3)] #[doc = "Funds were unreserved since bidder is no longer active. `[bidder, amount]`"] Unreserved { - bidder: ::subxt::ext::subxt_core::utils::AccountId32, + bidder: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 4)] @@ -58783,13 +58696,13 @@ pub mod api { #[doc = "reserve but no parachain slot has been leased."] ReserveConfiscated { para_id: runtime_types::polkadot_parachain_primitives::primitives::Id, - leaser: ::subxt::ext::subxt_core::utils::AccountId32, + leaser: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 5)] #[doc = "A new bid has been accepted as the current winner."] BidAccepted { - bidder: ::subxt::ext::subxt_core::utils::AccountId32, + bidder: ::subxt::utils::AccountId32, para_id: runtime_types::polkadot_parachain_primitives::primitives::Id, amount: ::core::primitive::u128, first_slot: ::core::primitive::u32, @@ -58810,16 +58723,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -58848,7 +58757,7 @@ pub mod api { #[doc = "Total Complexity: O(1)"] #[doc = ""] claim { - dest: ::subxt::ext::subxt_core::utils::AccountId32, + dest: ::subxt::utils::AccountId32, ethereum_signature: runtime_types::polkadot_runtime_common::claims::EcdsaSignature, }, @@ -58909,11 +58818,10 @@ pub mod api { #[doc = "Total Complexity: O(1)"] #[doc = ""] claim_attest { - dest: ::subxt::ext::subxt_core::utils::AccountId32, + dest: ::subxt::utils::AccountId32, ethereum_signature: runtime_types::polkadot_runtime_common::claims::EcdsaSignature, - statement: - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + statement: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 3)] #[doc = "Attest to a statement, needed to finalize the claims process."] @@ -58936,29 +58844,22 @@ pub mod api { #[doc = "Total Complexity: O(1)"] #[doc = ""] attest { - statement: - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + statement: ::subxt::alloc::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::ext::subxt_core::utils::AccountId32, - >, + maybe_preclaim: ::core::option::Option<::subxt::utils::AccountId32>, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -58982,22 +58883,18 @@ pub mod api { VestedBalanceExists, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "Someone claimed some DOTs."] Claimed { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, ethereum_address: runtime_types::polkadot_runtime_common::claims::EthereumAddress, amount: ::core::primitive::u128, @@ -59005,40 +58902,28 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct EcdsaSignature(pub [::core::primitive::u8; 65usize]); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct EthereumAddress(pub [::core::primitive::u8; 20usize]); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum StatementKind { #[codec(index = 0)] Regular, @@ -59051,16 +58936,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -59113,7 +58994,7 @@ pub mod api { #[doc = "- `who`: The account whose contribution should be withdrawn."] #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] withdraw { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, #[codec(compact)] index: runtime_types::polkadot_parachain_primitives::primitives::Id, }, @@ -59157,7 +59038,7 @@ pub mod api { #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] add_memo { index: runtime_types::polkadot_parachain_primitives::primitives::Id, - memo: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + memo: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 7)] #[doc = "Poke the fund into `NewRaise`"] @@ -59178,16 +59059,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -59262,16 +59139,12 @@ pub mod api { NoLeasePeriod, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -59282,7 +59155,7 @@ pub mod api { #[codec(index = 1)] #[doc = "Contributed to a crowd sale."] Contributed { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, fund_index: runtime_types::polkadot_parachain_primitives::primitives::Id, amount: ::core::primitive::u128, @@ -59290,7 +59163,7 @@ pub mod api { #[codec(index = 2)] #[doc = "Withdrew full balance of a contributor."] Withdrew { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, fund_index: runtime_types::polkadot_parachain_primitives::primitives::Id, amount: ::core::primitive::u128, @@ -59328,9 +59201,9 @@ pub mod api { #[codec(index = 8)] #[doc = "A memo has been updated."] MemoUpdated { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, para_id: runtime_types::polkadot_parachain_primitives::primitives::Id, - memo: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + memo: ::subxt::alloc::vec::Vec<::core::primitive::u8>, }, #[codec(index = 9)] #[doc = "A parachain has been moved to `NewRaise`"] @@ -59340,16 +59213,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct FundInfo<_0, _1, _2, _3> { pub depositor: _0, pub verifier: ::core::option::Option, @@ -59364,16 +59233,12 @@ pub mod api { pub fund_index: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum LastContribution<_0> { #[codec(index = 0)] Never, @@ -59388,54 +59253,40 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] #[doc = "Reap the `IdentityInfo` of `who` from the Identity pallet of `T`, unreserving any"] #[doc = "deposits held and removing storage items associated with `who`."] - reap_identity { - who: ::subxt::ext::subxt_core::utils::AccountId32, - }, + reap_identity { who: ::subxt::utils::AccountId32 }, #[codec(index = 1)] #[doc = "Update the deposit of `who`. Meant to be called by the system with an XCM `Transact`"] #[doc = "Instruction."] - poke_deposit { - who: ::subxt::ext::subxt_core::utils::AccountId32, - }, + poke_deposit { who: ::subxt::utils::AccountId32 }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "The identity and all sub accounts were reaped for `who`."] - IdentityReaped { - who: ::subxt::ext::subxt_core::utils::AccountId32, - }, + IdentityReaped { who: ::subxt::utils::AccountId32 }, #[codec(index = 1)] #[doc = "The deposits held for `who` were updated. `identity` is the new deposit held for"] #[doc = "identity info, and `subs` is the new deposit held for the sub-accounts."] DepositUpdated { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, identity: ::core::primitive::u128, subs: ::core::primitive::u128, }, @@ -59445,16 +59296,12 @@ pub mod api { pub mod impls { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum VersionedLocatableAsset { #[codec(index = 3)] V3 { @@ -59478,30 +59325,22 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { - # [codec (index = 0)] # [doc = "Register head data and validation code for a reserved Para Id."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin."] # [doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] # [doc = "- `genesis_head`: The genesis head data of the parachain/thread."] # [doc = "- `validation_code`: The initial validation code of the parachain/thread."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The account with the originating signature must reserve a deposit."] # [doc = ""] # [doc = "The deposit is required to cover the costs associated with storing the genesis head"] # [doc = "data and the validation code."] # [doc = "This accounts for the potential to store validation code of a size up to the"] # [doc = "`max_code_size`, as defined in the configuration pallet"] # [doc = ""] # [doc = "Anything already reserved previously for this para ID is accounted for."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Registered` event is emitted in case of success."] register { id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain_primitives :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Force the registration of a Para Id on the relay chain."] # [doc = ""] # [doc = "This function must be called by a Root origin."] # [doc = ""] # [doc = "The deposit taken can be specified for this registration. Any `ParaId`"] # [doc = "can be registered, including sub-1000 IDs which are System Parachains."] force_register { who : :: subxt :: ext :: subxt_core :: utils :: AccountId32 , deposit : :: core :: primitive :: u128 , id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain_primitives :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode , } , # [codec (index = 2)] # [doc = "Deregister a Para Id, freeing all data and returning any deposit."] # [doc = ""] # [doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be an"] # [doc = "on-demand parachain."] deregister { id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 3)] # [doc = "Swap a lease holding parachain with another parachain, either on-demand or lease"] # [doc = "holding."] # [doc = ""] # [doc = "The origin must be Root, the `para` owner, or the `para` itself."] # [doc = ""] # [doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] # [doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] # [doc = ""] # [doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] # [doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] # [doc = "scheduling info (i.e. whether they're an on-demand parachain or lease holding"] # [doc = "parachain), auction information and the auction deposit are switched."] swap { id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , other : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 4)] # [doc = "Remove a manager lock from a para. This will allow the manager of a"] # [doc = "previously locked para to deregister or swap a para without using governance."] # [doc = ""] # [doc = "Can only be called by the Root origin or the parachain."] remove_lock { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Reserve a Para Id on the relay chain."] # [doc = ""] # [doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] # [doc = "The origin account is able to register head data and validation code using `register` to"] # [doc = "create an on-demand parachain. Using the Slots pallet, an on-demand parachain can then"] # [doc = "be upgraded to a lease holding parachain."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new"] # [doc = " para ID."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for"] # [doc = "use."] reserve , # [codec (index = 6)] # [doc = "Add a manager lock from a para. This will prevent the manager of a"] # [doc = "para to deregister or swap a para."] # [doc = ""] # [doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] # [doc = "unlocked."] add_lock { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 7)] # [doc = "Schedule a parachain upgrade."] # [doc = ""] # [doc = "This will kick off a check of `new_code` by all validators. After the majority of the"] # [doc = "validators have reported on the validity of the code, the code will either be enacted"] # [doc = "or the upgrade will be rejected. If the code will be enacted, the current code of the"] # [doc = "parachain will be overwritten directly. This means that any PoV will be checked by this"] # [doc = "new code. The parachain itself will not be informed explicitly that the validation code"] # [doc = "has changed."] # [doc = ""] # [doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] # [doc = "unlocked."] schedule_code_upgrade { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , new_code : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode , } , # [codec (index = 8)] # [doc = "Set the parachain's current head."] # [doc = ""] # [doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] # [doc = "unlocked."] set_current_head { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , new_head : runtime_types :: polkadot_parachain_primitives :: primitives :: HeadData , } , } + # [codec (index = 0)] # [doc = "Register head data and validation code for a reserved Para Id."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin."] # [doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] # [doc = "- `genesis_head`: The genesis head data of the parachain/thread."] # [doc = "- `validation_code`: The initial validation code of the parachain/thread."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The account with the originating signature must reserve a deposit."] # [doc = ""] # [doc = "The deposit is required to cover the costs associated with storing the genesis head"] # [doc = "data and the validation code."] # [doc = "This accounts for the potential to store validation code of a size up to the"] # [doc = "`max_code_size`, as defined in the configuration pallet"] # [doc = ""] # [doc = "Anything already reserved previously for this para ID is accounted for."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Registered` event is emitted in case of success."] register { id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain_primitives :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Force the registration of a Para Id on the relay chain."] # [doc = ""] # [doc = "This function must be called by a Root origin."] # [doc = ""] # [doc = "The deposit taken can be specified for this registration. Any `ParaId`"] # [doc = "can be registered, including sub-1000 IDs which are System Parachains."] force_register { who : :: subxt :: utils :: AccountId32 , deposit : :: core :: primitive :: u128 , id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain_primitives :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode , } , # [codec (index = 2)] # [doc = "Deregister a Para Id, freeing all data and returning any deposit."] # [doc = ""] # [doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be an"] # [doc = "on-demand parachain."] deregister { id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 3)] # [doc = "Swap a lease holding parachain with another parachain, either on-demand or lease"] # [doc = "holding."] # [doc = ""] # [doc = "The origin must be Root, the `para` owner, or the `para` itself."] # [doc = ""] # [doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] # [doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] # [doc = ""] # [doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] # [doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] # [doc = "scheduling info (i.e. whether they're an on-demand parachain or lease holding"] # [doc = "parachain), auction information and the auction deposit are switched."] swap { id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , other : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 4)] # [doc = "Remove a manager lock from a para. This will allow the manager of a"] # [doc = "previously locked para to deregister or swap a para without using governance."] # [doc = ""] # [doc = "Can only be called by the Root origin or the parachain."] remove_lock { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Reserve a Para Id on the relay chain."] # [doc = ""] # [doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] # [doc = "The origin account is able to register head data and validation code using `register` to"] # [doc = "create an on-demand parachain. Using the Slots pallet, an on-demand parachain can then"] # [doc = "be upgraded to a lease holding parachain."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new"] # [doc = " para ID."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for"] # [doc = "use."] reserve , # [codec (index = 6)] # [doc = "Add a manager lock from a para. This will prevent the manager of a"] # [doc = "para to deregister or swap a para."] # [doc = ""] # [doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] # [doc = "unlocked."] add_lock { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 7)] # [doc = "Schedule a parachain upgrade."] # [doc = ""] # [doc = "This will kick off a check of `new_code` by all validators. After the majority of the"] # [doc = "validators have reported on the validity of the code, the code will either be enacted"] # [doc = "or the upgrade will be rejected. If the code will be enacted, the current code of the"] # [doc = "parachain will be overwritten directly. This means that any PoV will be checked by this"] # [doc = "new code. The parachain itself will not be informed explicitly that the validation code"] # [doc = "has changed."] # [doc = ""] # [doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] # [doc = "unlocked."] schedule_code_upgrade { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , new_code : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode , } , # [codec (index = 8)] # [doc = "Set the parachain's current head."] # [doc = ""] # [doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is"] # [doc = "unlocked."] set_current_head { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , new_head : runtime_types :: polkadot_parachain_primitives :: primitives :: HeadData , } , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -59550,22 +59389,18 @@ pub mod api { CannotSwap, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] Registered { para_id: runtime_types::polkadot_parachain_primitives::primitives::Id, - manager: ::subxt::ext::subxt_core::utils::AccountId32, + manager: ::subxt::utils::AccountId32, }, #[codec(index = 1)] Deregistered { @@ -59574,7 +59409,7 @@ pub mod api { #[codec(index = 2)] Reserved { para_id: runtime_types::polkadot_parachain_primitives::primitives::Id, - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, }, #[codec(index = 3)] Swapped { @@ -59584,16 +59419,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ParaInfo<_0, _1> { pub manager: _0, pub deposit: _1, @@ -59605,16 +59436,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -59650,9 +59477,7 @@ pub mod api { #[doc = "size `config.max_downward_message_size`."] sudo_queue_downward_xcm { id: runtime_types::polkadot_parachain_primitives::primitives::Id, - xcm: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::xcm::VersionedXcm, - >, + xcm: ::subxt::alloc::boxed::Box, }, #[codec(index = 5)] #[doc = "Forcefully establish a channel from the sender to the recipient."] @@ -59667,16 +59492,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -59718,16 +59539,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -59737,7 +59554,7 @@ pub mod api { #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] force_lease { para: runtime_types::polkadot_parachain_primitives::primitives::Id, - leaser: ::subxt::ext::subxt_core::utils::AccountId32, + leaser: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, period_begin: ::core::primitive::u32, period_count: ::core::primitive::u32, @@ -59762,16 +59579,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -59782,16 +59595,12 @@ pub mod api { LeaseError, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -59805,7 +59614,7 @@ pub mod api { #[doc = "Second balance is the total amount reserved."] Leased { para_id: runtime_types::polkadot_parachain_primitives::primitives::Id, - leaser: ::subxt::ext::subxt_core::utils::AccountId32, + leaser: ::subxt::utils::AccountId32, period_begin: ::core::primitive::u32, period_count: ::core::primitive::u32, extra_reserved: ::core::primitive::u128, @@ -59822,16 +59631,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -59843,16 +59648,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AssignmentState { pub ratio: runtime_types::polkadot_runtime_parachains::assigner_coretime::PartsOf57600, @@ -59860,57 +59661,41 @@ pub mod api { runtime_types::polkadot_runtime_parachains::assigner_coretime::PartsOf57600, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CoreDescriptor < _0 > { pub queue : :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: QueueDescriptor < _0 > > , pub current_work : :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: WorkState < _0 > > , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PartsOf57600(pub ::core::primitive::u16); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct QueueDescriptor<_0> { pub first: _0, pub last: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Schedule<_0> { - pub assignments: ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub assignments: ::subxt::alloc::vec::Vec<( runtime_types::pallet_broker::coretime_interface::CoreAssignment, runtime_types::polkadot_runtime_parachains::assigner_coretime::PartsOf57600, )>, @@ -59918,47 +59703,35 @@ pub mod api { pub next_schedule: ::core::option::Option<_0>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct WorkState < _0 > { pub assignments : :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < (runtime_types :: pallet_broker :: coretime_interface :: CoreAssignment , runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: AssignmentState ,) > , pub end_hint : :: core :: option :: Option < _0 > , pub pos : :: core :: primitive :: u16 , pub step : runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: PartsOf57600 , } + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct WorkState < _0 > { pub assignments : :: subxt :: alloc :: vec :: Vec < (runtime_types :: pallet_broker :: coretime_interface :: CoreAssignment , runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: AssignmentState ,) > , pub end_hint : :: core :: option :: Option < _0 > , pub pos : :: core :: primitive :: u16 , pub step : runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: PartsOf57600 , } } pub mod configuration { use super::runtime_types; pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { # [codec (index = 0)] # [doc = "Set the validation upgrade cooldown."] set_validation_upgrade_cooldown { new : :: core :: primitive :: u32 , } , # [codec (index = 1)] # [doc = "Set the validation upgrade delay."] set_validation_upgrade_delay { new : :: core :: primitive :: u32 , } , # [codec (index = 2)] # [doc = "Set the acceptance period for an included candidate."] set_code_retention_period { new : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "Set the max validation code size for incoming upgrades."] set_max_code_size { new : :: core :: primitive :: u32 , } , # [codec (index = 4)] # [doc = "Set the max POV block size for incoming upgrades."] set_max_pov_size { new : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Set the max head data size for paras."] set_max_head_data_size { new : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "Set the number of coretime execution cores."] # [doc = ""] # [doc = "NOTE: that this configuration is managed by the coretime chain. Only manually change"] # [doc = "this, if you really know what you are doing!"] set_coretime_cores { new : :: core :: primitive :: u32 , } , # [codec (index = 8)] # [doc = "Set the parachain validator-group rotation frequency"] set_group_rotation_frequency { new : :: core :: primitive :: u32 , } , # [codec (index = 9)] # [doc = "Set the availability period for paras."] set_paras_availability_period { new : :: core :: primitive :: u32 , } , # [codec (index = 11)] # [doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] set_scheduling_lookahead { new : :: core :: primitive :: u32 , } , # [codec (index = 12)] # [doc = "Set the maximum number of validators to assign to any core."] set_max_validators_per_core { new : :: core :: option :: Option < :: core :: primitive :: u32 > , } , # [codec (index = 13)] # [doc = "Set the maximum number of validators to use in parachain consensus."] set_max_validators { new : :: core :: option :: Option < :: core :: primitive :: u32 > , } , # [codec (index = 14)] # [doc = "Set the dispute period, in number of sessions to keep for disputes."] set_dispute_period { new : :: core :: primitive :: u32 , } , # [codec (index = 15)] # [doc = "Set the dispute post conclusion acceptance period."] set_dispute_post_conclusion_acceptance_period { new : :: core :: primitive :: u32 , } , # [codec (index = 18)] # [doc = "Set the no show slots, in number of number of consensus slots."] # [doc = "Must be at least 1."] set_no_show_slots { new : :: core :: primitive :: u32 , } , # [codec (index = 19)] # [doc = "Set the total number of delay tranches."] set_n_delay_tranches { new : :: core :: primitive :: u32 , } , # [codec (index = 20)] # [doc = "Set the zeroth delay tranche width."] set_zeroth_delay_tranche_width { new : :: core :: primitive :: u32 , } , # [codec (index = 21)] # [doc = "Set the number of validators needed to approve a block."] set_needed_approvals { new : :: core :: primitive :: u32 , } , # [codec (index = 22)] # [doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] set_relay_vrf_modulo_samples { new : :: core :: primitive :: u32 , } , # [codec (index = 23)] # [doc = "Sets the maximum items that can present in a upward dispatch queue at once."] set_max_upward_queue_count { new : :: core :: primitive :: u32 , } , # [codec (index = 24)] # [doc = "Sets the maximum total size of items that can present in a upward dispatch queue at"] # [doc = "once."] set_max_upward_queue_size { new : :: core :: primitive :: u32 , } , # [codec (index = 25)] # [doc = "Set the critical downward message size."] set_max_downward_message_size { new : :: core :: primitive :: u32 , } , # [codec (index = 27)] # [doc = "Sets the maximum size of an upward message that can be sent by a candidate."] set_max_upward_message_size { new : :: core :: primitive :: u32 , } , # [codec (index = 28)] # [doc = "Sets the maximum number of messages that a candidate can contain."] set_max_upward_message_num_per_candidate { new : :: core :: primitive :: u32 , } , # [codec (index = 29)] # [doc = "Sets the number of sessions after which an HRMP open channel request expires."] set_hrmp_open_request_ttl { new : :: core :: primitive :: u32 , } , # [codec (index = 30)] # [doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] set_hrmp_sender_deposit { new : :: core :: primitive :: u128 , } , # [codec (index = 31)] # [doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] # [doc = "channel."] set_hrmp_recipient_deposit { new : :: core :: primitive :: u128 , } , # [codec (index = 32)] # [doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] set_hrmp_channel_max_capacity { new : :: core :: primitive :: u32 , } , # [codec (index = 33)] # [doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] set_hrmp_channel_max_total_size { new : :: core :: primitive :: u32 , } , # [codec (index = 34)] # [doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] set_hrmp_max_parachain_inbound_channels { new : :: core :: primitive :: u32 , } , # [codec (index = 36)] # [doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] set_hrmp_channel_max_message_size { new : :: core :: primitive :: u32 , } , # [codec (index = 37)] # [doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] set_hrmp_max_parachain_outbound_channels { new : :: core :: primitive :: u32 , } , # [codec (index = 39)] # [doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] set_hrmp_max_message_num_per_candidate { new : :: core :: primitive :: u32 , } , # [codec (index = 42)] # [doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] set_pvf_voting_ttl { new : :: core :: primitive :: u32 , } , # [codec (index = 43)] # [doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] # [doc = "upgrade taking place."] # [doc = ""] # [doc = "See the field documentation for information and constraints for the new value."] set_minimum_validation_upgrade_delay { new : :: core :: primitive :: u32 , } , # [codec (index = 44)] # [doc = "Setting this to true will disable consistency checks for the configuration setters."] # [doc = "Use with caution."] set_bypass_consistency_check { new : :: core :: primitive :: bool , } , # [codec (index = 45)] # [doc = "Set the asynchronous backing parameters."] set_async_backing_params { new : runtime_types :: polkadot_primitives :: v9 :: async_backing :: AsyncBackingParams , } , # [codec (index = 46)] # [doc = "Set PVF executor parameters."] set_executor_params { new : runtime_types :: polkadot_primitives :: v9 :: executor_params :: ExecutorParams , } , # [codec (index = 47)] # [doc = "Set the on demand (parathreads) base fee."] set_on_demand_base_fee { new : :: core :: primitive :: u128 , } , # [codec (index = 48)] # [doc = "Set the on demand (parathreads) fee variability."] set_on_demand_fee_variability { new : runtime_types :: sp_arithmetic :: per_things :: Perbill , } , # [codec (index = 49)] # [doc = "Set the on demand (parathreads) queue max size."] set_on_demand_queue_max_size { new : :: core :: primitive :: u32 , } , # [codec (index = 50)] # [doc = "Set the on demand (parathreads) fee variability."] set_on_demand_target_queue_utilization { new : runtime_types :: sp_arithmetic :: per_things :: Perbill , } , # [codec (index = 52)] # [doc = "Set the minimum backing votes threshold."] set_minimum_backing_votes { new : :: core :: primitive :: u32 , } , # [codec (index = 53)] # [doc = "Set/Unset a node feature."] set_node_feature { index : :: core :: primitive :: u8 , value : :: core :: primitive :: bool , } , # [codec (index = 54)] # [doc = "Set approval-voting-params."] set_approval_voting_params { new : runtime_types :: polkadot_primitives :: v9 :: ApprovalVotingParams , } , # [codec (index = 55)] # [doc = "Set scheduler-params."] set_scheduler_params { new : runtime_types :: polkadot_primitives :: v9 :: SchedulerParams < :: core :: primitive :: u32 > , } , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -59967,16 +59740,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct HostConfiguration<_0> { pub max_code_size: ::core::primitive::u32, pub max_head_data_size: ::core::primitive::u32, @@ -60012,9 +59781,9 @@ pub mod api { pub pvf_voting_ttl: ::core::primitive::u32, pub minimum_validation_upgrade_delay: _0, pub minimum_backing_votes: ::core::primitive::u32, - pub node_features: ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub node_features: ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >, pub approval_voting_params: runtime_types::polkadot_primitives::v9::ApprovalVotingParams, @@ -60027,30 +59796,22 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { - # [codec (index = 1)] # [doc = "Request the configuration to be updated with the specified number of cores. Warning:"] # [doc = "Since this only schedules a configuration update, it takes two sessions to come into"] # [doc = "effect."] # [doc = ""] # [doc = "- `origin`: Root or the Coretime Chain"] # [doc = "- `count`: total number of cores"] request_core_count { count : :: core :: primitive :: u16 , } , # [codec (index = 2)] # [doc = "Request to claim the instantaneous coretime sales revenue starting from the block it was"] # [doc = "last claimed until and up to the block specified. The claimed amount value is sent back"] # [doc = "to the Coretime chain in a `notify_revenue` message. At the same time, the amount is"] # [doc = "teleported to the Coretime chain."] request_revenue_at { when : :: core :: primitive :: u32 , } , # [codec (index = 3)] credit_account { who : :: subxt :: ext :: subxt_core :: utils :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "Receive instructions from the `ExternalBrokerOrigin`, detailing how a specific core is"] # [doc = "to be used."] # [doc = ""] # [doc = "Parameters:"] # [doc = "-`origin`: The `ExternalBrokerOrigin`, assumed to be the coretime chain."] # [doc = "-`core`: The core that should be scheduled."] # [doc = "-`begin`: The starting blockheight of the instruction."] # [doc = "-`assignment`: How the blockspace should be utilised."] # [doc = "-`end_hint`: An optional hint as to when this particular set of instructions will end."] assign_core { core : :: core :: primitive :: u16 , begin : :: core :: primitive :: u32 , assignment : :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < (runtime_types :: pallet_broker :: coretime_interface :: CoreAssignment , runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: PartsOf57600 ,) > , end_hint : :: core :: option :: Option < :: core :: primitive :: u32 > , } , } + # [codec (index = 1)] # [doc = "Request the configuration to be updated with the specified number of cores. Warning:"] # [doc = "Since this only schedules a configuration update, it takes two sessions to come into"] # [doc = "effect."] # [doc = ""] # [doc = "- `origin`: Root or the Coretime Chain"] # [doc = "- `count`: total number of cores"] request_core_count { count : :: core :: primitive :: u16 , } , # [codec (index = 2)] # [doc = "Request to claim the instantaneous coretime sales revenue starting from the block it was"] # [doc = "last claimed until and up to the block specified. The claimed amount value is sent back"] # [doc = "to the Coretime chain in a `notify_revenue` message. At the same time, the amount is"] # [doc = "teleported to the Coretime chain."] request_revenue_at { when : :: core :: primitive :: u32 , } , # [codec (index = 3)] credit_account { who : :: subxt :: utils :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "Receive instructions from the `ExternalBrokerOrigin`, detailing how a specific core is"] # [doc = "to be used."] # [doc = ""] # [doc = "Parameters:"] # [doc = "-`origin`: The `ExternalBrokerOrigin`, assumed to be the coretime chain."] # [doc = "-`core`: The core that should be scheduled."] # [doc = "-`begin`: The starting blockheight of the instruction."] # [doc = "-`assignment`: How the blockspace should be utilised."] # [doc = "-`end_hint`: An optional hint as to when this particular set of instructions will end."] assign_core { core : :: core :: primitive :: u16 , begin : :: core :: primitive :: u32 , assignment : :: subxt :: alloc :: vec :: Vec < (runtime_types :: pallet_broker :: coretime_interface :: CoreAssignment , runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: PartsOf57600 ,) > , end_hint : :: core :: option :: Option < :: core :: primitive :: u32 > , } , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -60065,16 +59826,12 @@ pub mod api { AssetTransferFailed, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -60093,32 +59850,24 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] force_unfreeze, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -60150,16 +59899,12 @@ pub mod api { UnconfirmedDispute, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -60188,37 +59933,29 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] report_dispute_lost_unsigned { - dispute_proof: ::subxt::ext::subxt_core::alloc::boxed::Box< + dispute_proof: ::subxt::alloc::boxed::Box< runtime_types::polkadot_primitives::v9::slashing::DisputeProof, >, key_owner_proof: runtime_types::sp_session::MembershipProof, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -60244,16 +59981,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum DisputeLocation { #[codec(index = 0)] Local, @@ -60261,16 +59994,12 @@ pub mod api { Remote, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum DisputeResult { #[codec(index = 0)] Valid, @@ -60283,30 +60012,22 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { # [codec (index = 0)] # [doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] # [doc = "parameters."] # [doc = ""] # [doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] # [doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] # [doc = ""] # [doc = "These numbers are a subject to the relay-chain configuration limits."] # [doc = ""] # [doc = "The channel can be opened only after the recipient confirms it and only on a session"] # [doc = "change."] hrmp_init_open_channel { recipient : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , proposed_max_capacity : :: core :: primitive :: u32 , proposed_max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 1)] # [doc = "Accept a pending open channel request from the given sender."] # [doc = ""] # [doc = "The channel will be opened only on the next session boundary."] hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 2)] # [doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] # [doc = "recipient in the channel being closed."] # [doc = ""] # [doc = "The closure can only happen on a session change."] hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain_primitives :: primitives :: HrmpChannelId , } , # [codec (index = 3)] # [doc = "This extrinsic triggers the cleanup of all the HRMP storage items that a para may have."] # [doc = "Normally this happens once per session, but this allows you to trigger the cleanup"] # [doc = "immediately for a specific parachain."] # [doc = ""] # [doc = "Number of inbound and outbound channels for `para` must be provided as witness data."] # [doc = ""] # [doc = "Origin must be the `ChannelManager`."] force_clean_hrmp { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , num_inbound : :: core :: primitive :: u32 , num_outbound : :: core :: primitive :: u32 , } , # [codec (index = 4)] # [doc = "Force process HRMP open channel requests."] # [doc = ""] # [doc = "If there are pending HRMP open channel requests, you can use this function to process"] # [doc = "all of those requests immediately."] # [doc = ""] # [doc = "Total number of opening channels must be provided as witness data."] # [doc = ""] # [doc = "Origin must be the `ChannelManager`."] force_process_hrmp_open { channels : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Force process HRMP close channel requests."] # [doc = ""] # [doc = "If there are pending HRMP close channel requests, you can use this function to process"] # [doc = "all of those requests immediately."] # [doc = ""] # [doc = "Total number of closing channels must be provided as witness data."] # [doc = ""] # [doc = "Origin must be the `ChannelManager`."] force_process_hrmp_close { channels : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] # [doc = "or the recipient for that request. The origin must be either of those."] # [doc = ""] # [doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] # [doc = "already accepted."] # [doc = ""] # [doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] # [doc = "witness data."] hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain_primitives :: primitives :: HrmpChannelId , open_requests : :: core :: primitive :: u32 , } , # [codec (index = 7)] # [doc = "Open a channel from a `sender` to a `recipient` `ParaId`. Although opened by governance,"] # [doc = "the `max_capacity` and `max_message_size` are still subject to the Relay Chain's"] # [doc = "configured limits."] # [doc = ""] # [doc = "Expected use is when one (and only one) of the `ParaId`s involved in the channel is"] # [doc = "governed by the system, e.g. a system parachain."] # [doc = ""] # [doc = "Origin must be the `ChannelManager`."] force_open_hrmp_channel { sender : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , recipient : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , max_capacity : :: core :: primitive :: u32 , max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 8)] # [doc = "Establish an HRMP channel between two system chains. If the channel does not already"] # [doc = "exist, the transaction fees will be refunded to the caller. The system does not take"] # [doc = "deposits for channels between system chains, and automatically sets the message number"] # [doc = "and size limits to the maximum allowed by the network's configuration."] # [doc = ""] # [doc = "Arguments:"] # [doc = ""] # [doc = "- `sender`: A system chain, `ParaId`."] # [doc = "- `recipient`: A system chain, `ParaId`."] # [doc = ""] # [doc = "Any signed origin can call this function, but _both_ inputs MUST be system chains. If"] # [doc = "the channel does not exist yet, there is no fee."] establish_system_channel { sender : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , recipient : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 9)] # [doc = "Update the deposits held for an HRMP channel to the latest `Configuration`. Channels"] # [doc = "with system chains do not require a deposit."] # [doc = ""] # [doc = "Arguments:"] # [doc = ""] # [doc = "- `sender`: A chain, `ParaId`."] # [doc = "- `recipient`: A chain, `ParaId`."] # [doc = ""] # [doc = "Any signed origin can call this function."] poke_channel_deposits { sender : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , recipient : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 10)] # [doc = "Establish a bidirectional HRMP channel between a parachain and a system chain."] # [doc = ""] # [doc = "Arguments:"] # [doc = ""] # [doc = "- `target_system_chain`: A system chain, `ParaId`."] # [doc = ""] # [doc = "The origin needs to be the parachain origin."] establish_channel_with_system { target_system_chain : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -60371,52 +60092,40 @@ pub mod api { ChannelCreationNotAuthorized, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { # [codec (index = 0)] # [doc = "Open HRMP channel requested."] OpenChannelRequested { sender : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , recipient : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , proposed_max_capacity : :: core :: primitive :: u32 , proposed_max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 1)] # [doc = "An HRMP channel request sent by the receiver was canceled by either party."] OpenChannelCanceled { by_parachain : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , channel_id : runtime_types :: polkadot_parachain_primitives :: primitives :: HrmpChannelId , } , # [codec (index = 2)] # [doc = "Open HRMP channel accepted."] OpenChannelAccepted { sender : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , recipient : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 3)] # [doc = "HRMP channel closed."] ChannelClosed { by_parachain : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , channel_id : runtime_types :: polkadot_parachain_primitives :: primitives :: HrmpChannelId , } , # [codec (index = 4)] # [doc = "An HRMP channel was opened via Root origin."] HrmpChannelForceOpened { sender : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , recipient : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , proposed_max_capacity : :: core :: primitive :: u32 , proposed_max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "An HRMP channel was opened with a system chain."] HrmpSystemChannelOpened { sender : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , recipient : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , proposed_max_capacity : :: core :: primitive :: u32 , proposed_max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "An HRMP channel's deposits were updated."] OpenChannelDepositsUpdated { sender : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , recipient : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct HrmpChannel { pub max_capacity: ::core::primitive::u32, pub max_total_size: ::core::primitive::u32, pub max_message_size: ::core::primitive::u32, pub msg_count: ::core::primitive::u32, pub total_size: ::core::primitive::u32, - pub mqc_head: ::core::option::Option<::subxt::ext::subxt_core::utils::H256>, + pub mqc_head: ::core::option::Option<::subxt::utils::H256>, pub sender_deposit: ::core::primitive::u128, pub recipient_deposit: ::core::primitive::u128, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct HrmpOpenChannelRequest { pub confirmed: ::core::primitive::bool, pub _age: ::core::primitive::u32, @@ -60431,29 +60140,21 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call {} #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -60512,23 +60213,19 @@ pub mod api { ParaHeadMismatch, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "A candidate was backed. `[candidate, head_data]`"] CandidateBacked( runtime_types::polkadot_primitives::v9::CandidateReceiptV2< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >, runtime_types::polkadot_parachain_primitives::primitives::HeadData, runtime_types::polkadot_primitives::v9::CoreIndex, @@ -60538,7 +60235,7 @@ pub mod api { #[doc = "A candidate was included. `[candidate, head_data]`"] CandidateIncluded( runtime_types::polkadot_primitives::v9::CandidateReceiptV2< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >, runtime_types::polkadot_parachain_primitives::primitives::HeadData, runtime_types::polkadot_primitives::v9::CoreIndex, @@ -60548,7 +60245,7 @@ pub mod api { #[doc = "A candidate timed out. `[candidate, head_data]`"] CandidateTimedOut( runtime_types::polkadot_primitives::v9::CandidateReceiptV2< - ::subxt::ext::subxt_core::utils::H256, + ::subxt::utils::H256, >, runtime_types::polkadot_parachain_primitives::primitives::HeadData, runtime_types::polkadot_primitives::v9::CoreIndex, @@ -60562,31 +60259,23 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AggregateMessageOrigin { #[codec(index = 0)] Ump(runtime_types::polkadot_runtime_parachains::inclusion::UmpQueueId), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CandidatePendingAvailability<_0, _1> { pub core: runtime_types::polkadot_primitives::v9::CoreIndex, pub hash: runtime_types::polkadot_core_primitives::CandidateHash, @@ -60594,29 +60283,25 @@ pub mod api { runtime_types::polkadot_primitives::v9::CandidateDescriptorV2<_0>, pub commitments: runtime_types::polkadot_primitives::v9::CandidateCommitments<_1>, - pub availability_votes: ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub availability_votes: ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >, - pub backers: ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub backers: ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >, pub relay_parent_number: _1, pub backed_in_number: _1, pub backing_group: runtime_types::polkadot_primitives::v9::GroupIndex, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum UmpQueueId { #[codec(index = 0)] Para(runtime_types::polkadot_parachain_primitives::primitives::Id), @@ -60627,16 +60312,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -60647,21 +60328,17 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BufferedSessionChange { - pub validators: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub validators: ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::validator_app::Public, >, - pub queued: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub queued: ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::validator_app::Public, >, pub session_index: ::core::primitive::u32, @@ -60672,16 +60349,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -60748,16 +60421,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -60772,16 +60441,12 @@ pub mod api { InsufficientCredits, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] @@ -60789,7 +60454,7 @@ pub mod api { OnDemandOrderPlaced { para_id: runtime_types::polkadot_parachain_primitives::primitives::Id, spot_price: ::core::primitive::u128, - ordered_by: ::subxt::ext::subxt_core::utils::AccountId32, + ordered_by: ::subxt::utils::AccountId32, }, #[codec(index = 1)] #[doc = "The value of the spot price has likely changed"] @@ -60797,7 +60462,7 @@ pub mod api { #[codec(index = 2)] #[doc = "An account was given credits."] AccountCredited { - who: ::subxt::ext::subxt_core::utils::AccountId32, + who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, } @@ -60805,67 +60470,47 @@ pub mod api { pub mod types { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CoreAffinityCount { pub core_index: runtime_types::polkadot_primitives::v9::CoreIndex, pub count: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct EnqueuedOrder { pub para_id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , pub idx : runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: QueueIndex , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct QueueIndex(pub ::core::primitive::u32); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct QueueStatusType { pub traffic : runtime_types :: sp_arithmetic :: fixed_point :: FixedU128 , pub next_index : runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: QueueIndex , pub smallest_index : runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: QueueIndex , pub freed_indices : :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: ReverseQueueIndex > , } + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct QueueStatusType { pub traffic : runtime_types :: sp_arithmetic :: fixed_point :: FixedU128 , pub next_index : runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: QueueIndex , pub smallest_index : runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: QueueIndex , pub freed_indices : :: subxt :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: ReverseQueueIndex > , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ReverseQueueIndex(pub ::core::primitive::u32); } } @@ -60874,16 +60519,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Origin { #[codec(index = 0)] Parachain(runtime_types::polkadot_parachain_primitives::primitives::Id), @@ -60895,30 +60536,22 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { # [codec (index = 0)] # [doc = "Set the storage for the parachain validation code immediately."] force_set_current_code { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , new_code : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Set the storage for the current parachain head data immediately."] force_set_current_head { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , new_head : runtime_types :: polkadot_parachain_primitives :: primitives :: HeadData , } , # [codec (index = 2)] # [doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] force_schedule_code_upgrade { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , new_code : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode , relay_parent_number : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "Note a new block head for para within the context of the current block."] force_note_new_head { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , new_head : runtime_types :: polkadot_parachain_primitives :: primitives :: HeadData , } , # [codec (index = 4)] # [doc = "Put a parachain directly into the next session's action queue."] # [doc = "We can't queue it any sooner than this without going into the"] # [doc = "initializer..."] force_queue_action { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Adds the validation code to the storage."] # [doc = ""] # [doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] # [doc = "is running for that code, it will be instantly accepted."] # [doc = ""] # [doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] # [doc = "into storage with reference count 0. This is to account the fact that there are no users"] # [doc = "for this code yet. The caller will have to make sure that this code eventually gets"] # [doc = "used by some parachain or removed from the storage to avoid storage leaks. For the"] # [doc = "latter prefer to use the `poke_unused_validation_code` dispatchable to raw storage"] # [doc = "manipulation."] # [doc = ""] # [doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] # [doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] add_trusted_validation_code { validation_code : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode , } , # [codec (index = 6)] # [doc = "Remove the validation code from the storage iff the reference count is 0."] # [doc = ""] # [doc = "This is better than removing the storage directly, because it will not remove the code"] # [doc = "that was suddenly got used by some parachain while this dispatchable was pending"] # [doc = "dispatching."] poke_unused_validation_code { validation_code_hash : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , } , # [codec (index = 7)] # [doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] # [doc = "enacts the results if that was the last vote before achieving the supermajority."] include_pvf_check_statement { stmt : runtime_types :: polkadot_primitives :: v9 :: PvfCheckStatement , signature : runtime_types :: polkadot_primitives :: v9 :: validator_app :: Signature , } , # [codec (index = 8)] # [doc = "Set the storage for the current parachain head data immediately."] force_set_most_recent_context { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , context : :: core :: primitive :: u32 , } , # [codec (index = 9)] # [doc = "Remove an upgrade cooldown for a parachain."] # [doc = ""] # [doc = "The cost for removing the cooldown earlier depends on the time left for the cooldown"] # [doc = "multiplied by [`Config::CooldownRemovalMultiplier`]. The paid tokens are burned."] remove_upgrade_cooldown { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 10)] # [doc = "Sets the storage for the authorized current code hash of the parachain."] # [doc = "If not applied, it will be removed at the `System::block_number() + valid_period` block."] # [doc = ""] # [doc = "This can be useful, when triggering `Paras::force_set_current_code(para, code)`"] # [doc = "from a different chain than the one where the `Paras` pallet is deployed."] # [doc = ""] # [doc = "The main purpose is to avoid transferring the entire `code` Wasm blob between chains."] # [doc = "Instead, we authorize `code_hash` with `root`, which can later be applied by"] # [doc = "`Paras::apply_authorized_force_set_current_code(para, code)` by anyone."] # [doc = ""] # [doc = "Authorizations are stored in an **overwriting manner**."] authorize_force_set_current_code_hash { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , new_code_hash : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , valid_period : :: core :: primitive :: u32 , } , # [codec (index = 11)] # [doc = "Applies the already authorized current code for the parachain,"] # [doc = "triggering the same functionality as `force_set_current_code`."] apply_authorized_force_set_current_code { para : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , new_code : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode , } , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -60971,43 +60604,31 @@ pub mod api { InvalidBlockNumber, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { # [codec (index = 0)] # [doc = "Current code has been updated for a Para. `para_id`"] CurrentCodeUpdated (runtime_types :: polkadot_parachain_primitives :: primitives :: Id ,) , # [codec (index = 1)] # [doc = "Current head has been updated for a Para. `para_id`"] CurrentHeadUpdated (runtime_types :: polkadot_parachain_primitives :: primitives :: Id ,) , # [codec (index = 2)] # [doc = "A code upgrade has been scheduled for a Para. `para_id`"] CodeUpgradeScheduled (runtime_types :: polkadot_parachain_primitives :: primitives :: Id ,) , # [codec (index = 3)] # [doc = "A new head has been noted for a Para. `para_id`"] NewHeadNoted (runtime_types :: polkadot_parachain_primitives :: primitives :: Id ,) , # [codec (index = 4)] # [doc = "A para has been queued to execute pending actions. `para_id`"] ActionQueued (runtime_types :: polkadot_parachain_primitives :: primitives :: Id , :: core :: primitive :: u32 ,) , # [codec (index = 5)] # [doc = "The given para either initiated or subscribed to a PVF check for the given validation"] # [doc = "code. `code_hash` `para_id`"] PvfCheckStarted (runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain_primitives :: primitives :: Id ,) , # [codec (index = 6)] # [doc = "The given validation code was accepted by the PVF pre-checking vote."] # [doc = "`code_hash` `para_id`"] PvfCheckAccepted (runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain_primitives :: primitives :: Id ,) , # [codec (index = 7)] # [doc = "The given validation code was rejected by the PVF pre-checking vote."] # [doc = "`code_hash` `para_id`"] PvfCheckRejected (runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain_primitives :: primitives :: Id ,) , # [codec (index = 8)] # [doc = "The upgrade cooldown was removed."] UpgradeCooldownRemoved { para_id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , } , # [codec (index = 9)] # [doc = "A new code hash has been authorized for a Para."] CodeAuthorized { para_id : runtime_types :: polkadot_parachain_primitives :: primitives :: Id , code_hash : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , expire_at : :: core :: primitive :: u32 , } , } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AuthorizedCodeHashAndExpiry < _0 > { pub code_hash : runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash , pub expire_at : _0 , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ParaGenesisArgs { pub genesis_head: runtime_types::polkadot_parachain_primitives::primitives::HeadData, @@ -61016,16 +60637,12 @@ pub mod api { pub para_kind: ::core::primitive::bool, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ParaLifecycle { #[codec(index = 0)] Onboarding, @@ -61043,59 +60660,47 @@ pub mod api { OffboardingParachain, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ParaPastCodeMeta<_0> { - pub upgrade_times: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub upgrade_times: ::subxt::alloc::vec::Vec< runtime_types::polkadot_runtime_parachains::paras::ReplacementTimes<_0>, >, pub last_pruned: ::core::option::Option<_0>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PvfCheckActiveVoteState<_0> { - pub votes_accept: ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub votes_accept: ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >, - pub votes_reject: ::subxt::ext::subxt_core::utils::bits::DecodedBits< + pub votes_reject: ::subxt::utils::bits::DecodedBits< ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, + ::subxt::utils::bits::Lsb0, >, pub age: ::core::primitive::u32, pub created_at: _0, - pub causes: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub causes: ::subxt::alloc::vec::Vec< runtime_types::polkadot_runtime_parachains::paras::PvfCheckCause<_0>, >, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum PvfCheckCause<_0> { #[codec(index = 0)] Onboarding(runtime_types::polkadot_parachain_primitives::primitives::Id), @@ -61108,31 +60713,23 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ReplacementTimes<_0> { pub expected_at: _0, pub activated_at: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum UpgradeStrategy { #[codec(index = 0)] SetGoAheadSignal, @@ -61145,16 +60742,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -61168,16 +60761,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -61202,16 +60791,12 @@ pub mod api { pub mod common { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Assignment { #[codec(index = 0)] Pool { @@ -61228,55 +60813,43 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call {} } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AllowedRelayParentsTracker<_0, _1> { - pub buffer: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub buffer: ::subxt::alloc::vec::Vec< runtime_types::polkadot_runtime_parachains::shared::RelayParentInfo<_0>, >, pub latest_number: _1, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct RelayParentInfo<_0> { pub relay_parent: _0, pub state_root: _0, - pub claim_queue: ::subxt::ext::subxt_core::utils::KeyedVec< + pub claim_queue: ::subxt::utils::KeyedVec< runtime_types::polkadot_parachain_primitives::primitives::Id, - ::subxt::ext::subxt_core::utils::KeyedVec< + ::subxt::utils::KeyedVec< ::core::primitive::u8, - ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::alloc::vec::Vec< runtime_types::polkadot_primitives::v9::CoreIndex, >, >, @@ -61291,28 +60864,20 @@ pub mod api { pub mod nis { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct MinBid; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Parameters { #[codec(index = 0)] Target( @@ -61328,16 +60893,12 @@ pub mod api { ), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ParametersKey { #[codec(index = 0)] Target(runtime_types::rococo_runtime::dynamic_params::nis::Target), @@ -61345,16 +60906,12 @@ pub mod api { MinBid(runtime_types::rococo_runtime::dynamic_params::nis::MinBid), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ParametersValue { #[codec(index = 0)] Target(runtime_types::sp_arithmetic::per_things::Perquintill), @@ -61362,55 +60919,39 @@ pub mod api { MinBid(::core::primitive::u128), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Target; } pub mod preimage { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BaseDeposit; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ByteDeposit; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Parameters { #[codec(index = 0)] BaseDeposit( @@ -61424,16 +60965,12 @@ pub mod api { ), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ParametersKey { #[codec(index = 0)] BaseDeposit( @@ -61445,16 +60982,12 @@ pub mod api { ), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ParametersValue { #[codec(index = 0)] BaseDeposit(::core::primitive::u128), @@ -61470,16 +61003,12 @@ pub mod api { pub mod pallet_custom_origins { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Origin { #[codec(index = 0)] StakingAdmin, @@ -61544,16 +61073,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] @@ -61561,66 +61086,52 @@ pub mod api { #[doc = ""] #[doc = "The new validators will be active from current session + 2."] register_validators { - validators: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, + validators: ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, }, #[codec(index = 1)] #[doc = "Remove validators from the set."] #[doc = ""] #[doc = "The removed validators will be deactivated from current session + 2."] deregister_validators { - validators: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, + validators: ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] #[doc = "New validators were added to the set."] - ValidatorsRegistered( - ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - ), + ValidatorsRegistered(::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>), #[codec(index = 1)] #[doc = "Validators were removed from the set."] ValidatorsDeregistered( - ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, + ::subxt::alloc::vec::Vec<::subxt::utils::AccountId32>, ), } } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum OriginCaller { - # [codec (index = 0)] system (runtime_types :: frame_support :: dispatch :: RawOrigin < :: subxt :: ext :: subxt_core :: utils :: AccountId32 > ,) , # [codec (index = 43)] Origins (runtime_types :: rococo_runtime :: governance :: origins :: pallet_custom_origins :: Origin ,) , # [codec (index = 50)] ParachainsOrigin (runtime_types :: polkadot_runtime_parachains :: origin :: pallet :: Origin ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Origin ,) , } + # [codec (index = 0)] system (runtime_types :: frame_support :: dispatch :: RawOrigin < :: subxt :: utils :: AccountId32 > ,) , # [codec (index = 43)] Origins (runtime_types :: rococo_runtime :: governance :: origins :: pallet_custom_origins :: Origin ,) , # [codec (index = 50)] ParachainsOrigin (runtime_types :: polkadot_runtime_parachains :: origin :: pallet :: Origin ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Origin ,) , } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ProxyType { #[codec(index = 0)] Any, @@ -61640,20 +61151,20 @@ pub mod api { OnDemandOrdering, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Runtime; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum RuntimeCall { #[codec(index = 0)] System(runtime_types::frame_system::pallet::Call), @@ -61779,12 +61290,12 @@ pub mod api { Sudo(runtime_types::pallet_sudo::pallet::Call), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum RuntimeError { #[codec(index = 0)] System(runtime_types::frame_system::pallet::Error), @@ -61900,12 +61411,12 @@ pub mod api { Sudo(runtime_types::pallet_sudo::pallet::Error), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum RuntimeEvent { #[codec(index = 0)] System(runtime_types::frame_system::pallet::Event), @@ -62013,12 +61524,12 @@ pub mod api { Sudo(runtime_types::pallet_sudo::pallet::Event), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum RuntimeHoldReason { #[codec(index = 8)] Session(runtime_types::pallet_session::pallet::HoldReason), @@ -62032,12 +61543,12 @@ pub mod api { StateTrieMigration(runtime_types::pallet_state_trie_migration::pallet::HoldReason), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum RuntimeParameters { #[codec(index = 0)] Nis(runtime_types::rococo_runtime::dynamic_params::nis::Parameters), @@ -62045,12 +61556,12 @@ pub mod api { Preimage(runtime_types::rococo_runtime::dynamic_params::preimage::Parameters), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum RuntimeParametersKey { #[codec(index = 0)] Nis(runtime_types::rococo_runtime::dynamic_params::nis::ParametersKey), @@ -62058,12 +61569,12 @@ pub mod api { Preimage(runtime_types::rococo_runtime::dynamic_params::preimage::ParametersKey), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum RuntimeParametersValue { #[codec(index = 0)] Nis(runtime_types::rococo_runtime::dynamic_params::nis::ParametersValue), @@ -62071,12 +61582,12 @@ pub mod api { Preimage(runtime_types::rococo_runtime::dynamic_params::preimage::ParametersValue), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct SessionKeys { pub grandpa: runtime_types::sp_consensus_grandpa::app::Public, pub babe: runtime_types::sp_consensus_babe::app::Public, @@ -62091,76 +61602,56 @@ pub mod api { pub mod fixed_point { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct FixedI64(pub ::core::primitive::i64); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct FixedU128(pub ::core::primitive::u128); } pub mod per_things { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Perbill(pub ::core::primitive::u32); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Permill(pub ::core::primitive::u32); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Perquintill(pub ::core::primitive::u64); } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ArithmeticError { #[codec(index = 0)] Underflow, @@ -62175,16 +61666,12 @@ pub mod api { pub mod app { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Public(pub [::core::primitive::u8; 32usize]); } } @@ -62193,31 +61680,23 @@ pub mod api { pub mod app { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Public(pub [::core::primitive::u8; 32usize]); } pub mod digests { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum NextConfigDescriptor { #[codec(index = 1)] V1 { @@ -62226,16 +61705,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum PreDigest { #[codec(index = 1)] Primary(runtime_types::sp_consensus_babe::digests::PrimaryPreDigest), @@ -62247,47 +61722,35 @@ pub mod api { SecondaryVRF(runtime_types::sp_consensus_babe::digests::SecondaryVRFPreDigest), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PrimaryPreDigest { pub authority_index: ::core::primitive::u32, pub slot: runtime_types::sp_consensus_slots::Slot, pub vrf_signature: runtime_types::sp_core::sr25519::vrf::VrfSignature, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct SecondaryPlainPreDigest { pub authority_index: ::core::primitive::u32, pub slot: runtime_types::sp_consensus_slots::Slot, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct SecondaryVRFPreDigest { pub authority_index: ::core::primitive::u32, pub slot: runtime_types::sp_consensus_slots::Slot, @@ -62295,12 +61758,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AllowedSlots { #[codec(index = 0)] PrimarySlots, @@ -62310,17 +61773,17 @@ pub mod api { PrimaryAndSecondaryVRFSlots, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BabeConfiguration { pub slot_duration: ::core::primitive::u64, pub epoch_length: ::core::primitive::u64, pub c: (::core::primitive::u64, ::core::primitive::u64), - pub authorities: ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub authorities: ::subxt::alloc::vec::Vec<( runtime_types::sp_consensus_babe::app::Public, ::core::primitive::u64, )>, @@ -62328,28 +61791,28 @@ pub mod api { pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BabeEpochConfiguration { pub c: (::core::primitive::u64, ::core::primitive::u64), pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Epoch { pub epoch_index: ::core::primitive::u64, pub start_slot: runtime_types::sp_consensus_slots::Slot, pub duration: ::core::primitive::u64, - pub authorities: ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub authorities: ::subxt::alloc::vec::Vec<( runtime_types::sp_consensus_babe::app::Public, ::core::primitive::u64, )>, @@ -62357,31 +61820,25 @@ pub mod api { pub config: runtime_types::sp_consensus_babe::BabeEpochConfiguration, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct OpaqueKeyOwnershipProof( - pub ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct OpaqueKeyOwnershipProof(pub ::subxt::alloc::vec::Vec<::core::primitive::u8>); } pub mod sp_consensus_beefy { use super::runtime_types; pub mod commitment { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Commitment<_0> { pub payload: runtime_types::sp_consensus_beefy::payload::Payload, pub block_number: _0, @@ -62391,43 +61848,31 @@ pub mod api { pub mod ecdsa_crypto { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Public(pub [::core::primitive::u8; 33usize]); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Signature(pub [::core::primitive::u8; 65usize]); } pub mod mmr { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BeefyAuthoritySet<_0> { pub id: ::core::primitive::u64, pub len: ::core::primitive::u32, @@ -62437,41 +61882,37 @@ pub mod api { pub mod payload { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Payload( - pub ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub ::subxt::alloc::vec::Vec<( [::core::primitive::u8; 2usize], - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt::alloc::vec::Vec<::core::primitive::u8>, )>, ); } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct DoubleVotingProof<_0, _1, _2> { pub first: runtime_types::sp_consensus_beefy::VoteMessage<_0, _1, _2>, pub second: runtime_types::sp_consensus_beefy::VoteMessage<_0, _1, _2>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ForkVotingProof<_0, _1, _2> { pub vote: runtime_types::sp_consensus_beefy::VoteMessage< ::core::primitive::u32, @@ -62482,12 +61923,12 @@ pub mod api { pub header: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct FutureBlockVotingProof<_0, _1> { pub vote: runtime_types::sp_consensus_beefy::VoteMessage< _0, @@ -62496,23 +61937,23 @@ pub mod api { >, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ValidatorSet<_0> { - pub validators: ::subxt::ext::subxt_core::alloc::vec::Vec<_0>, + pub validators: ::subxt::alloc::vec::Vec<_0>, pub id: ::core::primitive::u64, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct VoteMessage<_0, _1, _2> { pub commitment: runtime_types::sp_consensus_beefy::commitment::Commitment<_0>, pub id: _1, @@ -62524,37 +61965,29 @@ pub mod api { pub mod app { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Public(pub [::core::primitive::u8; 32usize]); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Signature(pub [::core::primitive::u8; 64usize]); } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Equivocation<_0, _1> { #[codec(index = 0)] Prevote( @@ -62574,12 +62007,12 @@ pub mod api { ), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct EquivocationProof<_0, _1> { pub set_id: ::core::primitive::u64, pub equivocation: runtime_types::sp_consensus_grandpa::Equivocation<_0, _1>, @@ -62588,12 +62021,12 @@ pub mod api { pub mod sp_consensus_slots { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct EquivocationProof<_0, _1> { pub offender: _1, pub slot: runtime_types::sp_consensus_slots::Slot, @@ -62601,12 +62034,12 @@ pub mod api { pub second_header: _0, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Slot(pub ::core::primitive::u64); } pub mod sp_core { @@ -62614,16 +62047,12 @@ pub mod api { pub mod crypto { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct KeyTypeId(pub [::core::primitive::u8; 4usize]); } pub mod sr25519 { @@ -62631,16 +62060,12 @@ pub mod api { pub mod vrf { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct VrfSignature { pub pre_output: [::core::primitive::u8; 32usize], pub proof: [::core::primitive::u8; 64usize], @@ -62648,76 +62073,72 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct OpaqueMetadata( - pub ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct OpaqueMetadata(pub ::subxt::alloc::vec::Vec<::core::primitive::u8>); } pub mod sp_inherents { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CheckInherentsResult { pub okay: ::core::primitive::bool, pub fatal_error: ::core::primitive::bool, pub errors: runtime_types::sp_inherents::InherentData, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct InherentData { - pub data: ::subxt::ext::subxt_core::utils::KeyedVec< + pub data: ::subxt::utils::KeyedVec< [::core::primitive::u8; 8usize], - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt::alloc::vec::Vec<::core::primitive::u8>, >, } } pub mod sp_mmr_primitives { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AncestryProof<_0> { - pub prev_peaks: ::subxt::ext::subxt_core::alloc::vec::Vec<_0>, + pub prev_peaks: ::subxt::alloc::vec::Vec<_0>, pub prev_leaf_count: ::core::primitive::u64, pub leaf_count: ::core::primitive::u64, - pub items: ::subxt::ext::subxt_core::alloc::vec::Vec<(::core::primitive::u64, _0)>, + pub items: ::subxt::alloc::vec::Vec<(::core::primitive::u64, _0)>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct EncodableOpaqueLeaf( - pub ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct EncodableOpaqueLeaf(pub ::subxt::alloc::vec::Vec<::core::primitive::u8>); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Error { #[codec(index = 0)] InvalidNumericOp, @@ -62741,16 +62162,16 @@ pub mod api { InvalidBestKnownBlock, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct LeafProof<_0> { - pub leaf_indices: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u64>, + pub leaf_indices: ::subxt::alloc::vec::Vec<::core::primitive::u64>, pub leaf_count: ::core::primitive::u64, - pub items: ::subxt::ext::subxt_core::alloc::vec::Vec<_0>, + pub items: ::subxt::alloc::vec::Vec<_0>, } } pub mod sp_runtime { @@ -62760,21 +62181,16 @@ pub mod api { pub mod block { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct LazyBlock<_0, _1> { pub header: _0, - pub extrinsics: ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::sp_runtime::OpaqueExtrinsic, - >, + pub extrinsics: + ::subxt::alloc::vec::Vec, #[codec(skip)] pub __ignore: ::core::marker::PhantomData<_1>, } @@ -62782,50 +62198,42 @@ pub mod api { pub mod digest { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Digest { - pub logs: ::subxt::ext::subxt_core::alloc::vec::Vec< + pub logs: ::subxt::alloc::vec::Vec< runtime_types::sp_runtime::generic::digest::DigestItem, >, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum DigestItem { #[codec(index = 6)] PreRuntime( [::core::primitive::u8; 4usize], - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt::alloc::vec::Vec<::core::primitive::u8>, ), #[codec(index = 4)] Consensus( [::core::primitive::u8; 4usize], - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt::alloc::vec::Vec<::core::primitive::u8>, ), #[codec(index = 5)] Seal( [::core::primitive::u8; 4usize], - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt::alloc::vec::Vec<::core::primitive::u8>, ), #[codec(index = 0)] - Other(::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>), + Other(::subxt::alloc::vec::Vec<::core::primitive::u8>), #[codec(index = 8)] RuntimeEnvironmentUpdated, } @@ -62833,16 +62241,12 @@ pub mod api { pub mod era { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Era { #[codec(index = 0)] Immortal, @@ -63361,22 +62765,18 @@ pub mod api { pub mod header { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Header<_0> { - pub parent_hash: ::subxt::ext::subxt_core::utils::H256, + pub parent_hash: ::subxt::utils::H256, #[codec(compact)] pub number: _0, - pub state_root: ::subxt::ext::subxt_core::utils::H256, - pub extrinsics_root: ::subxt::ext::subxt_core::utils::H256, + pub state_root: ::subxt::utils::H256, + pub extrinsics_root: ::subxt::utils::H256, pub digest: runtime_types::sp_runtime::generic::digest::Digest, } } @@ -63384,16 +62784,12 @@ pub mod api { pub mod proving_trie { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum TrieError { #[codec(index = 0)] InvalidStateRoot, @@ -63428,31 +62824,23 @@ pub mod api { pub mod traits { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct BlakeTwo256; } pub mod transaction_validity { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum InvalidTransaction { #[codec(index = 0)] Call, @@ -63482,16 +62870,12 @@ pub mod api { UnknownOrigin, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum TransactionSource { #[codec(index = 0)] InBlock, @@ -63501,16 +62885,12 @@ pub mod api { External, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum TransactionValidityError { #[codec(index = 0)] Invalid(runtime_types::sp_runtime::transaction_validity::InvalidTransaction), @@ -63518,16 +62898,12 @@ pub mod api { Unknown(runtime_types::sp_runtime::transaction_validity::UnknownTransaction), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum UnknownTransaction { #[codec(index = 0)] CannotLookup, @@ -63537,35 +62913,29 @@ pub mod api { Custom(::core::primitive::u8), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ValidTransaction { pub priority: ::core::primitive::u64, - pub requires: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >, - pub provides: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >, + pub requires: + ::subxt::alloc::vec::Vec<::subxt::alloc::vec::Vec<::core::primitive::u8>>, + pub provides: + ::subxt::alloc::vec::Vec<::subxt::alloc::vec::Vec<::core::primitive::u8>>, pub longevity: ::core::primitive::u64, pub propagate: ::core::primitive::bool, } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum DispatchError { #[codec(index = 0)] Other, @@ -63599,23 +62969,23 @@ pub mod api { Trie(runtime_types::sp_runtime::proving_trie::TrieError), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct DispatchErrorWithPostInfo<_0> { pub post_info: _0, pub error: runtime_types::sp_runtime::DispatchError, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum ExtrinsicInclusionMode { #[codec(index = 0)] AllExtrinsics, @@ -63623,23 +62993,23 @@ pub mod api { OnlyInherents, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct ModuleError { pub index: ::core::primitive::u8, pub error: [::core::primitive::u8; 4usize], } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum MultiSignature { #[codec(index = 0)] Ed25519([::core::primitive::u8; 64usize]), @@ -63651,12 +63021,12 @@ pub mod api { Eth([::core::primitive::u8; 65usize]), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum MultiSigner { #[codec(index = 0)] Ed25519([::core::primitive::u8; 32usize]), @@ -63668,32 +63038,28 @@ pub mod api { Eth([::core::primitive::u8; 33usize]), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct OpaqueExtrinsic( - pub ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct OpaqueExtrinsic(pub ::subxt::alloc::vec::Vec<::core::primitive::u8>); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct OpaqueValue( - pub ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct OpaqueValue(pub ::subxt::alloc::vec::Vec<::core::primitive::u8>); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum TokenError { #[codec(index = 0)] FundsUnavailable, @@ -63717,12 +63083,12 @@ pub mod api { Blocked, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum TransactionalError { #[codec(index = 0)] LimitReached, @@ -63733,17 +63099,16 @@ pub mod api { pub mod sp_session { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct MembershipProof { pub session: ::core::primitive::u32, - pub trie_nodes: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >, + pub trie_nodes: + ::subxt::alloc::vec::Vec<::subxt::alloc::vec::Vec<::core::primitive::u8>>, pub validator_count: ::core::primitive::u32, } } @@ -63752,50 +63117,42 @@ pub mod api { pub mod offence { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct OffenceDetails<_0, _1> { pub offender: _1, - pub reporters: ::subxt::ext::subxt_core::alloc::vec::Vec<_0>, + pub reporters: ::subxt::alloc::vec::Vec<_0>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct OffenceSeverity(pub runtime_types::sp_arithmetic::per_things::Perbill); } } pub mod sp_version { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct RuntimeVersion { - pub spec_name: ::subxt::ext::subxt_core::alloc::string::String, - pub impl_name: ::subxt::ext::subxt_core::alloc::string::String, + pub spec_name: ::subxt::alloc::string::String, + pub impl_name: ::subxt::alloc::string::String, pub authoring_version: ::core::primitive::u32, pub spec_version: ::core::primitive::u32, pub impl_version: ::core::primitive::u32, - pub apis: ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub apis: ::subxt::alloc::vec::Vec<( [::core::primitive::u8; 8usize], ::core::primitive::u32, )>, @@ -63808,16 +63165,12 @@ pub mod api { pub mod weight_v2 { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Weight { #[codec(compact)] pub ref_time: ::core::primitive::u64, @@ -63826,12 +63179,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct RuntimeDbWeight { pub read: ::core::primitive::u64, pub write: ::core::primitive::u64, @@ -63844,16 +63197,12 @@ pub mod api { pub mod multilocation { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct MultiLocation { pub parents: ::core::primitive::u8, pub interior: runtime_types::xcm::v3::junctions::Junctions, @@ -63865,31 +63214,23 @@ pub mod api { pub mod asset { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Asset { pub id: runtime_types::staging_xcm::v4::asset::AssetId, pub fun: runtime_types::staging_xcm::v4::asset::Fungibility, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AssetFilter { #[codec(index = 0)] Definite(runtime_types::staging_xcm::v4::asset::Assets), @@ -63897,28 +63238,20 @@ pub mod api { Wild(runtime_types::staging_xcm::v4::asset::WildAsset), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AssetId(pub runtime_types::staging_xcm::v4::location::Location); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AssetInstance { #[codec(index = 0)] Undefined, @@ -63934,32 +63267,22 @@ pub mod api { Array32([::core::primitive::u8; 32usize]), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Assets( - pub ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::staging_xcm::v4::asset::Asset, - >, + pub ::subxt::alloc::vec::Vec, ); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Fungibility { #[codec(index = 0)] Fungible(#[codec(compact)] ::core::primitive::u128), @@ -63967,16 +63290,12 @@ pub mod api { NonFungible(runtime_types::staging_xcm::v4::asset::AssetInstance), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum WildAsset { #[codec(index = 0)] All, @@ -63996,16 +63315,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum WildFungibility { #[codec(index = 0)] Fungible, @@ -64016,16 +63331,12 @@ pub mod api { pub mod junction { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Junction { #[codec(index = 0)] Parachain(#[codec(compact)] ::core::primitive::u32), @@ -64071,16 +63382,12 @@ pub mod api { GlobalConsensus(runtime_types::staging_xcm::v4::junction::NetworkId), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum NetworkId { #[codec(index = 0)] ByGenesis([::core::primitive::u8; 32usize]), @@ -64115,16 +63422,12 @@ pub mod api { pub mod junctions { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Junctions { #[codec(index = 0)] Here, @@ -64149,32 +63452,24 @@ pub mod api { pub mod location { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Location { pub parents: ::core::primitive::u8, pub interior: runtime_types::staging_xcm::v4::junctions::Junctions, } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Instruction { #[codec(index = 0)] WithdrawAsset(runtime_types::staging_xcm::v4::asset::Assets), @@ -64319,17 +63614,15 @@ pub mod api { ExpectTransactStatus(runtime_types::xcm::v3::MaybeErrorCode), #[codec(index = 33)] QueryPallet { - module_name: - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + module_name: ::subxt::alloc::vec::Vec<::core::primitive::u8>, response_info: runtime_types::staging_xcm::v4::QueryResponseInfo, }, #[codec(index = 34)] ExpectPallet { #[codec(compact)] index: ::core::primitive::u32, - name: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - module_name: - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + name: ::subxt::alloc::vec::Vec<::core::primitive::u8>, + module_name: ::subxt::alloc::vec::Vec<::core::primitive::u8>, #[codec(compact)] crate_major: ::core::primitive::u32, #[codec(compact)] @@ -64386,16 +63679,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PalletInfo { #[codec(compact)] pub index: ::core::primitive::u32, @@ -64413,16 +63702,12 @@ pub mod api { pub patch: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct QueryResponseInfo { pub destination: runtime_types::staging_xcm::v4::location::Location, #[codec(compact)] @@ -64430,16 +63715,12 @@ pub mod api { pub max_weight: runtime_types::sp_weights::weight_v2::Weight, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Response { #[codec(index = 0)] Null, @@ -64464,20 +63745,14 @@ pub mod api { DispatchResult(runtime_types::xcm::v3::MaybeErrorCode), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Xcm( - pub ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::staging_xcm::v4::Instruction, - >, + pub ::subxt::alloc::vec::Vec, ); } pub mod v5 { @@ -64485,31 +63760,23 @@ pub mod api { pub mod asset { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Asset { pub id: runtime_types::staging_xcm::v5::asset::AssetId, pub fun: runtime_types::staging_xcm::v5::asset::Fungibility, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AssetFilter { #[codec(index = 0)] Definite(runtime_types::staging_xcm::v5::asset::Assets), @@ -64517,28 +63784,20 @@ pub mod api { Wild(runtime_types::staging_xcm::v5::asset::WildAsset), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct AssetId(pub runtime_types::staging_xcm::v5::location::Location); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AssetInstance { #[codec(index = 0)] Undefined, @@ -64554,16 +63813,12 @@ pub mod api { Array32([::core::primitive::u8; 32usize]), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AssetTransferFilter { #[codec(index = 0)] Teleport(runtime_types::staging_xcm::v5::asset::AssetFilter), @@ -64573,32 +63828,22 @@ pub mod api { ReserveWithdraw(runtime_types::staging_xcm::v5::asset::AssetFilter), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Assets( - pub ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::staging_xcm::v5::asset::Asset, - >, + pub ::subxt::alloc::vec::Vec, ); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Fungibility { #[codec(index = 0)] Fungible(#[codec(compact)] ::core::primitive::u128), @@ -64606,16 +63851,12 @@ pub mod api { NonFungible(runtime_types::staging_xcm::v5::asset::AssetInstance), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum WildAsset { #[codec(index = 0)] All, @@ -64635,16 +63876,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum WildFungibility { #[codec(index = 0)] Fungible, @@ -64655,16 +63892,12 @@ pub mod api { pub mod junction { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Junction { #[codec(index = 0)] Parachain(#[codec(compact)] ::core::primitive::u32), @@ -64710,16 +63943,12 @@ pub mod api { GlobalConsensus(runtime_types::staging_xcm::v5::junction::NetworkId), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum NetworkId { #[codec(index = 0)] ByGenesis([::core::primitive::u8; 32usize]), @@ -64748,16 +63977,12 @@ pub mod api { pub mod junctions { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Junctions { #[codec(index = 0)] Here, @@ -64782,16 +64007,12 @@ pub mod api { pub mod location { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Location { pub parents: ::core::primitive::u8, pub interior: runtime_types::staging_xcm::v5::junctions::Junctions, @@ -64800,31 +64021,23 @@ pub mod api { pub mod traits { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct InstructionError { pub index: ::core::primitive::u8, pub error: runtime_types::xcm::v5::traits::Error, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Outcome { #[codec(index = 0)] Complete { @@ -64840,16 +64053,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Hint { #[codec(index = 0)] AssetClaimer { @@ -64857,16 +64066,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Instruction { #[codec(index = 0)] WithdrawAsset(runtime_types::staging_xcm::v5::asset::Assets), @@ -65012,17 +64217,15 @@ pub mod api { ExpectTransactStatus(runtime_types::xcm::v3::MaybeErrorCode), #[codec(index = 33)] QueryPallet { - module_name: - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + module_name: ::subxt::alloc::vec::Vec<::core::primitive::u8>, response_info: runtime_types::staging_xcm::v5::QueryResponseInfo, }, #[codec(index = 34)] ExpectPallet { #[codec(compact)] index: ::core::primitive::u32, - name: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - module_name: - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + name: ::subxt::alloc::vec::Vec<::core::primitive::u8>, + module_name: ::subxt::alloc::vec::Vec<::core::primitive::u8>, #[codec(compact)] crate_major: ::core::primitive::u32, #[codec(compact)] @@ -65108,16 +64311,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PalletInfo { #[codec(compact)] pub index: ::core::primitive::u32, @@ -65135,16 +64334,12 @@ pub mod api { pub patch: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct QueryResponseInfo { pub destination: runtime_types::staging_xcm::v5::location::Location, #[codec(compact)] @@ -65152,16 +64347,12 @@ pub mod api { pub max_weight: runtime_types::sp_weights::weight_v2::Weight, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Response { #[codec(index = 0)] Null, @@ -65186,20 +64377,14 @@ pub mod api { DispatchResult(runtime_types::xcm::v3::MaybeErrorCode), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct Xcm( - pub ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::staging_xcm::v5::Instruction, - >, + pub ::subxt::alloc::vec::Vec, ); } } @@ -65210,16 +64395,12 @@ pub mod api { pub mod asset_transfer { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum TransferType { #[codec(index = 0)] Teleport, @@ -65238,18 +64419,14 @@ pub mod api { pub mod double_encoded { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct DoubleEncoded { - pub encoded: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub encoded: ::subxt::alloc::vec::Vec<::core::primitive::u8>, } } pub mod v3 { @@ -65257,16 +64434,12 @@ pub mod api { pub mod junction { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum BodyId { #[codec(index = 0)] Unit, @@ -65290,16 +64463,12 @@ pub mod api { Treasury, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum BodyPart { #[codec(index = 0)] Voice, @@ -65331,16 +64500,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Junction { #[codec(index = 0)] Parachain(#[codec(compact)] ::core::primitive::u32), @@ -65383,16 +64548,12 @@ pub mod api { GlobalConsensus(runtime_types::xcm::v3::junction::NetworkId), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum NetworkId { #[codec(index = 0)] ByGenesis([::core::primitive::u8; 32usize]), @@ -65427,16 +64588,12 @@ pub mod api { pub mod junctions { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Junctions { #[codec(index = 0)] Here, @@ -65503,16 +64660,12 @@ pub mod api { pub mod multiasset { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AssetId { #[codec(index = 0)] Concrete(runtime_types::staging_xcm::v3::multilocation::MultiLocation), @@ -65520,16 +64673,12 @@ pub mod api { Abstract([::core::primitive::u8; 32usize]), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AssetInstance { #[codec(index = 0)] Undefined, @@ -65545,16 +64694,12 @@ pub mod api { Array32([::core::primitive::u8; 32usize]), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Fungibility { #[codec(index = 0)] Fungible(#[codec(compact)] ::core::primitive::u128), @@ -65562,31 +64707,23 @@ pub mod api { NonFungible(runtime_types::xcm::v3::multiasset::AssetInstance), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct MultiAsset { pub id: runtime_types::xcm::v3::multiasset::AssetId, pub fun: runtime_types::xcm::v3::multiasset::Fungibility, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum MultiAssetFilter { #[codec(index = 0)] Definite(runtime_types::xcm::v3::multiasset::MultiAssets), @@ -65594,32 +64731,22 @@ pub mod api { Wild(runtime_types::xcm::v3::multiasset::WildMultiAsset), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct MultiAssets( - pub ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::xcm::v3::multiasset::MultiAsset, - >, + pub ::subxt::alloc::vec::Vec, ); #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum WildFungibility { #[codec(index = 0)] Fungible, @@ -65627,16 +64754,12 @@ pub mod api { NonFungible, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum WildMultiAsset { #[codec(index = 0)] All, @@ -65659,16 +64782,12 @@ pub mod api { pub mod traits { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Error { #[codec(index = 0)] Overflow, @@ -65752,16 +64871,12 @@ pub mod api { ExceedsStackLimit, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum SendError { #[codec(index = 0)] NotApplicable, @@ -65780,16 +64895,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Instruction { #[codec(index = 0)] WithdrawAsset(runtime_types::xcm::v3::multiasset::MultiAssets), @@ -65936,17 +65047,15 @@ pub mod api { ExpectTransactStatus(runtime_types::xcm::v3::MaybeErrorCode), #[codec(index = 33)] QueryPallet { - module_name: - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + module_name: ::subxt::alloc::vec::Vec<::core::primitive::u8>, response_info: runtime_types::xcm::v3::QueryResponseInfo, }, #[codec(index = 34)] ExpectPallet { #[codec(compact)] index: ::core::primitive::u32, - name: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - module_name: - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + name: ::subxt::alloc::vec::Vec<::core::primitive::u8>, + module_name: ::subxt::alloc::vec::Vec<::core::primitive::u8>, #[codec(compact)] crate_major: ::core::primitive::u32, #[codec(compact)] @@ -66003,16 +65112,12 @@ pub mod api { }, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum MaybeErrorCode { #[codec(index = 0)] Success, @@ -66030,16 +65135,12 @@ pub mod api { ), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum OriginKind { #[codec(index = 0)] Native, @@ -66051,16 +65152,12 @@ pub mod api { Xcm, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct PalletInfo { #[codec(compact)] pub index: ::core::primitive::u32, @@ -66078,16 +65175,12 @@ pub mod api { pub patch: ::core::primitive::u32, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct QueryResponseInfo { pub destination: runtime_types::staging_xcm::v3::multilocation::MultiLocation, #[codec(compact)] @@ -66095,16 +65188,12 @@ pub mod api { pub max_weight: runtime_types::sp_weights::weight_v2::Weight, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Response { #[codec(index = 0)] Null, @@ -66129,16 +65218,12 @@ pub mod api { DispatchResult(runtime_types::xcm::v3::MaybeErrorCode), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum WeightLimit { #[codec(index = 0)] Unlimited, @@ -66146,37 +65231,25 @@ pub mod api { Limited(runtime_types::sp_weights::weight_v2::Weight), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Xcm( - pub ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::xcm::v3::Instruction, - >, - ); + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct Xcm(pub ::subxt::alloc::vec::Vec); } pub mod v5 { use super::runtime_types; pub mod traits { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Error { #[codec(index = 0)] Overflow, @@ -66264,12 +65337,12 @@ pub mod api { } } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum VersionedAsset { #[codec(index = 3)] V3(runtime_types::xcm::v3::multiasset::MultiAsset), @@ -66279,12 +65352,12 @@ pub mod api { V5(runtime_types::staging_xcm::v5::asset::Asset), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum VersionedAssetId { #[codec(index = 3)] V3(runtime_types::xcm::v3::multiasset::AssetId), @@ -66294,12 +65367,12 @@ pub mod api { V5(runtime_types::staging_xcm::v5::asset::AssetId), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum VersionedAssets { #[codec(index = 3)] V3(runtime_types::xcm::v3::multiasset::MultiAssets), @@ -66309,12 +65382,12 @@ pub mod api { V5(runtime_types::staging_xcm::v5::asset::Assets), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum VersionedLocation { #[codec(index = 3)] V3(runtime_types::staging_xcm::v3::multilocation::MultiLocation), @@ -66324,12 +65397,12 @@ pub mod api { V5(runtime_types::staging_xcm::v5::location::Location), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum VersionedResponse { #[codec(index = 3)] V3(runtime_types::xcm::v3::Response), @@ -66339,12 +65412,12 @@ pub mod api { V5(runtime_types::staging_xcm::v5::Response), } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum VersionedXcm { #[codec(index = 3)] V3(runtime_types::xcm::v3::Xcm), @@ -66359,16 +65432,12 @@ pub mod api { pub mod authorized_aliases { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct OriginAliaser { pub location: runtime_types::xcm::VersionedLocation, pub expiry: ::core::option::Option<::core::primitive::u64>, @@ -66377,16 +65446,12 @@ pub mod api { pub mod conversions { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Error { #[codec(index = 0)] Unsupported, @@ -66397,16 +65462,12 @@ pub mod api { pub mod dry_run { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct CallDryRunEffects<_0> { pub execution_result: ::core::result::Result< runtime_types::frame_support::dispatch::PostDispatchInfo, @@ -66414,24 +65475,20 @@ pub mod api { runtime_types::frame_support::dispatch::PostDispatchInfo, >, >, - pub emitted_events: ::subxt::ext::subxt_core::alloc::vec::Vec<_0>, + pub emitted_events: ::subxt::alloc::vec::Vec<_0>, pub local_xcm: ::core::option::Option, - pub forwarded_xcms: ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub forwarded_xcms: ::subxt::alloc::vec::Vec<( runtime_types::xcm::VersionedLocation, - ::subxt::ext::subxt_core::alloc::vec::Vec, + ::subxt::alloc::vec::Vec, )>, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Error { #[codec(index = 0)] Unimplemented, @@ -66439,38 +65496,30 @@ pub mod api { VersionedConversionFailed, } #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct XcmDryRunEffects<_0> { pub execution_result: runtime_types::staging_xcm::v5::traits::Outcome, - pub emitted_events: ::subxt::ext::subxt_core::alloc::vec::Vec<_0>, - pub forwarded_xcms: ::subxt::ext::subxt_core::alloc::vec::Vec<( + pub emitted_events: ::subxt::alloc::vec::Vec<_0>, + pub forwarded_xcms: ::subxt::alloc::vec::Vec<( runtime_types::xcm::VersionedLocation, - ::subxt::ext::subxt_core::alloc::vec::Vec, + ::subxt::alloc::vec::Vec, )>, } } pub mod fees { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Error { #[codec(index = 0)] Unimplemented, @@ -66489,16 +65538,12 @@ pub mod api { pub mod trusted_query { use super::runtime_types; #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, Debug, )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum Error { #[codec(index = 0)] VersionedAssetConversionFailed, diff --git a/testing/integration-tests/src/lib.rs b/testing/integration-tests/src/lib.rs index a27fb8f44b5..c58513ecf75 100644 --- a/testing/integration-tests/src/lib.rs +++ b/testing/integration-tests/src/lib.rs @@ -2,10 +2,8 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -#[cfg(all(feature = "unstable-light-client", feature = "chainhead-backend"))] -compile_error!( - "The features 'unstable-light-client' and 'chainhead-backend' cannot be used together" -); +#[cfg(all(feature = "light-client", feature = "chainhead-backend"))] +compile_error!("The features 'light-client' and 'chainhead-backend' cannot be used together"); #[cfg(test)] pub mod utils; @@ -15,12 +13,12 @@ pub mod utils; use utils::*; #[cfg(any( - all(test, not(feature = "unstable-light-client")), - all(test, feature = "unstable-light-client-long-running") + all(test, not(feature = "light-client")), + all(test, feature = "light-client-long-running") ))] mod full_client; -#[cfg(all(test, feature = "unstable-light-client"))] +#[cfg(all(test, feature = "light-client"))] mod light_client; #[cfg(test)] diff --git a/testing/wasm-lightclient-tests/Cargo.toml b/testing/wasm-lightclient-tests/Cargo.toml index e79ec54ba08..538563a0c32 100644 --- a/testing/wasm-lightclient-tests/Cargo.toml +++ b/testing/wasm-lightclient-tests/Cargo.toml @@ -13,6 +13,6 @@ serde_json = "1" futures-util = "0.3.30" # This crate is not a part of the workspace, because it -# requires the "jsonrpsee web unstable-light-client" features to be enabled, which we don't +# requires the "jsonrpsee web light-client" features to be enabled, which we don't # want enabled for workspace builds in general. -subxt = { path = "../../subxt", default-features = false, features = ["web", "jsonrpsee", "unstable-light-client"] } +subxt = { path = "../../subxt", default-features = false, features = ["web", "jsonrpsee", "light-client"] } diff --git a/utils/accountid32/Cargo.toml b/utils/accountid32/Cargo.toml new file mode 100644 index 00000000000..85c897bb971 --- /dev/null +++ b/utils/accountid32/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "subxt-utils-accountid32" +version.workspace = true +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +publish = true +autotests = false + +license.workspace = true +repository.workspace = true +documentation.workspace = true +homepage.workspace = true +description = "Subxt's AccountId32 representation" + +[dependencies] +codec = { workspace = true } +serde = { workspace = true, features = ["alloc"] } +thiserror = { workspace = true } +base58 = { workspace = true } +scale-encode = { workspace = true, features = ["default"] } +scale-decode = { workspace = true, features = ["default"] } +scale-info = { workspace = true, features = ["derive"] } +blake2 = { workspace = true } + +[dev-dependencies] +sp-core = { workspace = true } +sp-keyring = { workspace = true } + +[lints] +workspace = true \ No newline at end of file diff --git a/core/src/utils/account_id.rs b/utils/accountid32/src/lib.rs similarity index 91% rename from core/src/utils/account_id.rs rename to utils/accountid32/src/lib.rs index 8088a3354f0..56f8af76510 100644 --- a/core/src/utils/account_id.rs +++ b/utils/accountid32/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. +// Copyright 2019-2025 Parity Technologies (UK) Ltd. // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. @@ -6,6 +6,10 @@ //! This doesn't contain much functionality itself, but is easy to convert to/from an `sp_core::AccountId32` //! for instance, to gain functionality without forcing a dependency on Substrate crates here. +#![no_std] + +extern crate alloc; + use alloc::format; use alloc::string::String; use alloc::vec; @@ -19,6 +23,7 @@ use thiserror::Error as DeriveError; /// that type. #[derive( Clone, + Copy, Eq, PartialEq, Ord, @@ -53,7 +58,7 @@ impl From<[u8; 32]> for AccountId32 { impl AccountId32 { // Return the ss58-check string for this key. Adapted from `sp_core::crypto`. We need this to // serialize our account appropriately but otherwise don't care. - fn to_ss58check(&self) -> String { + fn ss58(&self) -> String { // For serializing to a string to obtain the account nonce, we use the default substrate // prefix (since we have no way to otherwise pick one). It doesn't really matter, since when // it's deserialized back in system_accountNextIndex, we ignore this (so long as it's valid). @@ -73,7 +78,7 @@ impl AccountId32 { // This isn't strictly needed, but to give our AccountId32 a little more usefulness, we also // implement the logic needed to decode an AccountId32 from an SS58 encoded string. This is exposed // via a `FromStr` impl. - fn from_ss58check(s: &str) -> Result { + fn from_ss58(s: &str) -> Result { const CHECKSUM_LEN: usize = 2; let body_len = 32; @@ -118,7 +123,7 @@ pub enum FromSs58Error { InvalidPrefix, } -// We do this just to get a checksum to help verify the validity of the address in to_ss58check +// We do this just to get a checksum to help verify the validity of the address in ss58 fn ss58hash(data: &[u8]) -> Vec { use blake2::{Blake2b512, Digest}; const PREFIX: &[u8] = b"SS58PRE"; @@ -133,7 +138,7 @@ impl Serialize for AccountId32 { where S: serde::Serializer, { - serializer.serialize_str(&self.to_ss58check()) + serializer.serialize_str(&self.ss58()) } } @@ -142,21 +147,21 @@ impl<'de> Deserialize<'de> for AccountId32 { where D: serde::Deserializer<'de>, { - AccountId32::from_ss58check(&String::deserialize(deserializer)?) + AccountId32::from_ss58(&String::deserialize(deserializer)?) .map_err(|e| serde::de::Error::custom(format!("{e:?}"))) } } impl core::fmt::Display for AccountId32 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "{}", self.to_ss58check()) + write!(f, "{}", self.ss58()) } } impl core::str::FromStr for AccountId32 { type Err = FromSs58Error; fn from_str(s: &str) -> Result { - AccountId32::from_ss58check(s) + AccountId32::from_ss58(s) } } @@ -176,7 +181,7 @@ mod test { // Both should encode to ss58 the same way: let substrate_ss58 = substrate_account.to_ss58check(); - assert_eq!(substrate_ss58, local_account.to_ss58check()); + assert_eq!(substrate_ss58, local_account.ss58()); // Both should decode from ss58 back to the same: assert_eq!( @@ -184,7 +189,7 @@ mod test { substrate_account ); assert_eq!( - AccountId32::from_ss58check(&substrate_ss58).unwrap(), + AccountId32::from_ss58(&substrate_ss58).unwrap(), local_account ); } diff --git a/utils/fetch-metadata/Cargo.toml b/utils/fetch-metadata/Cargo.toml index 1fcf7613438..5b61393d4ed 100644 --- a/utils/fetch-metadata/Cargo.toml +++ b/utils/fetch-metadata/Cargo.toml @@ -29,7 +29,6 @@ frame-metadata = { workspace = true, optional = true, features = ["std"] } [package.metadata.docs.rs] features = ["url"] -rustdoc-args = ["--cfg", "docsrs"] [package.metadata.playground] default-features = true diff --git a/utils/fetch-metadata/src/lib.rs b/utils/fetch-metadata/src/lib.rs index 779aceb7250..8ed79187a3d 100644 --- a/utils/fetch-metadata/src/lib.rs +++ b/utils/fetch-metadata/src/lib.rs @@ -4,17 +4,12 @@ //! Subxt utils fetch metadata. -#![cfg_attr(docsrs, feature(doc_cfg))] - -// Internal helper macros -#[macro_use] -mod macros; mod error; -cfg_fetch_from_url! { - mod url; - pub use url::{from_url, from_url_blocking, MetadataVersion, Url}; -} +#[cfg(feature = "url")] +mod url; +#[cfg(feature = "url")] +pub use url::{MetadataVersion, Url, from_url, from_url_blocking}; pub use error::Error; diff --git a/utils/fetch-metadata/src/macros.rs b/utils/fetch-metadata/src/macros.rs deleted file mode 100644 index 4274331afa4..00000000000 --- a/utils/fetch-metadata/src/macros.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -macro_rules! cfg_feature { - ($feature:literal, $($item:item)*) => { - $( - #[cfg(feature = $feature)] - #[cfg_attr(docsrs, doc(cfg(feature = $feature)))] - $item - )* - } -} - -macro_rules! cfg_fetch_from_url { - ($($item:item)*) => { - crate::macros::cfg_feature!("url", $($item)*); - }; -} - -#[allow(unused)] -pub(crate) use {cfg_feature, cfg_fetch_from_url}; diff --git a/utils/fetch-metadata/src/url.rs b/utils/fetch-metadata/src/url.rs index cb8c855a0d4..a06f6469d03 100644 --- a/utils/fetch-metadata/src/url.rs +++ b/utils/fetch-metadata/src/url.rs @@ -5,7 +5,7 @@ //! Fetch metadata from a URL. use crate::Error; -use codec::{Decode, Encode}; +use codec::{Decode, Encode}; use jsonrpsee::{ core::client::ClientT, http_client::HttpClientBuilder, rpc_params, ws_client::WsClientBuilder, }; @@ -44,7 +44,11 @@ impl std::str::FromStr for MetadataVersion { } /// Returns the metadata bytes from the provided URL. -pub async fn from_url(url: Url, version: MetadataVersion, at_block_hash: Option<&str>) -> Result, Error> { +pub async fn from_url( + url: Url, + version: MetadataVersion, + at_block_hash: Option<&str>, +) -> Result, Error> { let bytes = match url.scheme() { "http" | "https" => fetch_metadata_http(url, version, at_block_hash).await, "ws" | "wss" => fetch_metadata_ws(url, version, at_block_hash).await, @@ -55,7 +59,11 @@ pub async fn from_url(url: Url, version: MetadataVersion, at_block_hash: Option< } /// Returns the metadata bytes from the provided URL, blocking the current thread. -pub fn from_url_blocking(url: Url, version: MetadataVersion, at_block_hash: Option<&str>) -> Result, Error> { +pub fn from_url_blocking( + url: Url, + version: MetadataVersion, + at_block_hash: Option<&str>, +) -> Result, Error> { tokio_block_on(from_url(url, version, at_block_hash)) } @@ -68,7 +76,11 @@ fn tokio_block_on>(fut: Fut) -> T { .block_on(fut) } -async fn fetch_metadata_ws(url: Url, version: MetadataVersion, at_block_hash: Option<&str>) -> Result, Error> { +async fn fetch_metadata_ws( + url: Url, + version: MetadataVersion, + at_block_hash: Option<&str>, +) -> Result, Error> { let client = WsClientBuilder::default() .request_timeout(std::time::Duration::from_secs(180)) .max_buffer_capacity_per_subscription(4096) @@ -78,7 +90,11 @@ async fn fetch_metadata_ws(url: Url, version: MetadataVersion, at_block_hash: Op fetch_metadata(client, version, at_block_hash).await } -async fn fetch_metadata_http(url: Url, version: MetadataVersion, at_block_hash: Option<&str>) -> Result, Error> { +async fn fetch_metadata_http( + url: Url, + version: MetadataVersion, + at_block_hash: Option<&str>, +) -> Result, Error> { let client = HttpClientBuilder::default() .request_timeout(std::time::Duration::from_secs(180)) .build(url)?; @@ -87,12 +103,16 @@ async fn fetch_metadata_http(url: Url, version: MetadataVersion, at_block_hash: } /// The innermost call to fetch metadata: -async fn fetch_metadata(client: impl ClientT, version: MetadataVersion, at_block_hash: Option<&str>) -> Result, Error> { +async fn fetch_metadata( + client: impl ClientT, + version: MetadataVersion, + at_block_hash: Option<&str>, +) -> Result, Error> { const UNSTABLE_METADATA_VERSION: u32 = u32::MAX; // Ensure always 0x prefix. - let at_block_hash = at_block_hash - .map(|hash| format!("0x{}", hash.strip_prefix("0x").unwrap_or(hash))); + let at_block_hash = + at_block_hash.map(|hash| format!("0x{}", hash.strip_prefix("0x").unwrap_or(hash))); let at_block_hash = at_block_hash.as_deref(); // Fetch available metadata versions. If error, revert to legacy metadata code. @@ -101,7 +121,10 @@ async fn fetch_metadata(client: impl ClientT, version: MetadataVersion, at_block at_block_hash: Option<&str>, ) -> Result, Error> { let res: String = client - .request("state_call", rpc_params!["Metadata_metadata_versions", "0x", at_block_hash]) + .request( + "state_call", + rpc_params!["Metadata_metadata_versions", "0x", at_block_hash], + ) .await?; let raw_bytes = hex::decode(res.trim_start_matches("0x"))?; Decode::decode(&mut &raw_bytes[..]).map_err(Into::into) @@ -170,7 +193,10 @@ async fn fetch_metadata(client: impl ClientT, version: MetadataVersion, at_block ) -> Result, Error> { // Fetch the metadata. let metadata_string: String = client - .request("state_call", rpc_params!["Metadata_metadata", "0x", at_block_hash]) + .request( + "state_call", + rpc_params!["Metadata_metadata", "0x", at_block_hash], + ) .await?; // Decode the metadata. @@ -182,12 +208,15 @@ async fn fetch_metadata(client: impl ClientT, version: MetadataVersion, at_block match fetch_available_versions(&client, at_block_hash).await { Ok(supported_versions) => { fetch_inner(&client, version, supported_versions, at_block_hash).await - }, + } Err(e) => { // The "new" interface failed. if the user is asking for V14 or the "latest" // metadata then try the legacy interface instead. Else, just return the // reason for failure. - if matches!(version, MetadataVersion::Version(14) | MetadataVersion::Latest) { + if matches!( + version, + MetadataVersion::Version(14) | MetadataVersion::Latest + ) { fetch_inner_legacy(&client, at_block_hash).await } else { Err(e) diff --git a/utils/strip-metadata/Cargo.toml b/utils/strip-metadata/Cargo.toml index 391f95eb7f7..9fa5195f884 100644 --- a/utils/strip-metadata/Cargo.toml +++ b/utils/strip-metadata/Cargo.toml @@ -21,7 +21,6 @@ either = { workspace = true } [package.metadata.docs.rs] features = ["url"] -rustdoc-args = ["--cfg", "docsrs"] [package.metadata.playground] default-features = true