diff --git a/Cargo.lock b/Cargo.lock index eba01d6141..4d0a464a0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,6 +110,12 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +[[package]] +name = "always-assert" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4436e0292ab1bb631b42973c61205e704475fe8126af845c8d923c0996328127" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -204,7 +210,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "074b80d14d0240b6ce94d68f059a2d26a5d77280ae142662365a21ef6e2594ef" dependencies = [ "include_dir", - "itertools", + "itertools 0.10.5", "proc-macro-error", "proc-macro2", "quote", @@ -246,7 +252,7 @@ dependencies = [ "ark-std", "derivative", "hashbrown 0.13.2", - "itertools", + "itertools 0.10.5", "num-traits", "zeroize", ] @@ -263,7 +269,7 @@ dependencies = [ "ark-std", "derivative", "digest 0.10.7", - "itertools", + "itertools 0.10.5", "num-bigint", "num-traits", "paste", @@ -415,16 +421,33 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "asset-hub-kusama-emulated-chain" +version = "0.0.0" +dependencies = [ + "asset-hub-kusama-runtime", + "cumulus-primitives-core", + "emulated-integration-tests-common", + "frame-support", + "kusama-emulated-chain", + "parachains-common", + "serde_json", + "sp-core", + "sp-runtime", + "system-parachains-constants", +] + [[package]] name = "asset-hub-kusama-integration-tests" -version = "1.0.0" +version = "0.1.0" dependencies = [ "assert_matches", "asset-hub-kusama-runtime", "asset-test-utils", - "emulated-chains", + "emulated-integration-tests-common", "frame-support", - "integration-tests-common", + "integration-tests-helpers", + "kusama-system-emulated-network", "pallet-asset-conversion", "pallet-assets", "pallet-balances", @@ -437,7 +460,6 @@ dependencies = [ "staging-xcm", "staging-xcm-executor", "system-parachains-constants", - "xcm-emulator", ] [[package]] @@ -523,27 +545,48 @@ dependencies = [ "system-parachains-constants", ] +[[package]] +name = "asset-hub-polkadot-emulated-chain" +version = "0.0.0" +dependencies = [ + "asset-hub-polkadot-runtime", + "cumulus-primitives-core", + "emulated-integration-tests-common", + "frame-support", + "parachains-common", + "polkadot-emulated-chain", + "serde_json", + "sp-core", + "sp-runtime", + "system-parachains-constants", +] + [[package]] name = "asset-hub-polkadot-integration-tests" -version = "1.0.0" +version = "0.1.0" dependencies = [ + "assert_matches", "asset-hub-polkadot-runtime", "asset-test-utils", - "emulated-chains", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcmp-queue", + "emulated-integration-tests-common", "frame-support", - "integration-tests-common", + "integration-tests-helpers", "pallet-assets", "pallet-balances", "pallet-message-queue", + "pallet-treasury", "pallet-xcm", "parachains-common", "parity-scale-codec", "polkadot-runtime", + "polkadot-runtime-common", + "polkadot-system-emulated-network", "sp-runtime", "staging-xcm", "staging-xcm-executor", "system-parachains-constants", - "xcm-emulator", ] [[package]] @@ -710,7 +753,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 0.38.28", + "rustix 0.38.31", "slab", "tracing", "windows-sys 0.52.0", @@ -839,6 +882,27 @@ dependencies = [ "serde", ] +[[package]] +name = "bindgen" +version = "0.65.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "prettyplease 0.2.16", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.48", +] + [[package]] name = "bip39" version = "2.0.0" @@ -915,6 +979,30 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "blake2s_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "cc", + "cfg-if", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.7.3" @@ -966,6 +1054,15 @@ dependencies = [ "serde", ] +[[package]] +name = "bounded-vec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68534a48cbf63a4b1323c433cf21238c9ec23711e0df13b08c33e5c2082663ce" +dependencies = [ + "thiserror", +] + [[package]] name = "bp-asset-hub-kusama" version = "1.0.0" @@ -1216,6 +1313,48 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "bridge-hub-kusama-emulated-chain" +version = "0.0.0" +dependencies = [ + "bridge-hub-kusama-runtime", + "cumulus-primitives-core", + "emulated-integration-tests-common", + "frame-support", + "parachains-common", + "serde_json", + "sp-core", + "sp-runtime", + "system-parachains-constants", +] + +[[package]] +name = "bridge-hub-kusama-integration-tests" +version = "0.1.0" +dependencies = [ + "bp-messages", + "bridge-hub-kusama-runtime", + "cumulus-pallet-xcmp-queue", + "emulated-integration-tests-common", + "frame-support", + "hex", + "hex-literal", + "integration-tests-helpers", + "kusama-polkadot-system-emulated-network", + "kusama-system-emulated-network", + "pallet-assets", + "pallet-balances", + "pallet-bridge-messages", + "pallet-message-queue", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "staging-xcm", + "staging-xcm-executor", +] + [[package]] name = "bridge-hub-kusama-runtime" version = "1.0.0" @@ -1302,6 +1441,44 @@ dependencies = [ "system-parachains-constants", ] +[[package]] +name = "bridge-hub-polkadot-emulated-chain" +version = "0.0.0" +dependencies = [ + "bridge-hub-polkadot-runtime", + "cumulus-primitives-core", + "emulated-integration-tests-common", + "frame-support", + "parachains-common", + "serde_json", + "sp-core", + "sp-runtime", + "system-parachains-constants", +] + +[[package]] +name = "bridge-hub-polkadot-integration-tests" +version = "0.1.0" +dependencies = [ + "bp-messages", + "bridge-hub-polkadot-runtime", + "cumulus-pallet-xcmp-queue", + "emulated-integration-tests-common", + "frame-support", + "integration-tests-helpers", + "kusama-polkadot-system-emulated-network", + "pallet-assets", + "pallet-balances", + "pallet-bridge-messages", + "pallet-message-queue", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "sp-runtime", + "staging-xcm", + "staging-xcm-executor", +] + [[package]] name = "bridge-hub-polkadot-runtime" version = "1.0.0" @@ -1543,6 +1720,17 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "c2-chacha" version = "0.3.3" @@ -1595,6 +1783,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-expr" version = "0.15.5" @@ -1610,6 +1807,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chacha" version = "0.3.0" @@ -1692,6 +1895,19 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "cid" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" +dependencies = [ + "core2", + "multibase", + "multihash 0.17.0", + "serde", + "unsigned-varint", +] + [[package]] name = "cipher" version = "0.2.5" @@ -1721,6 +1937,17 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "clang-sys" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" version = "4.4.18" @@ -1741,6 +1968,7 @@ dependencies = [ "anstyle", "clap_lex", "strsim", + "terminal_size", ] [[package]] @@ -1761,6 +1989,17 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +[[package]] +name = "coarsetime" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b3839cf01bb7960114be3ccf2340f541b6d0c81f8690b007b2b39f750f7e5d" +dependencies = [ + "libc", + "wasix", + "wasm-bindgen", +] + [[package]] name = "codespan-reporting" version = "0.11.1" @@ -1771,6 +2010,21 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "collectives-polkadot-emulated-chain" +version = "0.0.0" +dependencies = [ + "collectives-polkadot-runtime", + "cumulus-primitives-core", + "emulated-integration-tests-common", + "frame-support", + "parachains-common", + "serde_json", + "sp-core", + "sp-runtime", + "system-parachains-constants", +] + [[package]] name = "collectives-polkadot-runtime" version = "1.0.0" @@ -1850,6 +2104,17 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "comfy-table" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686" +dependencies = [ + "strum 0.25.0", + "strum_macros 0.25.3", + "unicode-width", +] + [[package]] name = "common-path" version = "1.0.0" @@ -1956,6 +2221,16 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "cpu-time" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e393a7668fe1fad3075085b86c781883000b4ede868f43627b34a87c8b7ded" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "cpufeatures" version = "0.2.11" @@ -2056,7 +2331,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.5", "log", "smallvec", "wasmparser", @@ -2106,6 +2381,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.19" @@ -2632,6 +2916,15 @@ dependencies = [ "subtle 2.5.0", ] +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + [[package]] name = "directories-next" version = "2.0.0" @@ -2642,6 +2935,18 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -2809,34 +3114,38 @@ dependencies = [ ] [[package]] -name = "emulated-chains" -version = "1.0.0" +name = "emulated-integration-tests-common" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff5b923201b2f914787a3d3156826f03879502c09dd8da4471731d0cacef9089" dependencies = [ - "asset-hub-kusama-runtime", - "asset-hub-polkadot-runtime", - "bridge-hub-kusama-runtime", - "bridge-hub-polkadot-runtime", - "collectives-polkadot-runtime", + "asset-test-utils", + "bp-messages", + "bridge-runtime-common", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcmp-queue", "cumulus-primitives-core", "frame-support", - "integration-tests-common", - "kusama-runtime-constants", + "pallet-assets", + "pallet-balances", + "pallet-bridge-messages", "pallet-im-online", - "pallet-staking", + "pallet-message-queue", + "pallet-xcm", "parachains-common", - "penpal-runtime", - "polkadot-parachain-primitives", + "parity-scale-codec", + "paste", "polkadot-primitives", - "polkadot-runtime", - "polkadot-runtime-constants", "polkadot-runtime-parachains", + "polkadot-service", + "sc-consensus-grandpa", + "serde_json", "sp-authority-discovery", "sp-consensus-babe", "sp-consensus-beefy", - "sp-consensus-grandpa", "sp-core", "sp-runtime", - "staging-kusama-runtime", + "staging-xcm", "xcm-emulator", ] @@ -3150,6 +3459,27 @@ dependencies = [ "pin-project-lite 0.2.13", ] +[[package]] +name = "exit-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" +dependencies = [ + "futures", +] + +[[package]] +name = "expander" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a718c0675c555c5f976fff4ea9e2c150fa06cefa201cadef87cfbf9324075881" +dependencies = [ + "blake3", + "fs-err", + "proc-macro2", + "quote", +] + [[package]] name = "expander" version = "2.0.0" @@ -3181,6 +3511,41 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "fatality" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad875162843b0d046276327afe0136e9ed3a23d5a754210fb6f1f33610d39ab" +dependencies = [ + "fatality-proc-macro", + "thiserror", +] + +[[package]] +name = "fatality-proc-macro" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" +dependencies = [ + "expander 0.0.4", + "indexmap 1.9.3", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", + "thiserror", +] + +[[package]] +name = "fdlimit" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e182f7dbc2ef73d9ef67351c5fbbea084729c48362d3ce9dd44c28e32e277fe5" +dependencies = [ + "libc", + "thiserror", +] + [[package]] name = "ff" version = "0.13.0" @@ -3329,6 +3694,55 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "frame-benchmarking-cli" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69fec078a73892cb5a7146671cf76e3abf23201fefe431a013399ac2e5b03b54" +dependencies = [ + "Inflector", + "array-bytes 6.2.2", + "chrono", + "clap", + "comfy-table", + "frame-benchmarking", + "frame-support", + "frame-system", + "gethostname", + "handlebars", + "itertools 0.10.5", + "lazy_static", + "linked-hash-map", + "log", + "parity-scale-codec", + "rand", + "rand_pcg", + "sc-block-builder", + "sc-cli", + "sc-client-api", + "sc-client-db", + "sc-executor", + "sc-service", + "sc-sysinfo", + "serde", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-storage", + "sp-trie", + "sp-wasm-interface", + "thiserror", + "thousands", +] + [[package]] name = "frame-election-provider-solution-type" version = "13.0.0" @@ -3463,9 +3877,9 @@ dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", - "expander", + "expander 2.0.0", "frame-support-procedural-tools", - "itertools", + "itertools 0.10.5", "macro_magic", "proc-macro-warning", "proc-macro2", @@ -3567,6 +3981,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "funty" version = "2.0.0" @@ -3719,6 +4143,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -3778,6 +4212,12 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "globset" version = "0.4.14" @@ -3861,6 +4301,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "handlebars" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "hash-db" version = "0.16.0" @@ -4028,6 +4482,12 @@ dependencies = [ "pin-project-lite 0.2.13", ] +[[package]] +name = "http-range-header" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" + [[package]] name = "httparse" version = "1.8.0" @@ -4280,6 +4740,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "integer-encoding" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" + [[package]] name = "integer-sqrt" version = "0.1.5" @@ -4290,34 +4756,15 @@ dependencies = [ ] [[package]] -name = "integration-tests-common" -version = "1.0.0" +name = "integration-tests-helpers" +version = "0.0.1" dependencies = [ "asset-test-utils", - "bp-messages", - "bridge-runtime-common", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "frame-support", - "pallet-assets", "pallet-balances", - "pallet-bridge-messages", - "pallet-im-online", "pallet-message-queue", "pallet-xcm", - "parachains-common", - "parity-scale-codec", "paste", - "polkadot-primitives", - "polkadot-runtime-parachains", - "sp-authority-discovery", - "sp-consensus-babe", - "sp-consensus-beefy", - "sp-consensus-grandpa", - "sp-core", - "sp-runtime", "staging-xcm", "xcm-emulator", ] @@ -4364,10 +4811,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.28", + "rustix 0.38.31", "windows-sys 0.48.0", ] +[[package]] +name = "is_executable" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" +dependencies = [ + "winapi", +] + [[package]] name = "itertools" version = "0.10.5" @@ -4377,6 +4833,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.10" @@ -4573,6 +5038,39 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" +[[package]] +name = "kusama-emulated-chain" +version = "1.0.0" +dependencies = [ + "emulated-integration-tests-common", + "kusama-runtime-constants", + "pallet-im-online", + "parachains-common", + "polkadot-primitives", + "sc-consensus-grandpa", + "serde_json", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "staging-kusama-runtime", +] + +[[package]] +name = "kusama-polkadot-system-emulated-network" +version = "0.1.0" +dependencies = [ + "asset-hub-kusama-emulated-chain", + "asset-hub-polkadot-emulated-chain", + "bridge-hub-kusama-emulated-chain", + "bridge-hub-polkadot-emulated-chain", + "emulated-integration-tests-common", + "kusama-emulated-chain", + "penpal-emulated-chain", + "polkadot-emulated-chain", +] + [[package]] name = "kusama-runtime-constants" version = "1.0.0" @@ -4587,6 +5085,17 @@ dependencies = [ "staging-xcm-builder", ] +[[package]] +name = "kusama-system-emulated-network" +version = "0.1.0" +dependencies = [ + "asset-hub-kusama-emulated-chain", + "bridge-hub-kusama-emulated-chain", + "emulated-integration-tests-common", + "kusama-emulated-chain", + "penpal-emulated-chain", +] + [[package]] name = "kvdb" version = "0.13.0" @@ -4596,18 +5105,69 @@ dependencies = [ "smallvec", ] +[[package]] +name = "kvdb-memorydb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" +dependencies = [ + "kvdb", + "parking_lot 0.12.1", +] + +[[package]] +name = "kvdb-rocksdb" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" +dependencies = [ + "kvdb", + "num_cpus", + "parking_lot 0.12.1", + "regex", + "rocksdb", + "smallvec", +] + +[[package]] +name = "landlock" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1530c5b973eeed4ac216af7e24baf5737645a6272e361f1fb95710678b67d9cc" +dependencies = [ + "enumflags2", + "libc", + "thiserror", +] + [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +[[package]] +name = "libloading" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "libm" version = "0.2.8" @@ -4685,7 +5245,7 @@ dependencies = [ "libp2p-identity", "log", "multiaddr", - "multihash", + "multihash 0.17.0", "multistream-select", "once_cell", "parking_lot 0.12.1", @@ -4745,7 +5305,7 @@ dependencies = [ "ed25519-dalek", "log", "multiaddr", - "multihash", + "multihash 0.17.0", "quick-protobuf", "rand", "sha2 0.10.8", @@ -5018,6 +5578,21 @@ dependencies = [ "redox_syscall 0.4.1", ] +[[package]] +name = "librocksdb-sys" +version = "0.11.0+8.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" +dependencies = [ + "bindgen", + "bzip2-sys", + "cc", + "glob", + "libc", + "libz-sys", + "tikv-jemalloc-sys", +] + [[package]] name = "libsecp256k1" version = "0.7.1" @@ -5177,6 +5752,26 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "mach" version = "0.3.2" @@ -5283,7 +5878,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.28", + "rustix 0.38.31", ] [[package]] @@ -5337,6 +5932,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "mick-jaeger" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" +dependencies = [ + "futures", + "rand", + "thrift", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -5389,13 +5995,50 @@ dependencies = [ ] [[package]] -name = "mockall" -version = "0.11.4" +name = "mmr-gadget" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +checksum = "f9d0ba6676a84f182dabd7c3ec2c92f0e882fe4e4179ddf76f02ac132e6eb0ab" dependencies = [ - "cfg-if", - "downcast", + "futures", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-offchain", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + +[[package]] +name = "mmr-rpc" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19066d17147f6819ec25f5f6fc3b9fca2008ae745ac7fa2d55ddb1d207119eae" +dependencies = [ + "anyhow", + "jsonrpsee", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + +[[package]] +name = "mockall" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +dependencies = [ + "cfg-if", + "downcast", "fragile", "lazy_static", "mockall_derive", @@ -5426,7 +6069,7 @@ dependencies = [ "data-encoding", "log", "multibase", - "multihash", + "multihash 0.17.0", "percent-encoding", "serde", "static_assertions", @@ -5450,12 +6093,61 @@ name = "multihash" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.7", + "multihash-derive 0.8.0", + "sha2 0.10.8", + "sha3", + "unsigned-varint", +] + +[[package]] +name = "multihash" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" +dependencies = [ + "core2", + "digest 0.10.7", + "multihash-derive 0.8.0", + "sha2 0.10.8", + "unsigned-varint", +] + +[[package]] +name = "multihash" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", - "multihash-derive", "unsigned-varint", ] +[[package]] +name = "multihash-codetable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d815ecb3c8238d00647f8630ede7060a642c9f704761cd6082cb4028af6935" +dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.7", + "multihash-derive 0.9.0", + "ripemd", + "serde", + "sha1", + "sha2 0.10.8", + "sha3", + "strobe-rs", +] + [[package]] name = "multihash-derive" version = "0.8.0" @@ -5470,6 +6162,31 @@ dependencies = [ "synstructure", ] +[[package]] +name = "multihash-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "890e72cb7396cb99ed98c1246a97b243cc16394470d94e0bc8b0c2c11d84290e" +dependencies = [ + "core2", + "multihash 0.19.1", + "multihash-derive-impl", +] + +[[package]] +name = "multihash-derive-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38685e08adb338659871ecfc6ee47ba9b22dcc8abcf6975d379cc49145c3040" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + [[package]] name = "multimap" version = "0.8.3" @@ -5517,6 +6234,21 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "names" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" +dependencies = [ + "rand", +] + +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" + [[package]] name = "netlink-packet-core" version = "0.4.2" @@ -5663,6 +6395,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", + "num-bigint", "num-integer", "num-traits", ] @@ -5747,6 +6480,54 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "orchestra" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2356622ffdfe72362a45a1e5e87bb113b8327e596e39b91f11f0ef4395c8da79" +dependencies = [ + "async-trait", + "dyn-clonable", + "futures", + "futures-timer", + "orchestra-proc-macro", + "pin-project", + "prioritized-metered-channel 0.6.1", + "thiserror", + "tracing", +] + +[[package]] +name = "orchestra-proc-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eedb646674596266dc9bb2b5c7eea7c36b32ecc7777eba0d510196972d72c4fd" +dependencies = [ + "expander 2.0.0", + "indexmap 2.1.0", + "itertools 0.11.0", + "petgraph", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ordered-float" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" +dependencies = [ + "num-traits", +] + [[package]] name = "pallet-alliance" version = "27.0.0" @@ -6254,7 +7035,7 @@ dependencies = [ "sp-npos-elections", "sp-runtime", "sp-std", - "strum", + "strum 0.24.1", ] [[package]] @@ -7147,6 +7928,23 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-transaction-payment-rpc" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1486d58f38892df779a7812f28ff962d0b0632b955ea3c348f605caa01ba6d" +dependencies = [ + "jsonrpsee", + "pallet-transaction-payment-rpc-runtime-api", + "parity-scale-codec", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-weights", +] + [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "28.0.0" @@ -7404,6 +8202,27 @@ dependencies = [ "substrate-wasm-builder", ] +[[package]] +name = "parity-db" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" +dependencies = [ + "blake2 0.10.6", + "crc32fast", + "fs2", + "hex", + "libc", + "log", + "lz4", + "memmap2", + "parking_lot 0.12.1", + "rand", + "siphasher", + "snap", + "winapi", +] + [[package]] name = "parity-scale-codec" version = "3.6.9" @@ -7547,6 +8366,12 @@ dependencies = [ "crypto-mac 0.11.0", ] +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + [[package]] name = "pem" version = "1.1.1" @@ -7556,6 +8381,22 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "penpal-emulated-chain" +version = "0.0.0" +dependencies = [ + "cumulus-primitives-core", + "emulated-integration-tests-common", + "frame-support", + "kusama-emulated-chain", + "parachains-common", + "penpal-runtime", + "polkadot-emulated-chain", + "serde_json", + "sp-core", + "sp-runtime", +] + [[package]] name = "penpal-runtime" version = "0.14.3" @@ -7626,6 +8467,51 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "pest" +version = "2.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e1288dbd7786462961e69bfd4df7848c1e37e8b74303dbdab82c3a9cdd2809" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1381c29a877c6d34b8c176e734f35d7f7f5b3adaefe940cb4d1bb7af94678e2e" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "pest_meta" +version = "2.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0934d6907f148c22a3acbda520c7eed243ad7487a30f51f6ce52b58b7077a8a" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.8", +] + [[package]] name = "petgraph" version = "0.6.4" @@ -7697,1525 +8583,3266 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] -name = "polkadot-core-primitives" +name = "polkadot-approval-distribution" version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda2b0f0c580c38f12445a4af10e0a23acf48381b2a95653e0be48ba787e10e5" +checksum = "98fd276eccca3ada04cb274f4b8c51f669087d8b334c775f1231a9194d5260d0" dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "bitvec", + "futures", + "futures-timer", + "itertools 0.10.5", + "polkadot-node-jaeger", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand", + "tracing-gum", ] [[package]] -name = "polkadot-parachain-primitives" -version = "6.0.0" +name = "polkadot-availability-bitfield-distribution" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b37c55955147479e7b2f3c2e5385db4846ac3e3b997cd4a4ad52344524b5447" +checksum = "51c43e54e0cc47dfb4f7c3917a774ccc796524087515b212d9fe109bde71846e" +dependencies = [ + "always-assert", + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-distribution" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121ded25722b8505335b05a77f1def84278802ed3f4774c7fe6ab7c961affe06" dependencies = [ - "bounded-collections", "derive_more", + "fatality", + "futures", "parity-scale-codec", - "polkadot-core-primitives", - "scale-info", - "serde", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand", + "schnellru", "sp-core", - "sp-runtime", - "sp-std", - "sp-weights", + "sp-keystore", + "thiserror", + "tracing-gum", ] [[package]] -name = "polkadot-primitives" +name = "polkadot-availability-recovery" version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aefd230a654f5b2aee18ebbd9c081835def0e1898ee6c018501dd77c18f5929" +checksum = "3902495dbba25e7526168c8f88b26cc0dbb96cfe10813238a650c67b34bf9f31" dependencies = [ - "bitvec", - "hex-literal", + "async-trait", + "fatality", + "futures", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain-primitives", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-authority-discovery", - "sp-consensus-slots", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand", + "sc-network", + "schnellru", + "thiserror", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polkadot-collator-protocol" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a70007b246c3679ee43f11123bda6d715f659f7b6d4134d0fcbe8980e049386b" +dependencies = [ + "bitvec", + "fatality", + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", "sp-core", - "sp-inherents", - "sp-io", "sp-keystore", "sp-runtime", - "sp-staking", - "sp-std", + "thiserror", + "tokio-util", + "tracing-gum", ] [[package]] -name = "polkadot-runtime" -version = "1.0.0" +name = "polkadot-core-primitives" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda2b0f0c580c38f12445a4af10e0a23acf48381b2a95653e0be48ba787e10e5" dependencies = [ - "binary-merkle-tree", - "frame-benchmarking", - "frame-election-provider-support", - "frame-executive", - "frame-remote-externalities", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "log", - "pallet-asset-rate", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-bags-list", - "pallet-balances", - "pallet-beefy", - "pallet-beefy-mmr", - "pallet-bounties", - "pallet-child-bounties", - "pallet-conviction-voting", - "pallet-election-provider-multi-phase", - "pallet-election-provider-support-benchmarking", - "pallet-fast-unstake", - "pallet-grandpa", - "pallet-identity", - "pallet-im-online", - "pallet-indices", - "pallet-message-queue", - "pallet-mmr", - "pallet-multisig", - "pallet-nomination-pools", - "pallet-nomination-pools-benchmarking", - "pallet-nomination-pools-runtime-api", - "pallet-offences", - "pallet-offences-benchmarking", - "pallet-preimage", - "pallet-proxy", - "pallet-referenda", - "pallet-scheduler", - "pallet-session", - "pallet-session-benchmarking", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-staking-reward-fn", - "pallet-staking-runtime-api", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-treasury", - "pallet-utility", - "pallet-vesting", - "pallet-whitelist", - "pallet-xcm", - "pallet-xcm-benchmarks", "parity-scale-codec", - "polkadot-primitives", - "polkadot-runtime-common", - "polkadot-runtime-constants", - "polkadot-runtime-parachains", "scale-info", - "separator", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-authority-discovery", - "sp-block-builder", - "sp-consensus-babe", - "sp-consensus-beefy", "sp-core", - "sp-debug-derive", - "sp-genesis-builder", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-npos-elections", - "sp-offchain", "sp-runtime", - "sp-session", - "sp-staking", "sp-std", - "sp-storage", - "sp-tracing", - "sp-transaction-pool", - "sp-trie", - "sp-version", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "substrate-wasm-builder", - "tiny-keccak", - "tokio", ] [[package]] -name = "polkadot-runtime-common" +name = "polkadot-dispute-distribution" version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4641a850b7415a42e56bd262aba243ed77a9280cb2b825a427c425bdc8961d70" +checksum = "84a9b173e02d1f600a422269b3b5a1db203d39f436f7db7d7e41ef6dda6f42e0" dependencies = [ - "bitvec", - "frame-benchmarking", - "frame-election-provider-support", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "libsecp256k1", - "log", - "pallet-asset-rate", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-broker", - "pallet-election-provider-multi-phase", - "pallet-fast-unstake", - "pallet-identity", - "pallet-session", - "pallet-staking", - "pallet-staking-reward-fn", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-treasury", - "pallet-vesting", - "pallet-xcm-benchmarks", + "derive_more", + "fatality", + "futures", + "futures-timer", + "indexmap 1.9.3", "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", "polkadot-primitives", - "polkadot-runtime-parachains", - "rustc-hex", - "scale-info", - "serde", - "serde_derive", - "slot-range-helper", - "sp-api", - "sp-core", - "sp-inherents", - "sp-io", - "sp-npos-elections", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "static_assertions", + "sc-network", + "schnellru", + "sp-application-crypto", + "sp-keystore", + "thiserror", + "tracing-gum", ] [[package]] -name = "polkadot-runtime-constants" +name = "polkadot-emulated-chain" version = "1.0.0" dependencies = [ - "frame-support", + "emulated-integration-tests-common", + "pallet-im-online", + "pallet-staking", + "parachains-common", "polkadot-primitives", - "polkadot-runtime-common", - "smallvec", + "polkadot-runtime", + "polkadot-runtime-constants", + "sc-consensus-grandpa", + "serde_json", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-runtime", - "sp-weights", - "staging-xcm-builder", ] [[package]] -name = "polkadot-runtime-metrics" +name = "polkadot-erasure-coding" version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac3c6ee03f38556274b26049c51c5c7095abfd4ebfd11cd492918a4344f2851" +checksum = "ff8347b3528fe94e47ec1b818b06bf821010a5f180d0ac5c89138da0d382debc" dependencies = [ - "bs58 0.5.0", - "frame-benchmarking", "parity-scale-codec", + "polkadot-node-primitives", "polkadot-primitives", - "sp-std", - "sp-tracing", + "reed-solomon-novelpoly", + "sp-core", + "sp-trie", + "thiserror", ] [[package]] -name = "polkadot-runtime-parachains" +name = "polkadot-gossip-support" version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d253ef2952097398d98ed12729e47f9328bcd1baa92c3acc1524a4baca7d1ac" +checksum = "f4de739371a4b5f036848de5c7185dfee88587016d2bb32af07f38fb909b80d8" dependencies = [ - "bitflags 1.3.2", - "bitvec", - "derive_more", - "frame-benchmarking", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-broker", - "pallet-message-queue", - "pallet-session", - "pallet-staking", - "pallet-timestamp", - "pallet-vesting", - "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain-primitives", + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", "polkadot-primitives", - "polkadot-runtime-metrics", "rand", "rand_chacha 0.3.1", - "rustc-hex", - "scale-info", - "serde", - "sp-api", + "sc-network", + "sc-network-common", "sp-application-crypto", - "sp-arithmetic", "sp-core", - "sp-inherents", - "sp-io", "sp-keystore", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-tracing", - "staging-xcm", - "staging-xcm-executor", - "static_assertions", + "tracing-gum", ] [[package]] -name = "polling" -version = "3.3.1" +name = "polkadot-network-bridge" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +checksum = "4598c9d00dbc017c0f01e82a7c0740805cc500c3b8946ad0b7945ab4d68dd7ee" dependencies = [ - "cfg-if", - "concurrent-queue", - "pin-project-lite 0.2.13", - "rustix 0.38.28", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "poly1305" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" -dependencies = [ - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash", + "always-assert", + "async-trait", + "bytes", + "fatality", + "futures", + "parity-scale-codec", + "parking_lot 0.12.1", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sc-network", + "sp-consensus", + "thiserror", + "tracing-gum", ] [[package]] -name = "polyval" -version = "0.6.1" +name = "polkadot-node-collation-generation" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +checksum = "ba987629ab789f529426d6187dbafaa8209f5ee479c645184e4c1e33a59e2135" dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash", + "futures", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "sp-maybe-compressed-blob", + "thiserror", + "tracing-gum", ] [[package]] -name = "portable-atomic" -version = "1.6.0" +name = "polkadot-node-core-approval-voting" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "b5910fa99def47accbb4505bef91f74614f62347bc0c53c11296d5ce70d8e255" +dependencies = [ + "bitvec", + "derive_more", + "futures", + "futures-timer", + "itertools 0.10.5", + "kvdb", + "merlin 3.0.0", + "parity-scale-codec", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "rand", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sc-keystore", + "schnellru", + "schnorrkel 0.11.4", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-runtime", + "thiserror", + "tracing-gum", +] [[package]] -name = "powerfmt" -version = "0.2.0" +name = "polkadot-node-core-av-store" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "0ab1583533dc82a719607323432c013e01c2a8c971eb7e7703ff5eadd762f4e3" +dependencies = [ + "bitvec", + "futures", + "futures-timer", + "kvdb", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sp-consensus", + "thiserror", + "tracing-gum", +] [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "polkadot-node-core-backing" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "d7b5468fa618ccbeb4611b073d2c28b9440b51f4012e69c117e43192f9de8b17" +dependencies = [ + "bitvec", + "fatality", + "futures", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "polkadot-statement-table", + "sp-keystore", + "thiserror", + "tracing-gum", +] [[package]] -name = "predicates" -version = "2.1.5" +name = "polkadot-node-core-bitfield-signing" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +checksum = "4975e2ecc81d34605748781e9449a7b7ff956c385b46496005257a1a7dd56f0d" dependencies = [ - "difflib", - "float-cmp", - "itertools", - "normalize-line-endings", - "predicates-core", - "regex", + "futures", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing-gum", + "wasm-timer", ] [[package]] -name = "predicates-core" -version = "1.0.6" +name = "polkadot-node-core-candidate-validation" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" +checksum = "bcfd720b86c1ddf6616cf083a2cb273147687521c1d13a7f3c991b1d5ae03444" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-node-core-pvf", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-parachain-primitives", + "polkadot-primitives", + "sp-maybe-compressed-blob", + "tracing-gum", +] [[package]] -name = "predicates-tree" -version = "1.0.9" +name = "polkadot-node-core-chain-api" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +checksum = "4a9f00bd39f433a2e8281524529853a3be54970e799a451e2c14fc5b75cf226f" dependencies = [ - "predicates-core", - "termtree", + "futures", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "sc-client-api", + "sc-consensus-babe", + "tracing-gum", ] [[package]] -name = "prettyplease" -version = "0.1.25" +name = "polkadot-node-core-chain-selection" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "ea28475a96dfb6419432314d8021780e5c5b0f50a5525fd332e8b2a947a2deb5" dependencies = [ - "proc-macro2", - "syn 1.0.109", + "futures", + "futures-timer", + "kvdb", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", ] [[package]] -name = "primitive-types" -version = "0.12.2" +name = "polkadot-node-core-dispute-coordinator" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +checksum = "5ad9cfb3e775dc4c611a79e294549fe4b244052ddaacf14133380e793c25a99f" dependencies = [ - "fixed-hash", - "impl-codec", - "impl-num-traits", - "impl-rlp", - "impl-serde", - "scale-info", - "uint", + "fatality", + "futures", + "kvdb", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-keystore", + "schnellru", + "thiserror", + "tracing-gum", ] [[package]] -name = "proc-macro-crate" -version = "1.3.1" +name = "polkadot-node-core-parachains-inherent" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "eb2535ef374a218b1e9d05b98a903edbdddf4eea47f9e137fcc09c8e1bc199dd" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "async-trait", + "futures", + "futures-timer", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sp-blockchain", + "sp-inherents", + "thiserror", + "tracing-gum", ] [[package]] -name = "proc-macro-crate" -version = "2.0.0" +name = "polkadot-node-core-prospective-parachains" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "15a8876cc0aa627190f1d41c01061a7acee9621703501d9a60118d35e81579f9" dependencies = [ - "toml_edit 0.20.2", + "bitvec", + "fatality", + "futures", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", ] [[package]] -name = "proc-macro-crate" -version = "3.1.0" +name = "polkadot-node-core-provisioner" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "25c88b17b93bf410a72bfb4543b1ae01bb0d33fd6cba9af1f0e74c4ef2b906ad" dependencies = [ - "toml_edit 0.21.0", + "bitvec", + "fatality", + "futures", + "futures-timer", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "polkadot-node-core-pvf" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "c80f2810b2eb843f3282b11e7ce1624866b6dd1ee6a95541b5882b5df3f36f25" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", + "always-assert", + "array-bytes 6.2.2", + "blake3", + "cfg-if", + "futures", + "futures-timer", + "is_executable", + "libc", + "parity-scale-codec", + "pin-project", + "polkadot-core-primitives", + "polkadot-node-core-pvf-common", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-parachain-primitives", + "polkadot-primitives", + "rand", + "slotmap", + "sp-core", + "sp-maybe-compressed-blob", + "sp-wasm-interface", + "tempfile", + "thiserror", + "tokio", + "tracing-gum", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "polkadot-node-core-pvf-checker" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "14d8ddb21cb3ad1868967b116fbf289610880cb95313b2798762cdd8653d36b7" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "futures", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing-gum", ] [[package]] -name = "proc-macro-warning" -version = "1.0.0" +name = "polkadot-node-core-pvf-common" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c" +checksum = "80bbf311b112a8552e89e5be55b0305d86328ba04528e47d3203cd27751405bc" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", + "cfg-if", + "cpu-time", + "futures", + "landlock", + "libc", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-primitives", + "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", + "seccompiler", + "sp-core", + "sp-externalities", + "sp-io", + "sp-tracing", + "thiserror", + "tracing-gum", ] [[package]] -name = "proc-macro2" -version = "1.0.78" +name = "polkadot-node-core-runtime-api" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "17345f76b7ebcf2f1e1be5411a6420971ef60d69070f115e459b2f017f91bcb5" dependencies = [ - "unicode-ident", + "futures", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "schnellru", + "sp-consensus-babe", + "tracing-gum", ] [[package]] -name = "prometheus" -version = "0.13.3" +name = "polkadot-node-jaeger" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "4b099624af4597bac5d1617a3cab057785ee47e657de7ad078957bfa397d82c4" dependencies = [ - "cfg-if", - "fnv", "lazy_static", - "memchr", + "log", + "mick-jaeger", + "parity-scale-codec", "parking_lot 0.12.1", - "thiserror", -] - -[[package]] -name = "prometheus-client" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" -dependencies = [ - "dtoa", - "itoa", - "parking_lot 0.12.1", - "prometheus-client-derive-encode", -] - -[[package]] -name = "prometheus-client-derive-encode" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive", + "polkadot-node-primitives", + "polkadot-primitives", + "sc-network", + "sp-core", + "thiserror", + "tokio", ] [[package]] -name = "prost-build" -version = "0.11.9" +name = "polkadot-node-metrics" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +checksum = "b2b5b00a9646875f22ab45e61ede04f623a3fbbc03bae52263b3d558c964bc32" dependencies = [ - "bytes", - "heck", - "itertools", - "lazy_static", + "bs58 0.5.0", + "futures", + "futures-timer", "log", - "multimap", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 1.0.109", - "tempfile", - "which", + "parity-scale-codec", + "polkadot-primitives", + "prioritized-metered-channel 0.5.1", + "sc-cli", + "sc-service", + "sc-tracing", + "substrate-prometheus-endpoint", + "tracing-gum", ] [[package]] -name = "prost-derive" -version = "0.11.9" +name = "polkadot-node-network-protocol" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "e420ba9220abaa468a393ff2834b7c2b4d7d87b6d903d9046dfd682c97d35d4c" dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn 1.0.109", + "async-channel", + "async-trait", + "bitvec", + "derive_more", + "fatality", + "futures", + "hex", + "parity-scale-codec", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-primitives", + "rand", + "sc-authority-discovery", + "sc-network", + "strum 0.24.1", + "thiserror", + "tracing-gum", ] [[package]] -name = "prost-types" -version = "0.11.9" +name = "polkadot-node-primitives" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "366d18f1498426975c610246063149ad84788eb1e924cab6ee44a4d8958ecf61" dependencies = [ - "prost", + "bitvec", + "bounded-vec", + "futures", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-primitives", + "schnorrkel 0.11.4", + "serde", + "sp-application-crypto", + "sp-consensus-babe", + "sp-core", + "sp-keystore", + "sp-maybe-compressed-blob", + "sp-runtime", + "thiserror", + "zstd 0.12.4", ] [[package]] -name = "psm" -version = "0.1.21" +name = "polkadot-node-subsystem" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "831cf07bf6588d7d8ab872f8f214b4b24b2c4243faf8028534f8a11a3f03c466" dependencies = [ - "cc", + "polkadot-node-jaeger", + "polkadot-node-subsystem-types", + "polkadot-overseer", ] [[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quick-protobuf" -version = "0.8.1" +name = "polkadot-node-subsystem-types" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +checksum = "bd132afdfcdf2e30f7924c9561bbc1208b0838ab9c2275bf0ef32525f63b8bd0" dependencies = [ - "byteorder", + "async-trait", + "bitvec", + "derive_more", + "futures", + "orchestra", + "polkadot-node-jaeger", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-primitives", + "polkadot-statement-table", + "sc-client-api", + "sc-network", + "sc-transaction-pool-api", + "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-blockchain", + "sp-consensus-babe", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", ] [[package]] -name = "quick-protobuf-codec" -version = "0.1.0" +name = "polkadot-node-subsystem-util" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +checksum = "d32c2f2027689777bd61681d769ed5ec726144905c4e3cb16c5f8a4edb55250a" dependencies = [ - "asynchronous-codec", - "bytes", - "quick-protobuf", + "async-trait", + "derive_more", + "fatality", + "futures", + "futures-channel", + "itertools 0.10.5", + "kvdb", + "parity-db", + "parity-scale-codec", + "parking_lot 0.12.1", + "pin-project", + "polkadot-node-jaeger", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-overseer", + "polkadot-primitives", + "prioritized-metered-channel 0.5.1", + "rand", + "sc-client-api", + "schnellru", + "sp-application-crypto", + "sp-core", + "sp-keystore", "thiserror", - "unsigned-varint", + "tracing-gum", ] [[package]] -name = "quicksink" -version = "0.1.2" +name = "polkadot-overseer" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" +checksum = "9aa0b71f50f0be1959bcb10a46105ca66b9c6868d549385a247750e5b7a45c77" dependencies = [ - "futures-core", - "futures-sink", - "pin-project-lite 0.1.12", + "async-trait", + "futures", + "futures-timer", + "orchestra", + "parking_lot 0.12.1", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "sc-client-api", + "sp-api", + "sp-core", + "tikv-jemalloc-ctl", + "tracing-gum", ] [[package]] -name = "quinn-proto" -version = "0.9.6" +name = "polkadot-parachain-primitives" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +checksum = "9b37c55955147479e7b2f3c2e5385db4846ac3e3b997cd4a4ad52344524b5447" dependencies = [ - "bytes", - "rand", - "ring 0.16.20", - "rustc-hash", - "rustls 0.20.9", - "slab", - "thiserror", - "tinyvec", - "tracing", - "webpki", + "bounded-collections", + "derive_more", + "parity-scale-codec", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", + "sp-weights", ] [[package]] -name = "quote" -version = "1.0.35" +name = "polkadot-primitives" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "8aefd230a654f5b2aee18ebbd9c081835def0e1898ee6c018501dd77c18f5929" dependencies = [ - "proc-macro2", + "bitvec", + "hex-literal", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", + "sp-std", ] [[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" +name = "polkadot-rpc" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "382eada9005c73375778e1dca58116e0660431cf90989fe0dde54ebe1f621a1e" dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", + "jsonrpsee", + "mmr-rpc", + "pallet-transaction-payment-rpc", + "polkadot-primitives", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-babe-rpc", + "sc-consensus-beefy", + "sc-consensus-beefy-rpc", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "sc-consensus-grandpa-rpc", + "sc-rpc", + "sc-rpc-spec-v2", + "sc-sync-state-rpc", + "sc-transaction-pool-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-keystore", + "sp-runtime", + "substrate-frame-rpc-system", + "substrate-state-trie-migration-rpc", ] [[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +name = "polkadot-runtime" +version = "1.0.0" dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] + "binary-merkle-tree", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-remote-externalities", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "log", + "pallet-asset-rate", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-beefy", + "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", + "pallet-conviction-voting", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-message-queue", + "pallet-mmr", + "pallet-multisig", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-preimage", + "pallet-proxy", + "pallet-referenda", + "pallet-scheduler", + "pallet-session", + "pallet-session-benchmarking", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-staking-reward-fn", + "pallet-staking-runtime-api", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-whitelist", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-constants", + "polkadot-runtime-parachains", + "scale-info", + "separator", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-debug-derive", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-transaction-pool", + "sp-trie", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", + "tiny-keccak", + "tokio", +] + +[[package]] +name = "polkadot-runtime-common" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4641a850b7415a42e56bd262aba243ed77a9280cb2b825a427c425bdc8961d70" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "libsecp256k1", + "log", + "pallet-asset-rate", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-broker", + "pallet-election-provider-multi-phase", + "pallet-fast-unstake", + "pallet-identity", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-fn", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-treasury", + "pallet-vesting", + "pallet-xcm-benchmarks", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "slot-range-helper", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "static_assertions", +] + +[[package]] +name = "polkadot-runtime-constants" +version = "1.0.0" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec", + "sp-core", + "sp-runtime", + "sp-weights", + "staging-xcm-builder", +] + +[[package]] +name = "polkadot-runtime-metrics" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ac3c6ee03f38556274b26049c51c5c7095abfd4ebfd11cd492918a4344f2851" +dependencies = [ + "bs58 0.5.0", + "frame-benchmarking", + "parity-scale-codec", + "polkadot-primitives", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "polkadot-runtime-parachains" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d253ef2952097398d98ed12729e47f9328bcd1baa92c3acc1524a4baca7d1ac" +dependencies = [ + "bitflags 1.3.2", + "bitvec", + "derive_more", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-broker", + "pallet-message-queue", + "pallet-session", + "pallet-staking", + "pallet-timestamp", + "pallet-vesting", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-metrics", + "rand", + "rand_chacha 0.3.1", + "rustc-hex", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-tracing", + "staging-xcm", + "staging-xcm-executor", + "static_assertions", +] + +[[package]] +name = "polkadot-service" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75bf984471c2608905176b62726b3552bbfdc3e04ebdc7fe75e5179ff215588" +dependencies = [ + "async-trait", + "frame-benchmarking", + "frame-benchmarking-cli", + "frame-support", + "frame-system", + "frame-system-rpc-runtime-api", + "futures", + "hex-literal", + "is_executable", + "kvdb", + "kvdb-rocksdb", + "log", + "mmr-gadget", + "pallet-babe", + "pallet-im-online", + "pallet-staking", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "parity-db", + "parity-scale-codec", + "parking_lot 0.12.1", + "polkadot-approval-distribution", + "polkadot-availability-bitfield-distribution", + "polkadot-availability-distribution", + "polkadot-availability-recovery", + "polkadot-collator-protocol", + "polkadot-core-primitives", + "polkadot-dispute-distribution", + "polkadot-gossip-support", + "polkadot-network-bridge", + "polkadot-node-collation-generation", + "polkadot-node-core-approval-voting", + "polkadot-node-core-av-store", + "polkadot-node-core-backing", + "polkadot-node-core-bitfield-signing", + "polkadot-node-core-candidate-validation", + "polkadot-node-core-chain-api", + "polkadot-node-core-chain-selection", + "polkadot-node-core-dispute-coordinator", + "polkadot-node-core-parachains-inherent", + "polkadot-node-core-prospective-parachains", + "polkadot-node-core-provisioner", + "polkadot-node-core-pvf", + "polkadot-node-core-pvf-checker", + "polkadot-node-core-runtime-api", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-rpc", + "polkadot-runtime-parachains", + "polkadot-statement-distribution", + "sc-authority-discovery", + "sc-basic-authorship", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-consensus-babe", + "sc-consensus-beefy", + "sc-consensus-grandpa", + "sc-consensus-slots", + "sc-executor", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-network-sync", + "sc-offchain", + "sc-service", + "sc-sync-state-rpc", + "sc-sysinfo", + "sc-telemetry", + "sc-transaction-pool", + "sc-transaction-pool-api", + "schnellru", + "serde", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-keystore", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-storage", + "sp-timestamp", + "sp-transaction-pool", + "sp-version", + "sp-weights", + "substrate-prometheus-endpoint", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-statement-distribution" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b82b48ff9204ea663ccccde78aefa8a524958aadff5c84a4f1fd773c291057d" +dependencies = [ + "arrayvec 0.7.4", + "bitvec", + "fatality", + "futures", + "futures-timer", + "indexmap 1.9.3", + "parity-scale-codec", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "sp-staking", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-statement-table" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478dea03265eb2465010dae149616e4f28fe858e103671b1a96dc19e9e388c8f" +dependencies = [ + "parity-scale-codec", + "polkadot-primitives", + "sp-core", +] + +[[package]] +name = "polkadot-system-emulated-network" +version = "0.1.0" +dependencies = [ + "asset-hub-polkadot-emulated-chain", + "bridge-hub-polkadot-emulated-chain", + "collectives-polkadot-emulated-chain", + "emulated-integration-tests-common", + "penpal-emulated-chain", + "polkadot-emulated-chain", +] + +[[package]] +name = "polling" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite 0.2.13", + "rustix 0.38.31", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash", +] + +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "float-cmp", + "itertools 0.10.5", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn 2.0.48", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-num-traits", + "impl-rlp", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "prioritized-metered-channel" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e99f0c89bd88f393aab44a4ab949351f7bc7e7e1179d11ecbfe50cbe4c47e342" +dependencies = [ + "coarsetime", + "crossbeam-queue", + "derive_more", + "futures", + "futures-timer", + "nanorand", + "thiserror", + "tracing", +] + +[[package]] +name = "prioritized-metered-channel" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a172e6cc603231f2cf004232eabcecccc0da53ba576ab286ef7baa0cfc7927ad" +dependencies = [ + "coarsetime", + "crossbeam-queue", + "derive_more", + "futures", + "futures-timer", + "nanorand", + "thiserror", + "tracing", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.2", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-warning" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prometheus" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot 0.12.1", + "thiserror", +] + +[[package]] +name = "prometheus-client" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.1", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +dependencies = [ + "bytes", + "heck", + "itertools 0.10.5", + "lazy_static", + "log", + "multimap", + "petgraph", + "prettyplease 0.1.25", + "prost", + "prost-types", + "regex", + "syn 1.0.109", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +dependencies = [ + "prost", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "quicksink" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" +dependencies = [ + "futures-core", + "futures-sink", + "pin-project-lite 0.1.12", +] + +[[package]] +name = "quinn-proto" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +dependencies = [ + "bytes", + "rand", + "ring 0.16.20", + "rustc-hash", + "rustls 0.20.9", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] name = "rand_chacha" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.12", +] + +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "yasna", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +dependencies = [ + "getrandom 0.2.12", + "libredox", + "thiserror", +] + +[[package]] +name = "reed-solomon-novelpoly" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58130877ca403ab42c864fbac74bb319a0746c07a634a92a5cfc7f54af272582" +dependencies = [ + "derive_more", + "fs-err", + "itertools 0.11.0", + "static_init", + "thiserror", +] + +[[package]] +name = "ref-cast" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "regalloc2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" +dependencies = [ + "fxhash", + "log", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle 2.5.0", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom 0.2.12", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rocksdb" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" +dependencies = [ + "libc", + "librocksdb-sys", +] + +[[package]] +name = "rococo-runtime-constants" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b5b507493a19b5061eb2860c394847261216c7ea7f8f62ba2cb02e55c27d611" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec", + "sp-core", + "sp-runtime", + "sp-weights", + "staging-xcm", + "staging-xcm-builder", +] + +[[package]] +name = "rpassword" +version = "7.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" +dependencies = [ + "libc", + "rtoolbox", + "windows-sys 0.48.0", +] + +[[package]] +name = "rtnetlink" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +dependencies = [ + "futures", + "log", + "netlink-packet-route", + "netlink-proto", + "nix", + "thiserror", + "tokio", +] + +[[package]] +name = "rtoolbox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", + "semver 0.9.0", ] [[package]] -name = "rand_core" -version = "0.5.1" +name = "rustc_version" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "getrandom 0.1.16", + "semver 1.0.18", ] [[package]] -name = "rand_core" -version = "0.6.4" +name = "rusticata-macros" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" dependencies = [ - "getrandom 0.2.12", + "nom", ] [[package]] -name = "rand_distr" -version = "0.4.3" +name = "rustix" +version = "0.36.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" dependencies = [ - "num-traits", - "rand", + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", ] [[package]] -name = "rawpointer" -version = "0.2.1" +name = "rustix" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys 0.4.12", + "windows-sys 0.52.0", +] [[package]] -name = "rayon" -version = "1.8.0" +name = "rustls" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ - "either", - "rayon-core", + "log", + "ring 0.16.20", + "sct", + "webpki", ] [[package]] -name = "rayon-core" -version = "1.12.0" +name = "rustls" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ - "crossbeam-deque", - "crossbeam-utils", + "log", + "ring 0.17.7", + "rustls-webpki", + "sct", ] [[package]] -name = "rcgen" -version = "0.10.0" +name = "rustls-native-certs" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ - "pem", - "ring 0.16.20", - "time", - "yasna", + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", ] [[package]] -name = "redox_syscall" -version = "0.2.16" +name = "rustls-pemfile" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "bitflags 1.3.2", + "base64 0.21.6", ] [[package]] -name = "redox_syscall" -version = "0.4.1" +name = "rustls-webpki" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "bitflags 1.3.2", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] -name = "redox_users" -version = "0.4.4" +name = "rustversion" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "rw-stream-sink" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ - "getrandom 0.2.12", - "libredox", - "thiserror", + "futures", + "pin-project", + "static_assertions", ] [[package]] -name = "ref-cast" -version = "1.0.20" +name = "ryu" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "safe-mix" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" dependencies = [ - "ref-cast-impl", + "rustc_version 0.2.3", ] [[package]] -name = "ref-cast-impl" -version = "1.0.20" +name = "safe_arch" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" +checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", + "bytemuck", ] [[package]] -name = "regalloc2" -version = "0.6.1" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sc-allocator" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b05714bc70605d5f8983612d1643d875cd4782ef53a8720907a0eb75070cba" dependencies = [ - "fxhash", "log", - "slice-group-by", - "smallvec", + "sp-core", + "sp-wasm-interface", + "thiserror", ] [[package]] -name = "regex" -version = "1.10.2" +name = "sc-authority-discovery" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "a1c23040352415cdcc22203d3b18e56f3516e51865f106f8bbf7efa95b411a59" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", + "async-trait", + "futures", + "futures-timer", + "ip_network", + "libp2p", + "log", + "multihash 0.18.1", + "multihash-codetable", + "parity-scale-codec", + "prost", + "prost-build", + "rand", + "sc-client-api", + "sc-network", + "sp-api", + "sp-authority-discovery", + "sp-blockchain", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-basic-authorship" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c016e38155386e23649a4a995ea67c55a1fe25a54c7cc7509954d454ee75eb3b" +dependencies = [ + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "sc-block-builder", + "sc-proposer-metrics", + "sc-telemetry", + "sc-transaction-pool-api", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-inherents", + "sp-runtime", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-block-builder" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "656b85de8aad8dd758f2e5f250f300e4711f294f238c9299064fbd624cb263f7" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-trie", +] + +[[package]] +name = "sc-chain-spec" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7f6a6926973e084fe9b23ffee9784cd41d84ea0627c605891542661bd9ff958" +dependencies = [ + "array-bytes 6.2.2", + "docify", + "log", + "memmap2", + "parity-scale-codec", + "sc-chain-spec-derive", + "sc-client-api", + "sc-executor", + "sc-network", + "sc-telemetry", + "serde", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-genesis-builder", + "sp-io", + "sp-runtime", + "sp-state-machine", ] [[package]] -name = "regex-automata" -version = "0.1.10" +name = "sc-chain-spec-derive" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "f2e80fbdaea194762d4b4b0eec389037c25ad102676203b42d684774ae3019b8" dependencies = [ - "regex-syntax 0.6.29", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] -name = "regex-automata" -version = "0.4.3" +name = "sc-cli" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "9819b656041094ca4e97402be145c2bcf3f47d00d854708b25ecd3211eafcd62" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.2", + "array-bytes 6.2.2", + "bip39", + "chrono", + "clap", + "fdlimit", + "futures", + "itertools 0.10.5", + "libp2p-identity", + "log", + "names", + "parity-scale-codec", + "rand", + "regex", + "rpassword", + "sc-client-api", + "sc-client-db", + "sc-keystore", + "sc-mixnet", + "sc-network", + "sc-service", + "sc-telemetry", + "sc-tracing", + "sc-utils", + "serde", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-keyring", + "sp-keystore", + "sp-panic-handler", + "sp-runtime", + "sp-version", + "thiserror", + "tokio", ] [[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "resolv-conf" -version = "0.7.0" +name = "sc-client-api" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +checksum = "af05565a0f6467ebe0b430f3a44524fecee9e4aff621647ea5eab8833f775b6f" dependencies = [ - "hostname", - "quick-error", + "fnv", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-executor", + "sc-transaction-pool-api", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-database", + "sp-externalities", + "sp-runtime", + "sp-state-machine", + "sp-statement-store", + "sp-storage", + "sp-trie", + "substrate-prometheus-endpoint", ] [[package]] -name = "rfc6979" -version = "0.4.0" +name = "sc-client-db" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +checksum = "6db9fbd18eb275120fdf2e9558a5006a69022405abb9c260c91d218ddb05db39" dependencies = [ - "hmac 0.12.1", - "subtle 2.5.0", + "hash-db", + "kvdb", + "kvdb-memorydb", + "kvdb-rocksdb", + "linked-hash-map", + "log", + "parity-db", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-state-db", + "schnellru", + "sp-arithmetic", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-runtime", + "sp-state-machine", + "sp-trie", ] [[package]] -name = "ring" -version = "0.16.20" +name = "sc-consensus" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "3b0409758bb01f2e975b01c7cb2203aa27746e9796a483b18c57123e6e78fae5" dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", + "async-trait", + "futures", + "futures-timer", + "libp2p-identity", + "log", + "mockall", + "parking_lot 0.12.1", + "sc-client-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", + "substrate-prometheus-endpoint", + "thiserror", ] [[package]] -name = "ring" -version = "0.17.7" +name = "sc-consensus-babe" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "0a7d698d9d2bde7e0b80e7ada57ede9255a6382da79d2ad9a4e9e70805c40e74" dependencies = [ - "cc", - "getrandom 0.2.12", - "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys 0.48.0", + "async-trait", + "fork-tree", + "futures", + "log", + "num-bigint", + "num-rational", + "num-traits", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-consensus", + "sc-consensus-epochs", + "sc-consensus-slots", + "sc-telemetry", + "sc-transaction-pool-api", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", ] [[package]] -name = "rlp" -version = "0.5.2" +name = "sc-consensus-babe-rpc" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +checksum = "f2f55379d0ce6f87026f896f03bce33862b57f77a46fbb4fb7e974182d20d458" dependencies = [ - "bytes", - "rustc-hex", + "futures", + "jsonrpsee", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-rpc-api", + "serde", + "sp-api", + "sp-application-crypto", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror", ] [[package]] -name = "rococo-runtime-constants" -version = "7.0.0" +name = "sc-consensus-beefy" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b5b507493a19b5061eb2860c394847261216c7ea7f8f62ba2cb02e55c27d611" +checksum = "3664a3cddc718187e058f67d9075ef9078c8f8347c0408304ead8565d4ba8164" dependencies = [ - "frame-support", - "polkadot-primitives", - "polkadot-runtime-common", - "smallvec", + "array-bytes 6.2.2", + "async-channel", + "async-trait", + "fnv", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-gossip", + "sc-network-sync", + "sc-utils", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", "sp-core", + "sp-keystore", + "sp-mmr-primitives", "sp-runtime", - "sp-weights", - "staging-xcm", - "staging-xcm-builder", + "substrate-prometheus-endpoint", + "thiserror", + "tokio", + "wasm-timer", ] [[package]] -name = "rtnetlink" -version = "0.10.1" +name = "sc-consensus-beefy-rpc" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +checksum = "9b4e3602efe1e206032164772c24365642e3dab807c5f8db0af166f6ef63af3e" dependencies = [ "futures", + "jsonrpsee", "log", - "netlink-packet-route", - "netlink-proto", - "nix", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-consensus-beefy", + "sc-rpc", + "serde", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", "thiserror", - "tokio", ] [[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-hex" -version = "2.1.0" +name = "sc-consensus-epochs" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +checksum = "0d0befddf2ca16d5f222968fceeab8625532f2d49303fafd17ae2e5d0e939da6" +dependencies = [ + "fork-tree", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sp-blockchain", + "sp-runtime", +] [[package]] -name = "rustc_version" -version = "0.2.3" +name = "sc-consensus-grandpa" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +checksum = "a824457a3384e7bc19d7ee587dffa5b646deb81a2351be0dd075c2110a3d677a" dependencies = [ - "semver 0.9.0", + "ahash 0.8.8", + "array-bytes 6.2.2", + "async-trait", + "dyn-clone", + "finality-grandpa", + "fork-tree", + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "rand", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-network-sync", + "sc-telemetry", + "sc-transaction-pool-api", + "sc-utils", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", ] [[package]] -name = "rustc_version" -version = "0.4.0" +name = "sc-consensus-grandpa-rpc" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "694328880bf11fce67f5e066d7884dbdf1f2a41c42a7dfce9b0a6bc6b90448a1" dependencies = [ - "semver 1.0.18", + "finality-grandpa", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus-grandpa", + "sc-rpc", + "serde", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", ] [[package]] -name = "rusticata-macros" -version = "4.1.0" +name = "sc-consensus-slots" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +checksum = "6649665fcf91d89c16bfb08e9326baf6547e5fe719d6438197434e5b642d716b" dependencies = [ - "nom", + "async-trait", + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sc-telemetry", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", ] [[package]] -name = "rustix" -version = "0.36.17" +name = "sc-executor" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" +checksum = "3129f8af1f8aa5b05829ffec942feff61163054a536704ba48fdcc2276f6042a" dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-executor-common", + "sc-executor-wasmtime", + "schnellru", + "sp-api", + "sp-core", + "sp-externalities", + "sp-io", + "sp-panic-handler", + "sp-runtime-interface", + "sp-trie", + "sp-version", + "sp-wasm-interface", + "tracing", ] [[package]] -name = "rustix" -version = "0.38.28" +name = "sc-executor-common" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "0285a4a14c0d2c1d04380ff83cddd79181ded510c605d36804cb9c6eb3bbf2ae" dependencies = [ - "bitflags 2.4.1", - "errno", - "libc", - "linux-raw-sys 0.4.12", - "windows-sys 0.52.0", + "sc-allocator", + "sp-maybe-compressed-blob", + "sp-wasm-interface", + "thiserror", + "wasm-instrument", ] [[package]] -name = "rustls" -version = "0.20.9" +name = "sc-executor-wasmtime" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "5c2ba6ea0e68400caf4847fbcfca6123952b05a817e06f024e9cbafa665ac9d8" dependencies = [ + "anyhow", + "cfg-if", + "libc", "log", - "ring 0.16.20", - "sct", - "webpki", + "parking_lot 0.12.1", + "rustix 0.36.17", + "sc-allocator", + "sc-executor-common", + "sp-runtime-interface", + "sp-wasm-interface", + "wasmtime", ] [[package]] -name = "rustls" -version = "0.21.10" +name = "sc-informant" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "7e07d2dde727c30974767aed4cddd241447c0a800b702662b529dd2e32a10db1" dependencies = [ + "ansi_term", + "futures", + "futures-timer", "log", - "ring 0.17.7", - "rustls-webpki", - "sct", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-network-sync", + "sp-blockchain", + "sp-runtime", ] [[package]] -name = "rustls-native-certs" -version = "0.6.3" +name = "sc-keystore" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "93acb7f7c6e5e4be067e78b782a35d1a6d34dafcd955975a1aec05cab9dbf8fe" dependencies = [ - "openssl-probe", - "rustls-pemfile", - "schannel", - "security-framework", + "array-bytes 6.2.2", + "parking_lot 0.12.1", + "serde_json", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror", ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "sc-mixnet" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "4cac7d7145c712c4a8b184b3979fe1a154c200ebb1b9f11f1e4e39db97a389f8" dependencies = [ - "base64 0.21.6", + "array-bytes 4.2.0", + "arrayvec 0.7.4", + "blake2 0.10.6", + "bytes", + "futures", + "futures-timer", + "libp2p-identity", + "log", + "mixnet", + "multiaddr", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-network", + "sc-transaction-pool-api", + "sp-api", + "sp-consensus", + "sp-core", + "sp-keystore", + "sp-mixnet", + "sp-runtime", + "thiserror", ] [[package]] -name = "rustls-webpki" -version = "0.101.7" +name = "sc-network" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "7f2f49eccabc1de61ff976a184f5380a230f07baa5cb075a31c8ec9459fcd076" dependencies = [ - "ring 0.17.7", - "untrusted 0.9.0", + "array-bytes 6.2.2", + "async-channel", + "async-trait", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures", + "futures-timer", + "ip_network", + "libp2p", + "linked_hash_set", + "log", + "mockall", + "parity-scale-codec", + "parking_lot 0.12.1", + "partial_sort", + "pin-project", + "rand", + "sc-client-api", + "sc-network-common", + "sc-utils", + "serde", + "serde_json", + "smallvec", + "sp-arithmetic", + "sp-blockchain", + "sp-core", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "tokio", + "tokio-stream", + "unsigned-varint", + "wasm-timer", + "zeroize", ] [[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - -[[package]] -name = "rw-stream-sink" -version = "0.3.0" +name = "sc-network-bitswap" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" +checksum = "2779d97eff742c1ebcce812bfd154a7273c2c2eb02e11fad76cf7eb583365834" dependencies = [ + "async-channel", + "cid", "futures", - "pin-project", - "static_assertions", + "libp2p-identity", + "log", + "prost", + "prost-build", + "sc-client-api", + "sc-network", + "sp-blockchain", + "sp-runtime", + "thiserror", + "unsigned-varint", ] [[package]] -name = "ryu" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "safe-mix" -version = "1.0.1" +name = "sc-network-common" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" +checksum = "9b798acc12d5b3120b2d5e8a078fcec39d6732089261136ac31c993235ade917" dependencies = [ - "rustc_version 0.2.3", + "async-trait", + "bitflags 1.3.2", + "futures", + "libp2p-identity", + "parity-scale-codec", + "prost-build", + "sc-consensus", + "sp-consensus", + "sp-consensus-grandpa", + "sp-runtime", ] [[package]] -name = "safe_arch" -version = "0.7.1" +name = "sc-network-gossip" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +checksum = "cd92792f3a04fcb1f21018c9f8a5d6d438d705a2548ffcdc7730280c667b8386" dependencies = [ - "bytemuck", + "ahash 0.8.8", + "futures", + "futures-timer", + "libp2p", + "log", + "sc-network", + "sc-network-common", + "sc-network-sync", + "schnellru", + "sp-runtime", + "substrate-prometheus-endpoint", + "tracing", ] [[package]] -name = "same-file" -version = "1.0.6" +name = "sc-network-light" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "34e7a126492850dbbd5cf0b77ec3ad350422c2822d165941ddbe618a76af0153" dependencies = [ - "winapi-util", + "array-bytes 6.2.2", + "async-channel", + "futures", + "libp2p-identity", + "log", + "parity-scale-codec", + "prost", + "prost-build", + "sc-client-api", + "sc-network", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", ] [[package]] -name = "sc-allocator" -version = "23.0.0" +name = "sc-network-sync" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b05714bc70605d5f8983612d1643d875cd4782ef53a8720907a0eb75070cba" +checksum = "c4c92fd35c49f748abf0bf420e1e99aa76b0f48ab43c183ea5dacef951116d7e" dependencies = [ + "array-bytes 6.2.2", + "async-channel", + "async-trait", + "fork-tree", + "futures", + "futures-timer", + "libp2p", "log", + "mockall", + "parity-scale-codec", + "prost", + "prost-build", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-utils", + "schnellru", + "smallvec", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", "sp-core", - "sp-wasm-interface", + "sp-runtime", + "substrate-prometheus-endpoint", "thiserror", + "tokio", + "tokio-stream", ] [[package]] -name = "sc-block-builder" +name = "sc-network-transactions" version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "656b85de8aad8dd758f2e5f250f300e4711f294f238c9299064fbd624cb263f7" +checksum = "99a1af3b9e158fa91df0cd92916b3ee5d8b8a14a2b61eb5dd9e36e045808f644" dependencies = [ + "array-bytes 6.2.2", + "futures", + "libp2p", + "log", "parity-scale-codec", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-core", - "sp-inherents", + "sc-network", + "sc-network-common", + "sc-network-sync", + "sc-utils", + "sp-consensus", "sp-runtime", - "sp-trie", + "substrate-prometheus-endpoint", ] [[package]] -name = "sc-chain-spec" -version = "27.0.0" +name = "sc-offchain" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7f6a6926973e084fe9b23ffee9784cd41d84ea0627c605891542661bd9ff958" +checksum = "cd5408dbdc3fe345813e983bd2b7ecf8f20e996141fa39a36336f511ab1859bb" dependencies = [ "array-bytes 6.2.2", - "docify", + "bytes", + "fnv", + "futures", + "futures-timer", + "hyper", + "hyper-rustls", + "libp2p", "log", - "memmap2", + "num_cpus", + "once_cell", "parity-scale-codec", - "sc-chain-spec-derive", + "parking_lot 0.12.1", + "rand", "sc-client-api", - "sc-executor", "sc-network", - "sc-telemetry", - "serde", - "serde_json", - "sp-blockchain", + "sc-network-common", + "sc-transaction-pool-api", + "sc-utils", + "sp-api", "sp-core", - "sp-genesis-builder", - "sp-io", + "sp-externalities", + "sp-keystore", + "sp-offchain", "sp-runtime", - "sp-state-machine", + "threadpool", + "tracing", ] [[package]] -name = "sc-chain-spec-derive" -version = "11.0.0" +name = "sc-proposer-metrics" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2e80fbdaea194762d4b4b0eec389037c25ad102676203b42d684774ae3019b8" +checksum = "fb8dadb2ae5a316e4d08cad6aacd5de1dec792f3bd94e3960795ff7ffd07211c" dependencies = [ - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 2.0.48", + "log", + "substrate-prometheus-endpoint", ] [[package]] -name = "sc-client-api" -version = "28.0.0" +name = "sc-rpc" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af05565a0f6467ebe0b430f3a44524fecee9e4aff621647ea5eab8833f775b6f" +checksum = "4ac0d83b9117c9c004e58331a593a28044eaf6414e5b3c605d1571b4a6981966" dependencies = [ - "fnv", "futures", + "jsonrpsee", "log", "parity-scale-codec", "parking_lot 0.12.1", - "sc-executor", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-mixnet", + "sc-rpc-api", + "sc-tracing", "sc-transaction-pool-api", "sc-utils", + "serde_json", "sp-api", "sp-blockchain", - "sp-consensus", "sp-core", - "sp-database", - "sp-externalities", + "sp-keystore", + "sp-offchain", + "sp-rpc", "sp-runtime", - "sp-state-machine", + "sp-session", "sp-statement-store", - "sp-storage", - "sp-trie", - "substrate-prometheus-endpoint", + "sp-version", + "tokio", ] [[package]] -name = "sc-consensus" +name = "sc-rpc-api" version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0409758bb01f2e975b01c7cb2203aa27746e9796a483b18c57123e6e78fae5" +checksum = "630e81a436f32487452ae1a57ad0ba31f320ddf864bb7faefd7490fe16b3e139" dependencies = [ - "async-trait", + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-mixnet", + "sc-transaction-pool-api", + "scale-info", + "serde", + "serde_json", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-version", + "thiserror", +] + +[[package]] +name = "sc-rpc-server" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b623908525a2f22aafa079080aa7fbce8b58ca8de53b9f31e3cc8547e0ad8b2" +dependencies = [ + "http", + "jsonrpsee", + "log", + "serde_json", + "substrate-prometheus-endpoint", + "tokio", + "tower", + "tower-http", +] + +[[package]] +name = "sc-rpc-spec-v2" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a54150c808fa10364b73faedd97aff0977a911a521d1caa8bad2bdc7943ad579" +dependencies = [ + "array-bytes 6.2.2", "futures", - "futures-timer", - "libp2p-identity", + "futures-util", + "hex", + "jsonrpsee", "log", - "mockall", + "parity-scale-codec", "parking_lot 0.12.1", + "sc-chain-spec", "sc-client-api", + "sc-transaction-pool-api", "sc-utils", "serde", "sp-api", "sp-blockchain", - "sp-consensus", "sp-core", + "sp-rpc", "sp-runtime", - "sp-state-machine", - "substrate-prometheus-endpoint", + "sp-version", "thiserror", + "tokio", + "tokio-stream", ] [[package]] -name = "sc-consensus-grandpa" -version = "0.19.0" +name = "sc-service" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a824457a3384e7bc19d7ee587dffa5b646deb81a2351be0dd075c2110a3d677a" +checksum = "703bd8b1fc0a137185bfa0b654e04283a58a1d8a2751380e7a0eca919961f150" dependencies = [ - "ahash 0.8.8", - "array-bytes 6.2.2", "async-trait", - "dyn-clone", - "finality-grandpa", - "fork-tree", + "directories", + "exit-future", "futures", "futures-timer", + "jsonrpsee", "log", "parity-scale-codec", "parking_lot 0.12.1", + "pin-project", "rand", - "sc-block-builder", "sc-chain-spec", "sc-client-api", + "sc-client-db", "sc-consensus", + "sc-executor", + "sc-informant", + "sc-keystore", "sc-network", + "sc-network-bitswap", "sc-network-common", - "sc-network-gossip", + "sc-network-light", "sc-network-sync", + "sc-network-transactions", + "sc-rpc", + "sc-rpc-server", + "sc-rpc-spec-v2", + "sc-sysinfo", "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", "sc-transaction-pool-api", "sc-utils", + "serde", "serde_json", "sp-api", - "sp-application-crypto", - "sp-arithmetic", "sp-blockchain", "sp-consensus", - "sp-consensus-grandpa", "sp-core", + "sp-externalities", "sp-keystore", "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-storage", + "sp-transaction-pool", + "sp-transaction-storage-proof", + "sp-trie", + "sp-version", + "static_init", "substrate-prometheus-endpoint", + "tempfile", "thiserror", + "tokio", + "tracing", + "tracing-futures", ] [[package]] -name = "sc-executor" -version = "0.32.0" +name = "sc-state-db" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3129f8af1f8aa5b05829ffec942feff61163054a536704ba48fdcc2276f6042a" +checksum = "fac20128b09ac6305aaf482a72c918b35400f3955d7032971df499b0661a5e76" dependencies = [ + "log", "parity-scale-codec", "parking_lot 0.12.1", - "sc-executor-common", - "sc-executor-wasmtime", - "schnellru", - "sp-api", "sp-core", - "sp-externalities", - "sp-io", - "sp-panic-handler", - "sp-runtime-interface", - "sp-trie", - "sp-version", - "sp-wasm-interface", - "tracing", ] [[package]] -name = "sc-executor-common" -version = "0.29.0" +name = "sc-sync-state-rpc" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0285a4a14c0d2c1d04380ff83cddd79181ded510c605d36804cb9c6eb3bbf2ae" +checksum = "cb310dce9d2474a74152605dc0ca0f81a46f61ba4e7a39752f1203121f47c0c6" dependencies = [ - "sc-allocator", - "sp-maybe-compressed-blob", - "sp-wasm-interface", + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "serde", + "serde_json", + "sp-blockchain", + "sp-runtime", "thiserror", - "wasm-instrument", -] - -[[package]] -name = "sc-executor-wasmtime" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c2ba6ea0e68400caf4847fbcfca6123952b05a817e06f024e9cbafa665ac9d8" -dependencies = [ - "anyhow", - "cfg-if", - "libc", - "log", - "parking_lot 0.12.1", - "rustix 0.36.17", - "sc-allocator", - "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", - "wasmtime", ] [[package]] -name = "sc-mixnet" -version = "0.4.0" +name = "sc-sysinfo" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cac7d7145c712c4a8b184b3979fe1a154c200ebb1b9f11f1e4e39db97a389f8" +checksum = "bfc9a5da78281735c6ff3b8d0287e95dcf32fc001415ac20cb2844c0ab4e6d05" dependencies = [ - "array-bytes 4.2.0", - "arrayvec 0.7.4", - "blake2 0.10.6", - "bytes", + "derive_more", "futures", - "futures-timer", - "libp2p-identity", + "libc", "log", - "mixnet", - "multiaddr", - "parity-scale-codec", - "parking_lot 0.12.1", - "sc-client-api", - "sc-network", - "sc-transaction-pool-api", - "sp-api", - "sp-consensus", + "rand", + "rand_pcg", + "regex", + "sc-telemetry", + "serde", + "serde_json", "sp-core", - "sp-keystore", - "sp-mixnet", - "sp-runtime", - "thiserror", + "sp-io", + "sp-std", ] [[package]] -name = "sc-network" -version = "0.34.0" +name = "sc-telemetry" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2f49eccabc1de61ff976a184f5380a230f07baa5cb075a31c8ec9459fcd076" +checksum = "96841bdc22e1ad5931e6cb7557b06ef33aeda7f5eef3864653359840f9fd025a" dependencies = [ - "array-bytes 6.2.2", - "async-channel", - "async-trait", - "asynchronous-codec", - "bytes", - "either", - "fnv", + "chrono", "futures", - "futures-timer", - "ip_network", "libp2p", - "linked_hash_set", "log", - "mockall", - "parity-scale-codec", "parking_lot 0.12.1", - "partial_sort", "pin-project", "rand", - "sc-client-api", - "sc-network-common", "sc-utils", "serde", "serde_json", - "smallvec", - "sp-arithmetic", - "sp-blockchain", - "sp-core", - "sp-runtime", - "substrate-prometheus-endpoint", "thiserror", - "tokio", - "tokio-stream", - "unsigned-varint", "wasm-timer", - "zeroize", -] - -[[package]] -name = "sc-network-common" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b798acc12d5b3120b2d5e8a078fcec39d6732089261136ac31c993235ade917" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "futures", - "libp2p-identity", - "parity-scale-codec", - "prost-build", - "sc-consensus", - "sp-consensus", - "sp-consensus-grandpa", - "sp-runtime", -] - -[[package]] -name = "sc-network-gossip" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd92792f3a04fcb1f21018c9f8a5d6d438d705a2548ffcdc7730280c667b8386" -dependencies = [ - "ahash 0.8.8", - "futures", - "futures-timer", - "libp2p", - "log", - "sc-network", - "sc-network-common", - "sc-network-sync", - "schnellru", - "sp-runtime", - "substrate-prometheus-endpoint", - "tracing", ] [[package]] -name = "sc-network-sync" -version = "0.33.0" +name = "sc-tracing" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4c92fd35c49f748abf0bf420e1e99aa76b0f48ab43c183ea5dacef951116d7e" +checksum = "90864e5e042d1238bcb082b0fa73ce58b7eb4897127783dae1dd66eee59cdaef" dependencies = [ - "array-bytes 6.2.2", - "async-channel", - "async-trait", - "fork-tree", - "futures", - "futures-timer", - "libp2p", + "ansi_term", + "chrono", + "is-terminal", + "lazy_static", + "libc", "log", - "mockall", "parity-scale-codec", - "prost", - "prost-build", + "parking_lot 0.12.1", + "regex", + "rustc-hash", "sc-client-api", - "sc-consensus", - "sc-network", - "sc-network-common", - "sc-utils", - "schnellru", - "smallvec", - "sp-arithmetic", + "sc-tracing-proc-macro", + "serde", + "sp-api", "sp-blockchain", - "sp-consensus", - "sp-consensus-grandpa", "sp-core", + "sp-rpc", "sp-runtime", - "substrate-prometheus-endpoint", + "sp-tracing", "thiserror", - "tokio", - "tokio-stream", + "tracing", + "tracing-log", + "tracing-subscriber", ] [[package]] -name = "sc-rpc-api" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630e81a436f32487452ae1a57ad0ba31f320ddf864bb7faefd7490fe16b3e139" -dependencies = [ - "jsonrpsee", - "parity-scale-codec", - "sc-chain-spec", - "sc-mixnet", - "sc-transaction-pool-api", - "scale-info", - "serde", - "serde_json", - "sp-core", - "sp-rpc", - "sp-runtime", - "sp-version", - "thiserror", +name = "sc-tracing-proc-macro" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151cdf86d79abf22cf2a240a7ca95041c908dbd96c2ae9a818073042aa210964" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] -name = "sc-telemetry" -version = "15.0.0" +name = "sc-transaction-pool" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96841bdc22e1ad5931e6cb7557b06ef33aeda7f5eef3864653359840f9fd025a" +checksum = "f7985fab634814ee28fe3ecd2131fa2cb4c8eee88a7e60f1cd59dc0afa826fe2" dependencies = [ - "chrono", + "async-trait", "futures", - "libp2p", + "futures-timer", + "linked-hash-map", "log", + "parity-scale-codec", "parking_lot 0.12.1", - "pin-project", - "rand", + "sc-client-api", + "sc-transaction-pool-api", "sc-utils", "serde", - "serde_json", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-tracing", + "sp-transaction-pool", + "substrate-prometheus-endpoint", "thiserror", - "wasm-timer", ] [[package]] @@ -9368,6 +11995,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "seccompiler" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345a3e4dddf721a478089d4697b83c6c0a8f5bf16086f6c13397e4534eb6e2e5" +dependencies = [ + "libc", +] + [[package]] name = "secp256k1" version = "0.28.1" @@ -9519,6 +12155,17 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.8.2" @@ -9574,6 +12221,21 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + [[package]] name = "signature" version = "2.2.0" @@ -9603,6 +12265,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -9631,12 +12299,27 @@ dependencies = [ "sp-std", ] +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "version_check", +] + [[package]] name = "smallvec" version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" + [[package]] name = "snow" version = "0.9.4" @@ -9732,7 +12415,7 @@ checksum = "0694be2891593450916d6b53a274d234bccbc86bcbada36ba23fc356989070c7" dependencies = [ "Inflector", "blake2 0.10.6", - "expander", + "expander 2.0.0", "proc-macro-crate 3.1.0", "proc-macro2", "quote", @@ -9884,7 +12567,7 @@ dependencies = [ "sp-mmr-primitives", "sp-runtime", "sp-std", - "strum", + "strum 0.24.1", ] [[package]] @@ -9937,7 +12620,7 @@ dependencies = [ "hash-db", "hash256-std-hasher", "impl-serde", - "itertools", + "itertools 0.10.5", "libsecp256k1", "log", "merlin 3.0.0", @@ -10083,7 +12766,7 @@ checksum = "98165ce7c625a8cdb88d39c6bbd56fe8b32ada64ed0894032beba99795f557da" dependencies = [ "sp-core", "sp-runtime", - "strum", + "strum 0.24.1", ] [[package]] @@ -10252,7 +12935,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfaf6e85b2ec12a4b99cd6d8d57d083e30c94b7f1b0d8f93547121495aae6f0c" dependencies = [ "Inflector", - "expander", + "expander 2.0.0", "proc-macro-crate 3.1.0", "proc-macro2", "quote", @@ -10394,6 +13077,22 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "sp-transaction-storage-proof" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2a2c693bc7ca363c9d2cd412276582aef10c794399aaffbd1fe2351099a1a5" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-trie", +] + [[package]] name = "sp-trie" version = "29.0.0" @@ -10499,7 +13198,7 @@ checksum = "a0ef947f358b9c238923f764c72a4a9d42f2d637c46e059dbd319d6e7cfb4f82" dependencies = [ "lazy_static", "maplit", - "strum", + "strum 0.24.1", ] [[package]] @@ -10721,6 +13420,47 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags 1.3.2", + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "parking_lot_core 0.8.6", + "static_init_macro", + "winapi", +] + +[[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 1.0.109", +] + +[[package]] +name = "strobe-rs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabb238a1cccccfa4c4fb703670c0d157e1256c1ba695abf1b93bd2bb14bab2d" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "keccak", + "subtle 2.5.0", + "zeroize", +] + [[package]] name = "strsim" version = "0.10.0" @@ -10733,9 +13473,15 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros", + "strum_macros 0.24.3", ] +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" + [[package]] name = "strum_macros" version = "0.24.3" @@ -10749,6 +13495,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.48", +] + [[package]] name = "substrate-bip39" version = "0.4.5" @@ -10774,6 +13533,26 @@ dependencies = [ "substrate-typenum", ] +[[package]] +name = "substrate-frame-rpc-system" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcee7812a1e1cec85e3095c5d1c1627ceb084c0c81e66c2f9df7cb7b3a5938f3" +dependencies = [ + "frame-system-rpc-runtime-api", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-rpc-api", + "sc-transaction-pool-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-runtime", +] + [[package]] name = "substrate-geohash" version = "0.13.0" @@ -10812,6 +13591,24 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "substrate-state-trie-migration-rpc" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92c25dcb3e4aee5559c2bd9b4d105786220cad116719d7ebb39e4f359865d44" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-client-api", + "sc-rpc-api", + "serde", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-trie", + "trie-db", +] + [[package]] name = "substrate-typenum" version = "1.16.0" @@ -10834,7 +13631,7 @@ dependencies = [ "filetime", "parity-wasm", "sp-maybe-compressed-blob", - "strum", + "strum 0.24.1", "tempfile", "toml 0.8.2", "walkdir", @@ -10943,7 +13740,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.4.1", - "rustix 0.38.28", + "rustix 0.38.31", "windows-sys 0.48.0", ] @@ -10956,6 +13753,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix 0.38.31", + "windows-sys 0.48.0", +] + [[package]] name = "termtree" version = "0.4.1" @@ -10982,6 +13789,12 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "thousands" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" + [[package]] name = "thread_local" version = "1.1.7" @@ -10992,6 +13805,49 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "thrift" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b82ca8f46f95b3ce96081fe3dd89160fdea970c254bb72925255d1b62aae692e" +dependencies = [ + "byteorder", + "integer-encoding", + "log", + "ordered-float", + "threadpool", +] + +[[package]] +name = "tikv-jemalloc-ctl" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619bfed27d807b54f7f776b9430d4f8060e66ee138a28632ca898584d462c31c" +dependencies = [ + "libc", + "paste", + "tikv-jemalloc-sys", +] + +[[package]] +name = "tikv-jemalloc-sys" +version = "0.5.4+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "time" version = "0.3.30" @@ -11058,6 +13914,7 @@ dependencies = [ "num_cpus", "parking_lot 0.12.1", "pin-project-lite 0.2.13", + "signal-hook-registry", "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", @@ -11104,6 +13961,7 @@ dependencies = [ "futures-core", "pin-project-lite 0.2.13", "tokio", + "tokio-util", ] [[package]] @@ -11197,6 +14055,24 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +dependencies = [ + "bitflags 2.4.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "pin-project-lite 0.2.13", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.2" @@ -11242,6 +14118,41 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-gum" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f134d9dda0e872989ddf57b90ca73bcad27f1fba2cc19cfada7b76549c590b0" +dependencies = [ + "coarsetime", + "polkadot-primitives", + "tracing", + "tracing-gum-proc-macro", +] + +[[package]] +name = "tracing-gum-proc-macro" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f074568687ffdfd0adb6005aa8d1d96840197f2c159f80471285f08694cf0ce" +dependencies = [ + "expander 2.0.0", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "tracing-log" version = "0.1.4" @@ -11273,6 +14184,7 @@ dependencies = [ "chrono", "lazy_static", "matchers", + "parking_lot 0.11.2", "regex", "serde", "serde_json", @@ -11383,6 +14295,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + [[package]] name = "uint" version = "0.9.5" @@ -11558,6 +14476,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasix" +version = "0.12.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1fbb4ef9bbca0c1170e0b00dd28abc9e3b68669821600cad1caaed606583c6d" +dependencies = [ + "wasi 0.11.0+wasi-snapshot-preview1", +] + [[package]] name = "wasm-bindgen" version = "0.2.89" @@ -11641,8 +14568,8 @@ checksum = "fc942673e7684671f0c5708fc18993569d184265fd5223bb51fc8e5b9b6cfd52" dependencies = [ "anyhow", "libc", - "strum", - "strum_macros", + "strum 0.24.1", + "strum_macros 0.24.3", "tempfile", "thiserror", "wasm-opt-cxx-sys", @@ -11954,7 +14881,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.28", + "rustix 0.38.31", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 01efeb50b9..daf6373db0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,10 +26,22 @@ members = [ "system-parachains/constants", "system-parachains/encointer", "system-parachains/gluttons/glutton-kusama", - "integration-tests/emulated/assets/asset-hub-kusama", - "integration-tests/emulated/assets/asset-hub-polkadot", - "integration-tests/emulated/chains", - "integration-tests/emulated/common", + "integration-tests/emulated/chains/relays/kusama", + "integration-tests/emulated/chains/relays/polkadot", + "integration-tests/emulated/chains/parachains/assets/asset-hub-kusama", + "integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot", + "integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama", + "integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot", + "integration-tests/emulated/chains/parachains/collectives/collectives-polkadot", + "integration-tests/emulated/chains/parachains/testing/penpal", + "integration-tests/emulated/helpers", + "integration-tests/emulated/networks/kusama-system", + "integration-tests/emulated/networks/polkadot-system", + "integration-tests/emulated/networks/kusama-polkadot-system", + "integration-tests/emulated/tests/assets/asset-hub-kusama", + "integration-tests/emulated/tests/assets/asset-hub-polkadot", + "integration-tests/emulated/tests/bridges/bridge-hub-kusama", + "integration-tests/emulated/tests/bridges/bridge-hub-polkadot", ] [profile.release] diff --git a/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs b/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs deleted file mode 100644 index c0d8309201..0000000000 --- a/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Disable tests when `runtime-benchmarks` is enabled, because of `type MessageProcessor = -// pallet_message_queue::mock_helpers::NoopMessageProcessor`. -#![cfg(not(feature = "runtime-benchmarks"))] - -pub use asset_test_utils::xcm_helpers; -pub use codec::Encode; -pub use emulated_chains::{ - asset_hub_kusama::ED as ASSET_HUB_KUSAMA_ED, kusama::ED as KUSAMA_ED, - AssetHubKusamaPara as AssetHubKusama, AssetHubKusamaParaPallet as AssetHubKusamaPallet, - AssetHubKusamaParaReceiver as AssetHubKusamaReceiver, - AssetHubKusamaParaSender as AssetHubKusamaSender, BridgeHubKusamaPara as BridgeHubKusama, - BridgeHubKusamaParaReceiver as BridgeHubKusamaReceiver, KusamaRelay as Kusama, - KusamaRelayPallet as KusamaPallet, KusamaRelayReceiver as KusamaReceiver, - KusamaRelaySender as KusamaSender, PenpalKusamaAPara as PenpalKusamaA, - PenpalKusamaAParaPallet as PenpalKusamaAPallet, - PenpalKusamaAParaReceiver as PenpalKusamaAReceiver, - PenpalKusamaAParaSender as PenpalKusamaASender, PenpalKusamaBPara as PenpalKusamaB, - PenpalKusamaBParaPallet as PenpalKusamaBPallet, PenpalLocalTeleportableToAssetHub, - PenpalXcmConfig, -}; -pub use frame_support::{ - assert_err, assert_ok, - pallet_prelude::Weight, - sp_runtime::{AccountId32, DispatchError, DispatchResult}, - traits::fungibles::Inspect, -}; -pub use integration_tests_common::{ - test_parachain_is_trusted_teleporter, - xcm_helpers::{non_fee_asset, xcm_transact_paid_execution, xcm_transact_unpaid_execution}, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, -}; -pub use parachains_common::{AccountId, Balance}; -pub use xcm::{ - prelude::{AccountId32 as AccountId32Junction, *}, - v3::{Error, NetworkId::Kusama as KusamaId}, -}; -pub use xcm_emulator::{ - assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, - RelayChain as Relay, Test, TestArgs, TestContext, TestExt, -}; - -pub const ASSET_ID: u32 = 1; -pub const ASSET_MIN_BALANCE: u128 = 1000; -// `Assets` pallet index -pub const ASSETS_PALLET_ID: u8 = 50; - -pub type RelayToSystemParaTest = Test; -pub type RelayToParaTest = Test; -pub type SystemParaToRelayTest = Test; -pub type SystemParaToParaTest = Test; -pub type ParaToSystemParaTest = Test; - -/// Returns a `TestArgs` instance to be used for the Relay Chain across integration tests -pub fn relay_test_args( - dest: MultiLocation, - beneficiary_id: AccountId32, - amount: Balance, -) -> TestArgs { - TestArgs { - dest, - beneficiary: AccountId32Junction { network: None, id: beneficiary_id.into() }.into(), - amount, - assets: (Here, amount).into(), - asset_id: None, - fee_asset_item: 0, - weight_limit: WeightLimit::Unlimited, - } -} - -/// Returns a `TestArgs` instance to be used by parachains across integration tests -pub fn para_test_args( - dest: MultiLocation, - beneficiary_id: AccountId32, - amount: Balance, - assets: MultiAssets, - asset_id: Option, - fee_asset_item: u32, -) -> TestArgs { - TestArgs { - dest, - beneficiary: AccountId32Junction { network: None, id: beneficiary_id.into() }.into(), - amount, - assets, - asset_id, - fee_asset_item, - weight_limit: WeightLimit::Unlimited, - } -} - -#[cfg(test)] -#[cfg(not(feature = "runtime-benchmarks"))] -mod tests; diff --git a/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml b/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml deleted file mode 100644 index 20abd3db11..0000000000 --- a/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml +++ /dev/null @@ -1,35 +0,0 @@ -[package] -name = "asset-hub-polkadot-integration-tests" -version = "1.0.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -description = "Asset Hub Polkadot runtime integration tests with xcm-emulator" -publish = false - -[dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9" } - -# Substrate -sp-runtime = { version = "31.0.1" } -frame-support = { version = "28.0.0" } -pallet-assets = { version = "29.0.0" } -pallet-balances = { version = "28.0.0" } -pallet-message-queue = { version = "31.0.0" } - -# Polkadot -xcm = { package = "staging-xcm", version = "7.0.0" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "7.0.0" } -pallet-xcm = { version = "7.0.0" } - -# Cumulus -parachains-common = { version = "7.0.0" } -xcm-emulator = { version = "0.5.0" } -asset-test-utils = { version = "7.0.1" } - -# Local -emulated-chains = { path = "../../chains" } -integration-tests-common = { path = "../../common" } -asset-hub-polkadot-runtime = { path = "../../../../system-parachains/asset-hubs/asset-hub-polkadot" } -polkadot-runtime = { path = "../../../../relay/polkadot" } -system-parachains-constants = { path = "../../../../system-parachains/constants" } diff --git a/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs b/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs deleted file mode 100644 index f006fc54b3..0000000000 --- a/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Disable tests when `runtime-benchmarks` is enabled, because of `type MessageProcessor = -// pallet_message_queue::mock_helpers::NoopMessageProcessor`. -#![cfg(not(feature = "runtime-benchmarks"))] - -pub use asset_test_utils::xcm_helpers; -pub use codec::Encode; -pub use emulated_chains::{ - asset_hub_polkadot::ED as ASSET_HUB_POLKADOT_ED, polkadot::ED as POLKADOT_ED, - AssetHubPolkadotPara as AssetHubPolkadot, AssetHubPolkadotParaPallet as AssetHubPolkadotPallet, - AssetHubPolkadotParaReceiver as AssetHubPolkadotReceiver, - AssetHubPolkadotParaSender as AssetHubPolkadotSender, - BridgeHubPolkadotPara as BridgeHubPolkadot, - BridgeHubPolkadotParaReceiver as BridgeHubPolkadotReceiver, PenpalLocalTeleportableToAssetHub, - PenpalPolkadotAPara as PenpalPolkadotA, PenpalPolkadotAParaPallet as PenpalPolkadotAPallet, - PenpalPolkadotAParaReceiver as PenpalPolkadotAReceiver, - PenpalPolkadotAParaSender as PenpalPolkadotASender, PenpalPolkadotBPara as PenpalPolkadotB, - PenpalPolkadotBParaPallet as PenpalPolkadotBPallet, PenpalXcmConfig, PolkadotRelay as Polkadot, - PolkadotRelayPallet as PolkadotPallet, PolkadotRelayReceiver as PolkadotReceiver, - PolkadotRelaySender as PolkadotSender, -}; -pub use frame_support::{ - assert_err, assert_ok, - pallet_prelude::Weight, - sp_runtime::{AccountId32, DispatchError, DispatchResult}, - traits::fungibles::Inspect, -}; -pub use integration_tests_common::{ - test_parachain_is_trusted_teleporter, - xcm_helpers::{non_fee_asset, xcm_transact_paid_execution, xcm_transact_unpaid_execution}, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, -}; -pub use parachains_common::{AccountId, Balance}; -pub use xcm::{ - prelude::{AccountId32 as AccountId32Junction, *}, - v3::{Error, NetworkId::Polkadot as PolkadotId}, -}; -pub use xcm_emulator::{ - assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, - RelayChain as Relay, Test, TestArgs, TestContext, TestExt, -}; - -pub const ASSET_ID: u32 = 1; -pub const ASSET_MIN_BALANCE: u128 = 1000; -// `Assets` pallet index -pub const ASSETS_PALLET_ID: u8 = 50; - -pub type RelayToSystemParaTest = Test; -pub type RelayToParaTest = Test; -pub type SystemParaToRelayTest = Test; -pub type SystemParaToParaTest = Test; -pub type ParaToSystemParaTest = Test; - -/// Returns a `TestArgs` instance to be used for the Relay Chain across integration tests -pub fn relay_test_args( - dest: MultiLocation, - beneficiary_id: AccountId32, - amount: Balance, -) -> TestArgs { - TestArgs { - dest, - beneficiary: AccountId32Junction { network: None, id: beneficiary_id.into() }.into(), - amount, - assets: (Here, amount).into(), - asset_id: None, - fee_asset_item: 0, - weight_limit: WeightLimit::Unlimited, - } -} - -/// Returns a `TestArgs` instance to be used by parachains across integration tests -pub fn para_test_args( - dest: MultiLocation, - beneficiary_id: AccountId32, - amount: Balance, - assets: MultiAssets, - asset_id: Option, - fee_asset_item: u32, -) -> TestArgs { - TestArgs { - dest, - beneficiary: AccountId32Junction { network: None, id: beneficiary_id.into() }.into(), - amount, - assets, - asset_id, - fee_asset_item, - weight_limit: WeightLimit::Unlimited, - } -} - -#[cfg(test)] -#[cfg(not(feature = "runtime-benchmarks"))] -mod tests; diff --git a/integration-tests/emulated/chains/Cargo.toml b/integration-tests/emulated/chains/Cargo.toml deleted file mode 100644 index 63d3773efb..0000000000 --- a/integration-tests/emulated/chains/Cargo.toml +++ /dev/null @@ -1,44 +0,0 @@ -[package] -name = "emulated-chains" -version = "1.0.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -description = "Definitions of the fellows emulated relay+para runtimes" - -[dependencies] - -# Substrate -grandpa-primitives = { package = "sp-consensus-grandpa", version = "13.0.0" } -sp-authority-discovery = { version = "26.0.0" } -sp-runtime = { version = "31.0.1" } -frame-support = { version = "28.0.0" } -sp-core = { version = "28.0.0" } -sp-consensus-babe = { version = "0.32.0" } -pallet-im-online = { version = "27.0.0" } -pallet-staking = { version = "28.0.0" } -beefy-primitives = { package = "sp-consensus-beefy", version = "13.0.0" } - -# Polkadot -polkadot-primitives = { version = "7.0.0" } -polkadot-runtime-parachains = { version = "7.0.0" } -polkadot-parachain-primitives = { version = "6.0.0" } - -# Cumulus -parachains-common = { version = "7.0.0" } -cumulus-primitives-core = { version = "0.7.0" } -xcm-emulator = { version = "0.5.0" } -penpal-runtime = { version = "0.14.3" } - -# Local runtimes -kusama-runtime = { package = "staging-kusama-runtime", path = "../../../relay/kusama" } -kusama-runtime-constants = { path = "../../../relay/kusama/constants" } -polkadot-runtime = { path = "../../../relay/polkadot" } -polkadot-runtime-constants = { path = "../../../relay/polkadot/constants" } -asset-hub-polkadot-runtime = { path = "../../../system-parachains/asset-hubs/asset-hub-polkadot" } -asset-hub-kusama-runtime = { path = "../../../system-parachains/asset-hubs/asset-hub-kusama" } -collectives-polkadot-runtime = { path = "../../../system-parachains/collectives/collectives-polkadot" } -bridge-hub-polkadot-runtime = { path = "../../../system-parachains/bridge-hubs/bridge-hub-polkadot" } -bridge-hub-kusama-runtime = { path = "../../../system-parachains/bridge-hubs/bridge-hub-kusama" } -# TODO: replace with `emulated-integration-tests-common@X.Y.Z` from `polkadot-sdk` -integration-tests-common = { path = "../common" } diff --git a/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/Cargo.toml b/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/Cargo.toml new file mode 100644 index 0000000000..0b4f070c48 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "asset-hub-kusama-emulated-chain" +version = "0.0.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Asset Hub Kusama emulated chain used for integration tests" +publish = false + +[dependencies] +serde_json = "1.0.111" + +# Substrate +sp-core = { version = "28.0.0" } +sp-runtime = { version = "31.0.1" } +frame-support = { version = "28.0.0" } + +# Cumulus +parachains-common = { version = "7.0.0" } +cumulus-primitives-core = { version = "0.7.0" } +emulated-integration-tests-common = { version = "3.0.0" } + +# Runtimes +asset-hub-kusama-runtime = { path = "../../../../../../system-parachains/asset-hubs/asset-hub-kusama" } +kusama-emulated-chain = { path = "../../../relays/kusama" } +system-parachains-constants = { path = "../../../../../../system-parachains/constants" } diff --git a/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/src/genesis.rs b/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/src/genesis.rs new file mode 100644 index 0000000000..d49faa57f5 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/src/genesis.rs @@ -0,0 +1,71 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Substrate +use sp_core::storage::Storage; + +// Cumulus +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, +}; +use parachains_common::Balance; + +pub const PARA_ID: u32 = 1000; +pub const ED: Balance = + system_parachains_constants::kusama::currency::SYSTEM_PARA_EXISTENTIAL_DEPOSIT; + +pub fn genesis() -> Storage { + let genesis_config = asset_hub_kusama_runtime::RuntimeGenesisConfig { + system: asset_hub_kusama_runtime::SystemConfig::default(), + balances: asset_hub_kusama_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .cloned() + .map(|k| (k, ED * 4096 * 4096)) + .collect(), + }, + parachain_info: asset_hub_kusama_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + collator_selection: asset_hub_kusama_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: asset_hub_kusama_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + asset_hub_kusama_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: asset_hub_kusama_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + ..Default::default() + }; + + build_genesis_storage( + &genesis_config, + asset_hub_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), + ) +} diff --git a/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/src/lib.rs b/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/src/lib.rs new file mode 100644 index 0000000000..775e575e7e --- /dev/null +++ b/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/src/lib.rs @@ -0,0 +1,59 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod genesis; + +// Substrate +use frame_support::traits::OnInitialize; + +// Cumulus +use emulated_integration_tests_common::{ + impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, + impl_assets_helpers_for_parachain, impl_foreign_assets_helpers_for_parachain, + impl_xcm_helpers_for_parachain, impls::Parachain, xcm_emulator::decl_test_parachains, +}; +use kusama_emulated_chain::Kusama; + +// AssetHubKusama Parachain declaration +decl_test_parachains! { + pub struct AssetHubKusama { + genesis = genesis::genesis(), + on_init = { + asset_hub_kusama_runtime::AuraExt::on_initialize(1); + }, + runtime = asset_hub_kusama_runtime, + core = { + XcmpMessageHandler: asset_hub_kusama_runtime::XcmpQueue, + LocationToAccountId: asset_hub_kusama_runtime::xcm_config::LocationToAccountId, + ParachainInfo: asset_hub_kusama_runtime::ParachainInfo, + MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, + }, + pallets = { + PolkadotXcm: asset_hub_kusama_runtime::PolkadotXcm, + Assets: asset_hub_kusama_runtime::Assets, + ForeignAssets: asset_hub_kusama_runtime::ForeignAssets, + PoolAssets: asset_hub_kusama_runtime::PoolAssets, + AssetConversion: asset_hub_kusama_runtime::AssetConversion, + Balances: asset_hub_kusama_runtime::Balances, + } + }, +} + +// AssetHubKusama implementation +impl_accounts_helpers_for_parachain!(AssetHubKusama); +impl_assert_events_helpers_for_parachain!(AssetHubKusama); +impl_assets_helpers_for_parachain!(AssetHubKusama, Kusama); +impl_foreign_assets_helpers_for_parachain!(AssetHubKusama, Kusama); +impl_xcm_helpers_for_parachain!(AssetHubKusama); diff --git a/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/Cargo.toml b/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/Cargo.toml new file mode 100644 index 0000000000..ed81adc3b2 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "asset-hub-polkadot-emulated-chain" +version = "0.0.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Asset Hub Polkadot emulated chain used for integration tests" +publish = false + +[dependencies] +serde_json = "1.0.111" + +# Substrate +sp-core = { version = "28.0.0" } +sp-runtime = { version = "31.0.1" } +frame-support = { version = "28.0.0" } + +# Cumulus +parachains-common = { version = "7.0.0" } +cumulus-primitives-core = { version = "0.7.0" } +emulated-integration-tests-common = { version = "3.0.0" } + +# Runtimes +asset-hub-polkadot-runtime = { path = "../../../../../../system-parachains/asset-hubs/asset-hub-polkadot" } +polkadot-emulated-chain = { path = "../../../relays/polkadot" } +system-parachains-constants = { path = "../../../../../../system-parachains/constants" } diff --git a/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/src/genesis.rs b/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/src/genesis.rs new file mode 100644 index 0000000000..1385e66954 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/src/genesis.rs @@ -0,0 +1,68 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Substrate +use sp_core::storage::Storage; + +// Cumulus +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, +}; +use parachains_common::Balance; + +pub const PARA_ID: u32 = 1000; +pub const ED: Balance = + system_parachains_constants::polkadot::currency::SYSTEM_PARA_EXISTENTIAL_DEPOSIT; + +pub fn genesis() -> Storage { + let genesis_config = asset_hub_polkadot_runtime::RuntimeGenesisConfig { + system: asset_hub_polkadot_runtime::SystemConfig::default(), + balances: asset_hub_polkadot_runtime::BalancesConfig { + balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(), + }, + parachain_info: asset_hub_polkadot_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + collator_selection: asset_hub_polkadot_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: asset_hub_polkadot_runtime::SessionConfig { + keys: collators::invulnerables_asset_hub_polkadot() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + asset_hub_polkadot_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: asset_hub_polkadot_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + ..Default::default() + }; + + build_genesis_storage( + &genesis_config, + asset_hub_polkadot_runtime::WASM_BINARY + .expect("WASM binary was not built, please build it!"), + ) +} diff --git a/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/src/lib.rs b/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/src/lib.rs new file mode 100644 index 0000000000..b0f35b3a6c --- /dev/null +++ b/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/src/lib.rs @@ -0,0 +1,57 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod genesis; + +// Substrate +use frame_support::traits::OnInitialize; + +// Cumulus +use emulated_integration_tests_common::{ + impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, + impl_assets_helpers_for_parachain, impl_foreign_assets_helpers_for_parachain, + impl_xcm_helpers_for_parachain, impls::Parachain, xcm_emulator::decl_test_parachains, +}; +use polkadot_emulated_chain::Polkadot; + +// AssetHubPolkadot Parachain declaration +decl_test_parachains! { + pub struct AssetHubPolkadot { + genesis = genesis::genesis(), + on_init = { + asset_hub_polkadot_runtime::AuraExt::on_initialize(1); + }, + runtime = asset_hub_polkadot_runtime, + core = { + XcmpMessageHandler: asset_hub_polkadot_runtime::XcmpQueue, + LocationToAccountId: asset_hub_polkadot_runtime::xcm_config::LocationToAccountId, + ParachainInfo: asset_hub_polkadot_runtime::ParachainInfo, + MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, + }, + pallets = { + PolkadotXcm: asset_hub_polkadot_runtime::PolkadotXcm, + Balances: asset_hub_polkadot_runtime::Balances, + Assets: asset_hub_polkadot_runtime::Assets, + ForeignAssets: asset_hub_polkadot_runtime::ForeignAssets, + } + }, +} + +// AssetHubPolkadot implementation +impl_accounts_helpers_for_parachain!(AssetHubPolkadot); +impl_assert_events_helpers_for_parachain!(AssetHubPolkadot); +impl_assets_helpers_for_parachain!(AssetHubPolkadot, Polkadot); +impl_foreign_assets_helpers_for_parachain!(AssetHubPolkadot, Polkadot); +impl_xcm_helpers_for_parachain!(AssetHubPolkadot); diff --git a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/Cargo.toml b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/Cargo.toml new file mode 100644 index 0000000000..09af5a3ef5 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "bridge-hub-kusama-emulated-chain" +version = "0.0.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Bridge Hub Kusama emulated chain used for integration tests" +publish = false + +[dependencies] +serde_json = "1.0.111" + +# Substrate +sp-core = { version = "28.0.0" } +sp-runtime = { version = "31.0.1" } +frame-support = { version = "28.0.0" } + +# Cumulus +parachains-common = { version = "7.0.0" } +cumulus-primitives-core = { version = "0.7.0" } +emulated-integration-tests-common = { version = "3.0.0" } + +# Runtimes +bridge-hub-kusama-runtime = { path = "../../../../../../system-parachains/bridge-hubs/bridge-hub-kusama" } +system-parachains-constants = { path = "../../../../../../system-parachains/constants" } diff --git a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/src/genesis.rs b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/src/genesis.rs new file mode 100644 index 0000000000..b9f217c38f --- /dev/null +++ b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/src/genesis.rs @@ -0,0 +1,77 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Substrate +use sp_core::{sr25519, storage::Storage}; + +// Cumulus +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, collators, get_account_id_from_seed, SAFE_XCM_VERSION, +}; +use parachains_common::Balance; + +pub const ASSETHUB_PARA_ID: u32 = 1000; +pub const PARA_ID: u32 = 1002; +pub const ED: Balance = + system_parachains_constants::kusama::currency::SYSTEM_PARA_EXISTENTIAL_DEPOSIT; + +pub fn genesis() -> Storage { + let genesis_config = bridge_hub_kusama_runtime::RuntimeGenesisConfig { + system: bridge_hub_kusama_runtime::SystemConfig::default(), + balances: bridge_hub_kusama_runtime::BalancesConfig { + balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(), + }, + parachain_info: bridge_hub_kusama_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + collator_selection: bridge_hub_kusama_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: bridge_hub_kusama_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + bridge_hub_kusama_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: bridge_hub_kusama_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + bridge_polkadot_grandpa: bridge_hub_kusama_runtime::BridgePolkadotGrandpaConfig { + owner: Some(get_account_id_from_seed::(accounts::BOB)), + ..Default::default() + }, + bridge_polkadot_messages: bridge_hub_kusama_runtime::BridgePolkadotMessagesConfig { + owner: Some(get_account_id_from_seed::(accounts::BOB)), + ..Default::default() + }, + ..Default::default() + }; + + build_genesis_storage( + &genesis_config, + bridge_hub_kusama_runtime::WASM_BINARY + .expect("WASM binary was not built, please build it!"), + ) +} diff --git a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/src/lib.rs b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/src/lib.rs new file mode 100644 index 0000000000..1504f90852 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/src/lib.rs @@ -0,0 +1,51 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod genesis; + +// Substrate +use frame_support::traits::OnInitialize; + +// Cumulus +use emulated_integration_tests_common::{ + impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, + impl_xcm_helpers_for_parachain, impls::Parachain, xcm_emulator::decl_test_parachains, +}; + +// BridgeHubKusama Parachain declaration +decl_test_parachains! { + pub struct BridgeHubKusama { + genesis = genesis::genesis(), + on_init = { + bridge_hub_kusama_runtime::AuraExt::on_initialize(1); + }, + runtime = bridge_hub_kusama_runtime, + core = { + XcmpMessageHandler: bridge_hub_kusama_runtime::XcmpQueue, + LocationToAccountId: bridge_hub_kusama_runtime::xcm_config::LocationToAccountId, + ParachainInfo: bridge_hub_kusama_runtime::ParachainInfo, + MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, + }, + pallets = { + PolkadotXcm: bridge_hub_kusama_runtime::PolkadotXcm, + Balances: bridge_hub_kusama_runtime::Balances, + } + }, +} + +// BridgeHubKusama implementation +impl_accounts_helpers_for_parachain!(BridgeHubKusama); +impl_assert_events_helpers_for_parachain!(BridgeHubKusama); +impl_xcm_helpers_for_parachain!(BridgeHubKusama); diff --git a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/Cargo.toml b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/Cargo.toml new file mode 100644 index 0000000000..904d6688c7 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "bridge-hub-polkadot-emulated-chain" +version = "0.0.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Bridge Hub Polkadot emulated chain used for integration tests" +publish = false + +[dependencies] +serde_json = "1.0.111" + +# Substrate +sp-core = { version = "28.0.0" } +sp-runtime = { version = "31.0.1" } +frame-support = { version = "28.0.0" } + +# Cumulus +parachains-common = { version = "7.0.0" } +cumulus-primitives-core = { version = "0.7.0" } +emulated-integration-tests-common = { version = "3.0.0" } + +# Runtimes +bridge-hub-polkadot-runtime = { path = "../../../../../../system-parachains/bridge-hubs/bridge-hub-polkadot" } +system-parachains-constants = { path = "../../../../../../system-parachains/constants" } diff --git a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/src/genesis.rs b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/src/genesis.rs new file mode 100644 index 0000000000..30b28c27d2 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/src/genesis.rs @@ -0,0 +1,76 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Substrate +use sp_core::{sr25519, storage::Storage}; + +// Cumulus +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, collators, get_account_id_from_seed, SAFE_XCM_VERSION, +}; +use parachains_common::Balance; + +pub const PARA_ID: u32 = 1002; +pub const ED: Balance = + system_parachains_constants::polkadot::currency::SYSTEM_PARA_EXISTENTIAL_DEPOSIT; + +pub fn genesis() -> Storage { + let genesis_config = bridge_hub_polkadot_runtime::RuntimeGenesisConfig { + system: bridge_hub_polkadot_runtime::SystemConfig::default(), + balances: bridge_hub_polkadot_runtime::BalancesConfig { + balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(), + }, + parachain_info: bridge_hub_polkadot_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + collator_selection: bridge_hub_polkadot_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: bridge_hub_polkadot_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + bridge_hub_polkadot_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: bridge_hub_polkadot_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + bridge_kusama_grandpa: bridge_hub_polkadot_runtime::BridgeKusamaGrandpaConfig { + owner: Some(get_account_id_from_seed::(accounts::BOB)), + ..Default::default() + }, + bridge_kusama_messages: bridge_hub_polkadot_runtime::BridgeKusamaMessagesConfig { + owner: Some(get_account_id_from_seed::(accounts::BOB)), + ..Default::default() + }, + ..Default::default() + }; + + build_genesis_storage( + &genesis_config, + bridge_hub_polkadot_runtime::WASM_BINARY + .expect("WASM binary was not built, please build it!"), + ) +} diff --git a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/src/lib.rs b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/src/lib.rs new file mode 100644 index 0000000000..c448eb7f98 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/src/lib.rs @@ -0,0 +1,51 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod genesis; + +// Substrate +use frame_support::traits::OnInitialize; + +// Cumulus +use emulated_integration_tests_common::{ + impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, + impl_xcm_helpers_for_parachain, impls::Parachain, xcm_emulator::decl_test_parachains, +}; + +// BridgeHubPolkadot Parachain declaration +decl_test_parachains! { + pub struct BridgeHubPolkadot { + genesis = genesis::genesis(), + on_init = { + bridge_hub_polkadot_runtime::AuraExt::on_initialize(1); + }, + runtime = bridge_hub_polkadot_runtime, + core = { + XcmpMessageHandler: bridge_hub_polkadot_runtime::XcmpQueue, + LocationToAccountId: bridge_hub_polkadot_runtime::xcm_config::LocationToAccountId, + ParachainInfo: bridge_hub_polkadot_runtime::ParachainInfo, + MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, + }, + pallets = { + PolkadotXcm: bridge_hub_polkadot_runtime::PolkadotXcm, + Balances: bridge_hub_polkadot_runtime::Balances, + } + }, +} + +// BridgeHubPolkadot implementation +impl_accounts_helpers_for_parachain!(BridgeHubPolkadot); +impl_assert_events_helpers_for_parachain!(BridgeHubPolkadot); +impl_xcm_helpers_for_parachain!(BridgeHubPolkadot); diff --git a/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/Cargo.toml b/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/Cargo.toml new file mode 100644 index 0000000000..e5111a89d6 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "collectives-polkadot-emulated-chain" +version = "0.0.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Collectives Polkadot emulated chain used for integration tests" +publish = false + +[dependencies] +serde_json = "1.0.111" + +# Substrate +sp-core = { version = "28.0.0" } +sp-runtime = { version = "31.0.1" } +frame-support = { version = "28.0.0" } + +# Cumulus +parachains-common = { version = "7.0.0" } +cumulus-primitives-core = { version = "0.7.0" } +emulated-integration-tests-common = { version = "3.0.0" } + +# Runtimes +collectives-polkadot-runtime = { path = "../../../../../../system-parachains/collectives/collectives-polkadot" } +system-parachains-constants = { path = "../../../../../../system-parachains/constants" } diff --git a/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/src/genesis.rs b/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/src/genesis.rs new file mode 100644 index 0000000000..c1e1fc03e0 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/src/genesis.rs @@ -0,0 +1,68 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Substrate +use sp_core::storage::Storage; + +// Cumulus +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, +}; +use parachains_common::Balance; + +pub const PARA_ID: u32 = 1001; +pub const ED: Balance = + system_parachains_constants::polkadot::currency::SYSTEM_PARA_EXISTENTIAL_DEPOSIT; + +pub fn genesis() -> Storage { + let genesis_config = collectives_polkadot_runtime::RuntimeGenesisConfig { + system: collectives_polkadot_runtime::SystemConfig::default(), + balances: collectives_polkadot_runtime::BalancesConfig { + balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(), + }, + parachain_info: collectives_polkadot_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + collator_selection: collectives_polkadot_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: collectives_polkadot_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + collectives_polkadot_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: collectives_polkadot_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + ..Default::default() + }; + + build_genesis_storage( + &genesis_config, + collectives_polkadot_runtime::WASM_BINARY + .expect("WASM binary was not built, please build it!"), + ) +} diff --git a/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/src/lib.rs b/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/src/lib.rs new file mode 100644 index 0000000000..d8ffbdcaf6 --- /dev/null +++ b/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/src/lib.rs @@ -0,0 +1,52 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod genesis; + +// Substrate +use frame_support::traits::OnInitialize; + +// Cumulus +use emulated_integration_tests_common::{ + impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, + impls::Parachain, xcm_emulator::decl_test_parachains, +}; + +// CollectivesPolkadot Parachain declaration +decl_test_parachains! { + pub struct CollectivesPolkadot { + genesis = genesis::genesis(), + on_init = { + collectives_polkadot_runtime::AuraExt::on_initialize(1); + }, + runtime = collectives_polkadot_runtime, + core = { + XcmpMessageHandler: collectives_polkadot_runtime::XcmpQueue, + LocationToAccountId: collectives_polkadot_runtime::xcm_config::LocationToAccountId, + ParachainInfo: collectives_polkadot_runtime::ParachainInfo, + MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, + }, + pallets = { + PolkadotXcm: collectives_polkadot_runtime::PolkadotXcm, + Balances: collectives_polkadot_runtime::Balances, + FellowshipTreasury: collectives_polkadot_runtime::FellowshipTreasury, + AssetRate: collectives_polkadot_runtime::AssetRate, + } + }, +} + +// CollectivesPolkadot implementation +impl_accounts_helpers_for_parachain!(CollectivesPolkadot); +impl_assert_events_helpers_for_parachain!(CollectivesPolkadot); diff --git a/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml b/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml new file mode 100644 index 0000000000..8e0b34ec9b --- /dev/null +++ b/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "penpal-emulated-chain" +version = "0.0.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Penpal emulated chain used for integration tests" +publish = false + +[dependencies] +serde_json = "1.0.111" + +# Substrate +sp-core = { version = "28.0.0" } +sp-runtime = { version = "31.0.1" } +frame-support = { version = "28.0.0" } + +# Cumulus +emulated-integration-tests-common = { version = "3.0.0" } +cumulus-primitives-core = { version = "0.7.0" } +parachains-common = { version = "7.0.0" } +penpal-runtime = { version = "0.14.0" } + +# Runtimes +kusama-emulated-chain = { path = "../../../relays/kusama" } +polkadot-emulated-chain = { path = "../../../relays/polkadot" } diff --git a/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs b/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs new file mode 100644 index 0000000000..9ab32a977d --- /dev/null +++ b/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs @@ -0,0 +1,71 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Substrate +use sp_core::{sr25519, storage::Storage}; + +// Cumulus +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, collators, get_account_id_from_seed, SAFE_XCM_VERSION, +}; +use parachains_common::Balance; + +// Penpal +pub const PARA_ID_A: u32 = 2000; +pub const PARA_ID_B: u32 = 2001; +pub const ED: Balance = penpal_runtime::EXISTENTIAL_DEPOSIT; + +pub fn genesis(para_id: u32) -> Storage { + let genesis_config = penpal_runtime::RuntimeGenesisConfig { + system: penpal_runtime::SystemConfig::default(), + balances: penpal_runtime::BalancesConfig { + balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(), + }, + parachain_info: penpal_runtime::ParachainInfoConfig { + parachain_id: para_id.into(), + ..Default::default() + }, + collator_selection: penpal_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: penpal_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + penpal_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: penpal_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + sudo: penpal_runtime::SudoConfig { + key: Some(get_account_id_from_seed::("Alice")), + }, + ..Default::default() + }; + + build_genesis_storage( + &genesis_config, + penpal_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), + ) +} diff --git a/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs b/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs new file mode 100644 index 0000000000..30d6e7bfad --- /dev/null +++ b/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs @@ -0,0 +1,79 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +mod genesis; +pub use genesis::{genesis, ED, PARA_ID_A, PARA_ID_B}; +pub use penpal_runtime::xcm_config::{LocalTeleportableToAssetHub, XcmConfig}; + +// Substrate +use frame_support::traits::OnInitialize; + +// Cumulus +use emulated_integration_tests_common::{ + impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, + impl_assets_helpers_for_parachain, impls::Parachain, xcm_emulator::decl_test_parachains, +}; +use kusama_emulated_chain::Kusama; +use polkadot_emulated_chain::Polkadot; + +// Penpal Parachain declaration +decl_test_parachains! { + pub struct PenpalA { + genesis = genesis(PARA_ID_A), + on_init = { + penpal_runtime::AuraExt::on_initialize(1); + }, + runtime = penpal_runtime, + core = { + XcmpMessageHandler: penpal_runtime::XcmpQueue, + LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, + ParachainInfo: penpal_runtime::ParachainInfo, + MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, + }, + pallets = { + PolkadotXcm: penpal_runtime::PolkadotXcm, + Assets: penpal_runtime::Assets, + ForeignAssets: penpal_runtime::ForeignAssets, + Balances: penpal_runtime::Balances, + } + }, + pub struct PenpalB { + genesis = genesis(PARA_ID_B), + on_init = { + penpal_runtime::AuraExt::on_initialize(1); + }, + runtime = penpal_runtime, + core = { + XcmpMessageHandler: penpal_runtime::XcmpQueue, + LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, + ParachainInfo: penpal_runtime::ParachainInfo, + MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, + }, + pallets = { + PolkadotXcm: penpal_runtime::PolkadotXcm, + Assets: penpal_runtime::Assets, + ForeignAssets: penpal_runtime::ForeignAssets, + Balances: penpal_runtime::Balances, + } + }, +} + +// Penpal implementation +impl_accounts_helpers_for_parachain!(PenpalA); +impl_accounts_helpers_for_parachain!(PenpalB); +impl_assets_helpers_for_parachain!(PenpalA, Kusama); +impl_assets_helpers_for_parachain!(PenpalB, Polkadot); +impl_assert_events_helpers_for_parachain!(PenpalA); +impl_assert_events_helpers_for_parachain!(PenpalB); diff --git a/integration-tests/emulated/chains/relays/kusama/Cargo.toml b/integration-tests/emulated/chains/relays/kusama/Cargo.toml new file mode 100644 index 0000000000..79040a6c8a --- /dev/null +++ b/integration-tests/emulated/chains/relays/kusama/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "kusama-emulated-chain" +version = "1.0.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Kusama emulated chain used for integration tests" +publish = false + +[dependencies] +serde_json = "1.0.111" + +# Substrate +sp-core = { version = "28.0.0" } +sp-runtime = { version = "31.0.1" } +authority-discovery-primitives = { package = "sp-authority-discovery", version = "26.0.0" } +babe-primitives = { package = "sp-consensus-babe", version = "0.32.0" } +beefy-primitives = { package = "sp-consensus-beefy", version = "13.0.0" } +grandpa = { package = "sc-consensus-grandpa", version = "0.19.0" } +pallet-im-online = { version = "27.0.0" } + +# Polkadot +polkadot-primitives = { version = "7.0.0" } + +# Cumulus +parachains-common = { version = "7.0.0" } +emulated-integration-tests-common = { version = "3.0.0" } + +# Runtimes +kusama-runtime-constants = { path = "../../../../../relay/kusama/constants" } +kusama-runtime = { package = "staging-kusama-runtime", path = "../../../../../relay/kusama" } diff --git a/integration-tests/emulated/chains/relays/kusama/src/genesis.rs b/integration-tests/emulated/chains/relays/kusama/src/genesis.rs new file mode 100644 index 0000000000..ca1b016511 --- /dev/null +++ b/integration-tests/emulated/chains/relays/kusama/src/genesis.rs @@ -0,0 +1,127 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Substrate +use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; +use babe_primitives::AuthorityId as BabeId; +use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId; +use grandpa::AuthorityId as GrandpaId; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; +use sp_core::{sr25519, storage::Storage}; + +// Polkadot +use polkadot_primitives::{AssignmentId, ValidatorId}; + +// Cumulus +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, get_account_id_from_seed, get_from_seed, get_host_config, +}; +use kusama_runtime_constants::currency::UNITS as KSM; +use parachains_common::Balance; + +pub const ED: Balance = kusama_runtime_constants::currency::EXISTENTIAL_DEPOSIT; +const ENDOWMENT: u128 = 1_000_000 * KSM; + +mod validators { + use super::*; + use parachains_common::AccountId; + + pub fn initial_authorities() -> Vec<( + AccountId, + AccountId, + BabeId, + GrandpaId, + ImOnlineId, + ValidatorId, + AssignmentId, + AuthorityDiscoveryId, + BeefyId, + )> { + let seed = "Alice"; + vec![( + get_account_id_from_seed::(&format!("{}//stash", seed)), + get_account_id_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + )] + } +} + +fn session_keys( + babe: BabeId, + grandpa: GrandpaId, + im_online: ImOnlineId, + para_validator: ValidatorId, + para_assignment: AssignmentId, + authority_discovery: AuthorityDiscoveryId, + beefy: BeefyId, +) -> kusama_runtime::SessionKeys { + kusama_runtime::SessionKeys { + grandpa, + babe, + im_online, + para_validator, + para_assignment, + authority_discovery, + beefy, + } +} + +pub fn genesis() -> Storage { + let genesis_config = kusama_runtime::RuntimeGenesisConfig { + system: kusama_runtime::SystemConfig::default(), + balances: kusama_runtime::BalancesConfig { + balances: accounts::init_balances().iter().map(|k| (k.clone(), ENDOWMENT)).collect(), + }, + session: kusama_runtime::SessionConfig { + keys: validators::initial_authorities() + .iter() + .map(|x| { + ( + x.0.clone(), + x.0.clone(), + session_keys( + x.2.clone(), + x.3.clone(), + x.4.clone(), + x.5.clone(), + x.6.clone(), + x.7.clone(), + x.8.clone(), + ), + ) + }) + .collect::>(), + }, + babe: kusama_runtime::BabeConfig { + authorities: Default::default(), + epoch_config: Some(kusama_runtime::BABE_GENESIS_EPOCH_CONFIG), + ..Default::default() + }, + configuration: kusama_runtime::ConfigurationConfig { config: get_host_config() }, + registrar: kusama_runtime::RegistrarConfig { + next_free_para_id: polkadot_primitives::LOWEST_PUBLIC_ID, + ..Default::default() + }, + ..Default::default() + }; + + build_genesis_storage(&genesis_config, kusama_runtime::WASM_BINARY.unwrap()) +} diff --git a/integration-tests/emulated/chains/relays/kusama/src/lib.rs b/integration-tests/emulated/chains/relays/kusama/src/lib.rs new file mode 100644 index 0000000000..58e82a51d0 --- /dev/null +++ b/integration-tests/emulated/chains/relays/kusama/src/lib.rs @@ -0,0 +1,49 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod genesis; + +// Cumulus +use emulated_integration_tests_common::{ + impl_accounts_helpers_for_relay_chain, impl_assert_events_helpers_for_relay_chain, + impl_hrmp_channels_helpers_for_relay_chain, impl_send_transact_helpers_for_relay_chain, + xcm_emulator::decl_test_relay_chains, +}; +use polkadot_primitives::runtime_api::runtime_decl_for_parachain_host::ParachainHostV9; + +// Kusama declaration +decl_test_relay_chains! { + #[api_version(10)] + pub struct Kusama { + genesis = genesis::genesis(), + on_init = (), + runtime = kusama_runtime, + core = { + SovereignAccountOf: kusama_runtime::xcm_config::SovereignAccountOf, + }, + pallets = { + XcmPallet: kusama_runtime::XcmPallet, + Balances: kusama_runtime::Balances, + Hrmp: kusama_runtime::Hrmp, + Identity: kusama_runtime::Identity, + } + }, +} + +// Kusama implementation +impl_accounts_helpers_for_relay_chain!(Kusama); +impl_assert_events_helpers_for_relay_chain!(Kusama); +impl_hrmp_channels_helpers_for_relay_chain!(Kusama); +impl_send_transact_helpers_for_relay_chain!(Kusama); diff --git a/integration-tests/emulated/chains/relays/polkadot/Cargo.toml b/integration-tests/emulated/chains/relays/polkadot/Cargo.toml new file mode 100644 index 0000000000..a161064a15 --- /dev/null +++ b/integration-tests/emulated/chains/relays/polkadot/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "polkadot-emulated-chain" +version = "1.0.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Polkadot emulated chain used for integration tests" +publish = false + +[dependencies] +serde_json = "1.0.111" + +# Substrate +sp-core = { version = "28.0.0" } +sp-runtime = { version = "31.0.1" } +authority-discovery-primitives = { package = "sp-authority-discovery", version = "26.0.0" } +babe-primitives = { package = "sp-consensus-babe", version = "0.32.0" } +beefy-primitives = { package = "sp-consensus-beefy", version = "13.0.0" } +grandpa = { package = "sc-consensus-grandpa", version = "0.19.0" } +pallet-im-online = { version = "27.0.0" } +pallet-staking = { version = "28.0.0" } + +# Polkadot +polkadot-primitives = { version = "7.0.0" } + +# Cumulus +parachains-common = { version = "7.0.0" } +emulated-integration-tests-common = { version = "3.0.0" } + +# Runtimes +polkadot-runtime-constants = { path = "../../../../../relay/polkadot/constants" } +polkadot-runtime = { path = "../../../../../relay/polkadot" } diff --git a/integration-tests/emulated/chains/relays/polkadot/src/genesis.rs b/integration-tests/emulated/chains/relays/polkadot/src/genesis.rs new file mode 100644 index 0000000000..6697aa2bad --- /dev/null +++ b/integration-tests/emulated/chains/relays/polkadot/src/genesis.rs @@ -0,0 +1,139 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Substrate +use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; +use babe_primitives::AuthorityId as BabeId; +use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId; +use grandpa::AuthorityId as GrandpaId; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; +use sp_core::{sr25519, storage::Storage}; +use sp_runtime::Perbill; + +// Polkadot +use polkadot_primitives::{AssignmentId, ValidatorId}; + +// Cumulus +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, get_account_id_from_seed, get_from_seed, get_host_config, +}; +use parachains_common::Balance; +use polkadot_runtime_constants::currency::UNITS as DOT; + +pub const ED: Balance = polkadot_runtime_constants::currency::EXISTENTIAL_DEPOSIT; +const ENDOWMENT: u128 = 1_000_000 * DOT; +const STASH: u128 = 100 * DOT; + +mod validators { + use super::*; + use parachains_common::AccountId; + + pub fn initial_authorities() -> Vec<( + AccountId, + AccountId, + BabeId, + GrandpaId, + ImOnlineId, + ValidatorId, + AssignmentId, + AuthorityDiscoveryId, + BeefyId, + )> { + let seed = "Alice"; + vec![( + get_account_id_from_seed::(&format!("{}//stash", seed)), + get_account_id_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + )] + } +} + +fn session_keys( + babe: BabeId, + grandpa: GrandpaId, + im_online: ImOnlineId, + para_validator: ValidatorId, + para_assignment: AssignmentId, + authority_discovery: AuthorityDiscoveryId, + beefy: BeefyId, +) -> polkadot_runtime::SessionKeys { + polkadot_runtime::SessionKeys { + babe, + grandpa, + im_online, + para_validator, + para_assignment, + authority_discovery, + beefy, + } +} + +pub fn genesis() -> Storage { + let genesis_config = polkadot_runtime::RuntimeGenesisConfig { + system: polkadot_runtime::SystemConfig::default(), + balances: polkadot_runtime::BalancesConfig { + balances: accounts::init_balances().iter().cloned().map(|k| (k, ENDOWMENT)).collect(), + }, + session: polkadot_runtime::SessionConfig { + keys: validators::initial_authorities() + .iter() + .map(|x| { + ( + x.0.clone(), + x.0.clone(), + session_keys( + x.2.clone(), + x.3.clone(), + x.4.clone(), + x.5.clone(), + x.6.clone(), + x.7.clone(), + x.8.clone(), + ), + ) + }) + .collect::>(), + }, + staking: polkadot_runtime::StakingConfig { + validator_count: validators::initial_authorities().len() as u32, + minimum_validator_count: 1, + stakers: validators::initial_authorities() + .iter() + .map(|x| { + (x.0.clone(), x.1.clone(), STASH, polkadot_runtime::StakerStatus::Validator) + }) + .collect(), + invulnerables: validators::initial_authorities().iter().map(|x| x.0.clone()).collect(), + force_era: pallet_staking::Forcing::ForceNone, + slash_reward_fraction: Perbill::from_percent(10), + ..Default::default() + }, + babe: polkadot_runtime::BabeConfig { + authorities: Default::default(), + epoch_config: Some(polkadot_runtime::BABE_GENESIS_EPOCH_CONFIG), + ..Default::default() + }, + configuration: polkadot_runtime::ConfigurationConfig { config: get_host_config() }, + ..Default::default() + }; + + build_genesis_storage(&genesis_config, polkadot_runtime::WASM_BINARY.unwrap()) +} diff --git a/integration-tests/emulated/chains/relays/polkadot/src/lib.rs b/integration-tests/emulated/chains/relays/polkadot/src/lib.rs new file mode 100644 index 0000000000..9b32e0ac87 --- /dev/null +++ b/integration-tests/emulated/chains/relays/polkadot/src/lib.rs @@ -0,0 +1,51 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod genesis; + +// Cumulus +use emulated_integration_tests_common::{ + impl_accounts_helpers_for_relay_chain, impl_assert_events_helpers_for_relay_chain, + impl_hrmp_channels_helpers_for_relay_chain, impl_send_transact_helpers_for_relay_chain, + xcm_emulator::decl_test_relay_chains, +}; +use polkadot_primitives::runtime_api::runtime_decl_for_parachain_host::ParachainHostV5; + +// Polkadot declaration +decl_test_relay_chains! { + #[api_version(10)] + pub struct Polkadot { + genesis = genesis::genesis(), + on_init = (), + runtime = polkadot_runtime, + core = { + SovereignAccountOf: polkadot_runtime::xcm_config::SovereignAccountOf, + }, + pallets = { + XcmPallet: polkadot_runtime::XcmPallet, + Balances: polkadot_runtime::Balances, + Treasury: polkadot_runtime::Treasury, + AssetRate: polkadot_runtime::AssetRate, + Hrmp: polkadot_runtime::Hrmp, + Identity: polkadot_runtime::Identity, + } + }, +} + +// Polkadot implementation +impl_accounts_helpers_for_relay_chain!(Polkadot); +impl_assert_events_helpers_for_relay_chain!(Polkadot); +impl_hrmp_channels_helpers_for_relay_chain!(Polkadot); +impl_send_transact_helpers_for_relay_chain!(Polkadot); diff --git a/integration-tests/emulated/chains/src/genesis.rs b/integration-tests/emulated/chains/src/genesis.rs deleted file mode 100644 index 76b1692605..0000000000 --- a/integration-tests/emulated/chains/src/genesis.rs +++ /dev/null @@ -1,650 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use integration_tests_common::{ - accounts, collators, get_account_id_from_seed, validators, SAFE_XCM_VERSION, -}; - -// Substrate -use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId; -use grandpa_primitives::AuthorityId as GrandpaId; -use pallet_im_online::sr25519::AuthorityId as ImOnlineId; -use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; -use sp_consensus_babe::AuthorityId as BabeId; -use sp_core::{sr25519, storage::Storage}; -use sp_runtime::{BuildStorage, Perbill}; - -// Cumulus -use parachains_common::{AccountId, Balance, BlockNumber}; -use polkadot_parachain_primitives::primitives::{HeadData, ValidationCode}; -use polkadot_primitives::{AssignmentId, ValidatorId}; -use polkadot_runtime_parachains::{ - configuration::HostConfiguration, - paras::{ParaGenesisArgs, ParaKind}, -}; -// Polkadot -pub mod polkadot { - use super::*; - pub const ED: Balance = polkadot_runtime_constants::currency::EXISTENTIAL_DEPOSIT; - const STASH: u128 = 100 * polkadot_runtime_constants::currency::UNITS; - - pub fn get_host_config() -> HostConfiguration { - HostConfiguration { - max_upward_queue_count: 10, - max_upward_queue_size: 51200, - max_upward_message_size: 51200, - max_upward_message_num_per_candidate: 10, - max_downward_message_size: 51200, - hrmp_sender_deposit: 100_000_000_000, - hrmp_recipient_deposit: 100_000_000_000, - hrmp_channel_max_capacity: 1000, - hrmp_channel_max_message_size: 102400, - hrmp_channel_max_total_size: 102400, - hrmp_max_parachain_outbound_channels: 30, - hrmp_max_parachain_inbound_channels: 30, - ..Default::default() - } - } - - fn session_keys( - babe: BabeId, - grandpa: GrandpaId, - im_online: ImOnlineId, - para_validator: ValidatorId, - para_assignment: AssignmentId, - authority_discovery: AuthorityDiscoveryId, - beefy: BeefyId, - ) -> polkadot_runtime::SessionKeys { - polkadot_runtime::SessionKeys { - babe, - grandpa, - im_online, - para_validator, - para_assignment, - authority_discovery, - beefy, - } - } - - pub fn genesis() -> Storage { - let genesis_config = polkadot_runtime::RuntimeGenesisConfig { - system: polkadot_runtime::SystemConfig::default(), - balances: polkadot_runtime::BalancesConfig { - balances: accounts::init_balances() - .iter() - .cloned() - .map(|k| (k, ED * 4096)) - .collect(), - }, - session: polkadot_runtime::SessionConfig { - keys: validators::initial_authorities() - .iter() - .map(|x| { - ( - x.0.clone(), - x.0.clone(), - polkadot::session_keys( - x.2.clone(), - x.3.clone(), - x.4.clone(), - x.5.clone(), - x.6.clone(), - x.7.clone(), - x.8.clone(), - ), - ) - }) - .collect::>(), - }, - staking: polkadot_runtime::StakingConfig { - validator_count: validators::initial_authorities().len() as u32, - minimum_validator_count: 1, - stakers: validators::initial_authorities() - .iter() - .map(|x| { - (x.0.clone(), x.1.clone(), STASH, polkadot_runtime::StakerStatus::Validator) - }) - .collect(), - invulnerables: validators::initial_authorities() - .iter() - .map(|x| x.0.clone()) - .collect(), - force_era: pallet_staking::Forcing::ForceNone, - slash_reward_fraction: Perbill::from_percent(10), - ..Default::default() - }, - babe: polkadot_runtime::BabeConfig { - authorities: Default::default(), - epoch_config: Some(polkadot_runtime::BABE_GENESIS_EPOCH_CONFIG), - ..Default::default() - }, - configuration: polkadot_runtime::ConfigurationConfig { config: get_host_config() }, - paras: polkadot_runtime::ParasConfig { - paras: vec![ - ( - asset_hub_polkadot::PARA_ID.into(), - ParaGenesisArgs { - genesis_head: HeadData::default(), - validation_code: ValidationCode( - asset_hub_polkadot_runtime::WASM_BINARY.unwrap().to_vec(), - ), - para_kind: ParaKind::Parachain, - }, - ), - ( - bridge_hub_polkadot::PARA_ID.into(), - ParaGenesisArgs { - genesis_head: HeadData::default(), - validation_code: ValidationCode( - bridge_hub_polkadot_runtime::WASM_BINARY.unwrap().to_vec(), - ), - para_kind: ParaKind::Parachain, - }, - ), - ( - penpal::PARA_ID_A.into(), - ParaGenesisArgs { - genesis_head: HeadData::default(), - validation_code: ValidationCode( - penpal_runtime::WASM_BINARY.unwrap().to_vec(), - ), - para_kind: ParaKind::Parachain, - }, - ), - ( - penpal::PARA_ID_B.into(), - ParaGenesisArgs { - genesis_head: HeadData::default(), - validation_code: ValidationCode( - penpal_runtime::WASM_BINARY.unwrap().to_vec(), - ), - para_kind: ParaKind::Parachain, - }, - ), - ], - ..Default::default() - }, - ..Default::default() - }; - - genesis_config.build_storage().unwrap() - } -} - -// Kusama -pub mod kusama { - use super::*; - pub const ED: Balance = kusama_runtime_constants::currency::EXISTENTIAL_DEPOSIT; - use kusama_runtime_constants::currency::UNITS as KSM; - const ENDOWMENT: u128 = 1_000_000 * KSM; - const STASH: u128 = 100 * KSM; - - pub fn get_host_config() -> HostConfiguration { - HostConfiguration { - max_upward_queue_count: 10, - max_upward_queue_size: 51200, - max_upward_message_size: 51200, - max_upward_message_num_per_candidate: 10, - max_downward_message_size: 51200, - hrmp_sender_deposit: 5_000_000_000_000, - hrmp_recipient_deposit: 5_000_000_000_000, - hrmp_channel_max_capacity: 1000, - hrmp_channel_max_message_size: 102400, - hrmp_channel_max_total_size: 102400, - hrmp_max_parachain_outbound_channels: 30, - hrmp_max_parachain_inbound_channels: 30, - ..Default::default() - } - } - - fn session_keys( - babe: BabeId, - grandpa: GrandpaId, - im_online: ImOnlineId, - para_validator: ValidatorId, - para_assignment: AssignmentId, - authority_discovery: AuthorityDiscoveryId, - beefy: BeefyId, - ) -> kusama_runtime::SessionKeys { - kusama_runtime::SessionKeys { - babe, - grandpa, - im_online, - para_validator, - para_assignment, - authority_discovery, - beefy, - } - } - - pub fn genesis() -> Storage { - let genesis_config = kusama_runtime::RuntimeGenesisConfig { - system: kusama_runtime::SystemConfig::default(), - balances: kusama_runtime::BalancesConfig { - balances: accounts::init_balances() - .iter() - .map(|k: &AccountId| (k.clone(), ENDOWMENT)) - .collect(), - }, - session: kusama_runtime::SessionConfig { - keys: validators::initial_authorities() - .iter() - .map(|x| { - ( - x.0.clone(), - x.0.clone(), - kusama::session_keys( - x.2.clone(), - x.3.clone(), - x.4.clone(), - x.5.clone(), - x.6.clone(), - x.7.clone(), - x.8.clone(), - ), - ) - }) - .collect::>(), - }, - staking: kusama_runtime::StakingConfig { - validator_count: validators::initial_authorities().len() as u32, - minimum_validator_count: 1, - stakers: validators::initial_authorities() - .iter() - .map(|x| { - (x.0.clone(), x.1.clone(), STASH, kusama_runtime::StakerStatus::Validator) - }) - .collect(), - invulnerables: validators::initial_authorities() - .iter() - .map(|x| x.0.clone()) - .collect(), - force_era: pallet_staking::Forcing::NotForcing, - slash_reward_fraction: Perbill::from_percent(10), - ..Default::default() - }, - babe: kusama_runtime::BabeConfig { - authorities: Default::default(), - epoch_config: Some(kusama_runtime::BABE_GENESIS_EPOCH_CONFIG), - ..Default::default() - }, - configuration: kusama_runtime::ConfigurationConfig { config: get_host_config() }, - paras: kusama_runtime::ParasConfig { - paras: vec![ - ( - asset_hub_kusama::PARA_ID.into(), - ParaGenesisArgs { - genesis_head: HeadData::default(), - validation_code: ValidationCode( - asset_hub_kusama_runtime::WASM_BINARY.unwrap().to_vec(), - ), - para_kind: ParaKind::Parachain, - }, - ), - ( - bridge_hub_kusama::PARA_ID.into(), - ParaGenesisArgs { - genesis_head: HeadData::default(), - validation_code: ValidationCode( - bridge_hub_kusama_runtime::WASM_BINARY.unwrap().to_vec(), - ), - para_kind: ParaKind::Parachain, - }, - ), - ( - penpal::PARA_ID_A.into(), - ParaGenesisArgs { - genesis_head: HeadData::default(), - validation_code: ValidationCode( - penpal_runtime::WASM_BINARY.unwrap().to_vec(), - ), - para_kind: ParaKind::Parachain, - }, - ), - ( - penpal::PARA_ID_B.into(), - ParaGenesisArgs { - genesis_head: HeadData::default(), - validation_code: ValidationCode( - penpal_runtime::WASM_BINARY.unwrap().to_vec(), - ), - para_kind: ParaKind::Parachain, - }, - ), - ], - ..Default::default() - }, - ..Default::default() - }; - - genesis_config.build_storage().unwrap() - } -} - -// Asset Hub Polkadot -pub mod asset_hub_polkadot { - use super::*; - pub const PARA_ID: u32 = 1000; - pub const ED: Balance = asset_hub_polkadot_runtime::ExistentialDeposit::get(); - - pub fn genesis() -> Storage { - let genesis_config = asset_hub_polkadot_runtime::RuntimeGenesisConfig { - system: asset_hub_polkadot_runtime::SystemConfig::default(), - balances: asset_hub_polkadot_runtime::BalancesConfig { - balances: accounts::init_balances() - .iter() - .cloned() - .map(|k| (k, ED * 4096 * 4096)) - .collect(), - }, - parachain_info: asset_hub_polkadot_runtime::ParachainInfoConfig { - parachain_id: PARA_ID.into(), - ..Default::default() - }, - collator_selection: asset_hub_polkadot_runtime::CollatorSelectionConfig { - invulnerables: collators::invulnerables_asset_hub_polkadot() - .iter() - .cloned() - .map(|(acc, _)| acc) - .collect(), - candidacy_bond: ED * 16, - ..Default::default() - }, - session: asset_hub_polkadot_runtime::SessionConfig { - keys: collators::invulnerables_asset_hub_polkadot() - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - asset_hub_polkadot_runtime::SessionKeys { aura }, // session keys - ) - }) - .collect(), - }, - polkadot_xcm: asset_hub_polkadot_runtime::PolkadotXcmConfig { - safe_xcm_version: Some(SAFE_XCM_VERSION), - ..Default::default() - }, - ..Default::default() - }; - - genesis_config.build_storage().unwrap() - } -} - -// Asset Hub Kusama -pub mod asset_hub_kusama { - use super::*; - pub const PARA_ID: u32 = 1000; - pub const ED: Balance = asset_hub_kusama_runtime::ExistentialDeposit::get(); - - pub fn genesis() -> Storage { - let genesis_config = asset_hub_kusama_runtime::RuntimeGenesisConfig { - system: asset_hub_kusama_runtime::SystemConfig::default(), - balances: asset_hub_kusama_runtime::BalancesConfig { - balances: accounts::init_balances() - .iter() - .cloned() - .map(|k| (k, ED * 4096 * 4096)) - .collect(), - }, - parachain_info: asset_hub_kusama_runtime::ParachainInfoConfig { - parachain_id: PARA_ID.into(), - ..Default::default() - }, - collator_selection: asset_hub_kusama_runtime::CollatorSelectionConfig { - invulnerables: collators::invulnerables() - .iter() - .cloned() - .map(|(acc, _)| acc) - .collect(), - candidacy_bond: ED * 16, - ..Default::default() - }, - session: asset_hub_kusama_runtime::SessionConfig { - keys: collators::invulnerables() - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - asset_hub_kusama_runtime::SessionKeys { aura }, // session keys - ) - }) - .collect(), - }, - polkadot_xcm: asset_hub_kusama_runtime::PolkadotXcmConfig { - safe_xcm_version: Some(SAFE_XCM_VERSION), - ..Default::default() - }, - ..Default::default() - }; - - genesis_config.build_storage().unwrap() - } -} - -// Bridge Hub Polkadot -pub mod bridge_hub_polkadot { - use super::*; - pub const PARA_ID: u32 = 1002; - pub const ED: Balance = bridge_hub_polkadot_runtime::ExistentialDeposit::get(); - - pub fn genesis() -> Storage { - let genesis_config = bridge_hub_polkadot_runtime::RuntimeGenesisConfig { - system: bridge_hub_polkadot_runtime::SystemConfig::default(), - balances: bridge_hub_polkadot_runtime::BalancesConfig { - balances: accounts::init_balances() - .iter() - .cloned() - .map(|k| (k, ED * 4096)) - .collect(), - }, - parachain_info: bridge_hub_polkadot_runtime::ParachainInfoConfig { - parachain_id: PARA_ID.into(), - ..Default::default() - }, - collator_selection: bridge_hub_polkadot_runtime::CollatorSelectionConfig { - invulnerables: collators::invulnerables() - .iter() - .cloned() - .map(|(acc, _)| acc) - .collect(), - candidacy_bond: ED * 16, - ..Default::default() - }, - session: bridge_hub_polkadot_runtime::SessionConfig { - keys: collators::invulnerables() - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - bridge_hub_polkadot_runtime::SessionKeys { aura }, // session keys - ) - }) - .collect(), - }, - polkadot_xcm: bridge_hub_polkadot_runtime::PolkadotXcmConfig { - safe_xcm_version: Some(SAFE_XCM_VERSION), - ..Default::default() - }, - ..Default::default() - }; - - genesis_config.build_storage().unwrap() - } -} - -// Bridge Hub Kusama -pub mod bridge_hub_kusama { - use super::*; - pub const PARA_ID: u32 = 1002; - pub const ED: Balance = bridge_hub_kusama_runtime::ExistentialDeposit::get(); - - pub fn genesis() -> Storage { - let genesis_config = bridge_hub_kusama_runtime::RuntimeGenesisConfig { - system: bridge_hub_kusama_runtime::SystemConfig::default(), - balances: bridge_hub_kusama_runtime::BalancesConfig { - balances: accounts::init_balances() - .iter() - .cloned() - .map(|k| (k, ED * 4096)) - .collect(), - }, - parachain_info: bridge_hub_kusama_runtime::ParachainInfoConfig { - parachain_id: PARA_ID.into(), - ..Default::default() - }, - collator_selection: bridge_hub_kusama_runtime::CollatorSelectionConfig { - invulnerables: collators::invulnerables() - .iter() - .cloned() - .map(|(acc, _)| acc) - .collect(), - candidacy_bond: ED * 16, - ..Default::default() - }, - session: bridge_hub_kusama_runtime::SessionConfig { - keys: collators::invulnerables() - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - bridge_hub_kusama_runtime::SessionKeys { aura }, // session keys - ) - }) - .collect(), - }, - polkadot_xcm: bridge_hub_kusama_runtime::PolkadotXcmConfig { - safe_xcm_version: Some(SAFE_XCM_VERSION), - ..Default::default() - }, - ..Default::default() - }; - - genesis_config.build_storage().unwrap() - } -} - -// Collectives -pub mod collectives { - use super::*; - pub const PARA_ID: u32 = 1001; - pub const ED: Balance = collectives_polkadot_runtime::ExistentialDeposit::get(); - - pub fn genesis() -> Storage { - let genesis_config = collectives_polkadot_runtime::RuntimeGenesisConfig { - system: collectives_polkadot_runtime::SystemConfig::default(), - balances: collectives_polkadot_runtime::BalancesConfig { - balances: accounts::init_balances() - .iter() - .cloned() - .map(|k| (k, ED * 4096)) - .collect(), - }, - parachain_info: collectives_polkadot_runtime::ParachainInfoConfig { - parachain_id: PARA_ID.into(), - ..Default::default() - }, - collator_selection: collectives_polkadot_runtime::CollatorSelectionConfig { - invulnerables: collators::invulnerables() - .iter() - .cloned() - .map(|(acc, _)| acc) - .collect(), - candidacy_bond: ED * 16, - ..Default::default() - }, - session: collectives_polkadot_runtime::SessionConfig { - keys: collators::invulnerables() - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - collectives_polkadot_runtime::SessionKeys { aura }, // session keys - ) - }) - .collect(), - }, - polkadot_xcm: collectives_polkadot_runtime::PolkadotXcmConfig { - safe_xcm_version: Some(SAFE_XCM_VERSION), - ..Default::default() - }, - ..Default::default() - }; - - genesis_config.build_storage().unwrap() - } -} - -// Penpal -pub mod penpal { - use super::*; - pub const PARA_ID_A: u32 = 2000; - pub const PARA_ID_B: u32 = 2001; - pub const ED: Balance = penpal_runtime::EXISTENTIAL_DEPOSIT; - - pub fn genesis(para_id: u32) -> Storage { - let genesis_config = penpal_runtime::RuntimeGenesisConfig { - system: penpal_runtime::SystemConfig::default(), - balances: penpal_runtime::BalancesConfig { - balances: accounts::init_balances() - .iter() - .cloned() - .map(|k| (k, ED * 4096 * 4096)) - .collect(), - }, - parachain_info: penpal_runtime::ParachainInfoConfig { - parachain_id: para_id.into(), - ..Default::default() - }, - collator_selection: penpal_runtime::CollatorSelectionConfig { - invulnerables: collators::invulnerables() - .iter() - .cloned() - .map(|(acc, _)| acc) - .collect(), - candidacy_bond: ED * 16, - ..Default::default() - }, - session: penpal_runtime::SessionConfig { - keys: collators::invulnerables() - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - penpal_runtime::SessionKeys { aura }, // session keys - ) - }) - .collect(), - }, - polkadot_xcm: penpal_runtime::PolkadotXcmConfig { - safe_xcm_version: Some(SAFE_XCM_VERSION), - ..Default::default() - }, - sudo: penpal_runtime::SudoConfig { - key: Some(get_account_id_from_seed::("Alice")), - }, - ..Default::default() - }; - - genesis_config.build_storage().unwrap() - } -} diff --git a/integration-tests/emulated/chains/src/lib.rs b/integration-tests/emulated/chains/src/lib.rs deleted file mode 100644 index ac4bddcfab..0000000000 --- a/integration-tests/emulated/chains/src/lib.rs +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub mod genesis; - -pub use genesis::{ - asset_hub_kusama, asset_hub_polkadot, bridge_hub_kusama, bridge_hub_polkadot, collectives, - kusama, penpal, polkadot, -}; - -use integration_tests_common::{ - accounts::{ALICE, BOB}, - impl_accounts_helpers_for_parachain, impl_accounts_helpers_for_relay_chain, - impl_assert_events_helpers_for_parachain, impl_assert_events_helpers_for_relay_chain, - impl_assets_helpers_for_parachain, impl_foreign_assets_helpers_for_parachain, - impl_hrmp_channels_helpers_for_relay_chain, impl_send_transact_helpers_for_relay_chain, - impls::Parachain, -}; - -// Substrate -use frame_support::traits::OnInitialize; - -// Cumulus -use xcm_emulator::{ - // decl_test_bridges, - decl_test_networks, - decl_test_parachains, - decl_test_relay_chains, - decl_test_sender_receiver_accounts_parameter_types, -}; - -decl_test_relay_chains! { - #[api_version(5)] - pub struct Polkadot { - genesis = polkadot::genesis(), - on_init = (), - runtime = polkadot_runtime, - core = { - SovereignAccountOf: polkadot_runtime::xcm_config::SovereignAccountOf, - }, - pallets = { - XcmPallet: polkadot_runtime::XcmPallet, - Balances: polkadot_runtime::Balances, - Hrmp: polkadot_runtime::Hrmp, - } - }, - #[api_version(9)] - pub struct Kusama { - genesis = kusama::genesis(), - on_init = (), - runtime = kusama_runtime, - core = { - SovereignAccountOf: kusama_runtime::xcm_config::SovereignAccountOf, - }, - pallets = { - XcmPallet: kusama_runtime::XcmPallet, - Balances: kusama_runtime::Balances, - Hrmp: kusama_runtime::Hrmp, - } - }, -} - -decl_test_parachains! { - // Polkadot Parachains - pub struct AssetHubPolkadot { - genesis = asset_hub_polkadot::genesis(), - on_init = { - asset_hub_polkadot_runtime::AuraExt::on_initialize(1); - }, - runtime = asset_hub_polkadot_runtime, - core = { - XcmpMessageHandler: asset_hub_polkadot_runtime::XcmpQueue, - LocationToAccountId: asset_hub_polkadot_runtime::xcm_config::LocationToAccountId, - ParachainInfo: asset_hub_polkadot_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - }, - pallets = { - PolkadotXcm: asset_hub_polkadot_runtime::PolkadotXcm, - Assets: asset_hub_polkadot_runtime::Assets, - ForeignAssets: asset_hub_polkadot_runtime::ForeignAssets, - Balances: asset_hub_polkadot_runtime::Balances, - } - }, - pub struct Collectives { - genesis = collectives::genesis(), - on_init = { - collectives_polkadot_runtime::AuraExt::on_initialize(1); - }, - runtime = collectives_polkadot_runtime, - core = { - XcmpMessageHandler: collectives_polkadot_runtime::XcmpQueue, - LocationToAccountId: collectives_polkadot_runtime::xcm_config::LocationToAccountId, - ParachainInfo: collectives_polkadot_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - }, - pallets = { - PolkadotXcm: collectives_polkadot_runtime::PolkadotXcm, - Balances: collectives_polkadot_runtime::Balances, - } - }, - pub struct BridgeHubPolkadot { - genesis = bridge_hub_polkadot::genesis(), - on_init = { - bridge_hub_polkadot_runtime::AuraExt::on_initialize(1); - }, - runtime = bridge_hub_polkadot_runtime, - core = { - XcmpMessageHandler: bridge_hub_polkadot_runtime::XcmpQueue, - LocationToAccountId: bridge_hub_polkadot_runtime::xcm_config::LocationToAccountId, - ParachainInfo: bridge_hub_polkadot_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - }, - pallets = { - PolkadotXcm: bridge_hub_polkadot_runtime::PolkadotXcm, - } - }, - pub struct PenpalPolkadotA { - genesis = penpal::genesis(penpal::PARA_ID_A), - on_init = { - penpal_runtime::AuraExt::on_initialize(1); - }, - runtime = penpal_runtime, - core = { - XcmpMessageHandler: penpal_runtime::XcmpQueue, - LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, - ParachainInfo: penpal_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - }, - pallets = { - PolkadotXcm: penpal_runtime::PolkadotXcm, - Assets: penpal_runtime::Assets, - Balances: penpal_runtime::Balances, - } - }, - pub struct PenpalPolkadotB { - genesis = penpal::genesis(penpal::PARA_ID_B), - on_init = { - penpal_runtime::AuraExt::on_initialize(1); - }, - runtime = penpal_runtime, - core = { - XcmpMessageHandler: penpal_runtime::XcmpQueue, - LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, - ParachainInfo: penpal_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - }, - pallets = { - PolkadotXcm: penpal_runtime::PolkadotXcm, - Assets: penpal_runtime::Assets, - Balances: penpal_runtime::Balances, - } - }, - // Kusama Parachains - pub struct AssetHubKusama { - genesis = asset_hub_kusama::genesis(), - on_init = { - asset_hub_kusama_runtime::AuraExt::on_initialize(1); - }, - runtime = asset_hub_kusama_runtime, - core = { - XcmpMessageHandler: asset_hub_kusama_runtime::XcmpQueue, - LocationToAccountId: asset_hub_kusama_runtime::xcm_config::LocationToAccountId, - ParachainInfo: asset_hub_kusama_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - }, - pallets = { - PolkadotXcm: asset_hub_kusama_runtime::PolkadotXcm, - Assets: asset_hub_kusama_runtime::Assets, - ForeignAssets: asset_hub_kusama_runtime::ForeignAssets, - PoolAssets: asset_hub_kusama_runtime::PoolAssets, - AssetConversion: asset_hub_kusama_runtime::AssetConversion, - Balances: asset_hub_kusama_runtime::Balances, - } - }, - pub struct BridgeHubKusama { - genesis = bridge_hub_kusama::genesis(), - on_init = { - bridge_hub_kusama_runtime::AuraExt::on_initialize(1); - }, - runtime = bridge_hub_kusama_runtime, - core = { - XcmpMessageHandler: bridge_hub_kusama_runtime::XcmpQueue, - LocationToAccountId: bridge_hub_kusama_runtime::xcm_config::LocationToAccountId, - ParachainInfo: bridge_hub_kusama_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - }, - pallets = { - PolkadotXcm: bridge_hub_kusama_runtime::PolkadotXcm, - } - }, - pub struct PenpalKusamaA { - genesis = penpal::genesis(penpal::PARA_ID_A), - on_init = { - penpal_runtime::AuraExt::on_initialize(1); - }, - runtime = penpal_runtime, - core = { - XcmpMessageHandler: penpal_runtime::XcmpQueue, - LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, - ParachainInfo: penpal_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - }, - pallets = { - PolkadotXcm: penpal_runtime::PolkadotXcm, - Assets: penpal_runtime::Assets, - Balances: penpal_runtime::Balances, - } - }, - pub struct PenpalKusamaB { - genesis = penpal::genesis(penpal::PARA_ID_B), - on_init = { - penpal_runtime::AuraExt::on_initialize(1); - }, - runtime = penpal_runtime, - core = { - XcmpMessageHandler: penpal_runtime::XcmpQueue, - LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, - ParachainInfo: penpal_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - }, - pallets = { - PolkadotXcm: penpal_runtime::PolkadotXcm, - Assets: penpal_runtime::Assets, - Balances: penpal_runtime::Balances, - } - }, -} - -decl_test_networks! { - pub struct PolkadotMockNet { - relay_chain = Polkadot, - parachains = vec![ - AssetHubPolkadot, - Collectives, - BridgeHubPolkadot, - PenpalPolkadotA, - PenpalPolkadotB, - ], - // TODO: uncomment when https://github.com/polkadot-fellows/runtimes/pull/108 is merged - // bridge = PolkadotKusamaMockBridge - bridge = () - }, - pub struct KusamaMockNet { - relay_chain = Kusama, - parachains = vec![ - AssetHubKusama, - BridgeHubKusama, - PenpalKusamaA, - PenpalKusamaB, - ], - // TODO: uncomment when https://github.com/polkadot-fellows/runtimes/pull/108 is merged - // bridge = KusamaPolkadotMockBridge - bridge = () - }, -} - -// TODO: uncomment when https://github.com/polkadot-fellows/runtimes/pull/108 is merged -// decl_test_bridges! { -// pub struct PolkadotKusamaMockBridge { -// source = BridgeHubPolkadot, -// target = BridgeHubKusama, -// handler = PolkadotKusamaMessageHandler -// }, -// pub struct KusamaPolkadotMockBridge { -// source = BridgeHubKusama, -// target = BridgeHubPolkadot, -// handler = KusamaPolkadotMessageHandler -// } -// } - -// Polkadot implementation -impl_accounts_helpers_for_relay_chain!(Polkadot); -impl_assert_events_helpers_for_relay_chain!(Polkadot); -impl_hrmp_channels_helpers_for_relay_chain!(Polkadot); -impl_send_transact_helpers_for_relay_chain!(Polkadot); - -// Kusama implementation -impl_accounts_helpers_for_relay_chain!(Kusama); -impl_assert_events_helpers_for_relay_chain!(Kusama); -impl_hrmp_channels_helpers_for_relay_chain!(Kusama); -impl_send_transact_helpers_for_relay_chain!(Kusama); - -// AssetHubPolkadot implementation -impl_accounts_helpers_for_parachain!(AssetHubPolkadot); -impl_assets_helpers_for_parachain!(AssetHubPolkadot, Polkadot); -impl_assert_events_helpers_for_parachain!(AssetHubPolkadot); -impl_foreign_assets_helpers_for_parachain!(AssetHubPolkadot, Polkadot); - -// AssetHubKusama implementation -impl_accounts_helpers_for_parachain!(AssetHubKusama); -impl_assets_helpers_for_parachain!(AssetHubKusama, Kusama); -impl_assert_events_helpers_for_parachain!(AssetHubKusama); -impl_foreign_assets_helpers_for_parachain!(AssetHubKusama, Kusama); - -// PenpalPolkadot implementations -impl_accounts_helpers_for_parachain!(PenpalPolkadotA); -impl_accounts_helpers_for_parachain!(PenpalPolkadotB); -impl_assets_helpers_for_parachain!(PenpalPolkadotA, Polkadot); -impl_assets_helpers_for_parachain!(PenpalPolkadotB, Polkadot); -impl_assert_events_helpers_for_parachain!(PenpalPolkadotA); -impl_assert_events_helpers_for_parachain!(PenpalPolkadotB); - -// PenpalKusama implementations -impl_accounts_helpers_for_parachain!(PenpalKusamaA); -impl_accounts_helpers_for_parachain!(PenpalKusamaB); -impl_assets_helpers_for_parachain!(PenpalKusamaA, Kusama); -impl_assets_helpers_for_parachain!(PenpalKusamaB, Kusama); -impl_assert_events_helpers_for_parachain!(PenpalKusamaA); -impl_assert_events_helpers_for_parachain!(PenpalKusamaB); - -// Collectives implementation -impl_accounts_helpers_for_parachain!(Collectives); -impl_assert_events_helpers_for_parachain!(Collectives); - -decl_test_sender_receiver_accounts_parameter_types! { - // Relays - PolkadotRelay { sender: ALICE, receiver: BOB }, - KusamaRelay { sender: ALICE, receiver: BOB }, - // Asset Hubs - AssetHubPolkadotPara { sender: ALICE, receiver: BOB }, - AssetHubKusamaPara { sender: ALICE, receiver: BOB }, - // Collectives - CollectivesPara { sender: ALICE, receiver: BOB }, - // Bridged Hubs - BridgeHubPolkadotPara { sender: ALICE, receiver: BOB }, - BridgeHubKusamaPara { sender: ALICE, receiver: BOB }, - // Penpals - PenpalPolkadotAPara { sender: ALICE, receiver: BOB }, - PenpalPolkadotBPara { sender: ALICE, receiver: BOB }, - PenpalKusamaAPara { sender: ALICE, receiver: BOB }, - PenpalKusamaBPara { sender: ALICE, receiver: BOB } -} - -pub type PenpalLocalTeleportableToAssetHub = - penpal_runtime::xcm_config::LocalTeleportableToAssetHub; -pub type PenpalXcmConfig = penpal_runtime::xcm_config::XcmConfig; diff --git a/integration-tests/emulated/common/Cargo.toml b/integration-tests/emulated/common/Cargo.toml deleted file mode 100644 index 8f9137cc5b..0000000000 --- a/integration-tests/emulated/common/Cargo.toml +++ /dev/null @@ -1,44 +0,0 @@ -[package] -name = "integration-tests-common" -version = "1.0.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -description = "Common resources for integration testing with xcm-emulator" - -[dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9" } -paste = "1.0.14" - -# Substrate -grandpa-primitives = { package = "sp-consensus-grandpa", version = "13.0.0" } -sp-authority-discovery = { version = "26.0.0" } -sp-runtime = { version = "31.0.1" } -frame-support = { version = "28.0.0" } -sp-core = { version = "28.0.0" } -sp-consensus-babe = { version = "0.32.0" } -pallet-assets = { version = "29.0.0" } -pallet-balances = { version = "28.0.0" } -pallet-message-queue = { version = "31.0.0" } -pallet-im-online = { version = "27.0.0" } -beefy-primitives = { package = "sp-consensus-beefy", version = "13.0.0" } - -# Polkadot -polkadot-primitives = { version = "7.0.0" } -polkadot-runtime-parachains = { version = "7.0.0" } -xcm = { package = "staging-xcm", version = "7.0.0" } -pallet-xcm = { version = "7.0.0" } - -# Cumulus -parachains-common = { version = "7.0.0" } -cumulus-primitives-core = { version = "0.7.0" } -xcm-emulator = { version = "0.5.0" } -cumulus-pallet-xcmp-queue = { version = "0.7.0" } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , version = "0.7.0" } -asset-test-utils = { version = "7.0.1" } -cumulus-pallet-dmp-queue = { version = "0.7.0" } - -# Bridges -bp-messages = { version = "0.7.0" } -pallet-bridge-messages = { version = "0.7.0" } -bridge-runtime-common = { version = "0.7.0" } diff --git a/integration-tests/emulated/common/src/impls.rs b/integration-tests/emulated/common/src/impls.rs deleted file mode 100644 index 076e8d7e7a..0000000000 --- a/integration-tests/emulated/common/src/impls.rs +++ /dev/null @@ -1,786 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub use codec::{Decode, Encode}; -pub use paste; - -pub use crate::{ - xcm_helpers::xcm_transact_unpaid_execution, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, -}; - -// Substrate -pub use frame_support::{ - assert_ok, - sp_runtime::AccountId32, - traits::fungibles::Inspect, - weights::{Weight, WeightMeter}, -}; -pub use pallet_assets; -pub use pallet_message_queue; -use sp_core::Get; - -// Cumulus -use bp_messages::{ - target_chain::{DispatchMessage, DispatchMessageData, MessageDispatch}, - LaneId, MessageKey, OutboundLaneData, -}; -use bridge_runtime_common::messages_xcm_extension::XcmBlobMessageDispatchResult; -pub use cumulus_pallet_dmp_queue; -pub use cumulus_pallet_parachain_system; -pub use cumulus_pallet_xcmp_queue; -pub use cumulus_primitives_core::{ - relay_chain::HrmpChannelId, DmpMessageHandler, ParaId, XcmpMessageHandler, -}; -use pallet_bridge_messages::{Config, Instance1, OutboundLanes, Pallet}; -pub use parachains_common::{AccountId, Balance}; -pub use xcm_emulator::{ - assert_expected_events, bx, helpers::weight_within_threshold, BridgeMessage, - BridgeMessageDispatchError, BridgeMessageHandler, Chain, Network, Parachain, RelayChain, - TestExt, -}; - -// Polkadot -pub use pallet_xcm; -pub use polkadot_runtime_parachains::{ - dmp, hrmp, - inclusion::{AggregateMessageOrigin, UmpQueueId}, -}; -pub use xcm::{ - prelude::{Junction, Junctions, MultiLocation, NetworkId, OriginKind, Outcome, VersionedXcm}, - v3::Error, - DoubleEncoded, -}; - -pub struct BridgeHubMessageHandler { - _marker: std::marker::PhantomData<(S, T, I)>, -} - -struct LaneIdWrapper(LaneId); - -impl From for u32 { - fn from(lane_id: LaneIdWrapper) -> u32 { - u32::from_be_bytes(lane_id.0 .0) - } -} - -impl From for LaneIdWrapper { - fn from(id: u32) -> LaneIdWrapper { - LaneIdWrapper(LaneId(id.to_be_bytes())) - } -} - -// TODO: uncomment when https://github.com/polkadot-fellows/runtimes/pull/108 is merged -// type BridgeHubPolkadotRuntime = ::Runtime; -// type BridgeHubKusamaRuntime = ::Runtime; - -// TODO: uncomment when https://github.com/polkadot-fellows/runtimes/pull/108 is merged -// pub type PolkadotKusamaMessageHandler -// = BridgeHubMessageHandler; -// pub type KusamaPolkadotMessageHandler -// = BridgeHubMessageHandler; - -impl BridgeMessageHandler for BridgeHubMessageHandler -where - S: Config, - T: Config, - I: 'static, - >::InboundPayload: From>, - >::MessageDispatch: - MessageDispatch, -{ - fn get_source_outbound_messages() -> Vec { - // get the source active outbound lanes - let active_lanes = S::ActiveOutboundLanes::get(); - - let mut messages: Vec = Default::default(); - - // collect messages from `OutboundMessages` for each active outbound lane in the source - for lane in active_lanes { - let latest_generated_nonce = - OutboundLanes::::get(lane).latest_generated_nonce; - let latest_received_nonce = - OutboundLanes::::get(lane).latest_received_nonce; - - (latest_received_nonce + 1..=latest_generated_nonce).for_each(|nonce| { - let encoded_payload: Vec = - Pallet::::outbound_message_data(*lane, nonce) - .expect("Bridge message does not exist") - .into(); - let payload = Vec::::decode(&mut &encoded_payload[..]) - .expect("Decodign XCM message failed"); - let id: u32 = LaneIdWrapper(*lane).into(); - let message = BridgeMessage { id, nonce, payload }; - - messages.push(message); - }); - } - messages - } - - fn dispatch_target_inbound_message( - message: BridgeMessage, - ) -> Result<(), BridgeMessageDispatchError> { - type TargetMessageDispatch = >::MessageDispatch; - type InboundPayload = >::InboundPayload; - - let lane_id = LaneIdWrapper::from(message.id).0; - let nonce = message.nonce; - let payload = Ok(From::from(message.payload)); - - // Directly dispatch outbound messages assuming everything is correct - // and bypassing the `Relayers` and `InboundLane` logic - let dispatch_result = TargetMessageDispatch::::dispatch(DispatchMessage { - key: MessageKey { lane_id, nonce }, - data: DispatchMessageData::> { payload }, - }); - - let result = match dispatch_result.dispatch_level_result { - XcmBlobMessageDispatchResult::Dispatched => Ok(()), - XcmBlobMessageDispatchResult::InvalidPayload => Err(BridgeMessageDispatchError( - Box::new(XcmBlobMessageDispatchResult::InvalidPayload), - )), - XcmBlobMessageDispatchResult::NotDispatched(e) => Err(BridgeMessageDispatchError( - Box::new(XcmBlobMessageDispatchResult::NotDispatched(e)), - )), - }; - result - } - - fn notify_source_message_delivery(lane_id: u32) { - let data = OutboundLanes::::get(LaneIdWrapper::from(lane_id).0); - let new_data = OutboundLaneData { - oldest_unpruned_nonce: data.oldest_unpruned_nonce + 1, - latest_received_nonce: data.latest_received_nonce + 1, - ..data - }; - - OutboundLanes::::insert(LaneIdWrapper::from(lane_id).0, new_data); - } -} - -#[macro_export] -macro_rules! impl_accounts_helpers_for_relay_chain { - ( $chain:ident ) => { - $crate::impls::paste::paste! { - impl $chain { - /// Fund a set of accounts with a balance - pub fn fund_accounts(accounts: Vec<($crate::impls::AccountId, $crate::impls::Balance)>) { - ::execute_with(|| { - for account in accounts { - $crate::impls::assert_ok!(]>::Balances::force_set_balance( - ::RuntimeOrigin::root(), - account.0.into(), - account.1, - )); - } - }); - } - /// Fund a sovereign account based on its Parachain Id - pub fn fund_para_sovereign(amount: $crate::impls::Balance, para_id: $crate::impls::ParaId) -> $crate::impls::AccountId32 { - let sovereign_account = ::sovereign_account_id_of_child_para(para_id); - Self::fund_accounts(vec![(sovereign_account.clone(), amount)]); - sovereign_account - } - } - } - }; -} - -#[macro_export] -macro_rules! impl_assert_events_helpers_for_relay_chain { - ( $chain:ident ) => { - $crate::impls::paste::paste! { - type [<$chain RuntimeEvent>] = <$chain as $crate::impls::Chain>::RuntimeEvent; - - impl $chain { - /// Asserts a dispatchable is completely executed and XCM sent - pub fn assert_xcm_pallet_attempted_complete(expected_weight: Option<$crate::impls::Weight>) { - $crate::impls::assert_expected_events!( - Self, - vec![ - [<$chain RuntimeEvent>]::::XcmPallet( - $crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Complete(weight) } - ) => { - weight: $crate::impls::weight_within_threshold( - ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), - expected_weight.unwrap_or(*weight), - *weight - ), - }, - ] - ); - } - - /// Asserts a dispatchable is incompletely executed and XCM sent - pub fn assert_xcm_pallet_attempted_incomplete( - expected_weight: Option<$crate::impls::Weight>, - expected_error: Option<$crate::impls::Error>, - ) { - $crate::impls::assert_expected_events!( - Self, - vec![ - // Dispatchable is properly executed and XCM message sent - [<$chain RuntimeEvent>]::::XcmPallet( - $crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Incomplete(weight, error) } - ) => { - weight: $crate::impls::weight_within_threshold( - ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), - expected_weight.unwrap_or(*weight), - *weight - ), - error: *error == expected_error.unwrap_or(*error), - }, - ] - ); - } - - /// Asserts a XCM message is sent - pub fn assert_xcm_pallet_sent() { - $crate::impls::assert_expected_events!( - Self, - vec![ - [<$chain RuntimeEvent>]::::XcmPallet($crate::impls::pallet_xcm::Event::Sent { .. }) => {}, - ] - ); - } - - /// Asserts a XCM from System Parachain is succesfully received and proccessed - pub fn assert_ump_queue_processed( - expected_success: bool, - expected_id: Option<$crate::impls::ParaId>, - expected_weight: Option<$crate::impls::Weight>, - ) { - $crate::impls::assert_expected_events!( - Self, - vec![ - // XCM is succesfully received and proccessed - [<$chain RuntimeEvent>]::::MessageQueue($crate::impls::pallet_message_queue::Event::Processed { - origin: $crate::impls::AggregateMessageOrigin::Ump($crate::impls::UmpQueueId::Para(id)), - weight_used, - success, - .. - }) => { - id: *id == expected_id.unwrap_or(*id), - weight_used: $crate::impls::weight_within_threshold( - ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), - expected_weight.unwrap_or(*weight_used), - *weight_used - ), - success: *success == expected_success, - }, - ] - ); - } - } - } - }; -} - -#[macro_export] -macro_rules! impl_hrmp_channels_helpers_for_relay_chain { - ( $chain:ident ) => { - $crate::impls::paste::paste! { - impl $chain { - /// Init open channel request with another Parachain - pub fn init_open_channel_call( - recipient_para_id: $crate::impls::ParaId, - max_capacity: u32, - max_message_size: u32, - ) -> $crate::impls::DoubleEncoded<()> { - use $crate::impls::Encode; - - ::RuntimeCall::Hrmp($crate::impls::hrmp::Call::< - ::Runtime, - >::hrmp_init_open_channel { - recipient: recipient_para_id, - proposed_max_capacity: max_capacity, - proposed_max_message_size: max_message_size, - }) - .encode() - .into() - } - /// Recipient Parachain accept the open request from another Parachain - pub fn accept_open_channel_call(sender_para_id: $crate::impls::ParaId) -> $crate::impls::DoubleEncoded<()> { - use $crate::impls::Encode; - - ::RuntimeCall::Hrmp($crate::impls::hrmp::Call::< - ::Runtime, - >::hrmp_accept_open_channel { - sender: sender_para_id, - }) - .encode() - .into() - } - - /// A root origin force to open a channel between two Parachains - pub fn force_process_hrmp_open(sender: $crate::impls::ParaId, recipient: $crate::impls::ParaId) { - use $crate::impls::Chain; - - ::execute_with(|| { - let relay_root_origin = ::RuntimeOrigin::root(); - - // Force process HRMP open channel requests without waiting for the next session - $crate::impls::assert_ok!(]>::Hrmp::force_process_hrmp_open( - relay_root_origin, - 0 - )); - - let channel_id = $crate::impls::HrmpChannelId { sender, recipient }; - - let hrmp_channel_exist = $crate::impls::hrmp::HrmpChannels::< - ::Runtime, - >::contains_key(&channel_id); - - // Check the HRMP channel has been successfully registrered - assert!(hrmp_channel_exist) - }); - } - } - } - }; -} - -#[macro_export] -macro_rules! impl_send_transact_helpers_for_relay_chain { - ( $chain:ident ) => { - $crate::impls::paste::paste! { - impl $chain { - /// A root origin (as governance) sends `xcm::Transact` with `UnpaidExecution` and encoded `call` to child parachain. - pub fn send_unpaid_transact_to_parachain_as_root( - recipient: $crate::impls::ParaId, - call: $crate::impls::DoubleEncoded<()> - ) { - use $crate::impls::{bx, Chain, RelayChain}; - - ::execute_with(|| { - let root_origin = ::RuntimeOrigin::root(); - let destination: $crate::impls::MultiLocation = ::child_location_of(recipient); - let xcm = $crate::impls::xcm_transact_unpaid_execution(call, $crate::impls::OriginKind::Superuser); - - // Send XCM `Transact` - $crate::impls::assert_ok!(]>::XcmPallet::send( - root_origin, - bx!(destination.into()), - bx!(xcm), - )); - Self::assert_xcm_pallet_sent(); - }); - } - } - } - }; -} - -#[macro_export] -macro_rules! impl_accounts_helpers_for_parachain { - ( $chain:ident ) => { - $crate::impls::paste::paste! { - impl $chain { - /// Fund a set of accounts with a balance - pub fn fund_accounts(accounts: Vec<($crate::impls::AccountId, $crate::impls::Balance)>) { - ::execute_with(|| { - for account in accounts { - $crate::impls::assert_ok!(]>::Balances::force_set_balance( - ::RuntimeOrigin::root(), - account.0.into(), - account.1, - )); - } - }); - } - - /// Return local sovereign account of `para_id` on other `network_id` - pub fn sovereign_account_of_parachain_on_other_global_consensus( - network_id: $crate::impls::NetworkId, - para_id: $crate::impls::ParaId, - ) -> $crate::impls::AccountId { - let remote_location = $crate::impls::MultiLocation { - parents: 2, - interior: $crate::impls::Junctions::X2( - $crate::impls::Junction::GlobalConsensus(network_id), - $crate::impls::Junction::Parachain(para_id.into()), - ), - }; - ::execute_with(|| { - Self::sovereign_account_id_of(remote_location) - }) - } - } - } - }; -} - -#[macro_export] -macro_rules! impl_assert_events_helpers_for_parachain { - ( $chain:ident ) => { - $crate::impls::paste::paste! { - type [<$chain RuntimeEvent>] = <$chain as $crate::impls::Chain>::RuntimeEvent; - - impl $chain { - /// Asserts a dispatchable is completely executed and XCM sent - pub fn assert_xcm_pallet_attempted_complete(expected_weight: Option<$crate::impls::Weight>) { - $crate::impls::assert_expected_events!( - Self, - vec![ - [<$chain RuntimeEvent>]::::PolkadotXcm( - $crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Complete(weight) } - ) => { - weight: $crate::impls::weight_within_threshold( - ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), - expected_weight.unwrap_or(*weight), - *weight - ), - }, - ] - ); - } - - /// Asserts a dispatchable is incompletely executed and XCM sent - pub fn assert_xcm_pallet_attempted_incomplete( - expected_weight: Option<$crate::impls::Weight>, - expected_error: Option<$crate::impls::Error>, - ) { - $crate::impls::assert_expected_events!( - Self, - vec![ - // Dispatchable is properly executed and XCM message sent - [<$chain RuntimeEvent>]::::PolkadotXcm( - $crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Incomplete(weight, error) } - ) => { - weight: $crate::impls::weight_within_threshold( - ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), - expected_weight.unwrap_or(*weight), - *weight - ), - error: *error == expected_error.unwrap_or(*error), - }, - ] - ); - } - - /// Asserts a dispatchable throws and error when trying to be sent - pub fn assert_xcm_pallet_attempted_error(expected_error: Option<$crate::impls::Error>) { - $crate::impls::assert_expected_events!( - Self, - vec![ - // Execution fails in the origin with `Barrier` - [<$chain RuntimeEvent>]::::PolkadotXcm( - $crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Error(error) } - ) => { - error: *error == expected_error.unwrap_or(*error), - }, - ] - ); - } - - /// Asserts a XCM message is sent - pub fn assert_xcm_pallet_sent() { - $crate::impls::assert_expected_events!( - Self, - vec![ - [<$chain RuntimeEvent>]::::PolkadotXcm($crate::impls::pallet_xcm::Event::Sent { .. }) => {}, - ] - ); - } - - /// Asserts a XCM message is sent to Relay Chain - pub fn assert_parachain_system_ump_sent() { - $crate::impls::assert_expected_events!( - Self, - vec![ - [<$chain RuntimeEvent>]::::ParachainSystem( - $crate::impls::cumulus_pallet_parachain_system::Event::UpwardMessageSent { .. } - ) => {}, - ] - ); - } - - /// Asserts a XCM from Relay Chain is completely executed - pub fn assert_dmp_queue_complete(expected_weight: Option<$crate::impls::Weight>) { - $crate::impls::assert_expected_events!( - Self, - vec![ - [<$chain RuntimeEvent>]::::MessageQueue($crate::impls::pallet_message_queue::Event::Processed { - success: true, weight_used: weight, .. - }) => { - weight: $crate::impls::weight_within_threshold( - ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), - expected_weight.unwrap_or(*weight), - *weight - ), - }, - ] - ); - } - - /// Asserts a XCM from Relay Chain is incompletely executed - pub fn assert_dmp_queue_incomplete( - expected_weight: Option<$crate::impls::Weight>, - expected_error: Option<$crate::impls::Error>, - ) { - $crate::impls::assert_expected_events!( - Self, - vec![ - [<$chain RuntimeEvent>]::::MessageQueue($crate::impls::pallet_message_queue::Event::Processed { - success: false, weight_used: weight, .. - }) => { - weight: $crate::impls::weight_within_threshold( - ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), - expected_weight.unwrap_or(*weight), - *weight - ), - }, - ] - ); - } - - /// Asserts a XCM from another Parachain is completely executed - pub fn assert_xcmp_queue_success(expected_weight: Option<$crate::impls::Weight>) { - $crate::impls::assert_expected_events!( - Self, - vec![ - [<$chain RuntimeEvent>]::::MessageQueue($crate::impls::pallet_message_queue::Event::Processed { success: true, weight_used: weight, .. } - - ) => { - weight: $crate::impls::weight_within_threshold( - ($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD), - expected_weight.unwrap_or(*weight), - *weight - ), - }, - ] - ); - } - } - } - }; -} - -#[macro_export] -macro_rules! impl_assets_helpers_for_parachain { - ( $chain:ident, $relay_chain:ident ) => { - $crate::impls::paste::paste! { - impl $chain { - /// Returns the encoded call for `force_create` from the assets pallet - pub fn force_create_asset_call( - asset_id: u32, - owner: $crate::impls::AccountId, - is_sufficient: bool, - min_balance: $crate::impls::Balance, - ) -> $crate::impls::DoubleEncoded<()> { - use $crate::impls::{Chain, Encode}; - - ::RuntimeCall::Assets($crate::impls::pallet_assets::Call::< - ::Runtime, - $crate::impls::pallet_assets::Instance1, - >::force_create { - id: asset_id.into(), - owner: owner.into(), - is_sufficient, - min_balance, - }) - .encode() - .into() - } - - /// Returns a `VersionedXcm` for `force_create` from the assets pallet - pub fn force_create_asset_xcm( - origin_kind: $crate::impls::OriginKind, - asset_id: u32, - owner: $crate::impls::AccountId, - is_sufficient: bool, - min_balance: $crate::impls::Balance, - ) -> $crate::impls::VersionedXcm<()> { - let call = Self::force_create_asset_call(asset_id, owner, is_sufficient, min_balance); - $crate::impls::xcm_transact_unpaid_execution(call, origin_kind) - } - - /// Mint assets making use of the assets pallet - pub fn mint_asset( - signed_origin: ::RuntimeOrigin, - id: u32, - beneficiary: $crate::impls::AccountId, - amount_to_mint: u128, - ) { - ::execute_with(|| { - $crate::impls::assert_ok!(]>::Assets::mint( - signed_origin, - id.into(), - beneficiary.clone().into(), - amount_to_mint - )); - - type RuntimeEvent = <$chain as $crate::impls::Chain>::RuntimeEvent; - - $crate::impls::assert_expected_events!( - Self, - vec![ - RuntimeEvent::::Assets( - $crate::impls::pallet_assets::Event::Issued { asset_id, owner, amount } - ) => { - asset_id: *asset_id == id, - owner: *owner == beneficiary.clone().into(), - amount: *amount == amount_to_mint, - }, - ] - ); - }); - } - - /// Force create and mint assets making use of the assets pallet - pub fn force_create_and_mint_asset( - id: u32, - min_balance: u128, - is_sufficient: bool, - asset_owner: $crate::impls::AccountId, - dmp_weight_threshold: Option<$crate::impls::Weight>, - amount_to_mint: u128, - ) { - use $crate::impls::Chain; - - // Force create asset - Self::force_create_asset_from_relay_as_root( - id, - min_balance, - is_sufficient, - asset_owner.clone(), - dmp_weight_threshold - ); - - // Mint asset for System Parachain's sender - let signed_origin = ::RuntimeOrigin::signed(asset_owner.clone()); - Self::mint_asset(signed_origin, id, asset_owner, amount_to_mint); - } - - /// Relay Chain sends `Transact` instruction with `force_create_asset` to Parachain with `Assets` instance of `pallet_assets` . - pub fn force_create_asset_from_relay_as_root( - id: u32, - min_balance: u128, - is_sufficient: bool, - asset_owner: $crate::impls::AccountId, - dmp_weight_threshold: Option<$crate::impls::Weight>, - ) { - use $crate::impls::{Parachain, Inspect, TestExt}; - - <$relay_chain>::send_unpaid_transact_to_parachain_as_root( - Self::para_id(), - Self::force_create_asset_call(id, asset_owner.clone(), is_sufficient, min_balance), - ); - - // Receive XCM message in Assets Parachain - Self::execute_with(|| { - type RuntimeEvent = <$chain as $crate::impls::Chain>::RuntimeEvent; - - Self::assert_dmp_queue_complete(dmp_weight_threshold); - - $crate::impls::assert_expected_events!( - Self, - vec![ - RuntimeEvent::::Assets($crate::impls::pallet_assets::Event::ForceCreated { asset_id, owner }) => { - asset_id: *asset_id == id, - owner: *owner == asset_owner, - }, - ] - ); - - assert!(]>::Assets::asset_exists(id.into())); - }); - } - } - } - }; -} - -#[macro_export] -macro_rules! impl_foreign_assets_helpers_for_parachain { - ( $chain:ident, $relay_chain:ident ) => { - $crate::impls::paste::paste! { - impl $chain { - /// Create foreign assets using sudo `ForeignAssets::force_create()` - pub fn force_create_foreign_asset( - id: $crate::impls::MultiLocation, - owner: $crate::impls::AccountId, - is_sufficient: bool, - min_balance: u128, - prefund_accounts: Vec<($crate::impls::AccountId, u128)>, - ) { - use $crate::impls::Inspect; - let sudo_origin = <$chain as $crate::impls::Chain>::RuntimeOrigin::root(); - ::execute_with(|| { - $crate::impls::assert_ok!( - ]>::ForeignAssets::force_create( - sudo_origin, - id, - owner.clone().into(), - is_sufficient, - min_balance, - ) - ); - assert!(]>::ForeignAssets::asset_exists(id)); - type RuntimeEvent = <$chain as $crate::impls::Chain>::RuntimeEvent; - $crate::impls::assert_expected_events!( - Self, - vec![ - RuntimeEvent::::ForeignAssets( - $crate::impls::pallet_assets::Event::ForceCreated { - asset_id, - .. - } - ) => { asset_id: *asset_id == id, }, - ] - ); - }); - for (beneficiary, amount) in prefund_accounts.into_iter() { - let signed_origin = - <$chain as $crate::impls::Chain>::RuntimeOrigin::signed(owner.clone()); - Self::mint_foreign_asset(signed_origin, id, beneficiary, amount); - } - } - - /// Mint assets making use of the ForeignAssets pallet-assets instance - pub fn mint_foreign_asset( - signed_origin: ::RuntimeOrigin, - id: $crate::impls::MultiLocation, - beneficiary: $crate::impls::AccountId, - amount_to_mint: u128, - ) { - ::execute_with(|| { - $crate::impls::assert_ok!(]>::ForeignAssets::mint( - signed_origin, - id.into(), - beneficiary.clone().into(), - amount_to_mint - )); - - type RuntimeEvent = <$chain as $crate::impls::Chain>::RuntimeEvent; - - $crate::impls::assert_expected_events!( - Self, - vec![ - RuntimeEvent::::ForeignAssets( - $crate::impls::pallet_assets::Event::Issued { asset_id, owner, amount } - ) => { - asset_id: *asset_id == id, - owner: *owner == beneficiary.clone().into(), - amount: *amount == amount_to_mint, - }, - ] - ); - }); - } - } - } - }; -} diff --git a/integration-tests/emulated/common/src/lib.rs b/integration-tests/emulated/common/src/lib.rs deleted file mode 100644 index 8058f88b58..0000000000 --- a/integration-tests/emulated/common/src/lib.rs +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub mod impls; -pub mod macros; -pub mod xcm_helpers; - -// Substrate -use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId; -use grandpa_primitives::AuthorityId as GrandpaId; -use pallet_im_online::sr25519::AuthorityId as ImOnlineId; -use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; -use sp_consensus_babe::AuthorityId as BabeId; -use sp_core::{sr25519, Pair, Public}; -use sp_runtime::{ - traits::{IdentifyAccount, Verify}, - MultiSignature, -}; - -// Cumulus -use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId}; -use polkadot_primitives::{AssignmentId, ValidatorId}; - -/// The default XCM version to set in genesis config. -pub const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; - -pub const XCM_V2: u32 = 3; -pub const XCM_V3: u32 = 2; -pub const REF_TIME_THRESHOLD: u64 = 33; -pub const PROOF_SIZE_THRESHOLD: u64 = 33; - -type AccountPublic = ::Signer; - -/// Helper function to generate a crypto pair from seed -fn get_from_seed(seed: &str) -> ::Public { - TPublic::Pair::from_string(&format!("//{}", seed), None) - .expect("static values are valid; qed") - .public() -} - -/// Helper function to generate an account ID from seed. -pub fn get_account_id_from_seed(seed: &str) -> AccountId -where - AccountPublic: From<::Public>, -{ - AccountPublic::from(get_from_seed::(seed)).into_account() -} - -pub mod accounts { - use super::*; - pub const ALICE: &str = "Alice"; - pub const BOB: &str = "Bob"; - pub const CHARLIE: &str = "Charlie"; - pub const DAVE: &str = "Dave"; - pub const EVE: &str = "Eve"; - pub const FERDIE: &str = "Ferdei"; - pub const ALICE_STASH: &str = "Alice//stash"; - pub const BOB_STASH: &str = "Bob//stash"; - pub const CHARLIE_STASH: &str = "Charlie//stash"; - pub const DAVE_STASH: &str = "Dave//stash"; - pub const EVE_STASH: &str = "Eve//stash"; - pub const FERDIE_STASH: &str = "Ferdie//stash"; - pub const FERDIE_BEEFY: &str = "Ferdie//stash"; - - pub fn init_balances() -> Vec { - vec![ - get_account_id_from_seed::(ALICE), - get_account_id_from_seed::(BOB), - get_account_id_from_seed::(CHARLIE), - get_account_id_from_seed::(DAVE), - get_account_id_from_seed::(EVE), - get_account_id_from_seed::(FERDIE), - get_account_id_from_seed::(ALICE_STASH), - get_account_id_from_seed::(BOB_STASH), - get_account_id_from_seed::(CHARLIE_STASH), - get_account_id_from_seed::(DAVE_STASH), - get_account_id_from_seed::(EVE_STASH), - get_account_id_from_seed::(FERDIE_STASH), - ] - } -} - -pub mod collators { - use super::*; - - pub fn invulnerables_asset_hub_polkadot() -> Vec<(AccountId, AssetHubPolkadotAuraId)> { - vec![ - ( - get_account_id_from_seed::("Alice"), - get_from_seed::("Alice"), - ), - ( - get_account_id_from_seed::("Bob"), - get_from_seed::("Bob"), - ), - ] - } - - pub fn invulnerables() -> Vec<(AccountId, AuraId)> { - vec![ - ( - get_account_id_from_seed::("Alice"), - get_from_seed::("Alice"), - ), - (get_account_id_from_seed::("Bob"), get_from_seed::("Bob")), - ] - } -} - -pub mod validators { - use super::*; - - pub fn initial_authorities() -> Vec<( - AccountId, - AccountId, - BabeId, - GrandpaId, - ImOnlineId, - ValidatorId, - AssignmentId, - AuthorityDiscoveryId, - BeefyId, - )> { - let seed = "Alice"; - vec![( - get_account_id_from_seed::(&format!("{}//stash", seed)), - get_account_id_from_seed::(seed), - get_from_seed::(seed), - get_from_seed::(seed), - get_from_seed::(seed), - get_from_seed::(seed), - get_from_seed::(seed), - get_from_seed::(seed), - get_from_seed::(seed), - )] - } -} diff --git a/integration-tests/emulated/common/src/macros.rs b/integration-tests/emulated/common/src/macros.rs deleted file mode 100644 index ffcf2bc346..0000000000 --- a/integration-tests/emulated/common/src/macros.rs +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub use paste; - -// Substrate -pub use pallet_balances; -pub use pallet_message_queue; -pub use pallet_xcm; - -// Polkadot -pub use xcm::prelude::{AccountId32, WeightLimit}; - -// Cumulus -pub use asset_test_utils; -pub use cumulus_pallet_xcmp_queue; -pub use xcm_emulator::Chain; - -#[macro_export] -macro_rules! test_parachain_is_trusted_teleporter { - ( $sender_para:ty, $sender_xcm_config:ty, vec![$( $receiver_para:ty ),+], ($assets:expr, $amount:expr) ) => { - $crate::macros::paste::paste! { - // init Origin variables - let sender = [<$sender_para Sender>]::get(); - let mut para_sender_balance_before = - <$sender_para as $crate::macros::Chain>::account_data_of(sender.clone()).free; - let origin = <$sender_para as $crate::macros::Chain>::RuntimeOrigin::signed(sender.clone()); - let fee_asset_item = 0; - let weight_limit = $crate::macros::WeightLimit::Unlimited; - - $( - { - // init Destination variables - let receiver = [<$receiver_para Receiver>]::get(); - let para_receiver_balance_before = - <$receiver_para as $crate::macros::Chain>::account_data_of(receiver.clone()).free; - let para_destination = - <$sender_para>::sibling_location_of(<$receiver_para>::para_id()); - let beneficiary: MultiLocation = - $crate::macros::AccountId32 { network: None, id: receiver.clone().into() }.into(); - - // Send XCM message from Origin Parachain - // We are only testing the limited teleport version, which should be ok since success will - // depend only on a proper `XcmConfig` at destination. - <$sender_para>::execute_with(|| { - assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::limited_teleport_assets( - origin.clone(), - bx!(para_destination.into()), - bx!(beneficiary.into()), - bx!($assets.clone().into()), - fee_asset_item, - weight_limit.clone(), - )); - - type RuntimeEvent = <$sender_para as $crate::macros::Chain>::RuntimeEvent; - - assert_expected_events!( - $sender_para, - vec![ - RuntimeEvent::PolkadotXcm( - $crate::macros::pallet_xcm::Event::Attempted { outcome: Outcome::Complete { .. } } - ) => {}, - RuntimeEvent::XcmpQueue( - $crate::macros::cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. } - ) => {}, - RuntimeEvent::Balances( - $crate::macros::pallet_balances::Event::Burned { who: sender, amount } - ) => {}, - ] - ); - }); - - // Receive XCM message in Destination Parachain - <$receiver_para>::execute_with(|| { - type RuntimeEvent = <$receiver_para as $crate::macros::Chain>::RuntimeEvent; - - assert_expected_events!( - $receiver_para, - vec![ - RuntimeEvent::Balances( - $crate::macros::pallet_balances::Event::Minted { who: receiver, .. } - ) => {}, - RuntimeEvent::MessageQueue( - $crate::macros::pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); - }); - - // Check if balances are updated accordingly in Origin and Destination Parachains - let para_sender_balance_after = - <$sender_para as $crate::macros::Chain>::account_data_of(sender.clone()).free; - let para_receiver_balance_after = - <$receiver_para as $crate::macros::Chain>::account_data_of(receiver.clone()).free; - let delivery_fees = <$sender_para>::execute_with(|| { - $crate::macros::asset_test_utils::xcm_helpers::transfer_assets_delivery_fees::< - <$sender_xcm_config as xcm_executor::Config>::XcmSender, - >($assets.clone(), fee_asset_item, weight_limit.clone(), beneficiary, para_destination) - }); - - assert_eq!(para_sender_balance_before - $amount - delivery_fees, para_sender_balance_after); - assert!(para_receiver_balance_after > para_receiver_balance_before); - - // Update sender balance - para_sender_balance_before = <$sender_para as $crate::macros::Chain>::account_data_of(sender.clone()).free; - } - )+ - } - }; -} - -#[macro_export] -macro_rules! include_penpal_create_foreign_asset_on_asset_hub { - ( $penpal:ident, $asset_hub:ident, $relay_ed:expr, $weight_to_fee:expr) => { - $crate::impls::paste::paste! { - pub fn penpal_create_foreign_asset_on_asset_hub( - asset_id_on_penpal: u32, - foreign_asset_at_asset_hub: MultiLocation, - ah_as_seen_by_penpal: MultiLocation, - is_sufficient: bool, - asset_owner: AccountId, - prefund_amount: u128, - ) { - use frame_support::weights::WeightToFee; - let ah_check_account = $asset_hub::execute_with(|| { - <$asset_hub as [<$asset_hub Pallet>]>::PolkadotXcm::check_account() - }); - let penpal_check_account = - $penpal::execute_with(|| <$penpal as [<$penpal Pallet>]>::PolkadotXcm::check_account()); - let penpal_as_seen_by_ah = $asset_hub::sibling_location_of($penpal::para_id()); - - // prefund SA of Penpal on AssetHub with enough native tokens to pay for creating - // new foreign asset, also prefund CheckingAccount with ED, because teleported asset - // itself might not be sufficient and CheckingAccount cannot be created otherwise - let sov_penpal_on_ah = $asset_hub::sovereign_account_id_of(penpal_as_seen_by_ah); - $asset_hub::fund_accounts(vec![ - (sov_penpal_on_ah.clone().into(), $relay_ed * 100_000_000_000), - (ah_check_account.clone().into(), $relay_ed * 1000), - ]); - - // prefund SA of AssetHub on Penpal with native asset - let sov_ah_on_penpal = $penpal::sovereign_account_id_of(ah_as_seen_by_penpal); - $penpal::fund_accounts(vec![ - (sov_ah_on_penpal.into(), $relay_ed * 1_000_000_000), - (penpal_check_account.clone().into(), $relay_ed * 1000), - ]); - - // Force create asset on $penpal and prefund [<$penpal Sender>] - $penpal::force_create_and_mint_asset( - asset_id_on_penpal, - ASSET_MIN_BALANCE, - is_sufficient, - asset_owner, - None, - prefund_amount, - ); - - let require_weight_at_most = Weight::from_parts(1_100_000_000_000, 30_000); - // `OriginKind::Xcm` required by ForeignCreators pallet-assets origin filter - let origin_kind = OriginKind::Xcm; - let call_create_foreign_assets = - <$asset_hub as Chain>::RuntimeCall::ForeignAssets(pallet_assets::Call::< - <$asset_hub as Chain>::Runtime, - pallet_assets::Instance2, - >::create { - id: foreign_asset_at_asset_hub, - min_balance: ASSET_MIN_BALANCE, - admin: sov_penpal_on_ah.into(), - }) - .encode(); - let buy_execution_fee_amount = $weight_to_fee::weight_to_fee( - &Weight::from_parts(10_100_000_000_000, 300_000), - ); - let buy_execution_fee = MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(buy_execution_fee_amount), - }; - let xcm = VersionedXcm::from(Xcm(vec![ - WithdrawAsset { 0: vec![buy_execution_fee.clone()].into() }, - BuyExecution { fees: buy_execution_fee.clone(), weight_limit: Unlimited }, - Transact { require_weight_at_most, origin_kind, call: call_create_foreign_assets.into() }, - ExpectTransactStatus(MaybeErrorCode::Success), - RefundSurplus, - DepositAsset { assets: All.into(), beneficiary: penpal_as_seen_by_ah }, - ])); - // Send XCM message from penpal => asset_hub - let sudo_penpal_origin = <$penpal as Chain>::RuntimeOrigin::root(); - $penpal::execute_with(|| { - assert_ok!(<$penpal as [<$penpal Pallet>]>::PolkadotXcm::send( - sudo_penpal_origin.clone(), - bx!(ah_as_seen_by_penpal.into()), - bx!(xcm), - )); - type RuntimeEvent = <$penpal as Chain>::RuntimeEvent; - assert_expected_events!( - $penpal, - vec![ - RuntimeEvent::PolkadotXcm(pallet_xcm::Event::Sent { .. }) => {}, - ] - ); - }); - $asset_hub::execute_with(|| { - type ForeignAssets = <$asset_hub as [<$asset_hub Pallet>]>::ForeignAssets; - assert!(ForeignAssets::asset_exists(foreign_asset_at_asset_hub)); - }); - } - } - }; -} diff --git a/integration-tests/emulated/common/src/xcm_helpers.rs b/integration-tests/emulated/common/src/xcm_helpers.rs deleted file mode 100644 index c40f51a440..0000000000 --- a/integration-tests/emulated/common/src/xcm_helpers.rs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . - -use parachains_common::AccountId; -use xcm::{prelude::*, DoubleEncoded}; - -/// Helper method to build a XCM with a `Transact` instruction and paying for its execution -pub fn xcm_transact_paid_execution( - call: DoubleEncoded<()>, - origin_kind: OriginKind, - native_asset: MultiAsset, - beneficiary: AccountId, -) -> VersionedXcm<()> { - let weight_limit = WeightLimit::Unlimited; - let require_weight_at_most = Weight::from_parts(1000000000, 200000); - let native_assets: MultiAssets = native_asset.clone().into(); - - VersionedXcm::from(Xcm(vec![ - WithdrawAsset(native_assets), - BuyExecution { fees: native_asset, weight_limit }, - Transact { require_weight_at_most, origin_kind, call }, - RefundSurplus, - DepositAsset { - assets: All.into(), - beneficiary: MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: beneficiary.into() }), - }, - }, - ])) -} - -/// Helper method to build a XCM with a `Transact` instruction without paying for its execution -pub fn xcm_transact_unpaid_execution( - call: DoubleEncoded<()>, - origin_kind: OriginKind, -) -> VersionedXcm<()> { - let weight_limit = WeightLimit::Unlimited; - let require_weight_at_most = Weight::from_parts(1000000000, 200000); - let check_origin = None; - - VersionedXcm::from(Xcm(vec![ - UnpaidExecution { weight_limit, check_origin }, - Transact { require_weight_at_most, origin_kind, call }, - ])) -} -/// Helper method to get the non-fee asset used in multiple assets transfer -pub fn non_fee_asset(assets: &MultiAssets, fee_idx: usize) -> Option<(MultiLocation, u128)> { - let asset = assets.inner().into_iter().enumerate().find(|a| a.0 != fee_idx)?.1.clone(); - let asset_id = match asset.id { - Concrete(id) => id, - _ => return None, - }; - let asset_amount = match asset.fun { - Fungible(amount) => amount, - _ => return None, - }; - Some((asset_id, asset_amount)) -} diff --git a/integration-tests/emulated/helpers/Cargo.toml b/integration-tests/emulated/helpers/Cargo.toml new file mode 100644 index 0000000000..8c30a59c32 --- /dev/null +++ b/integration-tests/emulated/helpers/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "integration-tests-helpers" +version = "0.0.1" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Emulated integration tests helpers" +publish = false + +[dependencies] +paste = "1.0.14" + +# Substrate +pallet-balances = { version = "28.0.0" } +pallet-message-queue = { version = "31.0.0" } + +# Polkadot +xcm = { package = "staging-xcm", version = "7.0.0" } +pallet-xcm = { version = "7.0.0" } + +# Cumulus +xcm-emulator = { version = "0.5.0" } +cumulus-pallet-xcmp-queue = { version = "0.7.0" } +asset-test-utils = { version = "7.0.1" } diff --git a/integration-tests/emulated/helpers/src/lib.rs b/integration-tests/emulated/helpers/src/lib.rs new file mode 100644 index 0000000000..ba85425eba --- /dev/null +++ b/integration-tests/emulated/helpers/src/lib.rs @@ -0,0 +1,124 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub use paste; + +// Substrate +pub use pallet_balances; +pub use pallet_message_queue; + +// Polkadot +pub use pallet_xcm; +pub use xcm::prelude::{AccountId32, WeightLimit}; + +// Cumulus +pub use asset_test_utils; +pub use cumulus_pallet_xcmp_queue; +pub use xcm_emulator::Chain; + +/// TODO: when bumping to polkadot-sdk v1.8.0, +/// remove this crate altogether and get the macros from `emulated-integration-tests-common`. +#[macro_export] +macro_rules! test_parachain_is_trusted_teleporter { + ( $sender_para:ty, $sender_xcm_config:ty, vec![$( $receiver_para:ty ),+], ($assets:expr, $amount:expr) ) => { + $crate::paste::paste! { + // init Origin variables + let sender = [<$sender_para Sender>]::get(); + let mut para_sender_balance_before = + <$sender_para as $crate::Chain>::account_data_of(sender.clone()).free; + let origin = <$sender_para as $crate::Chain>::RuntimeOrigin::signed(sender.clone()); + let fee_asset_item = 0; + let weight_limit = $crate::WeightLimit::Unlimited; + + $( + { + // init Destination variables + let receiver = [<$receiver_para Receiver>]::get(); + let para_receiver_balance_before = + <$receiver_para as $crate::Chain>::account_data_of(receiver.clone()).free; + let para_destination = + <$sender_para>::sibling_location_of(<$receiver_para>::para_id()); + let beneficiary: MultiLocation = + $crate::AccountId32 { network: None, id: receiver.clone().into() }.into(); + + // Send XCM message from Origin Parachain + // We are only testing the limited teleport version, which should be ok since success will + // depend only on a proper `XcmConfig` at destination. + <$sender_para>::execute_with(|| { + assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::limited_teleport_assets( + origin.clone(), + bx!(para_destination.clone().into()), + bx!(beneficiary.clone().into()), + bx!($assets.clone().into()), + fee_asset_item, + weight_limit.clone(), + )); + + type RuntimeEvent = <$sender_para as $crate::Chain>::RuntimeEvent; + + assert_expected_events!( + $sender_para, + vec![ + RuntimeEvent::PolkadotXcm( + $crate::pallet_xcm::Event::Attempted { outcome: Outcome::Complete { .. } } + ) => {}, + RuntimeEvent::XcmpQueue( + $crate::cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. } + ) => {}, + RuntimeEvent::Balances( + $crate::pallet_balances::Event::Burned { who: sender, amount } + ) => {}, + ] + ); + }); + + // Receive XCM message in Destination Parachain + <$receiver_para>::execute_with(|| { + type RuntimeEvent = <$receiver_para as $crate::Chain>::RuntimeEvent; + + assert_expected_events!( + $receiver_para, + vec![ + RuntimeEvent::Balances( + $crate::pallet_balances::Event::Minted { who: receiver, .. } + ) => {}, + RuntimeEvent::MessageQueue( + $crate::pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + }); + + // Check if balances are updated accordingly in Origin and Destination Parachains + let para_sender_balance_after = + <$sender_para as $crate::Chain>::account_data_of(sender.clone()).free; + let para_receiver_balance_after = + <$receiver_para as $crate::Chain>::account_data_of(receiver.clone()).free; + let delivery_fees = <$sender_para>::execute_with(|| { + $crate::asset_test_utils::xcm_helpers::transfer_assets_delivery_fees::< + <$sender_xcm_config as xcm_executor::Config>::XcmSender, + >($assets.clone(), fee_asset_item, weight_limit.clone(), beneficiary, para_destination) + }); + + assert_eq!(para_sender_balance_before - $amount - delivery_fees, para_sender_balance_after); + assert!(para_receiver_balance_after > para_receiver_balance_before); + + // Update sender balance + para_sender_balance_before = <$sender_para as $crate::Chain>::account_data_of(sender.clone()).free; + } + )+ + } + }; +} diff --git a/integration-tests/emulated/networks/kusama-polkadot-system/Cargo.toml b/integration-tests/emulated/networks/kusama-polkadot-system/Cargo.toml new file mode 100644 index 0000000000..004ba93c2b --- /dev/null +++ b/integration-tests/emulated/networks/kusama-polkadot-system/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "kusama-polkadot-system-emulated-network" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Kusama<>Polkadot emulated bridged network" +publish = false + +[dependencies] + +# Cumulus +emulated-integration-tests-common = { version = "3.0.0" } + +# Runtimes +asset-hub-kusama-emulated-chain = { path = "../../chains/parachains/assets/asset-hub-kusama" } +asset-hub-polkadot-emulated-chain = { path = "../../chains/parachains/assets/asset-hub-polkadot" } +bridge-hub-kusama-emulated-chain = { path = "../../chains/parachains/bridges/bridge-hub-kusama" } +bridge-hub-polkadot-emulated-chain = { path = "../../chains/parachains/bridges/bridge-hub-polkadot" } +kusama-emulated-chain = { path = "../../chains/relays/kusama" } +penpal-emulated-chain = { path = "../../chains/parachains/testing/penpal" } +polkadot-emulated-chain = { path = "../../chains/relays/polkadot" } diff --git a/integration-tests/emulated/networks/kusama-polkadot-system/src/lib.rs b/integration-tests/emulated/networks/kusama-polkadot-system/src/lib.rs new file mode 100644 index 0000000000..dbdb453718 --- /dev/null +++ b/integration-tests/emulated/networks/kusama-polkadot-system/src/lib.rs @@ -0,0 +1,100 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub use asset_hub_kusama_emulated_chain; +pub use asset_hub_polkadot_emulated_chain; +pub use bridge_hub_kusama_emulated_chain; +pub use bridge_hub_polkadot_emulated_chain; +pub use kusama_emulated_chain; +pub use penpal_emulated_chain; +pub use polkadot_emulated_chain; + +use asset_hub_kusama_emulated_chain::AssetHubKusama; +use asset_hub_polkadot_emulated_chain::AssetHubPolkadot; +use bridge_hub_kusama_emulated_chain::BridgeHubKusama; +use bridge_hub_polkadot_emulated_chain::BridgeHubPolkadot; +use kusama_emulated_chain::Kusama; +use penpal_emulated_chain::PenpalA; +use polkadot_emulated_chain::Polkadot; + +// Cumulus +use emulated_integration_tests_common::{ + accounts::{ALICE, BOB}, + impls::{BridgeHubMessageHandler, BridgeMessagesInstance1}, + xcm_emulator::{ + decl_test_bridges, decl_test_networks, decl_test_sender_receiver_accounts_parameter_types, + Chain, + }, +}; + +decl_test_networks! { + pub struct KusamaMockNet { + relay_chain = Kusama, + parachains = vec![ + AssetHubKusama, + BridgeHubKusama, + PenpalA, + ], + bridge = KusamaPolkadotMockBridge + + }, + pub struct PolkadotMockNet { + relay_chain = Polkadot, + parachains = vec![ + AssetHubPolkadot, + BridgeHubPolkadot, + ], + bridge = PolkadotKusamaMockBridge + }, +} + +decl_test_bridges! { + pub struct KusamaPolkadotMockBridge { + source = BridgeHubKusamaPara, + target = BridgeHubPolkadotPara, + handler = KusamaPolkadotMessageHandler + }, + pub struct PolkadotKusamaMockBridge { + source = BridgeHubPolkadotPara, + target = BridgeHubKusamaPara, + handler = PolkadotKusamaMessageHandler + } +} + +type BridgeHubKusamaRuntime = ::Runtime; +type BridgeHubPolkadotRuntime = ::Runtime; + +pub type KusamaPolkadotMessageHandler = BridgeHubMessageHandler< + BridgeHubKusamaRuntime, + BridgeMessagesInstance1, + BridgeHubPolkadotRuntime, + BridgeMessagesInstance1, +>; +pub type PolkadotKusamaMessageHandler = BridgeHubMessageHandler< + BridgeHubPolkadotRuntime, + BridgeMessagesInstance1, + BridgeHubKusamaRuntime, + BridgeMessagesInstance1, +>; + +decl_test_sender_receiver_accounts_parameter_types! { + KusamaRelay { sender: ALICE, receiver: BOB }, + AssetHubKusamaPara { sender: ALICE, receiver: BOB }, + BridgeHubKusamaPara { sender: ALICE, receiver: BOB }, + PolkadotRelay { sender: ALICE, receiver: BOB }, + AssetHubPolkadotPara { sender: ALICE, receiver: BOB }, + BridgeHubPolkadotPara { sender: ALICE, receiver: BOB }, + PenpalAPara { sender: ALICE, receiver: BOB } +} diff --git a/integration-tests/emulated/networks/kusama-system/Cargo.toml b/integration-tests/emulated/networks/kusama-system/Cargo.toml new file mode 100644 index 0000000000..e575d21a5d --- /dev/null +++ b/integration-tests/emulated/networks/kusama-system/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "kusama-system-emulated-network" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Kusama System emulated network" +publish = false + +[dependencies] + +# Cumulus +emulated-integration-tests-common = { version = "3.0.0" } + +# Runtimes +asset-hub-kusama-emulated-chain = { path = "../../chains/parachains/assets/asset-hub-kusama" } +bridge-hub-kusama-emulated-chain = { path = "../../chains/parachains/bridges/bridge-hub-kusama" } +kusama-emulated-chain = { path = "../../chains/relays/kusama" } +penpal-emulated-chain = { path = "../../chains/parachains/testing/penpal" } diff --git a/integration-tests/emulated/networks/kusama-system/src/lib.rs b/integration-tests/emulated/networks/kusama-system/src/lib.rs new file mode 100644 index 0000000000..b6a3cdc3e5 --- /dev/null +++ b/integration-tests/emulated/networks/kusama-system/src/lib.rs @@ -0,0 +1,51 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub use asset_hub_kusama_emulated_chain; +pub use bridge_hub_kusama_emulated_chain; +pub use kusama_emulated_chain; +pub use penpal_emulated_chain; + +use asset_hub_kusama_emulated_chain::AssetHubKusama; +use bridge_hub_kusama_emulated_chain::BridgeHubKusama; +use kusama_emulated_chain::Kusama; +use penpal_emulated_chain::{PenpalA, PenpalB}; + +// Cumulus +use emulated_integration_tests_common::{ + accounts::{ALICE, BOB}, + xcm_emulator::{decl_test_networks, decl_test_sender_receiver_accounts_parameter_types}, +}; + +decl_test_networks! { + pub struct KusamaMockNet { + relay_chain = Kusama, + parachains = vec![ + AssetHubKusama, + BridgeHubKusama, + PenpalA, + PenpalB, + ], + bridge = () + }, +} + +decl_test_sender_receiver_accounts_parameter_types! { + KusamaRelay { sender: ALICE, receiver: BOB }, + AssetHubKusamaPara { sender: ALICE, receiver: BOB }, + BridgeHubKusamaPara { sender: ALICE, receiver: BOB }, + PenpalAPara { sender: ALICE, receiver: BOB }, + PenpalBPara { sender: ALICE, receiver: BOB } +} diff --git a/integration-tests/emulated/networks/polkadot-system/Cargo.toml b/integration-tests/emulated/networks/polkadot-system/Cargo.toml new file mode 100644 index 0000000000..ddc400b973 --- /dev/null +++ b/integration-tests/emulated/networks/polkadot-system/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "polkadot-system-emulated-network" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Polkadot System emulated network" +publish = false + +[dependencies] + +# Cumulus +emulated-integration-tests-common = { version = "3.0.0" } + +# Runtimes +asset-hub-polkadot-emulated-chain = { path = "../../chains/parachains/assets/asset-hub-polkadot" } +bridge-hub-polkadot-emulated-chain = { path = "../../chains/parachains/bridges/bridge-hub-polkadot" } +collectives-polkadot-emulated-chain = { path = "../../chains/parachains/collectives/collectives-polkadot" } +penpal-emulated-chain = { path = "../../chains/parachains/testing/penpal" } +polkadot-emulated-chain = { path = "../../chains/relays/polkadot" } diff --git a/integration-tests/emulated/networks/polkadot-system/src/lib.rs b/integration-tests/emulated/networks/polkadot-system/src/lib.rs new file mode 100644 index 0000000000..bed1b549e2 --- /dev/null +++ b/integration-tests/emulated/networks/polkadot-system/src/lib.rs @@ -0,0 +1,55 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub use asset_hub_polkadot_emulated_chain; +pub use bridge_hub_polkadot_emulated_chain; +pub use collectives_polkadot_emulated_chain; +pub use penpal_emulated_chain; +pub use polkadot_emulated_chain; + +use asset_hub_polkadot_emulated_chain::AssetHubPolkadot; +use bridge_hub_polkadot_emulated_chain::BridgeHubPolkadot; +use collectives_polkadot_emulated_chain::CollectivesPolkadot; +use penpal_emulated_chain::{PenpalA, PenpalB}; +use polkadot_emulated_chain::Polkadot; + +// Cumulus +use emulated_integration_tests_common::{ + accounts::{ALICE, BOB}, + xcm_emulator::{decl_test_networks, decl_test_sender_receiver_accounts_parameter_types}, +}; + +decl_test_networks! { + pub struct PolkadotMockNet { + relay_chain = Polkadot, + parachains = vec![ + AssetHubPolkadot, + BridgeHubPolkadot, + CollectivesPolkadot, + PenpalA, + PenpalB, + ], + bridge = () + }, +} + +decl_test_sender_receiver_accounts_parameter_types! { + PolkadotRelay { sender: ALICE, receiver: BOB }, + AssetHubPolkadotPara { sender: ALICE, receiver: BOB }, + BridgeHubPolkadotPara { sender: ALICE, receiver: BOB }, + CollectivesPolkadotPara { sender: ALICE, receiver: BOB }, + PenpalAPara { sender: ALICE, receiver: BOB }, + PenpalBPara { sender: ALICE, receiver: BOB } +} diff --git a/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml b/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml similarity index 58% rename from integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml rename to integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml index c23f244896..72d1866a33 100644 --- a/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "asset-hub-kusama-integration-tests" -version = "1.0.0" +version = "0.1.0" authors.workspace = true edition.workspace = true license = "Apache-2.0" @@ -8,30 +8,30 @@ description = "Asset Hub Kusama runtime integration tests with xcm-emulator" publish = false [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9" } +codec = { package = "parity-scale-codec", version = "3.4.0" } assert_matches = "1.5.0" # Substrate sp-runtime = { version = "31.0.1" } frame-support = { version = "28.0.0" } -pallet-assets = { version = "29.0.0" } pallet-balances = { version = "28.0.0" } +pallet-assets = { version = "29.0.0" } pallet-asset-conversion = { version = "10.0.0" } pallet-message-queue = { version = "31.0.0" } # Polkadot xcm = { package = "staging-xcm", version = "7.0.0" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "7.0.0" } pallet-xcm = { version = "7.0.0" } +xcm-executor = { package = "staging-xcm-executor", version = "7.0.3" } # Cumulus -parachains-common = { version = "7.0.0" } -xcm-emulator = { version = "0.5.0" } asset-test-utils = { version = "7.0.1" } +emulated-integration-tests-common = { version = "3.0.0" } +parachains-common = { version = "7.0.0" } # Local -emulated-chains = { path = "../../chains" } -integration-tests-common = { path = "../../common" } -asset-hub-kusama-runtime = { path = "../../../../system-parachains/asset-hubs/asset-hub-kusama" } -kusama-runtime = { package = "staging-kusama-runtime", path = "../../../../relay/kusama" } -system-parachains-constants = { path = "../../../../system-parachains/constants" } +asset-hub-kusama-runtime = { path = "../../../../../system-parachains/asset-hubs/asset-hub-kusama" } +integration-tests-helpers = { path = "../../../helpers" } +kusama-runtime = { package = "staging-kusama-runtime", path = "../../../../../relay/kusama" } +kusama-system-emulated-network = { path = "../../../networks/kusama-system" } +system-parachains-constants = { path = "../../../../../system-parachains/constants" } diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/lib.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/lib.rs new file mode 100644 index 0000000000..b028b4bd53 --- /dev/null +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/lib.rs @@ -0,0 +1,70 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub use codec::Encode; + +// Substrate +pub use frame_support::{ + assert_err, assert_ok, + pallet_prelude::Weight, + sp_runtime::{AccountId32, DispatchError, DispatchResult}, + traits::fungibles::Inspect, +}; + +// Polkadot +pub use xcm::{ + prelude::{AccountId32 as AccountId32Junction, *}, + v3::{Error, NetworkId::Kusama as KusamaId}, +}; + +// Cumulus +pub use asset_test_utils::xcm_helpers; +pub use emulated_integration_tests_common::{ + xcm_emulator::{ + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, + }, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, +}; +pub use integration_tests_helpers::test_parachain_is_trusted_teleporter; +pub use kusama_system_emulated_network::{ + asset_hub_kusama_emulated_chain::{ + genesis::ED as ASSET_HUB_KUSAMA_ED, AssetHubKusamaParaPallet as AssetHubKusamaPallet, + }, + kusama_emulated_chain::{genesis::ED as KUSAMA_ED, KusamaRelayPallet as KusamaPallet}, + penpal_emulated_chain::PenpalAParaPallet as PenpalAPallet, + AssetHubKusamaPara as AssetHubKusama, AssetHubKusamaParaReceiver as AssetHubKusamaReceiver, + AssetHubKusamaParaSender as AssetHubKusamaSender, BridgeHubKusamaPara as BridgeHubKusama, + BridgeHubKusamaParaReceiver as BridgeHubKusamaReceiver, KusamaRelay as Kusama, + KusamaRelayReceiver as KusamaReceiver, KusamaRelaySender as KusamaSender, + PenpalAPara as PenpalA, PenpalAParaReceiver as PenpalAReceiver, + PenpalAParaSender as PenpalASender, +}; +pub use parachains_common::{AccountId, Balance}; + +pub const ASSET_ID: u32 = 1; +pub const ASSET_MIN_BALANCE: u128 = 1000; +// `Assets` pallet index +pub const ASSETS_PALLET_ID: u8 = 50; + +pub type RelayToSystemParaTest = Test; +pub type RelayToParaTest = Test; +pub type SystemParaToRelayTest = Test; +pub type SystemParaToParaTest = Test; +pub type ParaToSystemParaTest = Test; + +#[cfg(test)] +mod tests; diff --git a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs similarity index 89% rename from integration-tests/emulated/assets/asset-hub-kusama/src/tests/mod.rs rename to integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs index c51ed79e71..4b7498c1c6 100644 --- a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs @@ -20,8 +20,8 @@ mod swap; mod teleport; use crate::*; -integration_tests_common::include_penpal_create_foreign_asset_on_asset_hub!( - PenpalKusamaA, +emulated_integration_tests_common::include_penpal_create_foreign_asset_on_asset_hub!( + PenpalA, AssetHubKusama, KUSAMA_ED, system_parachains_constants::kusama::fee::WeightToFee diff --git a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/reserve_transfer.rs similarity index 82% rename from integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs rename to integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/reserve_transfer.rs index e99f9e422d..3e2b92c20e 100644 --- a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/reserve_transfer.rs @@ -16,6 +16,7 @@ use crate::*; use asset_hub_kusama_runtime::xcm_config::XcmConfig as AssetHubKusamaXcmConfig; use kusama_runtime::xcm_config::XcmConfig as KusamaXcmConfig; +use kusama_system_emulated_network::penpal_emulated_chain::XcmConfig as PenpalKusamaXcmConfig; fn relay_to_para_sender_assertions(t: RelayToParaTest) { type RuntimeEvent = ::RuntimeEvent; @@ -61,9 +62,9 @@ fn system_para_to_para_sender_assertions(t: SystemParaToParaTest) { } fn para_receiver_assertions(_: Test) { - type RuntimeEvent = ::RuntimeEvent; + type RuntimeEvent = ::RuntimeEvent; assert_expected_events!( - PenpalKusamaA, + PenpalA, vec![ RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {}, RuntimeEvent::MessageQueue( @@ -74,13 +75,10 @@ fn para_receiver_assertions(_: Test) { } fn para_to_system_para_sender_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - PenpalKusamaA::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( - 864_610_000, - 8_799, - ))); + type RuntimeEvent = ::RuntimeEvent; + PenpalA::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(864_610_000, 8_799))); assert_expected_events!( - PenpalKusamaA, + PenpalA, vec![ // Amount to reserve transfer is transferred to Parachain's Sovereign account RuntimeEvent::Balances( @@ -95,8 +93,8 @@ fn para_to_system_para_sender_assertions(t: ParaToSystemParaTest) { fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) { type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_on_ahr = AssetHubKusama::sovereign_account_id_of( - AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()), + let sov_penpal_on_ahk = AssetHubKusama::sovereign_account_id_of( + AssetHubKusama::sibling_location_of(PenpalA::para_id()), ); assert_expected_events!( AssetHubKusama, @@ -105,7 +103,7 @@ fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) { RuntimeEvent::Balances( pallet_balances::Event::Burned { who, amount } ) => { - who: *who == sov_penpal_on_ahr.clone().into(), + who: *who == sov_penpal_on_ahk.clone().into(), amount: *amount == t.args.amount, }, RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {}, @@ -141,9 +139,9 @@ fn system_para_to_para_assets_sender_assertions(t: SystemParaToParaTest) { } fn system_para_to_para_assets_receiver_assertions(_: Test) { - type RuntimeEvent = ::RuntimeEvent; + type RuntimeEvent = ::RuntimeEvent; assert_expected_events!( - PenpalKusamaA, + PenpalA, vec![ RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {}, RuntimeEvent::Assets(pallet_assets::Event::Issued { .. }) => {}, @@ -177,7 +175,7 @@ fn system_para_to_para_reserve_transfer_assets(t: SystemParaToParaTest) -> Dispa } fn para_to_system_para_reserve_transfer_assets(t: ParaToSystemParaTest) -> DispatchResult { - ::PolkadotXcm::limited_reserve_transfer_assets( + ::PolkadotXcm::limited_reserve_transfer_assets( t.signed_origin, bx!(t.args.dest.into()), bx!(t.args.beneficiary.into()), @@ -260,14 +258,14 @@ fn reserve_transfer_native_asset_from_system_para_to_relay_fails() { #[test] fn reserve_transfer_native_asset_from_relay_to_para() { // Init values for Relay - let destination = Kusama::child_location_of(PenpalKusamaA::para_id()); - let beneficiary_id = PenpalKusamaAReceiver::get(); + let destination = Kusama::child_location_of(PenpalA::para_id()); + let beneficiary_id = PenpalAReceiver::get(); let amount_to_send: Balance = KUSAMA_ED * 1000; let test_args = TestContext { sender: KusamaSender::get(), - receiver: PenpalKusamaAReceiver::get(), - args: relay_test_args(destination, beneficiary_id, amount_to_send), + receiver: PenpalAReceiver::get(), + args: TestArgs::new_relay(destination, beneficiary_id, amount_to_send), }; let mut test = RelayToParaTest::new(test_args); @@ -276,7 +274,7 @@ fn reserve_transfer_native_asset_from_relay_to_para() { let receiver_balance_before = test.receiver.balance; test.set_assertion::(relay_to_para_sender_assertions); - test.set_assertion::(para_receiver_assertions); + test.set_assertion::(para_receiver_assertions); test.set_dispatchable::(relay_to_para_reserve_transfer_assets); test.assert(); @@ -303,15 +301,15 @@ fn reserve_transfer_native_asset_from_relay_to_para() { #[test] fn reserve_transfer_native_asset_from_system_para_to_para() { // Init values for System Parachain - let destination = AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()); - let beneficiary_id = PenpalKusamaAReceiver::get(); + let destination = AssetHubKusama::sibling_location_of(PenpalA::para_id()); + let beneficiary_id = PenpalAReceiver::get(); let amount_to_send: Balance = ASSET_HUB_KUSAMA_ED * 1000; let assets = (Parent, amount_to_send).into(); let test_args = TestContext { sender: AssetHubKusamaSender::get(), - receiver: PenpalKusamaAReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + receiver: PenpalAReceiver::get(), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = SystemParaToParaTest::new(test_args); @@ -320,7 +318,7 @@ fn reserve_transfer_native_asset_from_system_para_to_para() { let receiver_balance_before = test.receiver.balance; test.set_assertion::(system_para_to_para_sender_assertions); - test.set_assertion::(para_receiver_assertions); + test.set_assertion::(para_receiver_assertions); test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); @@ -347,15 +345,15 @@ fn reserve_transfer_native_asset_from_system_para_to_para() { #[test] fn reserve_transfer_native_asset_from_para_to_system_para() { // Init values for Penpal Parachain - let destination = PenpalKusamaA::sibling_location_of(AssetHubKusama::para_id()); + let destination = PenpalA::sibling_location_of(AssetHubKusama::para_id()); let beneficiary_id = AssetHubKusamaReceiver::get(); let amount_to_send: Balance = ASSET_HUB_KUSAMA_ED * 1000; let assets = (Parent, amount_to_send).into(); let test_args = TestContext { - sender: PenpalKusamaASender::get(), + sender: PenpalASender::get(), receiver: AssetHubKusamaReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = ParaToSystemParaTest::new(test_args); @@ -363,24 +361,23 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { let sender_balance_before = test.sender.balance; let receiver_balance_before = test.receiver.balance; - let penpal_location_as_seen_by_ahr = - AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()); - let sov_penpal_on_ahr = AssetHubKusama::sovereign_account_id_of(penpal_location_as_seen_by_ahr); + let penpal_location_as_seen_by_ahk = AssetHubKusama::sibling_location_of(PenpalA::para_id()); + let sov_penpal_on_ahk = AssetHubKusama::sovereign_account_id_of(penpal_location_as_seen_by_ahk); - // fund the Penpal's SA on AHR with the native tokens held in reserve - AssetHubKusama::fund_accounts(vec![(sov_penpal_on_ahr.into(), amount_to_send * 2)]); + // fund the Penpal's SA on AHK with the native tokens held in reserve + AssetHubKusama::fund_accounts(vec![(sov_penpal_on_ahk.into(), amount_to_send * 2)]); - test.set_assertion::(para_to_system_para_sender_assertions); + test.set_assertion::(para_to_system_para_sender_assertions); test.set_assertion::(para_to_system_para_receiver_assertions); - test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); + test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); test.assert(); let sender_balance_after = test.sender.balance; let receiver_balance_after = test.receiver.balance; - let delivery_fees = PenpalKusamaA::execute_with(|| { + let delivery_fees = PenpalA::execute_with(|| { xcm_helpers::transfer_assets_delivery_fees::< - ::XcmSender, + ::XcmSender, >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest) }); @@ -398,7 +395,7 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { /// work #[test] fn reserve_transfer_assets_from_system_para_to_para() { - // Force create asset on AssetHubKusama and PenpalKusamaA from Relay Chain + // Force create asset on AssetHubKusama and PenpalA from Relay Chain AssetHubKusama::force_create_and_mint_asset( ASSET_ID, ASSET_MIN_BALANCE, @@ -407,18 +404,18 @@ fn reserve_transfer_assets_from_system_para_to_para() { Some(Weight::from_parts(1_019_445_000, 200_000)), ASSET_MIN_BALANCE * 1_000_000, ); - PenpalKusamaA::force_create_and_mint_asset( + PenpalA::force_create_and_mint_asset( ASSET_ID, ASSET_MIN_BALANCE, false, - PenpalKusamaASender::get(), + PenpalASender::get(), None, 0, ); // Init values for System Parachain - let destination = AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()); - let beneficiary_id = PenpalKusamaAReceiver::get(); + let destination = AssetHubKusama::sibling_location_of(PenpalA::para_id()); + let beneficiary_id = PenpalAReceiver::get(); let fee_amount_to_send = ASSET_HUB_KUSAMA_ED * 1000; let asset_amount_to_send = ASSET_MIN_BALANCE * 1000; let assets: MultiAssets = vec![ @@ -435,8 +432,8 @@ fn reserve_transfer_assets_from_system_para_to_para() { let para_test_args = TestContext { sender: AssetHubKusamaSender::get(), - receiver: PenpalKusamaAReceiver::get(), - args: para_test_args( + receiver: PenpalAReceiver::get(), + args: TestArgs::new_para( destination, beneficiary_id, asset_amount_to_send, @@ -448,10 +445,10 @@ fn reserve_transfer_assets_from_system_para_to_para() { let mut test = SystemParaToParaTest::new(para_test_args); - // Create SA-of-Penpal-on-AHR with ED. - let penpal_location = AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()); - let sov_penpal_on_ahr = AssetHubKusama::sovereign_account_id_of(penpal_location); - AssetHubKusama::fund_accounts(vec![(sov_penpal_on_ahr.into(), KUSAMA_ED)]); + // Create SA-of-Penpal-on-AHK with ED. + let penpal_location = AssetHubKusama::sibling_location_of(PenpalA::para_id()); + let sov_penpal_on_ahk = AssetHubKusama::sovereign_account_id_of(penpal_location); + AssetHubKusama::fund_accounts(vec![(sov_penpal_on_ahk.into(), KUSAMA_ED)]); let sender_balance_before = test.sender.balance; let receiver_balance_before = test.receiver.balance; @@ -460,13 +457,13 @@ fn reserve_transfer_assets_from_system_para_to_para() { type Assets = ::Assets; >::balance(ASSET_ID, &AssetHubKusamaSender::get()) }); - let receiver_assets_before = PenpalKusamaA::execute_with(|| { - type Assets = ::Assets; - >::balance(ASSET_ID, &PenpalKusamaAReceiver::get()) + let receiver_assets_before = PenpalA::execute_with(|| { + type Assets = ::Assets; + >::balance(ASSET_ID, &PenpalAReceiver::get()) }); test.set_assertion::(system_para_to_para_assets_sender_assertions); - test.set_assertion::(system_para_to_para_assets_receiver_assertions); + test.set_assertion::(system_para_to_para_assets_receiver_assertions); test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); @@ -486,9 +483,9 @@ fn reserve_transfer_assets_from_system_para_to_para() { type Assets = ::Assets; >::balance(ASSET_ID, &AssetHubKusamaSender::get()) }); - let receiver_assets_after = PenpalKusamaA::execute_with(|| { - type Assets = ::Assets; - >::balance(ASSET_ID, &PenpalKusamaAReceiver::get()) + let receiver_assets_after = PenpalA::execute_with(|| { + type Assets = ::Assets; + >::balance(ASSET_ID, &PenpalAReceiver::get()) }); // Sender's balance is reduced by exact amount diff --git a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/send.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/send.rs similarity index 88% rename from integration-tests/emulated/assets/asset-hub-kusama/src/tests/send.rs rename to integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/send.rs index 1b9a79f8c2..6dfa40d261 100644 --- a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/send.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/send.rs @@ -33,7 +33,7 @@ fn send_transact_as_superuser_from_relay_to_system_para_works() { #[test] fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() { let para_sovereign_account = AssetHubKusama::sovereign_account_id_of( - AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()), + AssetHubKusama::sibling_location_of(PenpalA::para_id()), ); // Force create and mint assets for Parachain's sovereign account @@ -60,9 +60,8 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() { let native_asset = (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into(); - let root_origin = ::RuntimeOrigin::root(); - let system_para_destination = - PenpalKusamaA::sibling_location_of(AssetHubKusama::para_id()).into(); + let root_origin = ::RuntimeOrigin::root(); + let system_para_destination = PenpalA::sibling_location_of(AssetHubKusama::para_id()).into(); let xcm = xcm_transact_paid_execution( call, origin_kind, @@ -70,14 +69,14 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() { para_sovereign_account.clone(), ); - PenpalKusamaA::execute_with(|| { - assert_ok!(::PolkadotXcm::send( + PenpalA::execute_with(|| { + assert_ok!(::PolkadotXcm::send( root_origin, bx!(system_para_destination), bx!(xcm), )); - PenpalKusamaA::assert_xcm_pallet_sent(); + PenpalA::assert_xcm_pallet_sent(); }); AssetHubKusama::execute_with(|| { diff --git a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/set_xcm_versions.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/set_xcm_versions.rs similarity index 100% rename from integration-tests/emulated/assets/asset-hub-kusama/src/tests/set_xcm_versions.rs rename to integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/set_xcm_versions.rs diff --git a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/swap.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/swap.rs similarity index 87% rename from integration-tests/emulated/assets/asset-hub-kusama/src/tests/swap.rs rename to integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/swap.rs index fc0159df14..d9f885e5f6 100644 --- a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/swap.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/swap.rs @@ -14,15 +14,17 @@ // limitations under the License. use crate::*; +use kusama_system_emulated_network::penpal_emulated_chain::LocalTeleportableToAssetHub as PenpalLocalTeleportableToAssetHub; use sp_runtime::ModuleError; +use system_parachains_constants::kusama::currency::SYSTEM_PARA_EXISTENTIAL_DEPOSIT; #[test] fn swap_locally_on_chain_using_local_assets() { - let asset_native = Box::new(asset_hub_kusama_runtime::xcm_config::KsmLocation::get()); - let asset_one = Box::new(MultiLocation { + let asset_native = asset_hub_kusama_runtime::xcm_config::KsmLocation::get(); + let asset_one = MultiLocation { parents: 0, interior: X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), - }); + }; AssetHubKusama::execute_with(|| { type RuntimeEvent = ::RuntimeEvent; @@ -44,8 +46,8 @@ fn swap_locally_on_chain_using_local_assets() { assert_ok!(::AssetConversion::create_pool( ::RuntimeOrigin::signed(AssetHubKusamaSender::get()), - asset_native.clone(), - asset_one.clone(), + Box::new(asset_native), + Box::new(asset_one), )); assert_expected_events!( @@ -57,8 +59,8 @@ fn swap_locally_on_chain_using_local_assets() { assert_ok!(::AssetConversion::add_liquidity( ::RuntimeOrigin::signed(AssetHubKusamaSender::get()), - asset_native.clone(), - asset_one.clone(), + Box::new(asset_native), + Box::new(asset_one), 1_000_000_000_000, 2_000_000_000_000, 0, @@ -73,7 +75,7 @@ fn swap_locally_on_chain_using_local_assets() { ] ); - let path = vec![asset_native.clone(), asset_one.clone()]; + let path = vec![Box::new(asset_native), Box::new(asset_one)]; assert_ok!( ::AssetConversion::swap_exact_tokens_for_tokens( @@ -98,9 +100,10 @@ fn swap_locally_on_chain_using_local_assets() { assert_ok!(::AssetConversion::remove_liquidity( ::RuntimeOrigin::signed(AssetHubKusamaSender::get()), - asset_native, - asset_one, - 1414213562273 - ASSET_HUB_KUSAMA_ED * 2, // all but the 2 EDs can't be retrieved. + Box::new(asset_native), + Box::new(asset_one), + 1414213562273 - SYSTEM_PARA_EXISTENTIAL_DEPOSIT * 2, /* all but the 2 EDs can't be + * retrieved. */ 0, 0, AssetHubKusamaSender::get().into(), @@ -111,15 +114,15 @@ fn swap_locally_on_chain_using_local_assets() { #[test] fn swap_locally_on_chain_using_foreign_assets() { let asset_native = asset_hub_kusama_runtime::xcm_config::KsmLocation::get(); - let ah_as_seen_by_penpal = PenpalKusamaA::sibling_location_of(AssetHubKusama::para_id()); + let ah_as_seen_by_penpal = PenpalA::sibling_location_of(AssetHubKusama::para_id()); let asset_location_on_penpal = PenpalLocalTeleportableToAssetHub::get(); let asset_id_on_penpal = match asset_location_on_penpal.last() { Some(GeneralIndex(id)) => *id as u32, _ => unreachable!(), }; - let asset_owner_on_penpal = PenpalKusamaASender::get(); + let asset_owner_on_penpal = PenpalASender::get(); let foreign_asset_at_asset_hub_kusama = - MultiLocation { parents: 1, interior: X1(Parachain(PenpalKusamaA::para_id().into())) } + MultiLocation { parents: 1, interior: X1(Parachain(PenpalA::para_id().into())) } .appended_with(asset_location_on_penpal) .unwrap(); @@ -133,8 +136,8 @@ fn swap_locally_on_chain_using_foreign_assets() { ASSET_MIN_BALANCE * 1_000_000, ); - let penpal_as_seen_by_ah = AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()); - let sov_penpal_on_ahr = AssetHubKusama::sovereign_account_id_of(penpal_as_seen_by_ah); + let penpal_as_seen_by_ah = AssetHubKusama::sibling_location_of(PenpalA::para_id()); + let sov_penpal_on_ahk = AssetHubKusama::sovereign_account_id_of(penpal_as_seen_by_ah); AssetHubKusama::fund_accounts(vec![ (AssetHubKusamaSender::get().into(), 5_000_000 * KUSAMA_ED), /* An account to swap dot * for something else. */ @@ -149,9 +152,9 @@ fn swap_locally_on_chain_using_foreign_assets() { type RuntimeEvent = ::RuntimeEvent; // 3. Mint foreign asset (in reality this should be a teleport or some such) assert_ok!(::ForeignAssets::mint( - ::RuntimeOrigin::signed(sov_penpal_on_ahr.clone().into()), + ::RuntimeOrigin::signed(sov_penpal_on_ahk.clone().into()), foreign_asset_at_asset_hub_kusama, - sov_penpal_on_ahr.clone().into(), + sov_penpal_on_ahk.clone().into(), 3_000_000_000_000, )); @@ -178,14 +181,14 @@ fn swap_locally_on_chain_using_foreign_assets() { // 5. Add liquidity: assert_ok!(::AssetConversion::add_liquidity( - ::RuntimeOrigin::signed(sov_penpal_on_ahr.clone()), + ::RuntimeOrigin::signed(sov_penpal_on_ahk.clone()), Box::new(asset_native), Box::new(foreign_asset_at_asset_hub_kusama), 1_000_000_000_000, 2_000_000_000_000, 0, 0, - sov_penpal_on_ahr.clone().into() + sov_penpal_on_ahk.clone().into() )); assert_expected_events!( @@ -223,13 +226,13 @@ fn swap_locally_on_chain_using_foreign_assets() { // 7. Remove liquidity assert_ok!(::AssetConversion::remove_liquidity( - ::RuntimeOrigin::signed(sov_penpal_on_ahr.clone()), + ::RuntimeOrigin::signed(sov_penpal_on_ahk.clone()), Box::new(asset_native), Box::new(foreign_asset_at_asset_hub_kusama), 1414213562273 - 2_000_000_000, // all but the 2 EDs can't be retrieved. 0, 0, - sov_penpal_on_ahr.clone().into(), + sov_penpal_on_ahk.clone().into(), )); }); } diff --git a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/teleport.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs similarity index 90% rename from integration-tests/emulated/assets/asset-hub-kusama/src/tests/teleport.rs rename to integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs index b940c4e2eb..c298686016 100644 --- a/integration-tests/emulated/assets/asset-hub-kusama/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs @@ -15,7 +15,9 @@ use crate::*; use asset_hub_kusama_runtime::xcm_config::XcmConfig as AssetHubKusamaXcmConfig; +use emulated_integration_tests_common::xcm_helpers::non_fee_asset; use kusama_runtime::xcm_config::XcmConfig as KusamaXcmConfig; +use kusama_system_emulated_network::penpal_emulated_chain::LocalTeleportableToAssetHub as PenpalLocalTeleportableToAssetHub; fn relay_origin_assertions(t: RelayToSystemParaTest) { type RuntimeEvent = ::RuntimeEvent; @@ -111,13 +113,13 @@ fn para_dest_assertions(t: RelayToSystemParaTest) { } fn penpal_to_ah_foreign_assets_sender_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - PenpalKusamaA::assert_xcm_pallet_attempted_complete(None); + type RuntimeEvent = ::RuntimeEvent; + PenpalA::assert_xcm_pallet_attempted_complete(None); let expected_asset_id = t.args.asset_id.unwrap(); let (_, expected_asset_amount) = non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); assert_expected_events!( - PenpalKusamaA, + PenpalA, vec![ RuntimeEvent::Balances( pallet_balances::Event::Withdraw { who, amount } @@ -136,8 +138,8 @@ fn penpal_to_ah_foreign_assets_sender_assertions(t: ParaToSystemParaTest) { fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) { type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_on_ahr = AssetHubKusama::sovereign_account_id_of( - AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()), + let sov_penpal_on_ahk = AssetHubKusama::sovereign_account_id_of( + AssetHubKusama::sibling_location_of(PenpalA::para_id()), ); let (expected_foreign_asset_id, expected_foreign_asset_amount) = non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); @@ -148,7 +150,7 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) { RuntimeEvent::Balances( pallet_balances::Event::Burned { who, amount } ) => { - who: *who == sov_penpal_on_ahr.clone().into(), + who: *who == sov_penpal_on_ahk.clone().into(), amount: *amount == t.args.amount, }, RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { @@ -196,13 +198,13 @@ fn ah_to_penpal_foreign_assets_sender_assertions(t: SystemParaToParaTest) { } fn ah_to_penpal_foreign_assets_receiver_assertions(t: SystemParaToParaTest) { - type RuntimeEvent = ::RuntimeEvent; + type RuntimeEvent = ::RuntimeEvent; let expected_asset_id = t.args.asset_id.unwrap(); let (_, expected_asset_amount) = non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); - let checking_account = ::PolkadotXcm::check_account(); + let checking_account = ::PolkadotXcm::check_account(); assert_expected_events!( - PenpalKusamaA, + PenpalA, vec![ // checking account burns local asset as part of incoming teleport RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { @@ -270,7 +272,7 @@ fn system_para_teleport_assets(t: SystemParaToRelayTest) -> DispatchResult { } fn para_to_system_para_transfer_assets(t: ParaToSystemParaTest) -> DispatchResult { - ::PolkadotXcm::transfer_assets( + ::PolkadotXcm::transfer_assets( t.signed_origin, bx!(t.args.dest.into()), bx!(t.args.beneficiary.into()), @@ -301,7 +303,7 @@ fn limited_teleport_native_assets_from_relay_to_system_para_works() { let test_args = TestContext { sender: KusamaSender::get(), receiver: AssetHubKusamaReceiver::get(), - args: relay_test_args(dest, beneficiary_id, amount_to_send), + args: TestArgs::new_relay(dest, beneficiary_id, amount_to_send), }; let mut test = RelayToSystemParaTest::new(test_args); @@ -345,7 +347,7 @@ fn limited_teleport_native_assets_back_from_system_para_to_relay_works() { let test_args = TestContext { sender: AssetHubKusamaSender::get(), receiver: KusamaReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = SystemParaToRelayTest::new(test_args); @@ -386,7 +388,7 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() { let test_args = TestContext { sender: AssetHubKusamaSender::get(), receiver: KusamaReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = SystemParaToRelayTest::new(test_args); @@ -424,7 +426,7 @@ fn teleport_native_assets_from_relay_to_system_para_works() { let test_args = TestContext { sender: KusamaSender::get(), receiver: AssetHubKusamaReceiver::get(), - args: relay_test_args(dest, beneficiary_id, amount_to_send), + args: TestArgs::new_relay(dest, beneficiary_id, amount_to_send), }; let mut test = RelayToSystemParaTest::new(test_args); @@ -468,7 +470,7 @@ fn teleport_native_assets_back_from_system_para_to_relay_works() { let test_args = TestContext { sender: AssetHubKusamaSender::get(), receiver: KusamaReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = SystemParaToRelayTest::new(test_args); @@ -509,7 +511,7 @@ fn teleport_native_assets_from_system_para_to_relay_fails() { let test_args = TestContext { sender: AssetHubKusamaSender::get(), receiver: KusamaReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = SystemParaToRelayTest::new(test_args); @@ -554,15 +556,15 @@ fn teleport_to_other_system_parachains_works() { /// (using native reserve-based transfer for fees) #[test] fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { - let ah_as_seen_by_penpal = PenpalKusamaA::sibling_location_of(AssetHubKusama::para_id()); + let ah_as_seen_by_penpal = PenpalA::sibling_location_of(AssetHubKusama::para_id()); let asset_location_on_penpal = PenpalLocalTeleportableToAssetHub::get(); let asset_id_on_penpal = match asset_location_on_penpal.last() { Some(GeneralIndex(id)) => *id as u32, _ => unreachable!(), }; - let asset_owner_on_penpal = PenpalKusamaASender::get(); + let asset_owner_on_penpal = PenpalASender::get(); let foreign_asset_at_asset_hub_kusama = - MultiLocation { parents: 1, interior: X1(Parachain(PenpalKusamaA::para_id().into())) } + MultiLocation { parents: 1, interior: X1(Parachain(PenpalA::para_id().into())) } .appended_with(asset_location_on_penpal) .unwrap(); super::penpal_create_foreign_asset_on_asset_hub( @@ -591,9 +593,9 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { // Penpal to AH test args let penpal_to_ah_test_args = TestContext { - sender: PenpalKusamaASender::get(), + sender: PenpalASender::get(), receiver: AssetHubKusamaReceiver::get(), - args: para_test_args( + args: TestArgs::new_para( ah_as_seen_by_penpal, penpal_to_ah_beneficiary_id, asset_amount_to_send, @@ -607,9 +609,9 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { let penpal_sender_balance_before = penpal_to_ah.sender.balance; let ah_receiver_balance_before = penpal_to_ah.receiver.balance; - let penpal_sender_assets_before = PenpalKusamaA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalKusamaASender::get()) + let penpal_sender_assets_before = PenpalA::execute_with(|| { + type Assets = ::Assets; + >::balance(asset_id_on_penpal, &PenpalASender::get()) }); let ah_receiver_assets_before = AssetHubKusama::execute_with(|| { type Assets = ::ForeignAssets; @@ -619,17 +621,17 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { ) }); - penpal_to_ah.set_assertion::(penpal_to_ah_foreign_assets_sender_assertions); + penpal_to_ah.set_assertion::(penpal_to_ah_foreign_assets_sender_assertions); penpal_to_ah.set_assertion::(penpal_to_ah_foreign_assets_receiver_assertions); - penpal_to_ah.set_dispatchable::(para_to_system_para_transfer_assets); + penpal_to_ah.set_dispatchable::(para_to_system_para_transfer_assets); penpal_to_ah.assert(); let penpal_sender_balance_after = penpal_to_ah.sender.balance; let ah_receiver_balance_after = penpal_to_ah.receiver.balance; - let penpal_sender_assets_after = PenpalKusamaA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalKusamaASender::get()) + let penpal_sender_assets_after = PenpalA::execute_with(|| { + type Assets = ::Assets; + >::balance(asset_id_on_penpal, &PenpalASender::get()) }); let ah_receiver_assets_after = AssetHubKusama::execute_with(|| { type Assets = ::ForeignAssets; @@ -668,8 +670,8 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { )); }); - let ah_to_penpal_beneficiary_id = PenpalKusamaAReceiver::get(); - let penpal_as_seen_by_ah = AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()); + let ah_to_penpal_beneficiary_id = PenpalAReceiver::get(); + let penpal_as_seen_by_ah = AssetHubKusama::sibling_location_of(PenpalA::para_id()); let ah_assets: MultiAssets = vec![ (Parent, fee_amount_to_send).into(), (foreign_asset_at_asset_hub_kusama, asset_amount_to_send).into(), @@ -684,8 +686,8 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { // AH to Penpal test args let ah_to_penpal_test_args = TestContext { sender: AssetHubKusamaSender::get(), - receiver: PenpalKusamaAReceiver::get(), - args: para_test_args( + receiver: PenpalAReceiver::get(), + args: TestArgs::new_para( penpal_as_seen_by_ah, ah_to_penpal_beneficiary_id, asset_amount_to_send, @@ -706,13 +708,13 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { &AssetHubKusamaSender::get(), ) }); - let penpal_receiver_assets_before = PenpalKusamaA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalKusamaAReceiver::get()) + let penpal_receiver_assets_before = PenpalA::execute_with(|| { + type Assets = ::Assets; + >::balance(asset_id_on_penpal, &PenpalAReceiver::get()) }); ah_to_penpal.set_assertion::(ah_to_penpal_foreign_assets_sender_assertions); - ah_to_penpal.set_assertion::(ah_to_penpal_foreign_assets_receiver_assertions); + ah_to_penpal.set_assertion::(ah_to_penpal_foreign_assets_receiver_assertions); ah_to_penpal.set_dispatchable::(system_para_to_para_transfer_assets); ah_to_penpal.assert(); @@ -726,9 +728,9 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { &AssetHubKusamaSender::get(), ) }); - let penpal_receiver_assets_after = PenpalKusamaA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalKusamaAReceiver::get()) + let penpal_receiver_assets_after = PenpalA::execute_with(|| { + type Assets = ::Assets; + >::balance(asset_id_on_penpal, &PenpalAReceiver::get()) }); // Sender's balance is reduced diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml b/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml new file mode 100644 index 0000000000..191501c6e0 --- /dev/null +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "asset-hub-polkadot-integration-tests" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Asset Hub Polkadot runtime integration tests with xcm-emulator" +publish = false + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.4.0" } +assert_matches = "1.5.0" + +# Substrate +sp-runtime = { version = "31.0.1" } +frame-support = { version = "28.0.0" } +pallet-balances = { version = "28.0.0" } +pallet-assets = { version = "29.0.0" } +pallet-treasury = { version = "27.0.0" } +pallet-message-queue = { version = "31.0.0" } + +# Polkadot +polkadot-runtime-common = { version = "7.0.0" } +xcm = { package = "staging-xcm", version = "7.0.0" } +pallet-xcm = { version = "7.0.0" } +xcm-executor = { package = "staging-xcm-executor", version = "7.0.3" } + +# Cumulus +asset-test-utils = { version = "7.0.1" } +emulated-integration-tests-common = { version = "3.0.0" } +parachains-common = { version = "7.0.0" } +cumulus-pallet-xcmp-queue = { version = "0.7.0" } +cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook"], version = "0.7.0" } + +# Local +asset-hub-polkadot-runtime = { path = "../../../../../system-parachains/asset-hubs/asset-hub-polkadot" } +integration-tests-helpers = { path = "../../../helpers" } +polkadot-runtime = { path = "../../../../../relay/polkadot" } +polkadot-system-emulated-network = { path = "../../../networks/polkadot-system" } +system-parachains-constants = { path = "../../../../../system-parachains/constants" } diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/lib.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/lib.rs new file mode 100644 index 0000000000..f41329a77d --- /dev/null +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/lib.rs @@ -0,0 +1,79 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub use codec::Encode; + +// Substrate +pub use frame_support::{ + assert_err, assert_ok, + instances::Instance2, + pallet_prelude::Weight, + sp_runtime::{AccountId32, DispatchError, DispatchResult, ModuleError}, + traits::fungibles::Inspect, + BoundedVec, +}; + +// Polkadot +pub use xcm::{ + prelude::{AccountId32 as AccountId32Junction, *}, + v3::{Error, NetworkId::Polkadot as PolkadotId}, +}; + +// Cumulus +pub use asset_test_utils::xcm_helpers; +pub use emulated_integration_tests_common::{ + xcm_emulator::{ + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, + }, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, +}; +pub use integration_tests_helpers::test_parachain_is_trusted_teleporter; +pub use parachains_common::{AccountId, Balance}; +pub use polkadot_system_emulated_network::{ + asset_hub_polkadot_emulated_chain::{ + genesis::ED as ASSET_HUB_POLKADOT_ED, AssetHubPolkadotParaPallet as AssetHubPolkadotPallet, + }, + collectives_polkadot_emulated_chain::{ + genesis::ED as COLLECTIVES_POLKADOT_ED, + CollectivesPolkadotParaPallet as CollectivesPolkadotPallet, + }, + penpal_emulated_chain::PenpalBParaPallet as PenpalBPallet, + polkadot_emulated_chain::{genesis::ED as POLKADOT_ED, PolkadotRelayPallet as PolkadotPallet}, + AssetHubPolkadotPara as AssetHubPolkadot, + AssetHubPolkadotParaReceiver as AssetHubPolkadotReceiver, + AssetHubPolkadotParaSender as AssetHubPolkadotSender, + BridgeHubPolkadotPara as BridgeHubPolkadot, + BridgeHubPolkadotParaReceiver as BridgeHubPolkadotReceiver, + CollectivesPolkadotPara as CollectivesPolkadot, PenpalBPara as PenpalB, + PenpalBParaReceiver as PenpalBReceiver, PenpalBParaSender as PenpalBSender, + PolkadotRelay as Polkadot, PolkadotRelayReceiver as PolkadotReceiver, + PolkadotRelaySender as PolkadotSender, +}; + +pub const ASSET_ID: u32 = 1; +pub const ASSET_MIN_BALANCE: u128 = 1000; +// `Assets` pallet index +pub const ASSETS_PALLET_ID: u8 = 50; + +pub type RelayToSystemParaTest = Test; +pub type RelayToParaTest = Test; +pub type SystemParaToRelayTest = Test; +pub type SystemParaToParaTest = Test; +pub type ParaToSystemParaTest = Test; + +#[cfg(test)] +mod tests; diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/fellowship_treasury.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/fellowship_treasury.rs new file mode 100644 index 0000000000..188174c0d1 --- /dev/null +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/fellowship_treasury.rs @@ -0,0 +1,131 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::*; +use emulated_integration_tests_common::accounts::{ALICE, BOB}; +use frame_support::traits::fungibles::{Create, Inspect, Mutate}; +use polkadot_runtime_common::impls::VersionedLocatableAsset; +use xcm_executor::traits::ConvertLocation; + +#[test] +fn create_and_claim_treasury_spend() { + const ASSET_ID: u32 = 1984; + const SPEND_AMOUNT: u128 = 1_000_000; + // treasury location from a sibling parachain. + let treasury_location: MultiLocation = MultiLocation::new( + 1, + X2(Parachain(CollectivesPolkadot::para_id().into()), PalletInstance(65)), + ); + // treasury account on a sibling parachain. + let treasury_account = + asset_hub_polkadot_runtime::xcm_config::LocationToAccountId::convert_location( + &treasury_location, + ) + .unwrap(); + let asset_hub_location = MultiLocation::new(1, Parachain(AssetHubPolkadot::para_id().into())); + let root = ::RuntimeOrigin::root(); + // asset kind to be spent from the treasury. + let asset_kind = VersionedLocatableAsset::V3 { + location: asset_hub_location, + asset_id: AssetId::Concrete((PalletInstance(50), GeneralIndex(ASSET_ID.into())).into()), + }; + // treasury spend beneficiary. + let alice: AccountId = Polkadot::account_id_of(ALICE); + let bob: AccountId = CollectivesPolkadot::account_id_of(BOB); + let bob_signed = ::RuntimeOrigin::signed(bob.clone()); + + AssetHubPolkadot::execute_with(|| { + type Assets = ::Assets; + + // create an asset class and mint some assets to the treasury account. + assert_ok!(>::create( + ASSET_ID, + treasury_account.clone(), + true, + SPEND_AMOUNT / 2 + )); + assert_ok!(>::mint_into(ASSET_ID, &treasury_account, SPEND_AMOUNT * 4)); + // beneficiary has zero balance. + assert_eq!(>::balance(ASSET_ID, &alice,), 0u128,); + }); + + CollectivesPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + type FellowshipTreasury = + ::FellowshipTreasury; + type AssetRate = ::AssetRate; + + // create a conversion rate from `asset_kind` to the native currency. + assert_ok!(AssetRate::create(root.clone(), Box::new(asset_kind.clone()), 2.into())); + + // create and approve a treasury spend. + assert_ok!(FellowshipTreasury::spend( + root, + Box::new(asset_kind), + SPEND_AMOUNT, + Box::new(MultiLocation::new(0, Into::<[u8; 32]>::into(alice.clone())).into()), + None, + )); + // claim the spend. + assert_ok!(FellowshipTreasury::payout(bob_signed.clone(), 0)); + + assert_expected_events!( + CollectivesPolkadot, + vec![ + RuntimeEvent::FellowshipTreasury(pallet_treasury::Event::Paid { .. }) => {}, + ] + ); + }); + + AssetHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + type Assets = ::Assets; + + // assert events triggered by xcm pay program + // 1. treasury asset transferred to spend beneficiary + // 2. response to the Fellowship treasury pallet instance sent back + // 3. XCM program completed + assert_expected_events!( + AssetHubPolkadot, + vec![ + RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) => { + id: id == &ASSET_ID, + from: from == &treasury_account, + to: to == &alice, + amount: amount == &SPEND_AMOUNT, + }, + RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {}, + RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true ,.. }) => {}, + ] + ); + // beneficiary received the assets from the treasury. + assert_eq!(>::balance(ASSET_ID, &alice,), SPEND_AMOUNT,); + }); + + CollectivesPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + type FellowshipTreasury = + ::FellowshipTreasury; + + // check the payment status to ensure the response from the AssetHub was received. + assert_ok!(FellowshipTreasury::check_status(bob_signed, 0)); + assert_expected_events!( + CollectivesPolkadot, + vec![ + RuntimeEvent::FellowshipTreasury(pallet_treasury::Event::SpendProcessed { .. }) => {}, + ] + ); + }); +} diff --git a/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs similarity index 85% rename from integration-tests/emulated/assets/asset-hub-polkadot/src/tests/mod.rs rename to integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs index 2b1a263e01..eaf2a15e11 100644 --- a/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs @@ -13,14 +13,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +mod fellowship_treasury; mod reserve_transfer; mod send; mod set_xcm_versions; mod teleport; +mod treasury; use crate::*; -integration_tests_common::include_penpal_create_foreign_asset_on_asset_hub!( - PenpalPolkadotA, +emulated_integration_tests_common::include_penpal_create_foreign_asset_on_asset_hub!( + PenpalB, AssetHubPolkadot, POLKADOT_ED, system_parachains_constants::polkadot::fee::WeightToFee diff --git a/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs similarity index 82% rename from integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs rename to integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs index e9fa92ff34..235b09858c 100644 --- a/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs @@ -16,10 +16,13 @@ use crate::*; use asset_hub_polkadot_runtime::xcm_config::XcmConfig as AssetHubPolkadotXcmConfig; use polkadot_runtime::xcm_config::XcmConfig as PolkadotXcmConfig; +use polkadot_system_emulated_network::penpal_emulated_chain::XcmConfig as PenpalPolkadotXcmConfig; fn relay_to_para_sender_assertions(t: RelayToParaTest) { type RuntimeEvent = ::RuntimeEvent; + Polkadot::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(864_610_000, 8_799))); + assert_expected_events!( Polkadot, vec![ @@ -39,10 +42,12 @@ fn relay_to_para_sender_assertions(t: RelayToParaTest) { fn system_para_to_para_sender_assertions(t: SystemParaToParaTest) { type RuntimeEvent = ::RuntimeEvent; + AssetHubPolkadot::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( - 864_610_000, - 8_799, + 676_119_000, + 6196, ))); + assert_expected_events!( AssetHubPolkadot, vec![ @@ -61,9 +66,9 @@ fn system_para_to_para_sender_assertions(t: SystemParaToParaTest) { } fn para_receiver_assertions(_: Test) { - type RuntimeEvent = ::RuntimeEvent; + type RuntimeEvent = ::RuntimeEvent; assert_expected_events!( - PenpalPolkadotA, + PenpalB, vec![ RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {}, RuntimeEvent::MessageQueue( @@ -74,13 +79,12 @@ fn para_receiver_assertions(_: Test) { } fn para_to_system_para_sender_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - PenpalPolkadotA::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( - 864_610_000, - 8_799, - ))); + type RuntimeEvent = ::RuntimeEvent; + + PenpalB::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(864_610_000, 8_799))); + assert_expected_events!( - PenpalPolkadotA, + PenpalB, vec![ // Amount to reserve transfer is transferred to Parachain's Sovereign account RuntimeEvent::Balances( @@ -95,17 +99,19 @@ fn para_to_system_para_sender_assertions(t: ParaToSystemParaTest) { fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) { type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_on_ahr = AssetHubPolkadot::sovereign_account_id_of( - AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()), + + let sov_penpal_on_ahp = AssetHubPolkadot::sovereign_account_id_of( + AssetHubPolkadot::sibling_location_of(PenpalB::para_id()), ); + assert_expected_events!( AssetHubPolkadot, vec![ - // Amount to reserve transfer is withdrawn from Parachain's Sovereign account + // Amount to reserve transfer is transferred to Parachain's Sovereign account RuntimeEvent::Balances( pallet_balances::Event::Burned { who, amount } ) => { - who: *who == sov_penpal_on_ahr.clone().into(), + who: *who == sov_penpal_on_ahp.clone().into(), amount: *amount == t.args.amount, }, RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {}, @@ -118,10 +124,12 @@ fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) { fn system_para_to_para_assets_sender_assertions(t: SystemParaToParaTest) { type RuntimeEvent = ::RuntimeEvent; + AssetHubPolkadot::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( - 864_610_000, - 8799, + 676_119_000, + 6196, ))); + assert_expected_events!( AssetHubPolkadot, vec![ @@ -141,9 +149,9 @@ fn system_para_to_para_assets_sender_assertions(t: SystemParaToParaTest) { } fn system_para_to_para_assets_receiver_assertions(_: Test) { - type RuntimeEvent = ::RuntimeEvent; + type RuntimeEvent = ::RuntimeEvent; assert_expected_events!( - PenpalPolkadotA, + PenpalB, vec![ RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {}, RuntimeEvent::Assets(pallet_assets::Event::Issued { .. }) => {}, @@ -177,7 +185,7 @@ fn system_para_to_para_reserve_transfer_assets(t: SystemParaToParaTest) -> Dispa } fn para_to_system_para_reserve_transfer_assets(t: ParaToSystemParaTest) -> DispatchResult { - ::PolkadotXcm::limited_reserve_transfer_assets( + ::PolkadotXcm::limited_reserve_transfer_assets( t.signed_origin, bx!(t.args.dest.into()), bx!(t.args.beneficiary.into()), @@ -230,7 +238,6 @@ fn reserve_transfer_native_asset_from_system_para_to_relay_fails() { let beneficiary: MultiLocation = AccountId32Junction { network: None, id: beneficiary_id.into() }.into(); let amount_to_send: Balance = ASSET_HUB_POLKADOT_ED * 1000; - let assets: MultiAssets = (Parent, amount_to_send).into(); let fee_asset_item = 0; @@ -260,14 +267,14 @@ fn reserve_transfer_native_asset_from_system_para_to_relay_fails() { #[test] fn reserve_transfer_native_asset_from_relay_to_para() { // Init values for Relay - let destination = Polkadot::child_location_of(PenpalPolkadotA::para_id()); - let beneficiary_id = PenpalPolkadotAReceiver::get(); + let destination = Polkadot::child_location_of(PenpalB::para_id()); + let beneficiary_id = PenpalBReceiver::get(); let amount_to_send: Balance = POLKADOT_ED * 1000; let test_args = TestContext { sender: PolkadotSender::get(), - receiver: PenpalPolkadotAReceiver::get(), - args: relay_test_args(destination, beneficiary_id, amount_to_send), + receiver: PenpalBReceiver::get(), + args: TestArgs::new_relay(destination, beneficiary_id, amount_to_send), }; let mut test = RelayToParaTest::new(test_args); @@ -276,7 +283,7 @@ fn reserve_transfer_native_asset_from_relay_to_para() { let receiver_balance_before = test.receiver.balance; test.set_assertion::(relay_to_para_sender_assertions); - test.set_assertion::(para_receiver_assertions); + test.set_assertion::(para_receiver_assertions); test.set_dispatchable::(relay_to_para_reserve_transfer_assets); test.assert(); @@ -303,15 +310,15 @@ fn reserve_transfer_native_asset_from_relay_to_para() { #[test] fn reserve_transfer_native_asset_from_system_para_to_para() { // Init values for System Parachain - let destination = AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()); - let beneficiary_id = PenpalPolkadotAReceiver::get(); + let destination = AssetHubPolkadot::sibling_location_of(PenpalB::para_id()); + let beneficiary_id = PenpalBReceiver::get(); let amount_to_send: Balance = ASSET_HUB_POLKADOT_ED * 1000; let assets = (Parent, amount_to_send).into(); let test_args = TestContext { sender: AssetHubPolkadotSender::get(), - receiver: PenpalPolkadotAReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + receiver: PenpalBReceiver::get(), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = SystemParaToParaTest::new(test_args); @@ -320,7 +327,7 @@ fn reserve_transfer_native_asset_from_system_para_to_para() { let receiver_balance_before = test.receiver.balance; test.set_assertion::(system_para_to_para_sender_assertions); - test.set_assertion::(para_receiver_assertions); + test.set_assertion::(para_receiver_assertions); test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); @@ -347,15 +354,15 @@ fn reserve_transfer_native_asset_from_system_para_to_para() { #[test] fn reserve_transfer_native_asset_from_para_to_system_para() { // Init values for Penpal Parachain - let destination = PenpalPolkadotA::sibling_location_of(AssetHubPolkadot::para_id()); + let destination = PenpalB::sibling_location_of(AssetHubPolkadot::para_id()); let beneficiary_id = AssetHubPolkadotReceiver::get(); let amount_to_send: Balance = ASSET_HUB_POLKADOT_ED * 1000; let assets = (Parent, amount_to_send).into(); let test_args = TestContext { - sender: PenpalPolkadotASender::get(), + sender: PenpalBSender::get(), receiver: AssetHubPolkadotReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = ParaToSystemParaTest::new(test_args); @@ -363,25 +370,24 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { let sender_balance_before = test.sender.balance; let receiver_balance_before = test.receiver.balance; - let penpal_location_as_seen_by_ahr = - AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()); - let sov_penpal_on_ahr = - AssetHubPolkadot::sovereign_account_id_of(penpal_location_as_seen_by_ahr); + let penpal_location_as_seen_by_ahp = AssetHubPolkadot::sibling_location_of(PenpalB::para_id()); + let sov_penpal_on_ahp = + AssetHubPolkadot::sovereign_account_id_of(penpal_location_as_seen_by_ahp); - // fund the Penpal's SA on AHR with the native tokens held in reserve - AssetHubPolkadot::fund_accounts(vec![(sov_penpal_on_ahr.into(), amount_to_send * 2)]); + // fund the Penpal's SA on AHP with the native tokens held in reserve + AssetHubPolkadot::fund_accounts(vec![(sov_penpal_on_ahp.into(), amount_to_send * 2)]); - test.set_assertion::(para_to_system_para_sender_assertions); + test.set_assertion::(para_to_system_para_sender_assertions); test.set_assertion::(para_to_system_para_receiver_assertions); - test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); + test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); test.assert(); let sender_balance_after = test.sender.balance; let receiver_balance_after = test.receiver.balance; - let delivery_fees = PenpalPolkadotA::execute_with(|| { + let delivery_fees = PenpalB::execute_with(|| { xcm_helpers::transfer_assets_delivery_fees::< - ::XcmSender, + ::XcmSender, >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest) }); @@ -399,27 +405,27 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { /// work #[test] fn reserve_transfer_assets_from_system_para_to_para() { - // Force create asset on AssetHubPolkadot and PenpalPolkadotA from Relay Chain + // Force create asset on AssetHubPolkadot and PenpalB from Relay Chain AssetHubPolkadot::force_create_and_mint_asset( ASSET_ID, ASSET_MIN_BALANCE, - false, + true, AssetHubPolkadotSender::get(), Some(Weight::from_parts(1_019_445_000, 200_000)), ASSET_MIN_BALANCE * 1_000_000, ); - PenpalPolkadotA::force_create_and_mint_asset( + PenpalB::force_create_and_mint_asset( ASSET_ID, ASSET_MIN_BALANCE, false, - PenpalPolkadotASender::get(), + PenpalBSender::get(), None, 0, ); // Init values for System Parachain - let destination = AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()); - let beneficiary_id = PenpalPolkadotAReceiver::get(); + let destination = AssetHubPolkadot::sibling_location_of(PenpalB::para_id()); + let beneficiary_id = PenpalBReceiver::get(); let fee_amount_to_send = ASSET_HUB_POLKADOT_ED * 1000; let asset_amount_to_send = ASSET_MIN_BALANCE * 1000; let assets: MultiAssets = vec![ @@ -436,8 +442,8 @@ fn reserve_transfer_assets_from_system_para_to_para() { let para_test_args = TestContext { sender: AssetHubPolkadotSender::get(), - receiver: PenpalPolkadotAReceiver::get(), - args: para_test_args( + receiver: PenpalBReceiver::get(), + args: TestArgs::new_para( destination, beneficiary_id, asset_amount_to_send, @@ -449,10 +455,10 @@ fn reserve_transfer_assets_from_system_para_to_para() { let mut test = SystemParaToParaTest::new(para_test_args); - // Create SA-of-Penpal-on-AHR with ED. - let penpal_location = AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()); - let sov_penpal_on_ahr = AssetHubPolkadot::sovereign_account_id_of(penpal_location); - AssetHubPolkadot::fund_accounts(vec![(sov_penpal_on_ahr.into(), POLKADOT_ED)]); + // Create SA-of-Penpal-on-AHP with ED. + let penpal_location = AssetHubPolkadot::sibling_location_of(PenpalB::para_id()); + let sov_penpal_on_ahp = AssetHubPolkadot::sovereign_account_id_of(penpal_location); + AssetHubPolkadot::fund_accounts(vec![(sov_penpal_on_ahp.into(), POLKADOT_ED)]); let sender_balance_before = test.sender.balance; let receiver_balance_before = test.receiver.balance; @@ -461,13 +467,13 @@ fn reserve_transfer_assets_from_system_para_to_para() { type Assets = ::Assets; >::balance(ASSET_ID, &AssetHubPolkadotSender::get()) }); - let receiver_assets_before = PenpalPolkadotA::execute_with(|| { - type Assets = ::Assets; - >::balance(ASSET_ID, &PenpalPolkadotAReceiver::get()) + let receiver_assets_before = PenpalB::execute_with(|| { + type Assets = ::Assets; + >::balance(ASSET_ID, &PenpalBReceiver::get()) }); test.set_assertion::(system_para_to_para_assets_sender_assertions); - test.set_assertion::(system_para_to_para_assets_receiver_assertions); + test.set_assertion::(system_para_to_para_assets_receiver_assertions); test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); @@ -487,9 +493,9 @@ fn reserve_transfer_assets_from_system_para_to_para() { type Assets = ::Assets; >::balance(ASSET_ID, &AssetHubPolkadotSender::get()) }); - let receiver_assets_after = PenpalPolkadotA::execute_with(|| { - type Assets = ::Assets; - >::balance(ASSET_ID, &PenpalPolkadotAReceiver::get()) + let receiver_assets_after = PenpalB::execute_with(|| { + type Assets = ::Assets; + >::balance(ASSET_ID, &PenpalBReceiver::get()) }); // Sender's balance is reduced by exact amount diff --git a/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/send.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/send.rs similarity index 87% rename from integration-tests/emulated/assets/asset-hub-polkadot/src/tests/send.rs rename to integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/send.rs index adbb28f024..403ad7d1d1 100644 --- a/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/send.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/send.rs @@ -33,7 +33,7 @@ fn send_transact_as_superuser_from_relay_to_system_para_works() { #[test] fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() { let para_sovereign_account = AssetHubPolkadot::sovereign_account_id_of( - AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()), + AssetHubPolkadot::sibling_location_of(PenpalB::para_id()), ); // Force create and mint assets for Parachain's sovereign account @@ -60,9 +60,8 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() { let native_asset = (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into(); - let root_origin = ::RuntimeOrigin::root(); - let system_para_destination = - PenpalPolkadotA::sibling_location_of(AssetHubPolkadot::para_id()).into(); + let root_origin = ::RuntimeOrigin::root(); + let system_para_destination = PenpalB::sibling_location_of(AssetHubPolkadot::para_id()).into(); let xcm = xcm_transact_paid_execution( call, origin_kind, @@ -70,21 +69,21 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() { para_sovereign_account.clone(), ); - PenpalPolkadotA::execute_with(|| { - assert_ok!(::PolkadotXcm::send( + PenpalB::execute_with(|| { + assert_ok!(::PolkadotXcm::send( root_origin, bx!(system_para_destination), bx!(xcm), )); - PenpalPolkadotA::assert_xcm_pallet_sent(); + PenpalB::assert_xcm_pallet_sent(); }); AssetHubPolkadot::execute_with(|| { type RuntimeEvent = ::RuntimeEvent; AssetHubPolkadot::assert_xcmp_queue_success(Some(Weight::from_parts( - 15_594_564_000, + 16_290_336_000, 562_893, ))); diff --git a/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/set_xcm_versions.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/set_xcm_versions.rs similarity index 100% rename from integration-tests/emulated/assets/asset-hub-polkadot/src/tests/set_xcm_versions.rs rename to integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/set_xcm_versions.rs diff --git a/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs similarity index 88% rename from integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs rename to integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs index ed49e09b9a..ae48670843 100644 --- a/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs @@ -15,12 +15,14 @@ use crate::*; use asset_hub_polkadot_runtime::xcm_config::XcmConfig as AssetHubPolkadotXcmConfig; +use emulated_integration_tests_common::xcm_helpers::non_fee_asset; use polkadot_runtime::xcm_config::XcmConfig as PolkadotXcmConfig; +use polkadot_system_emulated_network::penpal_emulated_chain::LocalTeleportableToAssetHub as PenpalLocalTeleportableToAssetHub; fn relay_origin_assertions(t: RelayToSystemParaTest) { type RuntimeEvent = ::RuntimeEvent; - Polkadot::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(631_531_000, 7_186))); + Polkadot::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(632_207_000, 7_186))); assert_expected_events!( Polkadot, @@ -45,7 +47,7 @@ fn relay_dest_assertions(t: SystemParaToRelayTest) { Polkadot::assert_ump_queue_processed( true, Some(AssetHubPolkadot::para_id()), - Some(Weight::from_parts(307_225_000, 7_186)), + Some(Weight::from_parts(308_222_000, 7_186)), ); assert_expected_events!( @@ -68,7 +70,7 @@ fn relay_dest_assertions_fail(_t: SystemParaToRelayTest) { Polkadot::assert_ump_queue_processed( false, Some(AssetHubPolkadot::para_id()), - Some(Weight::from_parts(157_718_000, 3_593)), + Some(Weight::from_parts(148_705_000, 3_593)), ); } @@ -76,8 +78,8 @@ fn para_origin_assertions(t: SystemParaToRelayTest) { type RuntimeEvent = ::RuntimeEvent; AssetHubPolkadot::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( - 720_053_000, - 7_203, + 533_910_000, + 7167, ))); AssetHubPolkadot::assert_parachain_system_ump_sent(); @@ -97,7 +99,7 @@ fn para_origin_assertions(t: SystemParaToRelayTest) { fn para_dest_assertions(t: RelayToSystemParaTest) { type RuntimeEvent = ::RuntimeEvent; - AssetHubPolkadot::assert_dmp_queue_complete(Some(Weight::from_parts(157_718_000, 3593))); + AssetHubPolkadot::assert_dmp_queue_complete(Some(Weight::from_parts(164_793_000, 3593))); assert_expected_events!( AssetHubPolkadot, @@ -111,13 +113,13 @@ fn para_dest_assertions(t: RelayToSystemParaTest) { } fn penpal_to_ah_foreign_assets_sender_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - PenpalPolkadotA::assert_xcm_pallet_attempted_complete(None); + type RuntimeEvent = ::RuntimeEvent; + PenpalB::assert_xcm_pallet_attempted_complete(None); let expected_asset_id = t.args.asset_id.unwrap(); let (_, expected_asset_amount) = non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); assert_expected_events!( - PenpalPolkadotA, + PenpalB, vec![ RuntimeEvent::Balances( pallet_balances::Event::Withdraw { who, amount } @@ -136,8 +138,8 @@ fn penpal_to_ah_foreign_assets_sender_assertions(t: ParaToSystemParaTest) { fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) { type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_on_ahr = AssetHubPolkadot::sovereign_account_id_of( - AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()), + let sov_penpal_on_ahk = AssetHubPolkadot::sovereign_account_id_of( + AssetHubPolkadot::sibling_location_of(PenpalB::para_id()), ); let (expected_foreign_asset_id, expected_foreign_asset_amount) = non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); @@ -148,7 +150,7 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) { RuntimeEvent::Balances( pallet_balances::Event::Burned { who, amount } ) => { - who: *who == sov_penpal_on_ahr.clone().into(), + who: *who == sov_penpal_on_ahk.clone().into(), amount: *amount == t.args.amount, }, RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { @@ -196,13 +198,13 @@ fn ah_to_penpal_foreign_assets_sender_assertions(t: SystemParaToParaTest) { } fn ah_to_penpal_foreign_assets_receiver_assertions(t: SystemParaToParaTest) { - type RuntimeEvent = ::RuntimeEvent; + type RuntimeEvent = ::RuntimeEvent; let expected_asset_id = t.args.asset_id.unwrap(); let (_, expected_asset_amount) = non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); - let checking_account = ::PolkadotXcm::check_account(); + let checking_account = ::PolkadotXcm::check_account(); assert_expected_events!( - PenpalPolkadotA, + PenpalB, vec![ // checking account burns local asset as part of incoming teleport RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { @@ -269,8 +271,8 @@ fn system_para_teleport_assets(t: SystemParaToRelayTest) -> DispatchResult { ) } -fn para_to_system_para_transfer_assets(t: ParaToSystemParaTest) -> DispatchResult { - ::PolkadotXcm::transfer_assets( +fn system_para_to_para_transfer_assets(t: SystemParaToParaTest) -> DispatchResult { + ::PolkadotXcm::transfer_assets( t.signed_origin, bx!(t.args.dest.into()), bx!(t.args.beneficiary.into()), @@ -280,8 +282,8 @@ fn para_to_system_para_transfer_assets(t: ParaToSystemParaTest) -> DispatchResul ) } -fn system_para_to_para_transfer_assets(t: SystemParaToParaTest) -> DispatchResult { - ::PolkadotXcm::transfer_assets( +fn para_to_system_para_transfer_assets(t: ParaToSystemParaTest) -> DispatchResult { + ::PolkadotXcm::transfer_assets( t.signed_origin, bx!(t.args.dest.into()), bx!(t.args.beneficiary.into()), @@ -297,11 +299,11 @@ fn limited_teleport_native_assets_from_relay_to_system_para_works() { // Init values for Relay Chain let amount_to_send: Balance = POLKADOT_ED * 1000; let dest = Polkadot::child_location_of(AssetHubPolkadot::para_id()); - let beneficiary_id = AssetHubPolkadotReceiver::get(); + let beneficiary = AssetHubPolkadotReceiver::get(); let test_args = TestContext { sender: PolkadotSender::get(), - receiver: AssetHubPolkadotReceiver::get(), - args: relay_test_args(dest, beneficiary_id, amount_to_send), + receiver: beneficiary.clone(), + args: TestArgs::new_relay(dest, beneficiary, amount_to_send), }; let mut test = RelayToSystemParaTest::new(test_args); @@ -345,7 +347,7 @@ fn limited_teleport_native_assets_back_from_system_para_to_relay_works() { let test_args = TestContext { sender: AssetHubPolkadotSender::get(), receiver: PolkadotReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = SystemParaToRelayTest::new(test_args); @@ -386,7 +388,7 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() { let test_args = TestContext { sender: AssetHubPolkadotSender::get(), receiver: PolkadotReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = SystemParaToRelayTest::new(test_args); @@ -420,11 +422,11 @@ fn teleport_native_assets_from_relay_to_system_para_works() { // Init values for Relay Chain let amount_to_send: Balance = POLKADOT_ED * 1000; let dest = Polkadot::child_location_of(AssetHubPolkadot::para_id()); - let beneficiary_id = AssetHubPolkadotReceiver::get(); + let beneficiary = AssetHubPolkadotReceiver::get(); let test_args = TestContext { sender: PolkadotSender::get(), - receiver: AssetHubPolkadotReceiver::get(), - args: relay_test_args(dest, beneficiary_id, amount_to_send), + receiver: beneficiary.clone(), + args: TestArgs::new_relay(dest, beneficiary, amount_to_send), }; let mut test = RelayToSystemParaTest::new(test_args); @@ -468,7 +470,7 @@ fn teleport_native_assets_back_from_system_para_to_relay_works() { let test_args = TestContext { sender: AssetHubPolkadotSender::get(), receiver: PolkadotReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = SystemParaToRelayTest::new(test_args); @@ -481,15 +483,15 @@ fn teleport_native_assets_back_from_system_para_to_relay_works() { test.set_dispatchable::(system_para_teleport_assets); test.assert(); - let sender_balance_after = test.sender.balance; - let receiver_balance_after = test.receiver.balance; - let delivery_fees = AssetHubPolkadot::execute_with(|| { xcm_helpers::transfer_assets_delivery_fees::< ::XcmSender, >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest) }); + let sender_balance_after = test.sender.balance; + let receiver_balance_after = test.receiver.balance; + // Sender's balance is reduced assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after); // Receiver's balance is increased @@ -509,7 +511,7 @@ fn teleport_native_assets_from_system_para_to_relay_fails() { let test_args = TestContext { sender: AssetHubPolkadotSender::get(), receiver: PolkadotReceiver::get(), - args: para_test_args(destination, beneficiary_id, amount_to_send, assets, None, 0), + args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; let mut test = SystemParaToRelayTest::new(test_args); @@ -554,15 +556,15 @@ fn teleport_to_other_system_parachains_works() { /// (using native reserve-based transfer for fees) #[test] fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { - let ah_as_seen_by_penpal = PenpalPolkadotA::sibling_location_of(AssetHubPolkadot::para_id()); + let ah_as_seen_by_penpal = PenpalB::sibling_location_of(AssetHubPolkadot::para_id()); let asset_location_on_penpal = PenpalLocalTeleportableToAssetHub::get(); let asset_id_on_penpal = match asset_location_on_penpal.last() { Some(GeneralIndex(id)) => *id as u32, _ => unreachable!(), }; - let asset_owner_on_penpal = PenpalPolkadotASender::get(); + let asset_owner_on_penpal = PenpalBSender::get(); let foreign_asset_at_asset_hub_polkadot = - MultiLocation { parents: 1, interior: X1(Parachain(PenpalPolkadotA::para_id().into())) } + MultiLocation { parents: 1, interior: X1(Parachain(PenpalB::para_id().into())) } .appended_with(asset_location_on_penpal) .unwrap(); super::penpal_create_foreign_asset_on_asset_hub( @@ -575,7 +577,7 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { ); let penpal_to_ah_beneficiary_id = AssetHubPolkadotReceiver::get(); - let fee_amount_to_send = ASSET_HUB_POLKADOT_ED * 10_000; + let fee_amount_to_send = ASSET_HUB_POLKADOT_ED * 1000; let asset_amount_to_send = ASSET_MIN_BALANCE * 1000; let penpal_assets: MultiAssets = vec![ @@ -591,9 +593,9 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { // Penpal to AH test args let penpal_to_ah_test_args = TestContext { - sender: PenpalPolkadotASender::get(), + sender: PenpalBSender::get(), receiver: AssetHubPolkadotReceiver::get(), - args: para_test_args( + args: TestArgs::new_para( ah_as_seen_by_penpal, penpal_to_ah_beneficiary_id, asset_amount_to_send, @@ -607,9 +609,9 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { let penpal_sender_balance_before = penpal_to_ah.sender.balance; let ah_receiver_balance_before = penpal_to_ah.receiver.balance; - let penpal_sender_assets_before = PenpalPolkadotA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalPolkadotASender::get()) + let penpal_sender_assets_before = PenpalB::execute_with(|| { + type Assets = ::Assets; + >::balance(asset_id_on_penpal, &PenpalBSender::get()) }); let ah_receiver_assets_before = AssetHubPolkadot::execute_with(|| { type Assets = ::ForeignAssets; @@ -619,17 +621,17 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { ) }); - penpal_to_ah.set_assertion::(penpal_to_ah_foreign_assets_sender_assertions); + penpal_to_ah.set_assertion::(penpal_to_ah_foreign_assets_sender_assertions); penpal_to_ah.set_assertion::(penpal_to_ah_foreign_assets_receiver_assertions); - penpal_to_ah.set_dispatchable::(para_to_system_para_transfer_assets); + penpal_to_ah.set_dispatchable::(para_to_system_para_transfer_assets); penpal_to_ah.assert(); let penpal_sender_balance_after = penpal_to_ah.sender.balance; let ah_receiver_balance_after = penpal_to_ah.receiver.balance; - let penpal_sender_assets_after = PenpalPolkadotA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalPolkadotASender::get()) + let penpal_sender_assets_after = PenpalB::execute_with(|| { + type Assets = ::Assets; + >::balance(asset_id_on_penpal, &PenpalBSender::get()) }); let ah_receiver_assets_after = AssetHubPolkadot::execute_with(|| { type Assets = ::ForeignAssets; @@ -668,8 +670,8 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { )); }); - let ah_to_penpal_beneficiary_id = PenpalPolkadotAReceiver::get(); - let penpal_as_seen_by_ah = AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()); + let ah_to_penpal_beneficiary_id = PenpalBReceiver::get(); + let penpal_as_seen_by_ah = AssetHubPolkadot::sibling_location_of(PenpalB::para_id()); let ah_assets: MultiAssets = vec![ (Parent, fee_amount_to_send).into(), (foreign_asset_at_asset_hub_polkadot, asset_amount_to_send).into(), @@ -684,8 +686,8 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { // AH to Penpal test args let ah_to_penpal_test_args = TestContext { sender: AssetHubPolkadotSender::get(), - receiver: PenpalPolkadotAReceiver::get(), - args: para_test_args( + receiver: PenpalBReceiver::get(), + args: TestArgs::new_para( penpal_as_seen_by_ah, ah_to_penpal_beneficiary_id, asset_amount_to_send, @@ -706,13 +708,13 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { &AssetHubPolkadotSender::get(), ) }); - let penpal_receiver_assets_before = PenpalPolkadotA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalPolkadotAReceiver::get()) + let penpal_receiver_assets_before = PenpalB::execute_with(|| { + type Assets = ::Assets; + >::balance(asset_id_on_penpal, &PenpalBReceiver::get()) }); ah_to_penpal.set_assertion::(ah_to_penpal_foreign_assets_sender_assertions); - ah_to_penpal.set_assertion::(ah_to_penpal_foreign_assets_receiver_assertions); + ah_to_penpal.set_assertion::(ah_to_penpal_foreign_assets_receiver_assertions); ah_to_penpal.set_dispatchable::(system_para_to_para_transfer_assets); ah_to_penpal.assert(); @@ -726,9 +728,9 @@ fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { &AssetHubPolkadotSender::get(), ) }); - let penpal_receiver_assets_after = PenpalPolkadotA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalPolkadotAReceiver::get()) + let penpal_receiver_assets_after = PenpalB::execute_with(|| { + type Assets = ::Assets; + >::balance(asset_id_on_penpal, &PenpalBReceiver::get()) }); // Sender's balance is reduced diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/treasury.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/treasury.rs new file mode 100644 index 0000000000..03e34b234d --- /dev/null +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/treasury.rs @@ -0,0 +1,126 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::*; +use emulated_integration_tests_common::accounts::{ALICE, BOB}; +use frame_support::traits::fungibles::{Create, Inspect, Mutate}; +use polkadot_runtime_common::impls::VersionedLocatableAsset; +use xcm_executor::traits::ConvertLocation; + +#[test] +fn create_and_claim_treasury_spend() { + const ASSET_ID: u32 = 1984; + const SPEND_AMOUNT: u128 = 1_000_000; + // treasury location from a sibling parachain. + let treasury_location: MultiLocation = MultiLocation::new(1, PalletInstance(19)); + // treasury account on a sibling parachain. + let treasury_account = + asset_hub_polkadot_runtime::xcm_config::LocationToAccountId::convert_location( + &treasury_location, + ) + .unwrap(); + let asset_hub_location = MultiLocation::new(0, Parachain(AssetHubPolkadot::para_id().into())); + let root = ::RuntimeOrigin::root(); + // asset kind to be spend from the treasury. + let asset_kind = VersionedLocatableAsset::V3 { + location: asset_hub_location, + asset_id: AssetId::Concrete((PalletInstance(50), GeneralIndex(ASSET_ID.into())).into()), + }; + // treasury spend beneficiary. + let alice: AccountId = Polkadot::account_id_of(ALICE); + let bob: AccountId = Polkadot::account_id_of(BOB); + let bob_signed = ::RuntimeOrigin::signed(bob.clone()); + + AssetHubPolkadot::execute_with(|| { + type Assets = ::Assets; + + // create an asset class and mint some assets to the treasury account. + assert_ok!(>::create( + ASSET_ID, + treasury_account.clone(), + true, + SPEND_AMOUNT / 2 + )); + assert_ok!(>::mint_into(ASSET_ID, &treasury_account, SPEND_AMOUNT * 4)); + // beneficiary has zero balance. + assert_eq!(>::balance(ASSET_ID, &alice,), 0u128,); + }); + + Polkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + type Treasury = ::Treasury; + type AssetRate = ::AssetRate; + + // create a conversion rate from `asset_kind` to the native currency. + assert_ok!(AssetRate::create(root.clone(), Box::new(asset_kind.clone()), 2.into())); + + // create and approve a treasury spend. + assert_ok!(Treasury::spend( + root, + Box::new(asset_kind), + SPEND_AMOUNT, + Box::new(MultiLocation::new(0, Into::<[u8; 32]>::into(alice.clone())).into()), + None, + )); + // claim the spend. + assert_ok!(Treasury::payout(bob_signed.clone(), 0)); + + assert_expected_events!( + Polkadot, + vec![ + RuntimeEvent::Treasury(pallet_treasury::Event::Paid { .. }) => {}, + ] + ); + }); + + AssetHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + type Assets = ::Assets; + + // assert events triggered by xcm pay program + // 1. treasury asset transferred to spend beneficiary + // 2. response to Relay Chain treasury pallet instance sent back + // 3. XCM program completed + assert_expected_events!( + AssetHubPolkadot, + vec![ + RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) => { + id: id == &ASSET_ID, + from: from == &treasury_account, + to: to == &alice, + amount: amount == &SPEND_AMOUNT, + }, + RuntimeEvent::ParachainSystem(cumulus_pallet_parachain_system::Event::UpwardMessageSent { .. }) => {}, + RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true ,.. }) => {}, + ] + ); + // beneficiary received the assets from the treasury. + assert_eq!(>::balance(ASSET_ID, &alice,), SPEND_AMOUNT,); + }); + + Polkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + type Treasury = ::Treasury; + + // check the payment status to ensure the response from the AssetHub was received. + assert_ok!(Treasury::check_status(bob_signed, 0)); + assert_expected_events!( + Polkadot, + vec![ + RuntimeEvent::Treasury(pallet_treasury::Event::SpendProcessed { .. }) => {}, + ] + ); + }); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml new file mode 100644 index 0000000000..ee4e95c369 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "bridge-hub-kusama-integration-tests" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Bridge Hub Kusama runtime integration tests with xcm-emulator" +publish = false + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.4.0" } +scale-info = { version = "2.10.0", features = ["derive"] } +hex = "0.4.3" +hex-literal = "0.4.1" + +# Substrate +sp-runtime = { version = "31.0.1" } +frame-support = { version = "28.0.0" } +pallet-balances = { version = "28.0.0" } +pallet-assets = { version = "29.0.0" } +pallet-message-queue = { version = "31.0.0" } + +# Polkadot +xcm = { package = "staging-xcm", version = "7.0.0" } +pallet-xcm = { version = "7.0.0" } +xcm-executor = { package = "staging-xcm-executor", version = "7.0.3" } + +# Cumulus +emulated-integration-tests-common = { version = "3.0.0" } +parachains-common = { version = "7.0.0" } +cumulus-pallet-xcmp-queue = { version = "0.7.0" } + +# Bridges +bp-messages = { version = "0.7.0" } +pallet-bridge-messages = { version = "0.7.0" } + +# Local +bridge-hub-kusama-runtime = { path = "../../../../../system-parachains/bridge-hubs/bridge-hub-kusama" } +integration-tests-helpers = { path = "../../../helpers" } +kusama-polkadot-system-emulated-network = { path = "../../../networks/kusama-polkadot-system" } +kusama-system-emulated-network = { path = "../../../networks/kusama-system" } diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/lib.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/lib.rs new file mode 100644 index 0000000000..1c7d1e1682 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/lib.rs @@ -0,0 +1,75 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Substrate +pub use frame_support::{assert_err, assert_ok, pallet_prelude::DispatchResult}; +pub use sp_runtime::DispatchError; + +// Polkadot +pub use xcm::{ + latest::ParentThen, + prelude::{AccountId32 as AccountId32Junction, *}, + v3::{ + Error, + NetworkId::{Kusama as KusamaId, Polkadot as PolkadotId}, + }, +}; + +// Bridges +pub use bp_messages::LaneId; + +// Cumulus +pub use emulated_integration_tests_common::{ + accounts::ALICE, + impls::Inspect, + xcm_emulator::{ + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, + }, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, +}; +pub use integration_tests_helpers::test_parachain_is_trusted_teleporter; +pub use kusama_polkadot_system_emulated_network::{ + asset_hub_kusama_emulated_chain::{ + genesis::ED as ASSET_HUB_KUSAMA_ED, AssetHubKusamaParaPallet as AssetHubKusamaPallet, + }, + asset_hub_polkadot_emulated_chain::{ + genesis::ED as ASSET_HUB_POLKADOT_ED, AssetHubPolkadotParaPallet as AssetHubPolkadotPallet, + }, + bridge_hub_kusama_emulated_chain::{ + genesis::ED as BRIDGE_HUB_KUSAMA_ED, BridgeHubKusamaParaPallet as BridgeHubKusamaPallet, + }, + kusama_emulated_chain::{genesis::ED as KUSAMA_ED, KusamaRelayPallet as KusamaPallet}, + AssetHubKusamaPara as AssetHubKusama, AssetHubKusamaParaReceiver as AssetHubKusamaReceiver, + AssetHubKusamaParaSender as AssetHubKusamaSender, AssetHubPolkadotPara as AssetHubPolkadot, + AssetHubPolkadotParaReceiver as AssetHubPolkadotReceiver, + BridgeHubKusamaPara as BridgeHubKusama, BridgeHubKusamaParaSender as BridgeHubKusamaSender, + BridgeHubPolkadotPara as BridgeHubPolkadot, KusamaRelay as Kusama, + KusamaRelayReceiver as KusamaReceiver, KusamaRelaySender as KusamaSender, +}; +pub use kusama_system_emulated_network::{ + penpal_emulated_chain::PenpalAParaPallet as PenpalAPallet, + BridgeHubKusamaParaReceiver as BridgeHubKusamaReceiver, PenpalAPara as PenpalA, + PenpalAParaReceiver as PenpalAReceiver, PenpalAParaSender as PenpalASender, +}; +pub use parachains_common::{AccountId, Balance}; + +pub const ASSET_ID: u32 = 1; +pub const ASSET_MIN_BALANCE: u128 = 1000; +pub const ASSETS_PALLET_ID: u8 = 50; + +#[cfg(test)] +mod tests; diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/asset_transfers.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/asset_transfers.rs new file mode 100644 index 0000000000..148c8b3ba9 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/asset_transfers.rs @@ -0,0 +1,171 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::tests::*; + +fn send_asset_from_asset_hub_kusama_to_asset_hub_polkadot(id: MultiLocation, amount: u128) { + let destination = asset_hub_polkadot_location(); + + // fund the AHK's SA on BHK for paying bridge transport fees + BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id(), 10_000_000_000_000u128); + + // set XCM versions + AssetHubKusama::force_xcm_version(destination, XCM_VERSION); + BridgeHubKusama::force_xcm_version(bridge_hub_polkadot_location(), XCM_VERSION); + + // send message over bridge + assert_ok!(send_asset_from_asset_hub_kusama(destination, (id, amount))); + assert_bridge_hub_kusama_message_accepted(true); + assert_bridge_hub_polkadot_message_received(); +} + +#[test] +fn send_ksms_from_asset_hub_kusama_to_asset_hub_polkadot() { + let ksm_at_asset_hub_kusama: MultiLocation = Parent.into(); + let ksm_at_asset_hub_polkadot = + MultiLocation { parents: 2, interior: X1(GlobalConsensus(NetworkId::Kusama)) }; + let owner: AccountId = AssetHubPolkadot::account_id_of(ALICE); + AssetHubPolkadot::force_create_foreign_asset( + ksm_at_asset_hub_polkadot, + owner, + true, + ASSET_MIN_BALANCE, + vec![], + ); + let sov_ahp_on_ahk = AssetHubKusama::sovereign_account_of_parachain_on_other_global_consensus( + NetworkId::Polkadot, + AssetHubPolkadot::para_id(), + ); + + let ksms_in_reserve_on_ahk_before = + ::account_data_of(sov_ahp_on_ahk.clone()).free; + let sender_ksms_before = + ::account_data_of(AssetHubKusamaSender::get()).free; + let receiver_ksms_before = AssetHubPolkadot::execute_with(|| { + type Assets = ::ForeignAssets; + >::balance(ksm_at_asset_hub_polkadot, &AssetHubPolkadotReceiver::get()) + }); + + let amount = ASSET_HUB_KUSAMA_ED * 1_000; + send_asset_from_asset_hub_kusama_to_asset_hub_polkadot(ksm_at_asset_hub_kusama, amount); + AssetHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + AssetHubPolkadot, + vec![ + // issue KSMs on AHP + RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { + asset_id: *asset_id == ksm_at_asset_hub_kusama, + owner: *owner == AssetHubPolkadotReceiver::get(), + }, + // message processed successfully + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + }); + + let sender_ksms_after = + ::account_data_of(AssetHubKusamaSender::get()).free; + let receiver_ksms_after = AssetHubPolkadot::execute_with(|| { + type Assets = ::ForeignAssets; + >::balance(ksm_at_asset_hub_polkadot, &AssetHubPolkadotReceiver::get()) + }); + let ksms_in_reserve_on_ahk_after = + ::account_data_of(sov_ahp_on_ahk.clone()).free; + + // Sender's balance is reduced + assert!(sender_ksms_before > sender_ksms_after); + // Receiver's balance is increased + assert!(receiver_ksms_after > receiver_ksms_before); + // Reserve balance is reduced by sent amount + assert_eq!(ksms_in_reserve_on_ahk_after, ksms_in_reserve_on_ahk_before + amount); +} + +#[test] +fn send_dots_from_asset_hub_kusama_to_asset_hub_polkadot() { + let prefund_amount = 10_000_000_000_000u128; + let dot_at_asset_hub_kusama = + MultiLocation { parents: 2, interior: X1(GlobalConsensus(NetworkId::Polkadot)) }; + let owner: AccountId = AssetHubPolkadot::account_id_of(ALICE); + AssetHubKusama::force_create_foreign_asset( + dot_at_asset_hub_kusama, + owner, + true, + ASSET_MIN_BALANCE, + vec![(AssetHubKusamaSender::get(), prefund_amount)], + ); + + // fund the AHK's SA on AHP with the DOT tokens held in reserve + let sov_ahk_on_ahp = AssetHubPolkadot::sovereign_account_of_parachain_on_other_global_consensus( + NetworkId::Kusama, + AssetHubKusama::para_id(), + ); + AssetHubPolkadot::fund_accounts(vec![(sov_ahk_on_ahp.clone(), prefund_amount)]); + + let dots_in_reserve_on_ahp_before = + ::account_data_of(sov_ahk_on_ahp.clone()).free; + assert_eq!(dots_in_reserve_on_ahp_before, prefund_amount); + let sender_dots_before = AssetHubKusama::execute_with(|| { + type Assets = ::ForeignAssets; + >::balance(dot_at_asset_hub_kusama, &AssetHubKusamaSender::get()) + }); + assert_eq!(sender_dots_before, prefund_amount); + let receiver_dots_before = + ::account_data_of(AssetHubPolkadotReceiver::get()).free; + + let amount_to_send = ASSET_HUB_POLKADOT_ED * 1_000; + send_asset_from_asset_hub_kusama_to_asset_hub_polkadot(dot_at_asset_hub_kusama, amount_to_send); + AssetHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + AssetHubPolkadot, + vec![ + // DOT is withdrawn from AHK's SA on AHP + RuntimeEvent::Balances( + pallet_balances::Event::Burned { who, amount } + ) => { + who: *who == sov_ahk_on_ahp, + amount: *amount == amount_to_send, + }, + // DOTs deposited to beneficiary + RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { + who: *who == AssetHubPolkadotReceiver::get(), + }, + // message processed successfully + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + }); + + let sender_dots_after = AssetHubKusama::execute_with(|| { + type Assets = ::ForeignAssets; + >::balance(dot_at_asset_hub_kusama, &AssetHubKusamaSender::get()) + }); + let receiver_dots_after = + ::account_data_of(AssetHubPolkadotReceiver::get()).free; + let dots_in_reserve_on_ahp_after = + ::account_data_of(sov_ahk_on_ahp).free; + + // Sender's balance is reduced + assert!(sender_dots_before > sender_dots_after); + // Receiver's balance is increased + assert!(receiver_dots_after > receiver_dots_before); + // Reserve balance is reduced by sent amount + assert_eq!(dots_in_reserve_on_ahp_after, dots_in_reserve_on_ahp_before - amount_to_send); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs new file mode 100644 index 0000000000..3e3f63297c --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs @@ -0,0 +1,114 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::*; + +mod asset_transfers; +mod send_xcm; +mod teleport; + +pub(crate) fn asset_hub_polkadot_location() -> MultiLocation { + MultiLocation { + parents: 2, + interior: X2( + GlobalConsensus(NetworkId::Polkadot), + Parachain(AssetHubPolkadot::para_id().into()), + ), + } +} + +pub(crate) fn bridge_hub_polkadot_location() -> MultiLocation { + MultiLocation { + parents: 2, + interior: X2( + GlobalConsensus(NetworkId::Polkadot), + Parachain(BridgeHubPolkadot::para_id().into()), + ), + } +} + +pub(crate) fn send_asset_from_asset_hub_kusama( + destination: MultiLocation, + (id, amount): (MultiLocation, u128), +) -> DispatchResult { + let signed_origin = + ::RuntimeOrigin::signed(AssetHubKusamaSender::get().into()); + + let beneficiary: MultiLocation = + AccountId32Junction { network: None, id: AssetHubPolkadotReceiver::get().into() }.into(); + + let assets: MultiAssets = (id, amount).into(); + let fee_asset_item = 0; + + AssetHubKusama::execute_with(|| { + ::PolkadotXcm::limited_reserve_transfer_assets( + signed_origin, + bx!(destination.into()), + bx!(beneficiary.into()), + bx!(assets.into()), + fee_asset_item, + WeightLimit::Unlimited, + ) + }) +} + +pub(crate) fn assert_bridge_hub_kusama_message_accepted(expected_processed: bool) { + BridgeHubKusama::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + if expected_processed { + assert_expected_events!( + BridgeHubKusama, + vec![ + // pay for bridge fees + RuntimeEvent::Balances(pallet_balances::Event::Burned { .. }) => {}, + // message exported + RuntimeEvent::BridgePolkadotMessages( + pallet_bridge_messages::Event::MessageAccepted { .. } + ) => {}, + // message processed successfully + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + } else { + assert_expected_events!( + BridgeHubKusama, + vec![ + RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { + success: false, + .. + }) => {}, + ] + ); + } + }); +} + +pub(crate) fn assert_bridge_hub_polkadot_message_received() { + BridgeHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + BridgeHubPolkadot, + vec![ + // message sent to destination + RuntimeEvent::XcmpQueue( + cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. } + ) => {}, + ] + ); + }) +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs new file mode 100644 index 0000000000..e1c64ef580 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs @@ -0,0 +1,177 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::tests::*; + +#[test] +fn send_xcm_from_kusama_relay_to_polkadot_asset_hub_should_fail_on_not_applicable() { + // Init tests variables + // XcmPallet send arguments + let sudo_origin = ::RuntimeOrigin::root(); + let destination = Kusama::child_location_of(BridgeHubKusama::para_id()).into(); + let weight_limit = WeightLimit::Unlimited; + let check_origin = None; + + let remote_xcm = Xcm(vec![ClearOrigin]); + + let xcm = VersionedXcm::from(Xcm(vec![ + UnpaidExecution { weight_limit, check_origin }, + ExportMessage { + network: PolkadotId, + destination: X1(Parachain(AssetHubPolkadot::para_id().into())), + xcm: remote_xcm, + }, + ])); + + // Kusama Global Consensus + // Send XCM message from Relay Chain to Bridge Hub source Parachain + Kusama::execute_with(|| { + assert_ok!(::XcmPallet::send( + sudo_origin, + bx!(destination), + bx!(xcm), + )); + + type RuntimeEvent = ::RuntimeEvent; + + assert_expected_events!( + Kusama, + vec![ + RuntimeEvent::XcmPallet(pallet_xcm::Event::Sent { .. }) => {}, + ] + ); + }); + // Receive XCM message in Bridge Hub source Parachain, it should fail, because we don't have + // opened bridge/lane. + assert_bridge_hub_kusama_message_accepted(false); +} + +#[test] +fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { + // Initially set only default version on all runtimes + AssetHubKusama::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); + BridgeHubKusama::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); + BridgeHubPolkadot::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); + AssetHubPolkadot::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); + + // prepare data + let destination = asset_hub_polkadot_location(); + let native_token = MultiLocation::parent(); + let amount = ASSET_HUB_KUSAMA_ED * 1_000; + + // fund the AHK's SA on BHK for paying bridge transport fees + BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id(), 10_000_000_000_000u128); + // fund sender + AssetHubKusama::fund_accounts(vec![(AssetHubKusamaSender::get().into(), amount * 10)]); + + // send XCM from AssetHubKusama - fails - destination version not known + assert_err!( + send_asset_from_asset_hub_kusama(destination, (native_token, amount)), + DispatchError::Module(sp_runtime::ModuleError { + index: 31, + error: [1, 0, 0, 0], + message: Some("SendFailure") + }) + ); + + // set destination version + AssetHubKusama::force_xcm_version(destination, xcm::v3::prelude::XCM_VERSION); + + // TODO: remove this block, when removing `xcm:v2` + { + // send XCM from AssetHubKusama - fails - AssetHubKusama is set to the default/safe `2` + // version, which does not have the `ExportMessage` instruction. If the default `2` is + // changed to `3`, then this assert can go away" + assert_err!( + send_asset_from_asset_hub_kusama(destination, (native_token, amount)), + DispatchError::Module(sp_runtime::ModuleError { + index: 31, + error: [1, 0, 0, 0], + message: Some("SendFailure") + }) + ); + + // set exact version for BridgeHubPolkadot to `2` without `ExportMessage` instruction + AssetHubKusama::force_xcm_version( + ParentThen(Parachain(BridgeHubKusama::para_id().into()).into()).into(), + xcm::v2::prelude::XCM_VERSION, + ); + // send XCM from AssetHubKusama - fails - `ExportMessage` is not in `2` + assert_err!( + send_asset_from_asset_hub_kusama(destination, (native_token, amount)), + DispatchError::Module(sp_runtime::ModuleError { + index: 31, + error: [1, 0, 0, 0], + message: Some("SendFailure") + }) + ); + } + + // set version with `ExportMessage` for BridgeHubKusama + AssetHubKusama::force_xcm_version( + ParentThen(Parachain(BridgeHubKusama::para_id().into()).into()).into(), + xcm::v3::prelude::XCM_VERSION, + ); + // send XCM from AssetHubKusama - ok + assert_ok!(send_asset_from_asset_hub_kusama(destination, (native_token, amount))); + + // `ExportMessage` on local BridgeHub - fails - remote BridgeHub version not known + assert_bridge_hub_kusama_message_accepted(false); + + // set version for remote BridgeHub on BridgeHubKusama + BridgeHubKusama::force_xcm_version( + bridge_hub_polkadot_location(), + xcm::v3::prelude::XCM_VERSION, + ); + // set version for AssetHubPolkadot on BridgeHubPolkadot + BridgeHubPolkadot::force_xcm_version( + ParentThen(Parachain(AssetHubPolkadot::para_id().into()).into()).into(), + xcm::v3::prelude::XCM_VERSION, + ); + + // send XCM from AssetHubKusama - ok + assert_ok!(send_asset_from_asset_hub_kusama(destination, (native_token, amount))); + assert_bridge_hub_kusama_message_accepted(true); + assert_bridge_hub_polkadot_message_received(); + // message delivered and processed at destination + AssetHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + AssetHubPolkadot, + vec![ + // message processed with failure, but for this scenario it is ok, important is that was delivered + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: false, .. } + ) => {}, + ] + ); + }); + + // TODO: remove this block, when removing `xcm:v2` + { + // set `2` version for remote BridgeHub on BridgeHubKusama, which does not have + // `UniversalOrigin` and `DescendOrigin` + BridgeHubKusama::force_xcm_version( + bridge_hub_polkadot_location(), + xcm::v2::prelude::XCM_VERSION, + ); + + // send XCM from AssetHubKusama - ok + assert_ok!(send_asset_from_asset_hub_kusama(destination, (native_token, amount))); + // message is not accepted on the local BridgeHub (`DestinationUnsupported`) because we + // cannot add `UniversalOrigin` and `DescendOrigin` + assert_bridge_hub_kusama_message_accepted(false); + } +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/teleport.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/teleport.rs new file mode 100644 index 0000000000..eac53a7ed2 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/teleport.rs @@ -0,0 +1,30 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::*; +use bridge_hub_kusama_runtime::xcm_config::XcmConfig; + +#[test] +fn teleport_to_other_system_parachains_works() { + let amount = BRIDGE_HUB_KUSAMA_ED * 100; + let native_asset: MultiAssets = (Parent, amount).into(); + + test_parachain_is_trusted_teleporter!( + BridgeHubKusama, // Origin + XcmConfig, // XCM configuration + vec![AssetHubKusama], // Destinations + (native_asset, amount) + ); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml new file mode 100644 index 0000000000..98b2fc0fd1 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "bridge-hub-polkadot-integration-tests" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +description = "Bridge Hub Polkadot runtime integration tests with xcm-emulator" +publish = false + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.4.0" } + +# Substrate +sp-runtime = { version = "31.0.1" } +frame-support = { version = "28.0.0" } +pallet-balances = { version = "28.0.0" } +pallet-assets = { version = "29.0.0" } +pallet-message-queue = { version = "31.0.0" } + +# Polkadot +xcm = { package = "staging-xcm", version = "7.0.0" } +pallet-xcm = { version = "7.0.0" } +xcm-executor = { package = "staging-xcm-executor", version = "7.0.3" } + +# Cumulus +emulated-integration-tests-common = { version = "3.0.0" } +parachains-common = { version = "7.0.0" } +cumulus-pallet-xcmp-queue = { version = "0.7.0" } + +# Bridges +bp-messages = { version = "0.7.0" } +pallet-bridge-messages = { version = "0.7.0" } + +# Runtimes +bridge-hub-polkadot-runtime = { path = "../../../../../system-parachains/bridge-hubs/bridge-hub-polkadot" } +integration-tests-helpers = { path = "../../../helpers" } +kusama-polkadot-system-emulated-network = { path = "../../../networks/kusama-polkadot-system" } diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs new file mode 100644 index 0000000000..2919efed42 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs @@ -0,0 +1,71 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Substrate +pub use frame_support::{assert_err, assert_ok, pallet_prelude::DispatchResult}; +pub use sp_runtime::DispatchError; + +// Polkadot +pub use xcm::{ + latest::ParentThen, + prelude::{AccountId32 as AccountId32Junction, *}, + v3::{ + Error, + NetworkId::{Kusama as KusamaId, Polkadot as PolkadotId}, + }, +}; + +// Bridges +pub use bp_messages::LaneId; + +// Cumulus +pub use emulated_integration_tests_common::{ + accounts::ALICE, + impls::Inspect, + xcm_emulator::{ + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, + }, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, +}; +pub use integration_tests_helpers::test_parachain_is_trusted_teleporter; +pub use kusama_polkadot_system_emulated_network::{ + asset_hub_kusama_emulated_chain::{ + genesis::ED as ASSET_HUB_KUSAMA_ED, AssetHubKusamaParaPallet as AssetHubKusamaPallet, + }, + asset_hub_polkadot_emulated_chain::{ + genesis::ED as ASSET_HUB_POLKADOT_ED, AssetHubPolkadotParaPallet as AssetHubPolkadotPallet, + }, + bridge_hub_polkadot_emulated_chain::{ + genesis::ED as BRIDGE_HUB_POLKADOT_ED, + BridgeHubPolkadotParaPallet as BridgeHubPolkadotPallet, + }, + polkadot_emulated_chain::PolkadotRelayPallet as PolkadotPallet, + AssetHubKusamaPara as AssetHubKusama, AssetHubKusamaParaReceiver as AssetHubKusamaReceiver, + AssetHubPolkadotPara as AssetHubPolkadot, + AssetHubPolkadotParaReceiver as AssetHubPolkadotReceiver, + AssetHubPolkadotParaSender as AssetHubPolkadotSender, BridgeHubKusamaPara as BridgeHubKusama, + BridgeHubPolkadotPara as BridgeHubPolkadot, + BridgeHubPolkadotParaSender as BridgeHubPolkadotSender, PolkadotRelay as Polkadot, +}; +pub use parachains_common::{AccountId, Balance}; + +pub const ASSET_ID: u32 = 1; +pub const ASSET_MIN_BALANCE: u128 = 1000; +pub const ASSETS_PALLET_ID: u8 = 50; + +#[cfg(test)] +mod tests; diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/asset_transfers.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/asset_transfers.rs new file mode 100644 index 0000000000..8c653c0900 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/asset_transfers.rs @@ -0,0 +1,173 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +use crate::tests::*; + +fn send_asset_from_asset_hub_polkadot_to_asset_hub_kusama(id: MultiLocation, amount: u128) { + let destination = asset_hub_kusama_location(); + + // fund the AHP's SA on BHP for paying bridge transport fees + BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), 10_000_000_000_000u128); + + // set XCM versions + AssetHubPolkadot::force_xcm_version(destination, XCM_VERSION); + BridgeHubPolkadot::force_xcm_version(bridge_hub_kusama_location(), XCM_VERSION); + + // send message over bridge + assert_ok!(send_asset_from_asset_hub_polkadot(destination, (id, amount))); + assert_bridge_hub_polkadot_message_accepted(true); + assert_bridge_hub_kusama_message_received(); +} + +#[test] +fn send_dots_from_asset_hub_polkadot_to_asset_hub_kusama() { + let dot_at_asset_hub_polkadot: MultiLocation = Parent.into(); + let dot_at_asset_hub_kusama = + MultiLocation { parents: 2, interior: X1(GlobalConsensus(NetworkId::Polkadot)) }; + let owner: AccountId = AssetHubKusama::account_id_of(ALICE); + AssetHubKusama::force_create_foreign_asset( + dot_at_asset_hub_kusama, + owner, + true, + ASSET_MIN_BALANCE, + vec![], + ); + let sov_ahk_on_ahp = AssetHubPolkadot::sovereign_account_of_parachain_on_other_global_consensus( + NetworkId::Kusama, + AssetHubKusama::para_id(), + ); + + let dots_in_reserve_on_ahp_before = + ::account_data_of(sov_ahk_on_ahp.clone()).free; + let sender_dots_before = + ::account_data_of(AssetHubPolkadotSender::get()).free; + let receiver_dots_before = AssetHubKusama::execute_with(|| { + type Assets = ::ForeignAssets; + >::balance(dot_at_asset_hub_kusama, &AssetHubKusamaReceiver::get()) + }); + + let amount = ASSET_HUB_POLKADOT_ED * 1_000; + send_asset_from_asset_hub_polkadot_to_asset_hub_kusama(dot_at_asset_hub_polkadot, amount); + AssetHubKusama::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + AssetHubKusama, + vec![ + // issue DOTs on AHK + RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { + asset_id: *asset_id == dot_at_asset_hub_kusama, + owner: *owner == AssetHubKusamaReceiver::get(), + }, + // message processed successfully + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + }); + + let sender_dots_after = + ::account_data_of(AssetHubPolkadotSender::get()).free; + let receiver_dots_after = AssetHubKusama::execute_with(|| { + type Assets = ::ForeignAssets; + >::balance(dot_at_asset_hub_kusama, &AssetHubKusamaReceiver::get()) + }); + let dots_in_reserve_on_ahp_after = + ::account_data_of(sov_ahk_on_ahp).free; + + // Sender's balance is reduced + assert!(sender_dots_before > sender_dots_after); + // Receiver's balance is increased + assert!(receiver_dots_after > receiver_dots_before); + // Reserve balance is increased by sent amount + assert_eq!(dots_in_reserve_on_ahp_after, dots_in_reserve_on_ahp_before + amount); +} + +#[test] +fn send_ksms_from_asset_hub_polkadot_to_asset_hub_kusama() { + let prefund_amount = 10_000_000_000_000u128; + let ksm_at_asset_hub_polkadot = + MultiLocation { parents: 2, interior: X1(GlobalConsensus(NetworkId::Kusama)) }; + let owner: AccountId = AssetHubPolkadot::account_id_of(ALICE); + AssetHubPolkadot::force_create_foreign_asset( + ksm_at_asset_hub_polkadot, + owner, + true, + ASSET_MIN_BALANCE, + vec![(AssetHubPolkadotSender::get(), prefund_amount)], + ); + + // fund the AHP's SA on AHK with the KSM tokens held in reserve + let sov_ahp_on_ahk = AssetHubKusama::sovereign_account_of_parachain_on_other_global_consensus( + NetworkId::Polkadot, + AssetHubPolkadot::para_id(), + ); + AssetHubKusama::fund_accounts(vec![(sov_ahp_on_ahk.clone(), prefund_amount)]); + + let ksms_in_reserve_on_ahk_before = + ::account_data_of(sov_ahp_on_ahk.clone()).free; + assert_eq!(ksms_in_reserve_on_ahk_before, prefund_amount); + let sender_ksms_before = AssetHubPolkadot::execute_with(|| { + type Assets = ::ForeignAssets; + >::balance(ksm_at_asset_hub_polkadot, &AssetHubPolkadotSender::get()) + }); + assert_eq!(sender_ksms_before, prefund_amount); + let receiver_ksms_before = + ::account_data_of(AssetHubKusamaReceiver::get()).free; + + let amount_to_send = ASSET_HUB_KUSAMA_ED * 1_000; + send_asset_from_asset_hub_polkadot_to_asset_hub_kusama( + ksm_at_asset_hub_polkadot, + amount_to_send, + ); + AssetHubKusama::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + AssetHubKusama, + vec![ + // KSM is withdrawn from AHP's SA on AHK + RuntimeEvent::Balances( + pallet_balances::Event::Burned { who, amount } + ) => { + who: *who == sov_ahp_on_ahk, + amount: *amount == amount_to_send, + }, + // KSMs deposited to beneficiary + RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { + who: *who == AssetHubKusamaReceiver::get(), + }, + // message processed successfully + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + }); + + let sender_ksms_after = AssetHubPolkadot::execute_with(|| { + type Assets = ::ForeignAssets; + >::balance(ksm_at_asset_hub_polkadot, &AssetHubPolkadotSender::get()) + }); + let receiver_ksms_after = + ::account_data_of(AssetHubKusamaReceiver::get()).free; + let ksms_in_reserve_on_ahk_after = + ::account_data_of(sov_ahp_on_ahk.clone()).free; + + // Sender's balance is reduced + assert!(sender_ksms_before > sender_ksms_after); + // Receiver's balance is increased + assert!(receiver_ksms_after > receiver_ksms_before); + // Reserve balance is reduced by sent amount + assert_eq!(ksms_in_reserve_on_ahk_after, ksms_in_reserve_on_ahk_before - amount_to_send); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs new file mode 100644 index 0000000000..e53c1ff66a --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs @@ -0,0 +1,114 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::*; + +mod asset_transfers; +mod send_xcm; +mod teleport; + +pub(crate) fn asset_hub_kusama_location() -> MultiLocation { + MultiLocation { + parents: 2, + interior: X2( + GlobalConsensus(NetworkId::Kusama), + Parachain(AssetHubKusama::para_id().into()), + ), + } +} + +pub(crate) fn bridge_hub_kusama_location() -> MultiLocation { + MultiLocation { + parents: 2, + interior: X2( + GlobalConsensus(NetworkId::Kusama), + Parachain(BridgeHubKusama::para_id().into()), + ), + } +} + +pub(crate) fn send_asset_from_asset_hub_polkadot( + destination: MultiLocation, + (id, amount): (MultiLocation, u128), +) -> DispatchResult { + let signed_origin = + ::RuntimeOrigin::signed(AssetHubPolkadotSender::get().into()); + + let beneficiary: MultiLocation = + AccountId32Junction { network: None, id: AssetHubKusamaReceiver::get().into() }.into(); + + let assets: MultiAssets = (id, amount).into(); + let fee_asset_item = 0; + + AssetHubPolkadot::execute_with(|| { + ::PolkadotXcm::limited_reserve_transfer_assets( + signed_origin, + bx!(destination.into()), + bx!(beneficiary.into()), + bx!(assets.into()), + fee_asset_item, + WeightLimit::Unlimited, + ) + }) +} + +pub(crate) fn assert_bridge_hub_polkadot_message_accepted(expected_processed: bool) { + BridgeHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + if expected_processed { + assert_expected_events!( + BridgeHubPolkadot, + vec![ + // pay for bridge fees + RuntimeEvent::Balances(pallet_balances::Event::Burned { .. }) => {}, + // message exported + RuntimeEvent::BridgeKusamaMessages( + pallet_bridge_messages::Event::MessageAccepted { .. } + ) => {}, + // message processed successfully + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + } else { + assert_expected_events!( + BridgeHubPolkadot, + vec![ + RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { + success: false, + .. + }) => {}, + ] + ); + } + }); +} + +pub(crate) fn assert_bridge_hub_kusama_message_received() { + BridgeHubKusama::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + BridgeHubKusama, + vec![ + // message sent to destination + RuntimeEvent::XcmpQueue( + cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. } + ) => {}, + ] + ); + }) +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs new file mode 100644 index 0000000000..ef30c0b758 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs @@ -0,0 +1,177 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::tests::*; + +#[test] +fn send_xcm_from_polkadot_relay_to_kusama_asset_hub_should_fail_on_not_applicable() { + // Init tests variables + // XcmPallet send arguments + let sudo_origin = ::RuntimeOrigin::root(); + let destination = Polkadot::child_location_of(BridgeHubPolkadot::para_id()).into(); + let weight_limit = WeightLimit::Unlimited; + let check_origin = None; + + let remote_xcm = Xcm(vec![ClearOrigin]); + + let xcm = VersionedXcm::from(Xcm(vec![ + UnpaidExecution { weight_limit, check_origin }, + ExportMessage { + network: KusamaId, + destination: X1(Parachain(AssetHubKusama::para_id().into())), + xcm: remote_xcm, + }, + ])); + + // Polkadot Global Consensus + // Send XCM message from Relay Chain to Bridge Hub source Parachain + Polkadot::execute_with(|| { + assert_ok!(::XcmPallet::send( + sudo_origin, + bx!(destination), + bx!(xcm), + )); + + type RuntimeEvent = ::RuntimeEvent; + + assert_expected_events!( + Polkadot, + vec![ + RuntimeEvent::XcmPallet(pallet_xcm::Event::Sent { .. }) => {}, + ] + ); + }); + // Receive XCM message in Bridge Hub source Parachain, it should fail, because we don't have + // opened bridge/lane. + assert_bridge_hub_polkadot_message_accepted(false); +} + +#[test] +fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { + // Initially set only default version on all runtimes + AssetHubKusama::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); + BridgeHubKusama::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); + BridgeHubPolkadot::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); + AssetHubPolkadot::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); + + // prepare data + let destination = asset_hub_kusama_location(); + let native_token = MultiLocation::parent(); + let amount = ASSET_HUB_POLKADOT_ED * 1_000; + + // fund the AHK's SA on BHK for paying bridge transport fees + BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), 10_000_000_000_000u128); + // fund sender + AssetHubPolkadot::fund_accounts(vec![(AssetHubPolkadotSender::get().into(), amount * 10)]); + + // send XCM from AssetHubPolkadot - fails - destination version not known + assert_err!( + send_asset_from_asset_hub_polkadot(destination, (native_token, amount)), + DispatchError::Module(sp_runtime::ModuleError { + index: 31, + error: [1, 0, 0, 0], + message: Some("SendFailure") + }) + ); + + // set destination version + AssetHubPolkadot::force_xcm_version(destination, xcm::v3::prelude::XCM_VERSION); + + // TODO: remove this block, when removing `xcm:v2` + { + // send XCM from AssetHubKusama - fails - AssetHubKusama is set to the default/safe `2` + // version, which does not have the `ExportMessage` instruction. If the default `2` is + // changed to `3`, then this assert can go away" + assert_err!( + send_asset_from_asset_hub_polkadot(destination, (native_token, amount)), + DispatchError::Module(sp_runtime::ModuleError { + index: 31, + error: [1, 0, 0, 0], + message: Some("SendFailure") + }) + ); + + // set exact version for BridgeHubPolkadot to `2` without `ExportMessage` instruction + AssetHubPolkadot::force_xcm_version( + ParentThen(Parachain(BridgeHubPolkadot::para_id().into()).into()).into(), + xcm::v2::prelude::XCM_VERSION, + ); + // send XCM from AssetHubPolkadot - fails - `ExportMessage` is not in `2` + assert_err!( + send_asset_from_asset_hub_polkadot(destination, (native_token, amount)), + DispatchError::Module(sp_runtime::ModuleError { + index: 31, + error: [1, 0, 0, 0], + message: Some("SendFailure") + }) + ); + } + + // set version with `ExportMessage` for BridgeHubPolkadot + AssetHubPolkadot::force_xcm_version( + ParentThen(Parachain(BridgeHubPolkadot::para_id().into()).into()).into(), + xcm::v3::prelude::XCM_VERSION, + ); + // send XCM from AssetHubPolkadot - ok + assert_ok!(send_asset_from_asset_hub_polkadot(destination, (native_token, amount))); + + // `ExportMessage` on local BridgeHub - fails - remote BridgeHub version not known + assert_bridge_hub_polkadot_message_accepted(false); + + // set version for remote BridgeHub on BridgeHubPolkadot + BridgeHubPolkadot::force_xcm_version( + bridge_hub_kusama_location(), + xcm::v3::prelude::XCM_VERSION, + ); + // set version for AssetHubKusama on BridgeHubKusama + BridgeHubKusama::force_xcm_version( + ParentThen(Parachain(AssetHubKusama::para_id().into()).into()).into(), + xcm::v3::prelude::XCM_VERSION, + ); + + // send XCM from AssetHubPolkadot - ok + assert_ok!(send_asset_from_asset_hub_polkadot(destination, (native_token, amount))); + assert_bridge_hub_polkadot_message_accepted(true); + assert_bridge_hub_kusama_message_received(); + // message delivered and processed at destination + AssetHubKusama::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + assert_expected_events!( + AssetHubKusama, + vec![ + // message processed with failure, but for this scenario it is ok, important is that was delivered + RuntimeEvent::MessageQueue( + pallet_message_queue::Event::Processed { success: false, .. } + ) => {}, + ] + ); + }); + + // TODO: remove this block, when removing `xcm:v2` + { + // set `2` version for remote BridgeHub on BridgeHubKusama, which does not have + // `UniversalOrigin` and `DescendOrigin` + BridgeHubPolkadot::force_xcm_version( + bridge_hub_kusama_location(), + xcm::v2::prelude::XCM_VERSION, + ); + + // send XCM from AssetHubPolkadot - ok + assert_ok!(send_asset_from_asset_hub_polkadot(destination, (native_token, amount))); + // message is not accepted on the local BridgeHub (`DestinationUnsupported`) because we + // cannot add `UniversalOrigin` and `DescendOrigin` + assert_bridge_hub_polkadot_message_accepted(false); + } +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/teleport.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/teleport.rs new file mode 100644 index 0000000000..eb915c3110 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/teleport.rs @@ -0,0 +1,30 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::*; +use bridge_hub_polkadot_runtime::xcm_config::XcmConfig; + +#[test] +fn teleport_to_other_system_parachains_works() { + let amount = BRIDGE_HUB_POLKADOT_ED * 100; + let native_asset: MultiAssets = (Parent, amount).into(); + + test_parachain_is_trusted_teleporter!( + BridgeHubPolkadot, // Origin + XcmConfig, // XCM configuration + vec![AssetHubPolkadot], // Destinations + (native_asset, amount) + ); +}