From 8524b08309c1b5b1a988783453eafa3265357cc9 Mon Sep 17 00:00:00 2001 From: SCC <87012234+Jinsipang@users.noreply.github.com> Date: Fri, 11 Nov 2022 17:30:05 +0800 Subject: [PATCH] Update v0.9.30 (#942) * some deps update to v0.9.30 * deps update to v0.9.30 * format code * change deps * fix docker file * fix docker file * change docker file * change docker file * fix docker yml file * fix docker yml file * fix docker yml file * add install dependencis shell * fix install dependencis shell * fix install dependencis shell * fix docker file * fix yml file * add sudo permisson * add some dep Co-authored-by: Chengcheng Shi --- .github/workflows/build-and-test.yml | 12 + .github/workflows/coverage.yml | 2 +- Cargo.lock | 1416 ++++++++++------- docker/Dockerfile | 2 +- mock-tee-primitives/Cargo.toml | 6 +- node/Cargo.toml | 106 +- node/src/service.rs | 9 +- pallets/bridge-transfer/Cargo.toml | 20 +- pallets/bridge-transfer/src/benchmarking.rs | 2 +- pallets/bridge-transfer/src/lib.rs | 6 +- pallets/bridge-transfer/src/mock.rs | 18 +- pallets/bridge-transfer/src/tests.rs | 95 +- pallets/bridge/Cargo.toml | 16 +- pallets/bridge/src/benchmarking.rs | 2 +- pallets/bridge/src/lib.rs | 30 +- pallets/bridge/src/mock.rs | 28 +- pallets/bridge/src/tests.rs | 122 +- pallets/drop3/Cargo.toml | 16 +- pallets/drop3/src/benchmarking.rs | 6 +- pallets/drop3/src/lib.rs | 4 +- pallets/drop3/src/mock.rs | 12 +- pallets/drop3/src/tests.rs | 298 +++- pallets/extrinsic-filter/Cargo.toml | 18 +- pallets/extrinsic-filter/src/benchmarking.rs | 2 +- pallets/extrinsic-filter/src/lib.rs | 18 +- pallets/extrinsic-filter/src/mock.rs | 25 +- pallets/extrinsic-filter/src/tests.rs | 276 ++-- pallets/identity-management-mock/Cargo.toml | 22 +- pallets/identity-management-mock/src/lib.rs | 6 +- pallets/identity-management-mock/src/mock.rs | 59 +- pallets/identity-management-mock/src/tests.rs | 2 +- pallets/identity-management/Cargo.toml | 23 +- .../identity-management/src/benchmarking.rs | 2 +- pallets/identity-management/src/lib.rs | 4 +- pallets/identity-management/src/mock.rs | 14 +- pallets/identity-management/src/tests.rs | 36 +- pallets/parachain-staking/Cargo.toml | 22 +- pallets/parachain-staking/src/benchmarking.rs | 2 +- pallets/parachain-staking/src/lib.rs | 8 +- pallets/parachain-staking/src/mock.rs | 16 +- pallets/parachain-staking/src/tests.rs | 1033 +++++++----- pallets/vc-management/Cargo.toml | 20 +- pallets/vc-management/src/lib.rs | 4 +- pallets/vc-management/src/mock.rs | 10 +- pallets/vc-management/src/tests.rs | 50 +- pallets/xcm-asset-manager/Cargo.toml | 20 +- pallets/xcm-asset-manager/src/lib.rs | 4 +- pallets/xcm-asset-manager/src/mock.rs | 12 +- pallets/xcm-asset-manager/src/tests.rs | 136 +- primitives/Cargo.toml | 10 +- runtime/common/Cargo.toml | 62 +- runtime/common/src/lib.rs | 13 +- runtime/common/src/tests/base_call_filter.rs | 30 +- runtime/common/src/tests/orml_xcm.rs | 24 +- runtime/common/src/tests/setup/mod.rs | 5 +- runtime/common/src/tests/setup/relay.rs | 30 +- .../common/src/tests/transaction_payment.rs | 17 +- runtime/common/src/tests/xcm_parachain/mod.rs | 21 +- runtime/litentry/Cargo.toml | 126 +- runtime/litentry/src/asset_config.rs | 9 +- runtime/litentry/src/lib.rs | 167 +- .../litentry/src/tests/base_call_filter.rs | 4 +- runtime/litentry/src/tests/mod.rs | 8 +- runtime/litentry/src/tests/orml_xcm.rs | 29 +- .../litentry/src/tests/transaction_payment.rs | 4 +- runtime/litentry/src/weights/pallet_proxy.rs | 18 +- runtime/litentry/src/xcm_config.rs | 36 +- runtime/litmus/Cargo.toml | 134 +- runtime/litmus/src/asset_config.rs | 9 +- runtime/litmus/src/lib.rs | 167 +- runtime/litmus/src/tests/base_call_filter.rs | 4 +- runtime/litmus/src/tests/mod.rs | 8 +- runtime/litmus/src/tests/orml_xcm.rs | 29 +- runtime/litmus/src/weights/pallet_proxy.rs | 16 +- runtime/litmus/src/xcm_config.rs | 36 +- runtime/rococo/Cargo.toml | 136 +- runtime/rococo/src/asset_config.rs | 9 +- runtime/rococo/src/lib.rs | 200 +-- runtime/rococo/src/tests/base_call_filter.rs | 4 +- runtime/rococo/src/tests/mod.rs | 8 +- runtime/rococo/src/tests/orml_xcm.rs | 29 +- runtime/rococo/src/weights/pallet_proxy.rs | 16 +- runtime/rococo/src/xcm_config.rs | 36 +- 83 files changed, 3190 insertions(+), 2336 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a25f9afa8c..344b10e0d9 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -107,6 +107,12 @@ jobs: target: wasm32-unknown-unknown default: true + - name: Install protobuf + run: | + sudo apt-get update && \ + sudo apt-get upgrade -y && \ + sudo apt-get install -yq openssl clang libclang-dev cmake protobuf-compiler + - name: Run cargo clippy check run: make clippy @@ -299,6 +305,12 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install protobuf + run: | + sudo apt-get update && \ + sudo apt-get upgrade -y && \ + sudo apt-get install -yq openssl clang libclang-dev cmake protobuf-compiler + - name: Cache cargo registry if: needs.check-file-change.outputs.src == 'true' uses: actions/cache@v3 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index be3d65415d..99c1c49210 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -38,7 +38,7 @@ jobs: - name: Install additional dependencies run: | sudo apt update -y && - sudo apt install -y cmake pkg-config libssl-dev git gcc build-essential git clang libclang-dev + sudo apt install -y cmake pkg-config libssl-dev git gcc build-essential git clang libclang-dev - name: Install cargo-tarpaulin run: | diff --git a/Cargo.lock b/Cargo.lock index 5c22264cc5..89172330c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,7 +109,7 @@ dependencies = [ [[package]] name = "aes-gcm" version = "0.10.1" -source = "git+https://github.com/RustCrypto/AEADs#5eb6d1a046371411d062db62671da29799beba7a" +source = "git+https://github.com/RustCrypto/AEADs#86250ac216bb0230c178765303265c6f037d9408" dependencies = [ "aead 0.5.1", "aes 0.8.2", @@ -198,6 +198,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "array-bytes" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a913633b0c922e6b745072795f50d90ebea78ba31a57e2ac8c2fc7b50950949" + [[package]] name = "arrayref" version = "0.3.6" @@ -253,22 +259,22 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" dependencies = [ - "concurrent-queue", + "concurrent-queue 1.2.4", "event-listener", "futures-core", ] [[package]] name = "async-executor" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b" dependencies = [ + "async-lock", "async-task", - "concurrent-queue", + "concurrent-queue 2.0.0", "fastrand", "futures-lite", - "once_cell", "slab", ] @@ -295,7 +301,7 @@ checksum = "e8121296a9f05be7f34aa4196b1747243b3b62e048bb7906f644f3fbfc490cf7" dependencies = [ "async-lock", "autocfg 1.1.0", - "concurrent-queue", + "concurrent-queue 1.2.4", "futures-lite", "libc", "log", @@ -397,9 +403,9 @@ dependencies = [ [[package]] name = "asynchronous-codec" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690" +checksum = "06a0daa378f5fd10634e44b0a29b2a87b890657658e072a30d6f26e57ddee182" dependencies = [ "bytes", "futures-sink", @@ -465,7 +471,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.29.0", + "object", "rustc-demangle", ] @@ -511,14 +517,14 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "async-trait", "beefy-primitives", "fnv", "futures 0.3.25", "futures-timer", - "hex", "log", "parity-scale-codec 3.2.1", "parking_lot 0.12.1", @@ -528,6 +534,7 @@ dependencies = [ "sc-finality-grandpa", "sc-keystore", "sc-network", + "sc-network-common", "sc-network-gossip", "sc-utils", "sp-api", @@ -547,7 +554,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -567,7 +574,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "beefy-primitives", "sp-api", @@ -576,7 +583,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -890,9 +897,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.74" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574" +checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" dependencies = [ "jobserver", ] @@ -1031,7 +1038,7 @@ checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" dependencies = [ "glob", "libc", - "libloading 0.7.3", + "libloading 0.7.4", ] [[package]] @@ -1127,7 +1134,7 @@ dependencies = [ [[package]] name = "common-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=szp/polkadot-v0.9.29#7ed394541f6770e72267ca6496b42d7ee3015570" +source = "git+https://github.com/litentry/integritee-pallets.git?branch=polkadot-v0.9.30#e4ef0aa973918295540c693bb66aa8fce8d05ab8" dependencies = [ "sp-std", ] @@ -1141,6 +1148,15 @@ dependencies = [ "cache-padded", ] +[[package]] +name = "concurrent-queue" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7bef69dc86e3c610e4e7aed41035e2a7ed12e72dd7530f61327a6579a4390b" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "console" version = "0.15.2" @@ -1223,19 +1239,21 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749d0d6022c9038dccf480bdde2a38d435937335bf2bb0f14e815d94517cdce8" +checksum = "52056f6d0584484b57fa6c1a65c1fcb15f3780d8b6a758426d9e3084169b2ddd" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94370cc7b37bf652ccd8bb8f09bd900997f7ccf97520edfc75554bb5c4abbea" +checksum = "18fed94c8770dc25d01154c3ffa64ed0b3ba9d583736f305fed7beebe5d9cf74" dependencies = [ + "arrayvec 0.7.2", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", @@ -1250,33 +1268,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a3cea8fdab90e44018c5b9a1dfd460d8ee265ac354337150222a354628bdb6" +checksum = "1c451b81faf237d11c7e4f3165eeb6bac61112762c5cfe7b4c0fb7241474358f" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac72f76f2698598951ab26d8c96eaa854810e693e7dd52523958b5909fde6b2" +checksum = "e7c940133198426d26128f08be2b40b0bd117b84771fd36798969c4d712d81fc" [[package]] name = "cranelift-entity" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09eaeacfcd2356fe0e66b295e8f9d59fdd1ac3ace53ba50de14d628ec902f72d" +checksum = "87a0f1b2fdc18776956370cf8d9b009ded3f855350c480c1c52142510961f352" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba69c9980d5ffd62c18a2bde927855fcd7c8dc92f29feaf8636052662cbd99c" +checksum = "34897538b36b216cc8dd324e73263596d51b8cf610da6498322838b2546baf8a" dependencies = [ "cranelift-codegen", "log", @@ -1286,15 +1304,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2920dc1e05cac40304456ed3301fde2c09bd6a9b0210bcfa2f101398d628d5b" +checksum = "1b2629a569fae540f16a76b70afcc87ad7decb38dc28fa6c648ac73b51e78470" [[package]] name = "cranelift-native" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04dfa45f9b2a6f587c564d6b63388e00cd6589d2df6ea2758cf79e1a13285e6" +checksum = "20937dab4e14d3e225c5adfc9c7106bafd4ac669bdb43027b911ff794c6fb318" dependencies = [ "cranelift-codegen", "libc", @@ -1303,9 +1321,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a46513ae6f26f3f267d8d75b5373d555fbbd1e68681f348d99df43f747ec54" +checksum = "80fc2288957a94fd342a015811479de1837850924166d1f1856d8406e6f3609b" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1489,7 +1507,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "clap", "parity-scale-codec 3.2.1", @@ -1504,7 +1522,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -1528,7 +1546,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -1557,7 +1575,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -1578,7 +1596,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-relay-chain" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -1602,7 +1620,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -1627,7 +1645,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", @@ -1651,7 +1669,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -1679,7 +1697,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "frame-executive", "frame-support", @@ -1697,7 +1715,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1715,7 +1733,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1746,7 +1764,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1757,7 +1775,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-session-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "frame-benchmarking", "frame-support", @@ -1771,7 +1789,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1788,7 +1806,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "frame-benchmarking", @@ -1807,7 +1825,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "frame-support", "parity-scale-codec 3.2.1", @@ -1823,7 +1841,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1846,7 +1864,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "futures 0.3.25", @@ -1859,7 +1877,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1879,7 +1897,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1908,7 +1926,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1931,7 +1949,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "backoff", @@ -1958,7 +1976,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "parity-scale-codec 3.2.1", @@ -2009,9 +2027,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" +checksum = "97abf9f0eca9e52b7f81b945524e76710e6cb2366aead23b7d4fbf72e281f888" dependencies = [ "cc", "cxxbridge-flags", @@ -2021,9 +2039,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" +checksum = "7cc32cc5fea1d894b77d269ddb9f192110069a8a9c1f1d441195fba90553dea3" dependencies = [ "cc", "codespan-reporting", @@ -2036,15 +2054,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" +checksum = "8ca220e4794c934dc6b1207c3b42856ad4c302f2df1712e9f8d2eec5afaacf1f" [[package]] name = "cxxbridge-macro" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" +checksum = "b846f081361125bfc8dc9d3940c84e1fd83ba54bbca7b17cd29483c828be0704" dependencies = [ "proc-macro2", "quote", @@ -2282,7 +2300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" dependencies = [ "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", + "hashbrown", "hex", "rand_core 0.6.4", "sha2 0.9.9", @@ -2364,9 +2382,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ "atty", "humantime", @@ -2619,7 +2637,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", ] @@ -2636,7 +2654,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -2659,9 +2677,10 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "Inflector", + "array-bytes", "chrono", "clap", "comfy-table", @@ -2671,7 +2690,6 @@ dependencies = [ "gethostname", "handlebars", "hash-db", - "hex", "itertools", "kvdb", "lazy_static", @@ -2710,7 +2728,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2721,7 +2739,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2737,7 +2755,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -2766,7 +2784,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "bitflags", "frame-metadata", @@ -2791,13 +2809,14 @@ dependencies = [ "sp-state-machine", "sp-std", "sp-tracing", + "sp-weights", "tt-call", ] [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "Inflector", "cfg-expr", @@ -2811,7 +2830,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2823,7 +2842,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro2", "quote", @@ -2833,7 +2852,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "log", @@ -2845,12 +2864,13 @@ dependencies = [ "sp-runtime", "sp-std", "sp-version", + "sp-weights", ] [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -2865,7 +2885,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -2874,7 +2894,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "parity-scale-codec 3.2.1", @@ -3247,15 +3267,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -3392,9 +3403,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.22" +version = "0.14.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfba89e19b959ca163c7752ba59d737c1ceea53a5d31a149c805446fc958064" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" dependencies = [ "bytes", "futures-channel", @@ -3456,7 +3467,7 @@ dependencies = [ [[package]] name = "ias-verify" version = "0.1.4" -source = "git+https://github.com/integritee-network/pallets.git?branch=szp/polkadot-v0.9.29#7ed394541f6770e72267ca6496b42d7ee3015570" +source = "git+https://github.com/litentry/integritee-pallets.git?branch=polkadot-v0.9.30#e4ef0aa973918295540c693bb66aa8fce8d05ab8" dependencies = [ "base64", "chrono", @@ -3573,7 +3584,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg 1.1.0", - "hashbrown 0.12.3", + "hashbrown", "serde", ] @@ -3612,15 +3623,19 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "0.5.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" +checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "io-lifetimes" -version = "0.7.4" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e481ccbe3dea62107216d0d1138bb8ad8e5e5c43009a098bd1990272c497b0" +checksum = "a7d367024b3f3414d8e01f437f704f41a9f64ab36f9067fa73e526ad4c763c87" +dependencies = [ + "libc", + "windows-sys 0.42.0", +] [[package]] name = "ip_network" @@ -3642,9 +3657,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" [[package]] name = "itertools" @@ -3843,8 +3858,8 @@ checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "kusama-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -3871,6 +3886,7 @@ dependencies = [ "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-gilt", "pallet-grandpa", "pallet-identity", @@ -3936,8 +3952,8 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "polkadot-primitives", @@ -4027,9 +4043,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if 1.0.0", "winapi", @@ -4037,9 +4053,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" [[package]] name = "libp2p" @@ -4099,8 +4115,8 @@ dependencies = [ "libp2p-request-response", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", ] @@ -4126,8 +4142,8 @@ dependencies = [ "multistream-select", "parking_lot 0.12.1", "pin-project", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", "ring 0.16.20", "rw-stream-sink", @@ -4177,8 +4193,8 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "smallvec", ] @@ -4201,8 +4217,8 @@ dependencies = [ "libp2p-swarm", "log", "prometheus-client", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "regex", "sha2 0.10.6", @@ -4224,8 +4240,8 @@ dependencies = [ "libp2p-swarm", "log", "lru 0.7.8", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "prost-codec", "smallvec", "thiserror", @@ -4249,8 +4265,8 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "sha2 0.10.6", "smallvec", @@ -4327,8 +4343,8 @@ dependencies = [ "lazy_static", "libp2p-core", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", "sha2 0.10.6", "snow", @@ -4364,8 +4380,8 @@ dependencies = [ "futures 0.3.25", "libp2p-core", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "unsigned-varint", "void", ] @@ -4400,8 +4416,8 @@ dependencies = [ "libp2p-swarm", "log", "pin-project", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "prost-codec", "rand 0.8.5", "smallvec", @@ -4424,8 +4440,8 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", "sha2 0.10.6", "thiserror", @@ -4666,15 +4682,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.0.42" +version = "0.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5284f00d480e1c39af34e72f8ad60b94f47007e3481cd3b731c1d67190ddc7b7" +checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "linux-raw-sys" -version = "0.0.46" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +checksum = "bb68f22743a3fb35785f1e7f844ca5a3de2dde5bd0c0ef5b372065814699b121" [[package]] name = "litentry-collator" @@ -4943,7 +4959,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" dependencies = [ - "hashbrown 0.12.3", + "hashbrown", ] [[package]] @@ -4952,7 +4968,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" dependencies = [ - "hashbrown 0.12.3", + "hashbrown", ] [[package]] @@ -5031,18 +5047,18 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memfd" -version = "0.4.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6627dc657574b49d6ad27105ed671822be56e0d2547d413bfbf3e8d8fa92e7a" +checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb" dependencies = [ - "libc", + "rustix 0.36.1", ] [[package]] name = "memmap2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" +checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" dependencies = [ "libc", ] @@ -5063,7 +5079,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown", "parity-util-mem", ] @@ -5078,9 +5094,9 @@ dependencies = [ [[package]] name = "memory_units" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" [[package]] name = "merlin" @@ -5147,12 +5163,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "more-asserts" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" - [[package]] name = "multiaddr" version = "0.14.0" @@ -5387,6 +5397,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg 1.1.0", + "num-integer", + "num-traits", +] + [[package]] name = "num-bigint-dig" version = "0.8.1" @@ -5452,7 +5473,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ "autocfg 1.1.0", - "num-bigint", + "num-bigint 0.2.6", "num-integer", "num-traits", ] @@ -5464,6 +5485,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg 1.1.0", + "num-bigint 0.4.3", "num-integer", "num-traits", ] @@ -5480,32 +5502,23 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ "hermit-abi", "libc", ] -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", -] - [[package]] name = "object" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ + "crc32fast", + "hashbrown", + "indexmap", "memchr", ] @@ -5536,7 +5549,7 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "dyn-clonable", @@ -5552,7 +5565,7 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "expander 0.0.6", "itertools", @@ -5575,7 +5588,7 @@ dependencies = [ [[package]] name = "orml-tokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.29#44fda4432b71f49ee59a650cf4775db895ab97af" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.30#ae13a54dbc1a654df0e2d5e9dc18582b62716365" dependencies = [ "frame-support", "frame-system", @@ -5590,7 +5603,7 @@ dependencies = [ [[package]] name = "orml-traits" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.29#44fda4432b71f49ee59a650cf4775db895ab97af" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.30#ae13a54dbc1a654df0e2d5e9dc18582b62716365" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -5608,7 +5621,7 @@ dependencies = [ [[package]] name = "orml-utilities" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.29#44fda4432b71f49ee59a650cf4775db895ab97af" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.30#ae13a54dbc1a654df0e2d5e9dc18582b62716365" dependencies = [ "frame-support", "parity-scale-codec 3.2.1", @@ -5622,7 +5635,7 @@ dependencies = [ [[package]] name = "orml-xcm-support" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.29#44fda4432b71f49ee59a650cf4775db895ab97af" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.30#ae13a54dbc1a654df0e2d5e9dc18582b62716365" dependencies = [ "frame-support", "orml-traits", @@ -5636,7 +5649,7 @@ dependencies = [ [[package]] name = "orml-xtokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.29#44fda4432b71f49ee59a650cf4775db895ab97af" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.30#ae13a54dbc1a654df0e2d5e9dc18582b62716365" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -5656,9 +5669,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.3.1" +version = "6.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9" +checksum = "7b5bf27447411e9ee3ff51186bf7a08e16c341efdde93f4d823e8844429bed7e" [[package]] name = "owning_ref" @@ -5694,7 +5707,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -5710,7 +5723,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -5726,7 +5739,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -5741,7 +5754,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5765,7 +5778,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5785,7 +5798,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5800,7 +5813,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "beefy-primitives", "frame-support", @@ -5816,13 +5829,13 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "beefy-merkle-tree", "beefy-primitives", "frame-support", "frame-system", - "hex", "log", "pallet-beefy", "pallet-mmr", @@ -5839,7 +5852,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5896,7 +5909,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5915,7 +5928,7 @@ dependencies = [ [[package]] name = "pallet-collator-selection" version = "3.0.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "frame-benchmarking", "frame-support", @@ -5935,7 +5948,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5952,7 +5965,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5984,13 +5997,14 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-support", "frame-system", "log", + "pallet-election-provider-support-benchmarking", "parity-scale-codec 3.2.1", "rand 0.7.3", "scale-info", @@ -6007,7 +6021,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6020,7 +6034,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6052,10 +6066,31 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-fast-unstake" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "pallet-staking", + "pallet-timestamp", + "parity-scale-codec 3.2.1", + "scale-info", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6070,7 +6105,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6093,7 +6128,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6162,7 +6197,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6182,7 +6217,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6199,7 +6234,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6216,7 +6251,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -6234,7 +6269,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "jsonrpsee", "parity-scale-codec 3.2.1", @@ -6249,7 +6284,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6264,7 +6299,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6281,7 +6316,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6293,6 +6328,7 @@ dependencies = [ "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", + "sp-runtime-interface", "sp-staking", "sp-std", ] @@ -6300,7 +6336,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -6310,7 +6346,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6327,7 +6363,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6374,7 +6410,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6390,7 +6426,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6405,7 +6441,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6420,7 +6456,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6436,7 +6472,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6457,7 +6493,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6473,7 +6509,7 @@ dependencies = [ [[package]] name = "pallet-sidechain" version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=szp/polkadot-v0.9.29#7ed394541f6770e72267ca6496b42d7ee3015570" +source = "git+https://github.com/litentry/integritee-pallets.git?branch=polkadot-v0.9.30#e4ef0aa973918295540c693bb66aa8fce8d05ab8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6498,7 +6534,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6512,7 +6548,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6535,7 +6571,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6546,7 +6582,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "sp-arithmetic", @@ -6555,7 +6591,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6569,7 +6605,7 @@ dependencies = [ [[package]] name = "pallet-teeracle" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=szp/polkadot-v0.9.29#7ed394541f6770e72267ca6496b42d7ee3015570" +source = "git+https://github.com/litentry/integritee-pallets.git?branch=polkadot-v0.9.30#e4ef0aa973918295540c693bb66aa8fce8d05ab8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6592,7 +6628,7 @@ dependencies = [ [[package]] name = "pallet-teerex" version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=szp/polkadot-v0.9.29#7ed394541f6770e72267ca6496b42d7ee3015570" +source = "git+https://github.com/litentry/integritee-pallets.git?branch=polkadot-v0.9.30#e4ef0aa973918295540c693bb66aa8fce8d05ab8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6616,7 +6652,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6634,7 +6670,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6653,7 +6689,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6669,7 +6705,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6684,7 +6720,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "pallet-transaction-payment", "parity-scale-codec 3.2.1", @@ -6695,7 +6731,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6712,7 +6748,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6749,7 +6785,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6763,8 +6799,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "frame-system", @@ -6781,8 +6817,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-benchmarking", "frame-support", @@ -6799,7 +6835,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -6918,7 +6954,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.12.3", + "hashbrown", "impl-trait-for-tuples", "parity-util-mem-derive", "parking_lot 0.12.1", @@ -6949,9 +6985,9 @@ dependencies = [ [[package]] name = "parity-wasm" -version = "0.42.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" @@ -7086,9 +7122,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" +checksum = "a528564cc62c19a7acac4d81e01f39e53e25e17b934878f4c6d25cc2836e62f8" dependencies = [ "thiserror", "ucd-trie", @@ -7096,9 +7132,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b75706b9642ebcb34dab3bc7750f811609a0eb1dd8b88c2d15bf628c1c65b2" +checksum = "d5fd9bc6500181952d34bd0b2b0163a54d794227b498be0b7afa7698d0a7b18f" dependencies = [ "pest", "pest_generator", @@ -7106,9 +7142,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f9272122f5979a6511a749af9db9bfc810393f63119970d7085fed1c4ea0db" +checksum = "d2610d5ac5156217b4ff8e46ddcef7cdf44b273da2ac5bca2ecbfa86a330e7c4" dependencies = [ "pest", "pest_meta", @@ -7119,9 +7155,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8717927f9b79515e565a64fe46c38b8cd0427e64c40680b14a7365ab09ac8d" +checksum = "824749bf7e21dd66b36fbe26b3f45c713879cccd4a009a917ab8e045ca8246fe" dependencies = [ "once_cell", "pest", @@ -7183,8 +7219,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" dependencies = [ "der 0.6.0", - "pkcs8", - "spki", + "pkcs8 0.9.0", + "spki 0.6.0", + "zeroize", +] + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der 0.5.1", + "spki 0.5.4", "zeroize", ] @@ -7195,7 +7242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" dependencies = [ "der 0.6.0", - "spki", + "spki 0.6.0", ] [[package]] @@ -7212,8 +7259,8 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "polkadot-approval-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "futures 0.3.25", "polkadot-node-network-protocol", @@ -7227,8 +7274,8 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "futures 0.3.25", "polkadot-node-network-protocol", @@ -7241,8 +7288,8 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "derive_more", "fatality", @@ -7264,8 +7311,8 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "fatality", "futures 0.3.25", @@ -7285,8 +7332,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "clap", "frame-benchmarking-cli", @@ -7311,8 +7358,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -7351,8 +7398,8 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "always-assert", "fatality", @@ -7372,8 +7419,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "parity-scale-codec 3.2.1", "parity-util-mem", @@ -7385,8 +7432,8 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "derive_more", "fatality", @@ -7408,8 +7455,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "parity-scale-codec 3.2.1", "polkadot-node-primitives", @@ -7422,8 +7469,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "futures 0.3.25", "futures-timer", @@ -7442,8 +7489,8 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "always-assert", "async-trait", @@ -7466,8 +7513,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "futures 0.3.25", "parity-scale-codec 3.2.1", @@ -7484,8 +7531,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitvec 1.0.1", "derive_more", @@ -7513,8 +7560,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitvec 1.0.1", "futures 0.3.25", @@ -7533,8 +7580,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitvec 1.0.1", "fatality", @@ -7552,8 +7599,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "futures 0.3.25", "polkadot-node-subsystem", @@ -7567,8 +7614,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "futures 0.3.25", @@ -7585,8 +7632,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "futures 0.3.25", "polkadot-node-subsystem", @@ -7600,8 +7647,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "futures 0.3.25", "futures-timer", @@ -7617,8 +7664,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "fatality", "futures 0.3.25", @@ -7636,8 +7683,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "futures 0.3.25", @@ -7653,8 +7700,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitvec 1.0.1", "fatality", @@ -7671,8 +7718,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "always-assert", "assert_matches", @@ -7683,7 +7730,7 @@ dependencies = [ "parity-scale-codec 3.2.1", "pin-project", "polkadot-core-primitives", - "polkadot-node-subsystem-util", + "polkadot-node-metrics", "polkadot-parachain", "rand 0.8.5", "rayon", @@ -7703,8 +7750,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "futures 0.3.25", "polkadot-node-primitives", @@ -7719,8 +7766,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "futures 0.3.25", "memory-lru", @@ -7735,8 +7782,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-std", "lazy_static", @@ -7753,8 +7800,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bs58", "futures 0.3.25", @@ -7772,8 +7819,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "derive_more", @@ -7787,6 +7834,7 @@ dependencies = [ "rand 0.8.5", "sc-authority-discovery", "sc-network", + "sc-network-common", "strum", "thiserror", "tracing-gum", @@ -7794,8 +7842,8 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bounded-vec", "futures 0.3.25", @@ -7816,8 +7864,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -7826,8 +7874,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "derive_more", @@ -7849,8 +7897,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "derive_more", @@ -7882,8 +7930,8 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "futures 0.3.25", @@ -7905,8 +7953,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "derive_more", "frame-support", @@ -7922,8 +7970,8 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "env_logger", "kusama-runtime", @@ -7937,8 +7985,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitvec 1.0.1", "frame-system", @@ -7967,8 +8015,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -7999,8 +8047,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -8026,6 +8074,7 @@ dependencies = [ "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-grandpa", "pallet-identity", "pallet-im-online", @@ -8087,8 +8136,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -8134,8 +8183,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "polkadot-primitives", @@ -8146,8 +8195,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bs58", "parity-scale-codec 3.2.1", @@ -8158,8 +8207,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitflags", "bitvec 1.0.1", @@ -8201,8 +8250,8 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "beefy-gadget", @@ -8305,8 +8354,8 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -8326,8 +8375,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "parity-scale-codec 3.2.1", "polkadot-primitives", @@ -8385,9 +8434,19 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "c142c0e46b57171fe0c528bee8c5b7569e80f0c17e377cd0e30ea57dbc11bb51" +dependencies = [ + "proc-macro2", + "syn", +] [[package]] name = "primitive-types" @@ -8430,7 +8489,7 @@ dependencies = [ [[package]] name = "prioritized-metered-channel" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "coarsetime", "crossbeam-queue", @@ -8530,7 +8589,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.10.1", +] + +[[package]] +name = "prost" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0841812012b2d4a6145fae9a6af1534873c32aa67fff26bd09f8fa42c83f95a" +dependencies = [ + "bytes", + "prost-derive 0.11.2", ] [[package]] @@ -8548,13 +8617,35 @@ dependencies = [ "log", "multimap", "petgraph", - "prost", - "prost-types", + "prost 0.10.4", + "prost-types 0.10.1", "regex", "tempfile", "which 4.3.0", ] +[[package]] +name = "prost-build" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8b442418ea0822409d9e7d047cbf1e7e9e1760b172bf9982cf29d517c93511" +dependencies = [ + "bytes", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prettyplease", + "prost 0.11.2", + "prost-types 0.11.2", + "regex", + "syn", + "tempfile", + "which 4.3.0", +] + [[package]] name = "prost-codec" version = "0.1.0" @@ -8563,7 +8654,7 @@ checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" dependencies = [ "asynchronous-codec", "bytes", - "prost", + "prost 0.10.4", "thiserror", "unsigned-varint", ] @@ -8581,6 +8672,19 @@ dependencies = [ "syn", ] +[[package]] +name = "prost-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "164ae68b6587001ca506d3bf7f1000bfa248d0e1217b618108fba4ec1d0cc306" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "prost-types" version = "0.10.1" @@ -8588,7 +8692,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" dependencies = [ "bytes", - "prost", + "prost 0.10.4", +] + +[[package]] +name = "prost-types" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747761bc3dc48f9a34553bf65605cf6cb6288ba219f3450b4275dbd81539551a" +dependencies = [ + "bytes", + "prost 0.11.2", ] [[package]] @@ -8912,7 +9026,7 @@ dependencies = [ "derive_more", "fs-err", "itertools", - "static_init", + "static_init 0.5.2", "thiserror", ] @@ -8938,9 +9052,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.2.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a8d23b35d7177df3b9d31ed8a9ab4bf625c668be77a319d4f5efd4a5257701c" +checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" dependencies = [ "fxhash", "log", @@ -8950,9 +9064,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", @@ -8970,26 +9084,14 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" - -[[package]] -name = "region" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "env_logger", "jsonrpsee", @@ -9183,8 +9285,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -9202,23 +9304,37 @@ dependencies = [ "pallet-balances", "pallet-beefy", "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", "pallet-collective", + "pallet-democracy", + "pallet-elections-phragmen", + "pallet-gilt", "pallet-grandpa", + "pallet-identity", "pallet-im-online", "pallet-indices", "pallet-membership", "pallet-mmr", "pallet-multisig", "pallet-offences", + "pallet-preimage", "pallet-proxy", + "pallet-recovery", + "pallet-scheduler", "pallet-session", + "pallet-society", "pallet-staking", "pallet-sudo", "pallet-timestamp", + "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", "pallet-utility", + "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-primitives", @@ -9244,6 +9360,7 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", + "static_assertions", "substrate-wasm-builder", "xcm", "xcm-builder", @@ -9252,8 +9369,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "polkadot-primitives", @@ -9284,7 +9401,7 @@ dependencies = [ "num-iter", "num-traits", "pkcs1", - "pkcs8", + "pkcs8 0.9.0", "rand_core 0.6.4", "serde", "signature", @@ -9380,30 +9497,30 @@ dependencies = [ [[package]] name = "rustix" -version = "0.33.7" +version = "0.35.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938a344304321a9da4973b9ff4f9f8db9caf4597dfd9dda6a60b523340a0fff0" +checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ "bitflags", "errno", - "io-lifetimes 0.5.3", + "io-lifetimes 0.7.5", "libc", - "linux-raw-sys 0.0.42", - "winapi", + "linux-raw-sys 0.0.46", + "windows-sys 0.42.0", ] [[package]] name = "rustix" -version = "0.35.12" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985947f9b6423159c4726323f373be0a21bdb514c5af06a849cb3d2dce2d01e8" +checksum = "812a2ec2043c4d6bc6482f5be2ab8244613cac2493d128d36c0759e52a626ab3" dependencies = [ "bitflags", "errno", - "io-lifetimes 0.7.4", + "io-lifetimes 1.0.1", "libc", - "linux-raw-sys 0.0.46", - "windows-sys 0.36.1", + "linux-raw-sys 0.1.2", + "windows-sys 0.42.0", ] [[package]] @@ -9492,7 +9609,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "sp-core", @@ -9503,7 +9620,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "futures 0.3.25", @@ -9512,8 +9629,8 @@ dependencies = [ "libp2p", "log", "parity-scale-codec 3.2.1", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "sc-client-api", "sc-network-common", @@ -9530,7 +9647,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "futures-timer", @@ -9553,7 +9670,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "sc-client-api", @@ -9569,7 +9686,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "impl-trait-for-tuples", "memmap2", @@ -9586,7 +9703,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9597,13 +9714,13 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "chrono", "clap", "fdlimit", "futures 0.3.25", - "hex", "libp2p", "log", "names", @@ -9615,6 +9732,7 @@ dependencies = [ "sc-client-db", "sc-keystore", "sc-network", + "sc-network-common", "sc-service", "sc-telemetry", "sc-tracing", @@ -9636,7 +9754,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "fnv", "futures 0.3.25", @@ -9664,7 +9782,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "hash-db", "kvdb", @@ -9689,7 +9807,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "futures 0.3.25", @@ -9713,7 +9831,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "futures 0.3.25", @@ -9742,14 +9860,14 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "fork-tree", "futures 0.3.25", "log", "merlin", - "num-bigint", + "num-bigint 0.2.6", "num-rational 0.2.4", "num-traits", "parity-scale-codec 3.2.1", @@ -9784,7 +9902,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -9806,7 +9924,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "fork-tree", "parity-scale-codec 3.2.1", @@ -9819,7 +9937,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "futures 0.3.25", @@ -9837,14 +9955,13 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-timestamp", "thiserror", ] [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "lazy_static", "lru 0.7.8", @@ -9871,7 +9988,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "environmental", "parity-scale-codec 3.2.1", @@ -9887,7 +10004,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -9902,16 +10019,15 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "cfg-if 1.0.0", "libc", "log", "once_cell", "parity-scale-codec 3.2.1", - "parity-wasm 0.42.2", - "rustix 0.33.7", - "rustix 0.35.12", + "parity-wasm 0.45.0", + "rustix 0.35.13", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -9923,16 +10039,16 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ahash", + "array-bytes", "async-trait", "dyn-clone", "finality-grandpa", "fork-tree", "futures 0.3.25", "futures-timer", - "hex", "log", "parity-scale-codec 3.2.1", "parking_lot 0.12.1", @@ -9964,7 +10080,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "finality-grandpa", "futures 0.3.25", @@ -9985,7 +10101,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ansi_term", "futures 0.3.25", @@ -10002,10 +10118,10 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "async-trait", - "hex", "parking_lot 0.12.1", "serde_json", "sp-application-crypto", @@ -10017,8 +10133,9 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "async-trait", "asynchronous-codec", "bitflags", @@ -10029,7 +10146,6 @@ dependencies = [ "fork-tree", "futures 0.3.25", "futures-timer", - "hex", "ip_network", "libp2p", "linked-hash-map", @@ -10039,8 +10155,7 @@ dependencies = [ "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "pin-project", - "prost", - "prost-build", + "prost 0.10.4", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -10059,22 +10174,43 @@ dependencies = [ "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", - "void", "zeroize", ] +[[package]] +name = "sc-network-bitswap" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +dependencies = [ + "cid", + "futures 0.3.25", + "libp2p", + "log", + "prost 0.11.2", + "prost-build 0.11.2", + "sc-client-api", + "sc-network-common", + "sp-blockchain", + "sp-runtime", + "thiserror", + "unsigned-varint", + "void", +] + [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "bitflags", "bytes", "futures 0.3.25", + "futures-timer", "libp2p", + "linked_hash_set", "parity-scale-codec 3.2.1", - "prost-build", + "prost-build 0.10.4", "sc-consensus", "sc-peerset", "serde", @@ -10083,13 +10219,14 @@ dependencies = [ "sp-consensus", "sp-finality-grandpa", "sp-runtime", + "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ahash", "futures 0.3.25", @@ -10107,15 +10244,15 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "futures 0.3.25", - "hex", "libp2p", "log", "parity-scale-codec 3.2.1", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "sc-client-api", "sc-network-common", "sc-peerset", @@ -10128,17 +10265,17 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "fork-tree", "futures 0.3.25", - "hex", "libp2p", "log", "lru 0.7.8", "parity-scale-codec 3.2.1", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "sc-client-api", "sc-consensus", "sc-network-common", @@ -10153,16 +10290,35 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-network-transactions" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +dependencies = [ + "array-bytes", + "futures 0.3.25", + "hex", + "libp2p", + "log", + "parity-scale-codec 3.2.1", + "pin-project", + "sc-network-common", + "sc-peerset", + "sp-consensus", + "sp-runtime", + "substrate-prometheus-endpoint", +] + [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "bytes", "fnv", "futures 0.3.25", "futures-timer", - "hex", "hyper", "hyper-rustls", "libp2p", @@ -10186,7 +10342,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "libp2p", @@ -10199,7 +10355,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10208,7 +10364,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "hash-db", @@ -10238,7 +10394,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -10261,7 +10417,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -10274,7 +10430,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "directories", @@ -10298,9 +10454,11 @@ dependencies = [ "sc-informant", "sc-keystore", "sc-network", + "sc-network-bitswap", "sc-network-common", "sc-network-light", "sc-network-sync", + "sc-network-transactions", "sc-offchain", "sc-rpc", "sc-rpc-server", @@ -10330,6 +10488,7 @@ dependencies = [ "sp-transaction-storage-proof", "sp-trie", "sp-version", + "static_init 1.0.3", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -10341,7 +10500,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -10355,7 +10514,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "jsonrpsee", "parity-scale-codec 3.2.1", @@ -10374,7 +10533,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "libc", @@ -10393,7 +10552,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "chrono", "futures 0.3.25", @@ -10411,7 +10570,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ansi_term", "atty", @@ -10442,7 +10601,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10453,7 +10612,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "futures-timer", @@ -10479,7 +10638,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "log", @@ -10492,7 +10651,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "futures-timer", @@ -10602,6 +10761,7 @@ checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" dependencies = [ "der 0.5.1", "generic-array 0.14.6", + "pkcs8 0.8.0", "subtle", "zeroize", ] @@ -10827,7 +10987,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "sidechain-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=szp/polkadot-v0.9.29#7ed394541f6770e72267ca6496b42d7ee3015570" +source = "git+https://github.com/litentry/integritee-pallets.git?branch=polkadot-v0.9.30#e4ef0aa973918295540c693bb66aa8fce8d05ab8" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10916,8 +11076,8 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "enumn", "parity-scale-codec 3.2.1", @@ -10993,7 +11153,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "hash-db", "log", @@ -11011,7 +11171,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "blake2", "proc-macro-crate", @@ -11023,7 +11183,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11036,7 +11196,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "integer-sqrt", "num-traits", @@ -11051,7 +11211,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11064,7 +11224,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "parity-scale-codec 3.2.1", @@ -11076,7 +11236,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -11088,7 +11248,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures 0.3.25", "log", @@ -11106,7 +11266,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "futures 0.3.25", @@ -11125,7 +11285,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "parity-scale-codec 3.2.1", @@ -11143,7 +11303,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "merlin", @@ -11166,7 +11326,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11180,7 +11340,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11193,18 +11353,18 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "base58", "bitflags", - "blake2-rfc", + "blake2", "byteorder", "dyn-clonable", "ed25519-zebra", "futures 0.3.25", "hash-db", "hash256-std-hasher", - "hex", "impl-serde", "lazy_static", "libsecp256k1", @@ -11239,7 +11399,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "blake2", "byteorder", @@ -11253,7 +11413,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro2", "quote", @@ -11264,7 +11424,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11273,7 +11433,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro2", "quote", @@ -11283,7 +11443,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "environmental", "parity-scale-codec 3.2.1", @@ -11294,7 +11454,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "finality-grandpa", "log", @@ -11312,7 +11472,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -11326,7 +11486,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "bytes", "futures 0.3.25", @@ -11352,7 +11512,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "lazy_static", "sp-core", @@ -11363,7 +11523,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "futures 0.3.25", @@ -11380,7 +11540,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "thiserror", "zstd", @@ -11389,7 +11549,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -11404,7 +11564,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11418,7 +11578,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "sp-api", "sp-core", @@ -11428,7 +11588,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "backtrace", "lazy_static", @@ -11438,7 +11598,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "rustc-hash", "serde", @@ -11448,7 +11608,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "either", "hash256-std-hasher", @@ -11465,12 +11625,13 @@ dependencies = [ "sp-core", "sp-io", "sp-std", + "sp-weights", ] [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -11488,7 +11649,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "Inflector", "proc-macro-crate", @@ -11500,7 +11661,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -11514,7 +11675,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11528,7 +11689,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11539,7 +11700,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "hash-db", "log", @@ -11561,12 +11722,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "impl-serde", "parity-scale-codec 3.2.1", @@ -11579,7 +11740,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "sp-core", @@ -11592,7 +11753,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "futures-timer", @@ -11608,7 +11769,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "sp-std", @@ -11620,7 +11781,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "sp-api", "sp-runtime", @@ -11629,7 +11790,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "log", @@ -11645,11 +11806,11 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ahash", "hash-db", - "hashbrown 0.12.3", + "hashbrown", "lazy_static", "lru 0.7.8", "memory-db", @@ -11668,11 +11829,11 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "impl-serde", "parity-scale-codec 3.2.1", - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", "scale-info", "serde", "sp-core-hashing-proc-macro", @@ -11685,7 +11846,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "proc-macro2", @@ -11696,7 +11857,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "impl-trait-for-tuples", "log", @@ -11706,12 +11867,38 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "sp-weights" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec 3.2.1", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", + "sp-std", +] + [[package]] name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der 0.5.1", +] + [[package]] name = "spki" version = "0.6.0" @@ -11724,9 +11911,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab7554f8a8b6f8d71cd5a8e6536ef116e2ce0504cf97ebf16311d58065dc8a6" +checksum = "37a9821878e1f13aba383aa40a86fb1b33c7265774ec91e32563cb1dd1577496" dependencies = [ "Inflector", "num-format", @@ -11758,7 +11945,22 @@ dependencies = [ "cfg_aliases", "libc", "parking_lot 0.11.2", - "static_init_macro", + "static_init_macro 0.5.0", +] + +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags", + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "parking_lot_core 0.8.5", + "static_init_macro 1.0.2", + "winapi", ] [[package]] @@ -11774,6 +11976,19 @@ dependencies = [ "syn", ] +[[package]] +name = "static_init_macro" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "statrs" version = "0.15.0" @@ -11831,7 +12046,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "platforms", ] @@ -11860,7 +12075,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.25", @@ -11881,7 +12096,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures-util", "hyper", @@ -11894,7 +12109,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "jsonrpsee", "log", @@ -11915,7 +12130,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ansi_term", "build-helper", @@ -11987,14 +12202,14 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" +checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" [[package]] name = "teeracle-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=szp/polkadot-v0.9.29#7ed394541f6770e72267ca6496b42d7ee3015570" +source = "git+https://github.com/litentry/integritee-pallets.git?branch=polkadot-v0.9.30#e4ef0aa973918295540c693bb66aa8fce8d05ab8" dependencies = [ "common-primitives", "sp-std", @@ -12004,7 +12219,7 @@ dependencies = [ [[package]] name = "teerex-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=szp/polkadot-v0.9.29#7ed394541f6770e72267ca6496b42d7ee3015570" +source = "git+https://github.com/litentry/integritee-pallets.git?branch=polkadot-v0.9.30#e4ef0aa973918295540c693bb66aa8fce8d05ab8" dependencies = [ "ias-verify", "parity-scale-codec 3.2.1", @@ -12051,7 +12266,7 @@ dependencies = [ [[package]] name = "test-utils" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=szp/polkadot-v0.9.29#7ed394541f6770e72267ca6496b42d7ee3015570" +source = "git+https://github.com/litentry/integritee-pallets.git?branch=polkadot-v0.9.30#e4ef0aa973918295540c693bb66aa8fce8d05ab8" dependencies = [ "hex-literal", "log", @@ -12314,8 +12529,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -12325,8 +12540,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -12386,7 +12601,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown", "log", "rustc-hex", "smallvec", @@ -12453,7 +12668,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "clap", "frame-try-runtime", @@ -12782,11 +12997,11 @@ dependencies = [ [[package]] name = "wasm-instrument" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "962e5b0401bbb6c887f54e69b8c496ea36f704df65db73e81fd5ff8dc3e63a9f" +checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" dependencies = [ - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", ] [[package]] @@ -12806,58 +13021,63 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.9.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" +checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" dependencies = [ - "downcast-rs", - "libc", - "libm", - "memory_units", - "num-rational 0.2.4", - "num-traits", - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", "wasmi-validation", + "wasmi_core", ] [[package]] name = "wasmi-validation" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" +checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" dependencies = [ - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", +] + +[[package]] +name = "wasmi_core" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" +dependencies = [ + "downcast-rs", + "libm", + "memory_units", + "num-rational 0.4.1", + "num-traits", ] [[package]] name = "wasmparser" -version = "0.85.0" +version = "0.89.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570460c58b21e9150d2df0eaaedbb7816c34bcec009ae0dcc976e40ba81463e7" +checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" dependencies = [ "indexmap", ] [[package]] name = "wasmtime" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f50eadf868ab6a04b7b511460233377d0bfbb92e417b2f6a98b98fef2e098f5" +checksum = "4ad5af6ba38311282f2a21670d96e78266e8c8e2f38cbcd52c254df6ccbc7731" dependencies = [ "anyhow", - "backtrace", "bincode", "cfg-if 1.0.0", "indexmap", - "lazy_static", "libc", "log", - "object 0.28.4", + "object", "once_cell", "paste", "psm", "rayon", - "region", "serde", "target-lexicon", "wasmparser", @@ -12866,14 +13086,23 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "winapi", + "windows-sys 0.36.1", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45de63ddfc8b9223d1adc8f7b2ee5f35d1f6d112833934ad7ea66e4f4339e597" +dependencies = [ + "cfg-if 1.0.0", ] [[package]] name = "wasmtime-cache" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1df23c642e1376892f3b72f311596976979cbf8b85469680cdd3a8a063d12a2" +checksum = "bcd849399d17d2270141cfe47fa0d91ee52d5f8ea9b98cf7ddde0d53e5f79882" dependencies = [ "anyhow", "base64", @@ -12881,19 +13110,19 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix 0.33.7", + "rustix 0.35.13", "serde", "sha2 0.9.9", "toml", - "winapi", + "windows-sys 0.36.1", "zstd", ] [[package]] name = "wasmtime-cranelift" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f264ff6b4df247d15584f2f53d009fbc90032cfdc2605b52b961bffc71b6eccd" +checksum = "4bd91339b742ff20bfed4532a27b73c86b5bcbfedd6bea2dcdf2d64471e1b5c6" dependencies = [ "anyhow", "cranelift-codegen", @@ -12903,8 +13132,7 @@ dependencies = [ "cranelift-wasm", "gimli", "log", - "more-asserts", - "object 0.28.4", + "object", "target-lexicon", "thiserror", "wasmparser", @@ -12913,17 +13141,16 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839d2820e4b830f4b9e7aa08d4c0acabf4a5036105d639f6dfa1c6891c73bdc6" +checksum = "ebb881c61f4f627b5d45c54e629724974f8a8890d455bcbe634330cc27309644" dependencies = [ "anyhow", "cranelift-entity", "gimli", "indexmap", "log", - "more-asserts", - "object 0.28.4", + "object", "serde", "target-lexicon", "thiserror", @@ -12933,9 +13160,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef0a0bcbfa18b946d890078ba0e1bc76bcc53eccfb40806c0020ec29dcd1bd49" +checksum = "1985c628011fe26adf5e23a5301bdc79b245e0e338f14bb58b39e4e25e4d8681" dependencies = [ "addr2line", "anyhow", @@ -12944,38 +13171,36 @@ dependencies = [ "cpp_demangle", "gimli", "log", - "object 0.28.4", - "region", + "object", "rustc-demangle", - "rustix 0.33.7", + "rustix 0.35.13", "serde", "target-lexicon", "thiserror", "wasmtime-environ", "wasmtime-jit-debug", "wasmtime-runtime", - "winapi", + "windows-sys 0.36.1", ] [[package]] name = "wasmtime-jit-debug" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4779d976206c458edd643d1ac622b6c37e4a0800a8b1d25dfbf245ac2f2cac" +checksum = "f671b588486f5ccec8c5a3dba6b4c07eac2e66ab8c60e6f4e53717c77f709731" dependencies = [ - "lazy_static", - "object 0.28.4", - "rustix 0.33.7", + "object", + "once_cell", + "rustix 0.35.13", ] [[package]] name = "wasmtime-runtime" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7eb6ffa169eb5dcd18ac9473c817358cd57bc62c244622210566d473397954a" +checksum = "ee8f92ad4b61736339c29361da85769ebc200f184361959d1792832e592a1afd" dependencies = [ "anyhow", - "backtrace", "cc", "cfg-if 1.0.0", "indexmap", @@ -12984,21 +13209,21 @@ dependencies = [ "mach", "memfd", "memoffset", - "more-asserts", + "paste", "rand 0.8.5", - "region", - "rustix 0.33.7", + "rustix 0.35.13", "thiserror", + "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "winapi", + "windows-sys 0.36.1", ] [[package]] name = "wasmtime-types" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d932b0ac5336f7308d869703dd225610a6a3aeaa8e968c52b43eed96cefb1c2" +checksum = "d23d61cb4c46e837b431196dd06abb11731541021916d03476a178b54dc07aeb" dependencies = [ "cranelift-entity", "serde", @@ -13056,8 +13281,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -13081,6 +13306,7 @@ dependencies = [ "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-grandpa", "pallet-identity", "pallet-im-online", @@ -13145,8 +13371,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "polkadot-primitives", @@ -13393,8 +13619,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -13407,8 +13633,8 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "frame-system", @@ -13427,8 +13653,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-benchmarking", "frame-support", @@ -13445,8 +13671,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "Inflector", "proc-macro2", @@ -13456,8 +13682,8 @@ dependencies = [ [[package]] name = "xcm-simulator" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "parity-scale-codec 3.2.1", diff --git a/docker/Dockerfile b/docker/Dockerfile index 20010c71bd..59433fbd33 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,7 +13,7 @@ COPY . /litentry RUN apt-get update && \ apt-get upgrade -y && \ - apt-get install -yq openssl clang libclang-dev cmake + apt-get install -yq openssl clang libclang-dev cmake protobuf-compiler # install sccache, must before `ARG RUSTC_WRAPPER` # otherwise the wrapper is set but sccache is not installed diff --git a/mock-tee-primitives/Cargo.toml b/mock-tee-primitives/Cargo.toml index 69fb2c5158..c8b54e15bf 100644 --- a/mock-tee-primitives/Cargo.toml +++ b/mock-tee-primitives/Cargo.toml @@ -10,9 +10,9 @@ hex = { version = "0.4.3", default-features = false, optional = true } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } parentchain-primitives = { package = "primitives", path = "../primitives", default-features = false } diff --git a/node/Cargo.toml b/node/Cargo.toml index 315bfea592..5a95b8068a 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -26,69 +26,69 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" # Substrate dependencies -sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } # RPC related dependencies -frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } jsonrpsee = "0.15.1" -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } # Cumulus dependencies -cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-client-collator = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } -cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" } +cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-client-collator = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } +cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.30" } # Polkadot dependencies -polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } -polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } +polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } +polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } # Benchmarking -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } # TryRuntime -try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } # Local dependencies litentry-parachain-runtime = { path = "../runtime/litentry" } @@ -97,7 +97,7 @@ primitives = { path = "../primitives" } rococo-parachain-runtime = { path = "../runtime/rococo" } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" } +substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = [] diff --git a/node/src/service.rs b/node/src/service.rs index 171f497e15..b941d59b4d 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -334,7 +334,7 @@ where let prometheus_registry = parachain_config.prometheus_registry().cloned(); let transaction_pool = params.transaction_pool.clone(); let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue); - let (network, system_rpc_tx, start_network) = + let (network, system_rpc_tx, tx_handler_controller, start_network) = sc_service::build_network(sc_service::BuildNetworkParams { config: ¶chain_config, client: client.clone(), @@ -372,6 +372,7 @@ where backend: backend.clone(), network: network.clone(), system_rpc_tx, + tx_handler_controller, telemetry: telemetry.as_mut(), })?; @@ -529,7 +530,7 @@ where ) })?; - Ok((timestamp, slot, parachain_inherent)) + Ok((slot, timestamp, parachain_inherent)) } }, block_import: client.clone(), @@ -593,7 +594,6 @@ where _, _, _, - _, >(cumulus_client_consensus_aura::ImportQueueParams { block_import: client.clone(), client, @@ -606,10 +606,9 @@ where slot_duration, ); - Ok((timestamp, slot)) + Ok((slot, timestamp)) }, registry: config.prometheus_registry(), - can_author_with: sp_consensus::AlwaysCanAuthor, spawner: &task_manager.spawn_essential_handle(), telemetry, }) diff --git a/pallets/bridge-transfer/Cargo.toml b/pallets/bridge-transfer/Cargo.toml index 8341636854..c99bd7664a 100644 --- a/pallets/bridge-transfer/Cargo.toml +++ b/pallets/bridge-transfer/Cargo.toml @@ -12,16 +12,16 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } # primitives -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } # frame dependencies -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } pallet-bridge = { path = "../bridge", default-features = false } pallet-parachain-staking = { path = "../parachain-staking", default-features = false } @@ -30,8 +30,8 @@ hex = { version = "0.4", default-features = false } [dev-dependencies] hex-literal = "0.3" -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } [features] default = ["std"] diff --git a/pallets/bridge-transfer/src/benchmarking.rs b/pallets/bridge-transfer/src/benchmarking.rs index 0b09667403..bc6440bc44 100644 --- a/pallets/bridge-transfer/src/benchmarking.rs +++ b/pallets/bridge-transfer/src/benchmarking.rs @@ -81,7 +81,7 @@ benchmarks! { set_maximum_issuance{ let origin = T::SetMaximumIssuanceOrigin::successful_origin(); let maximum_issuance:balance = 2u32.into(); - }:_(origin,maximum_issuance) + }:_(origin,maximum_issuance) verify{ assert_eq!(MaximumIssuance::::get(),maximum_issuance); } diff --git a/pallets/bridge-transfer/src/lib.rs b/pallets/bridge-transfer/src/lib.rs index fb809943f0..aa105f3a81 100644 --- a/pallets/bridge-transfer/src/lib.rs +++ b/pallets/bridge-transfer/src/lib.rs @@ -59,17 +59,17 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + bridge::Config { - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Specifies the origin check provided by the bridge for calls that can only be called by /// the bridge pallet - type BridgeOrigin: EnsureOrigin; + type BridgeOrigin: EnsureOrigin; /// The priviledged accounts to call the transfer_native type TransferNativeMembers: SortedMembers; /// The privileged origin to call update_maximum_issuance - type SetMaximumIssuanceOrigin: EnsureOrigin; + type SetMaximumIssuanceOrigin: EnsureOrigin; #[pallet::constant] type NativeTokenResourceId: Get; diff --git a/pallets/bridge-transfer/src/mock.rs b/pallets/bridge-transfer/src/mock.rs index a2c1c356a4..7b07eb6332 100644 --- a/pallets/bridge-transfer/src/mock.rs +++ b/pallets/bridge-transfer/src/mock.rs @@ -57,8 +57,8 @@ parameter_types! { impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -66,7 +66,7 @@ impl frame_system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); @@ -89,7 +89,7 @@ ord_parameter_types! { impl pallet_balances::Config for Test { type Balance = u64; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU64<1>; type AccountStore = System; type WeightInfo = (); @@ -105,9 +105,9 @@ parameter_types! { } impl bridge::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BridgeCommitteeOrigin = frame_system::EnsureRoot; - type Proposal = Call; + type Proposal = RuntimeCall; type BridgeChainId = TestChainId; type Currency = Balances; type ProposalLifetime = ProposalLifetime; @@ -151,7 +151,7 @@ impl SortedMembers for MembersProvider { } impl Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BridgeOrigin = bridge::EnsureBridge; type TransferNativeMembers = MembersProvider; type SetMaximumIssuanceOrigin = EnsureSignedBy; @@ -198,8 +198,8 @@ pub fn new_test_ext() -> sp_io::TestExternalities { // Checks events against the latest. A contiguous set of events must be provided. They must // include the most recent event, but do not have to include every past event. -pub fn assert_events(mut expected: Vec) { - let mut actual: Vec = +pub fn assert_events(mut expected: Vec) { + let mut actual: Vec = system::Pallet::::events().iter().map(|e| e.event.clone()).collect(); expected.reverse(); diff --git a/pallets/bridge-transfer/src/tests.rs b/pallets/bridge-transfer/src/tests.rs index e377cdb009..12c6f04c1e 100644 --- a/pallets/bridge-transfer/src/tests.rs +++ b/pallets/bridge-transfer/src/tests.rs @@ -19,9 +19,9 @@ use super::{ bridge, mock::{ - assert_events, balances, new_test_ext, Balances, Bridge, BridgeTransfer, Call, Event, - NativeTokenResourceId, Origin, ProposalLifetime, Test, TreasuryAccount, ENDOWED_BALANCE, - MAXIMUM_ISSURANCE, RELAYER_A, RELAYER_B, RELAYER_C, + assert_events, balances, new_test_ext, Balances, Bridge, BridgeTransfer, + NativeTokenResourceId, ProposalLifetime, RuntimeCall, RuntimeEvent, RuntimeOrigin, Test, + TreasuryAccount, ENDOWED_BALANCE, MAXIMUM_ISSURANCE, RELAYER_A, RELAYER_B, RELAYER_C, }, *, }; @@ -31,10 +31,10 @@ use hex_literal::hex; const TEST_THRESHOLD: u32 = 2; -fn make_transfer_proposal(to: u64, amount: u64) -> Call { +fn make_transfer_proposal(to: u64, amount: u64) -> RuntimeCall { let rid = NativeTokenResourceId::get(); // let amount - Call::BridgeTransfer(crate::Call::transfer { to, amount, rid }) + RuntimeCall::BridgeTransfer(crate::Call::transfer { to, amount, rid }) } #[test] @@ -54,14 +54,14 @@ fn transfer() { assert_eq!(Balances::free_balance(&bridge_id), ENDOWED_BALANCE); // Transfer and check result assert_ok!(BridgeTransfer::transfer( - Origin::signed(Bridge::account_id()), + RuntimeOrigin::signed(Bridge::account_id()), RELAYER_A, 10, resource_id, )); assert_eq!(Balances::free_balance(RELAYER_A), ENDOWED_BALANCE + 10); - assert_events(vec![Event::Balances(balances::Event::Deposit { + assert_events(vec![RuntimeEvent::Balances(balances::Event::Deposit { who: RELAYER_A, amount: 10, })]); @@ -74,10 +74,17 @@ fn transfer_native() { let dest_bridge_id: bridge::BridgeChainId = 0; let resource_id = NativeTokenResourceId::get(); let dest_account: Vec = vec![1]; - assert_ok!(pallet_bridge::Pallet::::update_fee(Origin::root(), dest_bridge_id, 10)); - assert_ok!(pallet_bridge::Pallet::::whitelist_chain(Origin::root(), dest_bridge_id)); + assert_ok!(pallet_bridge::Pallet::::update_fee( + RuntimeOrigin::root(), + dest_bridge_id, + 10 + )); + assert_ok!(pallet_bridge::Pallet::::whitelist_chain( + RuntimeOrigin::root(), + dest_bridge_id + )); assert_ok!(Pallet::::transfer_native( - Origin::signed(RELAYER_A), + RuntimeOrigin::signed(RELAYER_A), 100, dest_account.clone(), dest_bridge_id @@ -91,11 +98,11 @@ fn transfer_native() { ENDOWED_BALANCE - 100 ); assert_events(vec![ - mock::Event::Balances(pallet_balances::Event::Deposit { + mock::RuntimeEvent::Balances(pallet_balances::Event::Deposit { who: TreasuryAccount::get(), amount: 10, }), - Event::Bridge(bridge::Event::FungibleTransfer( + RuntimeEvent::Bridge(bridge::Event::FungibleTransfer( dest_bridge_id, 1, resource_id, @@ -115,7 +122,7 @@ fn mint_overflow() { assert_noop!( BridgeTransfer::transfer( - Origin::signed(Bridge::account_id()), + RuntimeOrigin::signed(Bridge::account_id()), RELAYER_A, u64::MAX, resource_id, @@ -134,7 +141,7 @@ fn exceed_max_supply() { assert_noop!( BridgeTransfer::transfer( - Origin::signed(Bridge::account_id()), + RuntimeOrigin::signed(Bridge::account_id()), RELAYER_A, MAXIMUM_ISSURANCE + 1, resource_id, @@ -152,7 +159,7 @@ fn exceed_max_supply_second() { assert_eq!(Balances::free_balance(&bridge_id), ENDOWED_BALANCE); assert_ok!(BridgeTransfer::transfer( - Origin::signed(Bridge::account_id()), + RuntimeOrigin::signed(Bridge::account_id()), RELAYER_A, MAXIMUM_ISSURANCE - Balances::total_issuance(), resource_id, @@ -160,7 +167,7 @@ fn exceed_max_supply_second() { assert_noop!( BridgeTransfer::transfer( - Origin::signed(Bridge::account_id()), + RuntimeOrigin::signed(Bridge::account_id()), RELAYER_A, 10, resource_id, @@ -180,7 +187,7 @@ fn transfer_to_regular_account() { assert_noop!( BridgeTransfer::transfer( - Origin::signed(Bridge::account_id()), + RuntimeOrigin::signed(Bridge::account_id()), RELAYER_A, amount, asset, @@ -199,16 +206,16 @@ fn create_successful_transfer_proposal() { let resource = b"BridgeTransfer.transfer".to_vec(); let proposal = make_transfer_proposal(RELAYER_A, 10); - assert_ok!(Bridge::set_threshold(Origin::root(), TEST_THRESHOLD,)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_A)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_B)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_C)); - assert_ok!(Bridge::whitelist_chain(Origin::root(), src_id)); - assert_ok!(Bridge::set_resource(Origin::root(), r_id, resource)); + assert_ok!(Bridge::set_threshold(RuntimeOrigin::root(), TEST_THRESHOLD,)); + assert_ok!(Bridge::add_relayer(RuntimeOrigin::root(), RELAYER_A)); + assert_ok!(Bridge::add_relayer(RuntimeOrigin::root(), RELAYER_B)); + assert_ok!(Bridge::add_relayer(RuntimeOrigin::root(), RELAYER_C)); + assert_ok!(Bridge::whitelist_chain(RuntimeOrigin::root(), src_id)); + assert_ok!(Bridge::set_resource(RuntimeOrigin::root(), r_id, resource)); // Create proposal (& vote) assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_A), + RuntimeOrigin::signed(RELAYER_A), prop_id, src_id, r_id, @@ -225,7 +232,7 @@ fn create_successful_transfer_proposal() { // Second relayer votes against assert_ok!(Bridge::reject_proposal( - Origin::signed(RELAYER_B), + RuntimeOrigin::signed(RELAYER_B), prop_id, src_id, r_id, @@ -242,7 +249,7 @@ fn create_successful_transfer_proposal() { // Third relayer votes in favour assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_C), + RuntimeOrigin::signed(RELAYER_C), prop_id, src_id, r_id, @@ -260,12 +267,12 @@ fn create_successful_transfer_proposal() { assert_eq!(Balances::free_balance(RELAYER_A), ENDOWED_BALANCE + 10); assert_events(vec![ - Event::Bridge(bridge::Event::VoteFor(src_id, prop_id, RELAYER_A)), - Event::Bridge(bridge::Event::VoteAgainst(src_id, prop_id, RELAYER_B)), - Event::Bridge(bridge::Event::VoteFor(src_id, prop_id, RELAYER_C)), - Event::Bridge(bridge::Event::ProposalApproved(src_id, prop_id)), - Event::Balances(balances::Event::Deposit { who: RELAYER_A, amount: 10 }), - Event::Bridge(bridge::Event::ProposalSucceeded(src_id, prop_id)), + RuntimeEvent::Bridge(bridge::Event::VoteFor(src_id, prop_id, RELAYER_A)), + RuntimeEvent::Bridge(bridge::Event::VoteAgainst(src_id, prop_id, RELAYER_B)), + RuntimeEvent::Bridge(bridge::Event::VoteFor(src_id, prop_id, RELAYER_C)), + RuntimeEvent::Bridge(bridge::Event::ProposalApproved(src_id, prop_id)), + RuntimeEvent::Balances(balances::Event::Deposit { who: RELAYER_A, amount: 10 }), + RuntimeEvent::Bridge(bridge::Event::ProposalSucceeded(src_id, prop_id)), ]); }) } @@ -276,13 +283,13 @@ fn test_external_balances_adjusted() { // Set the new external_balances assert_noop!( BridgeTransfer::set_external_balances( - Origin::signed(Bridge::account_id()), + RuntimeOrigin::signed(Bridge::account_id()), MaximumIssuance::::get() / 2 ), sp_runtime::DispatchError::BadOrigin ); assert_ok!(BridgeTransfer::set_external_balances( - Origin::root(), + RuntimeOrigin::root(), MaximumIssuance::::get() / 2 )); @@ -294,7 +301,7 @@ fn test_external_balances_adjusted() { // Check the external_balances assert_eq!(ExternalBalances::::get(), MaximumIssuance::::get() / 2); assert_ok!(BridgeTransfer::transfer( - Origin::signed(Bridge::account_id()), + RuntimeOrigin::signed(Bridge::account_id()), RELAYER_A, 10, resource_id, @@ -304,7 +311,7 @@ fn test_external_balances_adjusted() { // Check the external_balances assert_eq!(ExternalBalances::::get(), MaximumIssuance::::get() / 2 - 10); - assert_events(vec![Event::Balances(balances::Event::Deposit { + assert_events(vec![RuntimeEvent::Balances(balances::Event::Deposit { who: RELAYER_A, amount: 10, })]); @@ -312,10 +319,13 @@ fn test_external_balances_adjusted() { // Token cross out of parachain // Whitelist setup let dest_chain = 0; - assert_ok!(pallet_bridge::Pallet::::update_fee(Origin::root(), dest_chain, 0)); - assert_ok!(pallet_bridge::Pallet::::whitelist_chain(Origin::root(), dest_chain)); + assert_ok!(pallet_bridge::Pallet::::update_fee(RuntimeOrigin::root(), dest_chain, 0)); + assert_ok!(pallet_bridge::Pallet::::whitelist_chain( + RuntimeOrigin::root(), + dest_chain + )); assert_ok!(BridgeTransfer::transfer_native( - Origin::signed(RELAYER_A), + RuntimeOrigin::signed(RELAYER_A), 5, vec![0u8, 0u8, 0u8, 0u8], // no meaning dest_chain, @@ -330,7 +340,10 @@ fn test_external_balances_adjusted() { fn set_maximum_issuance() { new_test_ext().execute_with(|| { assert_eq!(pallet::MaximumIssuance::::get(), mock::MaximumIssuance::get()); - assert_ok!(pallet::Pallet::::set_maximum_issuance(Origin::signed(RELAYER_A), 2)); + assert_ok!(pallet::Pallet::::set_maximum_issuance( + RuntimeOrigin::signed(RELAYER_A), + 2 + )); assert_eq!(pallet::MaximumIssuance::::get(), 2); frame_system::Pallet::::assert_last_event( crate::Event::::MaximumIssuanceChanged { @@ -346,7 +359,7 @@ fn set_maximum_issuance_fails_with_unprivileged_origin() { new_test_ext().execute_with(|| { assert_eq!(pallet::MaximumIssuance::::get(), mock::MaximumIssuance::get()); assert_noop!( - pallet::Pallet::::set_maximum_issuance(Origin::signed(RELAYER_B), 2), + pallet::Pallet::::set_maximum_issuance(RuntimeOrigin::signed(RELAYER_B), 2), sp_runtime::DispatchError::BadOrigin ); assert_eq!(pallet::MaximumIssuance::::get(), mock::MaximumIssuance::get()); diff --git a/pallets/bridge/Cargo.toml b/pallets/bridge/Cargo.toml index 577b28f54a..c80f4f13b4 100644 --- a/pallets/bridge/Cargo.toml +++ b/pallets/bridge/Cargo.toml @@ -13,17 +13,17 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } # primitives -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } # frame dependencies -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } [features] default = ["std"] diff --git a/pallets/bridge/src/benchmarking.rs b/pallets/bridge/src/benchmarking.rs index 6941b1522d..09855c5d20 100644 --- a/pallets/bridge/src/benchmarking.rs +++ b/pallets/bridge/src/benchmarking.rs @@ -27,7 +27,7 @@ use sp_std::{boxed::Box, vec, vec::Vec}; const USER_SEED: u32 = 9966; -fn assert_last_event(generic_event: ::Event) { +fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } diff --git a/pallets/bridge/src/lib.rs b/pallets/bridge/src/lib.rs index 7c35b05f5f..dc7fe13a3d 100644 --- a/pallets/bridge/src/lib.rs +++ b/pallets/bridge/src/lib.rs @@ -34,12 +34,11 @@ pub use weights::WeightInfo; pub mod pallet { use crate::weights::WeightInfo; use codec::{Decode, Encode, EncodeLike}; - use frame_support::traits::{ - fungible::Mutate, Currency, ExistenceRequirement::AllowDeath, WithdrawReasons, - }; - pub use frame_support::{ - pallet_prelude::*, traits::StorageVersion, weights::GetDispatchInfo, PalletId, Parameter, + use frame_support::{ + dispatch::GetDispatchInfo, + traits::{fungible::Mutate, Currency, ExistenceRequirement::AllowDeath, WithdrawReasons}, }; + pub use frame_support::{pallet_prelude::*, traits::StorageVersion, PalletId, Parameter}; use frame_system::{ pallet_prelude::*, {self as system}, @@ -150,15 +149,16 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Origin used to administer the pallet - type BridgeCommitteeOrigin: EnsureOrigin; + type BridgeCommitteeOrigin: EnsureOrigin; /// Proposed dispatchable call type Proposal: Parameter - + Dispatchable - + EncodeLike + + Dispatchable + GetDispatchInfo - + From>; + + EncodeLike + + From> + + IsType<::RuntimeCall>; /// The identifier for this chain. /// This must be unique and must not collide with existing IDs within a set of bridged /// chains. @@ -722,20 +722,20 @@ pub mod pallet { /// Simple ensure origin for the bridge account pub struct EnsureBridge(sp_std::marker::PhantomData); - impl EnsureOrigin for EnsureBridge { + impl EnsureOrigin for EnsureBridge { type Success = T::AccountId; - fn try_origin(o: T::Origin) -> Result { + fn try_origin(o: T::RuntimeOrigin) -> Result { let bridge_id = MODULE_ID.into_account_truncating(); o.into().and_then(|o| match o { system::RawOrigin::Signed(who) if who == bridge_id => Ok(bridge_id), - r => Err(T::Origin::from(r)), + r => Err(T::RuntimeOrigin::from(r)), }) } #[cfg(feature = "runtime-benchmarks")] - fn successful_origin() -> T::Origin { + fn successful_origin() -> T::RuntimeOrigin { let bridge_id = MODULE_ID.into_account_truncating(); - T::Origin::from(system::RawOrigin::Signed(bridge_id)) + T::RuntimeOrigin::from(system::RawOrigin::Signed(bridge_id)) } } } diff --git a/pallets/bridge/src/mock.rs b/pallets/bridge/src/mock.rs index 1b8d1a0d4a..b559b742bb 100644 --- a/pallets/bridge/src/mock.rs +++ b/pallets/bridge/src/mock.rs @@ -54,8 +54,8 @@ parameter_types! { impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -63,7 +63,7 @@ impl frame_system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); @@ -86,7 +86,7 @@ ord_parameter_types! { impl pallet_balances::Config for Test { type Balance = u64; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU64<1>; type AccountStore = System; type WeightInfo = (); @@ -102,9 +102,9 @@ parameter_types! { } impl Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BridgeCommitteeOrigin = frame_system::EnsureRoot; - type Proposal = Call; + type Proposal = RuntimeCall; type BridgeChainId = TestChainId; type Currency = Balances; type ProposalLifetime = ProposalLifetime; @@ -145,16 +145,16 @@ pub fn new_test_ext_initialized( let mut t = new_test_ext(); t.execute_with(|| { // Set and check threshold - assert_ok!(Bridge::set_threshold(Origin::root(), TEST_THRESHOLD)); + assert_ok!(Bridge::set_threshold(RuntimeOrigin::root(), TEST_THRESHOLD)); assert_eq!(Bridge::relayer_threshold(), TEST_THRESHOLD); // Add relayers - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_A)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_B)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_C)); + assert_ok!(Bridge::add_relayer(RuntimeOrigin::root(), RELAYER_A)); + assert_ok!(Bridge::add_relayer(RuntimeOrigin::root(), RELAYER_B)); + assert_ok!(Bridge::add_relayer(RuntimeOrigin::root(), RELAYER_C)); // Whitelist chain - assert_ok!(Bridge::whitelist_chain(Origin::root(), src_id)); + assert_ok!(Bridge::whitelist_chain(RuntimeOrigin::root(), src_id)); // Set and check resource ID mapped to some junk data - assert_ok!(Bridge::set_resource(Origin::root(), r_id, resource)); + assert_ok!(Bridge::set_resource(RuntimeOrigin::root(), r_id, resource)); assert!(Bridge::resource_exists(r_id)); }); t @@ -162,8 +162,8 @@ pub fn new_test_ext_initialized( // Checks events against the latest. A contiguous set of events must be provided. They must // include the most recent event, but do not have to include every past event. -pub fn assert_events(mut expected: Vec) { - let mut actual: Vec = +pub fn assert_events(mut expected: Vec) { + let mut actual: Vec = system::Pallet::::events().iter().map(|e| e.event.clone()).collect(); expected.reverse(); diff --git a/pallets/bridge/src/tests.rs b/pallets/bridge/src/tests.rs index a129714785..debc6f5fc2 100644 --- a/pallets/bridge/src/tests.rs +++ b/pallets/bridge/src/tests.rs @@ -18,9 +18,9 @@ use super::{ mock::{ - assert_events, new_test_ext, new_test_ext_initialized, Balances, Bridge, Call, Event, - Origin, ProposalLifetime, System, Test, TestChainId, TreasuryAccount, ENDOWED_BALANCE, - RELAYER_A, RELAYER_B, RELAYER_C, TEST_THRESHOLD, + assert_events, new_test_ext, new_test_ext_initialized, Balances, Bridge, ProposalLifetime, + RuntimeCall, RuntimeEvent, RuntimeOrigin, System, Test, TestChainId, TreasuryAccount, + ENDOWED_BALANCE, RELAYER_A, RELAYER_B, RELAYER_C, TEST_THRESHOLD, }, pallet::Event as PalletEvent, *, @@ -99,13 +99,13 @@ fn setup_resources() { let method = "Pallet.do_something".as_bytes().to_vec(); let method2 = "Pallet.do_somethingElse".as_bytes().to_vec(); - assert_ok!(Bridge::set_resource(Origin::root(), id, method.clone())); + assert_ok!(Bridge::set_resource(RuntimeOrigin::root(), id, method.clone())); assert_eq!(Bridge::resources(id), Some(method)); - assert_ok!(Bridge::set_resource(Origin::root(), id, method2.clone())); + assert_ok!(Bridge::set_resource(RuntimeOrigin::root(), id, method2.clone())); assert_eq!(Bridge::resources(id), Some(method2)); - assert_ok!(Bridge::remove_resource(Origin::root(), id)); + assert_ok!(Bridge::remove_resource(RuntimeOrigin::root(), id)); assert_eq!(Bridge::resources(id), None); }) } @@ -115,13 +115,13 @@ fn whitelist_chain() { new_test_ext().execute_with(|| { assert!(!Bridge::chain_whitelisted(0)); - assert_ok!(Bridge::whitelist_chain(Origin::root(), 0)); + assert_ok!(Bridge::whitelist_chain(RuntimeOrigin::root(), 0)); assert_noop!( - Bridge::whitelist_chain(Origin::root(), TestChainId::get()), + Bridge::whitelist_chain(RuntimeOrigin::root(), TestChainId::get()), Error::::InvalidChainId ); - assert_events(vec![Event::Bridge(PalletEvent::ChainWhitelisted(0))]); + assert_events(vec![RuntimeEvent::Bridge(PalletEvent::ChainWhitelisted(0))]); }) } @@ -130,15 +130,15 @@ fn set_get_threshold() { new_test_ext().execute_with(|| { assert_eq!(>::get(), 1); - assert_ok!(Bridge::set_threshold(Origin::root(), TEST_THRESHOLD)); + assert_ok!(Bridge::set_threshold(RuntimeOrigin::root(), TEST_THRESHOLD)); assert_eq!(>::get(), TEST_THRESHOLD); - assert_ok!(Bridge::set_threshold(Origin::root(), 5)); + assert_ok!(Bridge::set_threshold(RuntimeOrigin::root(), 5)); assert_eq!(>::get(), 5); assert_events(vec![ - Event::Bridge(PalletEvent::RelayerThresholdChanged(TEST_THRESHOLD)), - Event::Bridge(PalletEvent::RelayerThresholdChanged(5)), + RuntimeEvent::Bridge(PalletEvent::RelayerThresholdChanged(TEST_THRESHOLD)), + RuntimeEvent::Bridge(PalletEvent::RelayerThresholdChanged(5)), ]); }) } @@ -146,40 +146,40 @@ fn set_get_threshold() { #[test] fn add_remove_relayer() { new_test_ext().execute_with(|| { - assert_ok!(Bridge::set_threshold(Origin::root(), TEST_THRESHOLD,)); + assert_ok!(Bridge::set_threshold(RuntimeOrigin::root(), TEST_THRESHOLD,)); assert_eq!(Bridge::relayer_count(), 0); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_A)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_B)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_C)); + assert_ok!(Bridge::add_relayer(RuntimeOrigin::root(), RELAYER_A)); + assert_ok!(Bridge::add_relayer(RuntimeOrigin::root(), RELAYER_B)); + assert_ok!(Bridge::add_relayer(RuntimeOrigin::root(), RELAYER_C)); assert_eq!(Bridge::relayer_count(), 3); // Already exists assert_noop!( - Bridge::add_relayer(Origin::root(), RELAYER_A), + Bridge::add_relayer(RuntimeOrigin::root(), RELAYER_A), Error::::RelayerAlreadyExists ); // Confirm removal - assert_ok!(Bridge::remove_relayer(Origin::root(), RELAYER_B)); + assert_ok!(Bridge::remove_relayer(RuntimeOrigin::root(), RELAYER_B)); assert_eq!(Bridge::relayer_count(), 2); assert_noop!( - Bridge::remove_relayer(Origin::root(), RELAYER_B), + Bridge::remove_relayer(RuntimeOrigin::root(), RELAYER_B), Error::::RelayerInvalid ); assert_eq!(Bridge::relayer_count(), 2); assert_events(vec![ - Event::Bridge(PalletEvent::RelayerAdded(RELAYER_A)), - Event::Bridge(PalletEvent::RelayerAdded(RELAYER_B)), - Event::Bridge(PalletEvent::RelayerAdded(RELAYER_C)), - Event::Bridge(PalletEvent::RelayerRemoved(RELAYER_B)), + RuntimeEvent::Bridge(PalletEvent::RelayerAdded(RELAYER_A)), + RuntimeEvent::Bridge(PalletEvent::RelayerAdded(RELAYER_B)), + RuntimeEvent::Bridge(PalletEvent::RelayerAdded(RELAYER_C)), + RuntimeEvent::Bridge(PalletEvent::RelayerRemoved(RELAYER_B)), ]); }) } -fn make_proposal(remark: Vec) -> Call { - Call::System(system::Call::remark { remark }) +fn make_proposal(remark: Vec) -> RuntimeCall { + RuntimeCall::System(system::Call::remark { remark }) } #[test] @@ -193,7 +193,7 @@ fn create_sucessful_proposal() { // Create proposal (& vote) assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_A), + RuntimeOrigin::signed(RELAYER_A), prop_id, src_id, r_id, @@ -210,7 +210,7 @@ fn create_sucessful_proposal() { // Second relayer votes against assert_ok!(Bridge::reject_proposal( - Origin::signed(RELAYER_B), + RuntimeOrigin::signed(RELAYER_B), prop_id, src_id, r_id, @@ -227,7 +227,7 @@ fn create_sucessful_proposal() { // Third relayer votes in favour assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_C), + RuntimeOrigin::signed(RELAYER_C), prop_id, src_id, r_id, @@ -243,11 +243,11 @@ fn create_sucessful_proposal() { assert_eq!(prop, expected); assert_events(vec![ - Event::Bridge(PalletEvent::VoteFor(src_id, prop_id, RELAYER_A)), - Event::Bridge(PalletEvent::VoteAgainst(src_id, prop_id, RELAYER_B)), - Event::Bridge(PalletEvent::VoteFor(src_id, prop_id, RELAYER_C)), - Event::Bridge(PalletEvent::ProposalApproved(src_id, prop_id)), - Event::Bridge(PalletEvent::ProposalSucceeded(src_id, prop_id)), + RuntimeEvent::Bridge(PalletEvent::VoteFor(src_id, prop_id, RELAYER_A)), + RuntimeEvent::Bridge(PalletEvent::VoteAgainst(src_id, prop_id, RELAYER_B)), + RuntimeEvent::Bridge(PalletEvent::VoteFor(src_id, prop_id, RELAYER_C)), + RuntimeEvent::Bridge(PalletEvent::ProposalApproved(src_id, prop_id)), + RuntimeEvent::Bridge(PalletEvent::ProposalSucceeded(src_id, prop_id)), ]); }) } @@ -263,7 +263,7 @@ fn create_unsucessful_proposal() { // Create proposal (& vote) assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_A), + RuntimeOrigin::signed(RELAYER_A), prop_id, src_id, r_id, @@ -280,7 +280,7 @@ fn create_unsucessful_proposal() { // Second relayer votes against assert_ok!(Bridge::reject_proposal( - Origin::signed(RELAYER_B), + RuntimeOrigin::signed(RELAYER_B), prop_id, src_id, r_id, @@ -297,7 +297,7 @@ fn create_unsucessful_proposal() { // Third relayer votes against assert_ok!(Bridge::reject_proposal( - Origin::signed(RELAYER_C), + RuntimeOrigin::signed(RELAYER_C), prop_id, src_id, r_id, @@ -316,10 +316,10 @@ fn create_unsucessful_proposal() { assert_eq!(Balances::free_balance(Bridge::account_id()), ENDOWED_BALANCE); assert_events(vec![ - Event::Bridge(PalletEvent::VoteFor(src_id, prop_id, RELAYER_A)), - Event::Bridge(PalletEvent::VoteAgainst(src_id, prop_id, RELAYER_B)), - Event::Bridge(PalletEvent::VoteAgainst(src_id, prop_id, RELAYER_C)), - Event::Bridge(PalletEvent::ProposalRejected(src_id, prop_id)), + RuntimeEvent::Bridge(PalletEvent::VoteFor(src_id, prop_id, RELAYER_A)), + RuntimeEvent::Bridge(PalletEvent::VoteAgainst(src_id, prop_id, RELAYER_B)), + RuntimeEvent::Bridge(PalletEvent::VoteAgainst(src_id, prop_id, RELAYER_C)), + RuntimeEvent::Bridge(PalletEvent::ProposalRejected(src_id, prop_id)), ]); }) } @@ -335,7 +335,7 @@ fn execute_after_threshold_change() { // Create proposal (& vote) assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_A), + RuntimeOrigin::signed(RELAYER_A), prop_id, src_id, r_id, @@ -351,11 +351,11 @@ fn execute_after_threshold_change() { assert_eq!(prop, expected); // Change threshold - assert_ok!(Bridge::set_threshold(Origin::root(), 1)); + assert_ok!(Bridge::set_threshold(RuntimeOrigin::root(), 1)); // Attempt to execute assert_ok!(Bridge::eval_vote_state( - Origin::signed(RELAYER_A), + RuntimeOrigin::signed(RELAYER_A), prop_id, src_id, Box::new(proposal.clone()) @@ -374,10 +374,10 @@ fn execute_after_threshold_change() { assert_eq!(Balances::free_balance(Bridge::account_id()), ENDOWED_BALANCE); assert_events(vec![ - Event::Bridge(PalletEvent::VoteFor(src_id, prop_id, RELAYER_A)), - Event::Bridge(PalletEvent::RelayerThresholdChanged(1)), - Event::Bridge(PalletEvent::ProposalApproved(src_id, prop_id)), - Event::Bridge(PalletEvent::ProposalSucceeded(src_id, prop_id)), + RuntimeEvent::Bridge(PalletEvent::VoteFor(src_id, prop_id, RELAYER_A)), + RuntimeEvent::Bridge(PalletEvent::RelayerThresholdChanged(1)), + RuntimeEvent::Bridge(PalletEvent::ProposalApproved(src_id, prop_id)), + RuntimeEvent::Bridge(PalletEvent::ProposalSucceeded(src_id, prop_id)), ]); }) } @@ -393,7 +393,7 @@ fn proposal_expires() { // Create proposal (& vote) assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_A), + RuntimeOrigin::signed(RELAYER_A), prop_id, src_id, r_id, @@ -414,7 +414,7 @@ fn proposal_expires() { // Attempt to submit a vote should fail assert_noop!( Bridge::reject_proposal( - Origin::signed(RELAYER_B), + RuntimeOrigin::signed(RELAYER_B), prop_id, src_id, r_id, @@ -436,7 +436,7 @@ fn proposal_expires() { // eval_vote_state should have no effect assert_noop!( Bridge::eval_vote_state( - Origin::signed(RELAYER_C), + RuntimeOrigin::signed(RELAYER_C), prop_id, src_id, Box::new(proposal.clone()) @@ -452,7 +452,7 @@ fn proposal_expires() { }; assert_eq!(prop, expected); - assert_events(vec![Event::Bridge(PalletEvent::VoteFor(src_id, prop_id, RELAYER_A))]); + assert_events(vec![RuntimeEvent::Bridge(PalletEvent::VoteFor(src_id, prop_id, RELAYER_A))]); }) } @@ -462,8 +462,8 @@ fn transfer_fungible() { let dest_id: BridgeChainId = 0; let resource_id = derive_resource_id(dest_id, b"remark"); let dest_account: Vec = vec![1]; - assert_ok!(Pallet::::update_fee(Origin::root(), dest_id, 10)); - assert_ok!(Pallet::::whitelist_chain(Origin::root(), dest_id)); + assert_ok!(Pallet::::update_fee(RuntimeOrigin::root(), dest_id, 10)); + assert_ok!(Pallet::::whitelist_chain(RuntimeOrigin::root(), dest_id)); assert_ok!(Pallet::::transfer_fungible( RELAYER_A, dest_id, @@ -481,11 +481,11 @@ fn transfer_fungible() { ENDOWED_BALANCE - 100 ); assert_events(vec![ - mock::Event::Balances(pallet_balances::Event::Deposit { + mock::RuntimeEvent::Balances(pallet_balances::Event::Deposit { who: TreasuryAccount::get(), amount: 10, }), - Event::Bridge(PalletEvent::FungibleTransfer( + RuntimeEvent::Bridge(PalletEvent::FungibleTransfer( dest_id, 1, resource_id, @@ -502,7 +502,7 @@ fn transfer_fungible_no_fee() { let dest_id: BridgeChainId = 0; let resource_id = derive_resource_id(dest_id, b"remark"); let dest_account: Vec = vec![1]; - assert_ok!(Pallet::::whitelist_chain(Origin::root(), dest_id)); + assert_ok!(Pallet::::whitelist_chain(RuntimeOrigin::root(), dest_id)); assert_noop!( Pallet::::transfer_fungible(RELAYER_A, dest_id, resource_id, dest_account, 100,), Error::::CannotPayAsFee @@ -531,8 +531,8 @@ fn transfer_fungible_insufficient_funds_fee() { let dest_account: Vec = vec![1]; let fee: BalanceOf = 10; let transfer_amount = fee; - assert_ok!(Pallet::::update_fee(Origin::root(), dest_id, fee)); - assert_ok!(Pallet::::whitelist_chain(Origin::root(), dest_id)); + assert_ok!(Pallet::::update_fee(RuntimeOrigin::root(), dest_id, fee)); + assert_ok!(Pallet::::whitelist_chain(RuntimeOrigin::root(), dest_id)); assert_noop!( Pallet::::transfer_fungible( RELAYER_A, @@ -554,8 +554,8 @@ fn transfer_fungible_insufficient_free_balance() { let dest_account: Vec = vec![1]; let fee: BalanceOf = 10; let transfer_amount = 100; - assert_ok!(Pallet::::update_fee(Origin::root(), dest_id, fee)); - assert_ok!(Pallet::::whitelist_chain(Origin::root(), dest_id)); + assert_ok!(Pallet::::update_fee(RuntimeOrigin::root(), dest_id, fee)); + assert_ok!(Pallet::::whitelist_chain(RuntimeOrigin::root(), dest_id)); assert_noop!( Pallet::::transfer_fungible( 0x7, diff --git a/pallets/drop3/Cargo.toml b/pallets/drop3/Cargo.toml index f8405e128b..59d8e4e026 100644 --- a/pallets/drop3/Cargo.toml +++ b/pallets/drop3/Cargo.toml @@ -12,18 +12,18 @@ version = '0.1.0' codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] diff --git a/pallets/drop3/src/benchmarking.rs b/pallets/drop3/src/benchmarking.rs index 39b605f274..b718497f3b 100644 --- a/pallets/drop3/src/benchmarking.rs +++ b/pallets/drop3/src/benchmarking.rs @@ -38,11 +38,11 @@ const TRANSFER_ED_MULTIPLIER: u32 = 2; // execution trapped... // - maybe have to make more careful thoughts of benchmarking the worst case scenario -fn assert_last_event(generic_event: ::Event) { +fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } -fn assert_event(generic_event: ::Event) { +fn assert_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_has_event(generic_event.into()); } @@ -119,7 +119,7 @@ benchmarks! { */ let old_admin= >::get(); let admin: T::AccountId = account("admin", 0, SEED); - }: _(origin, admin) + }: _(origin, admin) verify { assert_last_event::(Event::AdminChanged { old_admin }.into()); } diff --git a/pallets/drop3/src/lib.rs b/pallets/drop3/src/lib.rs index 205bd2275f..15abc48c00 100644 --- a/pallets/drop3/src/lib.rs +++ b/pallets/drop3/src/lib.rs @@ -109,7 +109,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// The overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// A unique id representing a single reward pool type PoolId: Default @@ -125,7 +125,7 @@ pub mod pallet { type Currency: ReservableCurrency; /// The origin who can set the admin account - type SetAdminOrigin: EnsureOrigin; + type SetAdminOrigin: EnsureOrigin; /// Weights type WeightInfo: WeightInfo; diff --git a/pallets/drop3/src/mock.rs b/pallets/drop3/src/mock.rs index 850b00731b..8317c9c1a6 100644 --- a/pallets/drop3/src/mock.rs +++ b/pallets/drop3/src/mock.rs @@ -57,8 +57,8 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -66,7 +66,7 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -84,7 +84,7 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type Balance = Balance; // the type that is relevant to us - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; @@ -100,7 +100,7 @@ ord_parameter_types! { } impl pallet_drop3::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type PoolId = PoolId; type SetAdminOrigin = EnsureSignedBy; type Currency = Balances; @@ -144,7 +144,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { ext.execute_with(|| { System::set_block_number(1); // set 1 as admin account - let _ = Drop3::set_admin(Origin::signed(1), 1); + let _ = Drop3::set_admin(RuntimeOrigin::signed(1), 1); }); ext } diff --git a/pallets/drop3/src/tests.rs b/pallets/drop3/src/tests.rs index 217fb90b05..4ac3b4db06 100644 --- a/pallets/drop3/src/tests.rs +++ b/pallets/drop3/src/tests.rs @@ -24,9 +24,11 @@ use frame_support::{ fn set_admin_works() { new_test_ext().execute_with(|| { assert_eq!(Drop3::admin().unwrap(), 1); - assert_ok!(Drop3::set_admin(Origin::signed(1), 2)); + assert_ok!(Drop3::set_admin(RuntimeOrigin::signed(1), 2)); assert_eq!(Drop3::admin().unwrap(), 2); - System::assert_last_event(Event::Drop3(crate::Event::AdminChanged { old_admin: Some(1) })); + System::assert_last_event(RuntimeEvent::Drop3(crate::Event::AdminChanged { + old_admin: Some(1), + })); }); } @@ -34,7 +36,10 @@ fn set_admin_works() { fn set_admin_fails_with_unprivileged_origin() { new_test_ext().execute_with(|| { assert_eq!(Drop3::admin().unwrap(), 1); - assert_noop!(Drop3::set_admin(Origin::signed(2), 2), sp_runtime::DispatchError::BadOrigin); + assert_noop!( + Drop3::set_admin(RuntimeOrigin::signed(2), 2), + sp_runtime::DispatchError::BadOrigin + ); assert_eq!(Drop3::admin().unwrap(), 1); }); } @@ -43,7 +48,13 @@ fn set_admin_fails_with_unprivileged_origin() { fn propose_reward_pool_works() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); assert_eq!(Drop3::get_sorted_pool_ids(), vec![1]); assert!(Drop3::reward_pools(1).is_some()); let pool = Drop3::reward_pools(1).unwrap(); @@ -53,7 +64,7 @@ fn propose_reward_pool_works() { assert_eq!(pool.total, 100); assert_eq!(pool.remain, 100); assert_eq!(Balances::reserved_balance(3), 100); - System::assert_last_event(Event::Drop3(crate::Event::RewardPoolProposed { + System::assert_last_event(RuntimeEvent::Drop3(crate::Event::RewardPoolProposed { id: 1, name: b"test".to_vec(), owner: 3, @@ -65,8 +76,20 @@ fn propose_reward_pool_works() { fn multiple_propose_reward_pool_works() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 10, 2, 3)); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 20, 4, 5)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 10, + 2, + 3 + )); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 20, + 4, + 5 + )); assert_eq!(Drop3::get_sorted_pool_ids(), vec![1, 2]); // they should have the same owner assert_eq!(Drop3::reward_pool_owners(1), Some(3)); @@ -83,7 +106,13 @@ fn propose_reward_pool_works_with_wrapping_id() { let _ = Balances::deposit_creating(&3, 1000); // create a new proposal, it should have the id PoolId::max_value() - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 10, 2, 3)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 10, + 2, + 3 + )); assert_eq!( Drop3::get_sorted_pool_ids(), vec![PoolId::max_value() - 1, PoolId::max_value()] @@ -91,7 +120,13 @@ fn propose_reward_pool_works_with_wrapping_id() { assert_eq!(Drop3::current_max_pool_id(), PoolId::max_value()); // create a new proposal, it should have the id PoolId::min_value() + 1 - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 10, 2, 3)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 10, + 2, + 3 + )); assert_eq!( Drop3::get_sorted_pool_ids(), vec![1, PoolId::max_value() - 1, PoolId::max_value()] @@ -103,8 +138,14 @@ fn propose_reward_pool_works_with_wrapping_id() { propose_default_reward_pool(4, false); // create a new proposal, it should have the id 3 - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 10, 2, 3)); - System::assert_last_event(Event::Drop3(crate::Event::RewardPoolProposed { + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 10, + 2, + 3 + )); + System::assert_last_event(RuntimeEvent::Drop3(crate::Event::RewardPoolProposed { id: 3, name: b"test".to_vec(), owner: 3, @@ -121,7 +162,7 @@ fn propose_reward_pool_fails_with_zero_toal() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); assert_noop!( - Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 0, 2, 3), + Drop3::propose_reward_pool(RuntimeOrigin::signed(3), b"test".to_vec(), 0, 2, 3), Error::::InvalidTotalBalance ); assert_eq!(Drop3::get_sorted_pool_ids(), Vec::::new()); @@ -133,7 +174,7 @@ fn propose_reward_pool_fails_with_insufficient_balance() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); assert_noop!( - Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 200, 2, 3), + Drop3::propose_reward_pool(RuntimeOrigin::signed(3), b"test".to_vec(), 200, 2, 3), pallet_balances::Error::::InsufficientBalance ); assert_eq!(Drop3::get_sorted_pool_ids(), Vec::::new()); @@ -144,10 +185,16 @@ fn propose_reward_pool_fails_with_insufficient_balance() { fn approve_reward_pool_works() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); - assert_ok!(Drop3::approve_reward_pool(Origin::signed(1), 1)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); + assert_ok!(Drop3::approve_reward_pool(RuntimeOrigin::signed(1), 1)); assert!(Drop3::reward_pools(1).unwrap().approved); - System::assert_last_event(Event::Drop3(crate::Event::RewardPoolApproved { id: 1 })); + System::assert_last_event(RuntimeEvent::Drop3(crate::Event::RewardPoolApproved { id: 1 })); }); } @@ -155,8 +202,17 @@ fn approve_reward_pool_works() { fn approve_reward_pool_fails_with_non_admin() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); - assert_noop!(Drop3::approve_reward_pool(Origin::signed(3), 1), Error::::RequireAdmin); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); + assert_noop!( + Drop3::approve_reward_pool(RuntimeOrigin::signed(3), 1), + Error::::RequireAdmin + ); assert!(!Drop3::reward_pools(1).unwrap().approved); }); } @@ -165,9 +221,15 @@ fn approve_reward_pool_fails_with_non_admin() { fn approve_reward_pool_fails_with_non_existent_pool() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); assert_noop!( - Drop3::approve_reward_pool(Origin::signed(1), 2), + Drop3::approve_reward_pool(RuntimeOrigin::signed(1), 2), Error::::NoSuchRewardPool ); assert!(!Drop3::reward_pools(1).unwrap().approved); @@ -178,20 +240,29 @@ fn approve_reward_pool_fails_with_non_existent_pool() { fn reject_reward_pool_works() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); - assert_ok!(Drop3::reject_reward_pool(Origin::signed(1), 1)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); + assert_ok!(Drop3::reject_reward_pool(RuntimeOrigin::signed(1), 1)); assert_eq!(Balances::reserved_balance(3), 0); assert_eq!(Balances::free_balance(3), 80); assert!(!crate::RewardPools::::contains_key(1)); - System::assert_has_event(Event::Drop3(crate::Event::RewardPoolRejected { id: 1 })); - System::assert_has_event(Event::Drop3(crate::Event::BalanceSlashed { who: 3, amount: 20 })); - System::assert_has_event(Event::Drop3(crate::Event::RewardPoolRemoved { + System::assert_has_event(RuntimeEvent::Drop3(crate::Event::RewardPoolRejected { id: 1 })); + System::assert_has_event(RuntimeEvent::Drop3(crate::Event::BalanceSlashed { + who: 3, + amount: 20, + })); + System::assert_has_event(RuntimeEvent::Drop3(crate::Event::RewardPoolRemoved { id: 1, name: b"test".to_vec(), owner: 3, })); assert_noop!( - Drop3::reject_reward_pool(Origin::signed(1), 5), + Drop3::reject_reward_pool(RuntimeOrigin::signed(1), 5), Error::::NoSuchRewardPool ); }); @@ -201,18 +272,27 @@ fn reject_reward_pool_works() { fn reject_reward_pool_works_with_unexpected_unreserve() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); // intentionally unreserve 90 out of 100 >::unreserve(&3, 90); // should be handled gracefully and no error happens - assert_ok!(Drop3::reject_reward_pool(Origin::signed(1), 1)); + assert_ok!(Drop3::reject_reward_pool(RuntimeOrigin::signed(1), 1)); assert_eq!(Balances::reserved_balance(3), 0); assert_eq!(Balances::free_balance(3), 90); assert!(!crate::RewardPools::::contains_key(1)); - System::assert_has_event(Event::Drop3(crate::Event::RewardPoolRejected { id: 1 })); + System::assert_has_event(RuntimeEvent::Drop3(crate::Event::RewardPoolRejected { id: 1 })); // only 10 was slashed - System::assert_has_event(Event::Drop3(crate::Event::BalanceSlashed { who: 3, amount: 10 })); - System::assert_has_event(Event::Drop3(crate::Event::RewardPoolRemoved { + System::assert_has_event(RuntimeEvent::Drop3(crate::Event::BalanceSlashed { + who: 3, + amount: 10, + })); + System::assert_has_event(RuntimeEvent::Drop3(crate::Event::RewardPoolRemoved { id: 1, name: b"test".to_vec(), owner: 3, @@ -224,13 +304,19 @@ fn reject_reward_pool_works_with_unexpected_unreserve() { fn reject_reward_pool_fails_with_already_approved() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); - assert_ok!(Drop3::approve_reward_pool(Origin::signed(1), 1)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); + assert_ok!(Drop3::approve_reward_pool(RuntimeOrigin::signed(1), 1)); assert!(Drop3::reward_pools(1).unwrap().approved); - System::assert_has_event(Event::Drop3(crate::Event::RewardPoolApproved { id: 1 })); + System::assert_has_event(RuntimeEvent::Drop3(crate::Event::RewardPoolApproved { id: 1 })); // reject an approved proposal should fail assert_noop!( - Drop3::reject_reward_pool(Origin::signed(1), 1), + Drop3::reject_reward_pool(RuntimeOrigin::signed(1), 1), Error::::RewardPoolAlreadyApproved ); // the pool shouldn't be deleted and no change of reserved balance @@ -245,28 +331,34 @@ fn reject_reward_pool_fails_with_already_approved() { fn start_stop_reward_pool_works() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); - assert_ok!(Drop3::approve_reward_pool(Origin::signed(1), 1)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); + assert_ok!(Drop3::approve_reward_pool(RuntimeOrigin::signed(1), 1)); // pool owner starts the reward pool - assert_ok!(Drop3::start_reward_pool(Origin::signed(3), 1)); + assert_ok!(Drop3::start_reward_pool(RuntimeOrigin::signed(3), 1)); assert!(Drop3::reward_pools(1).unwrap().started); // admin stops the reward pool - assert_ok!(Drop3::stop_reward_pool(Origin::signed(1), 1)); + assert_ok!(Drop3::stop_reward_pool(RuntimeOrigin::signed(1), 1)); assert!(!Drop3::reward_pools(1).unwrap().started); assert_noop!( - Drop3::start_reward_pool(Origin::signed(2), 1), + Drop3::start_reward_pool(RuntimeOrigin::signed(2), 1), Error::::RequireAdminOrRewardPoolOwner ); assert_noop!( - Drop3::start_reward_pool(Origin::signed(1), 5), + Drop3::start_reward_pool(RuntimeOrigin::signed(1), 5), Error::::NoSuchRewardPool ); assert_noop!( - Drop3::stop_reward_pool(Origin::signed(2), 1), + Drop3::stop_reward_pool(RuntimeOrigin::signed(2), 1), Error::::RequireAdminOrRewardPoolOwner ); assert_noop!( - Drop3::stop_reward_pool(Origin::signed(1), 5), + Drop3::stop_reward_pool(RuntimeOrigin::signed(1), 5), Error::::NoSuchRewardPool ); }); @@ -276,13 +368,19 @@ fn start_stop_reward_pool_works() { fn close_reward_pool_works() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); // pool owner should be able to close the pool even before the admin approves or rejects it - assert_ok!(Drop3::close_reward_pool(Origin::signed(3), 1)); + assert_ok!(Drop3::close_reward_pool(RuntimeOrigin::signed(3), 1)); assert!(!crate::RewardPools::::contains_key(1)); assert_eq!(Balances::reserved_balance(3), 0); assert_eq!(Balances::free_balance(3), 100); - System::assert_has_event(Event::Drop3(crate::Event::RewardPoolRemoved { + System::assert_has_event(RuntimeEvent::Drop3(crate::Event::RewardPoolRemoved { id: 1, name: b"test".to_vec(), owner: 3, @@ -290,7 +388,7 @@ fn close_reward_pool_works() { // try to close it the second time would bring about NoSuchRewardPool error assert_noop!( - Drop3::close_reward_pool(Origin::signed(3), 1), + Drop3::close_reward_pool(RuntimeOrigin::signed(3), 1), Error::::NoSuchRewardPool ); }); @@ -303,24 +401,36 @@ fn send_reward_works() { let _ = Balances::deposit_creating(&4, 5); let _ = Balances::deposit_creating(&5, 10); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 1, 3)); - assert_ok!(Drop3::approve_reward_pool(Origin::signed(1), 1)); - assert_ok!(Drop3::start_reward_pool(Origin::signed(3), 1)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 1, + 3 + )); + assert_ok!(Drop3::approve_reward_pool(RuntimeOrigin::signed(1), 1)); + assert_ok!(Drop3::start_reward_pool(RuntimeOrigin::signed(3), 1)); // only the reward pool owner can send reward, not even the admin assert_noop!( - Drop3::send_reward(Origin::signed(1), 1, 4, 10), + Drop3::send_reward(RuntimeOrigin::signed(1), 1, 4, 10), Error::::RequireRewardPoolOwner ); - assert_ok!(Drop3::send_reward(Origin::signed(3), 1, 4, 10)); - assert_ok!(Drop3::send_reward(Origin::signed(3), 1, 5, 20)); + assert_ok!(Drop3::send_reward(RuntimeOrigin::signed(3), 1, 4, 10)); + assert_ok!(Drop3::send_reward(RuntimeOrigin::signed(3), 1, 5, 20)); assert_eq!(Balances::reserved_balance(3), 70); assert_eq!(Balances::free_balance(4), 15); assert_eq!(Balances::free_balance(5), 30); assert_eq!(Drop3::reward_pools(1).unwrap().remain, 70); - System::assert_has_event(Event::Drop3(crate::Event::RewardSent { to: 4, amount: 10 })); - System::assert_has_event(Event::Drop3(crate::Event::RewardSent { to: 5, amount: 20 })); + System::assert_has_event(RuntimeEvent::Drop3(crate::Event::RewardSent { + to: 4, + amount: 10, + })); + System::assert_has_event(RuntimeEvent::Drop3(crate::Event::RewardSent { + to: 5, + amount: 20, + })); }); } @@ -331,9 +441,15 @@ fn send_reward_fails_with_unapproved_pool() { let _ = Balances::deposit_creating(&4, 5); let _ = Balances::deposit_creating(&5, 10); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 1, 3)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 1, + 3 + )); assert_noop!( - Drop3::send_reward(Origin::signed(3), 1, 4, 10), + Drop3::send_reward(RuntimeOrigin::signed(3), 1, 4, 10), Error::::RewardPoolUnapproved ); }); @@ -346,10 +462,16 @@ fn send_reward_fails_with_stopped_pool() { let _ = Balances::deposit_creating(&4, 5); let _ = Balances::deposit_creating(&5, 10); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 1, 3)); - assert_ok!(Drop3::approve_reward_pool(Origin::signed(1), 1)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 1, + 3 + )); + assert_ok!(Drop3::approve_reward_pool(RuntimeOrigin::signed(1), 1)); assert_noop!( - Drop3::send_reward(Origin::signed(3), 1, 4, 10), + Drop3::send_reward(RuntimeOrigin::signed(3), 1, 4, 10), Error::::RewardPoolStopped ); }); @@ -360,12 +482,18 @@ fn send_reward_fails_with_too_early() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); System::set_block_number(1); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); - assert_ok!(Drop3::approve_reward_pool(Origin::signed(1), 1)); - assert_ok!(Drop3::start_reward_pool(Origin::signed(3), 1)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); + assert_ok!(Drop3::approve_reward_pool(RuntimeOrigin::signed(1), 1)); + assert_ok!(Drop3::start_reward_pool(RuntimeOrigin::signed(3), 1)); assert_noop!( - Drop3::send_reward(Origin::signed(3), 1, 4, 10), + Drop3::send_reward(RuntimeOrigin::signed(3), 1, 4, 10), Error::::RewardPoolRanTooEarly ); }); @@ -376,12 +504,18 @@ fn send_reward_fails_with_too_late() { new_test_ext().execute_with(|| { let _ = Balances::deposit_creating(&3, 100); System::set_block_number(4); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 2, 3)); - assert_ok!(Drop3::approve_reward_pool(Origin::signed(1), 1)); - assert_ok!(Drop3::start_reward_pool(Origin::signed(3), 1)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 2, + 3 + )); + assert_ok!(Drop3::approve_reward_pool(RuntimeOrigin::signed(1), 1)); + assert_ok!(Drop3::start_reward_pool(RuntimeOrigin::signed(3), 1)); assert_noop!( - Drop3::send_reward(Origin::signed(3), 1, 4, 10), + Drop3::send_reward(RuntimeOrigin::signed(3), 1, 4, 10), Error::::RewardPoolRanTooLate ); }); @@ -394,14 +528,20 @@ fn send_reward_fails_with_insufficient_reserved_balance() { let _ = Balances::deposit_creating(&4, 5); let _ = Balances::deposit_creating(&5, 10); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 1, 3)); - assert_ok!(Drop3::approve_reward_pool(Origin::signed(1), 1)); - assert_ok!(Drop3::start_reward_pool(Origin::signed(3), 1)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 1, + 3 + )); + assert_ok!(Drop3::approve_reward_pool(RuntimeOrigin::signed(1), 1)); + assert_ok!(Drop3::start_reward_pool(RuntimeOrigin::signed(3), 1)); // intentionally unreserve 90 out of 100 >::unreserve(&3, 90); assert_noop!( - Drop3::send_reward(Origin::signed(3), 1, 4, 20), + Drop3::send_reward(RuntimeOrigin::signed(3), 1, 4, 20), Error::::InsufficientReservedBalance ); }); @@ -414,12 +554,18 @@ fn send_reward_fails_with_insufficient_remain() { let _ = Balances::deposit_creating(&4, 5); let _ = Balances::deposit_creating(&5, 10); - assert_ok!(Drop3::propose_reward_pool(Origin::signed(3), b"test".to_vec(), 100, 1, 3)); - assert_ok!(Drop3::approve_reward_pool(Origin::signed(1), 1)); - assert_ok!(Drop3::start_reward_pool(Origin::signed(3), 1)); + assert_ok!(Drop3::propose_reward_pool( + RuntimeOrigin::signed(3), + b"test".to_vec(), + 100, + 1, + 3 + )); + assert_ok!(Drop3::approve_reward_pool(RuntimeOrigin::signed(1), 1)); + assert_ok!(Drop3::start_reward_pool(RuntimeOrigin::signed(3), 1)); assert_noop!( - Drop3::send_reward(Origin::signed(3), 1, 4, 120), + Drop3::send_reward(RuntimeOrigin::signed(3), 1, 4, 120), Error::::InsufficientRemain ); }); diff --git a/pallets/extrinsic-filter/Cargo.toml b/pallets/extrinsic-filter/Cargo.toml index 41213f2be5..d570300487 100644 --- a/pallets/extrinsic-filter/Cargo.toml +++ b/pallets/extrinsic-filter/Cargo.toml @@ -12,18 +12,18 @@ version = '0.1.0' codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] diff --git a/pallets/extrinsic-filter/src/benchmarking.rs b/pallets/extrinsic-filter/src/benchmarking.rs index 74646cdcfc..33b877af57 100644 --- a/pallets/extrinsic-filter/src/benchmarking.rs +++ b/pallets/extrinsic-filter/src/benchmarking.rs @@ -26,7 +26,7 @@ use sp_std::vec; const MAX_BYTES: u32 = 1_024; -fn assert_last_event(generic_event: ::Event) { +fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } diff --git a/pallets/extrinsic-filter/src/lib.rs b/pallets/extrinsic-filter/src/lib.rs index d8344e2f64..ec680b01af 100644 --- a/pallets/extrinsic-filter/src/lib.rs +++ b/pallets/extrinsic-filter/src/lib.rs @@ -78,7 +78,7 @@ use frame_support::{ }; use frame_system::pallet_prelude::*; pub use pallet::*; -use sp_std::{prelude::*, vec::Vec}; +use sp_std::prelude::*; use scale_info::TypeInfo; pub use weights::WeightInfo; @@ -115,15 +115,15 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// The overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The priviledged origin to perform all operations - type UpdateOrigin: EnsureOrigin; + type UpdateOrigin: EnsureOrigin; /// Filters that will be specified in runtime binding - type NormalModeFilter: Contains; - type SafeModeFilter: Contains; - type TestModeFilter: Contains; + type NormalModeFilter: Contains; + type SafeModeFilter: Contains; + type TestModeFilter: Contains; /// Weights type WeightInfo: WeightInfo; @@ -254,11 +254,11 @@ pub mod pallet { } } - impl Contains for Pallet + impl Contains for Pallet where - ::Call: GetCallMetadata, + ::RuntimeCall: GetCallMetadata, { - fn contains(call: &T::Call) -> bool { + fn contains(call: &T::RuntimeCall) -> bool { let allowed_by_mode = match Self::mode() { OperationalMode::Normal => T::NormalModeFilter::contains(call), OperationalMode::Safe => T::SafeModeFilter::contains(call), diff --git a/pallets/extrinsic-filter/src/mock.rs b/pallets/extrinsic-filter/src/mock.rs index 6d8e907a92..b5f1a4992d 100644 --- a/pallets/extrinsic-filter/src/mock.rs +++ b/pallets/extrinsic-filter/src/mock.rs @@ -55,8 +55,8 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -64,7 +64,7 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -89,7 +89,7 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type Balance = Balance; // the type that is relevant to us - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; @@ -97,21 +97,24 @@ impl pallet_balances::Config for Test { } pub struct SafeModeFilter; -impl Contains for SafeModeFilter { - fn contains(call: &Call) -> bool { - matches!(call, Call::System(_) | Call::ExtrinsicFilter(_)) +impl Contains for SafeModeFilter { + fn contains(call: &RuntimeCall) -> bool { + matches!(call, RuntimeCall::System(_) | RuntimeCall::ExtrinsicFilter(_)) } } pub struct NormalModeFilter; -impl Contains for NormalModeFilter { - fn contains(call: &Call) -> bool { - matches!(call, Call::System(_) | Call::ExtrinsicFilter(_) | Call::Timestamp(_)) +impl Contains for NormalModeFilter { + fn contains(call: &RuntimeCall) -> bool { + matches!( + call, + RuntimeCall::System(_) | RuntimeCall::ExtrinsicFilter(_) | RuntimeCall::Timestamp(_) + ) } } impl pallet_extrinsic_filter::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type UpdateOrigin = EnsureRoot; type SafeModeFilter = SafeModeFilter; type NormalModeFilter = NormalModeFilter; diff --git a/pallets/extrinsic-filter/src/tests.rs b/pallets/extrinsic-filter/src/tests.rs index 9211193160..ebc7adbac4 100644 --- a/pallets/extrinsic-filter/src/tests.rs +++ b/pallets/extrinsic-filter/src/tests.rs @@ -23,9 +23,9 @@ fn set_mode_works() { new_test_ext().execute_with(|| { // default mode should be `Normal` assert_eq!(ExtrinsicFilter::mode(), crate::OperationalMode::Normal); - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Test)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Test)); assert_eq!(ExtrinsicFilter::mode(), crate::OperationalMode::Test); - System::assert_last_event(Event::ExtrinsicFilter(crate::Event::ModeSet { + System::assert_last_event(RuntimeEvent::ExtrinsicFilter(crate::Event::ModeSet { new_mode: crate::OperationalMode::Test, })); }); @@ -36,7 +36,7 @@ fn set_mode_fails_with_unauthorized_origin() { new_test_ext().execute_with(|| { assert_eq!(ExtrinsicFilter::mode(), crate::OperationalMode::Normal); assert_noop!( - ExtrinsicFilter::set_mode(Origin::signed(1), crate::OperationalMode::Test), + ExtrinsicFilter::set_mode(RuntimeOrigin::signed(1), crate::OperationalMode::Test), sp_runtime::DispatchError::BadOrigin ); }); @@ -49,7 +49,7 @@ fn set_mode_should_not_clear_blocked_extrinsics() { // block Balances.transfer assert_ok!(ExtrinsicFilter::block_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"Balances".to_vec(), Some(b"transfer".to_vec()) )); @@ -58,7 +58,7 @@ fn set_mode_should_not_clear_blocked_extrinsics() { Some(()) ); - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Test)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Test)); assert_eq!(ExtrinsicFilter::mode(), crate::OperationalMode::Test); // previously blocked extrinsics are still there assert_eq!( @@ -71,54 +71,66 @@ fn set_mode_should_not_clear_blocked_extrinsics() { #[test] fn safe_mode_works() { new_test_ext().execute_with(|| { - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Safe)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Safe)); // SafeModeFilter allows frame_system calls - let call: Call = frame_system::Call::remark { remark: vec![] }.into(); - assert_ok!(call.dispatch(Origin::signed(1))); + let call: RuntimeCall = frame_system::Call::remark { remark: vec![] }.into(); + assert_ok!(call.dispatch(RuntimeOrigin::signed(1))); // SafeModeFilter disallows pallet_timestamp calls - let call: Call = pallet_timestamp::Call::set { now: 100 }.into(); - assert_noop!(call.dispatch(Origin::none()), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_timestamp::Call::set { now: 100 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::none()), + frame_system::Error::::CallFiltered + ); // SafeModeFilter disallows balance calls - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); }); } #[test] fn normal_mode_works() { new_test_ext().execute_with(|| { - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Normal)); + assert_ok!(ExtrinsicFilter::set_mode( + RuntimeOrigin::root(), + crate::OperationalMode::Normal + )); // NormalModeFilter allows frame_system calls - let call: Call = frame_system::Call::remark { remark: vec![] }.into(); - assert_ok!(call.dispatch(Origin::signed(1))); + let call: RuntimeCall = frame_system::Call::remark { remark: vec![] }.into(); + assert_ok!(call.dispatch(RuntimeOrigin::signed(1))); // NormalModeFilter allows pallet_timestamp calls - let call: Call = pallet_timestamp::Call::set { now: 100 }.into(); - assert_ok!(call.dispatch(Origin::none())); + let call: RuntimeCall = pallet_timestamp::Call::set { now: 100 }.into(); + assert_ok!(call.dispatch(RuntimeOrigin::none())); // NormalModeFilter disallows balance calls - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); }); } #[test] fn test_mode_works() { new_test_ext().execute_with(|| { - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Test)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Test)); // TestModeFilter allows frame_system calls - let call: Call = frame_system::Call::remark { remark: vec![] }.into(); - assert_ok!(call.dispatch(Origin::signed(1))); + let call: RuntimeCall = frame_system::Call::remark { remark: vec![] }.into(); + assert_ok!(call.dispatch(RuntimeOrigin::signed(1))); // TestModeFilter allows pallet_timestamp calls - let call: Call = pallet_timestamp::Call::set { now: 100 }.into(); - assert_ok!(call.dispatch(Origin::none())); + let call: RuntimeCall = pallet_timestamp::Call::set { now: 100 }.into(); + assert_ok!(call.dispatch(RuntimeOrigin::none())); // TestModeFilter allows balance calls - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_ok!(call.dispatch(Origin::signed(1))); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_ok!(call.dispatch(RuntimeOrigin::signed(1))); assert_eq!(Balances::free_balance(&2), 10); }); } @@ -127,15 +139,15 @@ fn test_mode_works() { fn block_single_extrinsic_works() { new_test_ext().execute_with(|| { // TestModeFilter allows everything - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Test)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Test)); // block Balances.transfer assert_ok!(ExtrinsicFilter::block_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"Balances".to_vec(), Some(b"transfer".to_vec()) )); - System::assert_last_event(Event::ExtrinsicFilter(crate::Event::ExtrinsicsBlocked { + System::assert_last_event(RuntimeEvent::ExtrinsicFilter(crate::Event::ExtrinsicsBlocked { pallet_name_bytes: b"Balances".to_vec(), function_name_bytes: Some(b"transfer".to_vec()), })); @@ -144,12 +156,16 @@ fn block_single_extrinsic_works() { Some(()) ); // try to dispatch Balances.transfer should fail - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); // however, Balances.transfer_keep_alive should work - let call: Call = pallet_balances::Call::transfer_keep_alive { dest: 2, value: 10 }.into(); - assert_ok!(call.dispatch(Origin::signed(1))); + let call: RuntimeCall = + pallet_balances::Call::transfer_keep_alive { dest: 2, value: 10 }.into(); + assert_ok!(call.dispatch(RuntimeOrigin::signed(1))); assert_eq!(Balances::free_balance(&2), 10); }); } @@ -158,11 +174,15 @@ fn block_single_extrinsic_works() { fn block_whole_pallet_works() { new_test_ext().execute_with(|| { // TestModeFilter allows everything - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Test)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Test)); // block the whole Balances pallet - assert_ok!(ExtrinsicFilter::block_extrinsics(Origin::root(), b"Balances".to_vec(), None)); - System::assert_last_event(Event::ExtrinsicFilter(crate::Event::ExtrinsicsBlocked { + assert_ok!(ExtrinsicFilter::block_extrinsics( + RuntimeOrigin::root(), + b"Balances".to_vec(), + None + )); + System::assert_last_event(RuntimeEvent::ExtrinsicFilter(crate::Event::ExtrinsicsBlocked { pallet_name_bytes: b"Balances".to_vec(), function_name_bytes: None, })); @@ -171,12 +191,19 @@ fn block_whole_pallet_works() { Some(()) ); // try to dispatch Balances.transfer should fail - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); // Balances.transfer_keep_alive should fail too - let call: Call = pallet_balances::Call::transfer_keep_alive { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = + pallet_balances::Call::transfer_keep_alive { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); assert_eq!(Balances::free_balance(&2), 0); }); } @@ -185,15 +212,15 @@ fn block_whole_pallet_works() { fn unblock_single_extrinsic_works() { new_test_ext().execute_with(|| { // TestModeFilter allows everything - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Test)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Test)); // block Balances.transfer assert_ok!(ExtrinsicFilter::block_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"Balances".to_vec(), Some(b"transfer".to_vec()) )); - System::assert_last_event(Event::ExtrinsicFilter(crate::Event::ExtrinsicsBlocked { + System::assert_last_event(RuntimeEvent::ExtrinsicFilter(crate::Event::ExtrinsicsBlocked { pallet_name_bytes: b"Balances".to_vec(), function_name_bytes: Some(b"transfer".to_vec()), })); @@ -202,26 +229,31 @@ fn unblock_single_extrinsic_works() { Some(()) ); // try to dispatch Balances.transfer should fail - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); // unblock Balances.transfer assert_ok!(ExtrinsicFilter::unblock_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"Balances".to_vec(), Some(b"transfer".to_vec()) )); - System::assert_last_event(Event::ExtrinsicFilter(crate::Event::ExtrinsicsUnblocked { - pallet_name_bytes: b"Balances".to_vec(), - function_name_bytes: Some(b"transfer".to_vec()), - })); + System::assert_last_event(RuntimeEvent::ExtrinsicFilter( + crate::Event::ExtrinsicsUnblocked { + pallet_name_bytes: b"Balances".to_vec(), + function_name_bytes: Some(b"transfer".to_vec()), + }, + )); assert_eq!( ExtrinsicFilter::blocked_extrinsics((b"Balances".to_vec(), b"transfer".to_vec())), None ); - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_ok!(call.dispatch(Origin::signed(1))); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_ok!(call.dispatch(RuntimeOrigin::signed(1))); assert_eq!(Balances::free_balance(&2), 10); }); } @@ -230,11 +262,15 @@ fn unblock_single_extrinsic_works() { fn unblock_whole_pallet_works() { new_test_ext().execute_with(|| { // TestModeFilter allows everything - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Test)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Test)); // block the whole Balances pallet - assert_ok!(ExtrinsicFilter::block_extrinsics(Origin::root(), b"Balances".to_vec(), None)); - System::assert_last_event(Event::ExtrinsicFilter(crate::Event::ExtrinsicsBlocked { + assert_ok!(ExtrinsicFilter::block_extrinsics( + RuntimeOrigin::root(), + b"Balances".to_vec(), + None + )); + System::assert_last_event(RuntimeEvent::ExtrinsicFilter(crate::Event::ExtrinsicsBlocked { pallet_name_bytes: b"Balances".to_vec(), function_name_bytes: None, })); @@ -243,32 +279,46 @@ fn unblock_whole_pallet_works() { Some(()) ); // try to dispatch Balances.transfer should fail - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); // Balances.transfer_keep_alive should fail too - let call: Call = pallet_balances::Call::transfer_keep_alive { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = + pallet_balances::Call::transfer_keep_alive { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); assert_eq!(Balances::free_balance(&2), 0); // unblock the whole Balances pallet - assert_ok!(ExtrinsicFilter::unblock_extrinsics(Origin::root(), b"Balances".to_vec(), None)); - System::assert_last_event(Event::ExtrinsicFilter(crate::Event::ExtrinsicsUnblocked { - pallet_name_bytes: b"Balances".to_vec(), - function_name_bytes: None, - })); + assert_ok!(ExtrinsicFilter::unblock_extrinsics( + RuntimeOrigin::root(), + b"Balances".to_vec(), + None + )); + System::assert_last_event(RuntimeEvent::ExtrinsicFilter( + crate::Event::ExtrinsicsUnblocked { + pallet_name_bytes: b"Balances".to_vec(), + function_name_bytes: None, + }, + )); assert_eq!( ExtrinsicFilter::blocked_extrinsics((b"Balances".to_vec(), Vec::::default())), None ); // try to dispatch Balances.transfer should work - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_ok!(call.dispatch(Origin::signed(1))); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_ok!(call.dispatch(RuntimeOrigin::signed(1))); assert_eq!(Balances::free_balance(&2), 10); // Balances.transfer_keep_alive should work too - let call: Call = pallet_balances::Call::transfer_keep_alive { dest: 2, value: 10 }.into(); - assert_ok!(call.dispatch(Origin::signed(1))); + let call: RuntimeCall = + pallet_balances::Call::transfer_keep_alive { dest: 2, value: 10 }.into(); + assert_ok!(call.dispatch(RuntimeOrigin::signed(1))); assert_eq!(Balances::free_balance(&2), 20); }); } @@ -278,28 +328,34 @@ fn whitelisting_fails() { new_test_ext().execute_with(|| { // we disallow whitelisting, so set it to NormalMode and then try to unblock some // extrinsics will not work - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Normal)); + assert_ok!(ExtrinsicFilter::set_mode( + RuntimeOrigin::root(), + crate::OperationalMode::Normal + )); assert_noop!( ExtrinsicFilter::unblock_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"Balances".to_vec(), Some(b"transfer".to_vec()) ), Error::::ExtrinsicNotBlocked ); - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); }); } #[test] fn block_this_pallet_fails() { new_test_ext().execute_with(|| { - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Test)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Test)); assert_noop!( ExtrinsicFilter::block_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"ExtrinsicFilter".to_vec(), Some(b"block_extrinsics".to_vec()), ), @@ -319,17 +375,17 @@ fn block_this_pallet_fails() { #[test] fn block_more_than_once_fails() { new_test_ext().execute_with(|| { - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Test)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Test)); assert_ok!(ExtrinsicFilter::block_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"Balances".to_vec(), Some(b"transfer".to_vec()), )); assert_noop!( ExtrinsicFilter::block_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"Balances".to_vec(), Some(b"transfer".to_vec()), ), @@ -337,39 +393,49 @@ fn block_more_than_once_fails() { ); // Balances.transfer should be blocked though - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); }); } #[test] fn unpaired_block_unblock_fails() { new_test_ext().execute_with(|| { - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Test)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Test)); // block a single extrinsic and unblock the whole pallet should fail assert_ok!(ExtrinsicFilter::block_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"Balances".to_vec(), Some(b"transfer".to_vec()), )); assert_noop!( - ExtrinsicFilter::unblock_extrinsics(Origin::root(), b"Balances".to_vec(), None), + ExtrinsicFilter::unblock_extrinsics(RuntimeOrigin::root(), b"Balances".to_vec(), None), Error::::ExtrinsicNotBlocked ); // Balances.transfer should still be blocked - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); // clear the storage let _ = crate::BlockedExtrinsics::::clear(u32::max_value(), None); // block the whole pallet and unblock a single extrinsic should fail - assert_ok!(ExtrinsicFilter::block_extrinsics(Origin::root(), b"Balances".to_vec(), None,)); + assert_ok!(ExtrinsicFilter::block_extrinsics( + RuntimeOrigin::root(), + b"Balances".to_vec(), + None, + )); assert_noop!( ExtrinsicFilter::unblock_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"Balances".to_vec(), Some(b"Balances".to_vec()), ), @@ -377,44 +443,58 @@ fn unpaired_block_unblock_fails() { ); // Balances.transfer should still be blocked - let call: Call = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = pallet_balances::Call::transfer { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); // Balances.transfer_keep_alive should fail too - let call: Call = pallet_balances::Call::transfer_keep_alive { dest: 2, value: 10 }.into(); - assert_noop!(call.dispatch(Origin::signed(1)), frame_system::Error::::CallFiltered); + let call: RuntimeCall = + pallet_balances::Call::transfer_keep_alive { dest: 2, value: 10 }.into(); + assert_noop!( + call.dispatch(RuntimeOrigin::signed(1)), + frame_system::Error::::CallFiltered + ); }); } #[test] fn blocked_extrinsic_is_retained_upon_mode_switch() { new_test_ext().execute_with(|| { - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Safe)); + assert_ok!(ExtrinsicFilter::set_mode(RuntimeOrigin::root(), crate::OperationalMode::Safe)); // SafeModeFilter disallows pallet_timestamp calls - let call: Call = pallet_timestamp::Call::set { now: 100 }.into(); + let call: RuntimeCall = pallet_timestamp::Call::set { now: 100 }.into(); assert_noop!( - call.clone().dispatch(Origin::none()), + call.clone().dispatch(RuntimeOrigin::none()), frame_system::Error::::CallFiltered ); // block the whole pallet_timestamp - assert_ok!(ExtrinsicFilter::block_extrinsics(Origin::root(), b"Timestamp".to_vec(), None,)); + assert_ok!(ExtrinsicFilter::block_extrinsics( + RuntimeOrigin::root(), + b"Timestamp".to_vec(), + None, + )); // switch to NormalMode, calls to pallet_timestamp should still be filtered out - assert_ok!(ExtrinsicFilter::set_mode(Origin::root(), crate::OperationalMode::Normal)); + assert_ok!(ExtrinsicFilter::set_mode( + RuntimeOrigin::root(), + crate::OperationalMode::Normal + )); assert_noop!( - call.clone().dispatch(Origin::none()), + call.clone().dispatch(RuntimeOrigin::none()), frame_system::Error::::CallFiltered ); // unblock from NormalMode works assert_ok!(ExtrinsicFilter::unblock_extrinsics( - Origin::root(), + RuntimeOrigin::root(), b"Timestamp".to_vec(), None, )); // ... and takes effect - assert_ok!(call.dispatch(Origin::none())); + assert_ok!(call.dispatch(RuntimeOrigin::none())); }); } diff --git a/pallets/identity-management-mock/Cargo.toml b/pallets/identity-management-mock/Cargo.toml index 9e4c76ea57..dc87c15868 100644 --- a/pallets/identity-management-mock/Cargo.toml +++ b/pallets/identity-management-mock/Cargo.toml @@ -11,15 +11,15 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = log = { version = "0.4", default-features = false } scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } mock-tee-primitives = { path = "../../mock-tee-primitives", default-features = false } pallet-identity-management = { path = "../../pallets/identity-management", default-features = false } @@ -33,14 +33,14 @@ sha2 = { version = "0.10.2", default-features = false } [dev-dependencies] aes-gcm = { git = "https://github.com/RustCrypto/AEADs" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } parity-crypto = { version = "0.9.0", features = ["publickey"] } rand = { version = "0.8" } rand_chacha = { version = "0.3" } sha2 = { version = "0.10.2" } signature = { version = ">=1.4, <1.7", features = ["rand-preview"] } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] diff --git a/pallets/identity-management-mock/src/lib.rs b/pallets/identity-management-mock/src/lib.rs index afc961373e..b0c212999a 100644 --- a/pallets/identity-management-mock/src/lib.rs +++ b/pallets/identity-management-mock/src/lib.rs @@ -78,14 +78,14 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// Event - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// origin to manage caller whitelist - type ManageWhitelistOrigin: EnsureOrigin; + type ManageWhitelistOrigin: EnsureOrigin; // maximum delay in block numbers between linking an identity and verifying an identity #[pallet::constant] type MaxVerificationDelay: Get>; // some extrinsics should only be called by origins from TEE - type TEECallOrigin: EnsureOrigin; + type TEECallOrigin: EnsureOrigin; } #[pallet::event] diff --git a/pallets/identity-management-mock/src/mock.rs b/pallets/identity-management-mock/src/mock.rs index 20cd46aa83..632ba7017f 100644 --- a/pallets/identity-management-mock/src/mock.rs +++ b/pallets/identity-management-mock/src/mock.rs @@ -74,8 +74,8 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -83,7 +83,7 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -108,7 +108,7 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type Balance = Balance; // the type that is relevant to us - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; @@ -120,7 +120,7 @@ ord_parameter_types! { } impl pallet_identity_management_mock::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ManageWhitelistOrigin = EnsureRoot; type MaxVerificationDelay = ConstU64<10>; type TEECallOrigin = EnsureSignedBy; @@ -136,7 +136,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| { // add to `One` to whitelist - let _ = IdentityManagementMock::add_to_whitelist(Origin::root(), 1u64); + let _ = IdentityManagementMock::add_to_whitelist(RuntimeOrigin::root(), 1u64); System::set_block_number(1); }); ext @@ -214,21 +214,21 @@ pub fn setup_user_shieding_key( let shielding_key = Aes256Gcm::generate_key(&mut OsRng); let encrpted_shielding_key = tee_encrypt(&shielding_key); // whitelist caller - assert_ok!(IdentityManagementMock::add_to_whitelist(Origin::root(), who)); + assert_ok!(IdentityManagementMock::add_to_whitelist(RuntimeOrigin::root(), who)); assert_ok!(IdentityManagementMock::set_user_shielding_key( - Origin::signed(who), + RuntimeOrigin::signed(who), H256::random(), encrpted_shielding_key.to_vec() )); - System::assert_has_event(Event::IdentityManagementMock( + System::assert_has_event(RuntimeEvent::IdentityManagementMock( crate::Event::UserShieldingKeySetPlain { account: who }, )); // enrypt the result let key = IdentityManagementMock::user_shielding_keys(&who).unwrap(); let aes_encrypted_account = aes_encrypt_default(&key, who.encode().as_slice()); - System::assert_has_event(Event::IdentityManagementMock(crate::Event::UserShieldingKeySet { - account: aes_encrypted_account, - })); + System::assert_has_event(RuntimeEvent::IdentityManagementMock( + crate::Event::UserShieldingKeySet { account: aes_encrypted_account }, + )); key } @@ -240,33 +240,34 @@ pub fn setup_link_identity( let key = setup_user_shieding_key(who); let encrypted_identity = tee_encrypt(identity.encode().as_slice()); assert_ok!(IdentityManagementMock::link_identity( - Origin::signed(who), + RuntimeOrigin::signed(who), H256::random(), encrypted_identity.to_vec(), None )); - System::assert_has_event(Event::IdentityManagementMock(crate::Event::IdentityLinkedPlain { - account: who, - identity: identity.clone(), - })); + System::assert_has_event(RuntimeEvent::IdentityManagementMock( + crate::Event::IdentityLinkedPlain { account: who, identity: identity.clone() }, + )); // encrypt the result let aes_encrypted_account = aes_encrypt_default(&key, who.encode().as_slice()); let aes_encrypted_identity = aes_encrypt_default(&key, identity.encode().as_slice()); - System::assert_has_event(Event::IdentityManagementMock(crate::Event::UserShieldingKeySet { - account: aes_encrypted_account.clone(), - })); + System::assert_has_event(RuntimeEvent::IdentityManagementMock( + crate::Event::UserShieldingKeySet { account: aes_encrypted_account.clone() }, + )); // double check the challenge code let code = blake2_128(bn.encode().as_slice()); - System::assert_has_event(Event::IdentityManagementMock( + System::assert_has_event(RuntimeEvent::IdentityManagementMock( crate::Event::ChallengeCodeGeneratedPlain { account: who, identity, code }, )); let aes_encrypted_code = aes_encrypt_default(&key, code.encode().as_slice()); - System::assert_has_event(Event::IdentityManagementMock(crate::Event::ChallengeCodeGenerated { - account: aes_encrypted_account, - identity: aes_encrypted_identity, - code: aes_encrypted_code, - })); + System::assert_has_event(RuntimeEvent::IdentityManagementMock( + crate::Event::ChallengeCodeGenerated { + account: aes_encrypted_account, + identity: aes_encrypted_identity, + code: aes_encrypted_code, + }, + )); } pub fn setup_verify_twitter_identity( @@ -281,7 +282,7 @@ pub fn setup_verify_twitter_identity( _ => panic!("unxpected web_type"), }; assert_ok!(IdentityManagementMock::verify_identity( - Origin::signed(who), + RuntimeOrigin::signed(who), H256::random(), encrypted_identity, tee_encrypt(validation_data.encode().as_slice()), @@ -308,7 +309,7 @@ pub fn setup_verify_polkadot_identity( validation_data.encode().as_slice().len() ); assert_ok!(IdentityManagementMock::verify_identity( - Origin::signed(who), + RuntimeOrigin::signed(who), H256::random(), encrypted_identity, tee_encrypt(validation_data.encode().as_slice()), @@ -330,7 +331,7 @@ pub fn setup_verify_eth_identity( _ => panic!("unxpected web_type"), }; assert_ok!(IdentityManagementMock::verify_identity( - Origin::signed(who), + RuntimeOrigin::signed(who), H256::random(), encrypted_identity, tee_encrypt(validation_data.encode().as_slice()), diff --git a/pallets/identity-management-mock/src/tests.rs b/pallets/identity-management-mock/src/tests.rs index 4a88c52154..1d58f08b59 100644 --- a/pallets/identity-management-mock/src/tests.rs +++ b/pallets/identity-management-mock/src/tests.rs @@ -24,7 +24,7 @@ fn unpriveledged_origin_call_fails() { new_test_ext().execute_with(|| { assert_noop!( IdentityManagementMock::set_user_shielding_key( - Origin::signed(2), + RuntimeOrigin::signed(2), H256::random(), vec![] ), diff --git a/pallets/identity-management/Cargo.toml b/pallets/identity-management/Cargo.toml index 0692d724dc..c8a9aa0726 100644 --- a/pallets/identity-management/Cargo.toml +++ b/pallets/identity-management/Cargo.toml @@ -13,27 +13,27 @@ log = { version = "0.4", default-features = false } scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } # primitives -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } # frame dependencies -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } # benchmarking -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false, optional = true } hex = { version = "0.4", default-features = false } # local primitives = { path = "../../primitives", default-features = false } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", branch = "szp/polkadot-v0.9.29", features = ["skip-ias-check"] } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-teerex = { git = "https://github.com/litentry/integritee-pallets.git", branch = "polkadot-v0.9.30", features = ["skip-ias-check"] } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] @@ -53,5 +53,6 @@ std = [ "frame-system/std", "frame-benchmarking/std", "primitives/std", + "pallet-teerex/std", ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/identity-management/src/benchmarking.rs b/pallets/identity-management/src/benchmarking.rs index 1ba5543f1d..dc74b3e774 100644 --- a/pallets/identity-management/src/benchmarking.rs +++ b/pallets/identity-management/src/benchmarking.rs @@ -27,7 +27,7 @@ use sp_std::vec; const TEST_MRENCLAVE: [u8; 32] = [2u8; 32]; -fn assert_last_event(generic_event: ::Event) { +fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } diff --git a/pallets/identity-management/src/lib.rs b/pallets/identity-management/src/lib.rs index a8febb6a4f..b877db4f52 100644 --- a/pallets/identity-management/src/lib.rs +++ b/pallets/identity-management/src/lib.rs @@ -65,10 +65,10 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; type WeightInfo: WeightInfo; // some extrinsics should only be called by origins from TEE - type TEECallOrigin: EnsureOrigin; + type TEECallOrigin: EnsureOrigin; } #[pallet::event] diff --git a/pallets/identity-management/src/mock.rs b/pallets/identity-management/src/mock.rs index e3779c3678..2562ce6c60 100644 --- a/pallets/identity-management/src/mock.rs +++ b/pallets/identity-management/src/mock.rs @@ -34,7 +34,7 @@ type Block = frame_system::mocking::MockBlock; pub type Balance = u128; -type SystemOrigin = ::Origin; +type SystemOrigin = ::RuntimeOrigin; type SystemAccountId = ::AccountId; // Similar to `runtime_common`, just don't want to pull in the whole dependency @@ -77,8 +77,8 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -86,7 +86,7 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -111,7 +111,7 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type Balance = Balance; // the type that is relevant to us - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; @@ -124,7 +124,7 @@ parameter_types! { } impl pallet_teerex::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type MomentsPerDay = MomentsPerDay; type MaxSilenceTime = MaxSilenceTime; @@ -132,7 +132,7 @@ impl pallet_teerex::Config for Test { } impl pallet_identity_management::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type TEECallOrigin = EnsureEnclaveSigner; } diff --git a/pallets/identity-management/src/tests.rs b/pallets/identity-management/src/tests.rs index 93a7c3be62..e1d119bb5f 100644 --- a/pallets/identity-management/src/tests.rs +++ b/pallets/identity-management/src/tests.rs @@ -27,11 +27,11 @@ fn set_user_shielding_key_works() { new_test_ext().execute_with(|| { let shard: ShardIdentifier = H256::from_slice(&TEST_MRENCLAVE); assert_ok!(IdentityManagement::set_user_shielding_key( - Origin::signed(1), + RuntimeOrigin::signed(1), shard, vec![1u8; 2048] )); - System::assert_last_event(Event::IdentityManagement( + System::assert_last_event(RuntimeEvent::IdentityManagement( crate::Event::SetUserShieldingKeyRequested { shard }, )); }); @@ -42,14 +42,14 @@ fn link_identity_works() { new_test_ext().execute_with(|| { let shard: ShardIdentifier = H256::from_slice(&TEST_MRENCLAVE); assert_ok!(IdentityManagement::link_identity( - Origin::signed(1), + RuntimeOrigin::signed(1), shard, vec![1u8; 2048], Some(vec![1u8; 2048]) )); - System::assert_last_event(Event::IdentityManagement(crate::Event::LinkIdentityRequested { - shard, - })); + System::assert_last_event(RuntimeEvent::IdentityManagement( + crate::Event::LinkIdentityRequested { shard }, + )); }); } @@ -57,8 +57,12 @@ fn link_identity_works() { fn unlink_identity_works() { new_test_ext().execute_with(|| { let shard: ShardIdentifier = H256::from_slice(&TEST_MRENCLAVE); - assert_ok!(IdentityManagement::unlink_identity(Origin::signed(1), shard, vec![1u8; 2048])); - System::assert_last_event(Event::IdentityManagement( + assert_ok!(IdentityManagement::unlink_identity( + RuntimeOrigin::signed(1), + shard, + vec![1u8; 2048] + )); + System::assert_last_event(RuntimeEvent::IdentityManagement( crate::Event::UnlinkIdentityRequested { shard }, )); }); @@ -69,12 +73,12 @@ fn verify_identity_works() { new_test_ext().execute_with(|| { let shard: ShardIdentifier = H256::from_slice(&TEST_MRENCLAVE); assert_ok!(IdentityManagement::verify_identity( - Origin::signed(1), + RuntimeOrigin::signed(1), shard, vec![1u8; 2048], vec![1u8; 2048] )); - System::assert_last_event(Event::IdentityManagement( + System::assert_last_event(RuntimeEvent::IdentityManagement( crate::Event::VerifyIdentityRequested { shard }, )); }); @@ -84,13 +88,17 @@ fn verify_identity_works() { fn tee_callback_with_registered_enclave_works() { new_test_ext().execute_with(|| { assert_ok!(Teerex::register_enclave( - Origin::signed(1), + RuntimeOrigin::signed(1), TEST_MRENCLAVE.to_vec(), URL.to_vec() )); - assert_ok!(IdentityManagement::some_error(Origin::signed(1), vec![1u8; 16], vec![2u8; 16])); - System::assert_last_event(Event::IdentityManagement(crate::Event::SomeError { + assert_ok!(IdentityManagement::some_error( + RuntimeOrigin::signed(1), + vec![1u8; 16], + vec![2u8; 16] + )); + System::assert_last_event(RuntimeEvent::IdentityManagement(crate::Event::SomeError { func: vec![1u8; 16], error: vec![2u8; 16], })); @@ -101,7 +109,7 @@ fn tee_callback_with_registered_enclave_works() { fn tee_callback_with_unregistered_enclave_fails() { new_test_ext().execute_with(|| { assert_noop!( - IdentityManagement::some_error(Origin::signed(1), vec![1u8; 16], vec![2u8; 16]), + IdentityManagement::some_error(RuntimeOrigin::signed(1), vec![1u8; 16], vec![2u8; 16]), sp_runtime::DispatchError::BadOrigin, ); }); diff --git a/pallets/parachain-staking/Cargo.toml b/pallets/parachain-staking/Cargo.toml index 49a6c35d39..3f0ae72e2f 100644 --- a/pallets/parachain-staking/Cargo.toml +++ b/pallets/parachain-staking/Cargo.toml @@ -15,24 +15,24 @@ serde = { version = "1.0", optional = true } primitives = { path = "../../primitives", default-features = false } # Substrate -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", optional = true, default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", optional = true, default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] } scale-info = { version = "2.0", default-features = false, features = ["derive"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } [dev-dependencies] similar-asserts = "1.1.0" -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] diff --git a/pallets/parachain-staking/src/benchmarking.rs b/pallets/parachain-staking/src/benchmarking.rs index 8d97a4933c..6b71986723 100644 --- a/pallets/parachain-staking/src/benchmarking.rs +++ b/pallets/parachain-staking/src/benchmarking.rs @@ -108,7 +108,7 @@ fn roll_to_and_author(round_delay: u32, author: T::AccountId) { now += 1u32.into(); } } -fn assert_last_event(generic_event: ::Event) { +fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } diff --git a/pallets/parachain-staking/src/lib.rs b/pallets/parachain-staking/src/lib.rs index 6cdd977c0a..8c1a0e2b74 100644 --- a/pallets/parachain-staking/src/lib.rs +++ b/pallets/parachain-staking/src/lib.rs @@ -120,7 +120,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// Overarching event type - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The currency type /// We make Currency Lockable on purpose /// So we can test its interaction with Locks @@ -128,7 +128,7 @@ pub mod pallet { + ReservableCurrency + LockableCurrency; /// The origin for monetary governance - type MonetaryGovernanceOrigin: EnsureOrigin; + type MonetaryGovernanceOrigin: EnsureOrigin; /// Minimum number of blocks per round #[pallet::constant] type MinBlocksPerRound: Get; @@ -661,7 +661,7 @@ pub mod pallet { ); if let Err(error) = >::join_candidates( - T::Origin::from(Some(candidate.clone()).into()), + T::RuntimeOrigin::from(Some(candidate.clone()).into()), balance, ) { log::warn!("Join candidates failed in genesis with error {:?}", error); @@ -678,7 +678,7 @@ pub mod pallet { "Account does not have enough balance to place delegation." ); if let Err(error) = >::delegate( - T::Origin::from(Some(delegator.clone()).into()), + T::RuntimeOrigin::from(Some(delegator.clone()).into()), target.clone(), balance, ) { diff --git a/pallets/parachain-staking/src/mock.rs b/pallets/parachain-staking/src/mock.rs index cbd38287d5..5a88dc3960 100644 --- a/pallets/parachain-staking/src/mock.rs +++ b/pallets/parachain-staking/src/mock.rs @@ -63,16 +63,16 @@ parameter_types! { impl frame_system::Config for Test { type BaseCallFilter = Everything; type DbWeight = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type Index = u64; type BlockNumber = BlockNumber; - type Call = Call; + type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -94,7 +94,7 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 4]; type MaxLocks = (); type Balance = Balance; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -120,7 +120,7 @@ parameter_types! { pub const MinDelegation: u128 = 3; } impl Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type MonetaryGovernanceOrigin = frame_system::EnsureRoot; type MinBlocksPerRound = MinBlocksPerRound; @@ -268,7 +268,7 @@ pub(crate) fn roll_to_round_end(round: u64) -> u64 { roll_to(block) } -pub(crate) fn last_event() -> Event { +pub(crate) fn last_event() -> RuntimeEvent { System::events().pop().expect("Event expected").event } @@ -276,7 +276,9 @@ pub(crate) fn events() -> Vec> { System::events() .into_iter() .map(|r| r.event) - .filter_map(|e| if let Event::ParachainStaking(inner) = e { Some(inner) } else { None }) + .filter_map( + |e| if let RuntimeEvent::ParachainStaking(inner) = e { Some(inner) } else { None }, + ) .collect::>() } diff --git a/pallets/parachain-staking/src/tests.rs b/pallets/parachain-staking/src/tests.rs index 5c4b97f7d3..58191f77cb 100644 --- a/pallets/parachain-staking/src/tests.rs +++ b/pallets/parachain-staking/src/tests.rs @@ -34,7 +34,7 @@ use crate::{ delegation_requests::{CancelledScheduledRequest, DelegationAction, ScheduledRequest}, mock::{ roll_one_block, roll_to, roll_to_round_begin, roll_to_round_end, set_author, Balances, - Event as MetaEvent, ExtBuilder, Origin, ParachainStaking, Test, + ExtBuilder, ParachainStaking, RuntimeEvent as MetaEvent, RuntimeOrigin, Test, }, AtStake, Bond, CollatorStatus, DelegationScheduledRequests, DelegatorAdded, Error, Event, Range, @@ -51,15 +51,18 @@ use sp_runtime::{traits::Zero, DispatchError, ModuleError, Perbill, Percent}; fn invalid_root_origin_fails() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - ParachainStaking::set_total_selected(Origin::signed(45), 6u32), + ParachainStaking::set_total_selected(RuntimeOrigin::signed(45), 6u32), sp_runtime::DispatchError::BadOrigin ); assert_noop!( - ParachainStaking::set_collator_commission(Origin::signed(45), Perbill::from_percent(5)), + ParachainStaking::set_collator_commission( + RuntimeOrigin::signed(45), + Perbill::from_percent(5) + ), sp_runtime::DispatchError::BadOrigin ); assert_noop!( - ParachainStaking::set_blocks_per_round(Origin::signed(45), 3u32), + ParachainStaking::set_blocks_per_round(RuntimeOrigin::signed(45), 3u32), sp_runtime::DispatchError::BadOrigin ); }); @@ -71,8 +74,8 @@ fn invalid_root_origin_fails() { fn set_total_selected_event_emits_correctly() { ExtBuilder::default().build().execute_with(|| { // before we can bump total_selected we must bump the blocks per round - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 6u32)); - assert_ok!(ParachainStaking::set_total_selected(Origin::root(), 6u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 6u32)); + assert_ok!(ParachainStaking::set_total_selected(RuntimeOrigin::root(), 6u32)); assert_last_event!(MetaEvent::ParachainStaking(Event::TotalSelectedSet { old: 5u32, new: 6u32 @@ -85,7 +88,7 @@ fn set_total_selected_fails_if_above_blocks_per_round() { ExtBuilder::default().build().execute_with(|| { assert_eq!(ParachainStaking::round().length, 5); // test relies on this assert_noop!( - ParachainStaking::set_total_selected(Origin::root(), 6u32), + ParachainStaking::set_total_selected(RuntimeOrigin::root(), 6u32), Error::::RoundLengthMustBeAtLeastTotalSelectedCollators, ); }); @@ -94,26 +97,26 @@ fn set_total_selected_fails_if_above_blocks_per_round() { #[test] fn set_total_selected_passes_if_equal_to_blocks_per_round() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 10u32)); - assert_ok!(ParachainStaking::set_total_selected(Origin::root(), 10u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 10u32)); + assert_ok!(ParachainStaking::set_total_selected(RuntimeOrigin::root(), 10u32)); }); } #[test] fn set_total_selected_passes_if_below_blocks_per_round() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 10u32)); - assert_ok!(ParachainStaking::set_total_selected(Origin::root(), 9u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 10u32)); + assert_ok!(ParachainStaking::set_total_selected(RuntimeOrigin::root(), 9u32)); }); } #[test] fn set_blocks_per_round_fails_if_below_total_selected() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 20u32)); - assert_ok!(ParachainStaking::set_total_selected(Origin::root(), 15u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 20u32)); + assert_ok!(ParachainStaking::set_total_selected(RuntimeOrigin::root(), 15u32)); assert_noop!( - ParachainStaking::set_blocks_per_round(Origin::root(), 14u32), + ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 14u32), Error::::RoundLengthMustBeAtLeastTotalSelectedCollators, ); }); @@ -122,9 +125,9 @@ fn set_blocks_per_round_fails_if_below_total_selected() { #[test] fn set_blocks_per_round_passes_if_equal_to_total_selected() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 10u32)); - assert_ok!(ParachainStaking::set_total_selected(Origin::root(), 9u32)); - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 9u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 10u32)); + assert_ok!(ParachainStaking::set_total_selected(RuntimeOrigin::root(), 9u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 9u32)); }); } @@ -132,7 +135,7 @@ fn set_blocks_per_round_passes_if_equal_to_total_selected() { fn set_blocks_per_round_passes_if_above_total_selected() { ExtBuilder::default().build().execute_with(|| { assert_eq!(ParachainStaking::round().length, 5); // test relies on this - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 6u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 6u32)); }); } @@ -140,10 +143,10 @@ fn set_blocks_per_round_passes_if_above_total_selected() { fn set_total_selected_storage_updates_correctly() { ExtBuilder::default().build().execute_with(|| { // round length must be >= total_selected, so update that first - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 10u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 10u32)); assert_eq!(ParachainStaking::total_selected(), 5u32); - assert_ok!(ParachainStaking::set_total_selected(Origin::root(), 6u32)); + assert_ok!(ParachainStaking::set_total_selected(RuntimeOrigin::root(), 6u32)); assert_eq!(ParachainStaking::total_selected(), 6u32); }); } @@ -152,7 +155,7 @@ fn set_total_selected_storage_updates_correctly() { fn cannot_set_total_selected_to_current_total_selected() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - ParachainStaking::set_total_selected(Origin::root(), 5u32), + ParachainStaking::set_total_selected(RuntimeOrigin::root(), 5u32), Error::::NoWritingSameValue ); }); @@ -162,7 +165,7 @@ fn cannot_set_total_selected_to_current_total_selected() { fn cannot_set_total_selected_below_module_min() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - ParachainStaking::set_total_selected(Origin::root(), 4u32), + ParachainStaking::set_total_selected(RuntimeOrigin::root(), 4u32), Error::::CannotSetBelowMin ); }); @@ -174,7 +177,7 @@ fn cannot_set_total_selected_below_module_min() { fn set_collator_commission_event_emits_correctly() { ExtBuilder::default().build().execute_with(|| { assert_ok!(ParachainStaking::set_collator_commission( - Origin::root(), + RuntimeOrigin::root(), Perbill::from_percent(5) )); assert_last_event!(MetaEvent::ParachainStaking(Event::CollatorCommissionSet { @@ -189,7 +192,7 @@ fn set_collator_commission_storage_updates_correctly() { ExtBuilder::default().build().execute_with(|| { assert_eq!(ParachainStaking::collator_commission(), Perbill::from_percent(20)); assert_ok!(ParachainStaking::set_collator_commission( - Origin::root(), + RuntimeOrigin::root(), Perbill::from_percent(5) )); assert_eq!(ParachainStaking::collator_commission(), Perbill::from_percent(5)); @@ -200,7 +203,10 @@ fn set_collator_commission_storage_updates_correctly() { fn cannot_set_collator_commission_to_current_collator_commission() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - ParachainStaking::set_collator_commission(Origin::root(), Perbill::from_percent(20)), + ParachainStaking::set_collator_commission( + RuntimeOrigin::root(), + Perbill::from_percent(20) + ), Error::::NoWritingSameValue ); }); @@ -211,7 +217,7 @@ fn cannot_set_collator_commission_to_current_collator_commission() { #[test] fn set_blocks_per_round_event_emits_correctly() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 6u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 6u32)); assert_last_event!(MetaEvent::ParachainStaking(Event::BlocksPerRoundSet { current_round: 1, first_block: 0, @@ -228,7 +234,7 @@ fn set_blocks_per_round_event_emits_correctly() { fn set_blocks_per_round_storage_updates_correctly() { ExtBuilder::default().build().execute_with(|| { assert_eq!(ParachainStaking::round().length, 5); - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 6u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 6u32)); assert_eq!(ParachainStaking::round().length, 6); }); } @@ -237,7 +243,7 @@ fn set_blocks_per_round_storage_updates_correctly() { fn cannot_set_blocks_per_round_below_module_min() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - ParachainStaking::set_blocks_per_round(Origin::root(), 2u32), + ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 2u32), Error::::CannotSetBelowMin ); }); @@ -247,7 +253,7 @@ fn cannot_set_blocks_per_round_below_module_min() { fn cannot_set_blocks_per_round_to_current_blocks_per_round() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - ParachainStaking::set_blocks_per_round(Origin::root(), 5u32), + ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 5u32), Error::::NoWritingSameValue ); }); @@ -263,7 +269,7 @@ fn round_immediately_jumps_if_current_duration_exceeds_new_blocks_per_round() { // we can't lower the blocks per round because it must be above the number of collators, // and we can't lower the number of collators because it must be above // MinSelectedCandidates. so we first raise blocks per round, then lower it. - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 10u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 10u32)); roll_to(17); assert_last_event!(MetaEvent::ParachainStaking(Event::NewRound { @@ -272,7 +278,7 @@ fn round_immediately_jumps_if_current_duration_exceeds_new_blocks_per_round() { selected_collators_number: 1, total_balance: 20 })); - assert_ok!(ParachainStaking::set_blocks_per_round(Origin::root(), 5u32)); + assert_ok!(ParachainStaking::set_blocks_per_round(RuntimeOrigin::root(), 5u32)); roll_to(18); assert_last_event!(MetaEvent::ParachainStaking(Event::NewRound { starting_block: 18, @@ -290,14 +296,14 @@ fn invalid_monetary_origin_fails() { ExtBuilder::default().build().execute_with(|| { assert_noop!( ParachainStaking::set_staking_expectations( - Origin::signed(45), + RuntimeOrigin::signed(45), Range { min: 3u32.into(), ideal: 4u32.into(), max: 5u32.into() } ), sp_runtime::DispatchError::BadOrigin ); assert_noop!( ParachainStaking::set_inflation( - Origin::signed(45), + RuntimeOrigin::signed(45), Range { min: Perbill::from_percent(3), ideal: Perbill::from_percent(4), @@ -308,7 +314,7 @@ fn invalid_monetary_origin_fails() { ); assert_noop!( ParachainStaking::set_inflation( - Origin::signed(45), + RuntimeOrigin::signed(45), Range { min: Perbill::from_percent(3), ideal: Perbill::from_percent(4), @@ -318,12 +324,12 @@ fn invalid_monetary_origin_fails() { sp_runtime::DispatchError::BadOrigin ); assert_noop!( - ParachainStaking::set_parachain_bond_account(Origin::signed(45), 11), + ParachainStaking::set_parachain_bond_account(RuntimeOrigin::signed(45), 11), sp_runtime::DispatchError::BadOrigin ); assert_noop!( ParachainStaking::set_parachain_bond_reserve_percent( - Origin::signed(45), + RuntimeOrigin::signed(45), Percent::from_percent(2) ), sp_runtime::DispatchError::BadOrigin @@ -338,7 +344,7 @@ fn set_staking_event_emits_event_correctly() { ExtBuilder::default().build().execute_with(|| { // valid call succeeds assert_ok!(ParachainStaking::set_staking_expectations( - Origin::root(), + RuntimeOrigin::root(), Range { min: 3u128, ideal: 4u128, max: 5u128 } )); assert_last_event!(MetaEvent::ParachainStaking(Event::StakeExpectationsSet { @@ -357,7 +363,7 @@ fn set_staking_updates_storage_correctly() { Range { min: 700, ideal: 700, max: 700 } ); assert_ok!(ParachainStaking::set_staking_expectations( - Origin::root(), + RuntimeOrigin::root(), Range { min: 3u128, ideal: 4u128, max: 5u128 } )); assert_eq!( @@ -373,7 +379,7 @@ fn cannot_set_invalid_staking_expectations() { // invalid call fails assert_noop!( ParachainStaking::set_staking_expectations( - Origin::root(), + RuntimeOrigin::root(), Range { min: 5u128, ideal: 4u128, max: 3u128 } ), Error::::InvalidSchedule @@ -385,12 +391,12 @@ fn cannot_set_invalid_staking_expectations() { fn cannot_set_same_staking_expectations() { ExtBuilder::default().build().execute_with(|| { assert_ok!(ParachainStaking::set_staking_expectations( - Origin::root(), + RuntimeOrigin::root(), Range { min: 3u128, ideal: 4u128, max: 5u128 } )); assert_noop!( ParachainStaking::set_staking_expectations( - Origin::root(), + RuntimeOrigin::root(), Range { min: 3u128, ideal: 4u128, max: 5u128 } ), Error::::NoWritingSameValue @@ -405,7 +411,10 @@ fn set_inflation_event_emits_correctly() { ExtBuilder::default().build().execute_with(|| { let (min, ideal, max): (Perbill, Perbill, Perbill) = (Perbill::from_percent(3), Perbill::from_percent(4), Perbill::from_percent(5)); - assert_ok!(ParachainStaking::set_inflation(Origin::root(), Range { min, ideal, max })); + assert_ok!(ParachainStaking::set_inflation( + RuntimeOrigin::root(), + Range { min, ideal, max } + )); assert_last_event!(MetaEvent::ParachainStaking(Event::InflationSet { annual_min: min, annual_ideal: ideal, @@ -438,7 +447,10 @@ fn set_inflation_storage_updates_correctly() { max: Perbill::from_percent(5) } ); - assert_ok!(ParachainStaking::set_inflation(Origin::root(), Range { min, ideal, max }),); + assert_ok!(ParachainStaking::set_inflation( + RuntimeOrigin::root(), + Range { min, ideal, max } + ),); assert_eq!(ParachainStaking::inflation_config().annual, Range { min, ideal, max }); assert_eq!( ParachainStaking::inflation_config().round, @@ -456,7 +468,7 @@ fn cannot_set_invalid_inflation() { ExtBuilder::default().build().execute_with(|| { assert_noop!( ParachainStaking::set_inflation( - Origin::root(), + RuntimeOrigin::root(), Range { min: Perbill::from_percent(5), ideal: Perbill::from_percent(4), @@ -473,9 +485,12 @@ fn cannot_set_same_inflation() { ExtBuilder::default().build().execute_with(|| { let (min, ideal, max): (Perbill, Perbill, Perbill) = (Perbill::from_percent(3), Perbill::from_percent(4), Perbill::from_percent(5)); - assert_ok!(ParachainStaking::set_inflation(Origin::root(), Range { min, ideal, max }),); + assert_ok!(ParachainStaking::set_inflation( + RuntimeOrigin::root(), + Range { min, ideal, max } + ),); assert_noop!( - ParachainStaking::set_inflation(Origin::root(), Range { min, ideal, max }), + ParachainStaking::set_inflation(RuntimeOrigin::root(), Range { min, ideal, max }), Error::::NoWritingSameValue ); }); @@ -486,7 +501,7 @@ fn cannot_set_same_inflation() { #[test] fn set_parachain_bond_account_event_emits_correctly() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(ParachainStaking::set_parachain_bond_account(Origin::root(), 11)); + assert_ok!(ParachainStaking::set_parachain_bond_account(RuntimeOrigin::root(), 11)); assert_last_event!(MetaEvent::ParachainStaking(Event::ParachainBondAccountSet { old: 0, new: 11 @@ -498,7 +513,7 @@ fn set_parachain_bond_account_event_emits_correctly() { fn set_parachain_bond_account_storage_updates_correctly() { ExtBuilder::default().build().execute_with(|| { assert_eq!(ParachainStaking::parachain_bond_info().account, 0); - assert_ok!(ParachainStaking::set_parachain_bond_account(Origin::root(), 11)); + assert_ok!(ParachainStaking::set_parachain_bond_account(RuntimeOrigin::root(), 11)); assert_eq!(ParachainStaking::parachain_bond_info().account, 11); }); } @@ -509,7 +524,7 @@ fn set_parachain_bond_account_storage_updates_correctly() { fn set_parachain_bond_reserve_percent_event_emits_correctly() { ExtBuilder::default().build().execute_with(|| { assert_ok!(ParachainStaking::set_parachain_bond_reserve_percent( - Origin::root(), + RuntimeOrigin::root(), Percent::from_percent(50) )); assert_last_event!(MetaEvent::ParachainStaking(Event::ParachainBondReservePercentSet { @@ -524,7 +539,7 @@ fn set_parachain_bond_reserve_percent_storage_updates_correctly() { ExtBuilder::default().build().execute_with(|| { assert_eq!(ParachainStaking::parachain_bond_info().percent, Percent::from_percent(30)); assert_ok!(ParachainStaking::set_parachain_bond_reserve_percent( - Origin::root(), + RuntimeOrigin::root(), Percent::from_percent(50) )); assert_eq!(ParachainStaking::parachain_bond_info().percent, Percent::from_percent(50)); @@ -536,7 +551,7 @@ fn cannot_set_same_parachain_bond_reserve_percent() { ExtBuilder::default().build().execute_with(|| { assert_noop!( ParachainStaking::set_parachain_bond_reserve_percent( - Origin::root(), + RuntimeOrigin::root(), Percent::from_percent(30) ), Error::::NoWritingSameValue @@ -552,8 +567,8 @@ fn cannot_set_same_parachain_bond_reserve_percent() { fn join_candidates_event_emits_correctly() { ExtBuilder::default().with_balances(vec![(1, 10)]).build().execute_with(|| { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 1)); - assert_ok!(ParachainStaking::join_candidates(Origin::signed(1), 10u128)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 1)); + assert_ok!(ParachainStaking::join_candidates(RuntimeOrigin::signed(1), 10u128)); assert_last_event!(MetaEvent::ParachainStaking(Event::JoinedCollatorCandidates { account: 1, amount_locked: 10u128, @@ -566,10 +581,10 @@ fn join_candidates_event_emits_correctly() { fn join_candidates_reserves_balance() { ExtBuilder::default().with_balances(vec![(1, 10)]).build().execute_with(|| { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 1)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 1)); assert_eq!(Balances::reserved_balance(&1), 0); assert_eq!(Balances::free_balance(&1), 10); - assert_ok!(ParachainStaking::join_candidates(Origin::signed(1), 10u128)); + assert_ok!(ParachainStaking::join_candidates(RuntimeOrigin::signed(1), 10u128)); assert_eq!(Balances::reserved_balance(&1), 10); assert_eq!(Balances::free_balance(&1), 0); }); @@ -579,9 +594,9 @@ fn join_candidates_reserves_balance() { fn join_candidates_increases_total_staked() { ExtBuilder::default().with_balances(vec![(1, 10)]).build().execute_with(|| { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 1)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 1)); assert_eq!(ParachainStaking::total(), 0); - assert_ok!(ParachainStaking::join_candidates(Origin::signed(1), 10u128)); + assert_ok!(ParachainStaking::join_candidates(RuntimeOrigin::signed(1), 10u128)); assert_eq!(ParachainStaking::total(), 10); }); } @@ -590,9 +605,9 @@ fn join_candidates_increases_total_staked() { fn join_candidates_creates_candidate_state() { ExtBuilder::default().with_balances(vec![(1, 10)]).build().execute_with(|| { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 1)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 1)); assert!(ParachainStaking::candidate_info(1).is_none()); - assert_ok!(ParachainStaking::join_candidates(Origin::signed(1), 10u128)); + assert_ok!(ParachainStaking::join_candidates(RuntimeOrigin::signed(1), 10u128)); let candidate_state = ParachainStaking::candidate_info(1).expect("just joined => exists"); assert_eq!(candidate_state.bond, 10u128); }); @@ -602,9 +617,9 @@ fn join_candidates_creates_candidate_state() { fn join_candidates_adds_to_candidate_pool() { ExtBuilder::default().with_balances(vec![(1, 10)]).build().execute_with(|| { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 1)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 1)); assert!(ParachainStaking::candidate_pool().0.is_empty()); - assert_ok!(ParachainStaking::join_candidates(Origin::signed(1), 10u128)); + assert_ok!(ParachainStaking::join_candidates(RuntimeOrigin::signed(1), 10u128)); let candidate_pool = ParachainStaking::candidate_pool(); assert_eq!(candidate_pool.0[0].owner, 1); assert_eq!(candidate_pool.0[0].amount, 10); @@ -619,7 +634,7 @@ fn cannot_join_candidates_if_candidate() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::join_candidates(Origin::signed(1), 11u128), + ParachainStaking::join_candidates(RuntimeOrigin::signed(1), 11u128), Error::::CandidateExists ); }); @@ -634,9 +649,9 @@ fn cannot_join_candidates_if_delegator() { .build() .execute_with(|| { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 2)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 2)); assert_noop!( - ParachainStaking::join_candidates(Origin::signed(2), 10u128), + ParachainStaking::join_candidates(RuntimeOrigin::signed(2), 10u128), Error::::DelegatorExists ); }); @@ -646,9 +661,9 @@ fn cannot_join_candidates_if_delegator() { fn cannot_join_candidates_without_min_bond() { ExtBuilder::default().with_balances(vec![(1, 1000)]).build().execute_with(|| { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 1)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 1)); assert_noop!( - ParachainStaking::join_candidates(Origin::signed(1), 9u128), + ParachainStaking::join_candidates(RuntimeOrigin::signed(1), 9u128), Error::::CandidateBondBelowMin ); }); @@ -658,9 +673,9 @@ fn cannot_join_candidates_without_min_bond() { fn cannot_join_candidates_with_more_than_available_balance() { ExtBuilder::default().with_balances(vec![(1, 500)]).build().execute_with(|| { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 1)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 1)); assert_noop!( - ParachainStaking::join_candidates(Origin::signed(1), 501u128), + ParachainStaking::join_candidates(RuntimeOrigin::signed(1), 501u128), DispatchError::Module(ModuleError { index: 2, error: [8, 0, 0, 0], @@ -678,7 +693,7 @@ fn insufficient_join_candidates_weight_hint_fails() { .build() .execute_with(|| { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 6)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 6)); }); } @@ -701,8 +716,8 @@ fn sufficient_join_candidates_weight_hint_succeeds() { .execute_with(|| { for i in 6..10 { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), i)); - assert_ok!(ParachainStaking::join_candidates(Origin::signed(i), 20)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), i)); + assert_ok!(ParachainStaking::join_candidates(RuntimeOrigin::signed(i), 20)); } }); } @@ -716,7 +731,7 @@ fn leave_candidates_event_emits_correctly() { .with_candidates(vec![(1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateScheduledExit { exit_allowed_round: 1, candidate: 1, @@ -733,7 +748,7 @@ fn leave_candidates_removes_candidate_from_candidate_pool() { .build() .execute_with(|| { assert_eq!(ParachainStaking::candidate_pool().0.len(), 1); - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); assert!(ParachainStaking::candidate_pool().0.is_empty()); }); } @@ -742,7 +757,7 @@ fn leave_candidates_removes_candidate_from_candidate_pool() { fn cannot_leave_candidates_if_not_candidate() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - ParachainStaking::schedule_leave_candidates(Origin::signed(1)), + ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1)), Error::::CandidateDNE ); }); @@ -755,9 +770,9 @@ fn cannot_leave_candidates_if_already_leaving_candidates() { .with_candidates(vec![(1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); assert_noop!( - ParachainStaking::schedule_leave_candidates(Origin::signed(1)), + ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1)), Error::::CandidateAlreadyLeaving ); }); @@ -771,7 +786,7 @@ fn sufficient_leave_candidates_weight_hint_succeeds() { .build() .execute_with(|| { for i in 1..6 { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(i))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(i))); } }); } @@ -785,9 +800,9 @@ fn execute_leave_candidates_emits_event() { .with_candidates(vec![(1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(1), 1)); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateLeft { ex_candidate: 1, unlocked_amount: 10, @@ -803,9 +818,9 @@ fn execute_leave_candidates_callable_by_any_signed() { .with_candidates(vec![(1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(2), 1)); }); } @@ -817,9 +832,9 @@ fn execute_leave_candidates_requires_correct_weight_hint() { .with_delegations(vec![(2, 1, 10), (3, 1, 10), (4, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(2), 1)); }); } @@ -832,9 +847,9 @@ fn execute_leave_candidates_unreserves_balance() { .execute_with(|| { assert_eq!(Balances::reserved_balance(&1), 10); assert_eq!(Balances::free_balance(&1), 0); - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(1), 1)); assert_eq!(Balances::reserved_balance(&1), 0); assert_eq!(Balances::free_balance(&1), 10); }); @@ -848,9 +863,9 @@ fn execute_leave_candidates_decreases_total_staked() { .build() .execute_with(|| { assert_eq!(ParachainStaking::total(), 10); - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(1), 1)); assert_eq!(ParachainStaking::total(), 0); }); } @@ -862,13 +877,13 @@ fn execute_leave_candidates_removes_candidate_state() { .with_candidates(vec![(1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); // candidate state is not immediately removed let candidate_state = ParachainStaking::candidate_info(1).expect("just left => still exists"); assert_eq!(candidate_state.bond, 10u128); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(1), 1)); assert!(ParachainStaking::candidate_info(1).is_none()); }); } @@ -881,7 +896,11 @@ fn execute_leave_candidates_removes_pending_delegation_requests() { .with_delegations(vec![(2, 1, 15)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); let state = ParachainStaking::delegation_scheduled_requests(&1); assert_eq!( state, @@ -891,13 +910,13 @@ fn execute_leave_candidates_removes_pending_delegation_requests() { action: DelegationAction::Decrease(5), }], ); - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); // candidate state is not immediately removed let candidate_state = ParachainStaking::candidate_info(1).expect("just left => still exists"); assert_eq!(candidate_state.bond, 10u128); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(1), 1)); assert!(ParachainStaking::candidate_info(1).is_none()); assert!( !ParachainStaking::delegation_scheduled_requests(&1) @@ -919,18 +938,18 @@ fn cannot_execute_leave_candidates_before_delay() { .with_candidates(vec![(1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); assert_noop!( - ParachainStaking::execute_leave_candidates(Origin::signed(3), 1), + ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(3), 1), Error::::CandidateCannotLeaveYet ); roll_to(9); assert_noop!( - ParachainStaking::execute_leave_candidates(Origin::signed(3), 1), + ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(3), 1), Error::::CandidateCannotLeaveYet ); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(3), 1)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(3), 1)); }); } @@ -943,8 +962,8 @@ fn cancel_leave_candidates_emits_event() { .with_candidates(vec![(1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); - assert_ok!(ParachainStaking::cancel_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); + assert_ok!(ParachainStaking::cancel_leave_candidates(RuntimeOrigin::signed(1))); assert_last_event!(MetaEvent::ParachainStaking(Event::CancelledCandidateExit { candidate: 1 })); @@ -958,8 +977,8 @@ fn cancel_leave_candidates_updates_candidate_state() { .with_candidates(vec![(1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); - assert_ok!(ParachainStaking::cancel_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); + assert_ok!(ParachainStaking::cancel_leave_candidates(RuntimeOrigin::signed(1))); let candidate = ParachainStaking::candidate_info(&1).expect("just cancelled leave so exists"); assert!(candidate.is_active()); @@ -973,8 +992,8 @@ fn cancel_leave_candidates_adds_to_candidate_pool() { .with_candidates(vec![(1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); - assert_ok!(ParachainStaking::cancel_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); + assert_ok!(ParachainStaking::cancel_leave_candidates(RuntimeOrigin::signed(1))); assert_eq!(ParachainStaking::candidate_pool().0[0].owner, 1); assert_eq!(ParachainStaking::candidate_pool().0[0].amount, 10); }); @@ -989,7 +1008,7 @@ fn go_offline_event_emits_correctly() { .with_candidates(vec![(1, 20)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::go_offline(Origin::signed(1))); + assert_ok!(ParachainStaking::go_offline(RuntimeOrigin::signed(1))); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateWentOffline { candidate: 1 })); @@ -1004,7 +1023,7 @@ fn go_offline_removes_candidate_from_candidate_pool() { .build() .execute_with(|| { assert_eq!(ParachainStaking::candidate_pool().0.len(), 1); - assert_ok!(ParachainStaking::go_offline(Origin::signed(1))); + assert_ok!(ParachainStaking::go_offline(RuntimeOrigin::signed(1))); assert!(ParachainStaking::candidate_pool().0.is_empty()); }); } @@ -1018,7 +1037,7 @@ fn go_offline_updates_candidate_state_to_idle() { .execute_with(|| { let candidate_state = ParachainStaking::candidate_info(1).expect("is active candidate"); assert_eq!(candidate_state.status, CollatorStatus::Active); - assert_ok!(ParachainStaking::go_offline(Origin::signed(1))); + assert_ok!(ParachainStaking::go_offline(RuntimeOrigin::signed(1))); let candidate_state = ParachainStaking::candidate_info(1).expect("is candidate, just offline"); assert_eq!(candidate_state.status, CollatorStatus::Idle); @@ -1028,7 +1047,10 @@ fn go_offline_updates_candidate_state_to_idle() { #[test] fn cannot_go_offline_if_not_candidate() { ExtBuilder::default().build().execute_with(|| { - assert_noop!(ParachainStaking::go_offline(Origin::signed(3)), Error::::CandidateDNE); + assert_noop!( + ParachainStaking::go_offline(RuntimeOrigin::signed(3)), + Error::::CandidateDNE + ); }); } @@ -1039,9 +1061,9 @@ fn cannot_go_offline_if_already_offline() { .with_candidates(vec![(1, 20)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::go_offline(Origin::signed(1))); + assert_ok!(ParachainStaking::go_offline(RuntimeOrigin::signed(1))); assert_noop!( - ParachainStaking::go_offline(Origin::signed(1)), + ParachainStaking::go_offline(RuntimeOrigin::signed(1)), Error::::AlreadyOffline ); }); @@ -1056,8 +1078,8 @@ fn go_online_event_emits_correctly() { .with_candidates(vec![(1, 20)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::go_offline(Origin::signed(1))); - assert_ok!(ParachainStaking::go_online(Origin::signed(1))); + assert_ok!(ParachainStaking::go_offline(RuntimeOrigin::signed(1))); + assert_ok!(ParachainStaking::go_online(RuntimeOrigin::signed(1))); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateBackOnline { candidate: 1 })); @@ -1071,9 +1093,9 @@ fn go_online_adds_to_candidate_pool() { .with_candidates(vec![(1, 20)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::go_offline(Origin::signed(1))); + assert_ok!(ParachainStaking::go_offline(RuntimeOrigin::signed(1))); assert!(ParachainStaking::candidate_pool().0.is_empty()); - assert_ok!(ParachainStaking::go_online(Origin::signed(1))); + assert_ok!(ParachainStaking::go_online(RuntimeOrigin::signed(1))); assert_eq!(ParachainStaking::candidate_pool().0[0].owner, 1); assert_eq!(ParachainStaking::candidate_pool().0[0].amount, 20); }); @@ -1086,11 +1108,11 @@ fn go_online_storage_updates_candidate_state() { .with_candidates(vec![(1, 20)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::go_offline(Origin::signed(1))); + assert_ok!(ParachainStaking::go_offline(RuntimeOrigin::signed(1))); let candidate_state = ParachainStaking::candidate_info(1).expect("offline still exists"); assert_eq!(candidate_state.status, CollatorStatus::Idle); - assert_ok!(ParachainStaking::go_online(Origin::signed(1))); + assert_ok!(ParachainStaking::go_online(RuntimeOrigin::signed(1))); let candidate_state = ParachainStaking::candidate_info(1).expect("online so exists"); assert_eq!(candidate_state.status, CollatorStatus::Active); }); @@ -1099,7 +1121,10 @@ fn go_online_storage_updates_candidate_state() { #[test] fn cannot_go_online_if_not_candidate() { ExtBuilder::default().build().execute_with(|| { - assert_noop!(ParachainStaking::go_online(Origin::signed(3)), Error::::CandidateDNE); + assert_noop!( + ParachainStaking::go_online(RuntimeOrigin::signed(3)), + Error::::CandidateDNE + ); }); } @@ -1111,7 +1136,7 @@ fn cannot_go_online_if_already_online() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::go_online(Origin::signed(1)), + ParachainStaking::go_online(RuntimeOrigin::signed(1)), Error::::AlreadyActive ); }); @@ -1124,9 +1149,9 @@ fn cannot_go_online_if_leaving() { .with_candidates(vec![(1, 20)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); assert_noop!( - ParachainStaking::go_online(Origin::signed(1)), + ParachainStaking::go_online(RuntimeOrigin::signed(1)), Error::::CannotGoOnlineIfLeaving ); }); @@ -1141,7 +1166,7 @@ fn candidate_bond_more_emits_correct_event() { .with_candidates(vec![(1, 20)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::candidate_bond_more(Origin::signed(1), 30)); + assert_ok!(ParachainStaking::candidate_bond_more(RuntimeOrigin::signed(1), 30)); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateBondedMore { candidate: 1, amount: 30, @@ -1159,7 +1184,7 @@ fn candidate_bond_more_reserves_balance() { .execute_with(|| { assert_eq!(Balances::reserved_balance(&1), 20); assert_eq!(Balances::free_balance(&1), 30); - assert_ok!(ParachainStaking::candidate_bond_more(Origin::signed(1), 30)); + assert_ok!(ParachainStaking::candidate_bond_more(RuntimeOrigin::signed(1), 30)); assert_eq!(Balances::reserved_balance(&1), 50); assert_eq!(Balances::free_balance(&1), 0); }); @@ -1173,7 +1198,7 @@ fn candidate_bond_more_increases_total() { .build() .execute_with(|| { let mut total = ParachainStaking::total(); - assert_ok!(ParachainStaking::candidate_bond_more(Origin::signed(1), 30)); + assert_ok!(ParachainStaking::candidate_bond_more(RuntimeOrigin::signed(1), 30)); total += 30; assert_eq!(ParachainStaking::total(), total); }); @@ -1188,7 +1213,7 @@ fn candidate_bond_more_updates_candidate_state() { .execute_with(|| { let candidate_state = ParachainStaking::candidate_info(1).expect("updated => exists"); assert_eq!(candidate_state.bond, 20); - assert_ok!(ParachainStaking::candidate_bond_more(Origin::signed(1), 30)); + assert_ok!(ParachainStaking::candidate_bond_more(RuntimeOrigin::signed(1), 30)); let candidate_state = ParachainStaking::candidate_info(1).expect("updated => exists"); assert_eq!(candidate_state.bond, 50); }); @@ -1203,7 +1228,7 @@ fn candidate_bond_more_updates_candidate_pool() { .execute_with(|| { assert_eq!(ParachainStaking::candidate_pool().0[0].owner, 1); assert_eq!(ParachainStaking::candidate_pool().0[0].amount, 20); - assert_ok!(ParachainStaking::candidate_bond_more(Origin::signed(1), 30)); + assert_ok!(ParachainStaking::candidate_bond_more(RuntimeOrigin::signed(1), 30)); assert_eq!(ParachainStaking::candidate_pool().0[0].owner, 1); assert_eq!(ParachainStaking::candidate_pool().0[0].amount, 50); }); @@ -1218,7 +1243,10 @@ fn schedule_candidate_bond_less_event_emits_correctly() { .with_candidates(vec![(1, 30)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 10)); + assert_ok!(ParachainStaking::schedule_candidate_bond_less( + RuntimeOrigin::signed(1), + 10 + )); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateBondLessRequested { candidate: 1, amount_to_decrease: 10, @@ -1234,9 +1262,9 @@ fn cannot_schedule_candidate_bond_less_if_request_exists() { .with_candidates(vec![(1, 30)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 5)); + assert_ok!(ParachainStaking::schedule_candidate_bond_less(RuntimeOrigin::signed(1), 5)); assert_noop!( - ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 5), + ParachainStaking::schedule_candidate_bond_less(RuntimeOrigin::signed(1), 5), Error::::PendingCandidateRequestAlreadyExists ); }); @@ -1246,7 +1274,7 @@ fn cannot_schedule_candidate_bond_less_if_request_exists() { fn cannot_schedule_candidate_bond_less_if_not_candidate() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - ParachainStaking::schedule_candidate_bond_less(Origin::signed(6), 50), + ParachainStaking::schedule_candidate_bond_less(RuntimeOrigin::signed(6), 50), Error::::CandidateDNE ); }); @@ -1260,7 +1288,7 @@ fn cannot_schedule_candidate_bond_less_if_new_total_below_min_candidate_stk() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 21), + ParachainStaking::schedule_candidate_bond_less(RuntimeOrigin::signed(1), 21), Error::::CandidateBondBelowMin ); }); @@ -1273,8 +1301,11 @@ fn can_schedule_candidate_bond_less_if_leaving_candidates() { .with_candidates(vec![(1, 30)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 10)); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); + assert_ok!(ParachainStaking::schedule_candidate_bond_less( + RuntimeOrigin::signed(1), + 10 + )); }); } @@ -1285,11 +1316,11 @@ fn cannot_schedule_candidate_bond_less_if_exited_candidates() { .with_candidates(vec![(1, 30)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(1), 1)); assert_noop!( - ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 10), + ParachainStaking::schedule_candidate_bond_less(RuntimeOrigin::signed(1), 10), Error::::CandidateDNE ); }); @@ -1304,9 +1335,12 @@ fn execute_candidate_bond_less_emits_correct_event() { .with_candidates(vec![(1, 50)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 30)); + assert_ok!(ParachainStaking::schedule_candidate_bond_less( + RuntimeOrigin::signed(1), + 30 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_candidate_bond_less(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_candidate_bond_less(RuntimeOrigin::signed(1), 1)); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateBondedLess { candidate: 1, amount: 30, @@ -1324,9 +1358,12 @@ fn execute_candidate_bond_less_unreserves_balance() { .execute_with(|| { assert_eq!(Balances::reserved_balance(&1), 30); assert_eq!(Balances::free_balance(&1), 0); - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 10)); + assert_ok!(ParachainStaking::schedule_candidate_bond_less( + RuntimeOrigin::signed(1), + 10 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_candidate_bond_less(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_candidate_bond_less(RuntimeOrigin::signed(1), 1)); assert_eq!(Balances::reserved_balance(&1), 20); assert_eq!(Balances::free_balance(&1), 10); }); @@ -1340,9 +1377,12 @@ fn execute_candidate_bond_less_decreases_total() { .build() .execute_with(|| { let mut total = ParachainStaking::total(); - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 10)); + assert_ok!(ParachainStaking::schedule_candidate_bond_less( + RuntimeOrigin::signed(1), + 10 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_candidate_bond_less(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_candidate_bond_less(RuntimeOrigin::signed(1), 1)); total -= 10; assert_eq!(ParachainStaking::total(), total); }); @@ -1357,9 +1397,12 @@ fn execute_candidate_bond_less_updates_candidate_state() { .execute_with(|| { let candidate_state = ParachainStaking::candidate_info(1).expect("updated => exists"); assert_eq!(candidate_state.bond, 30); - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 10)); + assert_ok!(ParachainStaking::schedule_candidate_bond_less( + RuntimeOrigin::signed(1), + 10 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_candidate_bond_less(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_candidate_bond_less(RuntimeOrigin::signed(1), 1)); let candidate_state = ParachainStaking::candidate_info(1).expect("updated => exists"); assert_eq!(candidate_state.bond, 20); }); @@ -1374,9 +1417,12 @@ fn execute_candidate_bond_less_updates_candidate_pool() { .execute_with(|| { assert_eq!(ParachainStaking::candidate_pool().0[0].owner, 1); assert_eq!(ParachainStaking::candidate_pool().0[0].amount, 30); - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 10)); + assert_ok!(ParachainStaking::schedule_candidate_bond_less( + RuntimeOrigin::signed(1), + 10 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_candidate_bond_less(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_candidate_bond_less(RuntimeOrigin::signed(1), 1)); assert_eq!(ParachainStaking::candidate_pool().0[0].owner, 1); assert_eq!(ParachainStaking::candidate_pool().0[0].amount, 20); }); @@ -1391,8 +1437,11 @@ fn cancel_candidate_bond_less_emits_event() { .with_candidates(vec![(1, 30)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 10)); - assert_ok!(ParachainStaking::cancel_candidate_bond_less(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_candidate_bond_less( + RuntimeOrigin::signed(1), + 10 + )); + assert_ok!(ParachainStaking::cancel_candidate_bond_less(RuntimeOrigin::signed(1))); assert_last_event!(MetaEvent::ParachainStaking(Event::CancelledCandidateBondLess { candidate: 1, amount: 10, @@ -1408,8 +1457,11 @@ fn cancel_candidate_bond_less_updates_candidate_state() { .with_candidates(vec![(1, 30)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 10)); - assert_ok!(ParachainStaking::cancel_candidate_bond_less(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_candidate_bond_less( + RuntimeOrigin::signed(1), + 10 + )); + assert_ok!(ParachainStaking::cancel_candidate_bond_less(RuntimeOrigin::signed(1))); assert!(ParachainStaking::candidate_info(&1).unwrap().request.is_none()); }); } @@ -1421,9 +1473,12 @@ fn only_candidate_can_cancel_candidate_bond_less_request() { .with_candidates(vec![(1, 30)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(1), 10)); + assert_ok!(ParachainStaking::schedule_candidate_bond_less( + RuntimeOrigin::signed(1), + 10 + )); assert_noop!( - ParachainStaking::cancel_candidate_bond_less(Origin::signed(2)), + ParachainStaking::cancel_candidate_bond_less(RuntimeOrigin::signed(2)), Error::::CandidateDNE ); }); @@ -1438,7 +1493,7 @@ fn delegate_event_emits_correctly() { .with_candidates(vec![(1, 30)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::delegate(Origin::signed(2), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(2), 1, 10)); assert_last_event!(MetaEvent::ParachainStaking(Event::Delegation { delegator: 2, locked_amount: 10, @@ -1457,7 +1512,7 @@ fn delegate_reserves_balance() { .execute_with(|| { assert_eq!(Balances::reserved_balance(&2), 0); assert_eq!(Balances::free_balance(&2), 10); - assert_ok!(ParachainStaking::delegate(Origin::signed(2), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(2), 1, 10)); assert_eq!(Balances::reserved_balance(&2), 10); assert_eq!(Balances::free_balance(&2), 0); }); @@ -1471,7 +1526,7 @@ fn delegate_updates_delegator_state() { .build() .execute_with(|| { assert!(ParachainStaking::delegator_state(2).is_none()); - assert_ok!(ParachainStaking::delegate(Origin::signed(2), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(2), 1, 10)); let delegator_state = ParachainStaking::delegator_state(2).expect("just delegated => exists"); assert_eq!(delegator_state.total, 10); @@ -1494,7 +1549,7 @@ fn delegate_updates_collator_state() { ParachainStaking::top_delegations(1).expect("registered in genesis"); assert!(top_delegations.delegations.is_empty()); assert!(top_delegations.total.is_zero()); - assert_ok!(ParachainStaking::delegate(Origin::signed(2), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(2), 1, 10)); let candidate_state = ParachainStaking::candidate_info(1).expect("just delegated => exists"); assert_eq!(candidate_state.total_counted, 40); @@ -1513,9 +1568,9 @@ fn can_delegate_immediately_after_other_join_candidates() { .build() .execute_with(|| { // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 1)); - assert_ok!(ParachainStaking::join_candidates(Origin::signed(1), 20)); - assert_ok!(ParachainStaking::delegate(Origin::signed(2), 1, 20)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 1)); + assert_ok!(ParachainStaking::join_candidates(RuntimeOrigin::signed(1), 20)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(2), 1, 20)); }); } @@ -1527,8 +1582,8 @@ fn can_delegate_if_revoking() { .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); - assert_ok!(ParachainStaking::delegate(Origin::signed(2), 4, 10)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(2), 4, 10)); }); } @@ -1562,7 +1617,7 @@ fn cannot_delegate_if_full_and_new_delegation_less_than_or_equal_lowest_bottom() .build() .execute_with(|| { assert_noop!( - ParachainStaking::delegate(Origin::signed(11), 1, 10), + ParachainStaking::delegate(RuntimeOrigin::signed(11), 1, 10), Error::::CannotDelegateLessThanOrEqualToLowestBottomWhenFull ); }); @@ -1597,7 +1652,7 @@ fn can_delegate_if_full_and_new_delegation_greater_than_lowest_bottom() { ]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::delegate(Origin::signed(11), 1, 11)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(11), 1, 11)); assert_event_emitted!(Event::DelegationKicked { delegator: 10, candidate: 1, @@ -1615,8 +1670,8 @@ fn can_still_delegate_if_leaving() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); - assert_ok!(ParachainStaking::delegate(Origin::signed(2), 3, 10),); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(2), 3, 10),); }); } @@ -1628,7 +1683,7 @@ fn cannot_delegate_if_candidate() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::delegate(Origin::signed(2), 1, 10), + ParachainStaking::delegate(RuntimeOrigin::signed(2), 1, 10), Error::::CandidateExists ); }); @@ -1643,7 +1698,7 @@ fn cannot_delegate_if_already_delegated() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::delegate(Origin::signed(2), 1, 10), + ParachainStaking::delegate(RuntimeOrigin::signed(2), 1, 10), Error::::AlreadyDelegatedCandidate ); }); @@ -1658,7 +1713,7 @@ fn cannot_delegate_more_than_max_delegations() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::delegate(Origin::signed(2), 6, 10), + ParachainStaking::delegate(RuntimeOrigin::signed(2), 6, 10), Error::::ExceedMaxDelegationsPerDelegator, ); }); @@ -1684,10 +1739,10 @@ fn sufficient_delegate_weight_hint_succeeds() { .build() .execute_with(|| { for i in 7..11 { - assert_ok!(ParachainStaking::delegate(Origin::signed(i), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(i), 1, 10)); } for i in 3..11 { - assert_ok!(ParachainStaking::delegate(Origin::signed(i), 2, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(i), 2, 10)); } }); } @@ -1713,7 +1768,7 @@ fn insufficient_delegate_weight_hint_fails() { .execute_with(|| { // to set up for next error test for i in 7..11 { - assert_ok!(ParachainStaking::delegate(Origin::signed(i), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(i), 1, 10)); } }); } @@ -1728,7 +1783,7 @@ fn schedule_leave_delegators_event_emits_correctly() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegatorExitScheduled { round: 1, delegator: 2, @@ -1745,9 +1800,9 @@ fn cannot_schedule_leave_delegators_if_already_leaving() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); assert_noop!( - ParachainStaking::schedule_leave_delegators(Origin::signed(2)), + ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2)), Error::::DelegatorAlreadyLeaving ); }); @@ -1761,7 +1816,7 @@ fn cannot_schedule_leave_delegators_if_not_delegator() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::schedule_leave_delegators(Origin::signed(2)), + ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2)), Error::::DelegatorDNE ); }); @@ -1777,9 +1832,9 @@ fn execute_leave_delegators_event_emits_correctly() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(2), 2)); assert_event_emitted!(Event::DelegatorLeft { delegator: 2, unstaked_amount: 10 }); }); } @@ -1794,9 +1849,9 @@ fn execute_leave_delegators_unreserves_balance() { .execute_with(|| { assert_eq!(Balances::reserved_balance(&2), 10); assert_eq!(Balances::free_balance(&2), 0); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(2), 2)); assert_eq!(Balances::reserved_balance(&2), 0); assert_eq!(Balances::free_balance(&2), 10); }); @@ -1811,9 +1866,9 @@ fn execute_leave_delegators_decreases_total_staked() { .build() .execute_with(|| { assert_eq!(ParachainStaking::total(), 40); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(2), 2)); assert_eq!(ParachainStaking::total(), 30); }); } @@ -1827,9 +1882,9 @@ fn execute_leave_delegators_removes_delegator_state() { .build() .execute_with(|| { assert!(ParachainStaking::delegator_state(2).is_some()); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(2), 2)); assert!(ParachainStaking::delegator_state(2).is_none()); }); } @@ -1842,7 +1897,11 @@ fn execute_leave_delegators_removes_pending_delegation_requests() { .with_delegations(vec![(2, 1, 15)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); let state = ParachainStaking::delegation_scheduled_requests(&1); assert_eq!( state, @@ -1852,9 +1911,9 @@ fn execute_leave_delegators_removes_pending_delegation_requests() { action: DelegationAction::Decrease(5), }], ); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(2), 2)); assert!(ParachainStaking::delegator_state(2).is_none()); assert!( !ParachainStaking::delegation_scheduled_requests(&1) @@ -1884,9 +1943,9 @@ fn execute_leave_delegators_removes_delegations_from_collator_state() { assert_eq!(top_delegations.total, 10); } assert_eq!(ParachainStaking::delegator_state(1).unwrap().delegations.0.len(), 4usize); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(1))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(1))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(1), 1)); for i in 2..6 { let candidate_state = ParachainStaking::candidate_info(i).expect("initialized in ext builder"); @@ -1906,14 +1965,14 @@ fn cannot_execute_leave_delegators_before_delay() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); assert_noop!( - ParachainStaking::execute_leave_delegators(Origin::signed(2), 2), + ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(2), 2), Error::::DelegatorCannotLeaveYet ); // can execute after delay roll_to(10); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(2), 2)); }); } @@ -1925,18 +1984,18 @@ fn cannot_execute_leave_delegators_if_single_delegation_revoke_manually_cancelle .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); - assert_ok!(ParachainStaking::cancel_delegation_request(Origin::signed(2), 3)); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); + assert_ok!(ParachainStaking::cancel_delegation_request(RuntimeOrigin::signed(2), 3)); roll_to(10); assert_noop!( - ParachainStaking::execute_leave_delegators(Origin::signed(2), 2), + ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(2), 2), Error::::DelegatorNotLeaving ); // can execute after manually scheduling revoke, and the round delay after which // all revokes can be executed - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 3)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 3)); roll_to(20); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(2), 2)); }); } @@ -1949,7 +2008,7 @@ fn insufficient_execute_leave_delegators_weight_hint_fails() { .build() .execute_with(|| { for i in 3..7 { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(i))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(i))); } roll_to(10); }); @@ -1964,11 +2023,11 @@ fn sufficient_execute_leave_delegators_weight_hint_succeeds() { .build() .execute_with(|| { for i in 3..7 { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(i))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(i))); } roll_to(10); for i in 3..7 { - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(i), i)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(i), i)); } }); } @@ -1983,8 +2042,8 @@ fn cancel_leave_delegators_emits_correct_event() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); - assert_ok!(ParachainStaking::cancel_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); + assert_ok!(ParachainStaking::cancel_leave_delegators(RuntimeOrigin::signed(2))); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegatorExitCancelled { delegator: 2 })); @@ -1999,8 +2058,8 @@ fn cancel_leave_delegators_updates_delegator_state() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); - assert_ok!(ParachainStaking::cancel_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); + assert_ok!(ParachainStaking::cancel_leave_delegators(RuntimeOrigin::signed(2))); let delegator = ParachainStaking::delegator_state(&2).expect("just cancelled exit so exists"); assert!(delegator.is_active()); @@ -2015,17 +2074,17 @@ fn cannot_cancel_leave_delegators_if_single_delegation_revoke_manually_cancelled .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); - assert_ok!(ParachainStaking::cancel_delegation_request(Origin::signed(2), 3)); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); + assert_ok!(ParachainStaking::cancel_delegation_request(RuntimeOrigin::signed(2), 3)); roll_to(10); assert_noop!( - ParachainStaking::cancel_leave_delegators(Origin::signed(2)), + ParachainStaking::cancel_leave_delegators(RuntimeOrigin::signed(2)), Error::::DelegatorNotLeaving ); // can execute after manually scheduling revoke, without waiting for round delay after // which all revokes can be executed - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 3)); - assert_ok!(ParachainStaking::cancel_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 3)); + assert_ok!(ParachainStaking::cancel_leave_delegators(RuntimeOrigin::signed(2))); }); } @@ -2039,7 +2098,7 @@ fn revoke_delegation_event_emits_correctly() { .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegationRevocationScheduled { round: 1, delegator: 2, @@ -2047,7 +2106,11 @@ fn revoke_delegation_event_emits_correctly() { scheduled_exit: 3, })); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_event_emitted!(Event::DelegatorLeftCandidate { delegator: 2, candidate: 1, @@ -2065,9 +2128,9 @@ fn can_revoke_delegation_if_revoking_another_delegation() { .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); // this is an exit implicitly because last delegation revoked - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 3)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 3)); }); } @@ -2079,9 +2142,9 @@ fn delegator_not_allowed_revoke_if_already_leaving() { .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); assert_noop!( - ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 3), + ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 3), >::PendingDelegationRequestAlreadyExists, ); }); @@ -2091,7 +2154,7 @@ fn delegator_not_allowed_revoke_if_already_leaving() { fn cannot_revoke_delegation_if_not_delegator() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1), + ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1), Error::::DelegatorDNE ); }); @@ -2106,7 +2169,7 @@ fn cannot_revoke_delegation_that_dne() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 3), + ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 3), Error::::DelegationDNE ); }); @@ -2122,7 +2185,7 @@ fn can_schedule_revoke_delegation_below_min_delegator_stake() { .with_delegations(vec![(2, 1, 5), (2, 3, 3)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); }); } @@ -2138,7 +2201,7 @@ fn delegator_bond_more_reserves_balance() { .execute_with(|| { assert_eq!(Balances::reserved_balance(&2), 10); assert_eq!(Balances::free_balance(&2), 5); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(2), 1, 5)); assert_eq!(Balances::reserved_balance(&2), 15); assert_eq!(Balances::free_balance(&2), 0); }); @@ -2153,7 +2216,7 @@ fn delegator_bond_more_increases_total_staked() { .build() .execute_with(|| { assert_eq!(ParachainStaking::total(), 40); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(2), 1, 5)); assert_eq!(ParachainStaking::total(), 45); }); } @@ -2167,7 +2230,7 @@ fn delegator_bond_more_updates_delegator_state() { .build() .execute_with(|| { assert_eq!(ParachainStaking::delegator_state(2).expect("exists").total, 10); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(2), 1, 5)); assert_eq!(ParachainStaking::delegator_state(2).expect("exists").total, 15); }); } @@ -2183,7 +2246,7 @@ fn delegator_bond_more_updates_candidate_state_top_delegations() { assert_eq!(ParachainStaking::top_delegations(1).unwrap().delegations[0].owner, 2); assert_eq!(ParachainStaking::top_delegations(1).unwrap().delegations[0].amount, 10); assert_eq!(ParachainStaking::top_delegations(1).unwrap().total, 10); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(2), 1, 5)); assert_eq!(ParachainStaking::top_delegations(1).unwrap().delegations[0].owner, 2); assert_eq!(ParachainStaking::top_delegations(1).unwrap().delegations[0].amount, 15); assert_eq!(ParachainStaking::top_delegations(1).unwrap().total, 15); @@ -2207,7 +2270,7 @@ fn delegator_bond_more_updates_candidate_state_bottom_delegations() { 10 ); assert_eq!(ParachainStaking::bottom_delegations(1).unwrap().total, 10); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(2), 1, 5)); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegationIncreased { delegator: 2, candidate: 1, @@ -2235,7 +2298,7 @@ fn delegator_bond_more_increases_total() { .build() .execute_with(|| { assert_eq!(ParachainStaking::total(), 40); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(2), 1, 5)); assert_eq!(ParachainStaking::total(), 45); }); } @@ -2248,8 +2311,8 @@ fn can_delegator_bond_more_for_leaving_candidate() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(2), 1, 5)); }); } @@ -2261,9 +2324,9 @@ fn delegator_bond_more_disallowed_when_revoke_scheduled() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); assert_noop!( - ParachainStaking::delegator_bond_more(Origin::signed(2), 1, 5), + ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(2), 1, 5), >::PendingDelegationRevoke ); }); @@ -2277,8 +2340,12 @@ fn delegator_bond_more_allowed_when_bond_decrease_scheduled() { .with_delegations(vec![(2, 1, 15)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5,)); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5, + )); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(2), 1, 5)); }); } @@ -2292,7 +2359,11 @@ fn delegator_bond_less_event_emits_correctly() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegationDecreaseScheduled { delegator: 2, candidate: 1, @@ -2310,7 +2381,11 @@ fn delegator_bond_less_updates_delegator_state() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); let state = ParachainStaking::delegation_scheduled_requests(&1); assert_eq!( state, @@ -2331,9 +2406,9 @@ fn delegator_not_allowed_bond_less_if_leaving() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); assert_noop!( - ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 1), + ParachainStaking::schedule_delegator_bond_less(RuntimeOrigin::signed(2), 1, 1), >::PendingDelegationRequestAlreadyExists, ); }); @@ -2347,9 +2422,9 @@ fn cannot_delegator_bond_less_if_revoking() { .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); assert_noop!( - ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 1), + ParachainStaking::schedule_delegator_bond_less(RuntimeOrigin::signed(2), 1, 1), Error::::PendingDelegationRequestAlreadyExists ); }); @@ -2359,7 +2434,7 @@ fn cannot_delegator_bond_less_if_revoking() { fn cannot_delegator_bond_less_if_not_delegator() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5), + ParachainStaking::schedule_delegator_bond_less(RuntimeOrigin::signed(2), 1, 5), Error::::DelegatorDNE ); }); @@ -2374,7 +2449,7 @@ fn cannot_delegator_bond_less_if_candidate_dne() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 3, 5), + ParachainStaking::schedule_delegator_bond_less(RuntimeOrigin::signed(2), 3, 5), Error::::DelegationDNE ); }); @@ -2389,7 +2464,7 @@ fn cannot_delegator_bond_less_if_delegation_dne() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 3, 5), + ParachainStaking::schedule_delegator_bond_less(RuntimeOrigin::signed(2), 3, 5), Error::::DelegationDNE ); }); @@ -2404,7 +2479,7 @@ fn cannot_delegator_bond_less_below_min_collator_stk() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 6), + ParachainStaking::schedule_delegator_bond_less(RuntimeOrigin::signed(2), 1, 6), Error::::DelegatorBondBelowMin ); }); @@ -2419,7 +2494,7 @@ fn cannot_delegator_bond_less_more_than_total_delegation() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 11), + ParachainStaking::schedule_delegator_bond_less(RuntimeOrigin::signed(2), 1, 11), Error::::DelegatorBondBelowMin ); }); @@ -2434,7 +2509,7 @@ fn cannot_delegator_bond_less_below_min_delegation() { .build() .execute_with(|| { assert_noop!( - ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 8), + ParachainStaking::schedule_delegator_bond_less(RuntimeOrigin::signed(2), 1, 8), Error::::DelegationBelowMin ); }); @@ -2453,9 +2528,13 @@ fn execute_revoke_delegation_emits_exit_event_if_exit_happens() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_event_emitted!(Event::DelegatorLeftCandidate { delegator: 2, candidate: 1, @@ -2474,17 +2553,17 @@ fn cannot_execute_revoke_delegation_below_min_delegator_stake() { .with_delegations(vec![(2, 1, 5), (2, 3, 3)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); assert_noop!( - ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1), + ParachainStaking::execute_delegation_request(RuntimeOrigin::signed(2), 2, 1), Error::::DelegatorBondBelowMin ); // but delegator can cancel the request and request to leave instead: - assert_ok!(ParachainStaking::cancel_delegation_request(Origin::signed(2), 1)); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::cancel_delegation_request(RuntimeOrigin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); roll_to(20); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(2), 2)); }); } @@ -2497,9 +2576,13 @@ fn revoke_delegation_executes_exit_if_last_delegation() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_event_emitted!(Event::DelegatorLeftCandidate { delegator: 2, candidate: 1, @@ -2518,9 +2601,13 @@ fn execute_revoke_delegation_emits_correct_event() { .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_event_emitted!(Event::DelegatorLeftCandidate { delegator: 2, candidate: 1, @@ -2540,9 +2627,13 @@ fn execute_revoke_delegation_unreserves_balance() { .execute_with(|| { assert_eq!(Balances::reserved_balance(&2), 10); assert_eq!(Balances::free_balance(&2), 0); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_eq!(Balances::reserved_balance(&2), 0); assert_eq!(Balances::free_balance(&2), 10); }); @@ -2559,7 +2650,7 @@ fn execute_revoke_delegation_adds_revocation_to_delegator_state() { assert!(!ParachainStaking::delegation_scheduled_requests(&1) .iter() .any(|x| x.delegator == 2)); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); assert!(ParachainStaking::delegation_scheduled_requests(&1) .iter() .any(|x| x.delegator == 2)); @@ -2574,9 +2665,13 @@ fn execute_revoke_delegation_removes_revocation_from_delegator_state_upon_execut .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert!(!ParachainStaking::delegation_scheduled_requests(&1) .iter() .any(|x| x.delegator == 2)); @@ -2591,9 +2686,13 @@ fn execute_revoke_delegation_removes_revocation_from_state_for_single_delegation .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert!( !ParachainStaking::delegation_scheduled_requests(&1) .iter() @@ -2612,9 +2711,13 @@ fn execute_revoke_delegation_decreases_total_staked() { .build() .execute_with(|| { assert_eq!(ParachainStaking::total(), 40); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_eq!(ParachainStaking::total(), 30); }); } @@ -2628,11 +2731,15 @@ fn execute_revoke_delegation_for_last_delegation_removes_delegator_state() { .build() .execute_with(|| { assert!(ParachainStaking::delegator_state(2).is_some()); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); // this will be confusing for people // if status is leaving, then execute_delegation_request works if last delegation - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert!(ParachainStaking::delegator_state(2).is_none()); }); } @@ -2646,9 +2753,13 @@ fn execute_revoke_delegation_removes_delegation_from_candidate_state() { .build() .execute_with(|| { assert_eq!(ParachainStaking::candidate_info(1).expect("exists").delegation_count, 1u32); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert!(ParachainStaking::candidate_info(1) .expect("exists") .delegation_count @@ -2664,11 +2775,15 @@ fn can_execute_revoke_delegation_for_leaving_candidate() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); // can execute delegation request for leaving candidate - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); }); } @@ -2680,11 +2795,11 @@ fn can_execute_leave_candidates_if_revoking_candidate() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); roll_to(10); // revocation executes during execute leave candidates (callable by anyone) - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(1), 1)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(1), 1)); assert!(!ParachainStaking::is_delegator(&2)); assert_eq!(Balances::reserved_balance(&2), 0); assert_eq!(Balances::free_balance(&2), 10); @@ -2699,10 +2814,14 @@ fn delegator_bond_more_after_revoke_delegation_does_not_effect_exit() { .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(2), 3, 10)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(2), 3, 10)); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert!(ParachainStaking::is_delegator(&2)); assert_eq!(Balances::reserved_balance(&2), 20); assert_eq!(Balances::free_balance(&2), 10); @@ -2717,7 +2836,7 @@ fn delegator_bond_less_after_revoke_delegation_does_not_effect_exit() { .with_delegations(vec![(2, 1, 10), (2, 3, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegationRevocationScheduled { round: 1, delegator: 2, @@ -2725,13 +2844,25 @@ fn delegator_bond_less_after_revoke_delegation_does_not_effect_exit() { scheduled_exit: 3, })); assert_noop!( - ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 2), + ParachainStaking::schedule_delegator_bond_less(RuntimeOrigin::signed(2), 1, 2), Error::::PendingDelegationRequestAlreadyExists ); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 3, 2)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 3, + 2 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 3)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 3 + )); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegationDecreased { delegator: 2, candidate: 3, @@ -2756,9 +2887,17 @@ fn execute_delegator_bond_less_unreserves_balance() { .execute_with(|| { assert_eq!(Balances::reserved_balance(&2), 10); assert_eq!(Balances::free_balance(&2), 0); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_eq!(Balances::reserved_balance(&2), 5); assert_eq!(Balances::free_balance(&2), 5); }); @@ -2773,9 +2912,17 @@ fn execute_delegator_bond_less_decreases_total_staked() { .build() .execute_with(|| { assert_eq!(ParachainStaking::total(), 40); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_eq!(ParachainStaking::total(), 35); }); } @@ -2789,9 +2936,17 @@ fn execute_delegator_bond_less_updates_delegator_state() { .build() .execute_with(|| { assert_eq!(ParachainStaking::delegator_state(2).expect("exists").total, 10); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_eq!(ParachainStaking::delegator_state(2).expect("exists").total, 5); }); } @@ -2806,9 +2961,17 @@ fn execute_delegator_bond_less_updates_candidate_state() { .execute_with(|| { assert_eq!(ParachainStaking::top_delegations(1).unwrap().delegations[0].owner, 2); assert_eq!(ParachainStaking::top_delegations(1).unwrap().delegations[0].amount, 10); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_eq!(ParachainStaking::top_delegations(1).unwrap().delegations[0].owner, 2); assert_eq!(ParachainStaking::top_delegations(1).unwrap().delegations[0].amount, 5); }); @@ -2823,9 +2986,17 @@ fn execute_delegator_bond_less_decreases_total() { .build() .execute_with(|| { assert_eq!(ParachainStaking::total(), 40); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_eq!(ParachainStaking::total(), 35); }); } @@ -2844,9 +3015,17 @@ fn execute_delegator_bond_less_updates_just_bottom_delegations() { ParachainStaking::top_delegations(&1).expect("delegated by all so exists"); let pre_call_bottom_delegations = ParachainStaking::bottom_delegations(&1).expect("delegated by all so exists"); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 2)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 2 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); let post_call_candidate_info = ParachainStaking::candidate_info(&1).expect("delegated by all so exists"); let post_call_top_delegations = @@ -2898,9 +3077,17 @@ fn execute_delegator_bond_less_does_not_delete_bottom_delegations() { ParachainStaking::top_delegations(&1).expect("delegated by all so exists"); let pre_call_bottom_delegations = ParachainStaking::bottom_delegations(&1).expect("delegated by all so exists"); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(6), 1, 4)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(6), + 1, + 4 + )); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(6), 6, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(6), + 6, + 1 + )); let post_call_candidate_info = ParachainStaking::candidate_info(&1).expect("delegated by all so exists"); let post_call_top_delegations = @@ -2946,11 +3133,19 @@ fn can_execute_delegator_bond_less_for_leaving_candidate() { .with_delegations(vec![(2, 1, 15)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(1))); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(1))); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); roll_to(10); // can execute bond more delegation request for leaving candidate - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); }); } @@ -2965,8 +3160,8 @@ fn cancel_revoke_delegation_emits_correct_event() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); - assert_ok!(ParachainStaking::cancel_delegation_request(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); + assert_ok!(ParachainStaking::cancel_delegation_request(RuntimeOrigin::signed(2), 1)); assert_last_event!(MetaEvent::ParachainStaking(Event::CancelledDelegationRequest { delegator: 2, collator: 1, @@ -2986,7 +3181,7 @@ fn cancel_revoke_delegation_updates_delegator_state() { .with_delegations(vec![(2, 1, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); let state = ParachainStaking::delegation_scheduled_requests(&1); assert_eq!( state, @@ -3002,7 +3197,7 @@ fn cancel_revoke_delegation_updates_delegator_state() { .expect("delegator state must exist"), 10 ); - assert_ok!(ParachainStaking::cancel_delegation_request(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::cancel_delegation_request(RuntimeOrigin::signed(2), 1)); assert!(!ParachainStaking::delegation_scheduled_requests(&1) .iter() .any(|x| x.delegator == 2)); @@ -3025,8 +3220,12 @@ fn cancel_delegator_bond_less_correct_event() { .with_delegations(vec![(2, 1, 15)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); - assert_ok!(ParachainStaking::cancel_delegation_request(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); + assert_ok!(ParachainStaking::cancel_delegation_request(RuntimeOrigin::signed(2), 1)); assert_last_event!(MetaEvent::ParachainStaking(Event::CancelledDelegationRequest { delegator: 2, collator: 1, @@ -3046,7 +3245,11 @@ fn cancel_delegator_bond_less_updates_delegator_state() { .with_delegations(vec![(2, 1, 15)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 5 + )); let state = ParachainStaking::delegation_scheduled_requests(&1); assert_eq!( state, @@ -3062,7 +3265,7 @@ fn cancel_delegator_bond_less_updates_delegator_state() { .expect("delegator state must exist"), 5 ); - assert_ok!(ParachainStaking::cancel_delegation_request(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::cancel_delegation_request(RuntimeOrigin::signed(2), 1)); assert!(!ParachainStaking::delegation_scheduled_requests(&1) .iter() .any(|x| x.delegator == 2)); @@ -3085,7 +3288,7 @@ fn delegator_schedule_revocation_total() { .with_delegations(vec![(2, 1, 10), (2, 3, 10), (2, 4, 10)]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); assert_eq!( ParachainStaking::delegator_state(&2) .map(|x| x.less_total) @@ -3093,16 +3296,20 @@ fn delegator_schedule_revocation_total() { 10 ); roll_to(10); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 1 + )); assert_eq!( ParachainStaking::delegator_state(&2) .map(|x| x.less_total) .expect("delegator state must exist"), 0 ); - assert_ok!(ParachainStaking::delegate(Origin::signed(2), 5, 10)); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 3)); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 4)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(2), 5, 10)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 3)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 4)); assert_eq!( ParachainStaking::delegator_state(&2) .map(|x| x.less_total) @@ -3110,14 +3317,22 @@ fn delegator_schedule_revocation_total() { 20, ); roll_to(20); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 3)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 3 + )); assert_eq!( ParachainStaking::delegator_state(&2) .map(|x| x.less_total) .expect("delegator state must exist"), 10, ); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(2), 2, 4)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(2), + 2, + 4 + )); assert_eq!( ParachainStaking::delegator_state(&2) .map(|x| x.less_total) @@ -3150,7 +3365,7 @@ fn parachain_bond_inflation_reserve_matches_config() { assert_eq!(Balances::free_balance(&11), 1); // set parachain bond account so DefaultParachainBondReservePercent = 30% of inflation // is allocated to this account hereafter - assert_ok!(ParachainStaking::set_parachain_bond_account(Origin::root(), 11)); + assert_ok!(ParachainStaking::set_parachain_bond_account(RuntimeOrigin::root(), 11)); roll_to(8); // chooses top TotalSelectedCandidates (5), in order let mut expected = vec![ @@ -3211,13 +3426,13 @@ fn parachain_bond_inflation_reserve_matches_config() { set_author(5, 1, 100); // 1. ensure delegators are paid for 2 rounds after they leave assert_noop!( - ParachainStaking::schedule_leave_delegators(Origin::signed(66)), + ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(66)), Error::::DelegatorDNE ); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(6))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(6))); // fast forward to block in which delegator 6 exit executes roll_to(25); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(6), 6)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(6), 6)); roll_to(30); let mut new2 = vec![ Event::DelegatorExitScheduled { round: 4, delegator: 6, scheduled_exit: 6 }, @@ -3280,7 +3495,7 @@ fn parachain_bond_inflation_reserve_matches_config() { assert_eq_events!(expected.clone()); assert_eq!(Balances::free_balance(&11), 65); assert_ok!(ParachainStaking::set_parachain_bond_reserve_percent( - Origin::root(), + RuntimeOrigin::root(), Percent::from_percent(50) )); // 6 won't be paid for this round because they left already @@ -3335,7 +3550,7 @@ fn parachain_bond_inflation_reserve_matches_config() { assert_eq_events!(expected.clone()); assert_eq!(Balances::free_balance(&11), 126); set_author(8, 1, 100); - assert_ok!(ParachainStaking::delegate(Origin::signed(8), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(8), 1, 10)); roll_to(45); // new delegation is not rewarded yet let mut new5 = vec![ @@ -3435,16 +3650,16 @@ fn paid_collator_commission_matches_config() { ]; assert_eq_events!(expected.clone()); // This should be safe to delete after collator restrcition removed - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 4)); - assert_ok!(ParachainStaking::join_candidates(Origin::signed(4), 20u128)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 4)); + assert_ok!(ParachainStaking::join_candidates(RuntimeOrigin::signed(4), 20u128)); assert_last_event!(MetaEvent::ParachainStaking(Event::JoinedCollatorCandidates { account: 4, amount_locked: 20u128, new_total_amt_locked: 60u128, })); roll_to(9); - assert_ok!(ParachainStaking::delegate(Origin::signed(5), 4, 10)); - assert_ok!(ParachainStaking::delegate(Origin::signed(6), 4, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(5), 4, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(6), 4, 10)); roll_to(11); let mut new = vec![ Event::CandidateWhiteListAdded { candidate: 4 }, @@ -3526,11 +3741,11 @@ fn collator_exit_executes_after_delay() { .build() .execute_with(|| { roll_to(11); - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(2))); let info = ParachainStaking::candidate_info(&2).unwrap(); assert_eq!(info.status, CollatorStatus::Leaving(5)); roll_to(21); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(2), 2)); // we must exclude leaving collators from rewards while // holding them retroactively accountable for previous faults // (within the last T::SlashingWindow blocks) @@ -3613,15 +3828,15 @@ fn collator_selection_chooses_top_candidates() { }, ]; assert_eq_events!(expected); - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(6))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(6))); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateScheduledExit { exit_allowed_round: 2, candidate: 6, scheduled_exit: 4 })); roll_to(21); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(6), 6)); - assert_ok!(ParachainStaking::join_candidates(Origin::signed(6), 69u128)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(6), 6)); + assert_ok!(ParachainStaking::join_candidates(RuntimeOrigin::signed(6), 69u128)); assert_last_event!(MetaEvent::ParachainStaking(Event::JoinedCollatorCandidates { account: 6, amount_locked: 69u128, @@ -3889,9 +4104,9 @@ fn multiple_delegations() { }, ]; assert_eq_events!(expected.clone()); - assert_ok!(ParachainStaking::delegate(Origin::signed(6), 2, 10)); - assert_ok!(ParachainStaking::delegate(Origin::signed(6), 3, 10)); - assert_ok!(ParachainStaking::delegate(Origin::signed(6), 4, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(6), 2, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(6), 3, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(6), 4, 10)); roll_to(16); let mut new = vec![ Event::Delegation { @@ -3938,8 +4153,8 @@ fn multiple_delegations() { expected.append(&mut new); assert_eq_events!(expected.clone()); roll_to(21); - assert_ok!(ParachainStaking::delegate(Origin::signed(7), 2, 80)); - assert_ok!(ParachainStaking::delegate(Origin::signed(10), 2, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(7), 2, 80)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(10), 2, 10)); roll_to(26); let mut new2 = vec![ Event::CollatorChosen { round: 5, collator_account: 1, total_exposed_amount: 50 }, @@ -3979,7 +4194,7 @@ fn multiple_delegations() { ]; expected.append(&mut new2); assert_eq_events!(expected.clone()); - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(2))); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateScheduledExit { exit_allowed_round: 6, candidate: 2, @@ -4015,7 +4230,7 @@ fn multiple_delegations() { assert_eq!(Balances::free_balance(&6), 60); assert_eq!(Balances::free_balance(&7), 10); roll_to(40); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(2), 2)); assert_eq!(ParachainStaking::delegator_state(7).unwrap().total, 10); assert_eq!(ParachainStaking::delegator_state(6).unwrap().total, 30); assert_eq!(ParachainStaking::delegator_state(7).unwrap().delegations.0.len(), 1usize); @@ -4042,15 +4257,15 @@ fn execute_leave_candidate_removes_delegations() { .iter() .any(|x| x.delegator == 3)); - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(2))); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(3), 2)); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(2))); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(3), 2)); // Verifies the revocation request is present assert!(ParachainStaking::delegation_scheduled_requests(&2) .iter() .any(|x| x.delegator == 3)); roll_to(16); - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(2), 2)); // Verifies the revocation request is again empty assert!(!ParachainStaking::delegation_scheduled_requests(&2) .iter() @@ -4134,13 +4349,13 @@ fn payouts_follow_delegation_changes() { set_author(6, 1, 100); // 1. ensure delegators are paid for 2 rounds after they leave assert_noop!( - ParachainStaking::schedule_leave_delegators(Origin::signed(66)), + ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(66)), Error::::DelegatorDNE ); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(6))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(6))); // fast forward to block in which delegator 6 exit executes roll_to(25); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(6), 6)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(6), 6)); // keep paying 6 (note: inflation is in terms of total issuance so that's why 1 is 21) let mut new2 = vec![ Event::DelegatorExitScheduled { round: 4, delegator: 6, scheduled_exit: 6 }, @@ -4242,7 +4457,7 @@ fn payouts_follow_delegation_changes() { expected.append(&mut new4); assert_eq_events!(expected.clone()); set_author(9, 1, 100); - assert_ok!(ParachainStaking::delegate(Origin::signed(8), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(8), 1, 10)); roll_to(45); // new delegation is not rewarded yet let mut new5 = vec![ @@ -4328,25 +4543,25 @@ fn bottom_delegations_are_empty_when_top_delegations_not_full() { assert!(top_delegations.delegations.is_empty()); assert!(bottom_delegations.delegations.is_empty()); // 1 delegator => 1 top delegator, 0 bottom delegators - assert_ok!(ParachainStaking::delegate(Origin::signed(2), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(2), 1, 10)); let top_delegations = ParachainStaking::top_delegations(1).unwrap(); let bottom_delegations = ParachainStaking::bottom_delegations(1).unwrap(); assert_eq!(top_delegations.delegations.len(), 1usize); assert!(bottom_delegations.delegations.is_empty()); // 2 delegators => 2 top delegators, 0 bottom delegators - assert_ok!(ParachainStaking::delegate(Origin::signed(3), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(3), 1, 10)); let top_delegations = ParachainStaking::top_delegations(1).unwrap(); let bottom_delegations = ParachainStaking::bottom_delegations(1).unwrap(); assert_eq!(top_delegations.delegations.len(), 2usize); assert!(bottom_delegations.delegations.is_empty()); // 3 delegators => 3 top delegators, 0 bottom delegators - assert_ok!(ParachainStaking::delegate(Origin::signed(4), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(4), 1, 10)); let top_delegations = ParachainStaking::top_delegations(1).unwrap(); let bottom_delegations = ParachainStaking::bottom_delegations(1).unwrap(); assert_eq!(top_delegations.delegations.len(), 3usize); assert!(bottom_delegations.delegations.is_empty()); // 4 delegators => 4 top delegators, 0 bottom delegators - assert_ok!(ParachainStaking::delegate(Origin::signed(5), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(5), 1, 10)); let top_delegations = ParachainStaking::top_delegations(1).unwrap(); let bottom_delegations = ParachainStaking::bottom_delegations(1).unwrap(); assert_eq!(top_delegations.delegations.len(), 4usize); @@ -4395,23 +4610,39 @@ fn candidate_pool_updates_when_total_counted_changes() { } // 15 + 16 + 17 + 18 + 20 = 86 (top 4 + self bond) is_candidate_pool_bond(1, 86); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(3), 1, 8)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(3), 1, 8)); // 3: 11 -> 19 => 3 is in top, bumps out 7 // 16 + 17 + 18 + 19 + 20 = 90 (top 4 + self bond) is_candidate_pool_bond(1, 90); - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(4), 1, 8)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(4), 1, 8)); // 4: 12 -> 20 => 4 is in top, bumps out 8 // 17 + 18 + 19 + 20 + 20 = 94 (top 4 + self bond) is_candidate_pool_bond(1, 94); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(10), 1, 3)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(10), + 1, + 3 + )); roll_to(30); // 10: 18 -> 15 => 10 bumped to bottom, 8 bumped to top (- 18 + 16 = -2 for count) - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(10), 10, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(10), + 10, + 1 + )); // 16 + 17 + 19 + 20 + 20 = 92 (top 4 + self bond) is_candidate_pool_bond(1, 92); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(9), 1, 4)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(9), + 1, + 4 + )); roll_to(40); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(9), 9, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(9), + 9, + 1 + )); // 15 + 16 + 19 + 20 + 20 = 90 (top 4 + self bond) is_candidate_pool_bond(1, 90); }); @@ -4452,7 +4683,7 @@ fn only_top_collators_are_counted() { // 15 + 16 + 17 + 18 + 20 = 86 (top 4 + self bond) assert_eq!(collator_state.total_counted, 86); // bump bottom to the top - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(3), 1, 8)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(3), 1, 8)); assert_event_emitted!(Event::DelegationIncreased { delegator: 3, candidate: 1, @@ -4463,7 +4694,7 @@ fn only_top_collators_are_counted() { // 16 + 17 + 18 + 19 + 20 = 90 (top 4 + self bond) assert_eq!(collator_state.total_counted, 90); // bump bottom to the top - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(4), 1, 8)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(4), 1, 8)); assert_event_emitted!(Event::DelegationIncreased { delegator: 4, candidate: 1, @@ -4474,7 +4705,7 @@ fn only_top_collators_are_counted() { // 17 + 18 + 19 + 20 + 20 = 94 (top 4 + self bond) assert_eq!(collator_state.total_counted, 94); // bump bottom to the top - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(5), 1, 8)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(5), 1, 8)); assert_event_emitted!(Event::DelegationIncreased { delegator: 5, candidate: 1, @@ -4485,7 +4716,7 @@ fn only_top_collators_are_counted() { // 18 + 19 + 20 + 21 + 20 = 98 (top 4 + self bond) assert_eq!(collator_state.total_counted, 98); // bump bottom to the top - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(6), 1, 8)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(6), 1, 8)); assert_event_emitted!(Event::DelegationIncreased { delegator: 6, candidate: 1, @@ -4521,7 +4752,7 @@ fn delegation_events_convey_correct_position() { // 11 + 12 + 13 + 14 + 20 = 70 (top 4 + self bond) assert_eq!(collator1_state.total_counted, 70); // Top delegations are full, new highest delegation is made - assert_ok!(ParachainStaking::delegate(Origin::signed(7), 1, 15)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(7), 1, 15)); assert_event_emitted!(Event::Delegation { delegator: 7, locked_amount: 15, @@ -4532,7 +4763,7 @@ fn delegation_events_convey_correct_position() { // 12 + 13 + 14 + 15 + 20 = 70 (top 4 + self bond) assert_eq!(collator1_state.total_counted, 74); // New delegation is added to the bottom - assert_ok!(ParachainStaking::delegate(Origin::signed(8), 1, 10)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(8), 1, 10)); assert_event_emitted!(Event::Delegation { delegator: 8, locked_amount: 10, @@ -4543,7 +4774,7 @@ fn delegation_events_convey_correct_position() { // 12 + 13 + 14 + 15 + 20 = 70 (top 4 + self bond) assert_eq!(collator1_state.total_counted, 74); // 8 increases delegation to the top - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(8), 1, 3)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(8), 1, 3)); assert_event_emitted!(Event::DelegationIncreased { delegator: 8, candidate: 1, @@ -4554,7 +4785,7 @@ fn delegation_events_convey_correct_position() { // 13 + 13 + 14 + 15 + 20 = 75 (top 4 + self bond) assert_eq!(collator1_state.total_counted, 75); // 3 increases delegation but stays in bottom - assert_ok!(ParachainStaking::delegator_bond_more(Origin::signed(3), 1, 1)); + assert_ok!(ParachainStaking::delegator_bond_more(RuntimeOrigin::signed(3), 1, 1)); assert_event_emitted!(Event::DelegationIncreased { delegator: 3, candidate: 1, @@ -4565,7 +4796,11 @@ fn delegation_events_convey_correct_position() { // 13 + 13 + 14 + 15 + 20 = 75 (top 4 + self bond) assert_eq!(collator1_state.total_counted, 75); // 6 decreases delegation but stays in top - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(6), 1, 2)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(6), + 1, + 2 + )); assert_event_emitted!(Event::DelegationDecreaseScheduled { delegator: 6, candidate: 1, @@ -4573,7 +4808,11 @@ fn delegation_events_convey_correct_position() { execute_round: 3, }); roll_to(30); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(6), 6, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(6), + 6, + 1 + )); assert_event_emitted!(Event::DelegationDecreased { delegator: 6, candidate: 1, @@ -4584,7 +4823,11 @@ fn delegation_events_convey_correct_position() { // 12 + 13 + 13 + 15 + 20 = 73 (top 4 + self bond)Æ’ assert_eq!(collator1_state.total_counted, 73); // 6 decreases delegation and is bumped to bottom - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(6), 1, 1)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(6), + 1, + 1 + )); assert_event_emitted!(Event::DelegationDecreaseScheduled { delegator: 6, candidate: 1, @@ -4592,7 +4835,11 @@ fn delegation_events_convey_correct_position() { execute_round: 9, }); roll_to(40); - assert_ok!(ParachainStaking::execute_delegation_request(Origin::signed(6), 6, 1)); + assert_ok!(ParachainStaking::execute_delegation_request( + RuntimeOrigin::signed(6), + 6, + 1 + )); assert_event_emitted!(Event::DelegationDecreased { delegator: 6, candidate: 1, @@ -5008,9 +5255,9 @@ fn delegation_kicked_from_bottom_removes_pending_request() { ]) .build() .execute_with(|| { - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); // 10 delegates to full 1 => kicks lowest delegation (2, 19) - assert_ok!(ParachainStaking::delegate(Origin::signed(10), 1, 20)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(10), 1, 20)); // check the event assert_event_emitted!(Event::DelegationKicked { delegator: 2, @@ -5034,7 +5281,7 @@ fn no_selected_candidates_defaults_to_last_round_collators() { roll_to_round_begin(1); // schedule to leave for i in 1..6 { - assert_ok!(ParachainStaking::schedule_leave_candidates(Origin::signed(i))); + assert_ok!(ParachainStaking::schedule_leave_candidates(RuntimeOrigin::signed(i))); } let old_round = ParachainStaking::round().current; let old_selected_candidates = ParachainStaking::selected_candidates(); @@ -5045,7 +5292,7 @@ fn no_selected_candidates_defaults_to_last_round_collators() { roll_to_round_begin(3); // execute leave for i in 1..6 { - assert_ok!(ParachainStaking::execute_leave_candidates(Origin::signed(i), i)); + assert_ok!(ParachainStaking::execute_leave_candidates(RuntimeOrigin::signed(i), i)); } // next round roll_to_round_begin(4); @@ -5072,7 +5319,7 @@ fn test_delegator_scheduled_for_revoke_is_rewarded_for_previous_rounds_but_not_f // preset rewards for rounds 1, 2 and 3 (1..=3).for_each(|round| set_author(round, 1, 1)); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegationRevocationScheduled { round: 1, delegator: 2, @@ -5125,7 +5372,7 @@ fn test_delegator_scheduled_for_revoke_is_rewarded_when_request_cancelled() { // preset rewards for rounds 2, 3 and 4 (2..=4).for_each(|round| set_author(round, 1, 1)); - assert_ok!(ParachainStaking::schedule_revoke_delegation(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::schedule_revoke_delegation(RuntimeOrigin::signed(2), 1)); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegationRevocationScheduled { round: 1, delegator: 2, @@ -5140,7 +5387,7 @@ fn test_delegator_scheduled_for_revoke_is_rewarded_when_request_cancelled() { assert_eq!(30, collator.total_counted, "collator's total was reduced unexpectedly"); roll_to_round_begin(2); - assert_ok!(ParachainStaking::cancel_delegation_request(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::cancel_delegation_request(RuntimeOrigin::signed(2), 1)); roll_to_round_begin(4); assert_eq_last_events!( @@ -5182,7 +5429,11 @@ fn test_delegator_scheduled_for_bond_decrease_is_rewarded_for_previous_rounds_bu // preset rewards for rounds 1, 2 and 3 (1..=3).for_each(|round| set_author(round, 1, 1)); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 10,)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 10, + )); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegationDecreaseScheduled { execute_round: 3, delegator: 2, @@ -5238,7 +5489,11 @@ fn test_delegator_scheduled_for_bond_decrease_is_rewarded_when_request_cancelled // preset rewards for rounds 2, 3 and 4 (2..=4).for_each(|round| set_author(round, 1, 1)); - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(2), 1, 10,)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(2), + 1, + 10, + )); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegationDecreaseScheduled { execute_round: 3, delegator: 2, @@ -5253,7 +5508,7 @@ fn test_delegator_scheduled_for_bond_decrease_is_rewarded_when_request_cancelled assert_eq!(40, collator.total_counted, "collator's total was reduced unexpectedly"); roll_to_round_begin(2); - assert_ok!(ParachainStaking::cancel_delegation_request(Origin::signed(2), 1)); + assert_ok!(ParachainStaking::cancel_delegation_request(RuntimeOrigin::signed(2), 1)); roll_to_round_begin(4); assert_eq_last_events!( @@ -5297,7 +5552,7 @@ fn test_delegator_scheduled_for_leave_is_rewarded_for_previous_rounds_but_not_fo // preset rewards for rounds 1, 2 and 3 (1..=3).for_each(|round| set_author(round, 1, 1)); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2),)); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2),)); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegatorExitScheduled { round: 1, delegator: 2, @@ -5349,7 +5604,7 @@ fn test_delegator_scheduled_for_leave_is_rewarded_when_request_cancelled() { // preset rewards for rounds 2, 3 and 4 (2..=4).for_each(|round| set_author(round, 1, 1)); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(2))); assert_last_event!(MetaEvent::ParachainStaking(Event::DelegatorExitScheduled { round: 1, delegator: 2, @@ -5363,7 +5618,7 @@ fn test_delegator_scheduled_for_leave_is_rewarded_when_request_cancelled() { assert_eq!(30, collator.total_counted, "collator's total was reduced unexpectedly"); roll_to_round_begin(2); - assert_ok!(ParachainStaking::cancel_leave_delegators(Origin::signed(2))); + assert_ok!(ParachainStaking::cancel_leave_delegators(RuntimeOrigin::signed(2))); roll_to_round_begin(4); assert_eq_last_events!( @@ -5506,13 +5761,13 @@ fn add_white_list() { .build() .execute_with(|| { // Adding a candidate to whitelist - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 4)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 4)); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateWhiteListAdded { candidate: 4, })); // Adding a existing whitelist has no new effect ( new event) - assert_ok!(ParachainStaking::add_candidates_whitelist(Origin::root(), 1)); + assert_ok!(ParachainStaking::add_candidates_whitelist(RuntimeOrigin::root(), 1)); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateWhiteListAdded { candidate: 4, })); @@ -5528,13 +5783,13 @@ fn remove_white_list() { .build() .execute_with(|| { // Removing a candidate from whitelist - assert_ok!(ParachainStaking::remove_candidates_whitelist(Origin::root(), 1)); + assert_ok!(ParachainStaking::remove_candidates_whitelist(RuntimeOrigin::root(), 1)); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateWhiteListRemoved { candidate: 1, })); // Removing a non-existing whitelist has no new effect ( new event) - assert_ok!(ParachainStaking::remove_candidates_whitelist(Origin::root(), 3)); + assert_ok!(ParachainStaking::remove_candidates_whitelist(RuntimeOrigin::root(), 3)); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateWhiteListRemoved { candidate: 1, })); @@ -5554,7 +5809,7 @@ fn staked_capacity() { // Delegate/Candidate can not stake more if they do not have enough transferrable (free) // balance assert_noop!( - ParachainStaking::candidate_bond_more(Origin::signed(1), 3000), + ParachainStaking::candidate_bond_more(RuntimeOrigin::signed(1), 3000), DispatchError::Module(ModuleError { index: 2, error: [8, 0, 0, 0], @@ -5562,7 +5817,7 @@ fn staked_capacity() { }) ); assert_noop!( - ParachainStaking::delegate(Origin::signed(4), 1, 3000), + ParachainStaking::delegate(RuntimeOrigin::signed(4), 1, 3000), DispatchError::Module(ModuleError { index: 2, error: [8, 0, 0, 0], @@ -5572,15 +5827,15 @@ fn staked_capacity() { // Delegate/Candidate can stake more if they enough balance and lock insignificant large Balances::set_lock(ID_1, &2, 400, WithdrawReasons::all()); Balances::set_lock(ID_1, &5, 400, WithdrawReasons::all()); - assert_ok!(ParachainStaking::candidate_bond_more(Origin::signed(2), 500)); - assert_ok!(ParachainStaking::delegate(Origin::signed(5), 1, 500)); + assert_ok!(ParachainStaking::candidate_bond_more(RuntimeOrigin::signed(2), 500)); + assert_ok!(ParachainStaking::delegate(RuntimeOrigin::signed(5), 1, 500)); // Delegate/Candidate can not stake more if they enough balance and lock significant // large Balances::set_lock(ID_1, &3, 600, WithdrawReasons::TRANSFER); Balances::set_lock(ID_1, &6, 600, WithdrawReasons::TRANSFER); assert_noop!( - ParachainStaking::candidate_bond_more(Origin::signed(3), 500), + ParachainStaking::candidate_bond_more(RuntimeOrigin::signed(3), 500), DispatchError::Module(ModuleError { index: 2, error: [8, 0, 0, 0], @@ -5588,7 +5843,7 @@ fn staked_capacity() { }) ); assert_noop!( - ParachainStaking::delegate(Origin::signed(6), 1, 500), + ParachainStaking::delegate(RuntimeOrigin::signed(6), 1, 500), DispatchError::Module(ModuleError { index: 2, error: [8, 0, 0, 0], @@ -5600,7 +5855,11 @@ fn staked_capacity() { Balances::set_lock(ID_1, &2, u128::MAX, WithdrawReasons::all()); Balances::set_lock(ID_1, &5, u128::MAX, WithdrawReasons::all()); // Delegator leaves freely - assert_ok!(ParachainStaking::schedule_delegator_bond_less(Origin::signed(5), 1, 5)); + assert_ok!(ParachainStaking::schedule_delegator_bond_less( + RuntimeOrigin::signed(5), + 1, + 5 + )); let state = ParachainStaking::delegation_scheduled_requests(&1); assert_eq!( state, @@ -5610,9 +5869,9 @@ fn staked_capacity() { action: DelegationAction::Decrease(5), }], ); - assert_ok!(ParachainStaking::schedule_leave_delegators(Origin::signed(5))); + assert_ok!(ParachainStaking::schedule_leave_delegators(RuntimeOrigin::signed(5))); roll_to(10); - assert_ok!(ParachainStaking::execute_leave_delegators(Origin::signed(5), 5)); + assert_ok!(ParachainStaking::execute_leave_delegators(RuntimeOrigin::signed(5), 5)); assert!(ParachainStaking::delegator_state(2).is_none()); assert!( !ParachainStaking::delegation_scheduled_requests(&1) @@ -5622,9 +5881,9 @@ fn staked_capacity() { ); // Candidate leaves freely - assert_ok!(ParachainStaking::schedule_candidate_bond_less(Origin::signed(2), 5)); + assert_ok!(ParachainStaking::schedule_candidate_bond_less(RuntimeOrigin::signed(2), 5)); roll_to(20); - assert_ok!(ParachainStaking::execute_candidate_bond_less(Origin::signed(2), 2)); + assert_ok!(ParachainStaking::execute_candidate_bond_less(RuntimeOrigin::signed(2), 2)); assert_last_event!(MetaEvent::ParachainStaking(Event::CandidateBondedLess { candidate: 2, amount: 5, diff --git a/pallets/vc-management/Cargo.toml b/pallets/vc-management/Cargo.toml index a1123d3a45..642bb8d1e7 100644 --- a/pallets/vc-management/Cargo.toml +++ b/pallets/vc-management/Cargo.toml @@ -13,26 +13,26 @@ log = { version = "0.4", default-features = false } scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } # primitives -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } # frame dependencies -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } # local primitives = { path = "../../primitives", default-features = false } # benchmarking -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false, optional = true } hex = { version = "0.4", default-features = false } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] diff --git a/pallets/vc-management/src/lib.rs b/pallets/vc-management/src/lib.rs index 44a1760867..fc5255c70b 100644 --- a/pallets/vc-management/src/lib.rs +++ b/pallets/vc-management/src/lib.rs @@ -57,9 +57,9 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; // some extrinsics should only be called by origins from TEE - type TEECallOrigin: EnsureOrigin; + type TEECallOrigin: EnsureOrigin; } // a map VCID -> VC context diff --git a/pallets/vc-management/src/mock.rs b/pallets/vc-management/src/mock.rs index 30cf9c7160..56705e6334 100644 --- a/pallets/vc-management/src/mock.rs +++ b/pallets/vc-management/src/mock.rs @@ -57,8 +57,8 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -66,7 +66,7 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -91,7 +91,7 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type Balance = Balance; // the type that is relevant to us - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; @@ -103,7 +103,7 @@ ord_parameter_types! { } impl pallet_vc_management::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type TEECallOrigin = EnsureSignedBy; } diff --git a/pallets/vc-management/src/tests.rs b/pallets/vc-management/src/tests.rs index 2b1e68266f..4f6d2149e7 100644 --- a/pallets/vc-management/src/tests.rs +++ b/pallets/vc-management/src/tests.rs @@ -24,8 +24,8 @@ const TEST_MRENCLAVE: [u8; 32] = [2u8; 32]; fn request_vc_works() { new_test_ext().execute_with(|| { let shard: ShardIdentifier = H256::from_slice(&TEST_MRENCLAVE); - assert_ok!(VCManagement::request_vc(Origin::signed(1), shard, Ruleset::R1)); - System::assert_last_event(Event::VCManagement(crate::Event::VCRequested { + assert_ok!(VCManagement::request_vc(RuntimeOrigin::signed(1), shard, Ruleset::R1)); + System::assert_last_event(RuntimeEvent::VCManagement(crate::Event::VCRequested { shard, ruleset: Ruleset::R1, })); @@ -36,7 +36,7 @@ fn request_vc_works() { fn vc_issued_works() { new_test_ext().execute_with(|| { assert_ok!(VCManagement::vc_issued( - Origin::signed(1), + RuntimeOrigin::signed(1), 1, 0, H256::default(), @@ -54,7 +54,13 @@ fn vc_issued_works() { fn vc_issued_with_unpriviledged_origin_fails() { new_test_ext().execute_with(|| { assert_noop!( - VCManagement::vc_issued(Origin::signed(2), 2, 0, H256::default(), AesOutput::default()), + VCManagement::vc_issued( + RuntimeOrigin::signed(2), + 2, + 0, + H256::default(), + AesOutput::default() + ), sp_runtime::DispatchError::BadOrigin ); }); @@ -64,14 +70,20 @@ fn vc_issued_with_unpriviledged_origin_fails() { fn vc_issued_with_duplicated_id_fails() { new_test_ext().execute_with(|| { assert_ok!(VCManagement::vc_issued( - Origin::signed(1), + RuntimeOrigin::signed(1), 2, 0, H256::default(), AesOutput::default() )); assert_noop!( - VCManagement::vc_issued(Origin::signed(1), 2, 0, H256::default(), AesOutput::default()), + VCManagement::vc_issued( + RuntimeOrigin::signed(1), + 2, + 0, + H256::default(), + AesOutput::default() + ), Error::::VCAlreadyExists ); }); @@ -81,14 +93,14 @@ fn vc_issued_with_duplicated_id_fails() { fn disable_vc_works() { new_test_ext().execute_with(|| { assert_ok!(VCManagement::vc_issued( - Origin::signed(1), + RuntimeOrigin::signed(1), 2, 0, H256::default(), AesOutput::default() )); assert!(VCManagement::vc_registry(0).is_some()); - assert_ok!(VCManagement::disable_vc(Origin::signed(2), 0)); + assert_ok!(VCManagement::disable_vc(RuntimeOrigin::signed(2), 0)); // vc is not deleted assert!(VCManagement::vc_registry(0).is_some()); let context = VCManagement::vc_registry(0).unwrap(); @@ -99,7 +111,10 @@ fn disable_vc_works() { #[test] fn disable_vc_with_non_existent_vc_fails() { new_test_ext().execute_with(|| { - assert_noop!(VCManagement::disable_vc(Origin::signed(1), 0), Error::::VCNotExist); + assert_noop!( + VCManagement::disable_vc(RuntimeOrigin::signed(1), 0), + Error::::VCNotExist + ); }); } @@ -107,14 +122,14 @@ fn disable_vc_with_non_existent_vc_fails() { fn disable_vc_with_other_subject_fails() { new_test_ext().execute_with(|| { assert_ok!(VCManagement::vc_issued( - Origin::signed(1), + RuntimeOrigin::signed(1), 2, 0, H256::default(), AesOutput::default() )); assert_noop!( - VCManagement::disable_vc(Origin::signed(1), 0), + VCManagement::disable_vc(RuntimeOrigin::signed(1), 0), Error::::VCSubjectMismatch ); assert_eq!(VCManagement::vc_registry(0).unwrap().status, Status::Active); @@ -125,14 +140,14 @@ fn disable_vc_with_other_subject_fails() { fn revoke_vc_works() { new_test_ext().execute_with(|| { assert_ok!(VCManagement::vc_issued( - Origin::signed(1), + RuntimeOrigin::signed(1), 2, 0, H256::default(), AesOutput::default() )); assert!(VCManagement::vc_registry(0).is_some()); - assert_ok!(VCManagement::revoke_vc(Origin::signed(2), 0)); + assert_ok!(VCManagement::revoke_vc(RuntimeOrigin::signed(2), 0)); // vc is deleted assert!(VCManagement::vc_registry(0).is_none()); }); @@ -141,7 +156,10 @@ fn revoke_vc_works() { #[test] fn revokevc_with_non_existent_vc_fails() { new_test_ext().execute_with(|| { - assert_noop!(VCManagement::revoke_vc(Origin::signed(1), 0), Error::::VCNotExist); + assert_noop!( + VCManagement::revoke_vc(RuntimeOrigin::signed(1), 0), + Error::::VCNotExist + ); }); } @@ -149,14 +167,14 @@ fn revokevc_with_non_existent_vc_fails() { fn revoke_vc_with_other_subject_fails() { new_test_ext().execute_with(|| { assert_ok!(VCManagement::vc_issued( - Origin::signed(1), + RuntimeOrigin::signed(1), 2, 0, H256::default(), AesOutput::default() )); assert_noop!( - VCManagement::revoke_vc(Origin::signed(1), 0), + VCManagement::revoke_vc(RuntimeOrigin::signed(1), 0), Error::::VCSubjectMismatch ); assert_eq!(VCManagement::vc_registry(0).unwrap().status, Status::Active); diff --git a/pallets/xcm-asset-manager/Cargo.toml b/pallets/xcm-asset-manager/Cargo.toml index 06d8b8dc7e..90729a9c22 100644 --- a/pallets/xcm-asset-manager/Cargo.toml +++ b/pallets/xcm-asset-manager/Cargo.toml @@ -14,26 +14,26 @@ smallvec = "1.8.0" # Substrate Dependencies ## Substrate Primitive Dependencies -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } ## Substrate FRAME Dependencies -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } # Polkadot dependencies -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30", default-features = false } # Orml dependencies -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } # Benchmarks -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", optional = true, default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", optional = true, default-features = false } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } [features] default = ["std"] diff --git a/pallets/xcm-asset-manager/src/lib.rs b/pallets/xcm-asset-manager/src/lib.rs index a876ec7998..a6b7373e00 100644 --- a/pallets/xcm-asset-manager/src/lib.rs +++ b/pallets/xcm-asset-manager/src/lib.rs @@ -117,7 +117,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The Asset Id. This will be used to register the asset in Assets type AssetId: Member @@ -137,7 +137,7 @@ pub mod pallet { type Balance: Member + Parameter + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen; /// Origin that is allowed to create and modify asset information for foreign assets - type ForeignAssetModifierOrigin: EnsureOrigin; + type ForeignAssetModifierOrigin: EnsureOrigin; /// The currency mechanism in which we reserve deposits for local assets. type Currency: ReservableCurrency; diff --git a/pallets/xcm-asset-manager/src/mock.rs b/pallets/xcm-asset-manager/src/mock.rs index 4d2bf0a07b..70e5cd351e 100644 --- a/pallets/xcm-asset-manager/src/mock.rs +++ b/pallets/xcm-asset-manager/src/mock.rs @@ -58,8 +58,8 @@ impl frame_system::Config for Test { type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -67,7 +67,7 @@ impl frame_system::Config for Test { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); @@ -84,7 +84,7 @@ impl frame_system::Config for Test { impl pallet_balances::Config for Test { type Balance = Balance; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU64<1>; type AccountStore = System; type WeightInfo = (); @@ -139,7 +139,7 @@ impl From for Option { } impl Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = u64; type AssetId = u32; type ForeignAssetType = MockAssetType; @@ -167,7 +167,7 @@ pub(crate) fn events() -> Vec> { System::events() .into_iter() .map(|r| r.event) - .filter_map(|e| if let Event::AssetManager(inner) = e { Some(inner) } else { None }) + .filter_map(|e| if let RuntimeEvent::AssetManager(inner) = e { Some(inner) } else { None }) .collect::>() } diff --git a/pallets/xcm-asset-manager/src/tests.rs b/pallets/xcm-asset-manager/src/tests.rs index e89bd461e4..0a60ce878c 100644 --- a/pallets/xcm-asset-manager/src/tests.rs +++ b/pallets/xcm-asset-manager/src/tests.rs @@ -32,7 +32,7 @@ fn registering_foreign_works() { }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); @@ -61,14 +61,14 @@ fn registering_foreign_errors() { }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); assert_noop!( AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() ), @@ -97,7 +97,7 @@ fn test_relocated_asset_id_works() { }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); @@ -106,7 +106,7 @@ fn test_relocated_asset_id_works() { crate::ForeignAssetTracker::::put(10); assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(2), asset_metadata_1.clone() )); @@ -149,14 +149,14 @@ fn test_update_foreign_asset_metadata_works() { }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); assert_eq!(AssetManager::asset_id_type(0).unwrap(), MockAssetType::MockAsset(1)); assert_noop!( AssetManager::update_foreign_asset_metadata( - Origin::root(), + RuntimeOrigin::root(), 2, asset_metadata_2.clone() ), @@ -165,7 +165,7 @@ fn test_update_foreign_asset_metadata_works() { assert_eq!(AssetManager::asset_metadatas(0).unwrap(), asset_metadata_1); assert_ok!(AssetManager::update_foreign_asset_metadata( - Origin::root(), + RuntimeOrigin::root(), 0, asset_metadata_2.clone() )); @@ -193,7 +193,7 @@ fn test_root_can_change_units_per_second() { is_frozen: false, }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); @@ -203,7 +203,7 @@ fn test_root_can_change_units_per_second() { assert!(!AssetManager::payment_is_supported(MockAssetType::MockAsset(1))); assert_eq!(AssetManager::get_units_per_second(MockAssetType::MockAsset(1)), None); - assert_ok!(AssetManager::set_asset_units_per_second(Origin::root(), 0, 200u128)); + assert_ok!(AssetManager::set_asset_units_per_second(RuntimeOrigin::root(), 0, 200u128)); assert!(AssetManager::payment_is_supported(MockAssetType::MockAsset(1))); assert_eq!(AssetManager::asset_id_units_per_second(0), 200); @@ -232,7 +232,7 @@ fn test_regular_user_cannot_call_extrinsics() { }; assert_noop!( AssetManager::register_foreign_asset_type( - Origin::signed(1), + RuntimeOrigin::signed(1), MockAssetType::MockAsset(1), asset_metadata_1.clone() ), @@ -240,23 +240,27 @@ fn test_regular_user_cannot_call_extrinsics() { ); assert_noop!( - AssetManager::update_foreign_asset_metadata(Origin::signed(1), 0, asset_metadata_1), + AssetManager::update_foreign_asset_metadata( + RuntimeOrigin::signed(1), + 0, + asset_metadata_1 + ), sp_runtime::DispatchError::BadOrigin ); assert_noop!( - AssetManager::set_asset_units_per_second(Origin::signed(1), 0, 200u128), + AssetManager::set_asset_units_per_second(RuntimeOrigin::signed(1), 0, 200u128), sp_runtime::DispatchError::BadOrigin ); assert_noop!( - AssetManager::add_asset_type(Origin::signed(1), 1, MockAssetType::MockAsset(2)), + AssetManager::add_asset_type(RuntimeOrigin::signed(1), 1, MockAssetType::MockAsset(2)), sp_runtime::DispatchError::BadOrigin ); assert_noop!( AssetManager::remove_asset_type( - Origin::signed(1), + RuntimeOrigin::signed(1), MockAssetType::MockAsset(1), Some(MockAssetType::MockAsset(2)) ), @@ -286,26 +290,30 @@ fn test_root_can_add_asset_type() { }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(2), asset_metadata_2.clone() )); - assert_ok!(AssetManager::add_asset_type(Origin::root(), 0, MockAssetType::MockAsset(3))); + assert_ok!(AssetManager::add_asset_type( + RuntimeOrigin::root(), + 0, + MockAssetType::MockAsset(3) + )); assert_noop!( - AssetManager::add_asset_type(Origin::root(), 0, MockAssetType::MockAsset(2)), + AssetManager::add_asset_type(RuntimeOrigin::root(), 0, MockAssetType::MockAsset(2)), Error::::AssetAlreadyExists ); assert_noop!( - AssetManager::add_asset_type(Origin::root(), 2, MockAssetType::MockAsset(4)), + AssetManager::add_asset_type(RuntimeOrigin::root(), 2, MockAssetType::MockAsset(4)), Error::::AssetIdDoesNotExist ); @@ -345,7 +353,7 @@ fn test_change_units_per_second_after_setting_it_once() { is_frozen: false, }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); @@ -353,12 +361,12 @@ fn test_change_units_per_second_after_setting_it_once() { assert!(!AssetManager::payment_is_supported(MockAssetType::MockAsset(1))); assert_eq!(AssetManager::get_units_per_second(MockAssetType::MockAsset(1)), None); - assert_ok!(AssetManager::set_asset_units_per_second(Origin::root(), 0, 200u128)); + assert_ok!(AssetManager::set_asset_units_per_second(RuntimeOrigin::root(), 0, 200u128)); assert!(AssetManager::payment_is_supported(MockAssetType::MockAsset(1))); assert_eq!(AssetManager::asset_id_units_per_second(0), 200); assert_eq!(AssetManager::get_units_per_second(MockAssetType::MockAsset(1)), Some(200)); - assert_ok!(AssetManager::set_asset_units_per_second(Origin::root(), 0, 100u128)); + assert_ok!(AssetManager::set_asset_units_per_second(RuntimeOrigin::root(), 0, 100u128)); assert!(AssetManager::payment_is_supported(MockAssetType::MockAsset(1))); assert_eq!(AssetManager::asset_id_units_per_second(0), 100); @@ -388,22 +396,30 @@ fn test_root_can_remove_asset_type() { is_frozen: false, }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); - assert_ok!(AssetManager::set_asset_units_per_second(Origin::root(), 0, 100u128)); + assert_ok!(AssetManager::set_asset_units_per_second(RuntimeOrigin::root(), 0, 100u128)); - assert_ok!(AssetManager::add_asset_type(Origin::root(), 0, MockAssetType::MockAsset(2))); - assert_ok!(AssetManager::add_asset_type(Origin::root(), 0, MockAssetType::MockAsset(3))); + assert_ok!(AssetManager::add_asset_type( + RuntimeOrigin::root(), + 0, + MockAssetType::MockAsset(2) + )); + assert_ok!(AssetManager::add_asset_type( + RuntimeOrigin::root(), + 0, + MockAssetType::MockAsset(3) + )); assert!(AssetManager::payment_is_supported(MockAssetType::MockAsset(1))); assert_eq!(AssetManager::asset_id_units_per_second(0), 100); assert_eq!(AssetManager::get_units_per_second(MockAssetType::MockAsset(1)), Some(100)); assert_ok!(AssetManager::remove_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), None )); @@ -417,7 +433,7 @@ fn test_root_can_remove_asset_type() { assert_eq!(AssetManager::asset_id_type(0).unwrap(), MockAssetType::MockAsset(3)); assert_ok!(AssetManager::remove_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(3), Some(MockAssetType::MockAsset(2)) )); @@ -464,22 +480,30 @@ fn test_malicious_remove_asset_type_fail() { is_frozen: false, }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(2), asset_metadata_1 )); - assert_ok!(AssetManager::add_asset_type(Origin::root(), 0, MockAssetType::MockAsset(3))); - assert_ok!(AssetManager::add_asset_type(Origin::root(), 1, MockAssetType::MockAsset(4))); + assert_ok!(AssetManager::add_asset_type( + RuntimeOrigin::root(), + 0, + MockAssetType::MockAsset(3) + )); + assert_ok!(AssetManager::add_asset_type( + RuntimeOrigin::root(), + 1, + MockAssetType::MockAsset(4) + )); // try assign asset_type=4 (which belongs to asset_id=1) to asset_id=0 assert_noop!( AssetManager::remove_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), Some(MockAssetType::MockAsset(4)) ), @@ -500,15 +524,15 @@ fn test_asset_id_non_existent_error() { }; assert_noop!( - AssetManager::update_foreign_asset_metadata(Origin::root(), 0, asset_metadata_1), + AssetManager::update_foreign_asset_metadata(RuntimeOrigin::root(), 0, asset_metadata_1), Error::::AssetIdDoesNotExist ); assert_noop!( - AssetManager::set_asset_units_per_second(Origin::root(), 0, 200u128), + AssetManager::set_asset_units_per_second(RuntimeOrigin::root(), 0, 200u128), Error::::AssetIdDoesNotExist ); assert_noop!( - AssetManager::add_asset_type(Origin::root(), 1, MockAssetType::MockAsset(2)), + AssetManager::add_asset_type(RuntimeOrigin::root(), 1, MockAssetType::MockAsset(2)), Error::::AssetIdDoesNotExist ); }); @@ -525,20 +549,20 @@ fn test_asset_already_exists_error() { is_frozen: false, }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); assert_noop!( AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1 ), Error::::AssetAlreadyExists ); assert_noop!( - AssetManager::add_asset_type(Origin::root(), 0, MockAssetType::MockAsset(1)), + AssetManager::add_asset_type(RuntimeOrigin::root(), 0, MockAssetType::MockAsset(1)), Error::::AssetAlreadyExists ); @@ -557,17 +581,21 @@ fn test_asset_type_does_not_exist_error() { is_frozen: false, }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1 )); assert_noop!( - AssetManager::remove_asset_type(Origin::root(), MockAssetType::MockAsset(2), None), + AssetManager::remove_asset_type( + RuntimeOrigin::root(), + MockAssetType::MockAsset(2), + None + ), Error::::AssetTypeDoesNotExist ); assert_noop!( AssetManager::remove_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), Some(MockAssetType::MockAsset(2)) ), @@ -587,19 +615,27 @@ fn test_default_asset_type_removed_error() { is_frozen: false, }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1 )); - assert_ok!(AssetManager::add_asset_type(Origin::root(), 0, MockAssetType::MockAsset(2))); + assert_ok!(AssetManager::add_asset_type( + RuntimeOrigin::root(), + 0, + MockAssetType::MockAsset(2) + )); assert_noop!( - AssetManager::remove_asset_type(Origin::root(), MockAssetType::MockAsset(2), None), + AssetManager::remove_asset_type( + RuntimeOrigin::root(), + MockAssetType::MockAsset(2), + None + ), Error::::DefaultAssetTypeRemoved ); assert_noop!( AssetManager::remove_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), Some(MockAssetType::MockAsset(1)) ), @@ -619,20 +655,20 @@ fn test_asset_id_over_flow_error() { is_frozen: false, }; assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(1), asset_metadata_1.clone() )); crate::ForeignAssetTracker::::put(10); assert_ok!(AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(2), asset_metadata_1.clone() )); crate::ForeignAssetTracker::::put(u32::MAX); assert_noop!( AssetManager::register_foreign_asset_type( - Origin::root(), + RuntimeOrigin::root(), MockAssetType::MockAsset(3), asset_metadata_1 ), diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 53c3434ef8..29bcd80484 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -6,12 +6,12 @@ version = '0.9.11' [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } -scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30", default-features = false } [features] default = ["std"] diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 79dcb7cdc0..0d5470666b 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -11,39 +11,39 @@ scale-info = { version = "2.3.0", default-features = false, features = ["derive" # Substrate Dependencies ## Substrate Primitive Dependencies -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } ## Substrate FRAME Dependencies -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } ## Substrate Pallet Dependencies -pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } # Cumulus dependencies -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } # Polkadot dependencies -pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } # TEE -pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", default-features = false, branch = "szp/polkadot-v0.9.29" } +pallet-teerex = { git = "https://github.com/litentry/integritee-pallets.git", branch = "polkadot-v0.9.30", default-features = false } # local pallet-asset-manager = { path = "../../pallets/xcm-asset-manager", default-features = false } @@ -51,15 +51,15 @@ pallet-extrinsic-filter = { path = "../../pallets/extrinsic-filter", default-fea primitives = { path = "../../primitives", default-features = false } # Dev dependencies -cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = "polkadot-v0.9.29", default-features = false } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } -orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } -sp-state-machine = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false, optional = true } +cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = "polkadot-v0.9.30", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } +orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30", default-features = false } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30", default-features = false } +sp-state-machine = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30", default-features = false, optional = true } [features] default = ["std"] diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index bcc98d96c2..9a681382c1 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -25,11 +25,12 @@ pub mod tests; pub mod xcm_impl; use frame_support::{ + pallet_prelude::DispatchClass, parameter_types, sp_runtime, traits::{Currency, EitherOfDiverse, EnsureOrigin, OnUnbalanced, OriginTrait}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_PER_SECOND}, - DispatchClass, Weight, + Weight, }, }; use frame_system::{limits, EnsureRoot}; @@ -122,7 +123,7 @@ pub struct ToAuthor(sp_std::marker::PhantomData); impl OnUnbalanced> for ToAuthor where R: pallet_balances::Config + pallet_authorship::Config, - ::Event: From>, + ::RuntimeEvent: From>, { fn on_nonzero_unbalanced(amount: NegativeImbalance) { if let Some(author) = >::author() { @@ -148,7 +149,7 @@ macro_rules! impl_runtime_transaction_payment_fees { where R: pallet_balances::Config + pallet_treasury::Config + pallet_authorship::Config, pallet_treasury::Pallet: OnUnbalanced>, - ::Event: From>, + ::RuntimeEvent: From>, { fn on_unbalanceds(mut fees_then_tips: impl Iterator>) { if let Some(fees) = fees_then_tips.next() { @@ -304,17 +305,17 @@ where // EnsureOrigin implementation to make sure the extrinsic origin // must come from one of the registered enclaves pub struct EnsureEnclaveSigner(PhantomData); -impl EnsureOrigin for EnsureEnclaveSigner +impl EnsureOrigin for EnsureEnclaveSigner where T: frame_system::Config + pallet_teerex::Config, { type Success = T::AccountId; - fn try_origin(o: T::Origin) -> Result { + fn try_origin(o: T::RuntimeOrigin) -> Result { o.into().and_then(|o| match o { frame_system::RawOrigin::Signed(ref who) if pallet_teerex::Pallet::::is_registered_enclave(who) == Ok(true) => Ok(who.clone()), - r => Err(T::Origin::from(r)), + r => Err(T::RuntimeOrigin::from(r)), }) } } diff --git a/runtime/common/src/tests/base_call_filter.rs b/runtime/common/src/tests/base_call_filter.rs index db4254b314..81c769f976 100644 --- a/runtime/common/src/tests/base_call_filter.rs +++ b/runtime/common/src/tests/base_call_filter.rs @@ -31,7 +31,7 @@ use crate::{ BaseRuntimeRequirements, }; -type OpaqueCall = WrapperKeepOpaque<::Call>; +type OpaqueCall = WrapperKeepOpaque<::RuntimeCall>; type ExtrinsicFilter = pallet_extrinsic_filter::Pallet; type System = frame_system::Pallet; type Balances = pallet_balances::Pallet; @@ -48,13 +48,13 @@ pub fn multisig_enabled< R: BaseRuntimeRequirements, Origin: frame_support::traits::OriginTrait + From>, Call: Clone - + Dispatchable + + Dispatchable + From> + From> + Encode, >() where - ::Call: Decode, + ::RuntimeCall: Decode, <::Lookup as sp_runtime::traits::StaticLookup>::Source: From, ::PostInfo: sp_std::fmt::Debug + Default, @@ -82,7 +82,7 @@ where pub fn balance_transfer_works< R: BaseRuntimeRequirements, Origin: frame_support::traits::OriginTrait + From>, - Call: Clone + Dispatchable + From> + Encode, + Call: Clone + Dispatchable + From> + Encode, >() where <::Lookup as sp_runtime::traits::StaticLookup>::Source: @@ -103,7 +103,7 @@ where pub fn balance_transfer_disabled< R: BaseRuntimeRequirements, Origin: frame_support::traits::OriginTrait + From>, - Call: Clone + Dispatchable + From> + Encode, + Call: Clone + Dispatchable + From> + Encode, >() where <::Lookup as sp_runtime::traits::StaticLookup>::Source: @@ -126,7 +126,7 @@ where pub fn balance_transfer_with_sudo_works< R: BaseRuntimeRequirements, Origin: frame_support::traits::OriginTrait + From>, - Call: Clone + Dispatchable + From> + Encode, + Call: Clone + Dispatchable + From> + Encode, >() where <::Lookup as sp_runtime::traits::StaticLookup>::Source: @@ -150,9 +150,9 @@ where } pub fn block_core_call_has_no_effect< - R: BaseRuntimeRequirements + frame_system::Config, + R: BaseRuntimeRequirements + frame_system::Config, Origin: frame_support::traits::OriginTrait + From>, - Call: Clone + Dispatchable + From> + Encode, + Call: Clone + Dispatchable + From> + Encode, >() where <::Lookup as sp_runtime::traits::StaticLookup>::Source: @@ -186,10 +186,10 @@ where pub fn block_non_core_call_works< R: BaseRuntimeRequirements - + frame_system::Config + + frame_system::Config + pallet_vesting::Config>, Origin: frame_support::traits::OriginTrait + From>, - Call: Clone + Dispatchable + From>, + Call: Clone + Dispatchable + From>, >() where <::Lookup as sp_runtime::traits::StaticLookup>::Source: @@ -249,22 +249,24 @@ macro_rules! run_call_filter_tests { #[test] fn multisig_enabled() { - base_call_filter::multisig_enabled::(); + base_call_filter::multisig_enabled::(); } #[test] fn balance_transfer_with_sudo_works() { - base_call_filter::balance_transfer_with_sudo_works::(); + base_call_filter::balance_transfer_with_sudo_works::( + ); } #[test] fn block_core_call_has_no_effect() { - base_call_filter::block_core_call_has_no_effect::(); + base_call_filter::block_core_call_has_no_effect::( + ); } #[test] fn block_non_core_call_works() { - base_call_filter::block_non_core_call_works::(); + base_call_filter::block_non_core_call_works::(); } }; } diff --git a/runtime/common/src/tests/orml_xcm.rs b/runtime/common/src/tests/orml_xcm.rs index fc93e6d7d5..de7c6db5ec 100644 --- a/runtime/common/src/tests/orml_xcm.rs +++ b/runtime/common/src/tests/orml_xcm.rs @@ -31,7 +31,7 @@ use xcm::latest::prelude::*; use xcm_executor::traits::Convert; pub fn orml_xcm_root_works< - R: BaseRuntimeRequirements + frame_system::Config, + R: BaseRuntimeRequirements + frame_system::Config, Origin: OriginTrait + From> + Clone @@ -39,7 +39,7 @@ pub fn orml_xcm_root_works< pallet_collective::RawOrigin, >, LocalOriginToLocation: Convert, - Call: Clone + Dispatchable + From>, + Call: Clone + Dispatchable + From>, >() where <::Lookup as sp_runtime::traits::StaticLookup>::Source: @@ -65,7 +65,7 @@ where } pub fn orml_xcm_signed_works< - R: BaseRuntimeRequirements + frame_system::Config, + R: BaseRuntimeRequirements + frame_system::Config, Origin: OriginTrait + From> + Clone @@ -73,7 +73,7 @@ pub fn orml_xcm_signed_works< pallet_collective::RawOrigin, >, LocalOriginToLocation: Convert, - Call: Clone + Dispatchable + From>, + Call: Clone + Dispatchable + From>, >() where <::Lookup as sp_runtime::traits::StaticLookup>::Source: @@ -99,7 +99,7 @@ where } pub fn orml_xcm_two_thirds_councli_works< - R: BaseRuntimeRequirements + frame_system::Config, + R: BaseRuntimeRequirements + frame_system::Config, Origin: OriginTrait + From> + Clone @@ -107,7 +107,7 @@ pub fn orml_xcm_two_thirds_councli_works< pallet_collective::RawOrigin, > + std::convert::From>, LocalOriginToLocation: Convert, - Call: Clone + Dispatchable + From>, + Call: Clone + Dispatchable + From>, I, >() where @@ -136,7 +136,7 @@ where } pub fn orml_xcm_one_four_councli_works< - R: BaseRuntimeRequirements + frame_system::Config, + R: BaseRuntimeRequirements + frame_system::Config, Origin: OriginTrait + From> + Clone @@ -144,7 +144,7 @@ pub fn orml_xcm_one_four_councli_works< pallet_collective::RawOrigin, > + std::convert::From>, LocalOriginToLocation: Convert, - Call: Clone + Dispatchable + From>, + Call: Clone + Dispatchable + From>, I, >() where @@ -173,7 +173,7 @@ where } pub fn orml_xcm_half_councli_works< - R: BaseRuntimeRequirements + frame_system::Config, + R: BaseRuntimeRequirements + frame_system::Config, Origin: OriginTrait + From> + Clone @@ -181,7 +181,7 @@ pub fn orml_xcm_half_councli_works< pallet_collective::RawOrigin, > + std::convert::From>, LocalOriginToLocation: Convert, - Call: Clone + Dispatchable + From>, + Call: Clone + Dispatchable + From>, I, >() where @@ -210,7 +210,7 @@ where } pub fn orml_xcm_member_works< - R: BaseRuntimeRequirements + frame_system::Config, + R: BaseRuntimeRequirements + frame_system::Config, Origin: OriginTrait + From> + Clone @@ -218,7 +218,7 @@ pub fn orml_xcm_member_works< pallet_collective::RawOrigin, > + std::convert::From>, LocalOriginToLocation: Convert, - Call: Clone + Dispatchable + From>, + Call: Clone + Dispatchable + From>, I, >() where diff --git a/runtime/common/src/tests/setup/mod.rs b/runtime/common/src/tests/setup/mod.rs index 58326a573d..aa050890c6 100644 --- a/runtime/common/src/tests/setup/mod.rs +++ b/runtime/common/src/tests/setup/mod.rs @@ -15,10 +15,7 @@ // along with Litentry. If not, see . use codec::Decode; -use frame_support::{ - traits::GenesisBuild, - weights::{DispatchInfo, PostDispatchInfo, Weight}, -}; +use frame_support::{dispatch::*, traits::GenesisBuild, weights::Weight}; pub use pallet_balances::Call as BalancesCall; use sp_runtime::SaturatedConversion; pub use sp_std::cell::RefCell; diff --git a/runtime/common/src/tests/setup/relay.rs b/runtime/common/src/tests/setup/relay.rs index a55a3a3dbd..52a7860f4e 100644 --- a/runtime/common/src/tests/setup/relay.rs +++ b/runtime/common/src/tests/setup/relay.rs @@ -87,8 +87,8 @@ macro_rules! decl_test_relay_chain_runtime { type Block = frame_system::mocking::MockBlock; impl frame_system::Config for RelayChainRuntime { - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -96,7 +96,7 @@ macro_rules! decl_test_relay_chain_runtime { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); type BlockLength = (); @@ -116,7 +116,7 @@ macro_rules! decl_test_relay_chain_runtime { impl pallet_balances::Config for RelayChainRuntime { type MaxLocks = ConstU32<50>; type Balance = Balance; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; @@ -147,15 +147,15 @@ macro_rules! decl_test_relay_chain_runtime { pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = LocalAssetTransactor; - type OriginConverter = LocalOriginConverter; + type OriginConverter = LocalOriginConverter; type IsReserve = (); type IsTeleporter = (); type LocationInverter = LocationInverter; type Barrier = Barrier; // This is the setting should be same from Kusama - type Weigher = FixedWeightBounds, Call, ConstU32<100>>; + type Weigher = FixedWeightBounds, RuntimeCall, ConstU32<100>>; type Trader = UsingComponents, KsmLocation, AccountId, Balances, ()>; type ResponseHandler = (); @@ -164,28 +164,28 @@ macro_rules! decl_test_relay_chain_runtime { type SubscriptionService = XcmPallet; } - pub type LocalOriginToLocation = SignedToAccountId32; + pub type LocalOriginToLocation = SignedToAccountId32; impl pallet_xcm::Config for RelayChainRuntime { - type Event = Event; - type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; type XcmRouter = XcmRouter; // Anyone can execute XCM messages locally... - type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; + type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds, Call, ConstU32<100>>; + type Weigher = FixedWeightBounds, RuntimeCall, ConstU32<100>>; type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl ump::Config for RelayChainRuntime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type UmpSink = ump::XcmSink, RelayChainRuntime>; type FirstMessageFactorPercent = ConstU64<100>; type ExecuteOverweightOrigin = EnsureRoot; diff --git a/runtime/common/src/tests/transaction_payment.rs b/runtime/common/src/tests/transaction_payment.rs index f55d5961b6..9db9d3020e 100644 --- a/runtime/common/src/tests/transaction_payment.rs +++ b/runtime/common/src/tests/transaction_payment.rs @@ -16,11 +16,8 @@ use frame_support::{ assert_ok, - dispatch::RawOrigin, - weights::{ - constants::ExtrinsicBaseWeight, DispatchClass, DispatchInfo, IdentityFee, PostDispatchInfo, - Weight, WeightToFee, - }, + dispatch::{DispatchClass, DispatchInfo, PostDispatchInfo, RawOrigin}, + weights::{constants::ExtrinsicBaseWeight, IdentityFee, Weight, WeightToFee}, }; use pallet_balances::Call as BalancesCall; use pallet_transaction_payment::{Multiplier, OnChargeTransaction}; @@ -64,15 +61,15 @@ pub fn multiplier_can_grow_from_zero() { } pub fn transaction_payment_works< - R: BaseRuntimeRequirements + frame_system::Config, + R: BaseRuntimeRequirements + frame_system::Config, TransactionByteFee: frame_support::traits::Get, Origin: frame_support::traits::OriginTrait + From>, - Call: Clone + Dispatchable + From>, + Call: Clone + Dispatchable + From>, >() where <::Lookup as sp_runtime::traits::StaticLookup>::Source: From, - ::Call: + ::RuntimeCall: Dispatchable, ::OnChargeTransaction: OnChargeTransaction>>, @@ -161,8 +158,8 @@ macro_rules! run_transaction_payment_tests { transaction_payment::transaction_payment_works::< Runtime, TransactionByteFee, - Origin, - Call, + RuntimeOrigin, + RuntimeCall, >(); } }; diff --git a/runtime/common/src/tests/xcm_parachain/mod.rs b/runtime/common/src/tests/xcm_parachain/mod.rs index 506ba7eba9..86c6860351 100644 --- a/runtime/common/src/tests/xcm_parachain/mod.rs +++ b/runtime/common/src/tests/xcm_parachain/mod.rs @@ -88,11 +88,11 @@ pub trait TestXCMRequirements { type ParaOrigin: frame_support::traits::OriginTrait + From>; type ParaCall: Clone - + Dispatchable + + Dispatchable + From> + Encode; type ParaRuntime: ParaRuntimeRequirements - + frame_system::Config + + frame_system::Config + orml_xtokens::Config> + orml_tokens::Config + pallet_asset_manager::Config> @@ -104,10 +104,10 @@ pub trait TestXCMRequirements { type RelayOrigin: frame_support::traits::OriginTrait + From>; type RelayCall: Clone - + Dispatchable + + Dispatchable + From> + Encode; - type RelayRuntime: frame_system::Config + type RelayRuntime: frame_system::Config + pallet_xcm::Config + pallet_balances::Config; type UnitWeightCost: frame_support::traits::Get; @@ -271,7 +271,7 @@ pub fn test_xtokens_weight_parameter() { pub fn test_pallet_xcm_recognize_multilocation() where - ::Event: From>, + ::RuntimeEvent: From>, { relaychain_parachains_set_up::(); R::ParaA::execute_with(|| { @@ -541,7 +541,7 @@ pub fn test_methods_xtokens_expected_fail() { pub fn test_methods_pallet_xcm_expected_succeed() where - ::Event: From>, + ::RuntimeEvent: From>, { relaychain_parachains_set_up::(); @@ -1069,7 +1069,8 @@ pub fn test_pallet_xcm_send_capacity_without_transact() // Relay root manipulate its own sovereign account on Parachain A by Xcm::Transact (Flawed) pub fn test_pallet_xcm_send_capacity_relay_manipulation() where - ::Event: From>, + ::RuntimeEvent: + From>, <::Lookup as sp_runtime::traits::StaticLookup>::Source: From, { @@ -1162,7 +1163,7 @@ where // Parachain root manipulate its own sovereign account on Relay by Xcm::Transact succeed pub fn test_pallet_xcm_send_capacity_parachain_manipulation() where - ::Event: From>, + ::RuntimeEvent: From>, <::Lookup as sp_runtime::traits::StaticLookup>::Source: From, { @@ -1319,8 +1320,8 @@ macro_rules! run_xcm_tests { struct XCMRequirements; impl TestXCMRequirements for XCMRequirements { - type ParaOrigin = Origin; - type ParaCall = Call; + type ParaOrigin = RuntimeOrigin; + type ParaCall = RuntimeCall; type ParaRuntime = Runtime; type ParaA = ParaA; type ParaB = ParaB; diff --git a/runtime/litentry/Cargo.toml b/runtime/litentry/Cargo.toml index 1c5873335e..c62cecff7d 100644 --- a/runtime/litentry/Cargo.toml +++ b/runtime/litentry/Cargo.toml @@ -16,74 +16,74 @@ primitives = { path = "../../primitives", default-features = false } # Substrate Dependencies ## Substrate Primitive Dependencies -sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } ## Substrate FRAME Dependencies -frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.29" } +frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.30" } ## Substrate Pallet Dependencies -pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-bounties = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-preimage = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-bounties = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-preimage = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } # Cumulus dependencies -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } # Polkadot dependencies -pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } # Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } -orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } +orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } # benchmarking -cumulus-pallet-session-benchmarking = { git = 'https://github.com/paritytech/cumulus', default-features = false, branch = "polkadot-v0.9.29", optional = true } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29", optional = true } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29", optional = true } +cumulus-pallet-session-benchmarking = { git = 'https://github.com/paritytech/cumulus', default-features = false, branch = "polkadot-v0.9.30", optional = true } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30", optional = true } +frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30", optional = true } # Litentry pallets pallet-asset-manager = { path = "../../pallets/xcm-asset-manager", default-features = false } @@ -95,16 +95,16 @@ pallet-parachain-staking = { path = "../../pallets/parachain-staking", default-f runtime-common = { path = '../common', default-features = false } [dev-dependencies] -cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = "polkadot-v0.9.29" } +cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = "polkadot-v0.9.30" } hex-literal = "0.3.4" -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } runtime-common = { path = '../common', default-features = false, features = ["tests"] } -sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } +sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] @@ -113,7 +113,7 @@ runtime-benchmarks = [ "cumulus-pallet-session-benchmarking/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-bounties/runtime-benchmarks", diff --git a/runtime/litentry/src/asset_config.rs b/runtime/litentry/src/asset_config.rs index d4329e2540..a16fceb324 100644 --- a/runtime/litentry/src/asset_config.rs +++ b/runtime/litentry/src/asset_config.rs @@ -8,7 +8,7 @@ use sp_std::prelude::*; use runtime_common::{xcm_impl::CurrencyId, EnsureRootOrHalfCouncil}; use super::{ - weights, AccountId, Amount, AssetId, AssetManager, Balance, Balances, Event, Runtime, + weights, AccountId, Amount, AssetId, AssetManager, Balance, Balances, Runtime, RuntimeEvent, TreasuryPalletId, }; @@ -31,7 +31,7 @@ impl Contains for DustRemovalWhitelist { pub type ReserveIdentifier = [u8; 8]; impl orml_tokens::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type Amount = Amount; type CurrencyId = AssetId; @@ -45,10 +45,13 @@ impl orml_tokens::Config for Runtime { type WeightInfo = (); type OnNewTokenAccount = (); type OnKilledTokenAccount = (); + type OnDeposit = (); + type OnSlash = (); + type OnTransfer = (); } impl pallet_asset_manager::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type ForeignAssetType = CurrencyId; diff --git a/runtime/litentry/src/lib.rs b/runtime/litentry/src/lib.rs index d94741cb53..7c0b4b6a33 100644 --- a/runtime/litentry/src/lib.rs +++ b/runtime/litentry/src/lib.rs @@ -103,10 +103,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -161,7 +162,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -175,9 +176,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// Runtime version. @@ -215,8 +216,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -257,26 +258,33 @@ impl Default for ProxyType { } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, ProxyType::NonTransfer => !matches!( c, - Call::Balances(..) | Call::Vesting(pallet_vesting::Call::vested_transfer { .. }) + RuntimeCall::Balances(..) | + RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }) ), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility(..) | Call::Multisig(..) + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility(..) | + RuntimeCall::Multisig(..) + ), + ProxyType::Collator => matches!( + c, + RuntimeCall::ParachainStaking(..) | + RuntimeCall::Utility(..) | + RuntimeCall::Multisig(..) ), - ProxyType::Collator => - matches!(c, Call::ParachainStaking(..) | Call::Utility(..) | Call::Multisig(..)), ProxyType::Governance => matches!( c, - Call::Democracy(..) | - Call::Council(..) | Call::TechnicalCommittee(..) | - Call::Treasury(..) + RuntimeCall::Democracy(..) | + RuntimeCall::Council(..) | + RuntimeCall::TechnicalCommittee(..) | + RuntimeCall::Treasury(..) ), } } @@ -301,14 +309,14 @@ parameter_types! { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; type ProxyDepositFactor = ProxyDepositFactor; type MaxProxies = ConstU32<32>; - type WeightInfo = weights::pallet_proxy::WeightInfo; + type WeightInfo = (); type MaxPending = ConstU32<32>; type CallHasher = BlakeTwo256; type AnnouncementDepositBase = AnnouncementDepositBase; @@ -336,10 +344,10 @@ parameter_types! { } impl pallet_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type PalletsOrigin = OriginCaller; - type Call = Call; + type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; type MaxScheduledPerBlock = ConstU32<50>; @@ -356,7 +364,7 @@ parameter_types! { impl pallet_preimage::Config for Runtime { type WeightInfo = weights::pallet_preimage::WeightInfo; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; type MaxSize = PreimageMaxSize; @@ -372,7 +380,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -383,8 +391,8 @@ impl pallet_balances::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -395,7 +403,7 @@ parameter_types! { impl_runtime_transaction_payment_fees!(constants); impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = IdentityFee; @@ -416,8 +424,8 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = Call; - type Event = Event; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; type LaunchPeriod = LaunchPeriod; @@ -463,9 +471,9 @@ parameter_types! { } impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = CouncilMotionDuration; type MaxProposals = ConstU32<100>; type MaxMembers = CouncilDefaultMaxMembers; @@ -474,7 +482,7 @@ impl pallet_collective::Config for Runtime { } impl pallet_membership::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AddOrigin = EnsureRootOrTwoThirdsCouncil; type RemoveOrigin = EnsureRootOrTwoThirdsCouncil; type SwapOrigin = EnsureRootOrTwoThirdsCouncil; @@ -491,9 +499,9 @@ parameter_types! { } impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = TechnicalMotionDuration; type MaxProposals = ConstU32<100>; type MaxMembers = CouncilDefaultMaxMembers; @@ -502,7 +510,7 @@ impl pallet_collective::Config for Runtime { } impl pallet_membership::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AddOrigin = EnsureRootOrTwoThirdsCouncil; type RemoveOrigin = EnsureRootOrTwoThirdsCouncil; type SwapOrigin = EnsureRootOrTwoThirdsCouncil; @@ -538,7 +546,7 @@ impl pallet_treasury::Config for Runtime { type Currency = Balances; type ApproveOrigin = EnsureRootOrTwoThirdsCouncil; type RejectOrigin = EnsureRootOrHalfCouncil; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSlash = Treasury; type ProposalBond = ProposalBond; type ProposalBondMinimum = ProposalBondMinimum; @@ -555,7 +563,7 @@ impl pallet_treasury::Config for Runtime { } impl pallet_bounties::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BountyDepositBase = BountyDepositBase; type BountyDepositPayoutDelay = BountyDepositPayoutDelay; type BountyUpdatePeriod = BountyUpdatePeriod; @@ -570,8 +578,8 @@ impl pallet_bounties::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } parameter_types! { @@ -580,7 +588,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -596,7 +604,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; // We use pallet_xcm to confirm the version of xcm @@ -608,7 +616,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -618,7 +626,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = ConvertInto; @@ -653,7 +661,7 @@ parameter_types! { } impl pallet_parachain_staking::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type MonetaryGovernanceOrigin = EnsureRoot; /// Minimum round length is 2 minutes (10 * 12 second block times) @@ -701,7 +709,7 @@ parameter_types! { } impl pallet_vesting::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; @@ -718,9 +726,9 @@ parameter_types! { } impl pallet_bridge::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BridgeCommitteeOrigin = EnsureRootOrHalfCouncil; - type Proposal = Call; + type Proposal = RuntimeCall; type BridgeChainId = BridgeChainId; type Currency = Balances; type ProposalLifetime = ProposalLifetime; @@ -754,7 +762,7 @@ impl SortedMembers for TransferNativeAnyone { } impl pallet_bridge_transfer::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BridgeOrigin = pallet_bridge::EnsureBridge; type TransferNativeMembers = TransferNativeAnyone; type SetMaximumIssuanceOrigin = EnsureRootOrHalfCouncil; @@ -769,7 +777,7 @@ parameter_types! { } impl pallet_drop3::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type PoolId = u64; type SetAdminOrigin = EnsureRootOrHalfCouncil; type Currency = Balances; @@ -779,7 +787,7 @@ impl pallet_drop3::Config for Runtime { } impl pallet_extrinsic_filter::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type UpdateOrigin = EnsureRootOrHalfTechnicalCommittee; type NormalModeFilter = NormalModeFilter; type SafeModeFilter = SafeModeFilter; @@ -864,15 +872,16 @@ construct_runtime! { } pub struct BaseCallFilter; -impl Contains for BaseCallFilter { - fn contains(call: &Call) -> bool { +impl Contains for BaseCallFilter { + fn contains(call: &RuntimeCall) -> bool { if matches!( call, - Call::Sudo(_) | - Call::System(_) | Call::Timestamp(_) | - Call::ParachainSystem(_) | - Call::ExtrinsicFilter(_) | - Call::Multisig(_) + RuntimeCall::Sudo(_) | + RuntimeCall::System(_) | + RuntimeCall::Timestamp(_) | + RuntimeCall::ParachainSystem(_) | + RuntimeCall::ExtrinsicFilter(_) | + RuntimeCall::Multisig(_) ) { // always allow core calls return true @@ -883,38 +892,38 @@ impl Contains for BaseCallFilter { } pub struct SafeModeFilter; -impl Contains for SafeModeFilter { - fn contains(_call: &Call) -> bool { +impl Contains for SafeModeFilter { + fn contains(_call: &RuntimeCall) -> bool { false } } pub struct NormalModeFilter; -impl Contains for NormalModeFilter { - fn contains(call: &Call) -> bool { +impl Contains for NormalModeFilter { + fn contains(call: &RuntimeCall) -> bool { matches!( call, // Vesting::vest - Call::Vesting(pallet_vesting::Call::vest { .. }) | + RuntimeCall::Vesting(pallet_vesting::Call::vest { .. }) | // ChainBridge - Call::ChainBridge(_) | + RuntimeCall::ChainBridge(_) | // BridgeTransfer - Call::BridgeTransfer(_) | + RuntimeCall::BridgeTransfer(_) | // Utility - Call::Utility(_) | + RuntimeCall::Utility(_) | // Session - Call::Session(_) | + RuntimeCall::Session(_) | // ParachainStaking; Only the collator part - Call::ParachainStaking(pallet_parachain_staking::Call::join_candidates { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::schedule_leave_candidates { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::execute_leave_candidates { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::cancel_leave_candidates { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::go_offline { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::go_online { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::candidate_bond_more { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::schedule_candidate_bond_less { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::execute_candidate_bond_less { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::cancel_candidate_bond_less { .. }) + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::join_candidates { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::schedule_leave_candidates { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::execute_leave_candidates { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::cancel_leave_candidates { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::go_offline { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::go_online { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::candidate_bond_more { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::schedule_candidate_bond_less { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::execute_candidate_bond_less { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::cancel_candidate_bond_less { .. }) ) } } diff --git a/runtime/litentry/src/tests/base_call_filter.rs b/runtime/litentry/src/tests/base_call_filter.rs index b32380e941..149aac49ad 100644 --- a/runtime/litentry/src/tests/base_call_filter.rs +++ b/runtime/litentry/src/tests/base_call_filter.rs @@ -14,11 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Litentry. If not, see . -use crate::{Call, Origin, Runtime}; +use crate::{Runtime, RuntimeCall, RuntimeOrigin}; runtime_common::run_call_filter_tests!(); #[test] fn balance_transfer_disabled() { - base_call_filter::balance_transfer_disabled::(); + base_call_filter::balance_transfer_disabled::(); } diff --git a/runtime/litentry/src/tests/mod.rs b/runtime/litentry/src/tests/mod.rs index b135f8d00d..eaba86f646 100644 --- a/runtime/litentry/src/tests/mod.rs +++ b/runtime/litentry/src/tests/mod.rs @@ -24,7 +24,7 @@ pub mod setup { } mod transaction_payment { - use crate::{Call, Origin, Runtime, TransactionByteFee}; + use crate::{Runtime, RuntimeCall, RuntimeOrigin, TransactionByteFee}; runtime_common::run_transaction_payment_tests!(); } @@ -32,11 +32,11 @@ mod transaction_payment { mod xcm_parachain { use crate::{ tests::setup::{ - Call as RelayCall, Origin as RelayOrigin, ParaA, ParaB, Relay, RelayChainRuntime, - TestNet, + ParaA, ParaB, Relay, RelayChainRuntime, RuntimeCall as RelayCall, + RuntimeOrigin as RelayOrigin, TestNet, }, xcm_config::{LocationToAccountId, UnitWeightCost}, - Call, Origin, Runtime, + Runtime, RuntimeCall, RuntimeOrigin, }; runtime_common::run_xcm_tests!(); diff --git a/runtime/litentry/src/tests/orml_xcm.rs b/runtime/litentry/src/tests/orml_xcm.rs index 3d14793a6b..ec180763a9 100644 --- a/runtime/litentry/src/tests/orml_xcm.rs +++ b/runtime/litentry/src/tests/orml_xcm.rs @@ -14,26 +14,28 @@ // You should have received a copy of the GNU General Public License // along with Litentry. If not, see . -use crate::{xcm_config::LocalOriginToLocation, Call, CouncilInstance, Origin, Runtime}; +use crate::{ + xcm_config::LocalOriginToLocation, CouncilInstance, Runtime, RuntimeCall, RuntimeOrigin, +}; use runtime_common::tests::orml_xcm; #[test] fn orml_xcm_root_works() { - orml_xcm::orml_xcm_root_works::(); + orml_xcm::orml_xcm_root_works::(); } #[test] fn orml_xcm_signed_works() { - orml_xcm::orml_xcm_signed_works::(); + orml_xcm::orml_xcm_signed_works::(); } #[test] fn orml_xcm_two_thirds_council_works() { orml_xcm::orml_xcm_two_thirds_councli_works::< Runtime, - Origin, + RuntimeOrigin, LocalOriginToLocation, - Call, + RuntimeCall, CouncilInstance, >(); } @@ -42,9 +44,9 @@ fn orml_xcm_two_thirds_council_works() { fn orml_xcm_one_four_council_works() { orml_xcm::orml_xcm_one_four_councli_works::< Runtime, - Origin, + RuntimeOrigin, LocalOriginToLocation, - Call, + RuntimeCall, CouncilInstance, >(); } @@ -53,15 +55,20 @@ fn orml_xcm_one_four_council_works() { fn orml_xcm_half_council_works() { orml_xcm::orml_xcm_half_councli_works::< Runtime, - Origin, + RuntimeOrigin, LocalOriginToLocation, - Call, + RuntimeCall, CouncilInstance, >(); } #[test] fn orml_xcm_member_works() { - orml_xcm::orml_xcm_member_works::( - ); + orml_xcm::orml_xcm_member_works::< + Runtime, + RuntimeOrigin, + LocalOriginToLocation, + RuntimeCall, + CouncilInstance, + >(); } diff --git a/runtime/litentry/src/tests/transaction_payment.rs b/runtime/litentry/src/tests/transaction_payment.rs index 8839e82e9b..0379ce22e5 100644 --- a/runtime/litentry/src/tests/transaction_payment.rs +++ b/runtime/litentry/src/tests/transaction_payment.rs @@ -16,7 +16,7 @@ use runtime_common::tests::transaction_payment; -use crate::{Call, Origin, Runtime, TransactionByteFee}; +use crate::{RuntimeCall, RuntimeOrigin, Runtime, TransactionByteFee}; #[test] fn multiplier_can_grow_from_zero() { @@ -25,5 +25,5 @@ fn multiplier_can_grow_from_zero() { #[test] fn transaction_payment_works() { - transaction_payment::transaction_payment_works::(); + transaction_payment::transaction_payment_works::(); } diff --git a/runtime/litentry/src/weights/pallet_proxy.rs b/runtime/litentry/src/weights/pallet_proxy.rs index ab6d4e574b..2ed7ae65a5 100644 --- a/runtime/litentry/src/weights/pallet_proxy.rs +++ b/runtime/litentry/src/weights/pallet_proxy.rs @@ -138,20 +138,18 @@ impl pallet_proxy::WeightInfo for WeightInfo { } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) - /// The range of component `p` is `[1, 31]`. - fn anonymous(p: u32, ) -> Weight { - Weight::from_ref_time(35_206_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(61_000 as u64).saturating_mul(p as u64)) + fn create_pure(p: u32, ) -> Weight { + Weight::from_ref_time(31_077_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(37_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) - /// The range of component `p` is `[0, 30]`. - fn kill_anonymous(p: u32, ) -> Weight { - Weight::from_ref_time(27_237_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(95_000 as u64).saturating_mul(p as u64)) + fn kill_pure(p: u32, ) -> Weight { + Weight::from_ref_time(24_657_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(87_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/litentry/src/xcm_config.rs b/runtime/litentry/src/xcm_config.rs index 5e341b9d2d..1c8c8cedbb 100644 --- a/runtime/litentry/src/xcm_config.rs +++ b/runtime/litentry/src/xcm_config.rs @@ -53,8 +53,8 @@ use runtime_common::{ use crate::tests::setup::ParachainXcmRouter; use super::{ - AssetId, AssetManager, Balance, Balances, Call, DealWithFees, Event, Origin, ParachainInfo, - PolkadotXcm, Runtime, Tokens, Treasury, + AssetId, AssetManager, Balance, Balances, DealWithFees, ParachainInfo, PolkadotXcm, Runtime, + RuntimeCall, RuntimeEvent, RuntimeOrigin, Tokens, Treasury, }; #[cfg(not(test))] use super::{ParachainSystem, XcmpQueue}; @@ -62,7 +62,7 @@ use super::{ParachainSystem, XcmpQueue}; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Any; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); } @@ -131,18 +131,18 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter; this just converts an `AccountId32` origin into a normal // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { @@ -205,11 +205,11 @@ pub type Traders = ( ); /// Xcm Weigher shared between multiple Xcm-related configs. -pub type XcmWeigher = FixedWeightBounds; +pub type XcmWeigher = FixedWeightBounds; pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = AssetTransactors; @@ -234,7 +234,7 @@ impl xcm_executor::Config for XcmConfig { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; #[cfg(test)] /// The mimic XcmRouter which only change storage locally for Xcm to digest. @@ -283,16 +283,16 @@ parameter_types! { } impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We allow anyone to send any XCM to anywhere // This is highly relied on if target chain properly filtered // Check their Barriers implementation // And for TakeWeightCredit // Check if their executor's ShouldExecute trait weight_credit type SendXcmOrigin = - FilterEnsureOrigin; + FilterEnsureOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Nothing; // ^ Disable dispatchable execute on the XCM pallet. // Needs to be `Everything` for local testing. @@ -303,20 +303,20 @@ impl pallet_xcm::Config for Runtime { type XcmReserveTransferFilter = Everything; type Weigher = XcmWeigher; type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // ^ Override for AdvertisedXcmVersion default type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } impl orml_xtokens::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; type AccountIdToMultiLocation = AccountIdToMultiLocation; diff --git a/runtime/litmus/Cargo.toml b/runtime/litmus/Cargo.toml index 0f9481e960..361125f40b 100644 --- a/runtime/litmus/Cargo.toml +++ b/runtime/litmus/Cargo.toml @@ -16,73 +16,73 @@ primitives = { path = "../../primitives", default-features = false } # Substrate Dependencies ## Substrate Primitive Dependencies -sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } ## Substrate FRAME Dependencies -frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.29" } +frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.30" } ## Substrate Pallet Dependencies -pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-bounties = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-preimage = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-bounties = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-preimage = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } # Cumulus dependencies -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } # Polkadot dependencies -pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } # Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } -orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } +orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } -cumulus-pallet-session-benchmarking = { git = 'https://github.com/paritytech/cumulus', default-features = false, branch = "polkadot-v0.9.29", optional = true } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29", optional = true } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29", optional = true } +cumulus-pallet-session-benchmarking = { git = 'https://github.com/paritytech/cumulus', default-features = false, branch = "polkadot-v0.9.30", optional = true } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30", optional = true } +frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30", optional = true } # Litmus pallets pallet-asset-manager = { path = "../../pallets/xcm-asset-manager", default-features = false } @@ -96,22 +96,22 @@ pallet-vc-management = { path = "../../pallets/vc-management", default-features runtime-common = { path = '../common', default-features = false } # TEE pallets -# TODO: change to `master`/`polkadot-v0.9.29` branch temporarily for aligning upstream codebase: tee-worker/#113 -pallet-sidechain = { git = "https://github.com/integritee-network/pallets.git", default-features = false, branch = "szp/polkadot-v0.9.29" } -pallet-teeracle = { git = "https://github.com/integritee-network/pallets.git", default-features = false, branch = "szp/polkadot-v0.9.29" } -pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", default-features = false, branch = "szp/polkadot-v0.9.29" } +# TODO: change to `master`/`polkadot-v0.9.30` branch temporarily for aligning upstream codebase: tee-worker/#113 +pallet-sidechain = { git = "https://github.com/litentry/integritee-pallets.git", branch = "polkadot-v0.9.30", default-features = false } +pallet-teeracle = { git = "https://github.com/litentry/integritee-pallets.git", branch = "polkadot-v0.9.30", default-features = false } +pallet-teerex = { git = "https://github.com/litentry/integritee-pallets.git", branch = "polkadot-v0.9.30", default-features = false } [dev-dependencies] -cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = "polkadot-v0.9.29" } +cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = "polkadot-v0.9.30" } hex-literal = "0.3.4" -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } runtime-common = { path = '../common', default-features = false, features = ["tests"] } -sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } +sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] @@ -197,7 +197,7 @@ runtime-benchmarks = [ "cumulus-pallet-session-benchmarking/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-asset-manager/runtime-benchmarks", "pallet-balances/runtime-benchmarks", diff --git a/runtime/litmus/src/asset_config.rs b/runtime/litmus/src/asset_config.rs index d4329e2540..012c6b3bbd 100644 --- a/runtime/litmus/src/asset_config.rs +++ b/runtime/litmus/src/asset_config.rs @@ -8,7 +8,7 @@ use sp_std::prelude::*; use runtime_common::{xcm_impl::CurrencyId, EnsureRootOrHalfCouncil}; use super::{ - weights, AccountId, Amount, AssetId, AssetManager, Balance, Balances, Event, Runtime, + weights, AccountId, Amount, AssetId, AssetManager, Balance, Balances, Runtime, RuntimeEvent, TreasuryPalletId, }; @@ -31,7 +31,7 @@ impl Contains for DustRemovalWhitelist { pub type ReserveIdentifier = [u8; 8]; impl orml_tokens::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type Amount = Amount; type CurrencyId = AssetId; @@ -45,10 +45,13 @@ impl orml_tokens::Config for Runtime { type WeightInfo = (); type OnNewTokenAccount = (); type OnKilledTokenAccount = (); + type OnTransfer = (); + type OnSlash = (); + type OnDeposit = (); } impl pallet_asset_manager::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type ForeignAssetType = CurrencyId; diff --git a/runtime/litmus/src/lib.rs b/runtime/litmus/src/lib.rs index 535d6fd786..a043bfd4a8 100644 --- a/runtime/litmus/src/lib.rs +++ b/runtime/litmus/src/lib.rs @@ -112,10 +112,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -172,7 +173,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -186,9 +187,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// Runtime version. @@ -226,8 +227,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -268,26 +269,33 @@ impl Default for ProxyType { } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, ProxyType::NonTransfer => !matches!( c, - Call::Balances(..) | Call::Vesting(pallet_vesting::Call::vested_transfer { .. }) + RuntimeCall::Balances(..) | + RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }) ), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility(..) | Call::Multisig(..) + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility(..) | + RuntimeCall::Multisig(..) + ), + ProxyType::Collator => matches!( + c, + RuntimeCall::CollatorSelection(..) | + RuntimeCall::Utility(..) | + RuntimeCall::Multisig(..) ), - ProxyType::Collator => - matches!(c, Call::CollatorSelection(..) | Call::Utility(..) | Call::Multisig(..)), ProxyType::Governance => matches!( c, - Call::Democracy(..) | - Call::Council(..) | Call::TechnicalCommittee(..) | - Call::Treasury(..) + RuntimeCall::Democracy(..) | + RuntimeCall::Council(..) | + RuntimeCall::TechnicalCommittee(..) | + RuntimeCall::Treasury(..) ), } } @@ -312,14 +320,14 @@ parameter_types! { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; type ProxyDepositFactor = ProxyDepositFactor; type MaxProxies = ConstU32<32>; - type WeightInfo = weights::pallet_proxy::WeightInfo; + type WeightInfo = (); type MaxPending = ConstU32<32>; type CallHasher = BlakeTwo256; type AnnouncementDepositBase = AnnouncementDepositBase; @@ -347,10 +355,10 @@ parameter_types! { } impl pallet_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type PalletsOrigin = OriginCaller; - type Call = Call; + type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRootOrAllCouncil; type MaxScheduledPerBlock = ConstU32<50>; @@ -367,7 +375,7 @@ parameter_types! { impl pallet_preimage::Config for Runtime { type WeightInfo = weights::pallet_preimage::WeightInfo; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRootOrAllCouncil; type MaxSize = PreimageMaxSize; @@ -383,7 +391,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -394,8 +402,8 @@ impl pallet_balances::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -407,7 +415,7 @@ parameter_types! { impl_runtime_transaction_payment_fees!(constants); impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = IdentityFee; @@ -428,8 +436,8 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = Call; - type Event = Event; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; type LaunchPeriod = LaunchPeriod; @@ -475,9 +483,9 @@ parameter_types! { } impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = CouncilMotionDuration; type MaxProposals = ConstU32<100>; type MaxMembers = CouncilDefaultMaxMembers; @@ -486,7 +494,7 @@ impl pallet_collective::Config for Runtime { } impl pallet_membership::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AddOrigin = EnsureRootOrTwoThirdsCouncil; type RemoveOrigin = EnsureRootOrTwoThirdsCouncil; type SwapOrigin = EnsureRootOrTwoThirdsCouncil; @@ -503,9 +511,9 @@ parameter_types! { } impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = TechnicalMotionDuration; type MaxProposals = ConstU32<100>; type MaxMembers = CouncilDefaultMaxMembers; @@ -514,7 +522,7 @@ impl pallet_collective::Config for Runtime { } impl pallet_membership::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AddOrigin = EnsureRootOrTwoThirdsCouncil; type RemoveOrigin = EnsureRootOrTwoThirdsCouncil; type SwapOrigin = EnsureRootOrTwoThirdsCouncil; @@ -550,7 +558,7 @@ impl pallet_treasury::Config for Runtime { type Currency = Balances; type ApproveOrigin = EnsureRootOrTwoThirdsCouncil; type RejectOrigin = EnsureRootOrHalfCouncil; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSlash = Treasury; type ProposalBond = ProposalBond; type ProposalBondMinimum = ProposalBondMinimum; @@ -567,7 +575,7 @@ impl pallet_treasury::Config for Runtime { } impl pallet_bounties::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BountyDepositBase = BountyDepositBase; type BountyDepositPayoutDelay = BountyDepositPayoutDelay; type BountyUpdatePeriod = BountyUpdatePeriod; @@ -587,7 +595,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -603,7 +611,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; // We use pallet_xcm to confirm the version of xcm @@ -615,7 +623,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRootOrAllCouncil; } @@ -626,7 +634,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -651,7 +659,7 @@ parameter_types! { } impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = EnsureRootOrHalfCouncil; type PotId = PotId; @@ -671,7 +679,7 @@ parameter_types! { } impl pallet_vesting::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; @@ -688,9 +696,9 @@ parameter_types! { } impl pallet_bridge::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BridgeCommitteeOrigin = EnsureRootOrHalfCouncil; - type Proposal = Call; + type Proposal = RuntimeCall; type BridgeChainId = BridgeChainId; type Currency = Balances; type ProposalLifetime = ProposalLifetime; @@ -724,7 +732,7 @@ impl SortedMembers for TransferNativeAnyone { } impl pallet_bridge_transfer::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BridgeOrigin = pallet_bridge::EnsureBridge; type TransferNativeMembers = TransferNativeAnyone; type SetMaximumIssuanceOrigin = EnsureRootOrHalfCouncil; @@ -739,7 +747,7 @@ parameter_types! { } impl pallet_drop3::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type PoolId = u64; type SetAdminOrigin = EnsureRootOrHalfCouncil; type Currency = Balances; @@ -749,7 +757,7 @@ impl pallet_drop3::Config for Runtime { } impl pallet_extrinsic_filter::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type UpdateOrigin = EnsureRootOrHalfTechnicalCommittee; #[cfg(feature = "tee-dev")] type NormalModeFilter = Everything; @@ -766,7 +774,7 @@ parameter_types! { } impl pallet_teerex::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type MomentsPerDay = MomentsPerDay; type MaxSilenceTime = MaxSilenceTime; @@ -774,19 +782,19 @@ impl pallet_teerex::Config for Runtime { } impl pallet_sidechain::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type EarlyBlockProposalLenience = ConstU64<100>; } impl pallet_teeracle::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type MaxWhitelistedReleases = ConstU32<10>; } impl pallet_identity_management::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type TEECallOrigin = EnsureEnclaveSigner; } @@ -796,7 +804,7 @@ ord_parameter_types! { } impl pallet_identity_management_mock::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ManageWhitelistOrigin = EnsureRootOrAllCouncil; type MaxVerificationDelay = ConstU32<10>; // intentionally use ALICE for the IMP mock @@ -804,7 +812,7 @@ impl pallet_identity_management_mock::Config for Runtime { } impl pallet_vc_management::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type TEECallOrigin = EnsureEnclaveSigner; } @@ -892,16 +900,17 @@ construct_runtime! { pub struct BaseCallFilter; -impl Contains for BaseCallFilter { - fn contains(call: &Call) -> bool { +impl Contains for BaseCallFilter { + fn contains(call: &RuntimeCall) -> bool { if matches!( call, - Call::System(_) | - Call::Timestamp(_) | - Call::ParachainSystem(_) | - Call::ExtrinsicFilter(_) | - Call::Multisig(_) | - Call::Council(_) | Call::TechnicalCommittee(_) + RuntimeCall::System(_) | + RuntimeCall::Timestamp(_) | + RuntimeCall::ParachainSystem(_) | + RuntimeCall::ExtrinsicFilter(_) | + RuntimeCall::Multisig(_) | + RuntimeCall::Council(_) | + RuntimeCall::TechnicalCommittee(_) ) { // always allow core calls return true @@ -913,37 +922,37 @@ impl Contains for BaseCallFilter { pub struct SafeModeFilter; -impl Contains for SafeModeFilter { - fn contains(_call: &Call) -> bool { +impl Contains for SafeModeFilter { + fn contains(_call: &RuntimeCall) -> bool { false } } pub struct NormalModeFilter; -impl Contains for NormalModeFilter { - fn contains(call: &Call) -> bool { +impl Contains for NormalModeFilter { + fn contains(call: &RuntimeCall) -> bool { matches!( call, // Vesting::vest - Call::Vesting(pallet_vesting::Call::vest { .. }) | + RuntimeCall::Vesting(pallet_vesting::Call::vest { .. }) | // ChainBridge - Call::ChainBridge(_) | + RuntimeCall::ChainBridge(_) | // BridgeTransfer - Call::BridgeTransfer(_) | + RuntimeCall::BridgeTransfer(_) | // XTokens::transfer for normal users - Call::XTokens(orml_xtokens::Call::transfer { .. }) | + RuntimeCall::XTokens(orml_xtokens::Call::transfer { .. }) | // memberships - Call::CouncilMembership(_) | - Call::TechnicalCommitteeMembership(_) | + RuntimeCall::CouncilMembership(_) | + RuntimeCall::TechnicalCommitteeMembership(_) | // democracy, we don't subdivide the calls, so we allow public proposals - Call::Democracy(_) | + RuntimeCall::Democracy(_) | // Utility - Call::Utility(_) | + RuntimeCall::Utility(_) | // Session - Call::Session(_) | + RuntimeCall::Session(_) | // Balance - Call::Balances(_) + RuntimeCall::Balances(_) ) } } diff --git a/runtime/litmus/src/tests/base_call_filter.rs b/runtime/litmus/src/tests/base_call_filter.rs index 0bedeea497..7da2e27f8a 100644 --- a/runtime/litmus/src/tests/base_call_filter.rs +++ b/runtime/litmus/src/tests/base_call_filter.rs @@ -14,11 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Litentry. If not, see . -use crate::{Call, Origin, Runtime}; +use crate::{Runtime, RuntimeCall, RuntimeOrigin}; runtime_common::run_call_filter_tests!(); #[test] fn balance_transfer_works() { - base_call_filter::balance_transfer_works::(); + base_call_filter::balance_transfer_works::(); } diff --git a/runtime/litmus/src/tests/mod.rs b/runtime/litmus/src/tests/mod.rs index b135f8d00d..eaba86f646 100644 --- a/runtime/litmus/src/tests/mod.rs +++ b/runtime/litmus/src/tests/mod.rs @@ -24,7 +24,7 @@ pub mod setup { } mod transaction_payment { - use crate::{Call, Origin, Runtime, TransactionByteFee}; + use crate::{Runtime, RuntimeCall, RuntimeOrigin, TransactionByteFee}; runtime_common::run_transaction_payment_tests!(); } @@ -32,11 +32,11 @@ mod transaction_payment { mod xcm_parachain { use crate::{ tests::setup::{ - Call as RelayCall, Origin as RelayOrigin, ParaA, ParaB, Relay, RelayChainRuntime, - TestNet, + ParaA, ParaB, Relay, RelayChainRuntime, RuntimeCall as RelayCall, + RuntimeOrigin as RelayOrigin, TestNet, }, xcm_config::{LocationToAccountId, UnitWeightCost}, - Call, Origin, Runtime, + Runtime, RuntimeCall, RuntimeOrigin, }; runtime_common::run_xcm_tests!(); diff --git a/runtime/litmus/src/tests/orml_xcm.rs b/runtime/litmus/src/tests/orml_xcm.rs index 3d14793a6b..ec180763a9 100644 --- a/runtime/litmus/src/tests/orml_xcm.rs +++ b/runtime/litmus/src/tests/orml_xcm.rs @@ -14,26 +14,28 @@ // You should have received a copy of the GNU General Public License // along with Litentry. If not, see . -use crate::{xcm_config::LocalOriginToLocation, Call, CouncilInstance, Origin, Runtime}; +use crate::{ + xcm_config::LocalOriginToLocation, CouncilInstance, Runtime, RuntimeCall, RuntimeOrigin, +}; use runtime_common::tests::orml_xcm; #[test] fn orml_xcm_root_works() { - orml_xcm::orml_xcm_root_works::(); + orml_xcm::orml_xcm_root_works::(); } #[test] fn orml_xcm_signed_works() { - orml_xcm::orml_xcm_signed_works::(); + orml_xcm::orml_xcm_signed_works::(); } #[test] fn orml_xcm_two_thirds_council_works() { orml_xcm::orml_xcm_two_thirds_councli_works::< Runtime, - Origin, + RuntimeOrigin, LocalOriginToLocation, - Call, + RuntimeCall, CouncilInstance, >(); } @@ -42,9 +44,9 @@ fn orml_xcm_two_thirds_council_works() { fn orml_xcm_one_four_council_works() { orml_xcm::orml_xcm_one_four_councli_works::< Runtime, - Origin, + RuntimeOrigin, LocalOriginToLocation, - Call, + RuntimeCall, CouncilInstance, >(); } @@ -53,15 +55,20 @@ fn orml_xcm_one_four_council_works() { fn orml_xcm_half_council_works() { orml_xcm::orml_xcm_half_councli_works::< Runtime, - Origin, + RuntimeOrigin, LocalOriginToLocation, - Call, + RuntimeCall, CouncilInstance, >(); } #[test] fn orml_xcm_member_works() { - orml_xcm::orml_xcm_member_works::( - ); + orml_xcm::orml_xcm_member_works::< + Runtime, + RuntimeOrigin, + LocalOriginToLocation, + RuntimeCall, + CouncilInstance, + >(); } diff --git a/runtime/litmus/src/weights/pallet_proxy.rs b/runtime/litmus/src/weights/pallet_proxy.rs index 5f2b5a708c..ffc96754ba 100644 --- a/runtime/litmus/src/weights/pallet_proxy.rs +++ b/runtime/litmus/src/weights/pallet_proxy.rs @@ -138,19 +138,17 @@ impl pallet_proxy::WeightInfo for WeightInfo { } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) - /// The range of component `p` is `[1, 31]`. - fn anonymous(p: u32, ) -> Weight { - Weight::from_ref_time(35_540_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(48_000 as u64).saturating_mul(p as u64)) + fn create_pure(p: u32, ) -> Weight { + Weight::from_ref_time(31_077_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(37_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) - /// The range of component `p` is `[0, 30]`. - fn kill_anonymous(p: u32, ) -> Weight { - Weight::from_ref_time(27_686_000 as u64) - // Standard Error: 1_000 + fn kill_pure(p: u32, ) -> Weight { + Weight::from_ref_time(24_657_000 as u64) + // Standard Error: 2_000 .saturating_add(Weight::from_ref_time(87_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) diff --git a/runtime/litmus/src/xcm_config.rs b/runtime/litmus/src/xcm_config.rs index d04d8c29d0..dbec3efa30 100644 --- a/runtime/litmus/src/xcm_config.rs +++ b/runtime/litmus/src/xcm_config.rs @@ -52,8 +52,8 @@ use runtime_common::{ use crate::tests::setup::ParachainXcmRouter; use super::{ - AssetId, AssetManager, Balance, Balances, Call, DealWithFees, Event, Origin, ParachainInfo, - PolkadotXcm, Runtime, Tokens, Treasury, + AssetId, AssetManager, Balance, Balances, DealWithFees, ParachainInfo, PolkadotXcm, Runtime, + RuntimeCall, RuntimeEvent, RuntimeOrigin, Tokens, Treasury, }; #[cfg(not(test))] use super::{ParachainSystem, XcmpQueue}; @@ -61,7 +61,7 @@ use super::{ParachainSystem, XcmpQueue}; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Any; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); } @@ -130,18 +130,18 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter; this just converts an `AccountId32` origin into a normal // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { @@ -204,11 +204,11 @@ pub type Traders = ( ); /// Xcm Weigher shared between multiple Xcm-related configs. -pub type XcmWeigher = FixedWeightBounds; +pub type XcmWeigher = FixedWeightBounds; pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = AssetTransactors; @@ -233,7 +233,7 @@ impl xcm_executor::Config for XcmConfig { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; #[cfg(test)] /// The mimic XcmRouter which only change storage locally for Xcm to digest. @@ -282,16 +282,16 @@ parameter_types! { } impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We allow anyone to send any XCM to anywhere // This is highly relied on if target chain properly filtered // Check their Barriers implementation // And for TakeWeightCredit // Check if their executor's ShouldExecute trait weight_credit type SendXcmOrigin = - FilterEnsureOrigin; + FilterEnsureOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Nothing; // ^ Disable dispatchable execute on the XCM pallet. // Needs to be `Everything` for local testing. @@ -302,20 +302,20 @@ impl pallet_xcm::Config for Runtime { type XcmReserveTransferFilter = Everything; type Weigher = XcmWeigher; type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // ^ Override for AdvertisedXcmVersion default type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } impl orml_xtokens::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; type AccountIdToMultiLocation = AccountIdToMultiLocation; diff --git a/runtime/rococo/Cargo.toml b/runtime/rococo/Cargo.toml index 2a9fdfcda6..08bf494ca6 100644 --- a/runtime/rococo/Cargo.toml +++ b/runtime/rococo/Cargo.toml @@ -16,75 +16,75 @@ primitives = { path = "../../primitives", default-features = false } # Substrate Dependencies ## Substrate Primitive Dependencies -sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } ## Substrate FRAME Dependencies -frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.29" } +frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.30" } ## Substrate Pallet Dependencies -pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-bounties = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-preimage = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-tips = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } -pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-bounties = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-preimage = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-tips = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } +pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" } # Cumulus dependencies -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } -parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.29" } +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } +parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.30" } # Polkadot dependencies -pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.30" } # Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } -orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.29" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } +orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.30" } # benchmarking -cumulus-pallet-session-benchmarking = { git = 'https://github.com/paritytech/cumulus', default-features = false, branch = "polkadot-v0.9.29", optional = true } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29", optional = true } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29", optional = true } +cumulus-pallet-session-benchmarking = { git = 'https://github.com/paritytech/cumulus', default-features = false, branch = "polkadot-v0.9.30", optional = true } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30", optional = true } +frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30", optional = true } # Rococo pallets pallet-asset-manager = { path = "../../pallets/xcm-asset-manager", default-features = false } @@ -99,22 +99,22 @@ pallet-vc-management = { path = "../../pallets/vc-management", default-features runtime-common = { path = '../common', default-features = false } # TEE pallets -# TODO: change to `master`\`polkadot-v0.9.29` branch temporarily for aligning upstream codebase: tee-worker/#113 -pallet-sidechain = { git = "https://github.com/integritee-network/pallets.git", default-features = false, branch = "szp/polkadot-v0.9.29" } -pallet-teeracle = { git = "https://github.com/integritee-network/pallets.git", default-features = false, branch = "szp/polkadot-v0.9.29" } -pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", default-features = false, branch = "szp/polkadot-v0.9.29" } +# TODO: change to `master`\`polkadot-v0.9.30` branch temporarily for aligning upstream codebase: tee-worker/#113 +pallet-sidechain = { git = "https://github.com/litentry/integritee-pallets.git", branch = "polkadot-v0.9.30", default-features = false } +pallet-teeracle = { git = "https://github.com/litentry/integritee-pallets.git", branch = "polkadot-v0.9.30", default-features = false } +pallet-teerex = { git = "https://github.com/litentry/integritee-pallets.git", branch = "polkadot-v0.9.30", default-features = false } [dev-dependencies] -cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = "polkadot-v0.9.29" } +cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = "polkadot-v0.9.30" } hex-literal = "0.3.4" -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } runtime-common = { path = '../common', default-features = false, features = ["tests"] } -sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" } +sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30" } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] @@ -123,7 +123,7 @@ runtime-benchmarks = [ "cumulus-pallet-session-benchmarking/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-asset-manager/runtime-benchmarks", "pallet-balances/runtime-benchmarks", diff --git a/runtime/rococo/src/asset_config.rs b/runtime/rococo/src/asset_config.rs index 98fb34b28d..7ba4107e46 100644 --- a/runtime/rococo/src/asset_config.rs +++ b/runtime/rococo/src/asset_config.rs @@ -1,5 +1,5 @@ use super::{ - weights, AccountId, Amount, AssetId, AssetManager, Balance, Balances, Event, Runtime, + weights, AccountId, Amount, AssetId, AssetManager, Balance, Balances, Runtime, RuntimeEvent, TreasuryPalletId, }; use frame_support::{ @@ -29,7 +29,7 @@ impl Contains for DustRemovalWhitelist { pub type ReserveIdentifier = [u8; 8]; impl orml_tokens::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type Amount = Amount; type CurrencyId = AssetId; @@ -43,10 +43,13 @@ impl orml_tokens::Config for Runtime { type WeightInfo = (); type OnNewTokenAccount = (); type OnKilledTokenAccount = (); + type OnTransfer = (); + type OnSlash = (); + type OnDeposit = (); } impl pallet_asset_manager::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type ForeignAssetType = CurrencyId; diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 92abfedf7e..e580b702ee 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -111,10 +111,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -173,7 +174,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -187,9 +188,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// Runtime version. @@ -227,8 +228,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -269,26 +270,33 @@ impl Default for ProxyType { } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, ProxyType::NonTransfer => !matches!( c, - Call::Balances(..) | Call::Vesting(pallet_vesting::Call::vested_transfer { .. }) + RuntimeCall::Balances(..) | + RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }) ), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility(..) | Call::Multisig(..) + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility(..) | + RuntimeCall::Multisig(..) + ), + ProxyType::Collator => matches!( + c, + RuntimeCall::ParachainStaking(..) | + RuntimeCall::Utility(..) | + RuntimeCall::Multisig(..) ), - ProxyType::Collator => - matches!(c, Call::ParachainStaking(..) | Call::Utility(..) | Call::Multisig(..)), ProxyType::Governance => matches!( c, - Call::Democracy(..) | - Call::Council(..) | Call::TechnicalCommittee(..) | - Call::Treasury(..) + RuntimeCall::Democracy(..) | + RuntimeCall::Council(..) | + RuntimeCall::TechnicalCommittee(..) | + RuntimeCall::Treasury(..) ), } } @@ -313,14 +321,14 @@ parameter_types! { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; type ProxyDepositFactor = ProxyDepositFactor; type MaxProxies = ConstU32<32>; - type WeightInfo = weights::pallet_proxy::WeightInfo; + type WeightInfo = (); type MaxPending = ConstU32<32>; type CallHasher = BlakeTwo256; type AnnouncementDepositBase = AnnouncementDepositBase; @@ -348,10 +356,10 @@ parameter_types! { } impl pallet_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type PalletsOrigin = OriginCaller; - type Call = Call; + type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; type MaxScheduledPerBlock = ConstU32<50>; @@ -368,7 +376,7 @@ parameter_types! { impl pallet_preimage::Config for Runtime { type WeightInfo = weights::pallet_preimage::WeightInfo; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; type MaxSize = PreimageMaxSize; @@ -384,7 +392,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -395,8 +403,8 @@ impl pallet_balances::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = (); } @@ -407,7 +415,7 @@ parameter_types! { impl_runtime_transaction_payment_fees!(constants); impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = IdentityFee; @@ -428,8 +436,8 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = Call; - type Event = Event; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; type LaunchPeriod = LaunchPeriod; @@ -475,9 +483,9 @@ parameter_types! { } impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = CouncilMotionDuration; type MaxProposals = ConstU32<100>; type MaxMembers = CouncilDefaultMaxMembers; @@ -486,7 +494,7 @@ impl pallet_collective::Config for Runtime { } impl pallet_membership::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AddOrigin = EnsureRootOrTwoThirdsCouncil; type RemoveOrigin = EnsureRootOrTwoThirdsCouncil; type SwapOrigin = EnsureRootOrTwoThirdsCouncil; @@ -503,9 +511,9 @@ parameter_types! { } impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = TechnicalMotionDuration; type MaxProposals = ConstU32<100>; type MaxMembers = CouncilDefaultMaxMembers; @@ -514,7 +522,7 @@ impl pallet_collective::Config for Runtime { } impl pallet_membership::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AddOrigin = EnsureRootOrTwoThirdsCouncil; type RemoveOrigin = EnsureRootOrTwoThirdsCouncil; type SwapOrigin = EnsureRootOrTwoThirdsCouncil; @@ -553,7 +561,7 @@ impl pallet_treasury::Config for Runtime { type Currency = Balances; type ApproveOrigin = EnsureRootOrTwoThirdsCouncil; type RejectOrigin = EnsureRootOrHalfCouncil; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSlash = Treasury; type ProposalBond = ProposalBond; type ProposalBondMinimum = ProposalBondMinimum; @@ -594,7 +602,7 @@ impl ContainsLengthBound for CouncilProvider { } impl pallet_bounties::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BountyDepositBase = BountyDepositBase; type BountyDepositPayoutDelay = BountyDepositPayoutDelay; type BountyUpdatePeriod = BountyUpdatePeriod; @@ -609,7 +617,7 @@ impl pallet_bounties::Config for Runtime { } impl pallet_tips::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DataDepositPerByte = DataDepositPerByte; type MaximumReasonLength = MaximumReasonLength; type Tippers = CouncilProvider; @@ -620,8 +628,8 @@ impl pallet_tips::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } parameter_types! { @@ -630,7 +638,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -646,7 +654,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; // We use pallet_xcm to confirm the version of xcm @@ -658,7 +666,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -668,7 +676,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = ConvertInto; @@ -699,7 +707,7 @@ parameter_types! { } impl pallet_parachain_staking::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type MonetaryGovernanceOrigin = EnsureRoot; /// Minimum round length is 2 minutes (10 * 12 second block times) @@ -747,7 +755,7 @@ parameter_types! { } impl pallet_vesting::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; @@ -764,9 +772,9 @@ parameter_types! { } impl pallet_bridge::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BridgeCommitteeOrigin = EnsureRootOrHalfCouncil; - type Proposal = Call; + type Proposal = RuntimeCall; type BridgeChainId = BridgeChainId; type Currency = Balances; type ProposalLifetime = ProposalLifetime; @@ -799,7 +807,7 @@ impl SortedMembers for TransferNativeAnyone { } impl pallet_bridge_transfer::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BridgeOrigin = pallet_bridge::EnsureBridge; type TransferNativeMembers = TransferNativeAnyone; type SetMaximumIssuanceOrigin = EnsureRootOrHalfCouncil; @@ -814,7 +822,7 @@ parameter_types! { } impl pallet_drop3::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type PoolId = u64; type SetAdminOrigin = EnsureRootOrHalfCouncil; type Currency = Balances; @@ -824,7 +832,7 @@ impl pallet_drop3::Config for Runtime { } impl pallet_extrinsic_filter::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type UpdateOrigin = EnsureRootOrHalfTechnicalCommittee; #[cfg(feature = "tee-dev")] type NormalModeFilter = Everything; @@ -841,7 +849,7 @@ parameter_types! { } impl pallet_teerex::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type MomentsPerDay = MomentsPerDay; type MaxSilenceTime = MaxSilenceTime; @@ -849,19 +857,19 @@ impl pallet_teerex::Config for Runtime { } impl pallet_sidechain::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type EarlyBlockProposalLenience = ConstU64<100>; } impl pallet_teeracle::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type MaxWhitelistedReleases = ConstU32<10>; } impl pallet_identity_management::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type TEECallOrigin = EnsureEnclaveSigner; } @@ -871,7 +879,7 @@ ord_parameter_types! { } impl pallet_identity_management_mock::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ManageWhitelistOrigin = EnsureRoot; type MaxVerificationDelay = ConstU32<10>; // intentionally use ALICE for the IMP mock @@ -879,7 +887,7 @@ impl pallet_identity_management_mock::Config for Runtime { } impl pallet_vc_management::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type TEECallOrigin = EnsureEnclaveSigner; } @@ -971,16 +979,18 @@ construct_runtime! { } pub struct BaseCallFilter; -impl Contains for BaseCallFilter { - fn contains(call: &Call) -> bool { +impl Contains for BaseCallFilter { + fn contains(call: &RuntimeCall) -> bool { if matches!( call, - Call::Sudo(_) | - Call::System(_) | Call::Timestamp(_) | - Call::ParachainSystem(_) | - Call::ExtrinsicFilter(_) | - Call::Multisig(_) | - Call::Council(_) | Call::TechnicalCommittee(_) + RuntimeCall::Sudo(_) | + RuntimeCall::System(_) | + RuntimeCall::Timestamp(_) | + RuntimeCall::ParachainSystem(_) | + RuntimeCall::ExtrinsicFilter(_) | + RuntimeCall::Multisig(_) | + RuntimeCall::Council(_) | + RuntimeCall::TechnicalCommittee(_) ) { // always allow core calls return true @@ -991,52 +1001,52 @@ impl Contains for BaseCallFilter { } pub struct SafeModeFilter; -impl Contains for SafeModeFilter { - fn contains(_call: &Call) -> bool { +impl Contains for SafeModeFilter { + fn contains(_call: &RuntimeCall) -> bool { false } } pub struct NormalModeFilter; -impl Contains for NormalModeFilter { - fn contains(call: &Call) -> bool { +impl Contains for NormalModeFilter { + fn contains(call: &RuntimeCall) -> bool { matches!( call, // Vesting::vest - Call::Vesting(pallet_vesting::Call::vest { .. }) | + RuntimeCall::Vesting(pallet_vesting::Call::vest { .. }) | // ChainBridge - Call::ChainBridge(_) | + RuntimeCall::ChainBridge(_) | // BridgeTransfer - Call::BridgeTransfer(_) | + RuntimeCall::BridgeTransfer(_) | // XTokens::transfer for normal users - Call::XTokens(orml_xtokens::Call::transfer { .. }) | + RuntimeCall::XTokens(orml_xtokens::Call::transfer { .. }) | // memberships - Call::CouncilMembership(_) | - Call::TechnicalCommitteeMembership(_) | + RuntimeCall::CouncilMembership(_) | + RuntimeCall::TechnicalCommitteeMembership(_) | // democracy, we don't subdivide the calls, so we allow public proposals - Call::Democracy(_) | + RuntimeCall::Democracy(_) | // Utility - Call::Utility(_) | + RuntimeCall::Utility(_) | // Seesion - Call::Session(_) | + RuntimeCall::Session(_) | // Balance - Call::Balances(_) | + RuntimeCall::Balances(_) | // IMP Mock, only allowed on rococo for testing // we should use `tee-dev` branch if we want to test it on Litmus - Call::IdentityManagementMock(_) | - Call::IdentityManagement(_) | - Call::VCManagement(_) | + RuntimeCall::IdentityManagementMock(_) | + RuntimeCall::IdentityManagement(_) | + RuntimeCall::VCManagement(_) | // ParachainStaking; Only the collator part - Call::ParachainStaking(pallet_parachain_staking::Call::join_candidates { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::schedule_leave_candidates { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::execute_leave_candidates { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::cancel_leave_candidates { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::go_offline { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::go_online { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::candidate_bond_more { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::schedule_candidate_bond_less { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::execute_candidate_bond_less { .. }) | - Call::ParachainStaking(pallet_parachain_staking::Call::cancel_candidate_bond_less { .. }) + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::join_candidates { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::schedule_leave_candidates { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::execute_leave_candidates { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::cancel_leave_candidates { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::go_offline { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::go_online { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::candidate_bond_more { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::schedule_candidate_bond_less { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::execute_candidate_bond_less { .. }) | + RuntimeCall::ParachainStaking(pallet_parachain_staking::Call::cancel_candidate_bond_less { .. }) ) } } diff --git a/runtime/rococo/src/tests/base_call_filter.rs b/runtime/rococo/src/tests/base_call_filter.rs index 0bedeea497..7da2e27f8a 100644 --- a/runtime/rococo/src/tests/base_call_filter.rs +++ b/runtime/rococo/src/tests/base_call_filter.rs @@ -14,11 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Litentry. If not, see . -use crate::{Call, Origin, Runtime}; +use crate::{Runtime, RuntimeCall, RuntimeOrigin}; runtime_common::run_call_filter_tests!(); #[test] fn balance_transfer_works() { - base_call_filter::balance_transfer_works::(); + base_call_filter::balance_transfer_works::(); } diff --git a/runtime/rococo/src/tests/mod.rs b/runtime/rococo/src/tests/mod.rs index b135f8d00d..eaba86f646 100644 --- a/runtime/rococo/src/tests/mod.rs +++ b/runtime/rococo/src/tests/mod.rs @@ -24,7 +24,7 @@ pub mod setup { } mod transaction_payment { - use crate::{Call, Origin, Runtime, TransactionByteFee}; + use crate::{Runtime, RuntimeCall, RuntimeOrigin, TransactionByteFee}; runtime_common::run_transaction_payment_tests!(); } @@ -32,11 +32,11 @@ mod transaction_payment { mod xcm_parachain { use crate::{ tests::setup::{ - Call as RelayCall, Origin as RelayOrigin, ParaA, ParaB, Relay, RelayChainRuntime, - TestNet, + ParaA, ParaB, Relay, RelayChainRuntime, RuntimeCall as RelayCall, + RuntimeOrigin as RelayOrigin, TestNet, }, xcm_config::{LocationToAccountId, UnitWeightCost}, - Call, Origin, Runtime, + Runtime, RuntimeCall, RuntimeOrigin, }; runtime_common::run_xcm_tests!(); diff --git a/runtime/rococo/src/tests/orml_xcm.rs b/runtime/rococo/src/tests/orml_xcm.rs index 3d14793a6b..ec180763a9 100644 --- a/runtime/rococo/src/tests/orml_xcm.rs +++ b/runtime/rococo/src/tests/orml_xcm.rs @@ -14,26 +14,28 @@ // You should have received a copy of the GNU General Public License // along with Litentry. If not, see . -use crate::{xcm_config::LocalOriginToLocation, Call, CouncilInstance, Origin, Runtime}; +use crate::{ + xcm_config::LocalOriginToLocation, CouncilInstance, Runtime, RuntimeCall, RuntimeOrigin, +}; use runtime_common::tests::orml_xcm; #[test] fn orml_xcm_root_works() { - orml_xcm::orml_xcm_root_works::(); + orml_xcm::orml_xcm_root_works::(); } #[test] fn orml_xcm_signed_works() { - orml_xcm::orml_xcm_signed_works::(); + orml_xcm::orml_xcm_signed_works::(); } #[test] fn orml_xcm_two_thirds_council_works() { orml_xcm::orml_xcm_two_thirds_councli_works::< Runtime, - Origin, + RuntimeOrigin, LocalOriginToLocation, - Call, + RuntimeCall, CouncilInstance, >(); } @@ -42,9 +44,9 @@ fn orml_xcm_two_thirds_council_works() { fn orml_xcm_one_four_council_works() { orml_xcm::orml_xcm_one_four_councli_works::< Runtime, - Origin, + RuntimeOrigin, LocalOriginToLocation, - Call, + RuntimeCall, CouncilInstance, >(); } @@ -53,15 +55,20 @@ fn orml_xcm_one_four_council_works() { fn orml_xcm_half_council_works() { orml_xcm::orml_xcm_half_councli_works::< Runtime, - Origin, + RuntimeOrigin, LocalOriginToLocation, - Call, + RuntimeCall, CouncilInstance, >(); } #[test] fn orml_xcm_member_works() { - orml_xcm::orml_xcm_member_works::( - ); + orml_xcm::orml_xcm_member_works::< + Runtime, + RuntimeOrigin, + LocalOriginToLocation, + RuntimeCall, + CouncilInstance, + >(); } diff --git a/runtime/rococo/src/weights/pallet_proxy.rs b/runtime/rococo/src/weights/pallet_proxy.rs index 50f46d295b..c6e3b8fac1 100644 --- a/runtime/rococo/src/weights/pallet_proxy.rs +++ b/runtime/rococo/src/weights/pallet_proxy.rs @@ -138,20 +138,18 @@ impl pallet_proxy::WeightInfo for WeightInfo { } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) - /// The range of component `p` is `[1, 31]`. - fn anonymous(p: u32, ) -> Weight { - Weight::from_ref_time(36_474_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(50_000 as u64).saturating_mul(p as u64)) + fn create_pure(p: u32, ) -> Weight { + Weight::from_ref_time(31_077_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(37_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Proxy Proxies (r:1 w:1) - /// The range of component `p` is `[0, 30]`. - fn kill_anonymous(p: u32, ) -> Weight { - Weight::from_ref_time(28_567_000 as u64) + fn kill_pure(p: u32, ) -> Weight { + Weight::from_ref_time(24_657_000 as u64) // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(89_000 as u64).saturating_mul(p as u64)) + .saturating_add(Weight::from_ref_time(87_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/rococo/src/xcm_config.rs b/runtime/rococo/src/xcm_config.rs index 0717b04223..6ea329e4c4 100644 --- a/runtime/rococo/src/xcm_config.rs +++ b/runtime/rococo/src/xcm_config.rs @@ -52,8 +52,8 @@ use xcm_executor::{traits::JustTry, XcmExecutor}; use crate::tests::setup::ParachainXcmRouter; use super::{ - AssetId, AssetManager, Balance, Balances, Call, DealWithFees, Event, Origin, ParachainInfo, - PolkadotXcm, Runtime, Tokens, Treasury, + AssetId, AssetManager, Balance, Balances, DealWithFees, ParachainInfo, PolkadotXcm, Runtime, + RuntimeCall, RuntimeEvent, RuntimeOrigin, Tokens, Treasury, }; #[cfg(not(test))] use super::{ParachainSystem, XcmpQueue}; @@ -61,7 +61,7 @@ use super::{ParachainSystem, XcmpQueue}; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Any; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); } @@ -130,18 +130,18 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter; this just converts an `AccountId32` origin into a normal // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { @@ -204,11 +204,11 @@ pub type Traders = ( ); /// Xcm Weigher shared between multiple Xcm-related configs. -pub type XcmWeigher = FixedWeightBounds; +pub type XcmWeigher = FixedWeightBounds; pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = AssetTransactors; @@ -233,7 +233,7 @@ impl xcm_executor::Config for XcmConfig { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; #[cfg(test)] /// The mimic XcmRouter which only change storage locally for Xcm to digest. @@ -282,16 +282,16 @@ parameter_types! { } impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We allow anyone to send any XCM to anywhere // This is highly relied on if target chain properly filtered // Check their Barriers implementation // And for TakeWeightCredit // Check if their executor's ShouldExecute trait weight_credit type SendXcmOrigin = - FilterEnsureOrigin; + FilterEnsureOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Nothing; // ^ Disable dispatchable execute on the XCM pallet. // Needs to be `Everything` for local testing. @@ -302,20 +302,20 @@ impl pallet_xcm::Config for Runtime { type XcmReserveTransferFilter = Everything; type Weigher = XcmWeigher; type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // ^ Override for AdvertisedXcmVersion default type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } impl orml_xtokens::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; type AccountIdToMultiLocation = AccountIdToMultiLocation;