From 7de041023d57921b2a91cb0a70e14475ca4e4bc5 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Sat, 27 Jul 2024 14:24:37 +0100 Subject: [PATCH 1/5] refactor: migrate integration tests to paseo --- Cargo.lock | 383 +++++++++++------- Cargo.toml | 38 +- integration-tests/Cargo.toml | 24 +- .../src/chains/asset_hub_paseo/genesis.rs | 60 +++ .../src/chains/asset_hub_paseo/mod.rs | 39 ++ .../src/chains/asset_hub_rococo/genesis.rs | 52 --- .../src/chains/asset_hub_rococo/mod.rs | 39 -- integration-tests/src/chains/mod.rs | 4 +- .../src/chains/{rococo => paseo}/genesis.rs | 28 +- integration-tests/src/chains/paseo/mod.rs | 32 ++ .../src/chains/pop_network/mod.rs | 4 +- integration-tests/src/chains/rococo/mod.rs | 32 -- integration-tests/src/lib.rs | 340 ++++++++-------- 13 files changed, 583 insertions(+), 492 deletions(-) create mode 100644 integration-tests/src/chains/asset_hub_paseo/genesis.rs create mode 100644 integration-tests/src/chains/asset_hub_paseo/mod.rs delete mode 100644 integration-tests/src/chains/asset_hub_rococo/genesis.rs delete mode 100644 integration-tests/src/chains/asset_hub_rococo/mod.rs rename integration-tests/src/chains/{rococo => paseo}/genesis.rs (66%) create mode 100644 integration-tests/src/chains/paseo/mod.rs delete mode 100644 integration-tests/src/chains/rococo/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 4dc89da6..4179ad37 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -425,16 +425,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] -name = "asset-hub-rococo-runtime" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e80dcb69497d50ceef11a046720e1c5a0feeb5575239c5ccb4b0be14a49bcfa" +name = "asset-hub-paseo-runtime" +version = "1.0.0" +source = "git+https://github.com/paseo-network/runtimes/?tag=v1.2.5-system-chains#e7265b10b28d8b82c3146e72c98895dac2b55729" dependencies = [ "assets-common", - "bp-asset-hub-rococo", - "bp-asset-hub-westend", - "bp-bridge-hub-rococo", - "bp-bridge-hub-westend", + "bp-asset-hub-paseo", + "bp-bridge-hub-paseo", "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", "cumulus-pallet-session-benchmarking", @@ -445,6 +442,7 @@ dependencies = [ "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -461,12 +459,10 @@ dependencies = [ "pallet-collator-selection", "pallet-message-queue", "pallet-multisig", - "pallet-nft-fractionalization", "pallet-nfts", "pallet-nfts-runtime-api", "pallet-proxy", "pallet-session", - "pallet-state-trie-migration", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", @@ -477,10 +473,11 @@ dependencies = [ "pallet-xcm-bridge-hub-router", "parachains-common", "parity-scale-codec", + "paseo-runtime-constants", + "polkadot-core-primitives", "polkadot-parachain-primitives", "polkadot-runtime-common", "primitive-types", - "rococo-runtime-constants", "scale-info", "snowbridge-router-primitives", "sp-api", @@ -489,6 +486,7 @@ dependencies = [ "sp-core", "sp-genesis-builder", "sp-inherents", + "sp-io", "sp-offchain", "sp-runtime", "sp-session", @@ -502,7 +500,7 @@ dependencies = [ "staging-xcm-builder", "staging-xcm-executor", "substrate-wasm-builder", - "testnet-parachains-constants", + "system-parachains-constants", ] [[package]] @@ -1080,27 +1078,14 @@ dependencies = [ ] [[package]] -name = "bp-asset-hub-rococo" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbc4a97cc234685179ffb0b756e6a906acdae59e749e7b2202872da2c08478" -dependencies = [ - "bp-xcm-bridge-hub-router", - "frame-support", - "parity-scale-codec", - "scale-info", -] - -[[package]] -name = "bp-asset-hub-westend" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eebe84c84f20d5147df985ff74d47f264628e14614c836e1230c688b9476462" +name = "bp-asset-hub-paseo" +version = "1.0.0" +source = "git+https://github.com/paseo-network/runtimes/?tag=v1.2.5-system-chains#e7265b10b28d8b82c3146e72c98895dac2b55729" dependencies = [ - "bp-xcm-bridge-hub-router", "frame-support", - "parity-scale-codec", - "scale-info", + "sp-std", + "staging-xcm", + "system-parachains-constants", ] [[package]] @@ -1120,33 +1105,21 @@ dependencies = [ ] [[package]] -name = "bp-bridge-hub-rococo" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a9fd41ffa36ae08acf7da242a023703a7a6162d8aa2b8c06593f48f0c6c771" -dependencies = [ - "bp-bridge-hub-cumulus", - "bp-messages", - "bp-runtime", - "frame-support", - "sp-api", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "bp-bridge-hub-westend" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b65039a3c5aa8652f3dad6a2d6dc3948eff24333a30f2528bc34fc406e38819" +name = "bp-bridge-hub-paseo" +version = "1.0.0" +source = "git+https://github.com/paseo-network/runtimes/?tag=v1.2.5-system-chains#e7265b10b28d8b82c3146e72c98895dac2b55729" dependencies = [ "bp-bridge-hub-cumulus", "bp-messages", "bp-runtime", "frame-support", + "parity-scale-codec", + "scale-info", + "snowbridge-core", "sp-api", "sp-runtime", "sp-std", + "staging-xcm", ] [[package]] @@ -2869,6 +2842,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-syn-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -2973,21 +2957,21 @@ dependencies = [ [[package]] name = "docify" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc4fd38aaa9fb98ac70794c82a00360d1e165a87fbf96a8a91f9dfc602aaee2" +checksum = "43a2f138ad521dc4a2ced1a4576148a6a610b4c5923933b062a263130a6802ce" dependencies = [ "docify_macros", ] [[package]] name = "docify_macros" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63fa215f3a0d40fb2a221b3aa90d8e1fbb8379785a990cb60d62ac71ebdc6460" +checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" dependencies = [ "common-path", - "derive-syn-parse", + "derive-syn-parse 0.2.0", "once_cell", "proc-macro2", "quote", @@ -3736,6 +3720,22 @@ dependencies = [ "serde", ] +[[package]] +name = "frame-metadata-hash-extension" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb1eec9eb46d3e016c95b2fa875118c04609f2150013c56a894cae00581e265" +dependencies = [ + "array-bytes 6.2.2", + "docify", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + [[package]] name = "frame-remote-externalities" version = "0.36.0" @@ -3761,9 +3761,9 @@ dependencies = [ [[package]] name = "frame-support" -version = "29.0.0" +version = "29.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b24824d29c43d0af94be3356bbf30338ededed649f6841d315a9ae067ce872" +checksum = "b8e52c84b611d2049d9253f83a62ab0f093e4be5c42a7ef42ea5bb16d6611e32" dependencies = [ "aquamarine", "array-bytes 6.2.2", @@ -3809,7 +3809,7 @@ checksum = "3bf1d648c4007d421b9677b3c893256913498fff159dc2d85022cdd9cc432f3c" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse", + "derive-syn-parse 0.1.5", "expander 2.1.0", "frame-support-procedural-tools", "itertools 0.10.5", @@ -4448,7 +4448,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.13", - "socket2 0.4.10", + "socket2 0.5.6", "tokio", "tower-service", "tracing", @@ -4482,7 +4482,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core", ] [[package]] @@ -4695,7 +4695,7 @@ dependencies = [ name = "integration-tests" version = "0.0.0" dependencies = [ - "asset-hub-rococo-runtime", + "asset-hub-paseo-runtime", "asset-test-utils", "cumulus-primitives-core", "emulated-integration-tests-common", @@ -4705,13 +4705,14 @@ dependencies = [ "pallet-message-queue", "pallet-xcm", "parity-scale-codec", + "paseo-runtime", + "paseo-runtime-constants", "polkadot-primitives", "polkadot-runtime-parachains", "pop-runtime-common", "pop-runtime-devnet", - "rococo-runtime", - "rococo-runtime-constants", "sp-authority-discovery", + "sp-consensus-aura", "sp-consensus-babe", "sp-consensus-beefy", "sp-consensus-grandpa", @@ -5815,7 +5816,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" dependencies = [ "const-random", - "derive-syn-parse", + "derive-syn-parse 0.1.5", "macro_magic_core_macros", "proc-macro2", "quote", @@ -6763,9 +6764,9 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "29.0.0" +version = "29.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942007f4f7aace74b77009db1675e7ca98683a42dde5e2d85bba2a9f404d2e5a" +checksum = "a9a54b5d0c7c4c3731883d6b1ac18aff44db20c3d0a3470c8861001a17afdc85" dependencies = [ "docify", "frame-benchmarking", @@ -6930,14 +6931,15 @@ dependencies = [ [[package]] name = "pallet-broker" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd8cfe04e8c3f9ca8342ac785f2b1aee6140e1809546fc6f3a99fad20a8dfbf9" +checksum = "574c52fd629191c374c24a18036acac008ea92142309e5dd05e7f03149a667c3" dependencies = [ "bitvec", "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-arithmetic", @@ -6968,15 +6970,16 @@ dependencies = [ [[package]] name = "pallet-collator-selection" -version = "10.0.0" +version = "10.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5ad46601c613396e92292a24c5b5d76e904c456ece9deb10913f6ea2e2999" +checksum = "a36858c4275b7d19671b321e95f545e07c9643f97dffed1b333774cb391a4456" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", "pallet-authorship", + "pallet-balances", "pallet-session", "parity-scale-codec", "rand", @@ -7203,9 +7206,9 @@ dependencies = [ [[package]] name = "pallet-identity" -version = "29.0.0" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e1cae19e30e7dc822c419988b30bb1318d79a8d5da92733822d0e84fe760ca" +checksum = "452bba25325b7f0148eeecbde13e7c26dfb677ad46b3f160b359d7643b44c94b" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7401,9 +7404,9 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" -version = "26.0.0" +version = "26.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f14519c1c613d2f8c95c27015864c11a37969a23deeba9f6dbaff4276e1b81c" +checksum = "b62091305ec7426e71c3da2b0944c2df5a804109ee4d2e8f4fe34865e049f8ac" dependencies = [ "frame-support", "frame-system", @@ -7682,9 +7685,9 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "29.0.0" +version = "29.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a94127295cf027a26e933ea6788b0824e9fedd90740013673e2d36b5d707efe" +checksum = "061b00814eb794a40df4eca7972a7c67b26473cd85cc7c54f5816ae49ad6e11b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7728,9 +7731,9 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" -version = "15.0.0" +version = "15.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237d7b5a10cb6cba727c3e957fb241776302aa3cce589e6759ba53f50129c1a5" +checksum = "e47c73850103db30b61ef170107afe1ef0dab6905c495bd6dfb57b3c1dd81bc7" dependencies = [ "parity-scale-codec", "sp-api", @@ -7815,9 +7818,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "29.0.0" +version = "29.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f690f5c287ad34b28ca951ef7fae80b08cc9218d970723b7a70e4d29396872" +checksum = "5a5ba71f06f09e955b80dc313c333be3f8d9e8505b051558e0b7af4806b13310" dependencies = [ "frame-support", "frame-system", @@ -7862,9 +7865,9 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "28.0.0" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1605eb5083a2cd172544f33c6e59eca2e23ac49f02f13d1562b1b8a409df9c60" +checksum = "3eca44990d0d759213744f2d1f6fe1fadec1079a3e4e4da40556d6b4e42abbcd" dependencies = [ "docify", "frame-benchmarking", @@ -7947,9 +7950,9 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "8.0.1" +version = "8.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0bade2eb6ce40af35a5af150692b4e150638f7f68c15735ab9cdf79650d68e" +checksum = "ba9138b04168b07b1aff4a2079f5514753c31dddba40e5fb471b9cda7da27ad6" dependencies = [ "bounded-collections 0.2.0", "frame-benchmarking", @@ -8011,9 +8014,9 @@ dependencies = [ [[package]] name = "parachains-common" -version = "8.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34aa00981a24a2b772afaa49e258f9bcd6bb372db060a05614becc1c74d4456" +checksum = "711a4c073e7c83aac7e414ba16c7c641d6d9e22e6d32f9775ff35b2464ffd7ff" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", @@ -8101,9 +8104,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -8116,11 +8119,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -8227,6 +8230,116 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" +[[package]] +name = "paseo-runtime" +version = "1.2.5" +source = "git+https://github.com/paseo-network/runtimes/?tag=v1.2.5-system-chains#e7265b10b28d8b82c3146e72c98895dac2b55729" +dependencies = [ + "binary-merkle-tree", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-metadata-hash-extension", + "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-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-state-trie-migration", + "pallet-sudo", + "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", + "paseo-runtime-constants", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "scale-info", + "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-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", +] + +[[package]] +name = "paseo-runtime-constants" +version = "1.0.0" +source = "git+https://github.com/paseo-network/runtimes/?tag=v1.2.5-system-chains#e7265b10b28d8b82c3146e72c98895dac2b55729" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec", + "sp-core", + "sp-runtime", + "sp-weights", + "staging-xcm-builder", +] + [[package]] name = "paste" version = "1.0.14" @@ -9243,9 +9356,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "8.0.1" +version = "8.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06afbb3bd10245ad1907242a98ddffc3c0c1e209738b8382bc5bcfc1f28c0429" +checksum = "12a70422ca43d30457e2d9502a5e4af35e20fa2ff3f7cd46e0d2997c784f2665" dependencies = [ "bitvec", "frame-benchmarking", @@ -9309,9 +9422,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "8.0.1" +version = "8.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bcfd672be236fd1c38c702e7e99fe3f3e54df0ddb8127e542423221d1f50669" +checksum = "b8d37cd3e014b06daf396d1483b5327782a0ebadc816423419665166b75b3e3e" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -9944,15 +10057,6 @@ dependencies = [ "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.7", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -13025,9 +13129,9 @@ dependencies = [ [[package]] name = "sp-api" -version = "27.0.0" +version = "27.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef42aa652381ade883c14ffbbb5c0fec36d382d2217b5bace01b8a0e8634778" +checksum = "2e4f8702afd77f14a32733e2b589c02694bf79d0b3a641963c508016208724d0" dependencies = [ "hash-db", "log", @@ -13047,9 +13151,9 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "15.0.0" +version = "15.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0694be2891593450916d6b53a274d234bccbc86bcbada36ba23fc356989070c7" +checksum = "0301e2f77afb450fbf2b093f8b324c7ad88cc82e5e69bd5dc8658a1f068b2a96" dependencies = [ "Inflector", "blake2 0.10.6", @@ -13946,9 +14050,9 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "8.0.1" +version = "8.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f6cfc27c1d45f9a67e20ed3f7e60296299688825350291606add10bf3bbff2" +checksum = "78b7447c38be3ca9fb21c7434de2243aa6ac74acde8944cda7bb6e2a4f765801" dependencies = [ "frame-support", "frame-system", @@ -13969,9 +14073,9 @@ dependencies = [ [[package]] name = "staging-xcm-executor" -version = "8.0.1" +version = "8.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a638f4c8735cc04b5c93920a1f59e679f48b131315a07d146798e0decebf7720" +checksum = "74b5c5f2a1d610c5e20e5fae2680c9a28380f305afafeed62f341bfbce57b79a" dependencies = [ "environmental", "frame-benchmarking", @@ -14175,9 +14279,9 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "18.0.0" +version = "18.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "511bbc2df035f5fe2556d855369a1bbb45df620360391a1f6e3fa1a1d64af79a" +checksum = "4a39a20e17c24ede36b5bd5e7543a4cef8d8a0daf6e1a046dc31832b837a54a0" dependencies = [ "build-helper", "cargo_metadata", @@ -14389,6 +14493,20 @@ dependencies = [ "libc", ] +[[package]] +name = "system-parachains-constants" +version = "1.0.0" +source = "git+https://github.com/paseo-network/runtimes/?tag=v1.2.5-system-chains#e7265b10b28d8b82c3146e72c98895dac2b55729" +dependencies = [ + "frame-support", + "parachains-common", + "paseo-runtime-constants", + "polkadot-core-primitives", + "polkadot-primitives", + "smallvec", + "sp-runtime", +] + [[package]] name = "tap" version = "1.0.1" @@ -14438,21 +14556,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" -[[package]] -name = "testnet-parachains-constants" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ff23c25f39d64b930ab9d721643d0c780a66201c7f1da34fac6982752626bf5" -dependencies = [ - "frame-support", - "polkadot-core-primitives", - "rococo-runtime-constants", - "smallvec", - "sp-runtime", - "staging-xcm", - "westend-runtime-constants", -] - [[package]] name = "thiserror" version = "1.0.58" @@ -14737,17 +14840,6 @@ dependencies = [ "winnow 0.5.40", ] -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -15880,7 +15972,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core 0.51.1", + "windows-core", "windows-targets 0.48.5", ] @@ -15893,15 +15985,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.4", -] - [[package]] name = "windows-sys" version = "0.45.0" diff --git a/Cargo.toml b/Cargo.toml index 3f1d6e1c..1b1bcd7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,12 +47,12 @@ subxt-signer = "0.34.0" tokio = { version = "1.36", features = ["macros", "time", "rt-multi-thread"] } # Build -substrate-wasm-builder = "18.0.0" +substrate-wasm-builder = "18.0.1" substrate-build-script-utils = "11.0.0" # Local -pop-runtime-devnet = { path = "runtime/devnet", default-features = true } # default-features=true required for `-p pop-node` builds -pop-runtime-testnet = { path = "runtime/testnet", default-features = true } # default-features=true required for `-p pop-node` builds +pop-runtime-devnet = { path = "runtime/devnet", default-features = true, features = ["experimental"] } # default-features=true required for `-p pop-node` builds +pop-runtime-testnet = { path = "runtime/testnet", default-features = true, features = ["experimental"] } # default-features=true required for `-p pop-node` builds pop-runtime-common = { path = "runtime/common", default-features = false } pop-primitives = { path = "./primitives", default-features = false } @@ -76,7 +76,7 @@ sc-transaction-pool-api = "29.0.0" frame-benchmarking = { version = "29.0.0", default-features = false } frame-benchmarking-cli = "33.0.0" frame-executive = { version = "29.0.0", default-features = false } -frame-support = { version = "29.0.0", default-features = false } +frame-support = { version = "29.0.2", default-features = false } frame-system = { version = "29.0.0", default-features = false } frame-system-benchmarking = { version = "29.0.0", default-features = false } frame-system-rpc-runtime-api = { version = "27.0.0", default-features = false } @@ -84,7 +84,7 @@ frame-try-runtime = { version = "0.35.0", default-features = false } pallet-aura = { version = "28.0.0", default-features = false } pallet-authorship = { version = "29.0.0", default-features = false } pallet-assets = { version = "30.0.0", default-features = false } -pallet-balances = { version = "29.0.0", default-features = false } +pallet-balances = { version = "29.0.2", default-features = false } pallet-contracts = { version = "28.0.0", default-features = false } pallet-message-queue = { version = "32.0.0", default-features = false } pallet-multisig = { version = "29.0.0", default-features = false } @@ -97,11 +97,11 @@ pallet-scheduler = { version = "30.0.0", default-features = false } pallet-session = { version = "29.0.0", default-features = false } pallet-sudo = { version = "29.0.0", default-features = false } pallet-timestamp = { version = "28.0.0", default-features = false } -pallet-transaction-payment = { version = "29.0.0", default-features = false } +pallet-transaction-payment = { version = "29.0.2", default-features = false } pallet-transaction-payment-rpc = "31.0.0" pallet-transaction-payment-rpc-runtime-api = { version = "29.0.0", default-features = false } pallet-utility = { version = "29.0.0", default-features = false } -sp-api = { version = "27.0.0", default-features = false } +sp-api = { version = "27.0.1", default-features = false } sp-authority-discovery = { version = "27.0.0", default-features = false } sp-block-builder = { version = "27.0.0", default-features = false } sp-blockchain = "29.0.0" @@ -125,20 +125,17 @@ sp-transaction-pool = { version = "27.0.0", default-features = false } sp-version = { version = "30.0.0", default-features = false } # Polkadot -pallet-xcm = { version = "=8.0.1", default-features = false } +pallet-xcm = { version = "8.0.5", default-features = false } polkadot-cli = "8.0.0" polkadot-parachain-primitives = { version = "7.0.0", default-features = false } -polkadot-runtime-parachains = { version = "8.0.1", default-features = false } +polkadot-runtime-parachains = { version = "8.0.3", default-features = false } polkadot-primitives = { version = "8.0.1", default-features = false } -polkadot-runtime-common = { version = "8.0.1", default-features = false } -rococo-runtime-constants = { version = "8.0.0", default-features = false } -rococo-runtime = { version = "8.0.0", default-features = false } +polkadot-runtime-common = { version = "8.0.3", default-features = false } xcm = { package = "staging-xcm", version = "8.0.1", default-features = false } -xcm-builder = { package = "staging-xcm-builder", version = "8.0.1", default-features = false } -xcm-executor = { package = "staging-xcm-executor", version = "8.0.1", default-features = false } +xcm-builder = { package = "staging-xcm-builder", version = "8.0.3", default-features = false } +xcm-executor = { package = "staging-xcm-executor", version = "8.0.2", default-features = false } # Cumulus -asset-hub-rococo-runtime = { version = "0.12.0", default-features = false } asset-test-utils = { version = "8.0.1", default-features = false } cumulus-pallet-aura-ext = { version = "0.8.0", default-features = false } cumulus-pallet-parachain-system = { version = "0.8.1", default-features = false, features = ["parameterized-consensus-hook"] } @@ -149,8 +146,8 @@ cumulus-primitives-aura = { version = "0.8.0", default-features = false } cumulus-primitives-core = { version = "0.8.0", default-features = false } cumulus-primitives-utility = { version = "0.8.1", default-features = false } emulated-integration-tests-common = { version = "4.0.0", default-features = false } -pallet-collator-selection = { version = "10.0.0", default-features = false } -parachains-common = { version = "8.0.0", default-features = false } +pallet-collator-selection = { version = "10.0.3", default-features = false } +parachains-common = { version = "8.0.1", default-features = false } parachain-info = { package = "staging-parachain-info", version = "0.8.0", default-features = false } cumulus-primitives-parachain-inherent = "0.8.0" cumulus-relay-chain-interface = "0.8.0" @@ -160,4 +157,9 @@ cumulus-client-collator = "0.8.0" cumulus-client-consensus-aura = "0.8.0" cumulus-client-consensus-common = "0.8.0" cumulus-client-consensus-proposer = "0.8.0" -cumulus-client-service = "0.8.0" \ No newline at end of file +cumulus-client-service = "0.8.0" + +# Paseo +asset-hub-paseo-runtime = { git = "https://github.com/paseo-network/runtimes/", tag = "v1.2.5-system-chains", default-features = false } +paseo-runtime = { git = "https://github.com/paseo-network/runtimes/", tag = "v1.2.5-system-chains", default-features = false } +paseo-runtime-constants = { git = "https://github.com/paseo-network/runtimes/", tag = "v1.2.5-system-chains", default-features = false } \ No newline at end of file diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 03178735..0a427f8a 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -17,6 +17,7 @@ pallet-balances.workspace = true pallet-message-queue.workspace = true sp-core.workspace = true sp-authority-discovery.workspace = true +sp-consensus-aura.workspace = true sp-consensus-babe.workspace = true sp-consensus-beefy.workspace = true sp-consensus-grandpa.workspace = true @@ -24,19 +25,21 @@ sp-runtime.workspace = true # Polkadot polkadot-primitives.workspace = true -rococo-runtime-constants.workspace = true -rococo-runtime.workspace = true xcm.workspace = true xcm-executor.workspace = true polkadot-runtime-parachains.workspace = true pallet-xcm.workspace = true # Cumulus -asset-hub-rococo-runtime.workspace = true asset-test-utils.workspace = true cumulus-primitives-core.workspace = true emulated-integration-tests-common.workspace = true +# Paseo +asset-hub-paseo-runtime.workspace = true +paseo-runtime.workspace = true +paseo-runtime-constants.workspace = true + # Local pop-runtime-devnet.workspace = true pop-runtime-common.workspace = true @@ -44,19 +47,20 @@ pop-runtime-common.workspace = true [features] default = ["std"] std = [ - "asset-hub-rococo-runtime/std", + "asset-hub-paseo-runtime/std", "cumulus-primitives-core/std", "frame-support/std", "pallet-assets/std", "pallet-balances/std", "pallet-message-queue/std", "pallet-xcm/std", + "paseo-runtime/std", + "paseo-runtime-constants/std", "polkadot-primitives/std", "polkadot-runtime-parachains/std", "pop-runtime-devnet/std", - "rococo-runtime-constants/std", - "rococo-runtime/std", "sp-authority-discovery/std", + "sp-consensus-aura/std", "sp-consensus-babe/std", "sp-consensus-beefy/std", "sp-consensus-grandpa/std", @@ -67,26 +71,26 @@ std = [ ] runtime-benchmarks = [ - "asset-hub-rococo-runtime/runtime-benchmarks", + "asset-hub-paseo-runtime/runtime-benchmarks", "cumulus-primitives-core/runtime-benchmarks", "frame-support/runtime-benchmarks", "pallet-assets/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-message-queue/runtime-benchmarks", + "paseo-runtime/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "pop-runtime-devnet/runtime-benchmarks", - "rococo-runtime/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-executor/runtime-benchmarks", ] try-runtime = [ - "asset-hub-rococo-runtime/try-runtime", + "asset-hub-paseo-runtime/try-runtime", "frame-support/try-runtime", "pallet-assets/try-runtime", "pallet-balances/std", "pallet-message-queue/try-runtime", + "paseo-runtime/try-runtime", "pop-runtime-devnet/try-runtime", - "rococo-runtime/try-runtime", "sp-runtime/try-runtime", ] diff --git a/integration-tests/src/chains/asset_hub_paseo/genesis.rs b/integration-tests/src/chains/asset_hub_paseo/genesis.rs new file mode 100644 index 00000000..5d73eb3b --- /dev/null +++ b/integration-tests/src/chains/asset_hub_paseo/genesis.rs @@ -0,0 +1,60 @@ +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, get_account_id_from_seed, get_from_seed, SAFE_XCM_VERSION, +}; +use polkadot_primitives::{AccountId, Balance}; +use sp_core::{sr25519, storage::Storage}; + +pub(crate) const PARA_ID: u32 = 1000; +pub(crate) const ED: Balance = paseo_runtime_constants::currency::EXISTENTIAL_DEPOSIT / 10; + +pub(crate) fn genesis() -> Storage { + let genesis_config = asset_hub_paseo_runtime::RuntimeGenesisConfig { + system: asset_hub_paseo_runtime::SystemConfig::default(), + balances: asset_hub_paseo_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .cloned() + .map(|k| (k, ED * 4096 * 4096)) + .collect(), + }, + parachain_info: asset_hub_paseo_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + collator_selection: asset_hub_paseo_runtime::CollatorSelectionConfig { + invulnerables: invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: asset_hub_paseo_runtime::SessionConfig { + keys: invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + asset_hub_paseo_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: asset_hub_paseo_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + ..Default::default() + }; + + build_genesis_storage( + &genesis_config, + asset_hub_paseo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), + ) +} + +type AuraId = sp_consensus_aura::ed25519::AuthorityId; +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")), + ] +} diff --git a/integration-tests/src/chains/asset_hub_paseo/mod.rs b/integration-tests/src/chains/asset_hub_paseo/mod.rs new file mode 100644 index 00000000..51dae063 --- /dev/null +++ b/integration-tests/src/chains/asset_hub_paseo/mod.rs @@ -0,0 +1,39 @@ +pub(crate) mod genesis; + +use crate::chains::paseo::Paseo; +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 frame_support::traits::OnInitialize; + +// AssetHubPaseo Parachain declaration +decl_test_parachains! { + pub struct AssetHubPaseo { + genesis = genesis::genesis(), + on_init = { + asset_hub_paseo_runtime::AuraExt::on_initialize(1); + }, + runtime = asset_hub_paseo_runtime, + core = { + XcmpMessageHandler: asset_hub_paseo_runtime::XcmpQueue, + LocationToAccountId: asset_hub_paseo_runtime::xcm_config::LocationToAccountId, + ParachainInfo: asset_hub_paseo_runtime::ParachainInfo, + MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, + }, + pallets = { + PolkadotXcm: asset_hub_paseo_runtime::PolkadotXcm, + Assets: asset_hub_paseo_runtime::Assets, + ForeignAssets: asset_hub_paseo_runtime::ForeignAssets, + Balances: asset_hub_paseo_runtime::Balances, + } + }, +} + +// AssetHubPaseo implementation +impl_accounts_helpers_for_parachain!(AssetHubPaseo); +impl_assert_events_helpers_for_parachain!(AssetHubPaseo); +impl_assets_helpers_for_parachain!(AssetHubPaseo, Paseo); +impl_foreign_assets_helpers_for_parachain!(AssetHubPaseo, Paseo); +impl_xcm_helpers_for_parachain!(AssetHubPaseo); diff --git a/integration-tests/src/chains/asset_hub_rococo/genesis.rs b/integration-tests/src/chains/asset_hub_rococo/genesis.rs deleted file mode 100644 index a6a36edf..00000000 --- a/integration-tests/src/chains/asset_hub_rococo/genesis.rs +++ /dev/null @@ -1,52 +0,0 @@ -use emulated_integration_tests_common::{ - accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, -}; -use pop_runtime_common::Balance; -use sp_core::storage::Storage; - -pub(crate) const PARA_ID: u32 = 1000; -pub(crate) const ED: Balance = rococo_runtime_constants::currency::EXISTENTIAL_DEPOSIT / 10; - -pub(crate) fn genesis() -> Storage { - let genesis_config = asset_hub_rococo_runtime::RuntimeGenesisConfig { - system: asset_hub_rococo_runtime::SystemConfig::default(), - balances: asset_hub_rococo_runtime::BalancesConfig { - balances: accounts::init_balances() - .iter() - .cloned() - .map(|k| (k, ED * 4096 * 4096)) - .collect(), - }, - parachain_info: asset_hub_rococo_runtime::ParachainInfoConfig { - parachain_id: PARA_ID.into(), - ..Default::default() - }, - collator_selection: asset_hub_rococo_runtime::CollatorSelectionConfig { - invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), - candidacy_bond: ED * 16, - ..Default::default() - }, - session: asset_hub_rococo_runtime::SessionConfig { - keys: collators::invulnerables() - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - asset_hub_rococo_runtime::SessionKeys { aura }, // session keys - ) - }) - .collect(), - }, - polkadot_xcm: asset_hub_rococo_runtime::PolkadotXcmConfig { - safe_xcm_version: Some(SAFE_XCM_VERSION), - ..Default::default() - }, - ..Default::default() - }; - - build_genesis_storage( - &genesis_config, - asset_hub_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - ) -} diff --git a/integration-tests/src/chains/asset_hub_rococo/mod.rs b/integration-tests/src/chains/asset_hub_rococo/mod.rs deleted file mode 100644 index 4f119eaa..00000000 --- a/integration-tests/src/chains/asset_hub_rococo/mod.rs +++ /dev/null @@ -1,39 +0,0 @@ -pub(crate) mod genesis; - -use crate::chains::rococo::Rococo; -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 frame_support::traits::OnInitialize; - -// AssetHubRococo Parachain declaration -decl_test_parachains! { - pub struct AssetHubRococo { - genesis = genesis::genesis(), - on_init = { - asset_hub_rococo_runtime::AuraExt::on_initialize(1); - }, - runtime = asset_hub_rococo_runtime, - core = { - XcmpMessageHandler: asset_hub_rococo_runtime::XcmpQueue, - LocationToAccountId: asset_hub_rococo_runtime::xcm_config::LocationToAccountId, - ParachainInfo: asset_hub_rococo_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - }, - pallets = { - PolkadotXcm: asset_hub_rococo_runtime::PolkadotXcm, - Assets: asset_hub_rococo_runtime::Assets, - ForeignAssets: asset_hub_rococo_runtime::ForeignAssets, - Balances: asset_hub_rococo_runtime::Balances, - } - }, -} - -// AssetHubRococo implementation -impl_accounts_helpers_for_parachain!(AssetHubRococo); -impl_assert_events_helpers_for_parachain!(AssetHubRococo); -impl_assets_helpers_for_parachain!(AssetHubRococo, Rococo); -impl_foreign_assets_helpers_for_parachain!(AssetHubRococo, Rococo); -impl_xcm_helpers_for_parachain!(AssetHubRococo); diff --git a/integration-tests/src/chains/mod.rs b/integration-tests/src/chains/mod.rs index e9c4a651..429c6691 100644 --- a/integration-tests/src/chains/mod.rs +++ b/integration-tests/src/chains/mod.rs @@ -1,3 +1,3 @@ -pub(crate) mod asset_hub_rococo; +pub(crate) mod asset_hub_paseo; +pub(crate) mod paseo; pub(crate) mod pop_network; -pub(crate) mod rococo; diff --git a/integration-tests/src/chains/rococo/genesis.rs b/integration-tests/src/chains/paseo/genesis.rs similarity index 66% rename from integration-tests/src/chains/rococo/genesis.rs rename to integration-tests/src/chains/paseo/genesis.rs index 9db707c4..b2c62b6f 100644 --- a/integration-tests/src/chains/rococo/genesis.rs +++ b/integration-tests/src/chains/paseo/genesis.rs @@ -2,15 +2,15 @@ use emulated_integration_tests_common::{ accounts, build_genesis_storage, get_account_id_from_seed, get_from_seed, get_host_config, validators, }; +use paseo_runtime_constants::currency::UNITS as ROC; use polkadot_primitives::{AssignmentId, Balance, ValidatorId}; -use rococo_runtime_constants::currency::UNITS as ROC; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; use sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_core::{sr25519, storage::Storage}; -pub(crate) const ED: Balance = rococo_runtime_constants::currency::EXISTENTIAL_DEPOSIT; +pub(crate) const ED: Balance = paseo_runtime_constants::currency::EXISTENTIAL_DEPOSIT; const ENDOWMENT: u128 = 1_000_000 * ROC; fn session_keys( @@ -20,8 +20,8 @@ fn session_keys( para_assignment: AssignmentId, authority_discovery: AuthorityDiscoveryId, beefy: BeefyId, -) -> rococo_runtime::SessionKeys { - rococo_runtime::SessionKeys { +) -> paseo_runtime::SessionKeys { + paseo_runtime::SessionKeys { babe, grandpa, para_validator, @@ -32,12 +32,12 @@ fn session_keys( } pub(crate) fn genesis() -> Storage { - let genesis_config = rococo_runtime::RuntimeGenesisConfig { - system: rococo_runtime::SystemConfig::default(), - balances: rococo_runtime::BalancesConfig { + let genesis_config = paseo_runtime::RuntimeGenesisConfig { + system: paseo_runtime::SystemConfig::default(), + balances: paseo_runtime::BalancesConfig { balances: accounts::init_balances().iter().map(|k| (k.clone(), ENDOWMENT)).collect(), }, - session: rococo_runtime::SessionConfig { + session: paseo_runtime::SessionConfig { keys: validators::initial_authorities() .iter() .map(|x| { @@ -56,21 +56,21 @@ pub(crate) fn genesis() -> Storage { }) .collect::>(), }, - babe: rococo_runtime::BabeConfig { + babe: paseo_runtime::BabeConfig { authorities: Default::default(), - epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG), + epoch_config: Some(paseo_runtime::BABE_GENESIS_EPOCH_CONFIG), ..Default::default() }, - sudo: rococo_runtime::SudoConfig { + sudo: paseo_runtime::SudoConfig { key: Some(get_account_id_from_seed::("Alice")), }, - configuration: rococo_runtime::ConfigurationConfig { config: get_host_config() }, - registrar: rococo_runtime::RegistrarConfig { + configuration: paseo_runtime::ConfigurationConfig { config: get_host_config() }, + registrar: paseo_runtime::RegistrarConfig { next_free_para_id: polkadot_primitives::LOWEST_PUBLIC_ID, ..Default::default() }, ..Default::default() }; - build_genesis_storage(&genesis_config, rococo_runtime::WASM_BINARY.unwrap()) + build_genesis_storage(&genesis_config, paseo_runtime::WASM_BINARY.unwrap()) } diff --git a/integration-tests/src/chains/paseo/mod.rs b/integration-tests/src/chains/paseo/mod.rs new file mode 100644 index 00000000..735807e5 --- /dev/null +++ b/integration-tests/src/chains/paseo/mod.rs @@ -0,0 +1,32 @@ +pub(crate) mod genesis; + +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, +}; + +// Paseo declaration +decl_test_relay_chains! { + #[api_version(10)] + pub struct Paseo { + genesis = genesis::genesis(), + on_init = (), + runtime = paseo_runtime, + core = { + SovereignAccountOf: paseo_runtime::xcm_config::SovereignAccountOf, + }, + pallets = { + XcmPallet: paseo_runtime::XcmPallet, + Sudo: paseo_runtime::Sudo, + Balances: paseo_runtime::Balances, + Hrmp: paseo_runtime::Hrmp, + } + }, +} + +// Paseo implementation +impl_accounts_helpers_for_relay_chain!(Paseo); +impl_assert_events_helpers_for_relay_chain!(Paseo); +impl_hrmp_channels_helpers_for_relay_chain!(Paseo); +impl_send_transact_helpers_for_relay_chain!(Paseo); diff --git a/integration-tests/src/chains/pop_network/mod.rs b/integration-tests/src/chains/pop_network/mod.rs index bec90394..42b2cc2e 100644 --- a/integration-tests/src/chains/pop_network/mod.rs +++ b/integration-tests/src/chains/pop_network/mod.rs @@ -1,6 +1,6 @@ pub(crate) mod genesis; -use crate::chains::rococo::Rococo; +use crate::chains::paseo::Paseo; use emulated_integration_tests_common::{ impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, impl_assets_helpers_for_parachain, impl_xcm_helpers_for_parachain, impls::Parachain, @@ -33,5 +33,5 @@ decl_test_parachains! { // PopNetwork implementation impl_accounts_helpers_for_parachain!(PopNetwork); impl_assert_events_helpers_for_parachain!(PopNetwork); -impl_assets_helpers_for_parachain!(PopNetwork, Rococo); +impl_assets_helpers_for_parachain!(PopNetwork, Paseo); impl_xcm_helpers_for_parachain!(PopNetwork); diff --git a/integration-tests/src/chains/rococo/mod.rs b/integration-tests/src/chains/rococo/mod.rs deleted file mode 100644 index 71d6f1ef..00000000 --- a/integration-tests/src/chains/rococo/mod.rs +++ /dev/null @@ -1,32 +0,0 @@ -pub(crate) mod genesis; - -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, -}; - -// Rococo declaration -decl_test_relay_chains! { - #[api_version(10)] - pub struct Rococo { - genesis = genesis::genesis(), - on_init = (), - runtime = rococo_runtime, - core = { - SovereignAccountOf: rococo_runtime::xcm_config::LocationConverter, - }, - pallets = { - XcmPallet: rococo_runtime::XcmPallet, - Sudo: rococo_runtime::Sudo, - Balances: rococo_runtime::Balances, - Hrmp: rococo_runtime::Hrmp, - } - }, -} - -// Rococo implementation -impl_accounts_helpers_for_relay_chain!(Rococo); -impl_assert_events_helpers_for_relay_chain!(Rococo); -impl_hrmp_channels_helpers_for_relay_chain!(Rococo); -impl_send_transact_helpers_for_relay_chain!(Rococo); diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index 31e9860b..10aab904 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -1,13 +1,13 @@ #![cfg(test)] use crate::chains::{ - asset_hub_rococo::{genesis::ED as ASSET_HUB_ROCOCO_ED, AssetHubRococoParaPallet}, + asset_hub_paseo::{genesis::ED as ASSET_HUB_PASEO_ED, AssetHubPaseoParaPallet}, + paseo::{genesis::ED as PASEO_ED, PaseoRelayPallet}, pop_network::PopNetworkParaPallet, - rococo::{genesis::ED as ROCOCO_ED, RococoRelayPallet}, }; -use asset_hub_rococo_runtime::xcm_config::XcmConfig as AssetHubRococoXcmConfig; +use asset_hub_paseo_runtime::xcm_config::XcmConfig as AssetHubPaseoXcmConfig; use asset_test_utils::xcm_helpers; -use chains::{asset_hub_rococo::AssetHubRococo, pop_network::PopNetwork, rococo::Rococo}; +use chains::{asset_hub_paseo::AssetHubPaseo, paseo::Paseo, pop_network::PopNetwork}; use emulated_integration_tests_common::{ accounts::{ALICE, BOB}, xcm_emulator::{ @@ -16,27 +16,20 @@ use emulated_integration_tests_common::{ RelayChain as Relay, Test, TestArgs, TestContext, TestExt, }, }; -use frame_support::{ - dispatch::RawOrigin, pallet_prelude::Weight, sp_runtime::traits::Dispatchable, - sp_runtime::DispatchResult, -}; -use polkadot_runtime_parachains::assigner_on_demand; +use frame_support::{pallet_prelude::Weight, sp_runtime::DispatchResult}; +use paseo_runtime::xcm_config::XcmConfig as PaseoXcmConfig; use pop_runtime_common::Balance; -use pop_runtime_devnet as pop_runtime; use pop_runtime_devnet::config::xcm::XcmConfig as PopNetworkXcmConfig; -use rococo_runtime::xcm_config::XcmConfig as RococoXcmConfig; -use sp_core::Encode; use xcm::prelude::*; -use xcm_executor::traits::QueryHandler; mod chains; decl_test_networks! { // `pub` mandatory for the macro - pub struct RococoMockNet { - relay_chain = Rococo, + pub struct PaseoMockNet { + relay_chain = Paseo, parachains = vec![ - AssetHubRococo, + AssetHubPaseo, PopNetwork, ], bridge = () @@ -44,28 +37,28 @@ decl_test_networks! { } decl_test_sender_receiver_accounts_parameter_types! { - RococoRelay { sender: ALICE, receiver: BOB }, - AssetHubRococoPara { sender: ALICE, receiver: BOB }, + PaseoRelay { sender: ALICE, receiver: BOB }, + AssetHubPaseoPara { sender: ALICE, receiver: BOB }, PopNetworkPara { sender: ALICE, receiver: BOB} } -type RelayToParaTest = Test; -type SystemParaToParaTest = Test; -type ParaToSystemParaTest = Test; -type ParaToRelayTest = Test; +type RelayToParaTest = Test; +type SystemParaToParaTest = Test; +type ParaToSystemParaTest = Test; +type ParaToRelayTest = Test; fn relay_to_para_sender_assertions(t: RelayToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - RococoRelay::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(864_610_000, 8_799))); + type RuntimeEvent = ::RuntimeEvent; + PaseoRelay::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(864_610_000, 8_799))); assert_expected_events!( - RococoRelay, + PaseoRelay, vec![ // Amount to reserve transfer is transferred to Parachain's Sovereign account RuntimeEvent::Balances( pallet_balances::Event::Transfer { from, to, amount } ) => { from: *from == t.sender.account_id, - to: *to == RococoRelay::sovereign_account_id_of( + to: *to == PaseoRelay::sovereign_account_id_of( t.args.dest.clone() ), amount: *amount == t.args.amount, @@ -75,20 +68,20 @@ fn relay_to_para_sender_assertions(t: RelayToParaTest) { } fn system_para_to_para_sender_assertions(t: SystemParaToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - AssetHubRococoPara::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( + type RuntimeEvent = ::RuntimeEvent; + AssetHubPaseoPara::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( 864_610_000, 8_799, ))); assert_expected_events!( - AssetHubRococoPara, + AssetHubPaseoPara, vec![ // Amount to reserve transfer is transferred to Parachain's Sovereign account RuntimeEvent::Balances( pallet_balances::Event::Transfer { from, to, amount } ) => { from: *from == t.sender.account_id, - to: *to == AssetHubRococoPara::sovereign_account_id_of( + to: *to == AssetHubPaseoPara::sovereign_account_id_of( t.args.dest.clone() ), amount: *amount == t.args.amount, @@ -151,12 +144,12 @@ fn para_to_relay_sender_assertions(t: ParaToRelayTest) { } fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - let sov_pop_net_on_ahr = AssetHubRococoPara::sovereign_account_id_of( - AssetHubRococoPara::sibling_location_of(PopNetworkPara::para_id()), + type RuntimeEvent = ::RuntimeEvent; + let sov_pop_net_on_ahr = AssetHubPaseoPara::sovereign_account_id_of( + AssetHubPaseoPara::sibling_location_of(PopNetworkPara::para_id()), ); assert_expected_events!( - AssetHubRococoPara, + AssetHubPaseoPara, vec![ // Amount to reserve transfer is withdrawn from Parachain's Sovereign account RuntimeEvent::Balances( @@ -174,12 +167,12 @@ fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) { } fn para_to_relay_receiver_assertions(t: ParaToRelayTest) { - type RuntimeEvent = ::RuntimeEvent; - let sov_pop_net_on_relay = RococoRelay::sovereign_account_id_of( - RococoRelay::child_location_of(PopNetworkPara::para_id()), - ); + type RuntimeEvent = ::RuntimeEvent; + let sov_pop_net_on_relay = PaseoRelay::sovereign_account_id_of(PaseoRelay::child_location_of( + PopNetworkPara::para_id(), + )); assert_expected_events!( - RococoRelay, + PaseoRelay, vec![ // Amount to reserve transfer is withdrawn from Parachain's Sovereign account RuntimeEvent::Balances( @@ -197,7 +190,7 @@ fn para_to_relay_receiver_assertions(t: ParaToRelayTest) { } fn relay_to_para_reserve_transfer_assets(t: RelayToParaTest) -> DispatchResult { - ::XcmPallet::limited_reserve_transfer_assets( + ::XcmPallet::limited_reserve_transfer_assets( t.signed_origin, bx!(t.args.dest.into()), bx!(t.args.beneficiary.into()), @@ -208,7 +201,7 @@ fn relay_to_para_reserve_transfer_assets(t: RelayToParaTest) -> DispatchResult { } fn system_para_to_para_reserve_transfer_assets(t: SystemParaToParaTest) -> DispatchResult { - ::PolkadotXcm::limited_reserve_transfer_assets( + ::PolkadotXcm::limited_reserve_transfer_assets( t.signed_origin, bx!(t.args.dest.into()), bx!(t.args.beneficiary.into()), @@ -246,7 +239,7 @@ fn fund_pop_from_relay( amount_to_send: Balance, beneficiary: sp_runtime::AccountId32, ) { - let destination = RococoRelay::child_location_of(PopNetworkPara::para_id()); + let destination = PaseoRelay::child_location_of(PopNetworkPara::para_id()); let test_args = TestContext { sender, receiver: beneficiary.clone(), @@ -254,7 +247,7 @@ fn fund_pop_from_relay( }; let mut test = RelayToParaTest::new(test_args); - test.set_dispatchable::(relay_to_para_reserve_transfer_assets); + test.set_dispatchable::(relay_to_para_reserve_transfer_assets); test.assert(); } @@ -265,7 +258,7 @@ fn fund_pop_from_system_para( beneficiary: sp_runtime::AccountId32, assets: Assets, ) { - let destination = AssetHubRococoPara::sibling_location_of(PopNetworkPara::para_id()); + let destination = AssetHubPaseoPara::sibling_location_of(PopNetworkPara::para_id()); let test_args = TestContext { sender, receiver: beneficiary.clone(), @@ -273,7 +266,7 @@ fn fund_pop_from_system_para( }; let mut test = SystemParaToParaTest::new(test_args); - test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); + test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); } @@ -283,12 +276,12 @@ fn reserve_transfer_native_asset_from_relay_to_para() { init_tracing(); // Init values for Relay - let destination = RococoRelay::child_location_of(PopNetworkPara::para_id()); + let destination = PaseoRelay::child_location_of(PopNetworkPara::para_id()); let beneficiary_id = PopNetworkParaReceiver::get(); - let amount_to_send: Balance = ROCOCO_ED * 1000; + let amount_to_send: Balance = PASEO_ED * 1000; let test_args = TestContext { - sender: RococoRelaySender::get(), + sender: PaseoRelaySender::get(), receiver: PopNetworkParaReceiver::get(), args: TestArgs::new_relay(destination, beneficiary_id, amount_to_send), }; @@ -298,14 +291,14 @@ fn reserve_transfer_native_asset_from_relay_to_para() { let sender_balance_before = test.sender.balance; let receiver_balance_before = test.receiver.balance; - test.set_assertion::(relay_to_para_sender_assertions); + test.set_assertion::(relay_to_para_sender_assertions); test.set_assertion::(para_receiver_assertions); - test.set_dispatchable::(relay_to_para_reserve_transfer_assets); + test.set_dispatchable::(relay_to_para_reserve_transfer_assets); test.assert(); - let delivery_fees = RococoRelay::execute_with(|| { + let delivery_fees = PaseoRelay::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) }); @@ -329,18 +322,18 @@ fn reserve_transfer_native_asset_from_para_to_relay() { // Setup: reserve transfer from relay to Pop, so that sovereign account accurate for return // transfer - let amount_to_send: Balance = ROCOCO_ED * 1_000; - fund_pop_from_relay(RococoRelaySender::get(), amount_to_send, PopNetworkParaReceiver::get()); // alice on relay > bob on pop + let amount_to_send: Balance = PASEO_ED * 1_000; + fund_pop_from_relay(PaseoRelaySender::get(), amount_to_send, PopNetworkParaReceiver::get()); // alice on relay > bob on pop // Init values for Pop Network Parachain let destination = PopNetworkPara::parent_location(); // relay - let beneficiary_id = RococoRelayReceiver::get(); // bob on relay + let beneficiary_id = PaseoRelayReceiver::get(); // bob on relay let amount_to_send = PopNetworkPara::account_data_of(PopNetworkParaReceiver::get()).free; // bob on pop balance let assets = (Parent, amount_to_send).into(); let test_args = TestContext { sender: PopNetworkParaReceiver::get(), // bob on pop - receiver: RococoRelayReceiver::get(), // bob on relay + receiver: PaseoRelayReceiver::get(), // bob on relay args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; @@ -350,7 +343,7 @@ fn reserve_transfer_native_asset_from_para_to_relay() { let receiver_balance_before = test.receiver.balance; test.set_assertion::(para_to_relay_sender_assertions); - test.set_assertion::(para_to_relay_receiver_assertions); + test.set_assertion::(para_to_relay_receiver_assertions); test.set_dispatchable::(para_to_relay_reserve_transfer_assets); test.assert(); @@ -379,13 +372,13 @@ fn reserve_transfer_native_asset_from_system_para_to_para() { init_tracing(); // Init values for System Parachain - let destination = AssetHubRococoPara::sibling_location_of(PopNetworkPara::para_id()); + let destination = AssetHubPaseoPara::sibling_location_of(PopNetworkPara::para_id()); let beneficiary_id = PopNetworkParaReceiver::get(); - let amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 1000; + let amount_to_send: Balance = ASSET_HUB_PASEO_ED * 1000; let assets = (Parent, amount_to_send).into(); let test_args = TestContext { - sender: AssetHubRococoParaSender::get(), + sender: AssetHubPaseoParaSender::get(), receiver: PopNetworkParaReceiver::get(), args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; @@ -395,17 +388,17 @@ fn reserve_transfer_native_asset_from_system_para_to_para() { let sender_balance_before = test.sender.balance; let receiver_balance_before = test.receiver.balance; - test.set_assertion::(system_para_to_para_sender_assertions); + test.set_assertion::(system_para_to_para_sender_assertions); test.set_assertion::(para_receiver_assertions); - test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); + test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); let sender_balance_after = test.sender.balance; let receiver_balance_after = test.receiver.balance; - let delivery_fees = AssetHubRococoPara::execute_with(|| { + let delivery_fees = AssetHubPaseoPara::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) }); @@ -425,23 +418,23 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { init_tracing(); // Setup: reserve transfer from AH to Pop, so that sovereign account accurate for return transfer - let amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 1000; + let amount_to_send: Balance = ASSET_HUB_PASEO_ED * 1000; fund_pop_from_system_para( - AssetHubRococoParaSender::get(), + AssetHubPaseoParaSender::get(), amount_to_send, PopNetworkParaReceiver::get(), (Parent, amount_to_send).into(), ); // alice on asset hub > bob on pop // Init values for Pop Network Parachain - let destination = PopNetworkPara::sibling_location_of(AssetHubRococoPara::para_id()); - let beneficiary_id = AssetHubRococoParaReceiver::get(); // bob on asset hub + let destination = PopNetworkPara::sibling_location_of(AssetHubPaseoPara::para_id()); + let beneficiary_id = AssetHubPaseoParaReceiver::get(); // bob on asset hub let amount_to_send = PopNetworkPara::account_data_of(PopNetworkParaReceiver::get()).free; // bob on pop balance let assets = (Parent, amount_to_send).into(); let test_args = TestContext { - sender: PopNetworkParaReceiver::get(), // bob on pop - receiver: AssetHubRococoParaReceiver::get(), // bob on asset hub + sender: PopNetworkParaReceiver::get(), // bob on pop + receiver: AssetHubPaseoParaReceiver::get(), // bob on asset hub args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), }; @@ -451,15 +444,15 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { let receiver_balance_before = test.receiver.balance; let pop_net_location_as_seen_by_ahr = - AssetHubRococoPara::sibling_location_of(PopNetworkPara::para_id()); + AssetHubPaseoPara::sibling_location_of(PopNetworkPara::para_id()); let sov_pop_net_on_ahr = - AssetHubRococoPara::sovereign_account_id_of(pop_net_location_as_seen_by_ahr); + AssetHubPaseoPara::sovereign_account_id_of(pop_net_location_as_seen_by_ahr); // fund Pop Network's SA on AHR with the native tokens held in reserve - AssetHubRococoPara::fund_accounts(vec![(sov_pop_net_on_ahr.into(), amount_to_send * 2)]); + AssetHubPaseoPara::fund_accounts(vec![(sov_pop_net_on_ahr.into(), amount_to_send * 2)]); test.set_assertion::(para_to_system_para_sender_assertions); - test.set_assertion::(para_to_system_para_receiver_assertions); + test.set_assertion::(para_to_system_para_receiver_assertions); test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); test.assert(); @@ -482,105 +475,106 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { assert!(receiver_balance_after < receiver_balance_before + amount_to_send); } -#[test] -fn place_coretime_spot_order_from_para_to_relay() { - init_tracing(); - - let beneficiary: sp_runtime::AccountId32 = [1u8; 32].into(); - - // Setup: reserve transfer from relay to Pop, so that sovereign account accurate for return transfer - let amount_to_send: Balance = pop_runtime::UNIT * 1000; - fund_pop_from_relay(RococoRelaySender::get(), amount_to_send, beneficiary.clone()); - - let message = { - let assets: Asset = (Here, 10 * pop_runtime::UNIT).into(); - let beneficiary = AccountId32 { id: beneficiary.clone().into(), network: None }.into(); - let spot_order = ::RuntimeCall::OnDemandAssignmentProvider( - assigner_on_demand::Call::<::Runtime>::place_order_keep_alive { - max_amount: 1 * pop_runtime::UNIT, - para_id: AssetHubRococoPara::para_id().into(), - }, - ); - - // Set up transact status response handler - let query_id = PopNetworkPara::execute_with(|| { - as PopNetworkParaPallet>::PolkadotXcm::new_query( - PopNetworkPara::parent_location(), - // timeout in blocks - 10u32.into(), - Location::here(), - ) - }); - - let message = Xcm::builder() - .withdraw_asset(assets.clone().into()) - .buy_execution(assets.clone().into(), Unlimited) - .transact( - OriginKind::SovereignAccount, - Weight::from_parts(220_000_000, 15_000), - spot_order.encode().into(), - ) - .report_transact_status(QueryResponseInfo { - destination: RococoRelay::child_location_of(PopNetworkPara::para_id()), - query_id, - max_weight: Weight::from_parts(250_000_000, 10_000), - }) - .refund_surplus() - .deposit_asset(assets.into(), beneficiary) - .build(); - message - }; - - let destination = PopNetworkPara::parent_location().into_versioned(); - PopNetworkPara::execute_with(|| { - let res = ::RuntimeCall::PolkadotXcm(pallet_xcm::Call::< - ::Runtime, - >::send { - dest: bx!(destination), - message: bx!(VersionedXcm::V4(message)), - }) - // TODO: replace root with signed, currently prohibited by HashedDescription> (https://github.com/paritytech/polkadot-sdk/blob/a6713c55fd5082d333518c3ca13f2a4294726fcc/polkadot/runtime/rococo/src/xcm_config.rs#L67) rather than HashedDescription> (https://github.com/polkadot-fellows/runtimes/blob/e42821da8d85f721d0dd1670dfb23f4dd91bd3e8/relay/kusama/src/xcm_config.rs#L76) - //.dispatch(RawOrigin::Signed(beneficiary).into()); - .dispatch(RawOrigin::Root.into()); - - assert!(res.is_ok()); - type RuntimeEvent = ::RuntimeEvent; - // Check that the message was sent - assert_expected_events!( - PopNetworkPara, - vec![ - RuntimeEvent::PolkadotXcm(pallet_xcm::Event::Sent { .. }) => {}, - ] - ); - }); - - RococoRelay::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - assert_expected_events!( - RococoRelay, - vec![ - // We currently only check that the message was processed successfully - RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true, .. }) => {}, - // TODO: check order placed once we can have on-demand para id registered (probably via setting raw storage as a workaround) - // RuntimeEvent::OnDemandAssignmentProvider(assigner_on_demand::Event::OnDemandOrderPlaced { - // .. - // }) => {}, - ] - ); - }); - - PopNetworkPara::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - // Check that the reporting of the transact status message was sent - assert_expected_events!( - PopNetworkPara, - vec![ - RuntimeEvent::PolkadotXcm(pallet_xcm::Event::ResponseReady { query_id: 0, .. }) => {}, - RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true, .. }) => {}, - ] - ); - }); -} +// Note: commented out until coretime added to Paseo +// #[test] +// fn place_coretime_spot_order_from_para_to_relay() { +// init_tracing(); +// +// let beneficiary: sp_runtime::AccountId32 = [1u8; 32].into(); +// +// // Setup: reserve transfer from relay to Pop, so that sovereign account accurate for return transfer +// let amount_to_send: Balance = pop_runtime::UNIT * 1000; +// fund_pop_from_relay(PaseoRelaySender::get(), amount_to_send, beneficiary.clone()); +// +// let message = { +// let assets: Asset = (Here, 10 * pop_runtime::UNIT).into(); +// let beneficiary = AccountId32 { id: beneficiary.clone().into(), network: None }.into(); +// let spot_order = ::RuntimeCall::OnDemandAssignmentProvider( +// assigner_on_demand::Call::<::Runtime>::place_order_keep_alive { +// max_amount: 1 * pop_runtime::UNIT, +// para_id: AssetHubPaseoPara::para_id().into(), +// }, +// ); +// +// // Set up transact status response handler +// let query_id = PopNetworkPara::execute_with(|| { +// as PopNetworkParaPallet>::PolkadotXcm::new_query( +// PopNetworkPara::parent_location(), +// // timeout in blocks +// 10u32.into(), +// Location::here(), +// ) +// }); +// +// let message = Xcm::builder() +// .withdraw_asset(assets.clone().into()) +// .buy_execution(assets.clone().into(), Unlimited) +// .transact( +// OriginKind::SovereignAccount, +// Weight::from_parts(220_000_000, 15_000), +// spot_order.encode().into(), +// ) +// .report_transact_status(QueryResponseInfo { +// destination: PaseoRelay::child_location_of(PopNetworkPara::para_id()), +// query_id, +// max_weight: Weight::from_parts(250_000_000, 10_000), +// }) +// .refund_surplus() +// .deposit_asset(assets.into(), beneficiary) +// .build(); +// message +// }; +// +// let destination = PopNetworkPara::parent_location().into_versioned(); +// PopNetworkPara::execute_with(|| { +// let res = ::RuntimeCall::PolkadotXcm(pallet_xcm::Call::< +// ::Runtime, +// >::send { +// dest: bx!(destination), +// message: bx!(VersionedXcm::V4(message)), +// }) +// // TODO: replace root with signed, currently prohibited by HashedDescription> (https://github.com/paritytech/polkadot-sdk/blob/a6713c55fd5082d333518c3ca13f2a4294726fcc/polkadot/runtime/rococo/src/xcm_config.rs#L67) rather than HashedDescription> (https://github.com/polkadot-fellows/runtimes/blob/e42821da8d85f721d0dd1670dfb23f4dd91bd3e8/relay/kusama/src/xcm_config.rs#L76) +// //.dispatch(RawOrigin::Signed(beneficiary).into()); +// .dispatch(RawOrigin::Root.into()); +// +// assert!(res.is_ok()); +// type RuntimeEvent = ::RuntimeEvent; +// // Check that the message was sent +// assert_expected_events!( +// PopNetworkPara, +// vec![ +// RuntimeEvent::PolkadotXcm(pallet_xcm::Event::Sent { .. }) => {}, +// ] +// ); +// }); +// +// PaseoRelay::execute_with(|| { +// type RuntimeEvent = ::RuntimeEvent; +// assert_expected_events!( +// PaseoRelay, +// vec![ +// // We currently only check that the message was processed successfully +// RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true, .. }) => {}, +// // TODO: check order placed once we can have on-demand para id registered (probably via setting raw storage as a workaround) +// // RuntimeEvent::OnDemandAssignmentProvider(assigner_on_demand::Event::OnDemandOrderPlaced { +// // .. +// // }) => {}, +// ] +// ); +// }); +// +// PopNetworkPara::execute_with(|| { +// type RuntimeEvent = ::RuntimeEvent; +// // Check that the reporting of the transact status message was sent +// assert_expected_events!( +// PopNetworkPara, +// vec![ +// RuntimeEvent::PolkadotXcm(pallet_xcm::Event::ResponseReady { query_id: 0, .. }) => {}, +// RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true, .. }) => {}, +// ] +// ); +// }); +// } #[allow(dead_code)] static INIT: std::sync::Once = std::sync::Once::new(); From 0b7d7c3fff95512d46f8c47eacebe5289ca331ee Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Sat, 27 Jul 2024 14:47:05 +0100 Subject: [PATCH 2/5] refactor: set relay network --- runtime/devnet/src/config/xcm.rs | 3 ++- runtime/testnet/src/config/xcm.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/devnet/src/config/xcm.rs b/runtime/devnet/src/config/xcm.rs index a210f7a4..b58baf2f 100644 --- a/runtime/devnet/src/config/xcm.rs +++ b/runtime/devnet/src/config/xcm.rs @@ -28,7 +28,8 @@ use xcm_executor::XcmExecutor; parameter_types! { pub const RelayLocation: Location = Location::parent(); pub AssetHub: Location = Location::new(1, [Parachain(1000)]); - pub const RelayNetwork: Option = None; + // Note: Paseo currently uses Polkadot https://github.com/paseo-network/runtimes/blob/abc4ae9c5ae8f0166aab7ef2b427b3c2c6d5ce5c/relay/paseo/src/xcm_config.rs#L56 + pub const RelayNetwork: Option = Some(Polkadot); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorLocation = Parachain(ParachainInfo::parachain_id().into()).into(); } diff --git a/runtime/testnet/src/config/xcm.rs b/runtime/testnet/src/config/xcm.rs index a210f7a4..ee116a55 100644 --- a/runtime/testnet/src/config/xcm.rs +++ b/runtime/testnet/src/config/xcm.rs @@ -28,7 +28,8 @@ use xcm_executor::XcmExecutor; parameter_types! { pub const RelayLocation: Location = Location::parent(); pub AssetHub: Location = Location::new(1, [Parachain(1000)]); - pub const RelayNetwork: Option = None; + // 0x77afd6190f1554ad45fd0d31aee62aacc33c6db0ea801129acb813f913e0764f from https://dotapps-io.ipns.dweb.link/?rpc=wss%3A%2F%2Frpc.ibp.network%2Fpaseo#/explorer/query/0 + pub const RelayNetwork: Option = Some(ByGenesis([119,175,214,25,15,21,84,173,69,253,13,49,174,230,42,172,195,60,109,176,234,128,17,41,172,184,19,249,19,224,118,79])); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorLocation = Parachain(ParachainInfo::parachain_id().into()).into(); } From d116ab1cbb3f740c7df89b6ce1636b80dc494ea7 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Sat, 27 Jul 2024 16:01:22 +0100 Subject: [PATCH 3/5] fix: switch to fungibles adapter Rococo runtime (sdk 1.7) used currency adapter (https://github.com/paritytech/polkadot-sdk/blob/09df373db9cd5dfed82c5cdb0736d417d54249e6/polkadot/runtime/rococo/src/xcm_config.rs#L77) whereas Paseo/Polkadot uses fungible adapter (https://github.com/paseo-network/runtimes/blob/e7265b10b28d8b82c3146e72c98895dac2b55729/relay/paseo/src/xcm_config.rs#L82C33-L82C48), resulting in different events being emitted. --- integration-tests/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index 10aab904..c42035f9 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -153,12 +153,12 @@ fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) { vec![ // Amount to reserve transfer is withdrawn from Parachain's Sovereign account RuntimeEvent::Balances( - pallet_balances::Event::Withdraw { who, amount } + pallet_balances::Event::Burned { who, amount } ) => { who: *who == sov_pop_net_on_ahr.clone().into(), amount: *amount == t.args.amount, }, - RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {}, + RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {}, RuntimeEvent::MessageQueue( pallet_message_queue::Event::Processed { success: true, .. } ) => {}, @@ -176,12 +176,12 @@ fn para_to_relay_receiver_assertions(t: ParaToRelayTest) { vec![ // Amount to reserve transfer is withdrawn from Parachain's Sovereign account RuntimeEvent::Balances( - pallet_balances::Event::Withdraw { who, amount } + pallet_balances::Event::Burned { who, amount } ) => { who: *who == sov_pop_net_on_relay.clone().into(), amount: *amount == t.args.amount, }, - RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {}, + RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {}, RuntimeEvent::MessageQueue( pallet_message_queue::Event::Processed { success: true, .. } ) => {}, From 2209fa69d3a8c5d16724ca9a6633516f2f727220 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Sun, 28 Jul 2024 16:06:59 +0100 Subject: [PATCH 4/5] refactor: use correct relay token symbol --- integration-tests/src/chains/paseo/genesis.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/src/chains/paseo/genesis.rs b/integration-tests/src/chains/paseo/genesis.rs index b2c62b6f..d4c29ca2 100644 --- a/integration-tests/src/chains/paseo/genesis.rs +++ b/integration-tests/src/chains/paseo/genesis.rs @@ -2,7 +2,7 @@ use emulated_integration_tests_common::{ accounts, build_genesis_storage, get_account_id_from_seed, get_from_seed, get_host_config, validators, }; -use paseo_runtime_constants::currency::UNITS as ROC; +use paseo_runtime_constants::currency::UNITS as PAS; use polkadot_primitives::{AssignmentId, Balance, ValidatorId}; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; @@ -11,7 +11,7 @@ use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_core::{sr25519, storage::Storage}; pub(crate) const ED: Balance = paseo_runtime_constants::currency::EXISTENTIAL_DEPOSIT; -const ENDOWMENT: u128 = 1_000_000 * ROC; +const ENDOWMENT: u128 = 1_000_000 * PAS; fn session_keys( babe: BabeId, From cee8d1e57a9e48adb32b98aa32a2358bb3814623 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Sun, 4 Aug 2024 06:12:03 +0100 Subject: [PATCH 5/5] fix: use polkadot network id Whilst using ByGenesis is more accurate for the live paseo testnet, using this approach *may* prevent any local test networks from working, if zombienet config results in a different genesis block for example. --- runtime/testnet/src/config/xcm.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/testnet/src/config/xcm.rs b/runtime/testnet/src/config/xcm.rs index ee116a55..b58baf2f 100644 --- a/runtime/testnet/src/config/xcm.rs +++ b/runtime/testnet/src/config/xcm.rs @@ -28,8 +28,8 @@ use xcm_executor::XcmExecutor; parameter_types! { pub const RelayLocation: Location = Location::parent(); pub AssetHub: Location = Location::new(1, [Parachain(1000)]); - // 0x77afd6190f1554ad45fd0d31aee62aacc33c6db0ea801129acb813f913e0764f from https://dotapps-io.ipns.dweb.link/?rpc=wss%3A%2F%2Frpc.ibp.network%2Fpaseo#/explorer/query/0 - pub const RelayNetwork: Option = Some(ByGenesis([119,175,214,25,15,21,84,173,69,253,13,49,174,230,42,172,195,60,109,176,234,128,17,41,172,184,19,249,19,224,118,79])); + // Note: Paseo currently uses Polkadot https://github.com/paseo-network/runtimes/blob/abc4ae9c5ae8f0166aab7ef2b427b3c2c6d5ce5c/relay/paseo/src/xcm_config.rs#L56 + pub const RelayNetwork: Option = Some(Polkadot); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorLocation = Parachain(ParachainInfo::parachain_id().into()).into(); }