diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ca717ccf61..803f2e72fd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,306 +1,216 @@ name: Rust on: - push: - # Run jobs when commits are pushed to - # master or release-like branches: - branches: - - master - pull_request: - # Run jobs for any external PR that wants - # to merge to master, too: - branches: - - master + push: + # Run jobs when commits are pushed to + # master or release-like branches: + branches: + - master + pull_request: + # Run jobs for any external PR that wants + # to merge to master, too: + branches: + - master concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true env: - CARGO_TERM_COLOR: always - # TODO: Currently pointing at latest substrate; is there a suitable binary we can pin to here? - SUBSTRATE_URL: https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate + CARGO_TERM_COLOR: always + # TODO: Currently pointing at latest substrate; is there a suitable binary we can pin to here? + SUBSTRATE_URL: https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate jobs: - build: - name: Cargo check - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Download Substrate - run: | - curl $SUBSTRATE_URL --output substrate --location - chmod +x substrate - ./substrate --version - mkdir -p ~/.local/bin - mv substrate ~/.local/bin - - - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - name: Rust Cache - uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 - - - name: Install cargo-hack - uses: baptiste0928/cargo-install@v2 - with: - crate: cargo-hack - version: 0.5 - - - name: Cargo check - run: cargo hack --exclude-all-features --each-feature check --all-targets --workspace - - fmt: - name: Cargo fmt - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install Rust nightly toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt - - - name: Rust Cache - uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 - - - name: Cargo fmt - uses: actions-rs/cargo@v1.0.3 - with: - command: fmt - args: --all -- --check - - docs: - name: Check documentation - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Download Substrate - run: | - curl $SUBSTRATE_URL --output substrate --location - chmod +x substrate - ./substrate --version - mkdir -p ~/.local/bin - mv substrate ~/.local/bin - - - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - name: Rust Cache - uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 - - - name: Check internal documentation links - run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc -vv --workspace --no-deps --document-private-items - - - name: Run cargo test on documentation - uses: actions-rs/cargo@v1.0.3 - with: - command: test - args: --doc - - test-docs: - name: "Test: docs" - runs-on: ubuntu-latest-8-cores - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Download Substrate - run: | - curl $SUBSTRATE_URL --output substrate --location - chmod +x substrate - ./substrate --version - mkdir -p ~/.local/bin - mv substrate ~/.local/bin - - - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - name: Rust Cache - uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 - - - name: Run tests - uses: actions-rs/cargo@v1.0.3 - with: - command: test - args: --doc - - test-integration: - name: "Test: integration tests" - runs-on: ubuntu-latest-16-cores - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Download Substrate - run: | - curl $SUBSTRATE_URL --output substrate --location - chmod +x substrate - ./substrate --version - mkdir -p ~/.local/bin - mv substrate ~/.local/bin - - - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - name: Rust Cache - uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 - - - name: Run tests - uses: actions-rs/cargo@v1.0.3 - with: - command: test - args: --all-targets --package integration-tests - - test-ui: - name: "Test: UI tests" - runs-on: ubuntu-latest-16-cores - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Download Substrate - run: | - curl $SUBSTRATE_URL --output substrate --location - chmod +x substrate - ./substrate --version - mkdir -p ~/.local/bin - mv substrate ~/.local/bin - - - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - name: Rust Cache - uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 - - - name: Run tests - uses: actions-rs/cargo@v1.0.3 - with: - command: test - args: --all-targets --package ui-tests - - tests-other: - name: "Test: other (mainly unit) tests" - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Download Substrate - run: | - curl $SUBSTRATE_URL --output substrate --location - chmod +x substrate - ./substrate --version - mkdir -p ~/.local/bin - mv substrate ~/.local/bin - - - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - name: Rust Cache - uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 - - - name: Cargo test - uses: actions-rs/cargo@v1.0.3 - with: - command: test - args: --all-targets --workspace --exclude ui-tests --exclude integration-tests - - clippy: - name: Cargo clippy - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Download Substrate - run: | - curl $SUBSTRATE_URL --output substrate --location - chmod +x substrate - ./substrate --version - mkdir -p ~/.local/bin - mv substrate ~/.local/bin - - - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - components: clippy - override: true - - - name: Rust Cache - uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 - - - name: Run clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-targets -- -D warnings - - wasm_tests: - name: Test wasm - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3.1.0 - - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - - name: Install firefox - uses: browser-actions/setup-firefox@latest - - - name: Install chrome - uses: browser-actions/setup-chrome@latest - - - name: Rust Cache - uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 - - - name: Download Substrate - run: | - curl $SUBSTRATE_URL --output substrate --location - chmod +x substrate - ./substrate --version - mkdir -p ~/.local/bin - mv substrate ~/.local/bin - - - name: Run WASM tests - run: | - substrate --dev --tmp > /dev/null 2>&1 & - wasm-pack test --headless --firefox - wasm-pack test --headless --chrome - pkill substrate - working-directory: testing/wasm-tests + build: + name: Cargo check + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Download Substrate + run: | + curl $SUBSTRATE_URL --output substrate --location + chmod +x substrate + ./substrate --version + mkdir -p ~/.local/bin + mv substrate ~/.local/bin + + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Rust Cache + uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 + + - name: Install cargo-hack + uses: baptiste0928/cargo-install@v2 + with: + crate: cargo-hack + version: 0.5 + + - name: Cargo check + run: cargo hack --exclude-all-features --each-feature check --all-targets --workspace + + fmt: + name: Cargo fmt + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install Rust nightly toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + + - name: Rust Cache + uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 + + - name: Cargo fmt + uses: actions-rs/cargo@v1.0.3 + with: + command: fmt + args: --all -- --check + + docs: + name: Check documentation and run doc tests + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Download Substrate + run: | + curl $SUBSTRATE_URL --output substrate --location + chmod +x substrate + ./substrate --version + mkdir -p ~/.local/bin + mv substrate ~/.local/bin + + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Rust Cache + uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 + + - name: Check internal documentation links + run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc -vv --workspace --no-deps --document-private-items + + - name: Run cargo test on documentation + uses: actions-rs/cargo@v1.0.3 + with: + command: test + args: --doc + + nonwasm_tests: + name: "Test non-wasm" + runs-on: ubuntu-latest-16-cores + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Download Substrate + run: | + curl $SUBSTRATE_URL --output substrate --location + chmod +x substrate + ./substrate --version + mkdir -p ~/.local/bin + mv substrate ~/.local/bin + + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Rust Cache + uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 + + - name: Install cargo-nextest + run: cargo install cargo-nextest + + - name: Run tests + uses: actions-rs/cargo@v1.0.3 + with: + command: nextest + args: run --workspace + + clippy: + name: Cargo clippy + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Download Substrate + run: | + curl $SUBSTRATE_URL --output substrate --location + chmod +x substrate + ./substrate --version + mkdir -p ~/.local/bin + mv substrate ~/.local/bin + + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: clippy + override: true + + - name: Rust Cache + uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 + + - name: Run clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all-targets -- -D warnings + + wasm_tests: + name: Test wasm + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3.1.0 + + - name: Install wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + + - name: Install firefox + uses: browser-actions/setup-firefox@latest + + - name: Install chrome + uses: browser-actions/setup-chrome@latest + + - name: Rust Cache + uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1 + + - name: Download Substrate + run: | + curl $SUBSTRATE_URL --output substrate --location + chmod +x substrate + ./substrate --version + mkdir -p ~/.local/bin + mv substrate ~/.local/bin + + - name: Run WASM tests + run: | + substrate --dev --tmp > /dev/null 2>&1 & + wasm-pack test --headless --firefox + wasm-pack test --headless --chrome + pkill substrate + working-directory: testing/wasm-tests diff --git a/artifacts/polkadot_metadata.scale b/artifacts/polkadot_metadata_full.scale similarity index 72% rename from artifacts/polkadot_metadata.scale rename to artifacts/polkadot_metadata_full.scale index d42d495410..d85b0defd7 100644 Binary files a/artifacts/polkadot_metadata.scale and b/artifacts/polkadot_metadata_full.scale differ diff --git a/artifacts/polkadot_metadata_small.scale b/artifacts/polkadot_metadata_small.scale new file mode 100644 index 0000000000..fba6da3a21 Binary files /dev/null and b/artifacts/polkadot_metadata_small.scale differ diff --git a/artifacts/polkadot_metadata_tiny.scale b/artifacts/polkadot_metadata_tiny.scale new file mode 100644 index 0000000000..bb0ead8d79 Binary files /dev/null and b/artifacts/polkadot_metadata_tiny.scale differ diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index fde77ceb9c..39d0f826b5 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -23,7 +23,7 @@ //! use frame_metadata::RuntimeMetadataPrefixed; //! use subxt_codegen::{CratePath, DerivesRegistry, TypeSubstitutes}; //! -//! let encoded = fs::read("../artifacts/polkadot_metadata.scale").unwrap(); +//! let encoded = fs::read("../artifacts/polkadot_metadata_full.scale").unwrap(); //! //! // Runtime metadata obtained from a node. //! let metadata = ::decode(&mut &*encoded).unwrap(); diff --git a/examples/examples/blocks_subscribing.rs b/examples/examples/blocks_subscribing.rs index 7a7942c667..136af804c1 100644 --- a/examples/examples/blocks_subscribing.rs +++ b/examples/examples/blocks_subscribing.rs @@ -1,7 +1,7 @@ use futures::StreamExt; use subxt::{OnlineClient, PolkadotConfig}; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/constants_static.rs b/examples/examples/constants_static.rs index 1dd9409c0e..ebbf6ed0e9 100644 --- a/examples/examples/constants_static.rs +++ b/examples/examples/constants_static.rs @@ -1,6 +1,6 @@ use subxt::{OnlineClient, PolkadotConfig}; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/events.rs b/examples/examples/events.rs index 4c35398349..01499c1acb 100644 --- a/examples/examples/events.rs +++ b/examples/examples/events.rs @@ -1,6 +1,6 @@ use subxt::{OnlineClient, PolkadotConfig}; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/runtime_apis_dynamic.rs b/examples/examples/runtime_apis_dynamic.rs index c861c53357..bc2690bcf0 100644 --- a/examples/examples/runtime_apis_dynamic.rs +++ b/examples/examples/runtime_apis_dynamic.rs @@ -2,7 +2,7 @@ use sp_keyring::AccountKeyring; use subxt::dynamic::Value; use subxt::{config::PolkadotConfig, OnlineClient}; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/runtime_apis_raw.rs b/examples/examples/runtime_apis_raw.rs index fc61ff4b3b..c1ee7cf8d5 100644 --- a/examples/examples/runtime_apis_raw.rs +++ b/examples/examples/runtime_apis_raw.rs @@ -2,7 +2,7 @@ use subxt::ext::codec::Compact; use subxt::ext::frame_metadata::RuntimeMetadataPrefixed; use subxt::{OnlineClient, PolkadotConfig}; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/runtime_apis_static.rs b/examples/examples/runtime_apis_static.rs index 5e0d256bde..53732ce817 100644 --- a/examples/examples/runtime_apis_static.rs +++ b/examples/examples/runtime_apis_static.rs @@ -1,7 +1,7 @@ use sp_keyring::AccountKeyring; use subxt::{config::PolkadotConfig, OnlineClient}; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/setup_client_offline.rs b/examples/examples/setup_client_offline.rs index ba5d9b31ab..f6fbb77ba8 100644 --- a/examples/examples/setup_client_offline.rs +++ b/examples/examples/setup_client_offline.rs @@ -25,7 +25,7 @@ async fn main() -> Result<(), Box> { // 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.scale").unwrap(); + let bytes = std::fs::read("./artifacts/polkadot_metadata_small.scale").unwrap(); let metadata = RuntimeMetadataPrefixed::decode(&mut &*bytes).unwrap(); Metadata::try_from(metadata).unwrap() }; diff --git a/examples/examples/storage_fetch.rs b/examples/examples/storage_fetch.rs index 1a5b034be5..5674d51ff7 100644 --- a/examples/examples/storage_fetch.rs +++ b/examples/examples/storage_fetch.rs @@ -2,7 +2,7 @@ use sp_keyring::AccountKeyring; use subxt::{OnlineClient, PolkadotConfig}; // Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/storage_iterating.rs b/examples/examples/storage_iterating.rs index 4a6a0159a6..7b7864cf7c 100644 --- a/examples/examples/storage_iterating.rs +++ b/examples/examples/storage_iterating.rs @@ -1,7 +1,6 @@ use subxt::{OnlineClient, PolkadotConfig}; -// Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/tx_basic.rs b/examples/examples/tx_basic.rs index 787f1f9ef2..2f31e2476e 100644 --- a/examples/examples/tx_basic.rs +++ b/examples/examples/tx_basic.rs @@ -2,7 +2,7 @@ use sp_keyring::AccountKeyring; use subxt::{tx::PairSigner, OnlineClient, PolkadotConfig}; // Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/tx_status_stream.rs b/examples/examples/tx_status_stream.rs index a390f9e3d4..47d0b9196c 100644 --- a/examples/examples/tx_status_stream.rs +++ b/examples/examples/tx_status_stream.rs @@ -6,7 +6,7 @@ use subxt::{ }; // Generate an interface that we can use from the node's metadata. -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/tx_with_params.rs b/examples/examples/tx_with_params.rs index c94140d421..c64dcc2029 100644 --- a/examples/examples/tx_with_params.rs +++ b/examples/examples/tx_with_params.rs @@ -2,7 +2,7 @@ use sp_keyring::AccountKeyring; use subxt::config::polkadot::{Era, PlainTip, PolkadotExtrinsicParamsBuilder as Params}; use subxt::{tx::PairSigner, OnlineClient, PolkadotConfig}; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] diff --git a/metadata/benches/bench.rs b/metadata/benches/bench.rs index d264fbe5f3..12dd1fa6a8 100644 --- a/metadata/benches/bench.rs +++ b/metadata/benches/bench.rs @@ -13,7 +13,7 @@ use subxt_metadata::{ }; fn load_metadata() -> RuntimeMetadataV15 { - let bytes = fs::read(Path::new("../artifacts/polkadot_metadata.scale")) + let bytes = fs::read(Path::new("../artifacts/polkadot_metadata_full.scale")) .expect("Cannot read metadata blob"); let meta: RuntimeMetadataPrefixed = Decode::decode(&mut &*bytes).expect("Cannot decode scale metadata"); diff --git a/metadata/src/retain.rs b/metadata/src/retain.rs index c17d71c140..d1769f282e 100644 --- a/metadata/src/retain.rs +++ b/metadata/src/retain.rs @@ -256,7 +256,7 @@ mod tests { use std::{fs, path::Path}; fn load_metadata() -> RuntimeMetadataV15 { - let bytes = fs::read(Path::new("../artifacts/polkadot_metadata.scale")) + let bytes = fs::read(Path::new("../artifacts/polkadot_metadata_full.scale")) .expect("Cannot read metadata blob"); let meta: RuntimeMetadataPrefixed = Decode::decode(&mut &*bytes).expect("Cannot decode scale metadata"); diff --git a/scripts/artifacts.sh b/scripts/artifacts.sh new file mode 100755 index 0000000000..f561228a2a --- /dev/null +++ b/scripts/artifacts.sh @@ -0,0 +1,21 @@ +# # Generates the 3 metadata files in `/artifacts` and the polkadot.rs file for integration tests +# +# This script is to be run from the root of the repository: `scripts/artifacts.sh` +# +# It expects a local polkadot node to be running a JSON-RPC HTTP server at 127.0.0.1:9933 +# A local polkadot node can be run via: +# ``` +# git clone https://github.com/paritytech/polkadot.git +# cd polkadot +# cargo build --release +# ./target/release/polkadot --dev --tmp +# ``` + +# get the full metadata +cargo run --bin subxt metadata --version unstable > artifacts/polkadot_metadata_full.scale +# use it to generate polkadot.rs +cargo run --bin subxt codegen --file artifacts/polkadot_metadata_full.scale | rustfmt > testing/integration-tests/src/codegen/polkadot.rs +# generate a metadata file that only contains the pallets Balances, Staking, System and Multisig +cargo run --bin subxt metadata --file artifacts/polkadot_metadata_full.scale --pallets "Balances,Staking,System,Multisig" > artifacts/polkadot_metadata_small.scale +# generate a metadata file that only contains no pallets +cargo run --bin subxt metadata --file artifacts/polkadot_metadata_full.scale --pallets "" > artifacts/polkadot_metadata_tiny.scale diff --git a/subxt/src/book/setup/codegen.rs b/subxt/src/book/setup/codegen.rs index 5cf0d8032d..602f108e22 100644 --- a/subxt/src/book/setup/codegen.rs +++ b/subxt/src/book/setup/codegen.rs @@ -14,7 +14,7 @@ //! Using this macro looks something like: //! //! ```rust,no_run -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_tiny.scale")] //! pub mod polkadot {} //! ``` //! diff --git a/subxt/src/book/usage/constants.rs b/subxt/src/book/usage/constants.rs index b11193b7f2..6e889fafdc 100644 --- a/subxt/src/book/usage/constants.rs +++ b/subxt/src/book/usage/constants.rs @@ -18,7 +18,7 @@ //! ```rust,no_run //! use sp_keyring::AccountKeyring; //! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] //! pub mod polkadot {} //! //! let constant_query = polkadot::constants().system().block_length(); diff --git a/subxt/src/book/usage/runtime_apis.rs b/subxt/src/book/usage/runtime_apis.rs index e42ddb09a7..37ec878f42 100644 --- a/subxt/src/book/usage/runtime_apis.rs +++ b/subxt/src/book/usage/runtime_apis.rs @@ -24,7 +24,7 @@ //! ```rust,no_run //! use sp_keyring::AccountKeyring; //! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] //! pub mod polkadot {} //! //! let runtime_call = polkadot::apis().metadata().metadata_versions(); diff --git a/subxt/src/book/usage/storage.rs b/subxt/src/book/usage/storage.rs index 2c32e0d8fd..23b0dbc1e7 100644 --- a/subxt/src/book/usage/storage.rs +++ b/subxt/src/book/usage/storage.rs @@ -18,7 +18,7 @@ //! ```rust,no_run //! use sp_keyring::AccountKeyring; //! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] //! pub mod polkadot {} //! //! let account = AccountKeyring::Alice.to_account_id().into(); @@ -45,7 +45,7 @@ //! ```rust,no_run //! use sp_keyring::AccountKeyring; //! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] //! pub mod polkadot {} //! //! // A static query capable of iterating over accounts: diff --git a/subxt/src/book/usage/transactions.rs b/subxt/src/book/usage/transactions.rs index f5eddea603..49779228ab 100644 --- a/subxt/src/book/usage/transactions.rs +++ b/subxt/src/book/usage/transactions.rs @@ -26,7 +26,7 @@ //! We can use the statically generated interface to build transaction payloads: //! //! ```rust,no_run -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] //! pub mod polkadot {} //! //! let remark = "Hello there".as_bytes().to_vec(); diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index d23633e141..ee7e257c6f 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -109,7 +109,7 @@ pub mod ext { /// /// ```rust,no_run /// #[subxt::subxt( -/// runtime_metadata_path = "../artifacts/polkadot_metadata.scale", +/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", /// )] /// mod polkadot {} /// ``` @@ -130,7 +130,7 @@ pub mod ext { /// # pub mod path { pub mod to { pub use subxt; } } /// # fn main() {} /// #[subxt::subxt( -/// runtime_metadata_path = "../artifacts/polkadot_metadata.scale", +/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", /// crate = "crate::path::to::subxt" /// )] /// mod polkadot {} @@ -146,7 +146,7 @@ pub mod ext { /// /// ```rust /// #[subxt::subxt( -/// runtime_metadata_path = "../artifacts/polkadot_metadata.scale", +/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", /// substitute_type(path = "sp_arithmetic::per_things::Perbill", with = "crate::Foo") /// )] /// mod polkadot {} @@ -184,7 +184,7 @@ pub mod ext { /// /// ```rust,no_run /// #[subxt::subxt( -/// runtime_metadata_path = "../artifacts/polkadot_metadata.scale", +/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", /// substitute_type( /// path = "sp_runtime::multiaddress::MultiAddress", /// with = "::subxt::utils::Static<::sp_runtime::MultiAddress>" @@ -204,7 +204,7 @@ pub mod ext { /// /// ```rust,no_run /// #[subxt::subxt( -/// runtime_metadata_path = "../artifacts/polkadot_metadata.scale", +/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", /// derive_for_all_types = "Eq, PartialEq" /// )] /// mod polkadot {} @@ -220,7 +220,7 @@ pub mod ext { /// /// ```rust,no_run /// #[subxt::subxt( -/// runtime_metadata_path = "../artifacts/polkadot_metadata.scale", +/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", /// derive_for_all_types = "Eq, PartialEq", /// derive_for_type(path = "frame_support::PalletId", derive = "Ord, PartialOrd"), /// derive_for_type(path = "sp_runtime::ModuleError", derive = "Hash"), @@ -248,7 +248,7 @@ pub mod ext { /// /// ```rust,no_run /// #[subxt::subxt( -/// runtime_metadata_path = "../artifacts/polkadot_metadata.scale", +/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", /// generate_docs /// )] /// mod polkadot {} @@ -261,7 +261,7 @@ pub mod ext { /// /// ```rust,no_run /// #[subxt::subxt( -/// runtime_metadata_path = "../artifacts/polkadot_metadata.scale", +/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", /// runtime_types_only /// )] /// mod polkadot {} @@ -273,7 +273,7 @@ pub mod ext { /// /// ```rust,no_run /// #[subxt::subxt( -/// runtime_metadata_path = "../artifacts/polkadot_metadata.scale", +/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale", /// runtime_types_only, /// no_default_derives, /// derive_for_all_types="codec::Encode, codec::Decode" diff --git a/subxt/src/rpc/mod.rs b/subxt/src/rpc/mod.rs index 98c76e7998..2254db313c 100644 --- a/subxt/src/rpc/mod.rs +++ b/subxt/src/rpc/mod.rs @@ -25,7 +25,7 @@ //! # async fn main() { //! use subxt::{ PolkadotConfig, OnlineClient, storage::StorageKey }; //! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] //! pub mod polkadot {} //! //! let api = OnlineClient::::new().await.unwrap(); diff --git a/subxt/src/rpc/rpc.rs b/subxt/src/rpc/rpc.rs index f4914eea69..13b8ad202c 100644 --- a/subxt/src/rpc/rpc.rs +++ b/subxt/src/rpc/rpc.rs @@ -16,7 +16,7 @@ //! # async fn main() { //! use subxt::{ PolkadotConfig, OnlineClient, storage::StorageKey }; //! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] //! pub mod polkadot {} //! //! let api = OnlineClient::::new().await.unwrap(); diff --git a/subxt/src/storage/storage_type.rs b/subxt/src/storage/storage_type.rs index 84c554af6c..51d2e978b5 100644 --- a/subxt/src/storage/storage_type.rs +++ b/subxt/src/storage/storage_type.rs @@ -62,7 +62,7 @@ where /// ```no_run /// use subxt::{ PolkadotConfig, OnlineClient }; /// - /// #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] + /// #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] /// pub mod polkadot {} /// /// # #[tokio::main] @@ -172,7 +172,7 @@ where /// ```no_run /// use subxt::{ PolkadotConfig, OnlineClient }; /// - /// #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] + /// #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] /// pub mod polkadot {} /// /// # #[tokio::main] diff --git a/testing/integration-tests/src/codegen/mod.rs b/testing/integration-tests/src/codegen/mod.rs index 91b043b98d..786c0df00f 100644 --- a/testing/integration-tests/src/codegen/mod.rs +++ b/testing/integration-tests/src/codegen/mod.rs @@ -8,7 +8,7 @@ /// Generate by running this at the root of the repository: /// /// ``` -/// cargo run --bin subxt -- codegen --file artifacts/polkadot_metadata.scale | rustfmt > testing/integration-tests/src/codegen/polkadot.rs +/// cargo run --bin subxt -- codegen --file artifacts/polkadot_metadata_full.scale | rustfmt > testing/integration-tests/src/codegen/polkadot.rs /// ``` #[rustfmt::skip] #[allow(clippy::all)] diff --git a/testing/integration-tests/src/codegen/polkadot.rs b/testing/integration-tests/src/codegen/polkadot.rs index 2a4335ec3b..37746296a1 100644 --- a/testing/integration-tests/src/codegen/polkadot.rs +++ b/testing/integration-tests/src/codegen/polkadot.rs @@ -5,7 +5,7 @@ pub mod api { mod root_mod { pub use super::*; } - pub static PALLETS: [&str; 56usize] = [ + pub static PALLETS: [&str; 57usize] = [ "System", "Scheduler", "Preimage", @@ -57,6 +57,7 @@ pub mod api { "Hrmp", "ParaSessionInfo", "ParasDisputes", + "ParasSlashing", "Registrar", "Slots", "Auctions", @@ -590,14 +591,14 @@ pub mod api { Paras(paras::Call), #[codec(index = 57)] Initializer(initializer::Call), - #[codec(index = 58)] - Dmp(dmp::Call), #[codec(index = 59)] Ump(ump::Call), #[codec(index = 60)] Hrmp(hrmp::Call), #[codec(index = 62)] ParasDisputes(paras_disputes::Call), + #[codec(index = 63)] + ParasSlashing(paras_slashing::Call), #[codec(index = 70)] Registrar(registrar::Call), #[codec(index = 71)] @@ -910,13 +911,6 @@ pub mod api { metadata, )?)); } - if pallet_name == "Dmp" { - return Ok(Call::Dmp(dmp::Call::decode_with_metadata( - &mut &*pallet_bytes, - pallet_ty, - metadata, - )?)); - } if pallet_name == "Ump" { return Ok(Call::Ump(ump::Call::decode_with_metadata( &mut &*pallet_bytes, @@ -940,6 +934,15 @@ pub mod api { )?, )); } + if pallet_name == "ParasSlashing" { + return Ok(Call::ParasSlashing( + paras_slashing::Call::decode_with_metadata( + &mut &*pallet_bytes, + pallet_ty, + metadata, + )?, + )); + } if pallet_name == "Registrar" { return Ok(Call::Registrar(registrar::Call::decode_with_metadata( &mut &*pallet_bytes, @@ -1071,6 +1074,8 @@ pub mod api { Hrmp(hrmp::Error), #[codec(index = 62)] ParasDisputes(paras_disputes::Error), + #[codec(index = 63)] + ParasSlashing(paras_slashing::Error), #[codec(index = 70)] Registrar(registrar::Error), #[codec(index = 71)] @@ -1091,208 +1096,213 @@ pub mod api { use subxt::metadata::DecodeWithMetadata; let cursor = &mut &pallet_bytes[..]; if pallet_name == "System" { - let variant_error = system::Error::decode_with_metadata(cursor, 488u32, metadata)?; + let variant_error = system::Error::decode_with_metadata(cursor, 491u32, metadata)?; return Ok(Error::System(variant_error)); } if pallet_name == "Scheduler" { let variant_error = - scheduler::Error::decode_with_metadata(cursor, 493u32, metadata)?; + scheduler::Error::decode_with_metadata(cursor, 496u32, metadata)?; return Ok(Error::Scheduler(variant_error)); } if pallet_name == "Preimage" { let variant_error = - preimage::Error::decode_with_metadata(cursor, 498u32, metadata)?; + preimage::Error::decode_with_metadata(cursor, 501u32, metadata)?; return Ok(Error::Preimage(variant_error)); } if pallet_name == "Babe" { - let variant_error = babe::Error::decode_with_metadata(cursor, 514u32, metadata)?; + let variant_error = babe::Error::decode_with_metadata(cursor, 517u32, metadata)?; return Ok(Error::Babe(variant_error)); } if pallet_name == "Indices" { - let variant_error = indices::Error::decode_with_metadata(cursor, 516u32, metadata)?; + let variant_error = indices::Error::decode_with_metadata(cursor, 519u32, metadata)?; return Ok(Error::Indices(variant_error)); } if pallet_name == "Balances" { let variant_error = - balances::Error::decode_with_metadata(cursor, 527u32, metadata)?; + balances::Error::decode_with_metadata(cursor, 530u32, metadata)?; return Ok(Error::Balances(variant_error)); } if pallet_name == "Staking" { - let variant_error = staking::Error::decode_with_metadata(cursor, 551u32, metadata)?; + let variant_error = staking::Error::decode_with_metadata(cursor, 554u32, metadata)?; return Ok(Error::Staking(variant_error)); } if pallet_name == "Session" { - let variant_error = session::Error::decode_with_metadata(cursor, 558u32, metadata)?; + let variant_error = session::Error::decode_with_metadata(cursor, 561u32, metadata)?; return Ok(Error::Session(variant_error)); } if pallet_name == "Grandpa" { - let variant_error = grandpa::Error::decode_with_metadata(cursor, 562u32, metadata)?; + let variant_error = grandpa::Error::decode_with_metadata(cursor, 565u32, metadata)?; return Ok(Error::Grandpa(variant_error)); } if pallet_name == "ImOnline" { let variant_error = - im_online::Error::decode_with_metadata(cursor, 570u32, metadata)?; + im_online::Error::decode_with_metadata(cursor, 573u32, metadata)?; return Ok(Error::ImOnline(variant_error)); } if pallet_name == "Democracy" { let variant_error = - democracy::Error::decode_with_metadata(cursor, 587u32, metadata)?; + democracy::Error::decode_with_metadata(cursor, 590u32, metadata)?; return Ok(Error::Democracy(variant_error)); } if pallet_name == "Council" { - let variant_error = council::Error::decode_with_metadata(cursor, 590u32, metadata)?; + let variant_error = council::Error::decode_with_metadata(cursor, 593u32, metadata)?; return Ok(Error::Council(variant_error)); } if pallet_name == "TechnicalCommittee" { let variant_error = - technical_committee::Error::decode_with_metadata(cursor, 592u32, metadata)?; + technical_committee::Error::decode_with_metadata(cursor, 595u32, metadata)?; return Ok(Error::TechnicalCommittee(variant_error)); } if pallet_name == "PhragmenElection" { let variant_error = - phragmen_election::Error::decode_with_metadata(cursor, 596u32, metadata)?; + phragmen_election::Error::decode_with_metadata(cursor, 599u32, metadata)?; return Ok(Error::PhragmenElection(variant_error)); } if pallet_name == "TechnicalMembership" { let variant_error = - technical_membership::Error::decode_with_metadata(cursor, 598u32, metadata)?; + technical_membership::Error::decode_with_metadata(cursor, 601u32, metadata)?; return Ok(Error::TechnicalMembership(variant_error)); } if pallet_name == "Treasury" { let variant_error = - treasury::Error::decode_with_metadata(cursor, 604u32, metadata)?; + treasury::Error::decode_with_metadata(cursor, 607u32, metadata)?; return Ok(Error::Treasury(variant_error)); } if pallet_name == "ConvictionVoting" { let variant_error = - conviction_voting::Error::decode_with_metadata(cursor, 617u32, metadata)?; + conviction_voting::Error::decode_with_metadata(cursor, 620u32, metadata)?; return Ok(Error::ConvictionVoting(variant_error)); } if pallet_name == "Referenda" { let variant_error = - referenda::Error::decode_with_metadata(cursor, 635u32, metadata)?; + referenda::Error::decode_with_metadata(cursor, 638u32, metadata)?; return Ok(Error::Referenda(variant_error)); } if pallet_name == "Whitelist" { let variant_error = - whitelist::Error::decode_with_metadata(cursor, 636u32, metadata)?; + whitelist::Error::decode_with_metadata(cursor, 639u32, metadata)?; return Ok(Error::Whitelist(variant_error)); } if pallet_name == "Claims" { - let variant_error = claims::Error::decode_with_metadata(cursor, 637u32, metadata)?; + let variant_error = claims::Error::decode_with_metadata(cursor, 640u32, metadata)?; return Ok(Error::Claims(variant_error)); } if pallet_name == "Vesting" { - let variant_error = vesting::Error::decode_with_metadata(cursor, 641u32, metadata)?; + let variant_error = vesting::Error::decode_with_metadata(cursor, 644u32, metadata)?; return Ok(Error::Vesting(variant_error)); } if pallet_name == "Utility" { - let variant_error = utility::Error::decode_with_metadata(cursor, 642u32, metadata)?; + let variant_error = utility::Error::decode_with_metadata(cursor, 645u32, metadata)?; return Ok(Error::Utility(variant_error)); } if pallet_name == "Identity" { let variant_error = - identity::Error::decode_with_metadata(cursor, 653u32, metadata)?; + identity::Error::decode_with_metadata(cursor, 656u32, metadata)?; return Ok(Error::Identity(variant_error)); } if pallet_name == "Proxy" { - let variant_error = proxy::Error::decode_with_metadata(cursor, 662u32, metadata)?; + let variant_error = proxy::Error::decode_with_metadata(cursor, 665u32, metadata)?; return Ok(Error::Proxy(variant_error)); } if pallet_name == "Multisig" { let variant_error = - multisig::Error::decode_with_metadata(cursor, 666u32, metadata)?; + multisig::Error::decode_with_metadata(cursor, 669u32, metadata)?; return Ok(Error::Multisig(variant_error)); } if pallet_name == "Bounties" { let variant_error = - bounties::Error::decode_with_metadata(cursor, 670u32, metadata)?; + bounties::Error::decode_with_metadata(cursor, 673u32, metadata)?; return Ok(Error::Bounties(variant_error)); } if pallet_name == "ChildBounties" { let variant_error = - child_bounties::Error::decode_with_metadata(cursor, 673u32, metadata)?; + child_bounties::Error::decode_with_metadata(cursor, 676u32, metadata)?; return Ok(Error::ChildBounties(variant_error)); } if pallet_name == "Tips" { - let variant_error = tips::Error::decode_with_metadata(cursor, 675u32, metadata)?; + let variant_error = tips::Error::decode_with_metadata(cursor, 678u32, metadata)?; return Ok(Error::Tips(variant_error)); } if pallet_name == "ElectionProviderMultiPhase" { let variant_error = election_provider_multi_phase::Error::decode_with_metadata( - cursor, 685u32, metadata, + cursor, 688u32, metadata, )?; return Ok(Error::ElectionProviderMultiPhase(variant_error)); } if pallet_name == "VoterList" { let variant_error = - voter_list::Error::decode_with_metadata(cursor, 689u32, metadata)?; + voter_list::Error::decode_with_metadata(cursor, 692u32, metadata)?; return Ok(Error::VoterList(variant_error)); } if pallet_name == "NominationPools" { let variant_error = - nomination_pools::Error::decode_with_metadata(cursor, 707u32, metadata)?; + nomination_pools::Error::decode_with_metadata(cursor, 710u32, metadata)?; return Ok(Error::NominationPools(variant_error)); } if pallet_name == "FastUnstake" { let variant_error = - fast_unstake::Error::decode_with_metadata(cursor, 712u32, metadata)?; + fast_unstake::Error::decode_with_metadata(cursor, 715u32, metadata)?; return Ok(Error::FastUnstake(variant_error)); } if pallet_name == "Configuration" { let variant_error = - configuration::Error::decode_with_metadata(cursor, 716u32, metadata)?; + configuration::Error::decode_with_metadata(cursor, 719u32, metadata)?; return Ok(Error::Configuration(variant_error)); } if pallet_name == "ParaInclusion" { let variant_error = - para_inclusion::Error::decode_with_metadata(cursor, 721u32, metadata)?; + para_inclusion::Error::decode_with_metadata(cursor, 724u32, metadata)?; return Ok(Error::ParaInclusion(variant_error)); } if pallet_name == "ParaInherent" { let variant_error = - para_inherent::Error::decode_with_metadata(cursor, 727u32, metadata)?; + para_inherent::Error::decode_with_metadata(cursor, 730u32, metadata)?; return Ok(Error::ParaInherent(variant_error)); } if pallet_name == "Paras" { - let variant_error = paras::Error::decode_with_metadata(cursor, 754u32, metadata)?; + let variant_error = paras::Error::decode_with_metadata(cursor, 757u32, metadata)?; return Ok(Error::Paras(variant_error)); } if pallet_name == "Ump" { - let variant_error = ump::Error::decode_with_metadata(cursor, 760u32, metadata)?; + let variant_error = ump::Error::decode_with_metadata(cursor, 763u32, metadata)?; return Ok(Error::Ump(variant_error)); } if pallet_name == "Hrmp" { - let variant_error = hrmp::Error::decode_with_metadata(cursor, 768u32, metadata)?; + let variant_error = hrmp::Error::decode_with_metadata(cursor, 771u32, metadata)?; return Ok(Error::Hrmp(variant_error)); } if pallet_name == "ParasDisputes" { let variant_error = - paras_disputes::Error::decode_with_metadata(cursor, 777u32, metadata)?; + paras_disputes::Error::decode_with_metadata(cursor, 780u32, metadata)?; return Ok(Error::ParasDisputes(variant_error)); } + if pallet_name == "ParasSlashing" { + let variant_error = + paras_slashing::Error::decode_with_metadata(cursor, 785u32, metadata)?; + return Ok(Error::ParasSlashing(variant_error)); + } if pallet_name == "Registrar" { let variant_error = - registrar::Error::decode_with_metadata(cursor, 779u32, metadata)?; + registrar::Error::decode_with_metadata(cursor, 787u32, metadata)?; return Ok(Error::Registrar(variant_error)); } if pallet_name == "Slots" { - let variant_error = slots::Error::decode_with_metadata(cursor, 781u32, metadata)?; + let variant_error = slots::Error::decode_with_metadata(cursor, 789u32, metadata)?; return Ok(Error::Slots(variant_error)); } if pallet_name == "Auctions" { let variant_error = - auctions::Error::decode_with_metadata(cursor, 786u32, metadata)?; + auctions::Error::decode_with_metadata(cursor, 794u32, metadata)?; return Ok(Error::Auctions(variant_error)); } if pallet_name == "Crowdloan" { let variant_error = - crowdloan::Error::decode_with_metadata(cursor, 789u32, metadata)?; + crowdloan::Error::decode_with_metadata(cursor, 797u32, metadata)?; return Ok(Error::Crowdloan(variant_error)); } if pallet_name == "XcmPallet" { let variant_error = - xcm_pallet::Error::decode_with_metadata(cursor, 808u32, metadata)?; + xcm_pallet::Error::decode_with_metadata(cursor, 816u32, metadata)?; return Ok(Error::XcmPallet(variant_error)); } Err(::subxt::ext::scale_decode::Error::custom(format!( @@ -3802,10 +3812,10 @@ pub mod api { "TransactionPaymentCallApi_query_call_info", types::QueryCallInfo { call, len }, [ - 151u8, 40u8, 199u8, 73u8, 193u8, 248u8, 30u8, 24u8, 71u8, 196u8, 235u8, - 10u8, 211u8, 120u8, 228u8, 29u8, 101u8, 175u8, 200u8, 196u8, 70u8, - 44u8, 112u8, 209u8, 175u8, 246u8, 148u8, 118u8, 84u8, 127u8, 185u8, - 163u8, + 218u8, 54u8, 230u8, 230u8, 47u8, 1u8, 213u8, 144u8, 43u8, 21u8, 63u8, + 245u8, 81u8, 157u8, 189u8, 79u8, 108u8, 173u8, 142u8, 208u8, 47u8, + 90u8, 208u8, 125u8, 214u8, 233u8, 78u8, 29u8, 213u8, 198u8, 237u8, + 54u8, ], ) } @@ -3824,9 +3834,10 @@ pub mod api { "TransactionPaymentCallApi_query_call_fee_details", types::QueryCallFeeDetails { call, len }, [ - 56u8, 220u8, 173u8, 0u8, 48u8, 27u8, 228u8, 70u8, 139u8, 236u8, 142u8, - 142u8, 192u8, 147u8, 216u8, 185u8, 152u8, 219u8, 185u8, 189u8, 166u8, - 110u8, 224u8, 32u8, 94u8, 53u8, 248u8, 216u8, 90u8, 152u8, 63u8, 148u8, + 117u8, 194u8, 140u8, 175u8, 222u8, 226u8, 47u8, 206u8, 231u8, 61u8, + 90u8, 113u8, 66u8, 118u8, 129u8, 235u8, 145u8, 217u8, 255u8, 169u8, + 207u8, 24u8, 64u8, 140u8, 39u8, 42u8, 34u8, 179u8, 219u8, 33u8, 107u8, + 1u8, ], ) } @@ -4178,6 +4189,9 @@ pub mod api { pub fn paras_disputes(&self) -> paras_disputes::storage::StorageApi { paras_disputes::storage::StorageApi } + pub fn paras_slashing(&self) -> paras_slashing::storage::StorageApi { + paras_slashing::storage::StorageApi + } pub fn registrar(&self) -> registrar::storage::StorageApi { registrar::storage::StorageApi } @@ -4315,9 +4329,6 @@ pub mod api { pub fn initializer(&self) -> initializer::calls::TransactionApi { initializer::calls::TransactionApi } - pub fn dmp(&self) -> dmp::calls::TransactionApi { - dmp::calls::TransactionApi - } pub fn ump(&self) -> ump::calls::TransactionApi { ump::calls::TransactionApi } @@ -4327,6 +4338,9 @@ pub mod api { pub fn paras_disputes(&self) -> paras_disputes::calls::TransactionApi { paras_disputes::calls::TransactionApi } + pub fn paras_slashing(&self) -> paras_slashing::calls::TransactionApi { + paras_slashing::calls::TransactionApi + } pub fn registrar(&self) -> registrar::calls::TransactionApi { registrar::calls::TransactionApi } @@ -4350,9 +4364,9 @@ pub mod api { let runtime_metadata_hash = client.metadata().metadata_hash(&PALLETS); if runtime_metadata_hash != [ - 190u8, 141u8, 166u8, 186u8, 44u8, 119u8, 250u8, 170u8, 99u8, 5u8, 93u8, 253u8, - 141u8, 142u8, 175u8, 243u8, 206u8, 208u8, 98u8, 63u8, 166u8, 71u8, 159u8, 227u8, - 34u8, 235u8, 190u8, 96u8, 248u8, 13u8, 47u8, 146u8, + 193u8, 126u8, 5u8, 68u8, 158u8, 198u8, 107u8, 140u8, 166u8, 77u8, 81u8, 160u8, + 213u8, 179u8, 210u8, 41u8, 130u8, 34u8, 133u8, 228u8, 10u8, 134u8, 182u8, 62u8, + 72u8, 116u8, 209u8, 70u8, 115u8, 234u8, 227u8, 18u8, ] { Err(::subxt::error::MetadataError::IncompatibleMetadata) @@ -5085,10 +5099,9 @@ pub mod api { "Events", vec![], [ - 26u8, 210u8, 211u8, 123u8, 212u8, 15u8, 80u8, 216u8, 114u8, 185u8, - 65u8, 128u8, 244u8, 195u8, 118u8, 121u8, 178u8, 141u8, 187u8, 167u8, - 50u8, 176u8, 188u8, 16u8, 166u8, 230u8, 16u8, 138u8, 161u8, 106u8, - 166u8, 190u8, + 78u8, 158u8, 91u8, 165u8, 29u8, 179u8, 204u8, 195u8, 39u8, 3u8, 127u8, + 199u8, 132u8, 93u8, 252u8, 17u8, 84u8, 58u8, 51u8, 56u8, 159u8, 51u8, + 188u8, 138u8, 75u8, 109u8, 148u8, 73u8, 227u8, 56u8, 162u8, 246u8, ], ) } @@ -5527,9 +5540,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 164u8, 246u8, 61u8, 87u8, 188u8, 27u8, 147u8, 236u8, 52u8, 8u8, 236u8, - 129u8, 26u8, 72u8, 131u8, 237u8, 251u8, 235u8, 164u8, 113u8, 111u8, - 134u8, 93u8, 90u8, 90u8, 12u8, 212u8, 60u8, 188u8, 209u8, 11u8, 233u8, + 225u8, 142u8, 54u8, 240u8, 129u8, 69u8, 56u8, 230u8, 207u8, 110u8, + 78u8, 150u8, 87u8, 254u8, 95u8, 73u8, 74u8, 204u8, 165u8, 239u8, 246u8, + 132u8, 251u8, 183u8, 36u8, 102u8, 236u8, 244u8, 201u8, 2u8, 233u8, + 255u8, ], ) } @@ -5573,10 +5587,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 156u8, 178u8, 81u8, 158u8, 54u8, 35u8, 247u8, 189u8, 201u8, 227u8, - 26u8, 122u8, 219u8, 223u8, 92u8, 151u8, 189u8, 42u8, 137u8, 149u8, - 254u8, 183u8, 77u8, 2u8, 204u8, 112u8, 53u8, 235u8, 150u8, 120u8, 10u8, - 115u8, + 158u8, 202u8, 183u8, 44u8, 48u8, 102u8, 44u8, 53u8, 74u8, 193u8, 176u8, + 21u8, 240u8, 144u8, 135u8, 240u8, 87u8, 70u8, 132u8, 36u8, 229u8, + 233u8, 249u8, 55u8, 129u8, 81u8, 37u8, 193u8, 207u8, 252u8, 49u8, + 165u8, ], ) } @@ -5617,10 +5631,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 218u8, 137u8, 252u8, 13u8, 121u8, 128u8, 180u8, 62u8, 53u8, 213u8, - 72u8, 108u8, 241u8, 211u8, 254u8, 111u8, 240u8, 200u8, 251u8, 16u8, - 229u8, 105u8, 202u8, 252u8, 94u8, 76u8, 12u8, 163u8, 115u8, 109u8, - 167u8, 70u8, + 73u8, 79u8, 70u8, 138u8, 189u8, 239u8, 243u8, 180u8, 250u8, 183u8, + 246u8, 40u8, 204u8, 164u8, 154u8, 219u8, 87u8, 144u8, 44u8, 185u8, + 181u8, 130u8, 147u8, 11u8, 156u8, 54u8, 201u8, 207u8, 238u8, 76u8, + 61u8, 179u8, ], ) } @@ -5647,10 +5661,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 165u8, 208u8, 120u8, 60u8, 9u8, 191u8, 94u8, 147u8, 17u8, 13u8, 38u8, - 196u8, 105u8, 123u8, 10u8, 222u8, 227u8, 230u8, 145u8, 91u8, 95u8, - 91u8, 93u8, 84u8, 216u8, 176u8, 53u8, 188u8, 251u8, 255u8, 113u8, - 204u8, + 158u8, 154u8, 219u8, 160u8, 184u8, 209u8, 41u8, 234u8, 126u8, 157u8, + 63u8, 92u8, 143u8, 2u8, 82u8, 145u8, 45u8, 145u8, 148u8, 27u8, 48u8, + 255u8, 95u8, 70u8, 182u8, 146u8, 199u8, 252u8, 87u8, 105u8, 12u8, + 187u8, ], ) } @@ -8270,6 +8284,44 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Unlocked"; } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[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: ::subxt::utils::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Frozen { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Frozen"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[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: ::subxt::utils::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Thawed { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Thawed"; + } } pub mod storage { use super::runtime_types; @@ -12029,63 +12081,6 @@ pub mod api { ], ) } - #[doc = " Enumerates all reports of a kind along with the time they happened."] - #[doc = ""] - #[doc = " All reports are sorted by the time of offence."] - #[doc = ""] - #[doc = " Note that the actual type of this mapping is `Vec`, this is because values of"] - #[doc = " different types are not supported at the moment so we are doing the manual serialization."] - pub fn reports_by_kind_index( - &self, - _0: impl ::std::borrow::Borrow<[::core::primitive::u8; 16usize]>, - ) -> ::subxt::storage::address::Address< - ::subxt::storage::address::StaticStorageMapKey, - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::storage::address::Yes, - ::subxt::storage::address::Yes, - ::subxt::storage::address::Yes, - > { - ::subxt::storage::address::Address::new_static( - "Offences", - "ReportsByKindIndex", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], - [ - 162u8, 66u8, 131u8, 48u8, 250u8, 237u8, 179u8, 214u8, 36u8, 137u8, - 226u8, 136u8, 120u8, 61u8, 215u8, 43u8, 164u8, 50u8, 91u8, 164u8, 20u8, - 96u8, 189u8, 100u8, 242u8, 106u8, 21u8, 136u8, 98u8, 215u8, 180u8, - 145u8, - ], - ) - } - #[doc = " Enumerates all reports of a kind along with the time they happened."] - #[doc = ""] - #[doc = " All reports are sorted by the time of offence."] - #[doc = ""] - #[doc = " Note that the actual type of this mapping is `Vec`, this is because values of"] - #[doc = " different types are not supported at the moment so we are doing the manual serialization."] - pub fn reports_by_kind_index_root( - &self, - ) -> ::subxt::storage::address::Address< - ::subxt::storage::address::StaticStorageMapKey, - ::std::vec::Vec<::core::primitive::u8>, - (), - ::subxt::storage::address::Yes, - ::subxt::storage::address::Yes, - > { - ::subxt::storage::address::Address::new_static( - "Offences", - "ReportsByKindIndex", - Vec::new(), - [ - 162u8, 66u8, 131u8, 48u8, 250u8, 237u8, 179u8, 214u8, 36u8, 137u8, - 226u8, 136u8, 120u8, 61u8, 215u8, 43u8, 164u8, 50u8, 91u8, 164u8, 20u8, - 96u8, 189u8, 100u8, 242u8, 106u8, 21u8, 136u8, 98u8, 215u8, 180u8, - 145u8, - ], - ) - } } } } @@ -15321,10 +15316,9 @@ pub mod api { length_bound, }, [ - 207u8, 27u8, 175u8, 137u8, 87u8, 176u8, 52u8, 110u8, 175u8, 212u8, - 118u8, 136u8, 200u8, 108u8, 251u8, 232u8, 201u8, 155u8, 93u8, 62u8, - 38u8, 186u8, 198u8, 52u8, 26u8, 45u8, 214u8, 101u8, 202u8, 106u8, 99u8, - 219u8, + 0u8, 74u8, 70u8, 223u8, 112u8, 196u8, 199u8, 189u8, 93u8, 14u8, 101u8, + 211u8, 221u8, 38u8, 32u8, 220u8, 90u8, 120u8, 94u8, 107u8, 46u8, 121u8, + 250u8, 150u8, 26u8, 24u8, 20u8, 242u8, 253u8, 229u8, 43u8, 195u8, ], ) } @@ -15357,9 +15351,9 @@ pub mod api { length_bound, }, [ - 254u8, 227u8, 169u8, 126u8, 6u8, 164u8, 171u8, 55u8, 56u8, 151u8, 88u8, - 86u8, 190u8, 117u8, 162u8, 67u8, 200u8, 76u8, 182u8, 147u8, 104u8, - 250u8, 42u8, 76u8, 60u8, 234u8, 210u8, 0u8, 74u8, 178u8, 164u8, 129u8, + 157u8, 103u8, 73u8, 75u8, 15u8, 79u8, 50u8, 64u8, 5u8, 151u8, 194u8, + 216u8, 45u8, 47u8, 128u8, 206u8, 191u8, 52u8, 5u8, 104u8, 70u8, 6u8, + 139u8, 184u8, 12u8, 190u8, 109u8, 132u8, 195u8, 177u8, 197u8, 179u8, ], ) } @@ -15657,9 +15651,9 @@ pub mod api { _0.borrow(), )], [ - 112u8, 100u8, 134u8, 22u8, 5u8, 252u8, 154u8, 197u8, 212u8, 0u8, 30u8, - 67u8, 152u8, 38u8, 106u8, 78u8, 241u8, 69u8, 252u8, 61u8, 156u8, 34u8, - 151u8, 254u8, 20u8, 47u8, 22u8, 70u8, 136u8, 146u8, 55u8, 120u8, + 6u8, 23u8, 244u8, 48u8, 73u8, 203u8, 222u8, 109u8, 218u8, 166u8, 6u8, + 137u8, 121u8, 88u8, 54u8, 188u8, 37u8, 8u8, 229u8, 217u8, 170u8, 108u8, + 198u8, 66u8, 36u8, 92u8, 107u8, 168u8, 162u8, 204u8, 210u8, 20u8, ], ) } @@ -15678,9 +15672,9 @@ pub mod api { "ProposalOf", Vec::new(), [ - 112u8, 100u8, 134u8, 22u8, 5u8, 252u8, 154u8, 197u8, 212u8, 0u8, 30u8, - 67u8, 152u8, 38u8, 106u8, 78u8, 241u8, 69u8, 252u8, 61u8, 156u8, 34u8, - 151u8, 254u8, 20u8, 47u8, 22u8, 70u8, 136u8, 146u8, 55u8, 120u8, + 6u8, 23u8, 244u8, 48u8, 73u8, 203u8, 222u8, 109u8, 218u8, 166u8, 6u8, + 137u8, 121u8, 88u8, 54u8, 188u8, 37u8, 8u8, 229u8, 217u8, 170u8, 108u8, + 198u8, 66u8, 36u8, 92u8, 107u8, 168u8, 162u8, 204u8, 210u8, 20u8, ], ) } @@ -16030,10 +16024,9 @@ pub mod api { length_bound, }, [ - 207u8, 27u8, 175u8, 137u8, 87u8, 176u8, 52u8, 110u8, 175u8, 212u8, - 118u8, 136u8, 200u8, 108u8, 251u8, 232u8, 201u8, 155u8, 93u8, 62u8, - 38u8, 186u8, 198u8, 52u8, 26u8, 45u8, 214u8, 101u8, 202u8, 106u8, 99u8, - 219u8, + 0u8, 74u8, 70u8, 223u8, 112u8, 196u8, 199u8, 189u8, 93u8, 14u8, 101u8, + 211u8, 221u8, 38u8, 32u8, 220u8, 90u8, 120u8, 94u8, 107u8, 46u8, 121u8, + 250u8, 150u8, 26u8, 24u8, 20u8, 242u8, 253u8, 229u8, 43u8, 195u8, ], ) } @@ -16066,9 +16059,9 @@ pub mod api { length_bound, }, [ - 254u8, 227u8, 169u8, 126u8, 6u8, 164u8, 171u8, 55u8, 56u8, 151u8, 88u8, - 86u8, 190u8, 117u8, 162u8, 67u8, 200u8, 76u8, 182u8, 147u8, 104u8, - 250u8, 42u8, 76u8, 60u8, 234u8, 210u8, 0u8, 74u8, 178u8, 164u8, 129u8, + 157u8, 103u8, 73u8, 75u8, 15u8, 79u8, 50u8, 64u8, 5u8, 151u8, 194u8, + 216u8, 45u8, 47u8, 128u8, 206u8, 191u8, 52u8, 5u8, 104u8, 70u8, 6u8, + 139u8, 184u8, 12u8, 190u8, 109u8, 132u8, 195u8, 177u8, 197u8, 179u8, ], ) } @@ -16366,9 +16359,9 @@ pub mod api { _0.borrow(), )], [ - 112u8, 100u8, 134u8, 22u8, 5u8, 252u8, 154u8, 197u8, 212u8, 0u8, 30u8, - 67u8, 152u8, 38u8, 106u8, 78u8, 241u8, 69u8, 252u8, 61u8, 156u8, 34u8, - 151u8, 254u8, 20u8, 47u8, 22u8, 70u8, 136u8, 146u8, 55u8, 120u8, + 6u8, 23u8, 244u8, 48u8, 73u8, 203u8, 222u8, 109u8, 218u8, 166u8, 6u8, + 137u8, 121u8, 88u8, 54u8, 188u8, 37u8, 8u8, 229u8, 217u8, 170u8, 108u8, + 198u8, 66u8, 36u8, 92u8, 107u8, 168u8, 162u8, 204u8, 210u8, 20u8, ], ) } @@ -16387,9 +16380,9 @@ pub mod api { "ProposalOf", Vec::new(), [ - 112u8, 100u8, 134u8, 22u8, 5u8, 252u8, 154u8, 197u8, 212u8, 0u8, 30u8, - 67u8, 152u8, 38u8, 106u8, 78u8, 241u8, 69u8, 252u8, 61u8, 156u8, 34u8, - 151u8, 254u8, 20u8, 47u8, 22u8, 70u8, 136u8, 146u8, 55u8, 120u8, + 6u8, 23u8, 244u8, 48u8, 73u8, 203u8, 222u8, 109u8, 218u8, 166u8, 6u8, + 137u8, 121u8, 88u8, 54u8, 188u8, 37u8, 8u8, 229u8, 217u8, 170u8, 108u8, + 198u8, 66u8, 36u8, 92u8, 107u8, 168u8, 162u8, 204u8, 210u8, 20u8, ], ) } @@ -20155,10 +20148,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 123u8, 26u8, 93u8, 35u8, 214u8, 158u8, 129u8, 60u8, 147u8, 163u8, 50u8, - 19u8, 70u8, 25u8, 39u8, 205u8, 251u8, 178u8, 129u8, 202u8, 201u8, - 186u8, 27u8, 115u8, 129u8, 216u8, 139u8, 255u8, 104u8, 38u8, 41u8, - 66u8, + 97u8, 254u8, 134u8, 138u8, 68u8, 168u8, 207u8, 37u8, 107u8, 232u8, + 197u8, 219u8, 22u8, 91u8, 16u8, 162u8, 159u8, 99u8, 232u8, 92u8, 187u8, + 182u8, 231u8, 220u8, 235u8, 215u8, 186u8, 185u8, 40u8, 131u8, 191u8, + 37u8, ], ) } @@ -21439,9 +21432,9 @@ pub mod api { "batch", types::Batch { calls }, [ - 12u8, 135u8, 86u8, 65u8, 103u8, 75u8, 121u8, 211u8, 245u8, 38u8, 169u8, - 197u8, 234u8, 144u8, 84u8, 134u8, 129u8, 181u8, 119u8, 60u8, 213u8, - 152u8, 51u8, 172u8, 5u8, 146u8, 191u8, 24u8, 95u8, 241u8, 231u8, 209u8, + 221u8, 151u8, 56u8, 10u8, 237u8, 176u8, 153u8, 88u8, 29u8, 225u8, 27u8, + 231u8, 98u8, 222u8, 51u8, 94u8, 88u8, 16u8, 40u8, 253u8, 61u8, 35u8, + 70u8, 110u8, 15u8, 75u8, 102u8, 140u8, 125u8, 54u8, 223u8, 231u8, ], ) } @@ -21471,9 +21464,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 89u8, 62u8, 73u8, 74u8, 166u8, 135u8, 73u8, 171u8, 138u8, 219u8, 165u8, - 15u8, 77u8, 52u8, 179u8, 117u8, 96u8, 118u8, 50u8, 56u8, 187u8, 159u8, - 9u8, 185u8, 58u8, 183u8, 31u8, 128u8, 108u8, 62u8, 102u8, 197u8, + 154u8, 209u8, 156u8, 16u8, 183u8, 67u8, 69u8, 4u8, 187u8, 100u8, 27u8, + 221u8, 195u8, 187u8, 165u8, 6u8, 121u8, 94u8, 27u8, 111u8, 214u8, 91u8, + 83u8, 160u8, 242u8, 13u8, 236u8, 70u8, 155u8, 94u8, 78u8, 71u8, ], ) } @@ -21499,9 +21492,10 @@ pub mod api { "batch_all", types::BatchAll { calls }, [ - 126u8, 64u8, 7u8, 172u8, 174u8, 142u8, 40u8, 181u8, 203u8, 6u8, 157u8, - 178u8, 112u8, 250u8, 152u8, 101u8, 16u8, 93u8, 4u8, 39u8, 14u8, 180u8, - 217u8, 51u8, 19u8, 100u8, 77u8, 65u8, 50u8, 98u8, 183u8, 79u8, + 255u8, 107u8, 81u8, 108u8, 78u8, 19u8, 231u8, 220u8, 177u8, 177u8, + 28u8, 24u8, 100u8, 228u8, 227u8, 45u8, 3u8, 51u8, 132u8, 12u8, 48u8, + 158u8, 67u8, 201u8, 193u8, 126u8, 251u8, 177u8, 102u8, 251u8, 90u8, + 81u8, ], ) } @@ -21524,9 +21518,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 70u8, 103u8, 7u8, 7u8, 211u8, 56u8, 21u8, 249u8, 171u8, 126u8, 62u8, - 205u8, 184u8, 235u8, 35u8, 45u8, 101u8, 204u8, 176u8, 223u8, 38u8, - 15u8, 93u8, 189u8, 254u8, 195u8, 12u8, 157u8, 234u8, 96u8, 15u8, 50u8, + 74u8, 215u8, 136u8, 17u8, 87u8, 74u8, 107u8, 176u8, 229u8, 23u8, 109u8, + 233u8, 84u8, 229u8, 27u8, 35u8, 154u8, 93u8, 104u8, 222u8, 71u8, 167u8, + 39u8, 12u8, 235u8, 46u8, 204u8, 125u8, 67u8, 96u8, 236u8, 91u8, ], ) } @@ -21552,9 +21546,10 @@ pub mod api { "force_batch", types::ForceBatch { calls }, [ - 46u8, 245u8, 217u8, 95u8, 0u8, 142u8, 186u8, 62u8, 104u8, 197u8, 181u8, - 213u8, 218u8, 35u8, 75u8, 227u8, 67u8, 210u8, 215u8, 187u8, 5u8, 41u8, - 210u8, 165u8, 155u8, 35u8, 184u8, 71u8, 114u8, 184u8, 151u8, 82u8, + 183u8, 158u8, 12u8, 76u8, 9u8, 251u8, 54u8, 89u8, 139u8, 70u8, 51u8, + 72u8, 181u8, 28u8, 110u8, 207u8, 211u8, 236u8, 224u8, 44u8, 104u8, + 231u8, 238u8, 141u8, 176u8, 194u8, 100u8, 217u8, 63u8, 127u8, 166u8, + 24u8, ], ) } @@ -21577,9 +21572,9 @@ pub mod api { weight, }, [ - 127u8, 67u8, 196u8, 63u8, 164u8, 121u8, 43u8, 61u8, 37u8, 147u8, 131u8, - 88u8, 217u8, 192u8, 202u8, 66u8, 93u8, 42u8, 210u8, 128u8, 227u8, 8u8, - 6u8, 93u8, 232u8, 26u8, 240u8, 67u8, 30u8, 152u8, 94u8, 153u8, + 206u8, 4u8, 190u8, 61u8, 107u8, 61u8, 249u8, 88u8, 255u8, 170u8, 65u8, + 96u8, 12u8, 54u8, 149u8, 75u8, 250u8, 153u8, 103u8, 142u8, 117u8, 64u8, + 45u8, 189u8, 129u8, 28u8, 143u8, 78u8, 53u8, 188u8, 178u8, 19u8, ], ) } @@ -23176,10 +23171,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 14u8, 42u8, 86u8, 28u8, 32u8, 98u8, 119u8, 113u8, 168u8, 61u8, 112u8, - 87u8, 153u8, 37u8, 135u8, 82u8, 131u8, 185u8, 116u8, 230u8, 182u8, - 38u8, 134u8, 76u8, 161u8, 103u8, 131u8, 167u8, 138u8, 123u8, 34u8, - 104u8, + 29u8, 33u8, 67u8, 179u8, 234u8, 241u8, 45u8, 167u8, 110u8, 23u8, 85u8, + 27u8, 1u8, 184u8, 223u8, 187u8, 129u8, 206u8, 75u8, 237u8, 235u8, + 207u8, 43u8, 201u8, 194u8, 145u8, 149u8, 184u8, 95u8, 185u8, 205u8, + 248u8, ], ) } @@ -23459,9 +23454,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 8u8, 182u8, 157u8, 71u8, 2u8, 217u8, 103u8, 34u8, 52u8, 133u8, 231u8, - 248u8, 189u8, 158u8, 103u8, 53u8, 149u8, 166u8, 108u8, 226u8, 32u8, - 92u8, 174u8, 134u8, 220u8, 98u8, 17u8, 32u8, 140u8, 38u8, 200u8, 184u8, + 144u8, 103u8, 250u8, 31u8, 18u8, 158u8, 175u8, 139u8, 73u8, 56u8, + 178u8, 80u8, 164u8, 100u8, 162u8, 163u8, 119u8, 102u8, 177u8, 28u8, + 229u8, 128u8, 250u8, 242u8, 26u8, 223u8, 74u8, 180u8, 127u8, 124u8, + 134u8, 123u8, ], ) } @@ -23938,9 +23934,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 0u8, 101u8, 233u8, 4u8, 27u8, 61u8, 6u8, 243u8, 253u8, 208u8, 93u8, - 58u8, 221u8, 46u8, 248u8, 243u8, 6u8, 162u8, 59u8, 209u8, 185u8, 2u8, - 76u8, 95u8, 189u8, 8u8, 84u8, 89u8, 119u8, 25u8, 25u8, 116u8, + 113u8, 140u8, 77u8, 180u8, 170u8, 232u8, 85u8, 229u8, 218u8, 187u8, + 62u8, 64u8, 168u8, 186u8, 173u8, 27u8, 125u8, 216u8, 54u8, 167u8, + 225u8, 241u8, 10u8, 226u8, 138u8, 151u8, 242u8, 255u8, 212u8, 160u8, + 106u8, 69u8, ], ) } @@ -24004,10 +24001,10 @@ pub mod api { max_weight, }, [ - 172u8, 94u8, 125u8, 12u8, 125u8, 129u8, 89u8, 29u8, 172u8, 187u8, - 194u8, 188u8, 111u8, 34u8, 41u8, 94u8, 237u8, 82u8, 167u8, 33u8, 30u8, - 145u8, 155u8, 185u8, 169u8, 83u8, 60u8, 212u8, 138u8, 184u8, 152u8, - 58u8, + 167u8, 155u8, 31u8, 18u8, 196u8, 45u8, 139u8, 126u8, 185u8, 246u8, + 31u8, 88u8, 200u8, 228u8, 82u8, 139u8, 123u8, 239u8, 169u8, 185u8, + 227u8, 160u8, 71u8, 242u8, 152u8, 146u8, 87u8, 243u8, 170u8, 237u8, + 11u8, 6u8, ], ) } @@ -34073,18 +34070,6 @@ pub mod api { pub mod dmp { use super::root_mod; use super::runtime_types; - #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] - pub type Call = runtime_types::polkadot_runtime_parachains::dmp::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; - } - pub struct TransactionApi; - impl TransactionApi {} - } pub mod storage { use super::runtime_types; pub struct StorageApi; @@ -34201,6 +34186,53 @@ pub mod api { ], ) } + #[doc = " The number to multiply the base delivery fee by."] + pub fn delivery_fee_factor( + &self, + _0: impl ::std::borrow::Borrow, + ) -> ::subxt::storage::address::Address< + ::subxt::storage::address::StaticStorageMapKey, + runtime_types::sp_arithmetic::fixed_point::FixedU128, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::Address::new_static( + "Dmp", + "DeliveryFeeFactor", + vec![::subxt::storage::address::make_static_storage_map_key( + _0.borrow(), + )], + [ + 74u8, 221u8, 160u8, 244u8, 128u8, 163u8, 79u8, 26u8, 35u8, 182u8, + 211u8, 224u8, 181u8, 42u8, 98u8, 193u8, 128u8, 249u8, 40u8, 122u8, + 208u8, 19u8, 64u8, 8u8, 156u8, 165u8, 156u8, 59u8, 112u8, 197u8, 160u8, + 87u8, + ], + ) + } + #[doc = " The number to multiply the base delivery fee by."] + pub fn delivery_fee_factor_root( + &self, + ) -> ::subxt::storage::address::Address< + ::subxt::storage::address::StaticStorageMapKey, + runtime_types::sp_arithmetic::fixed_point::FixedU128, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::Address::new_static( + "Dmp", + "DeliveryFeeFactor", + Vec::new(), + [ + 74u8, 221u8, 160u8, 244u8, 128u8, 163u8, 79u8, 26u8, 35u8, 182u8, + 211u8, 224u8, 181u8, 42u8, 98u8, 193u8, 128u8, 249u8, 40u8, 122u8, + 208u8, 19u8, 64u8, 8u8, 156u8, 165u8, 156u8, 59u8, 112u8, 197u8, 160u8, + 87u8, + ], + ) + } } } } @@ -36285,6 +36317,164 @@ pub mod api { } } } + pub mod paras_slashing { + use super::root_mod; + use super::runtime_types; + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub type Error = + runtime_types::polkadot_runtime_parachains::disputes::slashing::pallet::Error; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub type Call = + runtime_types::polkadot_runtime_parachains::disputes::slashing::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 :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct ReportDisputeLostUnsigned { pub dispute_proof : :: std :: boxed :: Box < runtime_types :: polkadot_runtime_parachains :: disputes :: slashing :: DisputeProof > , pub key_owner_proof : runtime_types :: sp_session :: MembershipProof , } + impl ::subxt::blocks::StaticExtrinsic for ReportDisputeLostUnsigned { + const PALLET: &'static str = "ParasSlashing"; + const CALL: &'static str = "report_dispute_lost_unsigned"; + } + } + pub struct TransactionApi; + impl TransactionApi { + pub fn report_dispute_lost_unsigned( + &self, + dispute_proof : runtime_types :: polkadot_runtime_parachains :: disputes :: slashing :: DisputeProof, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::tx::Payload { + ::subxt::tx::Payload::new_static( + "ParasSlashing", + "report_dispute_lost_unsigned", + types::ReportDisputeLostUnsigned { + dispute_proof: ::std::boxed::Box::new(dispute_proof), + key_owner_proof, + }, + [ + 56u8, 94u8, 136u8, 125u8, 219u8, 155u8, 79u8, 241u8, 109u8, 125u8, + 106u8, 175u8, 5u8, 189u8, 34u8, 232u8, 132u8, 113u8, 157u8, 184u8, + 10u8, 34u8, 135u8, 184u8, 36u8, 224u8, 234u8, 141u8, 35u8, 69u8, 254u8, + 125u8, + ], + ) + } + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Validators pending dispute slashes."] + pub fn unapplied_slashes( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow< + runtime_types::polkadot_core_primitives::CandidateHash, + >, + ) -> ::subxt::storage::address::Address< + ::subxt::storage::address::StaticStorageMapKey, + runtime_types::polkadot_runtime_parachains::disputes::slashing::PendingSlashes, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::Address::new_static( + "ParasSlashing", + "UnappliedSlashes", + vec![ + ::subxt::storage::address::make_static_storage_map_key(_0.borrow()), + ::subxt::storage::address::make_static_storage_map_key(_1.borrow()), + ], + [ + 54u8, 95u8, 76u8, 24u8, 68u8, 137u8, 201u8, 120u8, 51u8, 146u8, 12u8, + 14u8, 39u8, 109u8, 69u8, 148u8, 117u8, 193u8, 139u8, 82u8, 23u8, 77u8, + 0u8, 16u8, 64u8, 125u8, 181u8, 249u8, 23u8, 156u8, 70u8, 90u8, + ], + ) + } + #[doc = " Validators pending dispute slashes."] + pub fn unapplied_slashes_root( + &self, + ) -> ::subxt::storage::address::Address< + ::subxt::storage::address::StaticStorageMapKey, + runtime_types::polkadot_runtime_parachains::disputes::slashing::PendingSlashes, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::Address::new_static( + "ParasSlashing", + "UnappliedSlashes", + Vec::new(), + [ + 54u8, 95u8, 76u8, 24u8, 68u8, 137u8, 201u8, 120u8, 51u8, 146u8, 12u8, + 14u8, 39u8, 109u8, 69u8, 148u8, 117u8, 193u8, 139u8, 82u8, 23u8, 77u8, + 0u8, 16u8, 64u8, 125u8, 181u8, 249u8, 23u8, 156u8, 70u8, 90u8, + ], + ) + } + #[doc = " `ValidatorSetCount` per session."] + pub fn validator_set_counts( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::Address< + ::subxt::storage::address::StaticStorageMapKey, + ::core::primitive::u32, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::Address::new_static( + "ParasSlashing", + "ValidatorSetCounts", + vec![::subxt::storage::address::make_static_storage_map_key( + _0.borrow(), + )], + [ + 121u8, 241u8, 222u8, 61u8, 186u8, 55u8, 206u8, 246u8, 31u8, 128u8, + 103u8, 53u8, 6u8, 73u8, 13u8, 120u8, 63u8, 56u8, 167u8, 75u8, 113u8, + 102u8, 221u8, 129u8, 151u8, 186u8, 225u8, 169u8, 128u8, 192u8, 107u8, + 214u8, + ], + ) + } + #[doc = " `ValidatorSetCount` per session."] + pub fn validator_set_counts_root( + &self, + ) -> ::subxt::storage::address::Address< + ::subxt::storage::address::StaticStorageMapKey, + ::core::primitive::u32, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::Address::new_static( + "ParasSlashing", + "ValidatorSetCounts", + Vec::new(), + [ + 121u8, 241u8, 222u8, 61u8, 186u8, 55u8, 206u8, 246u8, 31u8, 128u8, + 103u8, 53u8, 6u8, 73u8, 13u8, 120u8, 63u8, 56u8, 167u8, 75u8, 113u8, + 102u8, 221u8, 129u8, 151u8, 186u8, 225u8, 169u8, 128u8, 192u8, 107u8, + 214u8, + ], + ) + } + } + } + } pub mod registrar { use super::root_mod; use super::runtime_types; @@ -36737,6 +36927,24 @@ pub mod api { const PALLET: &'static str = "Registrar"; const EVENT: &'static str = "Reserved"; } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct Swapped { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + pub other_id: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::events::StaticEvent for Swapped { + const PALLET: &'static str = "Registrar"; + const EVENT: &'static str = "Swapped"; + } } pub mod storage { use super::runtime_types; @@ -38738,6 +38946,23 @@ pub mod api { const PALLET: &'static str = "XcmPallet"; const CALL: &'static str = "limited_teleport_assets"; } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct ForceSuspension { + pub suspended: ::core::primitive::bool, + } + impl ::subxt::blocks::StaticExtrinsic for ForceSuspension { + const PALLET: &'static str = "XcmPallet"; + const CALL: &'static str = "force_suspension"; + } } pub struct TransactionApi; impl TransactionApi { @@ -38870,7 +39095,7 @@ pub mod api { #[doc = "Extoll that a particular destination can be communicated with through a particular"] #[doc = "version of XCM."] #[doc = ""] - #[doc = "- `origin`: Must be Root."] + #[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( @@ -38895,7 +39120,7 @@ pub mod api { #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] #[doc = "version a destination can accept is unknown)."] #[doc = ""] - #[doc = "- `origin`: Must be Root."] + #[doc = "- `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, @@ -38914,7 +39139,7 @@ pub mod api { } #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] #[doc = ""] - #[doc = "- `origin`: Must be Root."] + #[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, @@ -38936,7 +39161,7 @@ pub mod api { #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] #[doc = "version changes."] #[doc = ""] - #[doc = "- `origin`: Must be Root."] + #[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( @@ -39042,6 +39267,25 @@ pub mod api { ], ) } + #[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: ::core::primitive::bool, + ) -> ::subxt::tx::Payload { + ::subxt::tx::Payload::new_static( + "XcmPallet", + "force_suspension", + types::ForceSuspension { suspended }, + [ + 147u8, 1u8, 117u8, 148u8, 8u8, 14u8, 53u8, 167u8, 85u8, 184u8, 25u8, + 183u8, 52u8, 197u8, 12u8, 135u8, 45u8, 88u8, 13u8, 27u8, 218u8, 31u8, + 80u8, 27u8, 183u8, 36u8, 0u8, 243u8, 235u8, 85u8, 75u8, 81u8, + ], + ) + } } } #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] @@ -40021,6 +40265,28 @@ pub mod api { ], ) } + #[doc = " Global suspension state of the XCM executor."] + pub fn xcm_execution_suspended( + &self, + ) -> ::subxt::storage::address::Address< + ::subxt::storage::address::StaticStorageMapKey, + ::core::primitive::bool, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::Address::new_static( + "XcmPallet", + "XcmExecutionSuspended", + vec![], + [ + 182u8, 20u8, 35u8, 10u8, 65u8, 208u8, 52u8, 141u8, 158u8, 23u8, 46u8, + 221u8, 172u8, 110u8, 39u8, 121u8, 106u8, 104u8, 19u8, 64u8, 90u8, + 137u8, 173u8, 31u8, 112u8, 219u8, 64u8, 238u8, 125u8, 242u8, 24u8, + 107u8, + ], + ) + } } } } @@ -41215,6 +41481,18 @@ pub mod api { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128, }, + #[codec(index = 19)] + #[doc = "Some balance was frozen."] + Frozen { + who: ::subxt::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 20)] + #[doc = "Some balance was thawed."] + Thawed { + who: ::subxt::utils::AccountId32, + amount: ::core::primitive::u128, + }, } } pub mod types { @@ -49531,7 +49809,7 @@ pub mod api { #[doc = "Extoll that a particular destination can be communicated with through a particular"] #[doc = "version of XCM."] #[doc = ""] - #[doc = "- `origin`: Must be Root."] + #[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 { @@ -49543,7 +49821,7 @@ pub mod api { #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] #[doc = "version a destination can accept is unknown)."] #[doc = ""] - #[doc = "- `origin`: Must be Root."] + #[doc = "- `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>, @@ -49551,7 +49829,7 @@ pub mod api { #[codec(index = 6)] #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] #[doc = ""] - #[doc = "- `origin`: Must be Root."] + #[doc = "- `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: ::std::boxed::Box, @@ -49560,7 +49838,7 @@ pub mod api { #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] #[doc = "version changes."] #[doc = ""] - #[doc = "- `origin`: Must be Root."] + #[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 { @@ -49617,6 +49895,12 @@ pub mod api { 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 }, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -51284,14 +51568,16 @@ pub mod api { Paras(runtime_types::polkadot_runtime_parachains::paras::pallet::Call), #[codec(index = 57)] Initializer(runtime_types::polkadot_runtime_parachains::initializer::pallet::Call), - #[codec(index = 58)] - Dmp(runtime_types::polkadot_runtime_parachains::dmp::pallet::Call), #[codec(index = 59)] Ump(runtime_types::polkadot_runtime_parachains::ump::pallet::Call), #[codec(index = 60)] Hrmp(runtime_types::polkadot_runtime_parachains::hrmp::pallet::Call), #[codec(index = 62)] ParasDisputes(runtime_types::polkadot_runtime_parachains::disputes::pallet::Call), + #[codec(index = 63)] + ParasSlashing( + runtime_types::polkadot_runtime_parachains::disputes::slashing::pallet::Call, + ), #[codec(index = 70)] Registrar(runtime_types::polkadot_runtime_common::paras_registrar::pallet::Call), #[codec(index = 71)] @@ -52360,6 +52646,11 @@ pub mod api { para_id: runtime_types::polkadot_parachain::primitives::Id, who: ::subxt::utils::AccountId32, }, + #[codec(index = 3)] + Swapped { + para_id: runtime_types::polkadot_parachain::primitives::Id, + other_id: runtime_types::polkadot_parachain::primitives::Id, + }, } } #[derive( @@ -52663,6 +52954,109 @@ pub mod api { Revert(::core::primitive::u32), } } + pub mod slashing { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + # [codec (index = 0)] report_dispute_lost_unsigned { dispute_proof : :: std :: boxed :: Box < runtime_types :: polkadot_runtime_parachains :: disputes :: slashing :: DisputeProof > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "The key ownership proof is invalid."] + InvalidKeyOwnershipProof, + #[codec(index = 1)] + #[doc = "The session index is too old or invalid."] + InvalidSessionIndex, + #[codec(index = 2)] + #[doc = "The candidate hash is invalid."] + InvalidCandidateHash, + #[codec(index = 3)] + #[doc = "There is no pending slash for the given validator index and time"] + #[doc = "slot."] + InvalidValidatorIndex, + #[codec(index = 4)] + #[doc = "The validator index does not match the validator id."] + ValidatorIndexIdMismatch, + #[codec(index = 5)] + #[doc = "The given slashing report is valid but already previously reported."] + DuplicateSlashingReport, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[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_runtime_parachains :: disputes :: slashing :: DisputesTimeSlot , pub kind : runtime_types :: polkadot_runtime_parachains :: disputes :: slashing :: SlashingOffenceKind , pub validator_index : runtime_types :: polkadot_primitives :: v4 :: ValidatorIndex , pub validator_id : runtime_types :: polkadot_primitives :: v4 :: validator_app :: Public , } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[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 :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct PendingSlashes { pub keys : :: subxt :: utils :: KeyedVec < runtime_types :: polkadot_primitives :: v4 :: ValidatorIndex , runtime_types :: polkadot_primitives :: v4 :: validator_app :: Public > , pub kind : runtime_types :: polkadot_runtime_parachains :: disputes :: slashing :: SlashingOffenceKind , } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[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, + #[codec(index = 1)] + AgainstValid, + } + } #[derive( :: subxt :: ext :: codec :: Decode, :: subxt :: ext :: codec :: Encode, @@ -52696,24 +53090,6 @@ pub mod api { Invalid, } } - pub mod dmp { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - # [codec (crate = :: subxt :: ext :: codec)] - #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] - #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] - pub enum Call {} - } - } pub mod hrmp { use super::runtime_types; pub mod pallet { diff --git a/testing/ui-tests/src/correct/generic_params.rs b/testing/ui-tests/src/correct/generic_params.rs index 72db6f196f..30f024fe12 100644 --- a/testing/ui-tests/src/correct/generic_params.rs +++ b/testing/ui-tests/src/correct/generic_params.rs @@ -20,7 +20,7 @@ pub struct Second(T, U); pub struct DoesntImplEncodeDecodeAsType(u16); #[subxt::subxt( - runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", + runtime_metadata_path = "../../../../artifacts/polkadot_metadata_small.scale", substitute_type( path = "sp_runtime::multiaddress::MultiAddress", // Discarding both params: @@ -30,7 +30,7 @@ pub struct DoesntImplEncodeDecodeAsType(u16); pub mod node_runtime {} #[subxt::subxt( - runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", + runtime_metadata_path = "../../../../artifacts/polkadot_metadata_small.scale", substitute_type( path = "sp_runtime::multiaddress::MultiAddress", // Discarding second param: @@ -40,7 +40,7 @@ pub mod node_runtime {} pub mod node_runtime2 {} #[subxt::subxt( - runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", + runtime_metadata_path = "../../../../artifacts/polkadot_metadata_small.scale", substitute_type( path = "sp_runtime::multiaddress::MultiAddress", // Discarding first param: @@ -50,7 +50,7 @@ pub mod node_runtime2 {} pub mod node_runtime3 {} #[subxt::subxt( - runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", + runtime_metadata_path = "../../../../artifacts/polkadot_metadata_small.scale", substitute_type( path = "sp_runtime::multiaddress::MultiAddress", // Swapping params: @@ -60,7 +60,7 @@ pub mod node_runtime3 {} pub mod node_runtime4 {} #[subxt::subxt( - runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", + runtime_metadata_path = "../../../../artifacts/polkadot_metadata_small.scale", substitute_type( path = "sp_runtime::multiaddress::MultiAddress", // Ignore input params and just use concrete types on output: @@ -70,7 +70,7 @@ pub mod node_runtime4 {} pub mod node_runtime5 {} #[subxt::subxt( - runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", + runtime_metadata_path = "../../../../artifacts/polkadot_metadata_small.scale", substitute_type( path = "sp_runtime::multiaddress::MultiAddress", // We can put a static type in, too: @@ -80,7 +80,7 @@ pub mod node_runtime5 {} pub mod node_runtime6 {} #[subxt::subxt( - runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", + runtime_metadata_path = "../../../../artifacts/polkadot_metadata_small.scale", substitute_type( path = "sp_runtime::multiaddress::MultiAddress", // Check that things can be wrapped in our Static type: @@ -90,7 +90,7 @@ pub mod node_runtime6 {} pub mod node_runtime7 {} #[subxt::subxt( - runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", + runtime_metadata_path = "../../../../artifacts/polkadot_metadata_small.scale", substitute_type( path = "sp_runtime::multiaddress::MultiAddress", // Recursive type param substitution should work too (swapping out nested A and B): diff --git a/testing/ui-tests/src/correct/rust_items_preserved.rs b/testing/ui-tests/src/correct/rust_items_preserved.rs index e8269e768b..f784e0dda6 100644 --- a/testing/ui-tests/src/correct/rust_items_preserved.rs +++ b/testing/ui-tests/src/correct/rust_items_preserved.rs @@ -1,4 +1,4 @@ -#[subxt::subxt(runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../../../../artifacts/polkadot_metadata_tiny.scale")] pub mod node_runtime { pub struct SomeStruct; pub enum SomeEnum { diff --git a/testing/ui-tests/src/incorrect/substitute_path_not_absolute.rs b/testing/ui-tests/src/incorrect/substitute_path_not_absolute.rs index 8cac806198..470ea83a7b 100644 --- a/testing/ui-tests/src/incorrect/substitute_path_not_absolute.rs +++ b/testing/ui-tests/src/incorrect/substitute_path_not_absolute.rs @@ -1,5 +1,5 @@ #[subxt::subxt( - runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", + runtime_metadata_path = "../../../../artifacts/polkadot_metadata_tiny.scale", substitute_type( path = "sp_arithmetic::per_things::Perbill", with = "sp_runtime::Perbill" diff --git a/testing/ui-tests/src/incorrect/url_and_path_provided.rs b/testing/ui-tests/src/incorrect/url_and_path_provided.rs index 47fd5b5d26..90cc5cca57 100644 --- a/testing/ui-tests/src/incorrect/url_and_path_provided.rs +++ b/testing/ui-tests/src/incorrect/url_and_path_provided.rs @@ -1,5 +1,5 @@ #[subxt::subxt( - runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", + runtime_metadata_path = "../../../../artifacts/polkadot_metadata_tiny.scale", runtime_metadata_url = "wss://rpc.polkadot.io:443" )] pub mod node_runtime {} diff --git a/testing/ui-tests/src/incorrect/url_and_path_provided.stderr b/testing/ui-tests/src/incorrect/url_and_path_provided.stderr index 5a98277e76..2c9d48feb8 100644 --- a/testing/ui-tests/src/incorrect/url_and_path_provided.stderr +++ b/testing/ui-tests/src/incorrect/url_and_path_provided.stderr @@ -2,7 +2,7 @@ error: Only one of 'runtime_metadata_path' or 'runtime_metadata_url' can be prov --> src/incorrect/url_and_path_provided.rs:1:1 | 1 | / #[subxt::subxt( -2 | | runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale", +2 | | runtime_metadata_path = "../../../../artifacts/polkadot_metadata_tiny.scale", 3 | | runtime_metadata_url = "wss://rpc.polkadot.io:443" 4 | | )] | |__^ diff --git a/testing/ui-tests/src/lib.rs b/testing/ui-tests/src/lib.rs index 702577204b..f9f20720d5 100644 --- a/testing/ui-tests/src/lib.rs +++ b/testing/ui-tests/src/lib.rs @@ -23,7 +23,8 @@ use crate::utils::{MetadataTestRunner, PalletMetadataTestRunner}; #[test] fn ui_tests() { let mut m = MetadataTestRunner::default(); - let mut p = PalletMetadataTestRunner::new(); + // specify pallets we want to test the metadata for (None => all pallets, but specifying only Some(..) speeds up test) + let mut p = PalletMetadataTestRunner::new(Some(&["Babe", "Claims", "Grandpa", "Balances"])); let t = trybuild::TestCases::new(); t.pass("src/correct/*.rs"); diff --git a/testing/ui-tests/src/utils/pallet_metadata_test_runner.rs b/testing/ui-tests/src/utils/pallet_metadata_test_runner.rs index e87c755f23..613a274507 100644 --- a/testing/ui-tests/src/utils/pallet_metadata_test_runner.rs +++ b/testing/ui-tests/src/utils/pallet_metadata_test_runner.rs @@ -8,15 +8,17 @@ use std::io::Read; use subxt_metadata::{metadata_v14_to_latest, retain_metadata_pallets}; static TEST_DIR_PREFIX: &str = "subxt_generated_pallets_ui_tests_"; -static METADATA_FILE: &str = "../../artifacts/polkadot_metadata.scale"; +static METADATA_FILE: &str = "../../artifacts/polkadot_metadata_full.scale"; pub struct PalletMetadataTestRunner { metadata: RuntimeMetadataV15, index: usize, + pallet_names: Option>, } impl PalletMetadataTestRunner { - pub fn new() -> PalletMetadataTestRunner { + /// if pallet_names is Some(..) only the provided pallets will be tested. + pub fn new(pallet_names: Option<&[&str]>) -> PalletMetadataTestRunner { let mut file = std::fs::File::open(METADATA_FILE).expect("Cannot open metadata.scale artifact"); @@ -32,8 +34,12 @@ impl PalletMetadataTestRunner { frame_metadata::RuntimeMetadata::V15(v15) => v15, _ => panic!("Unsupported metadata version {:?}", meta.1), }; - - PalletMetadataTestRunner { metadata, index: 0 } + let pallet_names = pallet_names.map(|v| v.iter().map(|e| e.to_string()).collect()); + PalletMetadataTestRunner { + metadata, + index: 0, + pallet_names, + } } pub fn path_to_next_ui_test(&mut self) -> Option { @@ -41,10 +47,15 @@ impl PalletMetadataTestRunner { return None }; let test_name = &pallet.name; - // Increment test index to avoid overlaps. let index = self.index; self.index += 1; + // if a pallet filter is set (pallet_names is Some), return the next pallet if this pallet is not in the filter. + if let Some(name_filter) = self.pallet_names.as_ref() { + if !name_filter.contains(test_name) { + return self.path_to_next_ui_test(); + } + } // Build custom metadata containing only this pallet. let mut metadata = self.metadata.clone(); @@ -92,9 +103,17 @@ impl PalletMetadataTestRunner { impl Drop for PalletMetadataTestRunner { fn drop(&mut self) { for i in 0..self.index { - let mut tmp_dir = std::env::temp_dir(); - tmp_dir.push(format!("{TEST_DIR_PREFIX}{i}")); - std::fs::remove_dir_all(tmp_dir).expect("cannot cleanup temp files"); + if let Some(pallet) = self.metadata.pallets.get(self.index) { + if let Some(name_filter) = self.pallet_names.as_ref() { + if !name_filter.contains(&pallet.name) { + continue; + } + } + + let mut tmp_dir = std::env::temp_dir(); + tmp_dir.push(format!("{TEST_DIR_PREFIX}{i}")); + std::fs::remove_dir_all(tmp_dir).expect("cannot cleanup temp files"); + }; } } }