diff --git a/.cargo/config.toml b/.cargo/config.toml index 66b28b348..c5ddbf806 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -10,7 +10,7 @@ rustflags = [ "-Aclippy::all", "-Dclippy::correctness", "-Aclippy::if-same-then-else", - "-Aclippy::clone-double-ref", + "-Asuspicious-double-ref-op", "-Dclippy::complexity", "-Aclippy::zero-prefixed-literal", # 00_1000_000 "-Aclippy::type_complexity", # raison d'etre diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 1cfbf5fa1..a70a3c61d 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -19,7 +19,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2022-11-15 + toolchain: nightly-2023-05-22 components: rustfmt target: wasm32-unknown-unknown default: true diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 9ed0e79a8..8a0d47639 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -26,7 +26,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2022-11-15 + toolchain: nightly-2023-05-22 components: rustfmt,clippy target: wasm32-unknown-unknown override: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76ea7a961..cea7c2b27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2022-11-15 + toolchain: nightly-2023-05-22 components: rustfmt target: wasm32-unknown-unknown default: true diff --git a/Cargo.lock b/Cargo.lock index fb495de8f..b04b433db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,20 +14,20 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.26.2", + "gimli 0.27.3", ] [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.27.3", + "gimli 0.28.0", ] [[package]] @@ -115,9 +115,9 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead 0.5.2", "aes 0.8.3", @@ -149,9 +149,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ "getrandom 0.2.10", "once_cell", @@ -160,25 +160,32 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" dependencies = [ "cfg-if", "getrandom 0.2.10", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "always-assert" version = "0.1.3" @@ -211,30 +218,29 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -250,9 +256,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -260,9 +266,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "approx" @@ -273,6 +279,20 @@ dependencies = [ "num-traits", ] +[[package]] +name = "aquamarine" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df752953c49ce90719c7bf1fc587bc8227aed04732ea0c0f85e5397d7fdbd1a1" +dependencies = [ + "include_dir", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "arc-swap" version = "1.6.0" @@ -280,10 +300,189 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] -name = "array-bytes" -version = "4.2.0" +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-scale" +version = "0.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b08346a3e38e2be792ef53ee168623c9244d968ff00cd70fb9932f6fe36393" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "parity-scale-codec", +] + +[[package]] +name = "ark-scale" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51bd73bb6ddb72630987d37fa963e99196896c0d0ea81b7c894567e74a2f83af" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ark-secret-scalar" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "ark-transcript", + "digest 0.10.7", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] [[package]] name = "array-bytes" @@ -297,6 +496,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + [[package]] name = "arrayvec" version = "0.5.2" @@ -322,7 +530,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.23", + "time", ] [[package]] @@ -338,7 +546,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.23", + "time", ] [[package]] @@ -376,12 +584,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "asn1_der" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" - [[package]] name = "assert_matches" version = "1.5.0" @@ -389,105 +591,404 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] -name = "assets-common" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +name = "asset-hub-kusama-runtime" +version = "0.9.420" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "assets-common", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "kusama-runtime-constants", "log", + "pallet-asset-conversion", + "pallet-asset-conversion-tx-payment", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "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", + "pallet-uniques", + "pallet-utility", "pallet-xcm", + "pallet-xcm-benchmarks", + "parachain-info", "parachains-common", "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "primitive-types", "scale-info", + "smallvec", "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "sp-weights", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", -] - -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", ] [[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +name = "asset-hub-polkadot-runtime" +version = "0.9.420" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "async-lock", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite", + "assets-common", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", "log", - "parking", - "polling", - "rustix 0.37.23", - "slab", - "socket2 0.4.9", - "waker-fn", -] - -[[package]] -name = "async-lock" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-recursion" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" + "pallet-asset-tx-payment", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-multisig", + "pallet-nfts", + "pallet-nfts-runtime-api", + "pallet-proxy", + "pallet-session", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-uniques", + "pallet-utility", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "polkadot-runtime-constants", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "sp-weights", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", +] + +[[package]] +name = "asset-hub-westend-runtime" +version = "0.9.420" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "assets-common", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "log", + "pallet-asset-conversion", + "pallet-asset-conversion-tx-payment", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-multisig", + "pallet-nft-fractionalization", + "pallet-nfts", + "pallet-nfts-runtime-api", + "pallet-proxy", + "pallet-session", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-uniques", + "pallet-utility", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "primitive-types", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", + "westend-runtime-constants", +] + +[[package]] +name = "assets-common" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "impl-trait-for-tuples", + "log", + "pallet-asset-conversion", + "pallet-asset-tx-payment", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", +] + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0c4a4f319e45986f347ee47fef8bf5e81c9abc3f6f58dc2391439f30df65f0" +dependencies = [ + "async-lock", + "async-task", + "concurrent-queue", + "fastrand 2.0.1", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock", + "autocfg", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite", + "log", + "parking", + "polling", + "rustix 0.37.26", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-net" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" +dependencies = [ + "async-io", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io", + "async-lock", + "async-signal", + "blocking", + "cfg-if", + "event-listener 3.0.0", + "futures-lite", + "rustix 0.38.20", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", +] + +[[package]] +name = "async-signal" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2a5415b7abcdc9cd7d63d6badba5288b2ca017e3fbd4173b8f405449f1a2399" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.20", + "signal-hook-registry", + "slab", + "windows-sys 0.48.0", ] +[[package]] +name = "async-task" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" + [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "asynchronous-codec" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a0daa378f5fd10634e44b0a29b2a87b890657658e072a30d6f26e57ddee182" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ "bytes", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.13", ] +[[package]] +name = "atomic-take" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ab6b55fe97976e46f91ddbed8d147d966475dc29b2032757ba47e02376fbc3" + [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atty" @@ -508,19 +1009,41 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ - "addr2line 0.20.0", + "addr2line 0.21.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.31.1", + "object 0.32.1", "rustc-demangle", ] +[[package]] +name = "bandersnatch_vrfs" +version = "0.0.1" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-scale 0.0.11", + "ark-serialize", + "ark-std", + "dleq_vrf", + "fflonk", + "merlin 3.0.0", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "ring 0.1.0", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "base-x" version = "0.2.11" @@ -547,9 +1070,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -570,11 +1093,11 @@ dependencies = [ name = "bifrost-asset-registry" version = "0.8.0" dependencies = [ + "bifrost-primitives", "frame-benchmarking", "frame-support", "frame-system", "log", - "node-primitives", "pallet-balances", "parity-scale-codec", "scale-info", @@ -582,19 +1105,19 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] name = "bifrost-call-switchgear" version = "0.8.0" dependencies = [ + "bifrost-primitives", "frame-benchmarking", "frame-support", "frame-system", - "node-primitives", "orml-tokens", "orml-traits", "pallet-balances", @@ -611,11 +1134,11 @@ name = "bifrost-cross-in-out" version = "0.8.0" dependencies = [ "bifrost-currencies", + "bifrost-primitives", "frame-benchmarking", "frame-support", "frame-system", "log", - "node-primitives", "orml-tokens", "orml-traits", "pallet-balances", @@ -625,7 +1148,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", + "staging-xcm", ] [[package]] @@ -653,15 +1176,15 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "bifrost-runtime-common", "bifrost-ve-minting", "env_logger 0.10.0", "frame-benchmarking", "frame-support", "frame-system", - "hex-literal 0.3.4", + "hex-literal 0.4.1", "log", - "node-primitives", "orml-tokens", "orml-traits", "pallet-balances", @@ -679,8 +1202,8 @@ name = "bifrost-farming-rpc-api" version = "0.8.0" dependencies = [ "bifrost-farming-rpc-runtime-api", + "bifrost-primitives", "jsonrpsee", - "node-primitives", "parity-scale-codec", "serde", "sp-api", @@ -694,7 +1217,7 @@ dependencies = [ name = "bifrost-farming-rpc-runtime-api" version = "0.8.0" dependencies = [ - "node-primitives", + "bifrost-primitives", "parity-scale-codec", "sp-api", "sp-std", @@ -706,15 +1229,15 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "bifrost-slp", "bifrost-vtoken-minting", "cumulus-primitives-core", "frame-benchmarking", "frame-support", "frame-system", - "hex-literal 0.3.4", + "hex-literal 0.4.1", "log", - "node-primitives", "orml-tokens", "orml-traits", "orml-xtokens", @@ -727,9 +1250,9 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "zenlink-protocol", ] @@ -739,15 +1262,16 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "bifrost-salp", "bifrost-vtoken-voting", + "bifrost-xcm-interface", "cumulus-primitives-core", "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", "log", - "node-primitives", "orml-tokens", "orml-traits", "pallet-balances", @@ -760,10 +1284,9 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", - "xcm-interface", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "zenlink-protocol", ] @@ -772,8 +1295,8 @@ name = "bifrost-flexible-fee-rpc" version = "0.8.0" dependencies = [ "bifrost-flexible-fee-rpc-runtime-api", + "bifrost-primitives", "jsonrpsee", - "node-primitives", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", @@ -787,7 +1310,7 @@ dependencies = [ name = "bifrost-flexible-fee-rpc-runtime-api" version = "0.8.0" dependencies = [ - "node-primitives", + "bifrost-primitives", "parity-scale-codec", "sp-api", ] @@ -796,68 +1319,33 @@ dependencies = [ name = "bifrost-kusama-integration-tests" version = "0.8.0" dependencies = [ + "asset-hub-kusama-runtime", "bifrost-asset-registry", - "bifrost-flexible-fee", - "bifrost-flexible-fee-rpc-runtime-api", "bifrost-kusama-runtime", - "bifrost-runtime-common", - "bifrost-salp", - "bifrost-salp-rpc-runtime-api", + "bifrost-primitives", "bifrost-slp", - "bifrost-vesting", - "bifrost-vsbond-auction", - "bifrost-vtoken-minting", "bifrost-vtoken-voting", - "cumulus-pallet-aura-ext", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-parachain-inherent", - "cumulus-primitives-timestamp", - "cumulus-primitives-utility", - "cumulus-test-relay-sproof-builder", "env_logger 0.10.0", "frame-support", "frame-system", - "hex", - "hex-literal 0.3.4", - "kusama-runtime", - "log", - "node-primitives", - "orml-tokens", - "orml-traits", - "orml-unknown-tokens", - "orml-xcm-support", - "orml-xtokens", + "integration-tests-common", + "pallet-asset-conversion", + "pallet-assets", "pallet-balances", - "pallet-collator-selection", "pallet-conviction-voting", - "pallet-membership", + "pallet-message-queue", "pallet-referenda", - "pallet-session", - "pallet-staking", - "pallet-transaction-payment", "pallet-xcm", - "parachain-info", + "parachains-common", "parity-scale-codec", - "polkadot-parachain", - "polkadot-primitives", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "polkadot-runtime-parachains", - "serde", "sp-io", "sp-runtime", - "sp-std", - "sp-trie", - "statemine-runtime", - "static_assertions", - "xcm", - "xcm-builder", + "staging-kusama-runtime", + "staging-xcm", "xcm-emulator", - "xcm-executor", - "zenlink-protocol", - "zenlink-protocol-runtime-api", ] [[package]] @@ -873,6 +1361,7 @@ dependencies = [ "bifrost-fee-share", "bifrost-flexible-fee", "bifrost-flexible-fee-rpc-runtime-api", + "bifrost-primitives", "bifrost-runtime-common", "bifrost-salp", "bifrost-salp-rpc-runtime-api", @@ -888,6 +1377,7 @@ dependencies = [ "bifrost-vstoken-conversion", "bifrost-vtoken-minting", "bifrost-vtoken-voting", + "bifrost-xcm-interface", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -903,10 +1393,9 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "hex-literal 0.3.4", + "hex-literal 0.4.1", "log", "merkle-distributor", - "node-primitives", "nutsfinance-stable-asset", "orml-tokens", "orml-traits", @@ -918,7 +1407,6 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-bounties", - "pallet-collator-selection", "pallet-collective", "pallet-conviction-voting", "pallet-democracy", @@ -944,7 +1432,7 @@ dependencies = [ "parachain-info", "parachain-staking", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "scale-info", "smallvec", @@ -958,17 +1446,17 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", + "sp-staking", "sp-std", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", - "strum", - "strum_macros", + "strum 0.24.1", + "strum_macros 0.24.3", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", - "xcm-interface", "zenlink-protocol", "zenlink-protocol-runtime-api", "zenlink-stable-amm", @@ -980,63 +1468,26 @@ dependencies = [ name = "bifrost-polkadot-integration-tests" version = "0.8.0" dependencies = [ + "asset-hub-kusama-runtime", "bifrost-asset-registry", - "bifrost-flexible-fee", - "bifrost-flexible-fee-rpc-runtime-api", "bifrost-polkadot-runtime", - "bifrost-runtime-common", - "bifrost-salp", - "bifrost-salp-rpc-runtime-api", - "bifrost-slp", - "bifrost-vesting", - "bifrost-vsbond-auction", - "bifrost-vtoken-minting", - "cumulus-pallet-aura-ext", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-parachain-inherent", - "cumulus-primitives-timestamp", - "cumulus-primitives-utility", - "cumulus-test-relay-sproof-builder", - "env_logger 0.10.0", + "bifrost-primitives", "frame-support", "frame-system", - "hex", - "hex-literal 0.3.4", - "log", - "node-primitives", - "orml-tokens", - "orml-traits", - "orml-unknown-tokens", - "orml-xcm-support", - "orml-xtokens", + "integration-tests-common", + "pallet-asset-conversion", + "pallet-assets", "pallet-balances", - "pallet-collator-selection", - "pallet-membership", - "pallet-staking", - "pallet-transaction-payment", "pallet-xcm", - "parachain-info", + "parachains-common", "parity-scale-codec", - "polkadot-parachain", - "polkadot-primitives", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "polkadot-runtime", "polkadot-runtime-parachains", - "serde", - "sp-io", "sp-runtime", - "sp-std", - "sp-trie", - "static_assertions", - "xcm", - "xcm-builder", + "staging-xcm", "xcm-emulator", - "xcm-executor", - "zenlink-protocol", - "zenlink-protocol-runtime-api", ] [[package]] @@ -1052,6 +1503,7 @@ dependencies = [ "bifrost-fee-share", "bifrost-flexible-fee", "bifrost-flexible-fee-rpc-runtime-api", + "bifrost-primitives", "bifrost-runtime-common", "bifrost-salp", "bifrost-salp-rpc-runtime-api", @@ -1067,6 +1519,7 @@ dependencies = [ "bifrost-vstoken-conversion", "bifrost-vtoken-minting", "bifrost-vtoken-voting", + "bifrost-xcm-interface", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -1082,10 +1535,9 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "hex-literal 0.3.4", + "hex-literal 0.4.1", "log", "merkle-distributor", - "node-primitives", "nutsfinance-stable-asset", "orml-tokens", "orml-traits", @@ -1122,7 +1574,7 @@ dependencies = [ "pallet-xcm", "parachain-info", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "scale-info", "smallvec", @@ -1136,26 +1588,44 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", + "sp-staking", "sp-std", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", - "strum", - "strum_macros", + "strum 0.24.1", + "strum_macros 0.24.3", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", - "xcm-interface", "zenlink-protocol", "zenlink-protocol-runtime-api", ] +[[package]] +name = "bifrost-primitives" +version = "0.8.0" +dependencies = [ + "bstringify", + "frame-support", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", + "staging-xcm", + "zenlink-protocol", +] + [[package]] name = "bifrost-runtime-common" version = "0.8.0" dependencies = [ "bifrost-asset-registry", + "bifrost-primitives", + "bifrost-xcm-interface", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", "cumulus-pallet-xcm", @@ -1168,7 +1638,6 @@ dependencies = [ "frame-system", "frame-system-rpc-runtime-api", "log", - "node-primitives", "orml-tokens", "orml-traits", "orml-xcm-support", @@ -1184,7 +1653,7 @@ dependencies = [ "pallet-xcm", "parachain-info", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "sp-api", "sp-arithmetic", "sp-block-builder", @@ -1198,10 +1667,9 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", - "xcm", - "xcm-builder", - "xcm-executor", - "xcm-interface", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "zenlink-protocol", "zenlink-protocol-runtime-api", ] @@ -1212,14 +1680,15 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "bifrost-stable-pool", "bifrost-vtoken-minting", + "bifrost-xcm-interface", "cumulus-primitives-core", "frame-benchmarking", "frame-support", "frame-system", "log", - "node-primitives", "nutsfinance-stable-asset", "orml-tokens", "orml-traits", @@ -1236,10 +1705,9 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", - "xcm-interface", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "zenlink-protocol", ] @@ -1247,9 +1715,9 @@ dependencies = [ name = "bifrost-salp-rpc-api" version = "0.8.0" dependencies = [ + "bifrost-primitives", "bifrost-salp-rpc-runtime-api", "jsonrpsee", - "node-primitives", "parity-scale-codec", "sp-api", "sp-blockchain", @@ -1262,7 +1730,7 @@ dependencies = [ name = "bifrost-salp-rpc-runtime-api" version = "0.8.0" dependencies = [ - "node-primitives", + "bifrost-primitives", "parity-scale-codec", "sp-api", ] @@ -1273,15 +1741,16 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "bifrost-vtoken-minting", + "bifrost-xcm-interface", "cumulus-primitives-core", "env_logger 0.10.0", "frame-benchmarking", "frame-support", "frame-system", - "hex-literal 0.3.4", + "hex-literal 0.4.1", "log", - "node-primitives", "orml-tokens", "orml-traits", "orml-xtokens", @@ -1291,17 +1760,16 @@ dependencies = [ "pallet-xcm", "parachain-staking", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "scale-info", "sp-arithmetic", "sp-core", "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", - "xcm-interface", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -1310,17 +1778,18 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "bifrost-runtime-common", "bifrost-slp", "bifrost-stable-pool", "bifrost-vtoken-minting", + "bifrost-xcm-interface", "cumulus-pallet-xcm", "cumulus-primitives-core", "frame-benchmarking", "frame-support", "frame-system", "hex-literal 0.3.4", - "node-primitives", "nutsfinance-stable-asset", "orml-tokens", "orml-traits", @@ -1333,12 +1802,12 @@ dependencies = [ "scale-info", "serde", "sp-core", + "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", - "xcm-interface", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "xcm-simulator", "zenlink-protocol", ] @@ -1349,6 +1818,7 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "bifrost-runtime-common", "bifrost-vtoken-minting", "env_logger 0.10.0", @@ -1356,7 +1826,6 @@ dependencies = [ "frame-support", "frame-system", "log", - "node-primitives", "nutsfinance-stable-asset", "orml-tokens", "orml-traits", @@ -1369,18 +1838,18 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] name = "bifrost-stable-pool-rpc-api" version = "0.8.0" dependencies = [ + "bifrost-primitives", "bifrost-stable-pool-rpc-runtime-api", "jsonrpsee", - "node-primitives", "parity-scale-codec", "serde", "sp-api", @@ -1394,7 +1863,7 @@ dependencies = [ name = "bifrost-stable-pool-rpc-runtime-api" version = "0.8.0" dependencies = [ - "node-primitives", + "bifrost-primitives", "parity-scale-codec", "sp-api", "sp-std", @@ -1406,15 +1875,15 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "bifrost-slp", "bifrost-vtoken-minting", "cumulus-primitives-core", "frame-benchmarking", "frame-support", "frame-system", - "hex-literal 0.3.4", + "hex-literal 0.4.1", "log", - "node-primitives", "orml-tokens", "orml-traits", "orml-xtokens", @@ -1427,9 +1896,9 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "zenlink-protocol", ] @@ -1440,6 +1909,7 @@ dependencies = [ "bifrost-asset-registry", "bifrost-currencies", "bifrost-farming", + "bifrost-primitives", "bifrost-runtime-common", "bifrost-slp", "bifrost-vtoken-minting", @@ -1449,7 +1919,6 @@ dependencies = [ "frame-system", "hex-literal 0.3.4", "log", - "node-primitives", "orml-tokens", "orml-traits", "orml-xtokens", @@ -1462,9 +1931,9 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -1472,11 +1941,11 @@ name = "bifrost-token-issuer" version = "0.8.0" dependencies = [ "bifrost-currencies", + "bifrost-primitives", "frame-benchmarking", "frame-support", "frame-system", "log", - "node-primitives", "orml-tokens", "orml-traits", "pallet-balances", @@ -1495,6 +1964,7 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "bifrost-runtime-common", "bifrost-slp", "bifrost-vtoken-minting", @@ -1503,9 +1973,8 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hex-literal 0.3.4", + "hex-literal 0.4.1", "log", - "node-primitives", "orml-tokens", "orml-traits", "orml-xtokens", @@ -1518,18 +1987,18 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] name = "bifrost-ve-minting-rpc-api" version = "0.8.0" dependencies = [ + "bifrost-primitives", "bifrost-ve-minting-rpc-runtime-api", "jsonrpsee", - "node-primitives", "parity-scale-codec", "serde", "sp-api", @@ -1543,7 +2012,7 @@ dependencies = [ name = "bifrost-ve-minting-rpc-runtime-api" version = "0.8.0" dependencies = [ - "node-primitives", + "bifrost-primitives", "parity-scale-codec", "sp-api", "sp-core", @@ -1570,11 +2039,11 @@ dependencies = [ name = "bifrost-vsbond-auction" version = "0.8.0" dependencies = [ + "bifrost-primitives", "frame-benchmarking", "frame-support", "frame-system", "log", - "node-primitives", "orml-tokens", "orml-traits", "parity-scale-codec", @@ -1592,11 +2061,11 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "frame-benchmarking", "frame-support", "frame-system", - "hex-literal 0.3.4", - "node-primitives", + "hex-literal 0.4.1", "orml-tokens", "orml-traits", "pallet-balances", @@ -1607,7 +2076,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm-builder", + "staging-xcm-builder", ] [[package]] @@ -1616,6 +2085,7 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-currencies", + "bifrost-primitives", "bifrost-runtime-common", "bifrost-slp", "cumulus-primitives-core", @@ -1623,9 +2093,8 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hex-literal 0.3.4", + "hex-literal 0.4.1", "log", - "node-primitives", "orml-tokens", "orml-traits", "orml-xtokens", @@ -1638,9 +2107,9 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -1649,12 +2118,12 @@ version = "0.8.0" dependencies = [ "assert_matches", "bifrost-currencies", + "bifrost-primitives", "cumulus-primitives-core", "frame-benchmarking", "frame-support", "frame-system", "log", - "node-primitives", "orml-tokens", "orml-traits", "pallet-balances", @@ -1666,15 +2135,38 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + +[[package]] +name = "bifrost-xcm-interface" +version = "0.8.0" +dependencies = [ + "bifrost-asset-registry", + "bifrost-primitives", + "cumulus-primitives-core", + "frame-benchmarking", + "frame-support", + "frame-system", + "orml-traits", + "pallet-balances", + "pallet-xcm", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-executor", ] [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "hash-db", "log", @@ -1691,9 +2183,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.64.0" +version = "0.65.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" dependencies = [ "bitflags 1.3.2", "cexpr", @@ -1701,14 +2193,30 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", + "prettyplease 0.2.15", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 1.0.109", + "syn 2.0.38", +] + +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes", ] +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + [[package]] name = "bitflags" version = "1.3.2" @@ -1717,9 +2225,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bitvec" @@ -1742,40 +2250,49 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +dependencies = [ + "arrayvec 0.4.12", + "constant_time_eq 0.1.5", +] + [[package]] name = "blake2b_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq 0.3.0", ] [[package]] name = "blake2s_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq 0.3.0", ] [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec 0.7.4", "cc", "cfg-if", "constant_time_eq 0.3.0", - "digest 0.10.7", ] [[package]] @@ -1833,11 +2350,27 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +[[package]] +name = "blocking" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c36a4d0d48574b3dd360b4b7d95cc651d2b6557b6402848a27d4b228a473e2a" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "fastrand 2.0.1", + "futures-io", + "futures-lite", + "piper", + "tracing", +] + [[package]] name = "bounded-collections" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" +checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" dependencies = [ "log", "parity-scale-codec", @@ -1855,82 +2388,534 @@ dependencies = [ ] [[package]] -name = "bs58" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +name = "bp-bridge-hub-cumulus" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-messages", + "bp-polkadot-core", + "bp-runtime", + "frame-support", + "frame-system", + "polkadot-primitives", + "sp-api", + "sp-std", +] [[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +name = "bp-bridge-hub-rococo" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "lazy_static", - "memchr", - "regex-automata 0.1.10", + "bp-bridge-hub-cumulus", + "bp-messages", + "bp-runtime", + "frame-support", + "sp-api", + "sp-runtime", + "sp-std", ] [[package]] -name = "bstr" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +name = "bp-bridge-hub-wococo" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "memchr", - "serde", + "bp-bridge-hub-cumulus", + "bp-messages", + "bp-runtime", + "frame-support", + "sp-api", + "sp-runtime", + "sp-std", ] [[package]] -name = "bstringify" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd769563b4ea2953e2825c9e6b7470a5f55f67e0be00030bf3e390a2a6071f64" +name = "bp-header-chain" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-runtime", + "finality-grandpa", + "frame-support", + "parity-scale-codec", + "scale-info", + "serde", + "sp-consensus-grandpa", + "sp-core", + "sp-runtime", + "sp-std", +] [[package]] -name = "build-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" +name = "bp-messages" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "semver 0.6.0", + "bp-header-chain", + "bp-runtime", + "frame-support", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-std", ] [[package]] -name = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +name = "bp-parachains" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-header-chain", + "bp-polkadot-core", + "bp-runtime", + "frame-support", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] [[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +name = "bp-polkadot-core" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-messages", + "bp-runtime", + "frame-support", + "frame-system", + "parity-scale-codec", + "parity-util-mem", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] [[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +name = "bp-relayers" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-messages", + "bp-runtime", + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] [[package]] -name = "bytemuck" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" - +name = "bp-rococo" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-header-chain", + "bp-polkadot-core", + "bp-runtime", + "frame-support", + "sp-api", + "sp-std", +] + +[[package]] +name = "bp-runtime" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "frame-support", + "frame-system", + "hash-db", + "impl-trait-for-tuples", + "log", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "trie-db", +] + +[[package]] +name = "bp-test-utils" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-header-chain", + "bp-parachains", + "bp-polkadot-core", + "bp-runtime", + "ed25519-dalek 1.0.1", + "finality-grandpa", + "parity-scale-codec", + "sp-application-crypto", + "sp-consensus-grandpa", + "sp-core", + "sp-runtime", + "sp-std", + "sp-trie", +] + +[[package]] +name = "bp-wococo" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-header-chain", + "bp-polkadot-core", + "bp-rococo", + "bp-runtime", + "frame-support", + "sp-api", + "sp-std", +] + +[[package]] +name = "bp-xcm-bridge-hub-router" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "bridge-hub-kusama-runtime" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "kusama-runtime-constants", + "log", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-multisig", + "pallet-session", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", +] + +[[package]] +name = "bridge-hub-polkadot-runtime" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "log", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-multisig", + "pallet-session", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "polkadot-runtime-constants", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", +] + +[[package]] +name = "bridge-hub-rococo-runtime" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-bridge-hub-rococo", + "bp-bridge-hub-wococo", + "bp-header-chain", + "bp-messages", + "bp-parachains", + "bp-polkadot-core", + "bp-relayers", + "bp-rococo", + "bp-runtime", + "bp-wococo", + "bridge-runtime-common", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "log", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-bridge-grandpa", + "pallet-bridge-messages", + "pallet-bridge-parachains", + "pallet-bridge-relayers", + "pallet-collator-selection", + "pallet-multisig", + "pallet-session", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "rococo-runtime-constants", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", +] + +[[package]] +name = "bridge-runtime-common" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-header-chain", + "bp-messages", + "bp-parachains", + "bp-polkadot-core", + "bp-relayers", + "bp-runtime", + "bp-xcm-bridge-hub-router", + "frame-support", + "frame-system", + "hash-db", + "log", + "pallet-bridge-grandpa", + "pallet-bridge-messages", + "pallet-bridge-parachains", + "pallet-bridge-relayers", + "pallet-transaction-payment", + "pallet-utility", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-trie", + "staging-xcm", + "staging-xcm-builder", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata 0.1.10", +] + +[[package]] +name = "bstr" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bstringify" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd769563b4ea2953e2825c9e6b7470a5f55f67e0be00030bf3e390a2a6071f64" + +[[package]] +name = "build-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" +dependencies = [ + "semver 0.6.0", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" + [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bzip2-sys" @@ -1954,9 +2939,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" dependencies = [ "serde", ] @@ -1969,7 +2954,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.17", + "semver 1.0.20", "serde", "serde_json", "thiserror", @@ -1977,11 +2962,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -2006,9 +2992,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.10.3" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" dependencies = [ "smallvec", ] @@ -2037,6 +3023,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher 0.4.4", + "cpufeatures", +] + [[package]] name = "chacha20poly1305" version = "0.9.1" @@ -2044,36 +3041,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ "aead 0.4.3", - "chacha20", + "chacha20 0.8.2", "cipher 0.3.0", - "poly1305", + "poly1305 0.7.2", "zeroize", ] [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] name = "cid" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" +checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" dependencies = [ "core2", "multibase", - "multihash 0.16.3", + "multihash", "serde", "unsigned-varint", ] @@ -2128,20 +3124,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.11" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.11" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" dependencies = [ "anstream", "anstyle", @@ -2151,27 +3146,27 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "coarsetime" -version = "0.1.23" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90d114103adbc625300f346d4d09dfb4ab1c4a8df6868435dd903392ecf4354" +checksum = "a73ef0d00d14301df35d0f13f5ea32344de6b00837485c358458f1e7f2d27db4" dependencies = [ "libc", "once_cell", @@ -2189,20 +3184,90 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "collectives-polkadot-runtime" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "log", + "pallet-alliance", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-collective", + "pallet-core-fellowship", + "pallet-multisig", + "pallet-preimage", + "pallet-proxy", + "pallet-ranked-collective", + "pallet-referenda", + "pallet-salary", + "pallet-scheduler", + "pallet-session", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", + "pallet-xcm", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "polkadot-runtime-constants", + "scale-info", + "smallvec", + "sp-api", + "sp-arithmetic", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", +] + [[package]] name = "color-print" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2a5e6504ed8648554968650feecea00557a3476bc040d0ffc33080e66b646d0" +checksum = "7a858372ff14bab9b1b30ea504f2a4bc534582aee3e42ba2d41d2a7baba63d5d" dependencies = [ "color-print-proc-macro", ] [[package]] name = "color-print-proc-macro" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51beaa537d73d2d1ff34ee70bc095f170420ab2ec5d687ecd3ec2b0d092514b" +checksum = "57e37866456a721d0a404439a1adae37a31be4e0055590d053dfe6981e05003f" dependencies = [ "nom", "proc-macro2", @@ -2218,20 +3283,40 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "comfy-table" -version = "6.2.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e959d788268e3bf9d35ace83e81b124190378e4c91c9067524675e33394b8ba" +checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686" dependencies = [ - "strum", - "strum_macros", + "strum 0.25.0", + "strum_macros 0.25.3", "unicode-width", ] +[[package]] +name = "common" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "fflonk", + "merlin 3.0.0", +] + +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] @@ -2251,15 +3336,35 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.4" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "const-random" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11df32a13d7892ec42d51d3d175faba5211ffe13ed25d4fb348ac9e9ce835593" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "tiny-keccak", +] [[package]] name = "constant_time_eq" -version = "0.2.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "constant_time_eq" @@ -2319,37 +3424,36 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" dependencies = [ "libc", ] [[package]] name = "cranelift-bforest" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc42ba2e232e5b20ff7dc299a812d53337dadce9a7e39a238e6a5cb82d2e57b" +checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "253531aca9b6f56103c9420369db3263e784df39aa1c90685a1f69cfbba0623e" +checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" dependencies = [ - "arrayvec 0.7.4", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", "cranelift-isle", - "gimli 0.26.2", - "hashbrown 0.12.3", + "gimli 0.27.3", + "hashbrown 0.13.2", "log", "regalloc2", "smallvec", @@ -2358,33 +3462,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f2154365e2bff1b1b8537a7181591fdff50d8e27fa6e40d5c69c3bad0ca7c8" +checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687e14e3f5775248930e0d5a84195abef8b829958e9794bf8d525104993612b4" +checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" [[package]] name = "cranelift-entity" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8483c2db6f45fe9ace984e5adc5d058102227e4c62e5aa2054e16b0275fd3a6e" +checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" dependencies = [ "cranelift-codegen", "log", @@ -2394,15 +3498,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9793158837678902446c411741d87b43f57dadfb944f2440db4287cda8cbd59" +checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" [[package]] name = "cranelift-native" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72668c7755f2b880665cb422c8ad2d56db58a88b9bebfef0b73edc2277c13c49" +checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" dependencies = [ "cranelift-codegen", "libc", @@ -2411,14 +3515,14 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852ce4b088b44ac4e29459573943009a70d1b192c8d77ef949b4e814f656fc1" +checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.5", "log", "smallvec", "wasmparser", @@ -2449,16 +3553,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" version = "0.8.3" @@ -2522,9 +3616,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -2540,7 +3634,7 @@ checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.17.0", ] [[package]] @@ -2584,12 +3678,13 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "clap", "parity-scale-codec", "sc-chain-spec", "sc-cli", + "sc-client-api", "sc-service", "sp-core", "sp-runtime", @@ -2599,7 +3694,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -2622,18 +3717,29 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", + "cumulus-client-collator", "cumulus-client-consensus-common", + "cumulus-client-consensus-proposer", + "cumulus-primitives-aura", "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-relay-chain-interface", "futures", "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", "sc-client-api", "sc-consensus", "sc-consensus-aura", + "sc-consensus-babe", "sc-consensus-slots", "sc-telemetry", + "schnellru", "sp-api", "sp-application-crypto", "sp-block-builder", @@ -2644,6 +3750,8 @@ dependencies = [ "sp-inherents", "sp-keystore", "sp-runtime", + "sp-state-machine", + "sp-timestamp", "substrate-prometheus-endpoint", "tracing", ] @@ -2651,7 +3759,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -2664,18 +3772,38 @@ dependencies = [ "polkadot-primitives", "sc-client-api", "sc-consensus", + "sc-consensus-babe", "schnellru", "sp-blockchain", "sp-consensus", + "sp-consensus-slots", + "sp-core", "sp-runtime", + "sp-timestamp", "sp-trie", + "substrate-prometheus-endpoint", "tracing", ] +[[package]] +name = "cumulus-client-consensus-proposer" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "anyhow", + "async-trait", + "cumulus-primitives-parachain-inherent", + "sp-consensus", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -2684,7 +3812,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "polkadot-node-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "sc-client-api", "sp-blockchain", @@ -2698,7 +3826,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2722,7 +3850,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -2757,11 +3885,13 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "cumulus-pallet-parachain-system", "frame-support", "frame-system", "pallet-aura", + "pallet-timestamp", "parity-scale-codec", "scale-info", "sp-application-crypto", @@ -2773,7 +3903,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2784,13 +3914,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", + "staging-xcm", ] [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -2802,7 +3932,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "scale-info", "sp-core", "sp-externalities", @@ -2813,25 +3943,27 @@ dependencies = [ "sp-std", "sp-trie", "sp-version", - "xcm", + "staging-xcm", + "trie-db", ] [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "cumulus-pallet-session-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "pallet-session", @@ -2843,7 +3975,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2853,15 +3985,16 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", + "staging-xcm", ] [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", + "frame-benchmarking", "frame-support", "frame-system", "log", @@ -2872,31 +4005,45 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-executor", + "staging-xcm", + "staging-xcm-executor", +] + +[[package]] +name = "cumulus-primitives-aura" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-primitives", + "sp-api", + "sp-consensus-aura", + "sp-runtime", + "sp-std", ] [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "scale-info", "sp-api", "sp-runtime", "sp-std", "sp-trie", - "xcm", + "staging-xcm", ] [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2919,7 +4066,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "futures", @@ -2932,7 +4079,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2942,15 +4089,15 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2958,7 +4105,6 @@ dependencies = [ "futures", "futures-timer", "polkadot-cli", - "polkadot-client", "polkadot-service", "sc-cli", "sc-client-api", @@ -2975,7 +4121,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2993,15 +4139,14 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 6.1.0", + "array-bytes", "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", "cumulus-relay-chain-rpc-interface", "futures", - "lru 0.9.0", "polkadot-availability-recovery", "polkadot-collator-protocol", "polkadot-core-primitives", @@ -3013,47 +4158,53 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sc-authority-discovery", - "sc-client-api", "sc-network", "sc-network-common", "sc-service", "sc-tracing", "sc-utils", + "schnellru", "sp-api", - "sp-blockchain", "sp-consensus", "sp-consensus-babe", "sp-runtime", - "tokio", "tracing", ] [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", + "either", "futures", "futures-timer", "jsonrpsee", - "lru 0.9.0", "parity-scale-codec", + "pin-project", "polkadot-overseer", + "rand 0.8.5", "sc-client-api", "sc-rpc-api", "sc-service", + "schnellru", "serde", "serde_json", + "smoldot", + "smoldot-light", "sp-api", "sp-authority-discovery", "sp-consensus-babe", "sp-core", + "sp-runtime", "sp-state-machine", "sp-storage", + "thiserror", "tokio", + "tokio-util", "tracing", "url", ] @@ -3061,7 +4212,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -3069,6 +4220,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-std", + "sp-trie", ] [[package]] @@ -3099,23 +4251,50 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.1" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", "fiat-crypto", - "packed_simd_2", - "platforms 3.0.2", + "platforms", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "curve25519-dalek-ng" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.6.4", + "subtle-ng", + "zeroize", +] + [[package]] name = "cxx" -version = "1.0.100" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e928d50d5858b744d1ea920b790641129c347a770d1530c3a85b77705a5ee031" +checksum = "c390c123d671cc547244943ecad81bdaab756c6ea332d9ca9c1f48d952a24895" dependencies = [ "cc", "cxxbridge-flags", @@ -3125,9 +4304,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.100" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8332ba63f8a8040ca479de693150129067304a3496674477fff6d0c372cc34ae" +checksum = "00d3d3ac9ffb900304edf51ca719187c779f4001bb544f26c4511d621de905cf" dependencies = [ "cc", "codespan-reporting", @@ -3135,24 +4314,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "cxxbridge-flags" -version = "1.0.100" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5966a5a87b6e9bb342f5fab7170a93c77096efe199872afffc4b477cfeb86957" +checksum = "94415827ecfea0f0c74c8cad7d1a86ddb3f05354d6a6ddeda0adee5e875d2939" [[package]] name = "cxxbridge-macro" -version = "1.0.100" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b2dab6991c7ab1572fea8cb049db819b1aeea1e2dac74c0869f244d9f21a7c" +checksum = "e33dbbe9f5621c9247f97ec14213b04f350bff4b6cebefe834c60055db266ecf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] @@ -3229,9 +4408,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "zeroize", @@ -3265,6 +4444,15 @@ dependencies = [ "rusticata-macros", ] +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] + [[package]] name = "derivative" version = "2.2.0" @@ -3416,7 +4604,51 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", +] + +[[package]] +name = "dleq_vrf" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-scale 0.0.10", + "ark-secret-scalar", + "ark-serialize", + "ark-std", + "ark-transcript", + "arrayvec 0.7.4", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "docify" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee528c501ddd15d5181997e9518e59024844eac44fd1e40cb20ddb2a8562fa" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca01728ab2679c464242eca99f94e2ce0514b52ac9ad950e2ed03fca991231c" +dependencies = [ + "common-path", + "derive-syn-parse", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.38", + "termcolor", + "toml 0.7.8", + "walkdir", ] [[package]] @@ -3433,9 +4665,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dtoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "519b83cd10f5f6e969625a409f735182bea5558cd8b64c655806ceaae36f1999" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dyn-clonable" @@ -3460,9 +4692,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "ecdsa" @@ -3478,13 +4710,13 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.7" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ - "der 0.7.7", + "der 0.7.8", "digest 0.10.7", - "elliptic-curve 0.13.5", + "elliptic-curve 0.13.6", "rfc6979 0.4.0", "signature 2.1.0", "spki 0.7.2", @@ -3499,6 +4731,16 @@ dependencies = [ "signature 1.6.4", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8 0.10.2", + "signature 2.1.0", +] + [[package]] name = "ed25519-dalek" version = "1.0.1" @@ -3506,13 +4748,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ "curve25519-dalek 3.2.0", - "ed25519", + "ed25519 1.5.3", "rand 0.7.3", "serde", "sha2 0.9.9", "zeroize", ] +[[package]] +name = "ed25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +dependencies = [ + "curve25519-dalek 4.1.1", + "ed25519 2.2.3", + "rand_core 0.6.4", + "serde", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "ed25519-zebra" version = "3.1.0" @@ -3527,11 +4783,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek 4.1.1", + "ed25519 2.2.3", + "hashbrown 0.14.2", + "hex", + "rand_core 0.6.4", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" @@ -3557,19 +4828,19 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.13.5" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.2", + "crypto-bigint 0.5.3", "digest 0.10.7", "ff 0.13.0", "generic-array 0.14.7", "group 0.13.0", "pkcs8 0.10.2", "rand_core 0.6.4", - "sec1 0.7.2", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -3594,33 +4865,33 @@ dependencies = [ [[package]] name = "enumflags2" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "enumn" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9838a970f5de399d3070ae1739e131986b2f5dcc223c7423ca0927e3a878522" +checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] @@ -3663,23 +4934,39 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys 0.48.0", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "ethbloom" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" dependencies = [ - "cc", - "libc", + "crunchy", + "fixed-hash", + "impl-rlp", + "impl-serde", + "tiny-keccak", +] + +[[package]] +name = "ethereum-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-rlp", + "impl-serde", + "primitive-types", + "uint", ] [[package]] @@ -3688,6 +4975,17 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29e56284f00d94c1bc7fd3c77027b4623c88c1f53d8d2394c6199f2921dea325" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite 0.2.13", +] + [[package]] name = "exit-future" version = "0.2.0" @@ -3721,19 +5019,6 @@ dependencies = [ "quote", ] -[[package]] -name = "expander" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" -dependencies = [ - "blake2", - "fs-err", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "expander" version = "2.0.0" @@ -3744,7 +5029,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] @@ -3768,6 +5053,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "fatality" version = "0.0.6" @@ -3822,11 +5113,24 @@ dependencies = [ "subtle", ] +[[package]] +name = "fflonk" +version = "0.1.0" +source = "git+https://github.com/w3f/fflonk#1beb0585e1c8488956fac7f05da061f9b41e8948" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "merlin 3.0.0", +] + [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" [[package]] name = "file-per-thread-logger" @@ -3840,13 +5144,13 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "windows-sys 0.48.0", ] @@ -3886,9 +5190,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "libz-sys", @@ -3913,7 +5217,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", ] @@ -3936,7 +5240,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-support-procedural", @@ -3961,10 +5265,10 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "Inflector", - "array-bytes 4.2.0", + "array-bytes", "chrono", "clap", "comfy-table", @@ -3973,7 +5277,7 @@ dependencies = [ "frame-system", "gethostname", "handlebars", - "itertools", + "itertools 0.10.5", "lazy_static", "linked-hash-map", "log", @@ -3995,12 +5299,13 @@ dependencies = [ "sp-database", "sp-externalities", "sp-inherents", + "sp-io", "sp-keystore", "sp-runtime", "sp-state-machine", - "sp-std", "sp-storage", "sp-trie", + "sp-wasm-interface", "thiserror", "thousands", ] @@ -4008,18 +5313,18 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -4036,11 +5341,12 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", "frame-try-runtime", + "log", "parity-scale-codec", "scale-info", "sp-core", @@ -4052,9 +5358,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "15.1.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ "cfg-if", "parity-scale-codec", @@ -4065,7 +5371,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-recursion", "futures", @@ -4077,87 +5383,99 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", + "sp-state-machine", "spinners", "substrate-rpc-client", "tokio", + "tokio-retry", ] [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "aquamarine", "bitflags 1.3.2", + "docify", "environmental", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "k256", "log", - "once_cell", + "macro_magic", "parity-scale-codec", "paste", "scale-info", "serde", + "serde_json", "smallvec", "sp-api", "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", + "sp-debug-derive", + "sp-genesis-builder", "sp-inherents", "sp-io", + "sp-metadata-ir", "sp-runtime", "sp-staking", "sp-state-machine", "sp-std", "sp-tracing", "sp-weights", + "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", + "expander 2.0.0", "frame-support-procedural-tools", - "itertools", + "itertools 0.10.5", + "macro_magic", "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "cfg-if", "frame-support", "log", "parity-scale-codec", @@ -4174,7 +5492,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -4189,7 +5507,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "sp-api", @@ -4198,7 +5516,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "parity-scale-codec", @@ -4229,7 +5547,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.38.4", + "rustix 0.38.20", "windows-sys 0.48.0", ] @@ -4294,12 +5612,12 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", "parking", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.13", "waker-fn", ] @@ -4311,7 +5629,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] @@ -4321,8 +5639,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls 0.20.8", - "webpki 0.22.0", + "rustls 0.20.9", + "webpki 0.22.4", ] [[package]] @@ -4356,7 +5674,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.13", "pin-utils", "slab", ] @@ -4376,7 +5694,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.17.0", ] [[package]] @@ -4385,7 +5703,7 @@ version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.17.0", "version_check", "zeroize", ] @@ -4444,9 +5762,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ "fallible-iterator", "indexmap 1.9.3", @@ -4455,9 +5773,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glob" @@ -4467,12 +5785,12 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1391ab1f92ffcc08911957149833e682aa3fe252b9f45f966d2ef972274c97df" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ "aho-corasick", - "bstr 1.6.0", + "bstr 1.7.0", "fnv", "log", "regex", @@ -4502,9 +5820,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -4521,9 +5839,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.7" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" +checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" dependencies = [ "log", "pest", @@ -4554,7 +5872,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.7", ] [[package]] @@ -4563,14 +5881,19 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.5", ] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +dependencies = [ + "ahash 0.8.5", + "allocator-api2", + "serde", +] [[package]] name = "heck" @@ -4589,9 +5912,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -4660,6 +5983,15 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -4690,14 +6022,14 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.13", ] [[package]] name = "http-range-header" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" @@ -4707,9 +6039,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -4733,8 +6065,8 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.10", - "socket2 0.4.9", + "pin-project-lite 0.2.13", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -4743,32 +6075,33 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", "log", - "rustls 0.20.8", + "rustls 0.21.7", "rustls-native-certs", "tokio", "tokio-rustls", - "webpki-roots", + "webpki-roots 0.23.1", ] [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows 0.48.0", + "windows-core", ] [[package]] @@ -4819,9 +6152,9 @@ dependencies = [ [[package]] name = "if-watch" -version = "3.0.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9465340214b296cd17a0009acdb890d6160010b8adf8f78a00d0d7ab270f79f" +checksum = "bbb892e5777fe09e16f3d44de7802f4daa7267ecbe8c466f19d94e25bb0c303e" dependencies = [ "async-io", "core-foundation", @@ -4833,7 +6166,7 @@ dependencies = [ "rtnetlink", "system-configuration", "tokio", - "windows 0.34.0", + "windows", ] [[package]] @@ -4845,6 +6178,26 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "impl-num-traits" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "951641f13f873bff03d4bf19ae8bec531935ac0ac2cc775f84d7edfdcfed3f17" +dependencies = [ + "integer-sqrt", + "num-traits", + "uint", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + [[package]] name = "impl-serde" version = "0.4.0" @@ -4865,6 +6218,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -4878,19 +6250,25 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.2", ] +[[package]] +name = "indexmap-nostd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" + [[package]] name = "indicatif" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff8cc23a7393a397ed1d7f56e6365cba772aba9f9912ab968b03043c395d057" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", "instant", @@ -4932,6 +6310,59 @@ dependencies = [ "num-traits", ] +[[package]] +name = "integration-tests-common" +version = "1.0.0" +dependencies = [ + "asset-hub-kusama-runtime", + "asset-hub-polkadot-runtime", + "asset-hub-westend-runtime", + "bifrost-kusama-runtime", + "bifrost-polkadot-runtime", + "bp-messages", + "bridge-hub-kusama-runtime", + "bridge-hub-polkadot-runtime", + "bridge-hub-rococo-runtime", + "bridge-runtime-common", + "collectives-polkadot-runtime", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "frame-support", + "kusama-runtime-constants", + "pallet-assets", + "pallet-bridge-messages", + "pallet-im-online", + "pallet-message-queue", + "pallet-staking", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "paste", + "penpal-runtime", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime", + "polkadot-runtime-constants", + "polkadot-runtime-parachains", + "polkadot-service", + "rococo-runtime", + "rococo-runtime-constants", + "sc-consensus-grandpa", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "staging-kusama-runtime", + "staging-xcm", + "westend-runtime", + "westend-runtime-constants", + "xcm-emulator", +] + [[package]] name = "interceptor" version = "0.8.2" @@ -4957,7 +6388,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", "windows-sys 0.48.0", ] @@ -4974,7 +6405,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.3", + "socket2 0.5.5", "widestring", "windows-sys 0.48.0", "winreg", @@ -4982,9 +6413,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" @@ -4992,11 +6423,20 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.4", + "hermit-abi 0.3.3", + "rustix 0.38.20", "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" @@ -5006,17 +6446,26 @@ 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.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -5032,9 +6481,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" +checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" dependencies = [ "jsonrpsee-core", "jsonrpsee-http-client", @@ -5047,9 +6496,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb" +checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" dependencies = [ "futures-util", "http", @@ -5063,14 +6512,14 @@ dependencies = [ "tokio-rustls", "tokio-util", "tracing", - "webpki-roots", + "webpki-roots 0.25.2", ] [[package]] name = "jsonrpsee-core" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" +checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" dependencies = [ "anyhow", "arrayvec 0.7.4", @@ -5096,9 +6545,9 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc345b0a43c6bc49b947ebeb936e886a419ee3d894421790c969cc56040542ad" +checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" dependencies = [ "async-trait", "hyper", @@ -5115,9 +6564,9 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa6da1e4199c10d7b1d0a6e5e8bd8e55f351163b6f4b3cbb044672a69bd4c1c" +checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" dependencies = [ "heck", "proc-macro-crate", @@ -5128,9 +6577,9 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb69dad85df79527c019659a992498d03f8495390496da2f07e6c24c2b356fc" +checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" dependencies = [ "futures-channel", "futures-util", @@ -5150,154 +6599,56 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c" -dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "jsonrpsee-ws-client" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b83daeecfc6517cfe210df24e570fb06213533dfb990318fae781f4c7119dd9" -dependencies = [ - "http", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", -] - -[[package]] -name = "k256" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" -dependencies = [ - "cfg-if", - "ecdsa 0.16.7", - "elliptic-curve 0.13.5", - "once_cell", - "sha2 0.10.7", -] - -[[package]] -name = "keccak" -version = "0.1.4" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "kusama-runtime" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" dependencies = [ - "bitvec", - "frame-benchmarking", - "frame-election-provider-support", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal 0.4.1", - "kusama-runtime-constants", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-bags-list", - "pallet-balances", - "pallet-bounties", - "pallet-child-bounties", - "pallet-collective", - "pallet-conviction-voting", - "pallet-democracy", - "pallet-election-provider-multi-phase", - "pallet-election-provider-support-benchmarking", - "pallet-elections-phragmen", - "pallet-fast-unstake", - "pallet-grandpa", - "pallet-identity", - "pallet-im-online", - "pallet-indices", - "pallet-membership", - "pallet-multisig", - "pallet-nis", - "pallet-nomination-pools", - "pallet-nomination-pools-benchmarking", - "pallet-nomination-pools-runtime-api", - "pallet-offences", - "pallet-offences-benchmarking", - "pallet-preimage", - "pallet-proxy", - "pallet-ranked-collective", - "pallet-recovery", - "pallet-referenda", - "pallet-scheduler", - "pallet-session", - "pallet-session-benchmarking", - "pallet-society", - "pallet-staking", - "pallet-staking-runtime-api", - "pallet-timestamp", - "pallet-tips", - "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-parachains", - "rustc-hex", - "scale-info", + "anyhow", + "beef", "serde", - "serde_derive", - "smallvec", - "sp-api", - "sp-arithmetic", - "sp-authority-discovery", - "sp-block-builder", - "sp-consensus-babe", - "sp-consensus-beefy", - "sp-core", - "sp-inherents", - "sp-io", - "sp-mmr-primitives", - "sp-npos-elections", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-transaction-pool", - "sp-version", - "static_assertions", - "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" +dependencies = [ + "http", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "k256" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +dependencies = [ + "cfg-if", + "ecdsa 0.16.8", + "elliptic-curve 0.13.6", + "once_cell", + "sha2 0.10.8", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", ] [[package]] name = "kusama-runtime-constants" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "polkadot-primitives", @@ -5329,9 +6680,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7a749456510c45f795e8b04a6a3e0976d0139213ecbf465843830ad55e2217" +checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", @@ -5341,6 +6692,17 @@ dependencies = [ "smallvec", ] +[[package]] +name = "landlock" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520baa32708c4e957d2fc3a186bc5bd8d26637c33137f399ddfc202adb240068" +dependencies = [ + "enumflags2", + "libc", + "thiserror", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -5353,42 +6715,13 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" -[[package]] -name = "lend-market" -version = "0.8.0" -dependencies = [ - "bifrost-asset-registry", - "bifrost-currencies", - "frame-benchmarking", - "frame-support", - "frame-system", - "node-primitives", - "num-traits", - "orml-oracle", - "orml-tokens", - "orml-traits", - "pallet-assets", - "pallet-balances", - "pallet-prices", - "pallet-timestamp", - "pallet-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "xcm-builder", -] - [[package]] name = "lend-market-rpc" version = "0.8.0" dependencies = [ + "bifrost-primitives", "jsonrpsee", "lend-market-rpc-runtime-api", - "node-primitives", "parity-scale-codec", "serde", "sp-api", @@ -5402,7 +6735,7 @@ dependencies = [ name = "lend-market-rpc-runtime-api" version = "0.8.0" dependencies = [ - "node-primitives", + "bifrost-primitives", "parity-scale-codec", "sp-api", "sp-runtime", @@ -5410,9 +6743,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -5426,34 +6759,30 @@ dependencies = [ [[package]] name = "libm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - -[[package]] -name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.50.1" +version = "0.51.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7b0104790be871edcf97db9bd2356604984e623a08d825c3f27852290266b8" +checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" dependencies = [ "bytes", "futures", "futures-timer", "getrandom 0.2.10", "instant", - "libp2p-core 0.38.0", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", "libp2p-dns", "libp2p-identify", + "libp2p-identity", "libp2p-kad", "libp2p-mdns", "libp2p-metrics", - "libp2p-mplex", "libp2p-noise", "libp2p-ping", "libp2p-quic", @@ -5464,44 +6793,32 @@ dependencies = [ "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", - "multiaddr 0.16.0", - "parking_lot 0.12.1", + "multiaddr", "pin-project", - "smallvec", ] [[package]] -name = "libp2p-core" -version = "0.38.0" +name = "libp2p-allow-block-list" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a8fcd392ff67af6cc3f03b1426c41f7f26b6b9aff2dc632c1c56dd649e571f" +checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "log", - "multiaddr 0.16.0", - "multihash 0.16.3", - "multistream-select", - "once_cell", - "parking_lot 0.12.1", - "pin-project", - "prost", - "prost-build", - "rand 0.8.5", - "rw-stream-sink", - "sec1 0.3.0", - "sha2 0.10.7", - "smallvec", - "thiserror", - "unsigned-varint", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", "void", - "zeroize", ] [[package]] @@ -5517,8 +6834,8 @@ dependencies = [ "instant", "libp2p-identity", "log", - "multiaddr 0.17.1", - "multihash 0.17.0", + "multiaddr", + "multihash", "multistream-select", "once_cell", "parking_lot 0.12.1", @@ -5534,12 +6851,12 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e42a271c1b49f789b92f7fc87749fa79ce5c7bdc88cbdfacb818a4bca47fec5" +checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" dependencies = [ "futures", - "libp2p-core 0.38.0", + "libp2p-core", "log", "parking_lot 0.12.1", "smallvec", @@ -5548,20 +6865,21 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.41.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c052d0026f4817b44869bfb6810f4e1112f43aec8553f2cb38881c524b563abf" +checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" dependencies = [ "asynchronous-codec", + "either", "futures", "futures-timer", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "lru 0.8.1", - "prost", - "prost-build", - "prost-codec", + "lru 0.10.1", + "quick-protobuf", + "quick-protobuf-codec", "smallvec", "thiserror", "void", @@ -5569,27 +6887,27 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e2d584751cecb2aabaa56106be6be91338a60a0f4e420cf2af639204f596fc1" +checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ - "bs58", - "ed25519-dalek", + "bs58 0.4.0", + "ed25519-dalek 2.0.0", "log", - "multiaddr 0.17.1", - "multihash 0.17.0", + "multiaddr", + "multihash", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "thiserror", "zeroize", ] [[package]] name = "libp2p-kad" -version = "0.42.1" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" +checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" dependencies = [ "arrayvec 0.7.4", "asynchronous-codec", @@ -5599,13 +6917,13 @@ dependencies = [ "futures", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "smallvec", "thiserror", "uint", @@ -5615,19 +6933,20 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f378264aade9872d6ccd315c0accc18be3a35d15fc1b9c36e5b6f983b62b5b" +checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" dependencies = [ "data-encoding", "futures", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", "rand 0.8.5", "smallvec", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "trust-dns-proto", "void", @@ -5635,11 +6954,11 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad8a64f29da86005c86a4d2728b8a0719e9b192f4092b609fd8790acb9dec55" +checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" dependencies = [ - "libp2p-core 0.38.0", + "libp2p-core", "libp2p-identify", "libp2p-kad", "libp2p-ping", @@ -5647,40 +6966,22 @@ dependencies = [ "prometheus-client", ] -[[package]] -name = "libp2p-mplex" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03805b44107aa013e7cbbfa5627b31c36cbedfdfb00603c0311998882bc4bace" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures", - "libp2p-core 0.38.0", - "log", - "nohash-hasher", - "parking_lot 0.12.1", - "rand 0.8.5", - "smallvec", - "unsigned-varint", -] - [[package]] name = "libp2p-noise" -version = "0.41.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978cb57efe82e892ec6f348a536bfbd9fee677adbe5689d7a93ad3a9bffbf2e" +checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ "bytes", "curve25519-dalek 3.2.0", "futures", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "log", "once_cell", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "snow", "static_assertions", "thiserror", @@ -5690,14 +6991,15 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "929fcace45a112536e22b3dcfd4db538723ef9c3cb79f672b98be2cc8e25f37f" +checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" dependencies = [ + "either", "futures", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", "libp2p-swarm", "log", "rand 0.8.5", @@ -5706,70 +7008,68 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.7.0-alpha" +version = "0.7.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e7c867e95c8130667b24409d236d37598270e6da69b3baf54213ba31ffca59" +checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ "bytes", "futures", "futures-timer", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-tls", "log", "parking_lot 0.12.1", "quinn-proto", "rand 0.8.5", - "rustls 0.20.8", + "rustls 0.20.9", "thiserror", "tokio", ] [[package]] name = "libp2p-request-response" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3236168796727bfcf4927f766393415361e2c644b08bedb6a6b13d957c9a4884" +checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" dependencies = [ "async-trait", - "bytes", "futures", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", "smallvec", - "unsigned-varint", ] [[package]] name = "libp2p-swarm" -version = "0.41.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a35472fe3276b3855c00f1c032ea8413615e030256429ad5349cdf67c6e1a0" +checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" dependencies = [ "either", "fnv", "futures", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm-derive", "log", - "pin-project", "rand 0.8.5", "smallvec", - "thiserror", "tokio", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" +checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" dependencies = [ "heck", "quote", @@ -5778,17 +7078,17 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b257baf6df8f2df39678b86c578961d48cc8b68642a12f0f763f56c8e5858d" +checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" dependencies = [ "futures", "futures-timer", "if-watch", "libc", - "libp2p-core 0.38.0", + "libp2p-core", "log", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", ] @@ -5800,26 +7100,26 @@ checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" dependencies = [ "futures", "futures-rustls", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", "rcgen 0.10.0", - "ring", - "rustls 0.20.8", + "ring 0.16.20", + "rustls 0.20.9", "thiserror", - "webpki 0.22.0", + "webpki 0.22.4", "x509-parser 0.14.0", "yasna", ] [[package]] name = "libp2p-wasm-ext" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb1a35299860e0d4b3c02a3e74e3b293ad35ae0cee8a056363b0c862d082069" +checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" dependencies = [ "futures", "js-sys", - "libp2p-core 0.38.0", + "libp2p-core", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", @@ -5827,9 +7127,9 @@ dependencies = [ [[package]] name = "libp2p-webrtc" -version = "0.4.0-alpha" +version = "0.4.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb6cd86dd68cba72308ea05de1cebf3ba0ae6e187c40548167955d4e3970f6a" +checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" dependencies = [ "async-trait", "asynchronous-codec", @@ -5838,13 +7138,13 @@ dependencies = [ "futures-timer", "hex", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-noise", "log", - "multihash 0.16.3", - "prost", - "prost-build", - "prost-codec", + "multihash", + "quick-protobuf", + "quick-protobuf-codec", "rand 0.8.5", "rcgen 0.9.3", "serde", @@ -5858,42 +7158,41 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d705506030d5c0aaf2882437c70dab437605f21c5f9811978f694e6917a3b54" +checksum = "111273f7b3d3510524c752e8b7a5314b7f7a1fee7e68161c01a7d72cbb06db9f" dependencies = [ "either", "futures", "futures-rustls", - "libp2p-core 0.38.0", + "libp2p-core", "log", "parking_lot 0.12.1", "quicksink", "rw-stream-sink", "soketto", "url", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] name = "libp2p-yamux" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f63594a0aa818642d9d4915c791945053877253f08a3626f13416b5cd928a29" +checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" dependencies = [ "futures", - "libp2p-core 0.38.0", + "libp2p-core", "log", - "parking_lot 0.12.1", "thiserror", "yamux", ] [[package]] name = "librocksdb-sys" -version = "0.10.0+7.9.2" +version = "0.11.0+8.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fe4d5874f5ff2bc616e55e8c6086d478fcda13faf9495768a4aa1c22042d30b" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" dependencies = [ "bindgen", "bzip2-sys", @@ -5920,7 +7219,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2 0.9.9", - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.17.0", ] [[package]] @@ -5954,9 +7253,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.9" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" dependencies = [ "cc", "pkg-config", @@ -5989,9 +7288,9 @@ dependencies = [ [[package]] name = "linregress" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de0b5f52a9f84544d268f5fabb71b38962d6aa3c6600b8bcd27d44ccf9c9c45" +checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" dependencies = [ "nalgebra", ] @@ -6010,15 +7309,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -6026,9 +7325,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" @@ -6041,13 +7340,19 @@ dependencies = [ [[package]] name = "lru" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "lru" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" + [[package]] name = "lru-cache" version = "0.1.2" @@ -6086,6 +7391,54 @@ dependencies = [ "libc", ] +[[package]] +name = "macro_magic" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "macro_magic_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d710e1214dffbab3b5dacb21475dde7d6ed84c69ff722b3a47a782668d44fbac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "macro_magic_macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.38", +] + [[package]] name = "maplit" version = "1.0.2" @@ -6115,9 +7468,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" dependencies = [ "autocfg", "rawpointer", @@ -6125,26 +7478,27 @@ dependencies = [ [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest 0.10.7", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memfd" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.37.23", + "rustix 0.38.20", ] [[package]] @@ -6165,6 +7519,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.9.0" @@ -6180,19 +7543,13 @@ version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "hash-db", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + "hash-db", +] [[package]] name = "merkle-distributor" version = "0.1.0" -source = "git+https://github.com/zenlinkpro/merkle-distributor?rev=e7483e829d540993141a6b3a9a1f6ec0a06c7744#e7483e829d540993141a6b3a9a1f6ec0a06c7744" +source = "git+https://github.com/bifrost-finance/merkle-distributor?rev=030bfe47039aa61d3a58a7bf5e12c957401972d6#030bfe47039aa61d3a58a7bf5e12c957401972d6" dependencies = [ "frame-support", "frame-system", @@ -6220,6 +7577,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "mick-jaeger" version = "0.1.8" @@ -6248,9 +7617,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -6260,7 +7629,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "log", @@ -6279,7 +7648,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "anyhow", "jsonrpsee", @@ -6319,24 +7688,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "multiaddr" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aebdb21e90f81d13ed01dc84123320838e53963c2ca94b60b305d3fa64f31e" -dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "multibase", - "multihash 0.16.3", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint", - "url", -] - [[package]] name = "multiaddr" version = "0.17.1" @@ -6348,7 +7699,7 @@ dependencies = [ "data-encoding", "log", "multibase", - "multihash 0.17.0", + "multihash", "percent-encoding", "serde", "static_assertions", @@ -6369,9 +7720,9 @@ dependencies = [ [[package]] name = "multihash" -version = "0.16.3" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" dependencies = [ "blake2b_simd", "blake2s_simd", @@ -6379,22 +7730,11 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", "unsigned-varint", ] -[[package]] -name = "multihash" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" -dependencies = [ - "core2", - "multihash-derive", - "unsigned-varint", -] - [[package]] name = "multihash-derive" version = "0.8.0" @@ -6442,7 +7782,7 @@ dependencies = [ "num-rational", "num-traits", "simba", - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.17.0", ] [[package]] @@ -6549,10 +7889,17 @@ dependencies = [ "memoffset 0.6.5", ] +[[package]] +name = "no-std-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + [[package]] name = "node-cli" version = "0.9.86" dependencies = [ + "bifrost-primitives", "clap", "cumulus-client-cli", "cumulus-client-service", @@ -6561,11 +7908,10 @@ dependencies = [ "frame-try-runtime", "log", "node-inspect", - "node-primitives", "node-service", "parity-scale-codec", "polkadot-cli", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "sc-cli", "sc-executor", @@ -6584,13 +7930,12 @@ dependencies = [ [[package]] name = "node-inspect" version = "0.9.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "clap", "parity-scale-codec", "sc-cli", "sc-client-api", - "sc-executor", "sc-service", "sp-blockchain", "sp-core", @@ -6598,24 +7943,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "node-primitives" -version = "0.8.0" -dependencies = [ - "bstringify", - "frame-support", - "frame-system", - "orml-oracle", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-std", - "xcm", - "zenlink-protocol", -] - [[package]] name = "node-rpc" version = "0.8.0" @@ -6624,6 +7951,7 @@ dependencies = [ "bifrost-farming-rpc-runtime-api", "bifrost-flexible-fee-rpc", "bifrost-flexible-fee-rpc-runtime-api", + "bifrost-primitives", "bifrost-salp-rpc-api", "bifrost-salp-rpc-runtime-api", "bifrost-stable-pool-rpc-api", @@ -6633,7 +7961,6 @@ dependencies = [ "jsonrpsee", "lend-market-rpc", "lend-market-rpc-runtime-api", - "node-primitives", "pallet-transaction-payment-rpc", "sc-client-api", "sc-rpc", @@ -6659,13 +7986,16 @@ dependencies = [ "bifrost-flexible-fee-rpc-runtime-api", "bifrost-kusama-runtime", "bifrost-polkadot-runtime", + "bifrost-primitives", "bifrost-runtime-common", "bifrost-salp-rpc-runtime-api", "bifrost-ve-minting-rpc-runtime-api", "color-print", "cumulus-client-cli", + "cumulus-client-collator", "cumulus-client-consensus-aura", "cumulus-client-consensus-common", + "cumulus-client-consensus-proposer", "cumulus-client-network", "cumulus-client-service", "cumulus-pallet-parachain-system", @@ -6675,10 +8005,10 @@ dependencies = [ "frame-benchmarking", "frame-benchmarking-cli", "frame-system-rpc-runtime-api", + "futures", "hex-literal 0.3.4", "jsonrpsee", "log", - "node-primitives", "node-rpc", "pallet-transaction-payment-rpc", "pallet-transaction-payment-rpc-runtime-api", @@ -6699,6 +8029,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-network-sync", + "sc-offchain", "sc-rpc", "sc-rpc-api", "sc-service", @@ -6706,6 +8037,7 @@ dependencies = [ "sc-telemetry", "sc-tracing", "sc-transaction-pool", + "sc-transaction-pool-api", "serde", "serde_json", "sp-api", @@ -6724,15 +8056,21 @@ dependencies = [ "sp-timestamp", "sp-transaction-pool", "sp-trie", + "staging-xcm", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", "try-runtime-cli", - "xcm", "zenlink-protocol", "zenlink-protocol-runtime-api", "zenlink-stable-amm-runtime-api", ] +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + [[package]] name = "nohash-hasher" version = "0.2.0" @@ -6757,9 +8095,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -6768,9 +8106,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" dependencies = [ "num-traits", ] @@ -6809,9 +8147,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -6822,7 +8160,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", ] @@ -6837,10 +8175,10 @@ name = "nutsfinance-stable-asset" version = "0.1.0" dependencies = [ "bifrost-currencies", + "bifrost-primitives", "frame-support", "frame-system", "log", - "node-primitives", "orml-tokens", "orml-traits", "pallet-balances", @@ -6855,21 +8193,21 @@ dependencies = [ [[package]] name = "object" -version = "0.29.0" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "crc32fast", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "indexmap 1.9.3", "memchr", ] [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -6940,7 +8278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2871aadd82a2c216ee68a69837a526dfe788ecbe74c4c5038a6acdbff6653066" dependencies = [ "expander 0.0.6", - "itertools", + "itertools 0.10.5", "petgraph", "proc-macro-crate", "proc-macro2", @@ -6957,31 +8295,14 @@ dependencies = [ "num-traits", ] -[[package]] -name = "orml-oracle" -version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=4ae0372e2c624e6acc98305564b9d395f70814c0#4ae0372e2c624e6acc98305564b9d395f70814c0" -dependencies = [ - "frame-support", - "frame-system", - "orml-traits", - "orml-utilities", - "parity-scale-codec", - "scale-info", - "serde", - "sp-application-crypto", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "orml-tokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=4ae0372e2c624e6acc98305564b9d395f70814c0#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=b3694e631df7f1ca16b1973122937753fcdee9d4#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "frame-system", + "log", "orml-traits", "parity-scale-codec", "scale-info", @@ -6994,26 +8315,27 @@ dependencies = [ [[package]] name = "orml-traits" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=4ae0372e2c624e6acc98305564b9d395f70814c0#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=b3694e631df7f1ca16b1973122937753fcdee9d4#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "impl-trait-for-tuples", "num-traits", "orml-utilities", "parity-scale-codec", + "paste", "scale-info", "serde", "sp-core", "sp-io", "sp-runtime", "sp-std", - "xcm", + "staging-xcm", ] [[package]] name = "orml-unknown-tokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=4ae0372e2c624e6acc98305564b9d395f70814c0#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=b3694e631df7f1ca16b1973122937753fcdee9d4#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "frame-system", @@ -7022,18 +8344,19 @@ dependencies = [ "scale-info", "serde", "sp-std", - "xcm", + "staging-xcm", ] [[package]] name = "orml-utilities" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=4ae0372e2c624e6acc98305564b9d395f70814c0#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=b3694e631df7f1ca16b1973122937753fcdee9d4#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -7042,7 +8365,7 @@ dependencies = [ [[package]] name = "orml-xcm" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=4ae0372e2c624e6acc98305564b9d395f70814c0#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=b3694e631df7f1ca16b1973122937753fcdee9d4#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "frame-system", @@ -7050,31 +8373,32 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-std", - "xcm", + "staging-xcm", ] [[package]] name = "orml-xcm-support" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=4ae0372e2c624e6acc98305564b9d395f70814c0#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=b3694e631df7f1ca16b1973122937753fcdee9d4#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "orml-traits", "parity-scale-codec", "sp-runtime", "sp-std", - "xcm", - "xcm-executor", + "staging-xcm", + "staging-xcm-executor", ] [[package]] name = "orml-xtokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=4ae0372e2c624e6acc98305564b9d395f70814c0#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=b3694e631df7f1ca16b1973122937753fcdee9d4#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", + "log", "orml-traits", "orml-xcm-support", "pallet-xcm", @@ -7084,8 +8408,8 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-executor", + "staging-xcm", + "staging-xcm-executor", ] [[package]] @@ -7096,7 +8420,7 @@ checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ "ecdsa 0.14.8", "elliptic-curve 0.12.3", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] @@ -7107,23 +8431,66 @@ checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" dependencies = [ "ecdsa 0.14.8", "elliptic-curve 0.12.3", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] -name = "packed_simd_2" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" +name = "pallet-alliance" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "cfg-if", - "libm 0.1.4", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-collective", + "pallet-identity", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-core-hashing", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-asset-conversion" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-asset-conversion-tx-payment" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "frame-support", + "frame-system", + "pallet-asset-conversion", + "pallet-transaction-payment", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", ] [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7141,11 +8508,12 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-core", @@ -7156,10 +8524,11 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", + "log", "pallet-timestamp", "parity-scale-codec", "scale-info", @@ -7172,7 +8541,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", @@ -7188,7 +8557,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", @@ -7202,7 +8571,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7226,8 +8595,10 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "aquamarine", + "docify", "frame-benchmarking", "frame-election-provider-support", "frame-support", @@ -7246,7 +8617,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7261,10 +8632,11 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", + "log", "pallet-authorship", "pallet-session", "parity-scale-codec", @@ -7280,9 +8652,9 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "binary-merkle-tree", "frame-support", "frame-system", @@ -7298,13 +8670,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", + "sp-state-machine", "sp-std", ] [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7319,10 +8692,91 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-bridge-grandpa" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-header-chain", + "bp-runtime", + "bp-test-utils", + "finality-grandpa", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-consensus-grandpa", + "sp-runtime", + "sp-std", + "sp-trie", +] + +[[package]] +name = "pallet-bridge-messages" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-messages", + "bp-runtime", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "num-traits", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-bridge-parachains" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-header-chain", + "bp-parachains", + "bp-polkadot-core", + "bp-runtime", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-bridge-grandpa", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", + "sp-trie", +] + +[[package]] +name = "pallet-bridge-relayers" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bp-messages", + "bp-relayers", + "bp-runtime", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-bridge-messages", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7341,7 +8795,7 @@ dependencies = [ [[package]] name = "pallet-collator-selection" version = "3.0.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7360,7 +8814,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7377,7 +8831,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7391,10 +8845,28 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-core-fellowship" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7412,7 +8884,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7429,13 +8901,13 @@ dependencies = [ "sp-npos-elections", "sp-runtime", "sp-std", - "strum", + "strum 0.24.1", ] [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7443,12 +8915,13 @@ dependencies = [ "parity-scale-codec", "sp-npos-elections", "sp-runtime", + "sp-std", ] [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7460,14 +8933,16 @@ dependencies = [ "sp-io", "sp-npos-elections", "sp-runtime", + "sp-staking", "sp-std", ] [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "docify", "frame-benchmarking", "frame-election-provider-support", "frame-support", @@ -7484,7 +8959,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7507,7 +8982,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7523,7 +8998,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7543,24 +9018,60 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-keyring", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-membership" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-message-queue" +version = "7.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", + "sp-arithmetic", "sp-core", "sp-io", - "sp-keyring", "sp-runtime", "sp-std", + "sp-weights", ] [[package]] -name = "pallet-membership" +name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7570,39 +9081,40 @@ dependencies = [ "scale-info", "sp-core", "sp-io", + "sp-mmr-primitives", "sp-runtime", "sp-std", ] [[package]] -name = "pallet-mmr" +name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", - "sp-core", "sp-io", - "sp-mmr-primitives", "sp-runtime", "sp-std", ] [[package]] -name = "pallet-multisig" +name = "pallet-nft-fractionalization" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", + "pallet-assets", + "pallet-nfts", "parity-scale-codec", "scale-info", - "sp-io", "sp-runtime", "sp-std", ] @@ -7610,7 +9122,7 @@ dependencies = [ [[package]] name = "pallet-nfts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7628,9 +9140,8 @@ dependencies = [ [[package]] name = "pallet-nfts-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "frame-support", "pallet-nfts", "parity-scale-codec", "sp-api", @@ -7639,7 +9150,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7655,11 +9166,12 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", "log", + "pallet-balances", "parity-scale-codec", "scale-info", "sp-core", @@ -7667,12 +9179,13 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-std", + "sp-tracing", ] [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7692,7 +9205,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -7703,7 +9216,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", @@ -7720,7 +9233,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7744,7 +9257,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7759,93 +9272,85 @@ dependencies = [ ] [[package]] -name = "pallet-prices" -version = "0.8.0" +name = "pallet-proxy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "bifrost-asset-registry", - "bifrost-currencies", + "frame-benchmarking", "frame-support", "frame-system", - "node-primitives", - "num-traits", - "orml-oracle", - "orml-tokens", - "orml-traits", - "pallet-assets", - "pallet-balances", - "pallet-traits", "parity-scale-codec", "scale-info", - "serde", - "sp-core", "sp-io", "sp-runtime", "sp-std", - "xcm", ] [[package]] -name = "pallet-proxy" +name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", + "sp-arithmetic", + "sp-core", "sp-io", "sp-runtime", "sp-std", ] [[package]] -name = "pallet-ranked-collective" +name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "parity-scale-codec", "scale-info", - "sp-arithmetic", - "sp-core", "sp-io", "sp-runtime", "sp-std", ] [[package]] -name = "pallet-recovery" +name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "assert_matches", "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", + "serde", + "sp-arithmetic", "sp-io", "sp-runtime", "sp-std", ] [[package]] -name = "pallet-referenda" +name = "pallet-salary" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "assert_matches", "frame-benchmarking", "frame-support", "frame-system", "log", "parity-scale-codec", "scale-info", - "serde", "sp-arithmetic", + "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -7854,8 +9359,9 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -7871,7 +9377,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", @@ -7885,6 +9391,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", + "sp-state-machine", "sp-std", "sp-trie", ] @@ -7892,13 +9399,14 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "pallet-session", "pallet-staking", + "parity-scale-codec", "rand 0.8.5", "sp-runtime", "sp-session", @@ -7908,13 +9416,17 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "rand_chacha 0.2.2", "scale-info", + "sp-arithmetic", + "sp-io", "sp-runtime", "sp-std", ] @@ -7922,7 +9434,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7945,18 +9457,18 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "log", "sp-arithmetic", @@ -7965,7 +9477,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "sp-api", @@ -7974,7 +9486,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -7991,8 +9503,9 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", @@ -8005,7 +9518,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -8017,13 +9530,14 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "sp-storage", "sp-timestamp", ] [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -8039,33 +9553,10 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-traits" -version = "0.8.0" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "node-primitives", - "num-bigint", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", -] - [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", @@ -8081,7 +9572,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -8097,7 +9588,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8109,7 +9600,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -8126,7 +9617,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -8141,7 +9632,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -8157,7 +9648,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -8172,7 +9663,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -8186,8 +9677,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8201,14 +9692,14 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-executor", + "staging-xcm", + "staging-xcm-executor", ] [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -8219,21 +9710,23 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", "parity-scale-codec", "scale-info", + "sp-runtime", + "sp-std", ] [[package]] @@ -8262,35 +9755,44 @@ dependencies = [ [[package]] name = "parachains-common" version = "1.0.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "cumulus-primitives-core", "cumulus-primitives-utility", "frame-support", "frame-system", + "kusama-runtime-constants", + "log", + "num-traits", "pallet-asset-tx-payment", "pallet-assets", "pallet-authorship", "pallet-balances", "pallet-collator-selection", "parity-scale-codec", + "polkadot-core-primitives", "polkadot-primitives", + "polkadot-runtime-constants", + "rococo-runtime-constants", "scale-info", + "smallvec", "sp-consensus-aura", "sp-core", "sp-io", "sp-runtime", "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", + "westend-runtime-constants", ] [[package]] name = "parity-db" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dab3ac198341b2f0fec6e7f8a6eeed07a41201d98a124260611598c142e76df" +checksum = "59e9ab494af9e6e813c72170f0d3c1de1500990d62c97cc05cc7576f91aa402f" dependencies = [ "blake2", "crc32fast", @@ -8308,9 +9810,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.3" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756d439303e94fae44f288ba881ad29670c65b0c4b0e05674ca81061bb65f2c5" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -8323,9 +9825,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.3" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d884d78fcf214d70b1e239fcd1c6e5e95aa3be1881918da2e488cc946c7a476" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8339,6 +9841,35 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" +[[package]] +name = "parity-util-mem" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" +dependencies = [ + "cfg-if", + "ethereum-types", + "hashbrown 0.12.3", + "impl-trait-for-tuples", + "lru 0.8.1", + "parity-util-mem-derive", + "parking_lot 0.12.1", + "primitive-types", + "smallvec", + "winapi", +] + +[[package]] +name = "parity-util-mem-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" +dependencies = [ + "proc-macro2", + "syn 1.0.109", + "synstructure", +] + [[package]] name = "parity-wasm" version = "0.45.0" @@ -8347,9 +9878,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -8369,7 +9900,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.9", ] [[package]] @@ -8388,22 +9919,28 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] +[[package]] +name = "partial_sort" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" + [[package]] name = "paste" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbkdf2" @@ -8423,6 +9960,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -8447,6 +9993,65 @@ dependencies = [ "base64ct", ] +[[package]] +name = "penpal-runtime" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "log", + "pallet-asset-tx-payment", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-xcm", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-common", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", +] + [[package]] name = "percent-encoding" version = "2.3.0" @@ -8455,19 +10060,20 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b" +checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" dependencies = [ "pest", "pest_generator", @@ -8475,56 +10081,56 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190" +checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "pest_meta" -version = "2.7.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0" +checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" dependencies = [ "once_cell", "pest", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 1.9.3", + "indexmap 2.0.2", ] [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] @@ -8535,9 +10141,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -8545,6 +10151,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkcs8" version = "0.9.0" @@ -8561,7 +10178,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.7", + "der 0.7.8", "spki 0.7.2", ] @@ -8573,27 +10190,23 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" - -[[package]] -name = "platforms" -version = "3.0.2" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" [[package]] name = "polkadot-approval-distribution" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", + "futures-timer", "polkadot-node-jaeger", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", + "polkadot-node-subsystem-util", "polkadot-primitives", "rand 0.8.5", "tracing-gum", @@ -8601,10 +10214,12 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "always-assert", "futures", + "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -8615,13 +10230,12 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "derive_more", "fatality", "futures", - "lru 0.9.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -8630,6 +10244,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "rand 0.8.5", + "schnellru", "sp-core", "sp-keystore", "thiserror", @@ -8638,12 +10253,11 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "fatality", "futures", - "lru 0.9.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -8653,21 +10267,20 @@ dependencies = [ "polkadot-primitives", "rand 0.8.5", "sc-network", + "schnellru", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-cli" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "clap", "frame-benchmarking-cli", "futures", "log", - "polkadot-client", - "polkadot-node-core-pvf-worker", "polkadot-node-metrics", "polkadot-performance-test", "polkadot-service", @@ -8682,58 +10295,15 @@ dependencies = [ "sp-keyring", "sp-maybe-compressed-blob", "substrate-build-script-utils", - "thiserror", - "try-runtime-cli", -] - -[[package]] -name = "polkadot-client" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" -dependencies = [ - "async-trait", - "frame-benchmarking", - "frame-benchmarking-cli", - "frame-system", - "frame-system-rpc-runtime-api", - "futures", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "polkadot-core-primitives", - "polkadot-node-core-parachains-inherent", - "polkadot-primitives", - "polkadot-runtime", - "polkadot-runtime-common", - "sc-client-api", - "sc-consensus", - "sc-executor", - "sc-service", - "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-keyring", - "sp-mmr-primitives", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-storage", - "sp-timestamp", - "sp-transaction-pool", + "thiserror", + "try-runtime-cli", ] [[package]] name = "polkadot-collator-protocol" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "always-assert", "bitvec", "fatality", "futures", @@ -8747,13 +10317,14 @@ dependencies = [ "sp-keystore", "sp-runtime", "thiserror", + "tokio-util", "tracing-gum", ] [[package]] name = "polkadot-core-primitives" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", @@ -8764,15 +10335,14 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "derive_more", "fatality", "futures", "futures-timer", "indexmap 1.9.3", - "lru 0.9.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -8781,6 +10351,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "sc-network", + "schnellru", "sp-application-crypto", "sp-keystore", "thiserror", @@ -8789,8 +10360,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -8803,8 +10374,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "futures-timer", @@ -8815,6 +10386,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "sc-network", + "sc-network-common", "sp-application-crypto", "sp-core", "sp-keystore", @@ -8823,8 +10395,8 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "always-assert", "async-trait", @@ -8846,8 +10418,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "parity-scale-codec", @@ -8864,16 +10436,15 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "derive_more", "futures", "futures-timer", "kvdb", - "lru 0.9.0", - "merlin", + "merlin 2.0.1", "parity-scale-codec", "polkadot-node-jaeger", "polkadot-node-primitives", @@ -8882,7 +10453,8 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sc-keystore", - "schnorrkel", + "schnellru", + "schnorrkel 0.9.1", "sp-application-crypto", "sp-consensus", "sp-consensus-slots", @@ -8893,8 +10465,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "futures", @@ -8902,6 +10474,7 @@ dependencies = [ "kvdb", "parity-scale-codec", "polkadot-erasure-coding", + "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -8914,8 +10487,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "fatality", @@ -8933,8 +10506,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "polkadot-node-subsystem", @@ -8948,8 +10521,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "futures", @@ -8960,7 +10533,8 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-parachain", + "polkadot-overseer", + "polkadot-parachain-primitives", "polkadot-primitives", "sp-maybe-compressed-blob", "tracing-gum", @@ -8968,8 +10542,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "polkadot-node-metrics", @@ -8983,8 +10557,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "futures-timer", @@ -9000,27 +10574,27 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "fatality", "futures", "kvdb", - "lru 0.9.0", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", "sc-keystore", + "schnellru", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "futures", @@ -9034,10 +10608,27 @@ dependencies = [ "tracing-gum", ] +[[package]] +name = "polkadot-node-core-prospective-parachains" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bitvec", + "fatality", + "futures", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", +] + [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "fatality", @@ -9047,15 +10638,14 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand 0.8.5", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "always-assert", "futures", @@ -9064,25 +10654,26 @@ dependencies = [ "parity-scale-codec", "pin-project", "polkadot-core-primitives", + "polkadot-node-core-pvf-common", "polkadot-node-metrics", "polkadot-node-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "rand 0.8.5", "slotmap", "sp-core", "sp-maybe-compressed-blob", - "sp-tracing", "sp-wasm-interface", "substrate-build-script-utils", + "tempfile", "tokio", "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "polkadot-node-primitives", @@ -9096,29 +10687,46 @@ dependencies = [ ] [[package]] -name = "polkadot-node-core-pvf-worker" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +name = "polkadot-node-core-pvf-common" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "assert_matches", "cpu-time", "futures", + "landlock", "libc", "parity-scale-codec", - "polkadot-node-core-pvf", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", - "rayon", "sc-executor", "sc-executor-common", "sc-executor-wasmtime", "sp-core", "sp-externalities", "sp-io", + "sp-tracing", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf-prepare-worker" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "futures", + "libc", + "parity-scale-codec", + "polkadot-node-core-pvf-common", + "polkadot-parachain-primitives", + "polkadot-primitives", + "rayon", + "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", + "sp-io", "sp-maybe-compressed-blob", "sp-tracing", - "substrate-build-script-utils", - "tempfile", "tikv-jemalloc-ctl", "tokio", "tracing-gum", @@ -9126,23 +10734,23 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", - "lru 0.9.0", "polkadot-node-metrics", "polkadot-node-subsystem", "polkadot-node-subsystem-types", "polkadot-primitives", + "schnellru", "sp-consensus-babe", "tracing-gum", ] [[package]] name = "polkadot-node-jaeger" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "lazy_static", "log", @@ -9159,10 +10767,10 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "bs58", + "bs58 0.5.0", "futures", "futures-timer", "log", @@ -9178,10 +10786,12 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "async-channel", "async-trait", + "bitvec", "derive_more", "fatality", "futures", @@ -9193,22 +10803,22 @@ dependencies = [ "rand 0.8.5", "sc-authority-discovery", "sc-network", - "strum", + "strum 0.24.1", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-primitives" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bounded-vec", "futures", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", - "schnorrkel", + "schnorrkel 0.9.1", "serde", "sp-application-crypto", "sp-consensus-babe", @@ -9217,13 +10827,13 @@ dependencies = [ "sp-maybe-compressed-blob", "sp-runtime", "thiserror", - "zstd 0.11.2+zstd.1.5.2", + "zstd 0.12.4", ] [[package]] name = "polkadot-node-subsystem" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -9232,8 +10842,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "derive_more", @@ -9245,6 +10855,7 @@ dependencies = [ "polkadot-primitives", "polkadot-statement-table", "sc-network", + "sc-transaction-pool-api", "smallvec", "sp-api", "sp-authority-discovery", @@ -9255,17 +10866,16 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "derive_more", "fatality", "futures", "futures-channel", - "itertools", + "itertools 0.10.5", "kvdb", - "lru 0.9.0", "parity-db", "parity-scale-codec", "parking_lot 0.11.2", @@ -9279,6 +10889,7 @@ dependencies = [ "polkadot-primitives", "prioritized-metered-channel", "rand 0.8.5", + "schnellru", "sp-application-crypto", "sp-core", "sp-keystore", @@ -9288,13 +10899,12 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "futures", "futures-timer", - "lru 0.9.0", "orchestra", "parking_lot 0.12.1", "polkadot-node-metrics", @@ -9303,6 +10913,7 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-primitives", "sc-client-api", + "schnellru", "sp-api", "sp-core", "tikv-jemalloc-ctl", @@ -9310,9 +10921,9 @@ dependencies = [ ] [[package]] -name = "polkadot-parachain" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +name = "polkadot-parachain-primitives" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bounded-collections", "derive_more", @@ -9328,32 +10939,32 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "env_logger 0.9.3", - "kusama-runtime", "log", "polkadot-erasure-coding", - "polkadot-node-core-pvf-worker", + "polkadot-node-core-pvf-prepare-worker", "polkadot-node-primitives", "polkadot-primitives", "quote", "sc-executor-common", "sp-maybe-compressed-blob", + "staging-kusama-runtime", "thiserror", ] [[package]] name = "polkadot-primitives" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "hex-literal 0.4.1", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "scale-info", "serde", "sp-api", @@ -9372,8 +10983,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -9404,8 +11015,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "frame-benchmarking", @@ -9437,6 +11048,7 @@ dependencies = [ "pallet-im-online", "pallet-indices", "pallet-membership", + "pallet-message-queue", "pallet-multisig", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", @@ -9461,6 +11073,7 @@ dependencies = [ "pallet-vesting", "pallet-whitelist", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-primitives", "polkadot-runtime-common", @@ -9487,19 +11100,20 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] name = "polkadot-runtime-common" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "frame-benchmarking", @@ -9538,14 +11152,14 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "staging-xcm", "static_assertions", - "xcm", ] [[package]] name = "polkadot-runtime-constants" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "polkadot-primitives", @@ -9558,10 +11172,11 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "bs58", + "bs58 0.5.0", + "frame-benchmarking", "parity-scale-codec", "polkadot-primitives", "sp-std", @@ -9570,8 +11185,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -9579,17 +11194,19 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "impl-trait-for-tuples", "log", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", "pallet-balances", + "pallet-message-queue", "pallet-session", "pallet-staking", "pallet-timestamp", "pallet-vesting", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-metrics", "rand 0.8.5", @@ -9607,39 +11224,42 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "staging-xcm", + "staging-xcm-executor", "static_assertions", - "xcm", - "xcm-executor", ] [[package]] name = "polkadot-service" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", + "frame-benchmarking", "frame-benchmarking-cli", "frame-support", + "frame-system", "frame-system-rpc-runtime-api", "futures", "hex-literal 0.4.1", - "kusama-runtime", + "is_executable", "kvdb", "kvdb-rocksdb", "log", - "lru 0.9.0", "mmr-gadget", "pallet-babe", "pallet-im-online", "pallet-staking", + "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "parity-db", + "parity-scale-codec", "polkadot-approval-distribution", "polkadot-availability-bitfield-distribution", "polkadot-availability-distribution", "polkadot-availability-recovery", - "polkadot-client", "polkadot-collator-protocol", + "polkadot-core-primitives", "polkadot-dispute-distribution", "polkadot-gossip-support", "polkadot-network-bridge", @@ -9653,7 +11273,9 @@ dependencies = [ "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", @@ -9662,11 +11284,11 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-rpc", "polkadot-runtime", - "polkadot-runtime-constants", + "polkadot-runtime-common", "polkadot-runtime-parachains", "polkadot-statement-distribution", "rococo-runtime", @@ -9692,6 +11314,8 @@ dependencies = [ "sc-sysinfo", "sc-telemetry", "sc-transaction-pool", + "sc-transaction-pool-api", + "schnellru", "serde", "serde_json", "sp-api", @@ -9705,6 +11329,7 @@ dependencies = [ "sp-core", "sp-inherents", "sp-io", + "sp-keyring", "sp-keystore", "sp-mmr-primitives", "sp-offchain", @@ -9714,7 +11339,9 @@ dependencies = [ "sp-storage", "sp-timestamp", "sp-transaction-pool", - "sp-trie", + "sp-version", + "sp-weights", + "staging-kusama-runtime", "substrate-prometheus-endpoint", "thiserror", "tracing-gum", @@ -9723,17 +11350,20 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "arrayvec 0.5.2", + "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-types", "polkadot-node-subsystem-util", "polkadot-primitives", "sp-keystore", @@ -9744,8 +11374,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -9764,7 +11394,7 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.13", "windows-sys 0.48.0", ] @@ -9779,6 +11409,17 @@ dependencies = [ "universal-hash 0.4.1", ] +[[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 0.5.1", +] + [[package]] name = "polyval" version = "0.5.3" @@ -9805,9 +11446,15 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.4.0" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b559898e0b4931ed2d3b959ab0c2da4d99cc644c4b0b1a35b4d344027f474023" + +[[package]] +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d220334a184db82b31b83f5ff093e3315280fb2b6bbc032022b2304a509aab7a" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" @@ -9823,7 +11470,7 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", - "itertools", + "itertools 0.10.5", "normalize-line-endings", "predicates-core", "regex", @@ -9855,14 +11502,26 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prettyplease" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +dependencies = [ + "proc-macro2", + "syn 2.0.38", +] + [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", + "impl-num-traits", + "impl-rlp", "impl-serde", "scale-info", "uint", @@ -9920,20 +11579,20 @@ dependencies = [ [[package]] name = "proc-macro-warning" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" +checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -9954,25 +11613,25 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", "parking_lot 0.12.1", - "prometheus-client-derive-text-encode", + "prometheus-client-derive-encode", ] [[package]] -name = "prometheus-client-derive-text-encode" -version = "0.3.0" +name = "prometheus-client-derive-encode" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] @@ -9993,12 +11652,12 @@ checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck", - "itertools", + "itertools 0.10.5", "lazy_static", "log", "multimap", "petgraph", - "prettyplease", + "prettyplease 0.1.25", "prost", "prost-types", "regex", @@ -10007,19 +11666,6 @@ dependencies = [ "which", ] -[[package]] -name = "prost-codec" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc34979ff898b6e141106178981ce2596c387ea6e62533facfc61a37fc879c0" -dependencies = [ - "asynchronous-codec", - "bytes", - "prost", - "thiserror", - "unsigned-varint", -] - [[package]] name = "prost-derive" version = "0.11.9" @@ -10027,7 +11673,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", @@ -10066,6 +11712,19 @@ 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" @@ -10079,27 +11738,27 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c10f662eee9c94ddd7135043e544f3c82fa839a1e7b865911331961b53186c" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ "bytes", "rand 0.8.5", - "ring", + "ring 0.16.20", "rustc-hash", - "rustls 0.20.8", + "rustls 0.20.9", "slab", "thiserror", "tinyvec", "tracing", - "webpki 0.22.0", + "webpki 0.22.4", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -10198,9 +11857,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -10208,14 +11867,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -10225,8 +11882,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ "pem", - "ring", - "time 0.3.23", + "ring 0.16.20", + "time", "x509-parser 0.13.2", "yasna", ] @@ -10238,8 +11895,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", - "ring", - "time 0.3.23", + "ring 0.16.20", + "time", "yasna", ] @@ -10261,6 +11918,15 @@ 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.3" @@ -10274,42 +11940,42 @@ dependencies = [ [[package]] name = "reed-solomon-novelpoly" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221" +checksum = "58130877ca403ab42c864fbac74bb319a0746c07a634a92a5cfc7f54af272582" dependencies = [ "derive_more", "fs-err", - "itertools", - "static_init 0.5.2", + "itertools 0.11.0", + "static_init", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1641819477c319ef452a075ac34a4be92eb9ba09f6841f62d594d50fdcf0bf6b" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bf53dad9b6086826722cdc99140793afd9f62faa14a1ad07eb4f955e7a7216" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "regalloc2" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" +checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" dependencies = [ "fxhash", "log", @@ -10319,14 +11985,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.3", - "regex-syntax 0.7.4", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -10340,13 +12006,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.8.2", ] [[package]] @@ -10357,21 +12023,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" - -[[package]] -name = "region" -version = "3.0.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" -dependencies = [ - "bitflags 1.3.2", - "libc", - "mach", - "winapi", -] +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "resolv-conf" @@ -10404,6 +12058,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "ring" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "common", + "fflonk", + "merlin 3.0.0", +] + [[package]] name = "ring" version = "0.16.20" @@ -10413,17 +12082,41 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +dependencies = [ + "cc", + "getrandom 0.2.10", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + +[[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.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015439787fce1e75d55f279078d33ff14b4af5d93d995e8838ee4631301c8a99" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" dependencies = [ "libc", "librocksdb-sys", @@ -10431,8 +12124,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -10460,6 +12153,7 @@ dependencies = [ "pallet-im-online", "pallet-indices", "pallet-membership", + "pallet-message-queue", "pallet-mmr", "pallet-multisig", "pallet-nis", @@ -10483,7 +12177,7 @@ dependencies = [ "pallet-xcm", "pallet-xcm-benchmarks", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -10506,19 +12200,20 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] name = "rococo-runtime-constants" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "polkadot-primitives", @@ -10614,7 +12309,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.17", + "semver 1.0.20", ] [[package]] @@ -10628,9 +12323,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.15" +version = "0.36.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" +checksum = "6da3636faa25820d8648e0e31c5d519bbb01f72fdf57131f0f5f7da5fed36eab" dependencies = [ "bitflags 1.3.2", "errno", @@ -10642,9 +12337,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" +version = "0.37.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "84f3f8f960ed3b5a59055428714943298bf3fa2d4a1d53135084e0544829d995" dependencies = [ "bitflags 1.3.2", "errno", @@ -10656,14 +12351,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys 0.4.3", + "linux-raw-sys 0.4.10", "windows-sys 0.48.0", ] @@ -10675,21 +12370,33 @@ checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ "base64 0.13.1", "log", - "ring", + "ring 0.16.20", "sct 0.6.1", "webpki 0.21.4", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring 0.16.20", + "sct 0.7.0", + "webpki 0.22.4", +] + +[[package]] +name = "rustls" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", - "ring", + "ring 0.16.20", + "rustls-webpki 0.101.6", "sct 0.7.0", - "webpki 0.22.0", ] [[package]] @@ -10698,26 +12405,57 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ - "openssl-probe", - "rustls-pemfile", - "schannel", - "security-framework", + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.5", +] + +[[package]] +name = "rustls-webpki" +version = "0.100.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] -name = "rustls-pemfile" -version = "1.0.3" +name = "rustls-webpki" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ - "base64 0.21.2", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] name = "rustversion" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ruzstd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" +dependencies = [ + "byteorder", + "thiserror-core", + "twox-hash", +] [[package]] name = "rw-stream-sink" @@ -10732,15 +12470,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "safe_arch" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62a7484307bd40f8f7ccbacccac730108f2cae119a3b11c74485b48aa9ea650f" +checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" dependencies = [ "bytemuck", ] @@ -10757,7 +12495,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "log", "sp-core", @@ -10768,7 +12506,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "futures", @@ -10776,13 +12514,13 @@ dependencies = [ "ip_network", "libp2p", "log", + "multihash", "parity-scale-codec", "prost", "prost-build", "rand 0.8.5", "sc-client-api", "sc-network", - "sc-network-common", "sp-api", "sp-authority-discovery", "sp-blockchain", @@ -10796,7 +12534,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "futures-timer", @@ -10819,7 +12557,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -10834,7 +12572,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -10853,25 +12591,25 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "chrono", "clap", "fdlimit", "futures", - "libp2p", + "libp2p-identity", "log", "names", "parity-scale-codec", @@ -10882,7 +12620,6 @@ dependencies = [ "sc-client-db", "sc-keystore", "sc-network", - "sc-network-common", "sc-service", "sc-telemetry", "sc-tracing", @@ -10904,7 +12641,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "fnv", "futures", @@ -10920,9 +12657,9 @@ dependencies = [ "sp-core", "sp-database", "sp-externalities", - "sp-keystore", "sp-runtime", "sp-state-machine", + "sp-statement-store", "sp-storage", "substrate-prometheus-endpoint", ] @@ -10930,7 +12667,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "hash-db", "kvdb", @@ -10956,12 +12693,12 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "futures", "futures-timer", - "libp2p", + "libp2p-identity", "log", "mockall", "parking_lot 0.12.1", @@ -10981,7 +12718,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "futures", @@ -11010,7 +12747,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "fork-tree", @@ -11025,8 +12762,8 @@ dependencies = [ "sc-consensus", "sc-consensus-epochs", "sc-consensus-slots", - "sc-keystore", "sc-telemetry", + "sc-transaction-pool-api", "scale-info", "sp-api", "sp-application-crypto", @@ -11046,7 +12783,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "jsonrpsee", @@ -11068,9 +12805,10 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", + "async-channel", "async-trait", "fnv", "futures", @@ -11079,9 +12817,7 @@ dependencies = [ "parking_lot 0.12.1", "sc-client-api", "sc-consensus", - "sc-keystore", "sc-network", - "sc-network-common", "sc-network-gossip", "sc-network-sync", "sc-utils", @@ -11103,7 +12839,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "jsonrpsee", @@ -11122,7 +12858,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "fork-tree", "parity-scale-codec", @@ -11135,10 +12871,10 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "ahash 0.8.3", - "array-bytes 4.2.0", + "ahash 0.8.5", + "array-bytes", "async-trait", "dyn-clone", "finality-grandpa", @@ -11157,6 +12893,7 @@ dependencies = [ "sc-network-common", "sc-network-gossip", "sc-telemetry", + "sc-transaction-pool-api", "sc-utils", "serde_json", "sp-api", @@ -11175,7 +12912,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "finality-grandpa", "futures", @@ -11195,11 +12932,12 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "assert_matches", "async-trait", "futures", + "futures-timer", "jsonrpsee", "log", "parity-scale-codec", @@ -11229,7 +12967,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "futures", @@ -11252,14 +12990,13 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "lru 0.8.1", "parity-scale-codec", "parking_lot 0.12.1", "sc-executor-common", - "sc-executor-wasmi", "sc-executor-wasmtime", + "schnellru", "sp-api", "sp-core", "sp-externalities", @@ -11270,46 +13007,30 @@ dependencies = [ "sp-version", "sp-wasm-interface", "tracing", - "wasmi", ] [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface", "thiserror", "wasm-instrument", - "wasmi", -] - -[[package]] -name = "sc-executor-wasmi" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "log", - "sc-allocator", - "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", - "wasmi", ] [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "anyhow", "cfg-if", "libc", "log", - "once_cell", - "rustix 0.36.15", + "rustix 0.36.16", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -11320,7 +13041,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "ansi_term", "futures", @@ -11336,10 +13057,9 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", - "async-trait", + "array-bytes", "parking_lot 0.12.1", "serde_json", "sp-application-crypto", @@ -11351,9 +13071,9 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "async-channel", "async-trait", "asynchronous-codec", @@ -11366,47 +13086,43 @@ dependencies = [ "libp2p", "linked_hash_set", "log", - "lru 0.8.1", "mockall", "parity-scale-codec", "parking_lot 0.12.1", + "partial_sort", "pin-project", "rand 0.8.5", - "sc-block-builder", "sc-client-api", - "sc-consensus", "sc-network-common", - "sc-peerset", "sc-utils", "serde", "serde_json", "smallvec", - "snow", "sp-arithmetic", "sp-blockchain", - "sp-consensus", "sp-core", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", + "wasm-timer", "zeroize", ] [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "async-channel", "cid", "futures", - "libp2p", + "libp2p-identity", "log", "prost", "prost-build", "sc-client-api", "sc-network", - "sc-network-common", "sp-blockchain", "sp-runtime", "thiserror", @@ -11416,45 +13132,33 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", "async-trait", "bitflags 1.3.2", - "bytes", "futures", - "futures-timer", - "libp2p", + "libp2p-identity", "parity-scale-codec", "prost-build", "sc-consensus", - "sc-peerset", - "sc-utils", - "serde", - "smallvec", - "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", - "zeroize", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.5", "futures", "futures-timer", "libp2p", "log", - "lru 0.8.1", "sc-network", "sc-network-common", - "sc-peerset", + "schnellru", "sp-runtime", "substrate-prometheus-endpoint", "tracing", @@ -11463,19 +13167,18 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", + "async-channel", "futures", - "libp2p", + "libp2p-identity", "log", "parity-scale-codec", "prost", "prost-build", "sc-client-api", "sc-network", - "sc-network-common", - "sc-peerset", "sp-blockchain", "sp-core", "sp-runtime", @@ -11485,16 +13188,16 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", + "async-channel", "async-trait", "fork-tree", "futures", "futures-timer", "libp2p", "log", - "lru 0.8.1", "mockall", "parity-scale-codec", "prost", @@ -11503,8 +13206,8 @@ dependencies = [ "sc-consensus", "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", + "schnellru", "smallvec", "sp-arithmetic", "sp-blockchain", @@ -11519,17 +13222,15 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "futures", "libp2p", "log", "parity-scale-codec", - "pin-project", "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", "sp-consensus", "sp-runtime", @@ -11539,9 +13240,9 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "bytes", "fnv", "futures", @@ -11549,6 +13250,7 @@ dependencies = [ "hyper", "hyper-rustls", "libp2p", + "log", "num_cpus", "once_cell", "parity-scale-codec", @@ -11557,33 +13259,22 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-common", - "sc-peerset", + "sc-transaction-pool-api", "sc-utils", "sp-api", "sp-core", + "sp-externalities", + "sp-keystore", "sp-offchain", "sp-runtime", "threadpool", "tracing", ] -[[package]] -name = "sc-peerset" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "futures", - "libp2p", - "log", - "sc-utils", - "serde_json", - "wasm-timer", -] - [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -11592,7 +13283,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "jsonrpsee", @@ -11615,6 +13306,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-session", + "sp-statement-store", "sp-version", "tokio", ] @@ -11622,7 +13314,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -11641,7 +13333,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "http", "jsonrpsee", @@ -11656,9 +13348,9 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "futures", "futures-util", "hex", @@ -11669,6 +13361,7 @@ dependencies = [ "sc-chain-spec", "sc-client-api", "sc-transaction-pool-api", + "sc-utils", "serde", "sp-api", "sp-blockchain", @@ -11676,13 +13369,14 @@ dependencies = [ "sp-runtime", "sp-version", "thiserror", + "tokio", "tokio-stream", ] [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "directories", @@ -11709,11 +13403,9 @@ dependencies = [ "sc-network-light", "sc-network-sync", "sc-network-transactions", - "sc-offchain", "sc-rpc", "sc-rpc-server", "sc-rpc-spec-v2", - "sc-storage-monitor", "sc-sysinfo", "sc-telemetry", "sc-tracing", @@ -11736,7 +13428,7 @@ dependencies = [ "sp-transaction-storage-proof", "sp-trie", "sp-version", - "static_init 1.0.3", + "static_init", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -11748,7 +13440,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "log", "parity-scale-codec", @@ -11759,14 +13451,12 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "clap", "fs4", - "futures", "log", "sc-client-db", - "sc-utils", "sp-core", "thiserror", "tokio", @@ -11775,7 +13465,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -11794,7 +13484,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "libc", @@ -11813,7 +13503,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "chrono", "futures", @@ -11832,7 +13522,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "ansi_term", "atty", @@ -11840,12 +13530,10 @@ dependencies = [ "lazy_static", "libc", "log", - "once_cell", "parking_lot 0.12.1", "regex", "rustc-hash", "sc-client-api", - "sc-rpc-server", "sc-tracing-proc-macro", "serde", "sp-api", @@ -11863,25 +13551,24 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "futures", "futures-timer", "linked-hash-map", "log", - "num-traits", "parity-scale-codec", "parking_lot 0.12.1", "sc-client-api", @@ -11901,13 +13588,15 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "futures", "log", + "parity-scale-codec", "serde", "sp-blockchain", + "sp-core", "sp-runtime", "thiserror", ] @@ -11915,7 +13604,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-channel", "futures", @@ -11929,9 +13618,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" +checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ "bitvec", "cfg-if", @@ -11943,9 +13632,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11968,7 +13657,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.5", "cfg-if", "hashbrown 0.13.2", ] @@ -11983,7 +13672,7 @@ dependencies = [ "arrayvec 0.5.2", "curve25519-dalek 2.1.3", "getrandom 0.1.16", - "merlin", + "merlin 2.0.1", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", @@ -11991,17 +13680,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "schnorrkel" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "844b7645371e6ecdf61ff246ba1958c29e802881a749ae3fb1993675d210d28d" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek-ng", + "merlin 3.0.0", + "rand_core 0.6.4", + "sha2 0.9.9", + "subtle-ng", + "zeroize", +] + [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scratch" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "764cad9e7e1ca5fe15b552859ff5d96a314e6ed2934f2260168cd5dfa5891409" +checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" [[package]] name = "sct" @@ -12009,8 +13714,8 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -12019,8 +13724,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -12051,12 +13756,12 @@ dependencies = [ [[package]] name = "sec1" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct 0.2.0", - "der 0.7.7", + "der 0.7.8", "generic-array 0.14.7", "pkcs8 0.10.2", "subtle", @@ -12092,9 +13797,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -12105,9 +13810,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -12124,9 +13829,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" dependencies = [ "serde", ] @@ -12139,29 +13844,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.171" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.102" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5062a995d481b2308b6064e9af76011f2921c35f97b0468811ed9f6cd91dfed" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -12170,9 +13875,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -12192,9 +13897,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -12228,9 +13933,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -12249,18 +13954,18 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "shlex" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "signal-hook-registry" @@ -12306,9 +14011,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" dependencies = [ "bstr 0.2.17", "unicode-segmentation", @@ -12316,9 +14021,9 @@ dependencies = [ [[package]] name = "similar-asserts" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf644ad016b75129f01a34a355dcb8d66a5bc803e417c7a77cc5d5ee9fa0f18" +checksum = "e041bb827d1bfca18f213411d51b665309f1afb37a04a5d1464530e13779fc0f" dependencies = [ "console", "similar", @@ -12326,15 +14031,15 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -12347,8 +14052,8 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "enumn", "parity-scale-codec", @@ -12368,9 +14073,116 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + +[[package]] +name = "smol" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" +dependencies = [ + "async-channel", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-net", + "async-process", + "blocking", + "futures-lite", +] + +[[package]] +name = "smoldot" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0bb30cf57b7b5f6109ce17c3164445e2d6f270af2cb48f6e4d31c2967c9a9f5" +dependencies = [ + "arrayvec 0.7.4", + "async-lock", + "atomic-take", + "base64 0.21.5", + "bip39", + "blake2-rfc", + "bs58 0.5.0", + "chacha20 0.9.1", + "crossbeam-queue", + "derive_more", + "ed25519-zebra 4.0.3", + "either", + "event-listener 2.5.3", + "fnv", + "futures-lite", + "futures-util", + "hashbrown 0.14.2", + "hex", + "hmac 0.12.1", + "itertools 0.11.0", + "libsecp256k1", + "merlin 3.0.0", + "no-std-net", + "nom", + "num-bigint", + "num-rational", + "num-traits", + "pbkdf2 0.12.2", + "pin-project", + "poly1305 0.8.0", + "rand 0.8.5", + "rand_chacha 0.3.1", + "ruzstd", + "schnorrkel 0.10.2", + "serde", + "serde_json", + "sha2 0.10.8", + "sha3", + "siphasher", + "slab", + "smallvec", + "soketto", + "twox-hash", + "wasmi", + "x25519-dalek 2.0.0", + "zeroize", +] + +[[package]] +name = "smoldot-light" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "256b5bad1d6b49045e95fe87492ce73d5af81545d8b4d8318a872d2007024c33" +dependencies = [ + "async-channel", + "async-lock", + "base64 0.21.5", + "blake2-rfc", + "derive_more", + "either", + "event-listener 2.5.3", + "fnv", + "futures-channel", + "futures-lite", + "futures-util", + "hashbrown 0.14.2", + "hex", + "itertools 0.11.0", + "log", + "lru 0.11.1", + "no-std-net", + "parking_lot 0.12.1", + "pin-project", + "rand 0.8.5", + "rand_chacha 0.3.1", + "serde", + "serde_json", + "siphasher", + "slab", + "smol", + "smoldot", + "zeroize", +] [[package]] name = "snap" @@ -12380,26 +14192,26 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ "aes-gcm 0.9.4", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-rc.1", + "curve25519-dalek 4.1.1", "rand_core 0.6.4", - "ring", + "ring 0.16.20", "rustc_version", - "sha2 0.10.7", + "sha2 0.10.8", "subtle", ] [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -12407,9 +14219,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", @@ -12435,7 +14247,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "hash-db", "log", @@ -12443,6 +14255,7 @@ dependencies = [ "scale-info", "sp-api-proc-macro", "sp-core", + "sp-externalities", "sp-metadata-ir", "sp-runtime", "sp-state-machine", @@ -12455,21 +14268,21 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "Inflector", "blake2", - "expander 1.0.0", + "expander 2.0.0", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "sp-application-crypto" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", @@ -12481,8 +14294,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "integer-sqrt", "num-traits", @@ -12496,7 +14309,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", @@ -12509,9 +14322,8 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "parity-scale-codec", "sp-api", "sp-inherents", "sp-runtime", @@ -12521,13 +14333,13 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "futures", "log", - "lru 0.8.1", "parity-scale-codec", "parking_lot 0.12.1", + "schnellru", "sp-api", "sp-consensus", "sp-database", @@ -12539,7 +14351,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "futures", @@ -12554,14 +14366,13 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", - "sp-consensus", "sp-consensus-slots", "sp-inherents", "sp-runtime", @@ -12572,7 +14383,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "parity-scale-codec", @@ -12580,11 +14391,9 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-consensus", "sp-consensus-slots", "sp-core", "sp-inherents", - "sp-keystore", "sp-runtime", "sp-std", "sp-timestamp", @@ -12593,7 +14402,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "lazy_static", "parity-scale-codec", @@ -12606,13 +14415,13 @@ dependencies = [ "sp-mmr-primitives", "sp-runtime", "sp-std", - "strum", + "strum 0.24.1", ] [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "finality-grandpa", "log", @@ -12630,7 +14439,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", @@ -12641,16 +14450,18 @@ dependencies = [ [[package]] name = "sp-core" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "21.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", + "arrayvec 0.7.4", + "bandersnatch_vrfs", "bitflags 1.3.2", "blake2", "bounded-collections", - "bs58", + "bs58 0.5.0", "dyn-clonable", - "ed25519-zebra", + "ed25519-zebra 3.1.0", "futures", "hash-db", "hash256-std-hasher", @@ -12658,7 +14469,7 @@ dependencies = [ "lazy_static", "libsecp256k1", "log", - "merlin", + "merlin 2.0.1", "parity-scale-codec", "parking_lot 0.12.1", "paste", @@ -12666,7 +14477,7 @@ dependencies = [ "rand 0.8.5", "regex", "scale-info", - "schnorrkel", + "schnorrkel 0.9.1", "secp256k1", "secrecy", "serde", @@ -12680,38 +14491,37 @@ dependencies = [ "substrate-bip39", "thiserror", "tiny-bip39", + "tracing", "zeroize", ] [[package]] name = "sp-core-hashing" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", - "sp-std", "twox-hash", ] [[package]] name = "sp-core-hashing-proc-macro" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "proc-macro2", "quote", "sp-core-hashing", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -12719,18 +14529,18 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "sp-externalities" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "environmental", "parity-scale-codec", @@ -12738,16 +14548,26 @@ dependencies = [ "sp-storage", ] +[[package]] +name = "sp-genesis-builder" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "serde_json", + "sp-api", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-core", "sp-runtime", "sp-std", "thiserror", @@ -12755,13 +14575,11 @@ dependencies = [ [[package]] name = "sp-io" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bytes", - "ed25519", - "ed25519-dalek", - "futures", + "ed25519-dalek 2.0.0", "libsecp256k1", "log", "parity-scale-codec", @@ -12781,24 +14599,22 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "lazy_static", "sp-core", "sp-runtime", - "strum", + "strum 0.24.1", ] [[package]] name = "sp-keystore" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "0.27.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures", "parity-scale-codec", "parking_lot 0.12.1", - "serde", "sp-core", "sp-externalities", "thiserror", @@ -12807,16 +14623,16 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "thiserror", - "zstd 0.12.3+zstd.1.5.2", + "zstd 0.12.4", ] [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -12827,7 +14643,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -12845,7 +14661,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", @@ -12859,7 +14675,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "sp-api", "sp-core", @@ -12868,8 +14684,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "backtrace", "lazy_static", @@ -12879,7 +14695,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "rustc-hash", "serde", @@ -12888,8 +14704,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "either", "hash256-std-hasher", @@ -12910,8 +14726,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -12928,25 +14744,26 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-core", + "sp-keystore", "sp-runtime", "sp-staking", "sp-std", @@ -12955,8 +14772,9 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "serde", @@ -12967,8 +14785,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "0.28.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "hash-db", "log", @@ -12983,17 +14801,42 @@ dependencies = [ "sp-trie", "thiserror", "tracing", + "trie-db", +] + +[[package]] +name = "sp-statement-store" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "aes-gcm 0.10.3", + "curve25519-dalek 4.1.1", + "ed25519-dalek 2.0.0", + "hkdf", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sha2 0.10.8", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-externalities", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "thiserror", + "x25519-dalek 2.0.0", ] [[package]] name = "sp-std" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" [[package]] name = "sp-storage" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13006,11 +14849,9 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures-timer", - "log", "parity-scale-codec", "sp-inherents", "sp-runtime", @@ -13020,8 +14861,8 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "sp-std", @@ -13033,7 +14874,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "sp-api", "sp-runtime", @@ -13042,10 +14883,9 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "log", "parity-scale-codec", "scale-info", "sp-core", @@ -13057,10 +14897,10 @@ dependencies = [ [[package]] name = "sp-trie" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.5", "hash-db", "hashbrown 0.13.2", "lazy_static", @@ -13080,8 +14920,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13097,33 +14937,32 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "sp-wasm-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", "sp-std", - "wasmi", "wasmtime", ] [[package]] name = "sp-weights" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", @@ -13141,6 +14980,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spinners" version = "4.1.0" @@ -13149,7 +14994,7 @@ checksum = "08615eea740067d9899969bc2891c68a19c315cb1f66640af9a9ecb91b13bcab" dependencies = [ "lazy_static", "maplit", - "strum", + "strum 0.24.1", ] [[package]] @@ -13169,14 +15014,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.7", + "der 0.7.8", ] [[package]] name = "ss58-registry" -version = "1.41.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfc443bad666016e012538782d9e3006213a7db43e9fb1dda91657dc06a6fa08" +checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" dependencies = [ "Inflector", "num-format", @@ -13194,89 +15039,176 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] -name = "statemine-runtime" -version = "2.0.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +name = "staging-kusama-runtime" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "assets-common", - "cumulus-pallet-aura-ext", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-session-benchmarking", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-timestamp", - "cumulus-primitives-utility", + "binary-merkle-tree", + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", "frame-executive", "frame-support", "frame-system", + "frame-system-benchmarking", "frame-system-rpc-runtime-api", + "frame-try-runtime", "hex-literal 0.4.1", "kusama-runtime-constants", "log", - "pallet-asset-tx-payment", - "pallet-assets", - "pallet-aura", + "pallet-authority-discovery", "pallet-authorship", + "pallet-babe", + "pallet-bags-list", "pallet-balances", - "pallet-collator-selection", + "pallet-beefy", + "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", + "pallet-collective", + "pallet-conviction-voting", + "pallet-democracy", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", + "pallet-elections-phragmen", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-message-queue", + "pallet-mmr", "pallet-multisig", - "pallet-nfts", - "pallet-nfts-runtime-api", + "pallet-nis", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-preimage", "pallet-proxy", + "pallet-ranked-collective", + "pallet-recovery", + "pallet-referenda", + "pallet-scheduler", "pallet-session", + "pallet-session-benchmarking", + "pallet-society", + "pallet-staking", + "pallet-staking-runtime-api", "pallet-state-trie-migration", "pallet-timestamp", + "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "pallet-uniques", + "pallet-treasury", "pallet-utility", + "pallet-vesting", + "pallet-whitelist", "pallet-xcm", - "parachain-info", - "parachains-common", + "pallet-xcm-benchmarks", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-primitives", "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rustc-hex", "scale-info", + "serde", + "serde_derive", "smallvec", "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", "sp-block-builder", - "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-npos-elections", "sp-offchain", "sp-runtime", "sp-session", + "sp-staking", "sp-std", + "sp-storage", "sp-transaction-pool", "sp-version", - "sp-weights", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "static_assertions", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +name = "staging-xcm" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bounded-collections", + "derivative", + "environmental", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-weights", + "xcm-procedural", +] [[package]] -name = "static_init" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b73400442027c4adedda20a9f9b7945234a5bd8d5f7e86da22bd5d0622369c" +name = "staging-xcm-builder" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "cfg_aliases", - "libc", - "parking_lot 0.11.2", - "static_init_macro 0.5.0", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-transaction-payment", + "parity-scale-codec", + "polkadot-parachain-primitives", + "scale-info", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "staging-xcm", + "staging-xcm-executor", +] + +[[package]] +name = "staging-xcm-executor" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "staging-xcm", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "static_init" version = "1.0.3" @@ -13288,23 +15220,10 @@ dependencies = [ "libc", "parking_lot 0.11.2", "parking_lot_core 0.8.6", - "static_init_macro 1.0.2", + "static_init_macro", "winapi", ] -[[package]] -name = "static_init_macro" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbf" -dependencies = [ - "cfg_aliases", - "memchr", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "static_init_macro" version = "1.0.2" @@ -13330,9 +15249,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" @@ -13346,6 +15271,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.38", +] + [[package]] name = "stun" version = "0.4.4" @@ -13357,7 +15295,7 @@ dependencies = [ "lazy_static", "md-5", "rand 0.8.5", - "ring", + "ring 0.16.20", "subtle", "thiserror", "tokio", @@ -13373,7 +15311,7 @@ checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" dependencies = [ "hmac 0.11.0", "pbkdf2 0.8.0", - "schnorrkel", + "schnorrkel 0.9.1", "sha2 0.9.9", "zeroize", ] @@ -13381,26 +15319,23 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "platforms 2.0.0", -] +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" [[package]] name = "substrate-fixed" version = "0.5.9" -source = "git+https://github.com/encointer/substrate-fixed#a4fb461aae6205ffc55bed51254a40c52be04e5d" +source = "git+https://github.com/encointer/substrate-fixed#df67f97a6db9b40215f105613b381ca82f1e2ff4" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "typenum 1.16.0 (git+https://github.com/encointer/typenum?tag=v1.16.0)", + "typenum 1.16.0", ] [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -13419,7 +15354,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "hyper", "log", @@ -13431,7 +15366,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "jsonrpsee", @@ -13444,14 +15379,12 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "jsonrpsee", - "log", "parity-scale-codec", "sc-client-api", "sc-rpc-api", - "scale-info", "serde", "sp-core", "sp-runtime", @@ -13463,16 +15396,17 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "ansi_term", "build-helper", "cargo_metadata", "filetime", + "parity-wasm", "sp-maybe-compressed-blob", - "strum", + "strum 0.24.1", "tempfile", - "toml 0.7.6", + "toml 0.7.8", "walkdir", "wasm-opt", ] @@ -13492,6 +15426,12 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "subtle-ng" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" + [[package]] name = "syn" version = "1.0.109" @@ -13505,9 +15445,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -13555,29 +15495,28 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.9" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8e77cb757a61f51b947ec4a7e3646efd825b73561db1c232a8ccb639e611a0" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ - "autocfg", "cfg-if", - "fastrand", + "fastrand 2.0.1", "redox_syscall 0.3.5", - "rustix 0.37.23", + "rustix 0.38.20", "windows-sys 0.48.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -13590,22 +15529,42 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] +[[package]] +name = "thiserror-core" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d97345f6437bb2004cd58819d8a9ef8e36cdd7661c2abc4bbde0a7c40d9f497" +dependencies = [ + "thiserror-core-impl", +] + +[[package]] +name = "thiserror-core-impl" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ac1c5050e43014d16b2f94d0d2ce79e65ffdd8b38d8048f9c8f6a8a6da62ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] @@ -13648,9 +15607,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-ctl" -version = "0.5.0" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37706572f4b151dff7a0146e040804e9c26fe3a3118591112f05cf12a4216c1" +checksum = "619bfed27d807b54f7f776b9430d4f8060e66ee138a28632ca898584d462c31c" dependencies = [ "libc", "paste", @@ -13659,9 +15618,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.5.3+5.3.0-patched" +version = "0.5.4+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a678df20055b43e57ef8cddde41cdfda9a3c1a060b67f4c5836dfb1d78543ba8" +checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" dependencies = [ "cc", "libc", @@ -13669,22 +15628,13 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.23" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ + "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -13692,15 +15642,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -13717,13 +15667,22 @@ dependencies = [ "pbkdf2 0.11.0", "rand 0.8.5", "rustc-hash", - "sha2 0.10.7", + "sha2 0.10.8", "thiserror", "unicode-normalization", "wasm-bindgen", "zeroize", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -13751,20 +15710,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.13", "signal-hook-registry", - "socket2 0.4.9", + "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", ] @@ -13777,18 +15735,28 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", +] + +[[package]] +name = "tokio-retry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +dependencies = [ + "pin-project", + "rand 0.8.5", + "tokio", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.20.8", + "rustls 0.21.7", "tokio", - "webpki 0.22.0", ] [[package]] @@ -13798,22 +15766,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.13", "tokio", "tokio-util", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.13", "tokio", "tracing", ] @@ -13829,9 +15797,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", @@ -13841,20 +15809,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.12" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "serde", "serde_spanned", "toml_datetime", @@ -13874,18 +15842,18 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.3.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "bytes", "futures-core", "futures-util", "http", "http-body", "http-range-header", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.13", "tower-layer", "tower-service", ] @@ -13904,33 +15872,32 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.13", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -13948,9 +15915,10 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "coarsetime", "polkadot-node-jaeger", "polkadot-primitives", "tracing", @@ -13959,24 +15927,24 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "expander 2.0.0", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -14053,7 +16021,7 @@ dependencies = [ "lazy_static", "rand 0.8.5", "smallvec", - "socket2 0.4.9", + "socket2 0.4.10", "thiserror", "tinyvec", "tokio", @@ -14090,7 +16058,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "clap", @@ -14101,7 +16069,6 @@ dependencies = [ "parity-scale-codec", "sc-cli", "sc-executor", - "sc-service", "serde", "serde_json", "sp-api", @@ -14121,7 +16088,7 @@ dependencies = [ "sp-version", "sp-weights", "substrate-rpc-client", - "zstd 0.12.3+zstd.1.5.2", + "zstd 0.12.4", ] [[package]] @@ -14142,7 +16109,7 @@ dependencies = [ "log", "md-5", "rand 0.8.5", - "ring", + "ring 0.16.20", "stun", "thiserror", "tokio", @@ -14164,18 +16131,18 @@ dependencies = [ [[package]] name = "typenum" version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "typenum" -version = "1.16.0" -source = "git+https://github.com/encointer/typenum?tag=v1.16.0#4c8dddaa8bdd13130149e43b4085ad14e960617f" +source = "git+https://github.com/encointer/typenum?tag=polkadot-v1.0.0#4cba9a73f7e94ba38c824616efab93f177c9a556" dependencies = [ "parity-scale-codec", "scale-info", ] +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "ucd-trie" version = "0.1.6" @@ -14202,9 +16169,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -14223,9 +16190,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -14255,9 +16222,9 @@ dependencies = [ [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ "asynchronous-codec", "bytes", @@ -14271,11 +16238,17 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna 0.4.0", @@ -14290,9 +16263,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" dependencies = [ "getrandom 0.2.10", ] @@ -14332,15 +16305,15 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -14361,12 +16334,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -14394,7 +16361,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -14428,7 +16395,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -14450,14 +16417,14 @@ dependencies = [ [[package]] name = "wasm-opt" -version = "0.111.0" +version = "0.114.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a303793cbc01fb96551badfc7367db6007396bba6bac97936b3c8b6f7fdb41" +checksum = "effbef3bd1dde18acb401f73e740a6f3d4a1bc651e9773bddc512fe4d8d68f67" dependencies = [ "anyhow", "libc", - "strum", - "strum_macros", + "strum 0.24.1", + "strum_macros 0.24.3", "tempfile", "thiserror", "wasm-opt-cxx-sys", @@ -14466,9 +16433,9 @@ dependencies = [ [[package]] name = "wasm-opt-cxx-sys" -version = "0.111.0" +version = "0.114.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c9deb56f8a9f2ec177b3bd642a8205621835944ed5da55f2388ef216aca5a4" +checksum = "c09e24eb283919ace2ed5733bda4842a59ce4c8de110ef5c6d98859513d17047" dependencies = [ "anyhow", "cxx", @@ -14478,15 +16445,14 @@ dependencies = [ [[package]] name = "wasm-opt-sys" -version = "0.111.0" +version = "0.114.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4432e28b542738a9776cedf92e8a99d8991c7b4667ee2c7ccddfb479dd2856a7" +checksum = "36f2f817bed2e8d65eb779fa37317e74de15585751f903c9118342d1970703a4" dependencies = [ "anyhow", "cc", "cxx", "cxx-build", - "regex", ] [[package]] @@ -14506,53 +16472,59 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.13.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" +checksum = "1f341edb80021141d4ae6468cbeefc50798716a347d4085c3811900049ea8945" dependencies = [ - "parity-wasm", - "wasmi-validation", + "smallvec", + "spin 0.9.8", + "wasmi_arena", "wasmi_core", + "wasmparser-nostd", ] [[package]] -name = "wasmi-validation" -version = "0.5.0" +name = "wasmi_arena" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" -dependencies = [ - "parity-wasm", -] +checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" [[package]] name = "wasmi_core" -version = "0.2.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" dependencies = [ "downcast-rs", - "libm 0.2.7", - "memory_units", - "num-rational", + "libm", "num-traits", - "region", + "paste", ] [[package]] name = "wasmparser" -version = "0.100.0" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ "indexmap 1.9.3", "url", ] +[[package]] +name = "wasmparser-nostd" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +dependencies = [ + "indexmap-nostd", +] + [[package]] name = "wasmtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", @@ -14560,7 +16532,7 @@ dependencies = [ "indexmap 1.9.3", "libc", "log", - "object 0.29.0", + "object 0.30.4", "once_cell", "paste", "psm", @@ -14573,43 +16545,43 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-asm-macros" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ceb3adf61d654be0be67fffdce42447b0880481348785be5fe40b5dd7663a4c" +checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.13.1", + "base64 0.21.5", "bincode", "directories-next", "file-per-thread-logger", "log", - "rustix 0.36.15", + "rustix 0.36.16", "serde", - "sha2 0.10.7", + "sha2 0.10.8", "toml 0.5.11", - "windows-sys 0.42.0", + "windows-sys 0.45.0", "zstd 0.11.2+zstd.1.5.2", ] [[package]] name = "wasmtime-cranelift" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c366bb8647e01fd08cb5589976284b00abfded5529b33d7e7f3f086c68304a4" +checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" dependencies = [ "anyhow", "cranelift-codegen", @@ -14617,27 +16589,43 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.26.2", + "gimli 0.27.3", "log", - "object 0.29.0", + "object 0.30.4", "target-lexicon", "thiserror", "wasmparser", + "wasmtime-cranelift-shared", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-native", + "gimli 0.27.3", + "object 0.30.4", + "target-lexicon", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.26.2", + "gimli 0.27.3", "indexmap 1.9.3", "log", - "object 0.29.0", + "object 0.30.4", "serde", "target-lexicon", "thiserror", @@ -14647,18 +16635,18 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.17.0", + "addr2line 0.19.0", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.26.2", + "gimli 0.27.3", "log", - "object 0.29.0", + "object 0.30.4", "rustc-demangle", "serde", "target-lexicon", @@ -14666,36 +16654,36 @@ dependencies = [ "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-jit-debug" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ - "object 0.29.0", + "object 0.30.4", "once_cell", - "rustix 0.36.15", + "rustix 0.36.16", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ "cfg-if", "libc", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-runtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", @@ -14705,21 +16693,21 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.6.5", + "memoffset 0.8.0", "paste", "rand 0.8.5", - "rustix 0.36.15", + "rustix 0.36.16", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-types" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", @@ -14743,18 +16731,18 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -14763,9 +16751,24 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.0", + "webpki 0.22.4", +] + +[[package]] +name = "webpki-roots" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" +dependencies = [ + "rustls-webpki 0.100.3", ] +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + [[package]] name = "webrtc" version = "0.6.0" @@ -14782,17 +16785,17 @@ dependencies = [ "rand 0.8.5", "rcgen 0.9.3", "regex", - "ring", + "ring 0.16.20", "rtcp", "rtp", "rustls 0.19.1", "sdp", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "stun", "thiserror", - "time 0.3.23", + "time", "tokio", "turn", "url", @@ -14824,12 +16827,12 @@ dependencies = [ [[package]] name = "webrtc-dtls" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942be5bd85f072c3128396f6e5a9bfb93ca8c1939ded735d177b7bcba9a13d05" +checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" dependencies = [ "aes 0.6.0", - "aes-gcm 0.10.2", + "aes-gcm 0.10.3", "async-trait", "bincode", "block-modes", @@ -14841,25 +16844,24 @@ dependencies = [ "hkdf", "hmac 0.12.1", "log", - "oid-registry 0.6.1", "p256", "p384", "rand 0.8.5", "rand_core 0.6.4", - "rcgen 0.9.3", - "ring", + "rcgen 0.10.0", + "ring 0.16.20", "rustls 0.19.1", "sec1 0.3.0", "serde", "sha1", - "sha2 0.10.7", + "sha2 0.10.8", "signature 1.6.4", "subtle", "thiserror", "tokio", "webpki 0.21.4", "webrtc-util", - "x25519-dalek 2.0.0-pre.1", + "x25519-dalek 2.0.0", "x509-parser 0.13.2", ] @@ -14894,7 +16896,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" dependencies = [ "log", - "socket2 0.4.9", + "socket2 0.4.10", "thiserror", "tokio", "webrtc-util", @@ -14977,9 +16979,10 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "binary-merkle-tree", "bitvec", "frame-benchmarking", "frame-election-provider-support", @@ -14996,6 +16999,8 @@ dependencies = [ "pallet-babe", "pallet-bags-list", "pallet-balances", + "pallet-beefy", + "pallet-beefy-mmr", "pallet-collective", "pallet-democracy", "pallet-election-provider-multi-phase", @@ -15007,6 +17012,8 @@ dependencies = [ "pallet-im-online", "pallet-indices", "pallet-membership", + "pallet-message-queue", + "pallet-mmr", "pallet-multisig", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", @@ -15034,7 +17041,7 @@ dependencies = [ "pallet-xcm", "pallet-xcm-benchmarks", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -15044,6 +17051,7 @@ dependencies = [ "serde_derive", "smallvec", "sp-api", + "sp-application-crypto", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", @@ -15058,19 +17066,20 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", "westend-runtime-constants", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] name = "westend-runtime-constants" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "polkadot-primitives", @@ -15083,20 +17092,21 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix 0.38.20", ] [[package]] name = "wide" -version = "0.7.11" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa469ffa65ef7e0ba0f164183697b89b854253fd31aeb92358b7b6155177d62f" +checksum = "c68938b57b33da363195412cfc5fc37c9ed49aa9cfe2156fde64b8d2c9498242" dependencies = [ "bytemuck", "safe_arch", @@ -15126,9 +17136,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -15141,39 +17151,21 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" -dependencies = [ - "windows_aarch64_msvc 0.34.0", - "windows_i686_gnu 0.34.0", - "windows_i686_msvc 0.34.0", - "windows_x86_64_gnu 0.34.0", - "windows_x86_64_msvc 0.34.0", -] - -[[package]] -name = "windows" -version = "0.48.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-targets 0.48.1", + "windows-core", + "windows-targets 0.48.5", ] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows-core" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.48.5", ] [[package]] @@ -15191,7 +17183,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -15211,17 +17203,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -15232,15 +17224,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.34.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -15250,15 +17236,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.34.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -15268,15 +17248,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -15286,15 +17260,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.34.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -15304,9 +17272,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -15316,15 +17284,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.34.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -15334,15 +17296,15 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.4.9" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a2094c43cc94775293eaa0e499fbc30048a6d824ac82c0351a8c0bf9112529" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" dependencies = [ "memchr", ] @@ -15379,12 +17341,13 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0-pre.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5da623d8af10a62342bcbbb230e33e58a63255a58012f8653c578e54bab48df" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.1.1", "rand_core 0.6.4", + "serde", "zeroize", ] @@ -15401,10 +17364,10 @@ dependencies = [ "lazy_static", "nom", "oid-registry 0.4.0", - "ring", + "ring 0.16.20", "rusticata-macros", "thiserror", - "time 0.3.23", + "time", ] [[package]] @@ -15422,141 +17385,68 @@ dependencies = [ "oid-registry 0.6.1", "rusticata-macros", "thiserror", - "time 0.3.23", -] - -[[package]] -name = "xcm" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" -dependencies = [ - "bounded-collections", - "derivative", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-weights", - "xcm-procedural", -] - -[[package]] -name = "xcm-builder" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-transaction-payment", - "parity-scale-codec", - "polkadot-parachain", - "scale-info", - "sp-arithmetic", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", + "time", ] [[package]] name = "xcm-emulator" version = "0.1.0" -source = "git+https://github.com/shaunxw/xcm-simulator?rev=d011e5ca62b93e8f688c2042c1f92cdbafc5d1d0#d011e5ca62b93e8f688c2042c1f92cdbafc5d1d0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", - "cumulus-pallet-xcmp-queue", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-test-relay-sproof-builder", "frame-support", "frame-system", - "parachain-info", + "impl-trait-for-tuples", + "lazy_static", + "log", + "pallet-balances", + "pallet-message-queue", + "parachains-common", "parity-scale-codec", "paste", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-parachains", - "quote", - "sp-arithmetic", - "sp-io", - "sp-std", - "xcm", - "xcm-executor", -] - -[[package]] -name = "xcm-executor" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" -dependencies = [ - "environmental", - "frame-benchmarking", - "frame-support", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", "sp-arithmetic", "sp-core", "sp-io", "sp-runtime", "sp-std", - "sp-weights", - "xcm", -] - -[[package]] -name = "xcm-interface" -version = "0.8.0" -dependencies = [ - "bifrost-asset-registry", - "cumulus-primitives-core", - "frame-benchmarking", - "frame-support", - "frame-system", - "node-primitives", - "orml-traits", - "pallet-balances", - "pallet-xcm", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", + "sp-tracing", + "staging-xcm", + "staging-xcm-executor", ] [[package]] name = "xcm-procedural" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] name = "xcm-simulator" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "parity-scale-codec", "paste", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-runtime-parachains", "sp-io", "sp-std", - "xcm", - "xcm-executor", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -15579,18 +17469,18 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.23", + "time", ] [[package]] name = "zenlink-protocol" version = "0.4.4" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf#c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?rev=f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1#f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" dependencies = [ "cumulus-primitives-core", + "frame-benchmarking", "frame-support", "frame-system", - "log", "orml-tokens", "orml-traits", "pallet-balances", @@ -15601,17 +17491,17 @@ dependencies = [ "sp-core", "sp-runtime", "sp-std", - "xcm", - "xcm-executor", + "staging-xcm", ] [[package]] name = "zenlink-protocol-rpc" version = "0.4.4" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf#c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?rev=f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1#f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" dependencies = [ "jsonrpsee", "parity-scale-codec", + "serde", "sp-api", "sp-blockchain", "sp-rpc", @@ -15623,7 +17513,7 @@ dependencies = [ [[package]] name = "zenlink-protocol-runtime-api" version = "0.4.4" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf#c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?rev=f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1#f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" dependencies = [ "parity-scale-codec", "sp-api", @@ -15634,7 +17524,7 @@ dependencies = [ [[package]] name = "zenlink-stable-amm" version = "0.1.0" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf#c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?rev=f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1#f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" dependencies = [ "frame-support", "frame-system", @@ -15651,7 +17541,7 @@ dependencies = [ [[package]] name = "zenlink-stable-amm-rpc" version = "0.1.0" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf#c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?rev=f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1#f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -15665,7 +17555,7 @@ dependencies = [ [[package]] name = "zenlink-stable-amm-runtime-api" version = "0.1.0" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf#c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?rev=f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1#f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" dependencies = [ "parity-scale-codec", "sp-api", @@ -15676,7 +17566,7 @@ dependencies = [ [[package]] name = "zenlink-swap-router" version = "0.1.0" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf#c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?rev=f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1#f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" dependencies = [ "frame-support", "frame-system", @@ -15692,6 +17582,26 @@ dependencies = [ "zenlink-stable-amm", ] +[[package]] +name = "zerocopy" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c19fae0c8a9efc6a8281f2e623db8af1db9e57852e04cde3e754dd2dc29340f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc56589e9ddd1f1c28d4b4b5c773ce232910a6bb67a70133d61c9e347585efe9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "zeroize" version = "1.6.0" @@ -15709,7 +17619,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] @@ -15723,11 +17633,11 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.3+zstd.1.5.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" dependencies = [ - "zstd-safe 6.0.5+zstd.1.5.4", + "zstd-safe 6.0.6", ] [[package]] @@ -15742,9 +17652,9 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.5+zstd.1.5.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" dependencies = [ "libc", "zstd-sys", @@ -15752,11 +17662,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index a3f49c3c0..7ac37b55a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,13 @@ +cargo-features = ["resolver"] + [workspace] members = [ "integration-tests/bifrost-kusama", "integration-tests/bifrost-polkadot", "node/cli", - "node/primitives", "node/rpc", "node/service", + "primitives", "pallets/asset-registry", "pallets/currencies", "pallets/flexible-fee", @@ -27,12 +29,13 @@ members = [ "pallets/parachain-staking", "pallets/ve-minting", "pallets/stable-pool", - "pallets/lend-market", - "pallets/prices", + "runtime/bifrost-kusama", "runtime/bifrost-polkadot", ] +resolver = "2" + [profile.dev] split-debuginfo = "unpacked" @@ -74,12 +77,10 @@ ed25519-dalek = { opt-level = 3 } flate2 = { opt-level = 3 } futures-channel = { opt-level = 3 } hashbrown = { opt-level = 3 } -hash-db = { opt-level = 3 } hmac = { opt-level = 3 } httparse = { opt-level = 3 } integer-sqrt = { opt-level = 3 } keccak = { opt-level = 3 } -libm = { opt-level = 3 } librocksdb-sys = { opt-level = 3 } libsecp256k1 = { opt-level = 3 } libz-sys = { opt-level = 3 } @@ -98,29 +99,23 @@ smallvec = { opt-level = 3 } snow = { opt-level = 3 } twox-hash = { opt-level = 3 } uint = { opt-level = 3 } -wasmi = { opt-level = 3 } x25519-dalek = { opt-level = 3 } yamux = { opt-level = 3 } zeroize = { opt-level = 3 } [patch.crates-io] -zenlink-protocol = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" } -zenlink-protocol-rpc = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" } -zenlink-protocol-runtime-api = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" } -zenlink-stable-amm = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" } -zenlink-stable-amm-rpc = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" } -zenlink-stable-amm-runtime-api = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" } -zenlink-swap-router = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "c32bb5f63bcd06dc49ca8a48dd7b7a0f78c358bf" } -merkle-distributor = { git = "https://github.com/zenlinkpro/merkle-distributor", rev = "e7483e829d540993141a6b3a9a1f6ec0a06c7744" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "4ae0372e2c624e6acc98305564b9d395f70814c0" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "4ae0372e2c624e6acc98305564b9d395f70814c0" } -orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "4ae0372e2c624e6acc98305564b9d395f70814c0" } -orml-unknown-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "4ae0372e2c624e6acc98305564b9d395f70814c0" } -orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "4ae0372e2c624e6acc98305564b9d395f70814c0" } -orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "4ae0372e2c624e6acc98305564b9d395f70814c0" } -orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "4ae0372e2c624e6acc98305564b9d395f70814c0" } -orml-utilities = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "4ae0372e2c624e6acc98305564b9d395f70814c0" } -xcm-emulator = { git = "https://github.com/shaunxw/xcm-simulator", rev = "d011e5ca62b93e8f688c2042c1f92cdbafc5d1d0" } - -[workspace.dependencies] -bifrost-currencies = { path = "./pallets/currencies", default-features = false} +zenlink-protocol = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", rev = "f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" } +zenlink-protocol-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", rev = "f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" } +zenlink-protocol-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", rev = "f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" } +zenlink-stable-amm = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", rev = "f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" } +zenlink-stable-amm-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", rev = "f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" } +zenlink-stable-amm-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", rev = "f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" } +zenlink-swap-router = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", rev = "f5d2ce81b72d36eb0b71d021a4eecf95d0a437e1" } +merkle-distributor = { git = "https://github.com/bifrost-finance/merkle-distributor", rev = "030bfe47039aa61d3a58a7bf5e12c957401972d6" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4" } +orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4" } +orml-unknown-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4" } +orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4" } +orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4" } +orml-utilities = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4" } diff --git a/Dockerfile b/Dockerfile index 00b11bc97..1651db50b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2019-2022 Liebi Technologies. +# Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. # This file is part of Bifrost. # Bifrost is free software: you can redistribute it and/or modify @@ -18,8 +18,8 @@ FROM rust:buster as builder RUN apt-get update && apt-get install time cmake clang libclang-dev llvm protobuf-compiler -y -RUN rustup toolchain install nightly-2022-11-15 -RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2022-11-15 +RUN rustup toolchain install nightly-2023-05-22 +RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 WORKDIR /app COPY . /app diff --git a/HEADER-GPL3 b/HEADER-GPL3 index ac118b203..b07d40bf0 100644 --- a/HEADER-GPL3 +++ b/HEADER-GPL3 @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/Makefile b/Makefile index 0f86041ac..61e32577f 100644 --- a/Makefile +++ b/Makefile @@ -35,23 +35,23 @@ test-all: integration-test test-runtimes test-benchmarks .PHONY: test-runtimes test-runtimes: - SKIP_WASM_BUILD= cargo test --features "with-all-runtime" --lib + cargo test --features "with-all-runtime" --lib .PHONY: test-benchmarks test-benchmarks: - cargo test --all benchmarking --features="runtime-benchmarks, polkadot" --exclude "*-integration-tests" --exclude "node-*" --exclude "*-runtime" + cargo test --all benchmarking --features="runtime-benchmarks, polkadot" --exclude "*integration*" --exclude "node-*" --exclude "*-runtime" .PHONY: integration-test # integration test integration-test: - SKIP_WASM_BUILD= cargo test -p *-integration-tests + cargo test -p *-integration-tests .PHONY: kusama-integration-test # integration test kusama-integration-test: - SKIP_WASM_BUILD= cargo test -p bifrost-kusama-integration-tests + cargo test -p bifrost-kusama-integration-tests .PHONY: polkadot-integration-test # integration test polkadot-integration-test: - SKIP_WASM_BUILD= cargo test -p bifrost-polkadot-integration-tests + cargo test -p bifrost-polkadot-integration-tests .PHONY: clean # cargo clean clean: @@ -68,7 +68,7 @@ format: .PHONY: clippy # cargo clippy clippy: - cargo clippy --all --all-targets --features=with-all-runtime -- -D warnings + SKIP_WASM_BUILD= cargo clippy --all --all-targets --features=with-all-runtime -- -D warnings .PHONY: benchmarking-staking # benchmarking staking pallet benchmarking-staking: diff --git a/integration-tests/bifrost-kusama/Cargo.toml b/integration-tests/bifrost-kusama/Cargo.toml index e5f3bc763..bb5530676 100644 --- a/integration-tests/bifrost-kusama/Cargo.toml +++ b/integration-tests/bifrost-kusama/Cargo.toml @@ -5,87 +5,38 @@ authors = ["Ron Yang "] edition = "2021" [dependencies] -# third-party dependencies -codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"] } -log = { version = "0.4.17" } -serde = { version = "1.0.160", optional = true } -static_assertions = "1.1.0" -hex = { version = "0.4", optional = true } -hex-literal = { version = "0.3.4" } - -# primitives -node-primitives = { default-features = false, path = "../../node/primitives" } - -# frame dependencies -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-conviction-voting = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-referenda = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } - -# Cumulus dependencies -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } - -# Polkadot dependencies -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } - -# bifrost pallets -bifrost-asset-registry = { path = "../../pallets/asset-registry" } -bifrost-flexible-fee = { path = "../../pallets/flexible-fee" } -bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api" } -bifrost-salp = { path = "../../pallets/salp" } -bifrost-salp-rpc-runtime-api = { path = "../../pallets/salp/rpc/runtime-api" } +env_logger = "0.10.0" +codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } + +# Substrate +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-asset-conversion = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} + +# Polkadot +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +kusama-runtime = { package = "staging-kusama-runtime", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} + +# Cumulus +parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +asset-hub-kusama-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } + +# Local +xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +integration-tests-common = { path = "../common", default-features = false} bifrost-slp = { path = "../../pallets/slp" } -bifrost-vsbond-auction = { path = "../../pallets/vsbond-auction" } -bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting" } -bifrost-vtoken-voting = { path = "../../pallets/vtoken-voting", features = [ "kusama" ] } -pallet-vesting = { package = "bifrost-vesting", path = "../../pallets/vesting" } -bifrost-runtime-common = { path = "../../runtime/common" } +bifrost-vtoken-voting = { path = "../../pallets/vtoken-voting" } +bifrost-primitives = { path = "../../primitives" } +bifrost-asset-registry = { path = "../../pallets/asset-registry" } bifrost-kusama-runtime = { path = "../../runtime/bifrost-kusama" } - -# orml -orml-tokens = { version = "0.4.1-dev" } -orml-traits = { version = "0.4.1-dev" } -orml-xtokens = { version = "0.4.1-dev" } -orml-unknown-tokens = { version = "0.4.1-dev" } -orml-xcm-support = { version = "0.4.1-dev" } - -zenlink-protocol = { version = "*" } -zenlink-protocol-runtime-api = { version = "*" } - -[dev-dependencies] -env_logger = "0.10.0" -hex = "0.4.0" - -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } - -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-test-relay-sproof-builder = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } - -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -kusama-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -statemine-runtime = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -xcm-emulator = { version = "*" } diff --git a/integration-tests/bifrost-kusama/src/asset_registry.rs b/integration-tests/bifrost-kusama/src/asset_registry.rs deleted file mode 100644 index 4dae2bf90..000000000 --- a/integration-tests/bifrost-kusama/src/asset_registry.rs +++ /dev/null @@ -1,325 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program 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. - -// This program 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 this program. If not, see . - -use crate::kusama_integration_tests::*; -use bifrost_asset_registry::{ - AssetMetadata, AssetMetadatas, CurrencyIdToLocations, CurrencyIdToWeights, CurrencyMetadatas, - Error, Event, LocationToCurrencyIds, -}; -use frame_support::{assert_noop, assert_ok}; -use xcm::{ - v3::{prelude::*, Weight}, - VersionedMultiLocation, -}; - -#[test] -fn register_native_asset_works() { - sp_io::TestExternalities::default().execute_with(|| { - ExtBuilder::default().build().execute_with(|| { - let v0_location = VersionedMultiLocation::V3(X1(Parachain(1000)).into()); - - assert_ok!(AssetRegistry::register_native_asset( - RuntimeOrigin::root(), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(v0_location.clone()), - Box::new(AssetMetadata { - name: b"Token Name".to_vec(), - symbol: b"TN".to_vec(), - decimals: 12, - minimal_balance: 1, - }) - )); - System::assert_last_event(RuntimeEvent::AssetRegistry(Event::AssetRegistered { - asset_id: AssetIds::NativeAssetId(CurrencyId::Token(TokenSymbol::DOT)), - metadata: AssetMetadata { - name: b"Token Name".to_vec(), - symbol: b"TN".to_vec(), - decimals: 12, - minimal_balance: 1, - }, - })); - - assert_eq!( - AssetMetadatas::::get(AssetIds::NativeAssetId(CurrencyId::Token( - TokenSymbol::DOT - ))), - Some(AssetMetadata { - name: b"Token Name".to_vec(), - symbol: b"TN".to_vec(), - decimals: 12, - minimal_balance: 1, - }) - ); - // Can't duplicate - assert_noop!( - AssetRegistry::register_native_asset( - RuntimeOrigin::root(), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(v0_location.clone()), - Box::new(AssetMetadata { - name: b"Token Name".to_vec(), - symbol: b"TN".to_vec(), - decimals: 12, - minimal_balance: 1, - }) - ), - Error::::AssetIdExisted - ); - }); - }) -} - -#[test] -fn update_native_asset_works() { - sp_io::TestExternalities::default().execute_with(|| { - ExtBuilder::default().build().execute_with(|| { - let v0_location = VersionedMultiLocation::V3(X1(Parachain(1000)).into()); - assert_noop!( - AssetRegistry::update_native_asset( - RuntimeOrigin::root(), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(v0_location.clone()), - Box::new(AssetMetadata { - name: b"New Token Name".to_vec(), - symbol: b"NTN".to_vec(), - decimals: 13, - minimal_balance: 2, - }) - ), - Error::::AssetIdNotExists - ); - - let new_location = VersionedMultiLocation::V3(X1(Parachain(2000)).into()); - assert_ok!(AssetRegistry::register_native_asset( - RuntimeOrigin::root(), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(new_location.clone()), - Box::new(AssetMetadata { - name: b"Token Name".to_vec(), - symbol: b"TN".to_vec(), - decimals: 12, - minimal_balance: 1, - }) - )); - - assert_ok!(AssetRegistry::update_native_asset( - RuntimeOrigin::root(), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(new_location.clone()), - Box::new(AssetMetadata { - name: b"New Token Name".to_vec(), - symbol: b"NTN".to_vec(), - decimals: 13, - minimal_balance: 2, - }) - )); - - System::assert_last_event(bifrost_kusama_runtime::RuntimeEvent::AssetRegistry( - Event::AssetUpdated { - asset_id: AssetIds::NativeAssetId(CurrencyId::Token(TokenSymbol::DOT)), - metadata: AssetMetadata { - name: b"New Token Name".to_vec(), - symbol: b"NTN".to_vec(), - decimals: 13, - minimal_balance: 2, - }, - }, - )); - - assert_eq!( - AssetMetadatas::::get(AssetIds::NativeAssetId(CurrencyId::Token( - TokenSymbol::DOT - ))), - Some(AssetMetadata { - name: b"New Token Name".to_vec(), - symbol: b"NTN".to_vec(), - decimals: 13, - minimal_balance: 2, - }) - ); - }); - }) -} - -#[test] -fn register_token_metadata() { - sp_io::TestExternalities::default().execute_with(|| { - ExtBuilder::default().build().execute_with(|| { - let metadata = AssetMetadata { - name: b"Bifrost Native Coin".to_vec(), - symbol: b"BNC".to_vec(), - decimals: 12, - minimal_balance: 0, - }; - - assert_ok!(AssetRegistry::register_token_metadata( - RuntimeOrigin::root(), - Box::new(metadata.clone()) - )); - - assert_eq!( - CurrencyMetadatas::::get(CurrencyId::Token2(0)), - Some(metadata.clone()) - ) - }) - }) -} - -#[test] -fn register_vtoken_metadata() { - sp_io::TestExternalities::default().execute_with(|| { - ExtBuilder::default().build().execute_with(|| { - let metadata = AssetMetadata { - name: b"Bifrost Native Coin".to_vec(), - symbol: b"BNC".to_vec(), - decimals: 12, - minimal_balance: 0, - }; - let v_metadata = AssetMetadata { - name: b"Voucher BNC".to_vec(), - symbol: b"vBNC".to_vec(), - decimals: 12, - minimal_balance: 0, - }; - assert_noop!( - AssetRegistry::register_vtoken_metadata(RuntimeOrigin::root(), 1), - Error::::CurrencyIdNotExists - ); - - assert_ok!(AssetRegistry::register_token_metadata( - RuntimeOrigin::root(), - Box::new(metadata.clone()) - )); - - assert_ok!(AssetRegistry::register_vtoken_metadata(RuntimeOrigin::root(), 0)); - - assert_eq!( - CurrencyMetadatas::::get(CurrencyId::VToken2(0)), - Some(v_metadata.clone()) - ) - }) - }) -} - -#[test] -fn register_vsbond_metadata() { - sp_io::TestExternalities::default().execute_with(|| { - ExtBuilder::default().build().execute_with(|| { - let metadata = AssetMetadata { - name: b"KSM Native Token".to_vec(), - symbol: b"KSM".to_vec(), - decimals: 12, - minimal_balance: 0, - }; - let name = "vsBOND-KSM-2001-10-20".as_bytes().to_vec(); - let v_metadata = AssetMetadata { - name: name.clone(), - symbol: name, - decimals: 12, - minimal_balance: 0, - }; - assert_noop!( - AssetRegistry::register_vtoken_metadata(RuntimeOrigin::root(), 1), - Error::::CurrencyIdNotExists - ); - - assert_ok!(AssetRegistry::register_token_metadata( - RuntimeOrigin::root(), - Box::new(metadata.clone()) - )); - - assert_ok!(AssetRegistry::register_vsbond_metadata( - RuntimeOrigin::root(), - 0, - 2001, - 10, - 20 - )); - - assert_eq!( - CurrencyMetadatas::::get(CurrencyId::VSBond2(0, 2001, 10, 20)), - Some(v_metadata.clone()) - ) - }) - }) -} - -#[test] -fn register_multilocation() { - sp_io::TestExternalities::default().execute_with(|| { - ExtBuilder::default().build().execute_with(|| { - let metadata = AssetMetadata { - name: b"Bifrost Native Coin".to_vec(), - symbol: b"BNC".to_vec(), - decimals: 12, - minimal_balance: 0, - }; - - let location = VersionedMultiLocation::V3(MultiLocation { - parents: 1, - interior: X1(Parachain(2001)), - }); - let multi_location: MultiLocation = location.clone().try_into().unwrap(); - - assert_noop!( - AssetRegistry::register_multilocation( - RuntimeOrigin::root(), - CurrencyId::Token2(0), - Box::new(location.clone()), - Weight::from_parts(2000_000_000, 0) - ), - Error::::CurrencyIdNotExists - ); - - assert_ok!(AssetRegistry::register_token_metadata( - RuntimeOrigin::root(), - Box::new(metadata.clone()) - )); - - assert_ok!(AssetRegistry::register_multilocation( - RuntimeOrigin::root(), - CurrencyId::Token2(0), - Box::new(location.clone()), - Weight::from_parts(2000_000_000, 0) - )); - - assert_noop!( - AssetRegistry::register_multilocation( - RuntimeOrigin::root(), - CurrencyId::Token2(0), - Box::new(location.clone()), - Weight::from_parts(2000_000_000, 0) - ), - Error::::CurrencyIdExisted - ); - - assert_eq!( - LocationToCurrencyIds::::get(multi_location), - Some(CurrencyId::Token2(0)) - ); - assert_eq!( - CurrencyIdToLocations::::get(CurrencyId::Token2(0)), - Some(multi_location) - ); - assert_eq!( - CurrencyIdToWeights::::get(CurrencyId::Token2(0)), - Some(Weight::from_parts(2000_000_000, 0)) - ); - }) - }) -} diff --git a/integration-tests/bifrost-kusama/src/dollor_tests.rs b/integration-tests/bifrost-kusama/src/dollor_tests.rs index eb1f268c9..a168e7b21 100644 --- a/integration-tests/bifrost-kusama/src/dollor_tests.rs +++ b/integration-tests/bifrost-kusama/src/dollor_tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,8 +17,8 @@ // along with this program. If not, see . use bifrost_kusama_runtime::Runtime; +use bifrost_primitives::{CurrencyId, TokenSymbol::*}; use bifrost_runtime_common::{cent, dollar, micro, microcent, milli, millicent}; -use node_primitives::{CurrencyId, TokenSymbol::*}; const DECIMAL_18: u128 = 1_000_000_000_000_000_000; const DECIMAL_12: u128 = 1_000_000_000_000; diff --git a/integration-tests/bifrost-kusama/src/general_key.rs b/integration-tests/bifrost-kusama/src/general_key.rs index a4a610249..2c0939969 100644 --- a/integration-tests/bifrost-kusama/src/general_key.rs +++ b/integration-tests/bifrost-kusama/src/general_key.rs @@ -1,5 +1,5 @@ +use bifrost_primitives::{CurrencyId, TokenSymbol}; use codec::Encode; -use node_primitives::{CurrencyId, TokenSymbol}; use sp_runtime::BoundedVec; use xcm::prelude::*; diff --git a/integration-tests/bifrost-kusama/src/kusama_cross_chain_transact.rs b/integration-tests/bifrost-kusama/src/kusama_cross_chain_transact.rs index 064828546..b11077267 100644 --- a/integration-tests/bifrost-kusama/src/kusama_cross_chain_transact.rs +++ b/integration-tests/bifrost-kusama/src/kusama_cross_chain_transact.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/integration-tests/bifrost-kusama/src/kusama_cross_chain_transfer.rs b/integration-tests/bifrost-kusama/src/kusama_cross_chain_transfer.rs deleted file mode 100644 index f5f81bd8a..000000000 --- a/integration-tests/bifrost-kusama/src/kusama_cross_chain_transfer.rs +++ /dev/null @@ -1,95 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program 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. - -// This program 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 this program. If not, see . - -//! Cross-chain transfer tests within Kusama network. -use bifrost_kusama_runtime::Runtime; -use frame_support::assert_ok; -use orml_traits::MultiCurrency; -use xcm::{v3::prelude::*, VersionedMultiAssets, VersionedMultiLocation}; -use xcm_emulator::{ParaId, TestExt}; - -use crate::{kusama_integration_tests::*, kusama_test_net::*}; - -#[test] -fn transfer_ksm_between_bifrost_and_relay_chain() { - sp_io::TestExternalities::default().execute_with(|| { - KusamaNet::execute_with(|| { - // Kusama alice(100 KSM) -> Bifrost bob 10 KSM - assert_ok!(kusama_runtime::XcmPallet::reserve_transfer_assets( - kusama_runtime::RuntimeOrigin::signed(ALICE.into()), - Box::new(VersionedMultiLocation::V3(X1(Parachain(2001)).into())), - Box::new(VersionedMultiLocation::V3( - X1(Junction::AccountId32 { id: CATHI, network: None }).into() - )), - Box::new(VersionedMultiAssets::V3( - (Here, 10 * dollar::(RelayCurrencyId::get())).into() - )), - 0, - )); - - // Bifrost alice 90 KSM - assert_eq!( - Balances::free_balance(&AccountId::from(ALICE)), - 90 * dollar::(RelayCurrencyId::get()) - ); - // Parachain account 10 KSM - let parachain_account: AccountId = ParaId::from(2001).into_account_truncating(); - assert_eq!( - Balances::free_balance(parachain_account), - 12 * dollar::(RelayCurrencyId::get()) - ); - }); - - Bifrost::execute_with(|| { - // Bifrost bob 9.9 KSM - assert_eq!( - Tokens::free_balance(RelayCurrencyId::get(), &AccountId::from(CATHI)), - 9999919872000 - ); - - // Bifrost bob 9.9 KSM -> Kusama bob 2 KSM - assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(CATHI.into()), - RelayCurrencyId::get(), - 2 * dollar::(RelayCurrencyId::get()), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::new( - 1, - X1(Junction::AccountId32 { id: CATHI, network: None }) - ))), - xcm_emulator::Unlimited - )); - // Bifrost bob 7.9 KSM - assert_eq!( - Tokens::free_balance(RelayCurrencyId::get(), &AccountId::from(CATHI)), - 7999919872000 - ); - }); - - KusamaNet::execute_with(|| { - // Parachain account 8 KSM - let parachain_account: AccountId = ParaId::from(2001).into_account_truncating(); - assert_eq!( - Balances::free_balance(parachain_account), - 10 * dollar::(RelayCurrencyId::get()) - ); - - // Bifrost bob 1.9 KSM - assert_eq!(Balances::free_balance(&AccountId::from(CATHI)), 1999909712564); - }); - }) -} diff --git a/integration-tests/bifrost-kusama/src/kusama_integration_tests.rs b/integration-tests/bifrost-kusama/src/kusama_integration_tests.rs index 3e8b78e9d..2edecad90 100644 --- a/integration-tests/bifrost-kusama/src/kusama_integration_tests.rs +++ b/integration-tests/bifrost-kusama/src/kusama_integration_tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -16,9 +16,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +pub use bifrost_primitives::*; pub use codec::Encode; -use frame_support::{traits::GenesisBuild, weights::constants::*}; -pub use node_primitives::*; +use frame_support::weights::constants::*; pub use orml_traits::{Change, GetByKey, MultiCurrency}; pub use sp_runtime::{ traits::{AccountIdConversion, BadOrigin, Convert, Zero}, diff --git a/integration-tests/bifrost-kusama/src/kusama_test_net.rs b/integration-tests/bifrost-kusama/src/kusama_test_net.rs index 07de36981..3ed860fc1 100644 --- a/integration-tests/bifrost-kusama/src/kusama_test_net.rs +++ b/integration-tests/bifrost-kusama/src/kusama_test_net.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/integration-tests/bifrost-kusama/src/lib.rs b/integration-tests/bifrost-kusama/src/lib.rs index 1deeccadc..555fd8ed4 100644 --- a/integration-tests/bifrost-kusama/src/lib.rs +++ b/integration-tests/bifrost-kusama/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,16 +17,89 @@ // along with this program. If not, see . #![cfg(test)] -mod account_id; -mod asset_registry; -mod dollor_tests; -mod kusama_cross_chain_transact; -mod kusama_integration_tests; -mod kusama_test_net; +// mod account_id; +// mod dollor_tests; +// mod general_key; +// mod kusama_cross_chain_transact; +// mod kusama_integration_tests; +// mod kusama_test_net; // mod salp; -mod slp; -mod statemine; -mod total_issuance; -mod treasury; -mod vtoken_minting; -mod vtoken_voting; +// mod slp; +// mod total_issuance; +// mod treasury; +// mod vtoken_minting; +// mod vtoken_voting; +mod reserve_transfer; + +pub use codec::Encode; +pub use frame_support::{ + assert_err, assert_ok, + pallet_prelude::Weight, + sp_runtime::{AccountId32, DispatchError, DispatchResult}, + traits::fungibles::Inspect, +}; +pub use integration_tests_common::{ + constants::{ + asset_hub_kusama::ED as ASSET_HUB_KUSAMA_ED, kusama::ED as KUSAMA_ED, PROOF_SIZE_THRESHOLD, + REF_TIME_THRESHOLD, XCM_V3, + }, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + AssetHubKusama, AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender, + BifrostKusama, BifrostKusamaReceiver, Kusama, KusamaPallet, KusamaReceiver, KusamaSender, + PenpalKusamaA, PenpalKusamaAPallet, PenpalKusamaAReceiver, PenpalKusamaASender, PenpalKusamaB, + PenpalKusamaBPallet, +}; +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 SystemParaToRelayTest = Test; +pub type SystemParaToParaTest = Test; + +/// Returns a `TestArgs` instance to de used for the Relay Chain accross integraton tests +pub fn relay_test_args(amount: Balance) -> TestArgs { + TestArgs { + dest: Kusama::child_location_of(AssetHubKusama::para_id()), + beneficiary: AccountId32Junction { + network: None, + id: AssetHubKusamaReceiver::get().into(), + } + .into(), + amount, + assets: (Here, amount).into(), + asset_id: None, + fee_asset_item: 0, + weight_limit: WeightLimit::Unlimited, + } +} + +/// Returns a `TestArgs` instance to de used for the System Parachain accross integraton tests +pub fn system_para_test_args( + dest: MultiLocation, + beneficiary_id: AccountId32, + amount: Balance, + assets: MultiAssets, + asset_id: Option, +) -> TestArgs { + TestArgs { + dest, + beneficiary: AccountId32Junction { network: None, id: beneficiary_id.into() }.into(), + amount, + assets, + asset_id, + fee_asset_item: 0, + weight_limit: WeightLimit::Unlimited, + } +} diff --git a/integration-tests/bifrost-kusama/src/reserve_transfer.rs b/integration-tests/bifrost-kusama/src/reserve_transfer.rs new file mode 100644 index 000000000..c4d78431b --- /dev/null +++ b/integration-tests/bifrost-kusama/src/reserve_transfer.rs @@ -0,0 +1,215 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +use crate::*; + +fn system_para_to_para_assertions(t: SystemParaToParaTest) { + type RuntimeEvent = ::RuntimeEvent; + + AssetHubKusama::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( + 630_092_000, + 6_196, + ))); + + assert_expected_events!( + AssetHubKusama, + vec![ + // Amount to reserve transfer is transferred to Parachain's Sovereing account + RuntimeEvent::Balances( + pallet_balances::Event::Transfer { from, to, amount } + ) => { + from: *from == t.sender.account_id, + to: *to == AssetHubKusama::sovereign_account_id_of( + t.args.dest + ), + amount: *amount == t.args.amount, + }, + ] + ); +} + +fn system_para_to_para_assets_assertions(t: SystemParaToParaTest) { + type RuntimeEvent = ::RuntimeEvent; + + AssetHubKusama::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( + 676_119_000, + 6196, + ))); + + assert_expected_events!( + AssetHubKusama, + vec![ + // Amount to reserve transfer is transferred to Parachain's Sovereing account + RuntimeEvent::Assets( + pallet_assets::Event::Transferred { asset_id, from, to, amount } + ) => { + asset_id: *asset_id == ASSET_ID, + from: *from == t.sender.account_id, + to: *to == AssetHubKusama::sovereign_account_id_of( + t.args.dest + ), + amount: *amount == t.args.amount, + }, + ] + ); +} + +fn system_para_to_para_limited_reserve_transfer_assets(t: SystemParaToParaTest) -> DispatchResult { + ::PolkadotXcm::limited_reserve_transfer_assets( + t.signed_origin, + bx!(t.args.dest.into()), + bx!(t.args.beneficiary.into()), + bx!(t.args.assets.into()), + t.args.fee_asset_item, + t.args.weight_limit, + ) +} + +fn system_para_to_para_reserve_transfer_assets(t: SystemParaToParaTest) -> DispatchResult { + ::PolkadotXcm::reserve_transfer_assets( + t.signed_origin, + bx!(t.args.dest.into()), + bx!(t.args.beneficiary.into()), + bx!(t.args.assets.into()), + t.args.fee_asset_item, + ) +} + +/// Limited Reserve Transfers of native asset from AssetHub to BifrostKusama should work +#[test] +fn limited_reserve_transfer_native_asset_from_asset_hub_to_bifrost_kusama() { + // Init values for System Parachain + let destination = AssetHubKusama::sibling_location_of(BifrostKusama::para_id()); + let beneficiary_id = BifrostKusamaReceiver::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: BifrostKusamaReceiver::get(), + args: system_para_test_args(destination, beneficiary_id, amount_to_send, assets, None), + }; + + let mut test = SystemParaToParaTest::new(test_args); + + let sender_balance_before = test.sender.balance; + + test.set_assertion::(system_para_to_para_assertions); + test.set_dispatchable::(system_para_to_para_limited_reserve_transfer_assets); + test.assert(); + + let sender_balance_after = test.sender.balance; + + assert_eq!(sender_balance_before - amount_to_send, sender_balance_after); +} + +/// Reserve Transfers of native asset from AssetHub to BifrostKusama should work +#[test] +fn reserve_transfer_native_asset_from_asset_hub_to_bifrost_kusama() { + // Init values for System Parachain + let destination = AssetHubKusama::sibling_location_of(BifrostKusama::para_id()); + let beneficiary_id = BifrostKusamaReceiver::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: BifrostKusamaReceiver::get(), + args: system_para_test_args(destination, beneficiary_id, amount_to_send, assets, None), + }; + + let mut test = SystemParaToParaTest::new(test_args); + + let sender_balance_before = test.sender.balance; + + test.set_assertion::(system_para_to_para_assertions); + test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); + test.assert(); + + let sender_balance_after = test.sender.balance; + + assert_eq!(sender_balance_before - amount_to_send, sender_balance_after); +} + +/// Limited Reserve Transfers of a local asset from AssetHub to BifrostKusama should work +#[test] +fn limited_reserve_transfer_asset_from_asset_hub_to_bifrost_kusama() { + // Force create asset from Relay Chain and mint assets for System Parachain's sender account + AssetHubKusama::force_create_and_mint_asset( + ASSET_ID, + ASSET_MIN_BALANCE, + true, + AssetHubKusamaSender::get(), + ASSET_MIN_BALANCE * 1000000, + ); + + // Init values for System Parachain + let destination = AssetHubKusama::sibling_location_of(BifrostKusama::para_id()); + let beneficiary_id = BifrostKusamaReceiver::get(); + let amount_to_send = ASSET_MIN_BALANCE * 1000; + let assets = + (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), amount_to_send) + .into(); + + let system_para_test_args = TestContext { + sender: AssetHubKusamaSender::get(), + receiver: BifrostKusamaReceiver::get(), + args: system_para_test_args(destination, beneficiary_id, amount_to_send, assets, None), + }; + + let mut system_para_test = SystemParaToParaTest::new(system_para_test_args); + + system_para_test.set_assertion::(system_para_to_para_assets_assertions); + system_para_test + .set_dispatchable::(system_para_to_para_limited_reserve_transfer_assets); + system_para_test.assert(); +} + +/// Reserve Transfers of a local asset from AssetHub to BifrostKusama should work +#[test] +fn reserve_transfer_asset_from_asset_hub_to_bifrost_kusama() { + // Force create asset from Relay Chain and mint assets for System Parachain's sender account + AssetHubKusama::force_create_and_mint_asset( + ASSET_ID, + ASSET_MIN_BALANCE, + true, + AssetHubKusamaSender::get(), + ASSET_MIN_BALANCE * 1000000, + ); + + // Init values for System Parachain + let destination = AssetHubKusama::sibling_location_of(BifrostKusama::para_id()); + let beneficiary_id = BifrostKusamaReceiver::get(); + let amount_to_send = ASSET_MIN_BALANCE * 1000; + let assets = + (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), amount_to_send) + .into(); + + let system_para_test_args = TestContext { + sender: AssetHubKusamaSender::get(), + receiver: BifrostKusamaReceiver::get(), + args: system_para_test_args(destination, beneficiary_id, amount_to_send, assets, None), + }; + + let mut system_para_test = SystemParaToParaTest::new(system_para_test_args); + + system_para_test.set_assertion::(system_para_to_para_assets_assertions); + system_para_test + .set_dispatchable::(system_para_to_para_reserve_transfer_assets); + system_para_test.assert(); +} diff --git a/integration-tests/bifrost-kusama/src/salp.rs b/integration-tests/bifrost-kusama/src/salp.rs index 15164e4a6..6124e97b8 100644 --- a/integration-tests/bifrost-kusama/src/salp.rs +++ b/integration-tests/bifrost-kusama/src/salp.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/integration-tests/bifrost-kusama/src/slp.rs b/integration-tests/bifrost-kusama/src/slp.rs index 9de744ca8..b121cdeb9 100644 --- a/integration-tests/bifrost-kusama/src/slp.rs +++ b/integration-tests/bifrost-kusama/src/slp.rs @@ -1,1171 +1,1173 @@ -// // This file is part of Bifrost. +// This file is part of Bifrost. -// // Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. -// // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// // This program 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. - -// // This program 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 this program. If not, see . - -// //! Cross-chain transfer tests within Kusama network. - -// /* - -// fail_validators_by_delegator_query_response -// confirm_validators_by_delegator_query_response -// fail_delegator_ledger_query_response -// confirm_delegator_ledger_query_response - -// remove_supplement_fee_account_from_whitelist -// add_supplement_fee_account_to_whitelist -// supplement_fee_reserve - -// set_ongoing_time_unit_update_interval -// update_ongoing_time_unit - -// set_currency_tune_exchange_rate_limit -// set_hosting_fees -// set_currency_delays -// set_minimums_and_maximums - -// set_delegator_ledger -// set_validators_by_delegator -// set_fee_source -// set_operate_origin -// set_xcm_dest_weight_and_fee - -// remove_validator -// add_validator - -// initialize_delegator -// remove_delegator -// add_delegator - -// charge_host_fee_and_tune_vtoken_exchange_rate -// refund_currency_due_unbond - -// decrease_token_pool -// increase_token_pool - -// transfer_to -// transfer_back - -// chill -// liquidize -// payout - -// redelegate -// undelegate -// delegate - -// rebond -// unbond_all -// unbond -// bond_extra -// bond - -// bond/unbond/bond_extra/unbond_all/rebond/chill/liquidize confirm_delegator_ledger_query_response -// delegate/undelegate/redelegate confirm_validators_by_delegator_query_response - -// */ -// #![cfg(test)] -// use bifrost_kusama_runtime::{NativeCurrencyId, VtokenMinting}; -// use bifrost_slp::{primitives::UnlockChunk, Delays, Ledger, MinimumsMaximums, SubstrateLedger}; -// use frame_support::{assert_ok, BoundedVec}; -// use node_primitives::{TimeUnit, XcmOperationType as XcmOperation}; -// use orml_traits::MultiCurrency; -// use pallet_staking::{Nominations, StakingLedger}; -// use sp_runtime::Permill; -// use xcm::{prelude::*, v3::Weight, VersionedMultiAssets, VersionedMultiLocation}; -// use xcm_emulator::TestExt; - -// use crate::{kusama_integration_tests::*, kusama_test_net::*}; - -// const ENTRANCE_ACCOUNT: [u8; 32] = -// hex_literal::hex!["6d6f646c62662f76746b696e0000000000000000000000000000000000000000"]; -// const BIFROST_TREASURY_ACCOUNT: [u8; 32] = -// hex_literal::hex!["6d6f646c62662f74727372790000000000000000000000000000000000000000"]; -// const KSM_DELEGATOR_0_ACCOUNT: [u8; 32] = -// hex_literal::hex!["5a53736d8e96f1c007cf0d630acf5209b20611617af23ce924c8e25328eb5d28"]; - -// const EXIT_ACCOUNT: [u8; 32] = -// hex_literal::hex!["6d6f646c62662f76746f75740000000000000000000000000000000000000000"]; - -// const BIFROST_TREASURY_MULTILOCATION: MultiLocation = MultiLocation { -// parents: 0, -// interior: X1(AccountId32 { network: None, id: BIFROST_TREASURY_ACCOUNT }), -// }; -// const KSM_DELEGATOR_0_MULTILOCATION: MultiLocation = MultiLocation { -// parents: 1, -// interior: X1(AccountId32 { network: None, id: KSM_DELEGATOR_0_ACCOUNT }), -// }; - -// const ENTRANCE_ACCOUNT_MULTILOCATION: MultiLocation = -// MultiLocation { parents: 0, interior: X1(AccountId32 { network: None, id: ENTRANCE_ACCOUNT }) }; - -// const EXIT_ACCOUNT_MULTILOCATION: MultiLocation = -// MultiLocation { parents: 0, interior: X1(AccountId32 { network: None, id: EXIT_ACCOUNT }) }; - -// const KUSAMA_ALICE_MULTILOCATION: MultiLocation = -// MultiLocation { parents: 1, interior: X1(AccountId32 { network: None, id: ALICE }) }; -// const KUSAMA_ALICE_STASH_MULTILOCATION: MultiLocation = MultiLocation { -// parents: 1, -// interior: X1(AccountId32 { network: None, id: KUSAMA_ALICE_STASH_ACCOUNT }), -// }; -// const KUSAMA_BOB_STASH_MULTILOCATION: MultiLocation = MultiLocation { -// parents: 1, -// interior: X1(AccountId32 { network: None, id: KUSAMA_BOB_STASH_ACCOUNT }), -// }; - -// /// **************************************************** -// /// ********* Preparation section ******************** -// /// **************************************************** - -// // Preparation: register sub-account index 0. -// fn slp_setup() { -// cross_ksm_to_bifrost(BIFROST_TREASURY_ACCOUNT, 10000 * KSM_DECIMALS); -// // cross_ksm_to_bifrost(ENTRANCE_ACCOUNT, 10000 * KSM_DECIMALS); -// cross_ksm_to_bifrost(ALICE, 10000 * KSM_DECIMALS); -// cross_ksm_to_bifrost(BOB, 10000 * KSM_DECIMALS); - -// KusamaNet::execute_with(|| { -// assert_ok!(kusama_runtime::Balances::force_set_balance( -// kusama_runtime::RuntimeOrigin::root(), -// sp_runtime::MultiAddress::Id(AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// 10000 * KSM_DECIMALS -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Balances::force_set_balance( -// RuntimeOrigin::root(), -// sp_runtime::MultiAddress::Id(AccountId::from(BIFROST_TREASURY_ACCOUNT)), -// 10000 * BNC_DECIMALS -// )); -// }); - -// vksm_vtoken_minting_setup(); - -// Bifrost::execute_with(|| { -// // set operate origin to be ALICE for vksm -// assert_ok!(Slp::set_operate_origin( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Some(AccountId::from(ALICE)) -// )); -// // Set OngoingTimeUnitUpdateInterval as 1/3 Era(1800 blocks per Era, 12 seconds per -// // block) -// assert_ok!(Slp::set_ongoing_time_unit_update_interval( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Some(1) -// )); -// // Initialize ongoing timeunit as 0. -// assert_ok!(Slp::update_ongoing_time_unit( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// TimeUnit::Era(0) -// )); -// assert_ok!(Slp::set_ongoing_time_unit_update_interval( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Some(600) -// )); - -// // set fee_source for ksm to be treasury -// assert_ok!(Slp::set_fee_source( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Some((BIFROST_TREASURY_MULTILOCATION, 1 * KSM_DECIMALS)) -// )); -// // set fee_source for ksm to be treasury -// assert_ok!(Slp::set_fee_source( -// RuntimeOrigin::root(), -// NativeCurrencyId::get(), -// Some((BIFROST_TREASURY_MULTILOCATION, 1 * BNC_DECIMALS)) -// )); - -// let mins_and_maxs = MinimumsMaximums { -// delegator_bonded_minimum: KSM_DECIMALS / 10, -// bond_extra_minimum: KSM_DECIMALS / 1000, -// unbond_minimum: KSM_DECIMALS / 1000, -// rebond_minimum: KSM_DECIMALS / 1000, -// unbond_record_maximum: 32, -// validators_back_maximum: 24, -// delegator_active_staking_maximum: 80000 * KSM_DECIMALS, -// validators_reward_maximum: 256, -// delegation_amount_minimum: KSM_DECIMALS / 1000, -// delegators_maximum: 100, -// validators_maximum: 300, -// }; - -// // Set minimums and maximums -// assert_ok!(Slp::set_minimums_and_maximums( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Some(mins_and_maxs) -// )); - -// // Initialize currency delays. -// let delay = -// Delays { unlock_delay: TimeUnit::Era(0), leave_delegators_delay: TimeUnit::Era(0) }; -// assert_ok!(Slp::set_currency_delays( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Some(delay) -// )); - -// assert_ok!(Slp::set_hosting_fees( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Some((Permill::from_parts(1000), BIFROST_TREASURY_MULTILOCATION)) -// )); - -// assert_ok!(Slp::set_currency_tune_exchange_rate_limit( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Some((10, Permill::from_parts(1000))) -// )); - -// // add Alice and Bob to validators -// assert_ok!(Slp::add_validator( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Box::new(KUSAMA_ALICE_STASH_MULTILOCATION), -// )); -// assert_ok!(Slp::add_validator( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Box::new(KUSAMA_BOB_STASH_MULTILOCATION), -// )); - -// // Register Operation weight and fee -// assert_ok!( -// ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( -// RelayCurrencyId::get(), -// XcmOperation::TransferTo, -// Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), -// ) -// ); - -// assert_ok!( -// ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( -// RelayCurrencyId::get(), -// XcmOperation::Bond, -// Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), -// ) -// ); - -// assert_ok!( -// ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( -// RelayCurrencyId::get(), -// XcmOperation::BondExtra, -// Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), -// ) -// ); - -// assert_ok!( -// ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( -// RelayCurrencyId::get(), -// XcmOperation::Unbond, -// Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), -// ) -// ); - -// assert_ok!( -// ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( -// RelayCurrencyId::get(), -// XcmOperation::Rebond, -// Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), -// ) -// ); - -// assert_ok!( -// ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( -// RelayCurrencyId::get(), -// XcmOperation::Delegate, -// Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), -// ) -// ); - -// assert_ok!( -// ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( -// RelayCurrencyId::get(), -// XcmOperation::Payout, -// Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), -// ) -// ); - -// assert_ok!( -// ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( -// RelayCurrencyId::get(), -// XcmOperation::Liquidize, -// Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), -// ) -// ); - -// assert_ok!( -// ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( -// RelayCurrencyId::get(), -// XcmOperation::Chill, -// Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), -// ) -// ); - -// assert_ok!( -// ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( -// RelayCurrencyId::get(), -// XcmOperation::TransferBack, -// Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), -// ) -// ); - -// // initialize two delegators -// assert_ok!(Slp::initialize_delegator(RuntimeOrigin::root(), RelayCurrencyId::get(), None)); -// }); -// } - -// fn vksm_vtoken_minting_setup() { -// Bifrost::execute_with(|| { -// // Set the vtoken-minting mint and redeem fee rate to 0.1% with origin root. This is for all -// // tokens, not just vksm. -// assert_ok!(VtokenMinting::set_fees( -// RuntimeOrigin::root(), -// Permill::from_parts(1000), -// Permill::from_parts(1000), -// )); -// // set the number of fast-redeem user unlocking records to be 10 per block. This is for all -// // tokens, not just vksm. -// assert_ok!(VtokenMinting::set_hook_iteration_limit(RuntimeOrigin::root(), 10)); -// // set vksm unlock duration to be 28 eras -// assert_ok!(VtokenMinting::set_unlock_duration( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// TimeUnit::Era(28) -// )); -// // set vksm minimum mint amount to be 1 KSM -// assert_ok!(VtokenMinting::set_minimum_mint( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// 1 * KSM_DECIMALS -// )); -// // set vksm minimum redeem amount to be 0.1 KSM -// assert_ok!(VtokenMinting::set_minimum_redeem( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// KSM_DECIMALS / 10 -// )); -// // add vksm to be a supported rebond token -// assert_ok!(VtokenMinting::add_support_rebond_token( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// )); -// // set vksm starting fast-redeem timeunit to be era 0 -// assert_ok!(VtokenMinting::set_min_time_unit( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// TimeUnit::Era(0) -// )); -// }) -// } - -// fn cross_ksm_to_bifrost(to: [u8; 32], amount: u128) { -// KusamaNet::execute_with(|| { -// assert_ok!(kusama_runtime::Balances::force_set_balance( -// kusama_runtime::RuntimeOrigin::root(), -// sp_runtime::MultiAddress::Id(AccountId::from(to)), -// amount -// )); -// assert_ok!(kusama_runtime::XcmPallet::reserve_transfer_assets( -// kusama_runtime::RuntimeOrigin::signed(to.into()), -// Box::new(VersionedMultiLocation::V3(X1(Parachain(2001)).into())), -// Box::new(VersionedMultiLocation::V3( -// X1(Junction::AccountId32 { id: to, network: None }).into() -// )), -// Box::new(VersionedMultiAssets::V3((Here, amount).into())), -// 0, -// )); -// }); -// } - -// #[test] -// fn vtoken_minting() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); -// Bifrost::execute_with(|| { -// println!( -// "{:?}", -// Currencies::free_balance( -// CurrencyId::VToken(TokenSymbol::KSM), -// &AccountId::from(ALICE) -// ) -// ); -// println!( -// "{:?}", -// Currencies::free_balance( -// CurrencyId::Token(TokenSymbol::KSM), -// &AccountId::from(ALICE) -// ) -// ); -// assert_ok!(VtokenMinting::mint( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// CurrencyId::Token(TokenSymbol::KSM), -// 100 * KSM_DECIMALS, -// BoundedVec::default() -// )); -// // alice account should have 99.9 vKSM -// assert_eq!( -// Currencies::free_balance( -// CurrencyId::VToken(TokenSymbol::KSM), -// &AccountId::from(ALICE) -// ), -// 99900000000000 -// ); -// assert_eq!( -// Currencies::free_balance( -// CurrencyId::Token(TokenSymbol::KSM), -// &AccountId::from(ENTRANCE_ACCOUNT) -// ), -// 99900000000000 -// ) -// }) -// }); -// } - -// #[test] -// fn transfer_to() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// 10000 * KSM_DECIMALS -// ); -// }); - -// Bifrost::execute_with(|| { -// // Bond 50 ksm for sub-account index 0 -// assert_ok!(VtokenMinting::mint( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// CurrencyId::Token(TokenSymbol::KSM), -// 100 * KSM_DECIMALS, -// BoundedVec::default() -// )); - -// assert_ok!(Slp::transfer_to( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(ENTRANCE_ACCOUNT_MULTILOCATION), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// )); - -// assert_eq!( -// Currencies::free_balance( -// CurrencyId::Token(TokenSymbol::KSM), -// &AccountId::from(ENTRANCE_ACCOUNT) -// ), -// 49900000000000 -// ); -// }); - -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// 10049999909994200 -// ); -// }); -// }) -// } - -// #[test] -// fn transfer_back() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// KusamaNet::execute_with(|| { -// use kusama_runtime::System; -// System::reset_events(); -// assert_eq!( -// kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// 10000 * KSM_DECIMALS -// ); -// }); - -// Bifrost::execute_with(|| { -// // Bond 50 ksm for sub-account index 0 -// assert_eq!( -// Currencies::free_balance( -// CurrencyId::Token(TokenSymbol::KSM), -// &AccountId::from(EXIT_ACCOUNT) -// ), -// 0 -// ); - -// assert_ok!(Slp::transfer_back( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// Box::new(EXIT_ACCOUNT_MULTILOCATION), -// 50 * KSM_DECIMALS, -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_eq!( -// Currencies::free_balance( -// CurrencyId::Token(TokenSymbol::KSM), -// &AccountId::from(EXIT_ACCOUNT) -// ), -// 49999929608000 -// ); -// }); - -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// 9950 * KSM_DECIMALS -// ); -// }); -// }) -// } - -// #[test] -// fn bond_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// Bifrost::execute_with(|| { -// // Bond 50 ksm for sub-account index 0 -// assert_ok!(Slp::bond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// None -// )); -// }); - -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// Some(StakingLedger { -// stash: AccountId::from(KSM_DELEGATOR_0_ACCOUNT), -// total: 50 * KSM_DECIMALS, -// active: 50 * KSM_DECIMALS, -// unlocking: BoundedVec::try_from(vec![]).unwrap(), -// claimed_rewards: BoundedVec::try_from(vec![]).unwrap(), -// }) -// ); -// }); - -// Bifrost::execute_with(|| { -// // Bond 50 ksm and auto confirm -// assert_eq!( -// Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), -// Some(Ledger::Substrate(SubstrateLedger { -// account: KSM_DELEGATOR_0_MULTILOCATION, -// total: 50 * KSM_DECIMALS, -// active: 50 * KSM_DECIMALS, -// unlocking: vec![], -// })) -// ); -// }); -// }) -// } - -// #[test] -// fn bond_extra_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// KusamaNet::execute_with(|| { -// use kusama_runtime::System; -// System::reset_events(); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::bond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// None -// )); -// }); -// Bifrost::execute_with(|| { -// // Bond_extra 20 ksm for sub-account index 0 -// assert_ok!(Slp::bond_extra( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// None, -// 20 * KSM_DECIMALS, -// )); -// }); - -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// Some(StakingLedger { -// stash: AccountId::from(KSM_DELEGATOR_0_ACCOUNT), -// total: 70 * KSM_DECIMALS, -// active: 70 * KSM_DECIMALS, -// unlocking: BoundedVec::try_from(vec![]).unwrap(), -// claimed_rewards: BoundedVec::try_from(vec![]).unwrap(), -// }) -// ); -// }); - -// Bifrost::execute_with(|| { -// // Bond 70 ksm and auto confirm -// assert_eq!( -// Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), -// Some(Ledger::Substrate(SubstrateLedger { -// account: KSM_DELEGATOR_0_MULTILOCATION, -// total: 70 * KSM_DECIMALS, -// active: 70 * KSM_DECIMALS, -// unlocking: vec![], -// })) -// ); -// }); -// }) -// } - -// #[test] -// fn unbond_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::bond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// None -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::unbond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// None, -// 20 * KSM_DECIMALS, -// )); -// }); -// // KusamaNet::execute_with(|| { -// // use kusama_runtime::System; -// // assert_eq!( -// // kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// // Some(StakingLedger { -// // stash: AccountId::from(KSM_DELEGATOR_0_ACCOUNT), -// // total: 50 * KSM_DECIMALS, -// // active: 30 * KSM_DECIMALS, -// // unlocking: _, -// // claimed_rewards: BoundedVec::try_from(vec![]).unwrap(), -// // }) -// // ); -// // }); - -// Bifrost::execute_with(|| { -// // Bond 70 ksm and auto confirm -// assert_eq!( -// Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), -// Some(Ledger::Substrate(SubstrateLedger { -// account: KSM_DELEGATOR_0_MULTILOCATION, -// total: 50 * KSM_DECIMALS, -// active: 30 * KSM_DECIMALS, -// unlocking: vec![UnlockChunk { -// value: 20 * KSM_DECIMALS, -// unlock_time: TimeUnit::Era(0) -// }], -// })) -// ); -// }); -// }) -// } - -// #[test] -// fn unbond_all_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// Bifrost::execute_with(|| { -// // Unbond 0.5 ksm, 0.5 ksm left. -// assert_ok!(Slp::bond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// None -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::unbond_all( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// )); -// }); - -// // KusamaNet::execute_with(|| { -// // use kusama_runtime::System; -// // println!("{:?}", System::events()); -// // assert_eq!( -// // kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// // Some(StakingLedger { -// // stash: AccountId::from(KSM_DELEGATOR_0_ACCOUNT), -// // total: 50 * KSM_DECIMALS, -// // active: 0, -// // unlocking: BoundedVec::try_from(vec![]).unwrap(), -// // claimed_rewards: BoundedVec::try_from(vec![]).unwrap(), -// // }) -// // ); -// // }); - -// Bifrost::execute_with(|| { -// // Bond 70 ksm and auto confirm -// assert_eq!( -// Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), -// Some(Ledger::Substrate(SubstrateLedger { -// account: KSM_DELEGATOR_0_MULTILOCATION, -// total: 50 * KSM_DECIMALS, -// active: 0, -// unlocking: vec![UnlockChunk { -// value: 50 * KSM_DECIMALS, -// unlock_time: TimeUnit::Era(0) -// }], -// })) -// ); -// }); -// }) -// } - -// #[test] -// fn rebond_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::bond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// None -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::unbond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// None, -// 30 * KSM_DECIMALS -// )); -// }); - -// Bifrost::execute_with(|| { -// // rebond 0.5 ksm. -// assert_ok!(Slp::rebond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// None, -// Some(20 * KSM_DECIMALS), -// )); -// }); - -// // So the bonded amount should be 1 ksm -// // KusamaNet::execute_with(|| { -// // assert_eq!( -// // kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// // Some(StakingLedger { -// // stash: AccountId::from(KSM_DELEGATOR_0_ACCOUNT), -// // total: 50 * KSM_DECIMALS, -// // active: 40 * KSM_DECIMALS, -// // unlocking: BoundedVec::try_from(vec![]).unwrap(), -// // claimed_rewards: BoundedVec::try_from(vec![]).unwrap(), -// // }) -// // ); -// // }); -// Bifrost::execute_with(|| { -// // Bond 70 ksm and auto confirm -// assert_eq!( -// Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), -// Some(Ledger::Substrate(SubstrateLedger { -// account: KSM_DELEGATOR_0_MULTILOCATION, -// total: 50 * KSM_DECIMALS, -// active: 40 * KSM_DECIMALS, -// unlocking: vec![UnlockChunk { -// value: 10 * KSM_DECIMALS, -// unlock_time: TimeUnit::Era(0) -// }], -// })) -// ); -// }); -// }) -// } - -// #[test] -// fn delegate_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// // bond 1 ksm for sub-account index 0 -// slp_setup(); - -// KusamaNet::execute_with(|| { -// use kusama_runtime::System; -// System::reset_events(); -// }); - -// Bifrost::execute_with(|| { -// // Unbond 0.5 ksm, 0.5 ksm left. -// assert_ok!(VtokenMinting::mint( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// CurrencyId::Token(TokenSymbol::KSM), -// 100 * KSM_DECIMALS, -// BoundedVec::default() -// )); - -// assert_ok!(Slp::bond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// None -// )); -// }); - -// KusamaNet::execute_with(|| { -// use kusama_runtime::System; -// println!("{:?}", System::events()); -// System::reset_events(); -// }); - -// Bifrost::execute_with(|| { -// // delegate -// assert_ok!(Slp::delegate( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION], -// )); -// }); - -// KusamaNet::execute_with(|| { -// use kusama_runtime::System; -// println!("{:?}", System::events()); -// assert_eq!( -// kusama_runtime::Staking::nominators(AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// Some(Nominations { -// targets: BoundedVec::try_from(vec![ -// KUSAMA_ALICE_STASH_ACCOUNT.into(), -// KUSAMA_BOB_STASH_ACCOUNT.into(), -// ]) -// .unwrap(), -// submitted_in: 0, -// suppressed: false -// }) -// ); -// }); -// }) -// } - -// #[test] -// fn undelegate_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::bond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// None -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::delegate( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION], -// )); -// }); - -// Bifrost::execute_with(|| { -// // Undelegate validator 0. Only validator 1 left. -// assert_ok!(Slp::undelegate( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// vec![KUSAMA_ALICE_STASH_MULTILOCATION], -// )); -// }); - -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Staking::nominators(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// Some(Nominations { -// targets: BoundedVec::try_from(vec![KUSAMA_BOB_STASH_ACCOUNT.into()]).unwrap(), -// submitted_in: 0, -// suppressed: false -// },) -// ); -// }); -// }) -// } - -// #[test] -// fn redelegate_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::bond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// None -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::delegate( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION], -// )); -// }); - -// Bifrost::execute_with(|| { -// // Undelegate validator 0. Only validator 1 left. -// assert_ok!(Slp::undelegate( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// vec![KUSAMA_ALICE_STASH_MULTILOCATION], -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::redelegate( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// Some(vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION]) -// )); -// }); - -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Staking::nominators(AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// Some(Nominations { -// targets: BoundedVec::try_from(vec![ -// KUSAMA_ALICE_STASH_ACCOUNT.into(), -// KUSAMA_BOB_STASH_ACCOUNT.into(), -// ]) -// .unwrap(), -// submitted_in: 0, -// suppressed: false -// }) -// ); -// }); -// }) -// } - -// #[test] -// fn payout_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); -// Bifrost::execute_with(|| { -// // Bond 1 ksm for sub-account index 0 -// assert_ok!(Slp::payout( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// Box::new(KUSAMA_ALICE_STASH_MULTILOCATION), -// Some(TimeUnit::Era(27)) -// )); -// }); -// }) -// } - -// #[test] -// fn liquidize_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::bond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// None -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::delegate( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION], -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::unbond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// None, -// 20 * KSM_DECIMALS -// )); -// }); - -// Bifrost::execute_with(|| { -// // Bond 70 ksm and auto confirm -// assert_eq!( -// Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), -// Some(Ledger::Substrate(SubstrateLedger { -// account: KSM_DELEGATOR_0_MULTILOCATION, -// total: 50 * KSM_DECIMALS, -// active: 30 * KSM_DECIMALS, -// unlocking: vec![UnlockChunk { -// value: 20 * KSM_DECIMALS, -// unlock_time: TimeUnit::Era(0) -// }], -// })) -// ); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::liquidize( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// Some(TimeUnit::SlashingSpan(5)), -// None, -// None -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_eq!( -// Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), -// Some(Ledger::Substrate(SubstrateLedger { -// account: KSM_DELEGATOR_0_MULTILOCATION, -// total: 30 * KSM_DECIMALS, -// active: 30 * KSM_DECIMALS, -// unlocking: vec![], -// })) -// ); -// }); -// }) -// } - -// #[test] -// fn chill_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::bond( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// 50 * KSM_DECIMALS, -// None -// )); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::delegate( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION], -// )); -// }); - -// // check if sub-account index 0 belongs to the group of nominators -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Staking::nominators(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)) -// .is_some(), -// true -// ); -// assert_eq!( -// kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)) -// .is_some(), -// true -// ); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::chill( -// RuntimeOrigin::signed(AccountId::from(ALICE)), -// RelayCurrencyId::get(), -// Box::new(KSM_DELEGATOR_0_MULTILOCATION), -// )); -// }); - -// // check if sub-account index 0 belongs to the group of nominators -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Staking::nominators(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)) -// .is_some(), -// false -// ); -// }); -// }) -// } - -// #[test] -// fn supplement_fee_reserve_works() { -// sp_io::TestExternalities::default().execute_with(|| { -// slp_setup(); -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// 10000 * KSM_DECIMALS -// ); -// }); - -// Bifrost::execute_with(|| { -// assert_ok!(Slp::supplement_fee_reserve( -// RuntimeOrigin::root(), -// RelayCurrencyId::get(), -// Box::new(KUSAMA_ALICE_MULTILOCATION), -// )); -// }); - -// KusamaNet::execute_with(|| { -// assert_eq!( -// kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), -// 10000 * KSM_DECIMALS -// ); -// }); -// }) -// } +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Cross-chain transfer tests within Kusama network. + +/* + +fail_validators_by_delegator_query_response +confirm_validators_by_delegator_query_response +fail_delegator_ledger_query_response +confirm_delegator_ledger_query_response + +remove_supplement_fee_account_from_whitelist +add_supplement_fee_account_to_whitelist +supplement_fee_reserve + +set_ongoing_time_unit_update_interval +update_ongoing_time_unit + +set_currency_tune_exchange_rate_limit +set_hosting_fees +set_currency_delays +set_minimums_and_maximums + +set_delegator_ledger +set_validators_by_delegator +set_fee_source +set_operate_origin +set_xcm_dest_weight_and_fee + +remove_validator +add_validator + +initialize_delegator +remove_delegator +add_delegator + +charge_host_fee_and_tune_vtoken_exchange_rate +refund_currency_due_unbond + +decrease_token_pool +increase_token_pool + +transfer_to +transfer_back + +chill +liquidize +payout + +redelegate +undelegate +delegate + +rebond +unbond_all +unbond +bond_extra +bond + + +bond/unbond/bond_extra/unbond_all/rebond/chill/liquidize confirm_delegator_ledger_query_response +delegate/undelegate/redelegate confirm_validators_by_delegator_query_response + +*/ + +#![cfg(test)] +use bifrost_kusama_runtime::{NativeCurrencyId, VtokenMinting}; +use bifrost_primitives::{TimeUnit, XcmOperationType as XcmOperation}; +use bifrost_slp::{primitives::UnlockChunk, Delays, Ledger, MinimumsMaximums, SubstrateLedger}; +use frame_support::{assert_ok, BoundedVec}; +use orml_traits::MultiCurrency; +use pallet_staking::{Nominations, StakingLedger}; +use sp_runtime::Permill; +use xcm::{prelude::*, v3::Weight, VersionedMultiAssets, VersionedMultiLocation}; +use xcm_emulator::TestExt; + +use crate::{kusama_integration_tests::*, kusama_test_net::*}; + +const ENTRANCE_ACCOUNT: [u8; 32] = + hex_literal::hex!["6d6f646c62662f76746b696e0000000000000000000000000000000000000000"]; +const BIFROST_TREASURY_ACCOUNT: [u8; 32] = + hex_literal::hex!["6d6f646c62662f74727372790000000000000000000000000000000000000000"]; +const KSM_DELEGATOR_0_ACCOUNT: [u8; 32] = + hex_literal::hex!["5a53736d8e96f1c007cf0d630acf5209b20611617af23ce924c8e25328eb5d28"]; + +const EXIT_ACCOUNT: [u8; 32] = + hex_literal::hex!["6d6f646c62662f76746f75740000000000000000000000000000000000000000"]; + +const BIFROST_TREASURY_MULTILOCATION: MultiLocation = MultiLocation { + parents: 0, + interior: X1(AccountId32 { network: None, id: BIFROST_TREASURY_ACCOUNT }), +}; +const KSM_DELEGATOR_0_MULTILOCATION: MultiLocation = MultiLocation { + parents: 1, + interior: X1(AccountId32 { network: None, id: KSM_DELEGATOR_0_ACCOUNT }), +}; + +const ENTRANCE_ACCOUNT_MULTILOCATION: MultiLocation = + MultiLocation { parents: 0, interior: X1(AccountId32 { network: None, id: ENTRANCE_ACCOUNT }) }; + +const EXIT_ACCOUNT_MULTILOCATION: MultiLocation = + MultiLocation { parents: 0, interior: X1(AccountId32 { network: None, id: EXIT_ACCOUNT }) }; + +const KUSAMA_ALICE_MULTILOCATION: MultiLocation = + MultiLocation { parents: 1, interior: X1(AccountId32 { network: None, id: ALICE }) }; +const KUSAMA_ALICE_STASH_MULTILOCATION: MultiLocation = MultiLocation { + parents: 1, + interior: X1(AccountId32 { network: None, id: KUSAMA_ALICE_STASH_ACCOUNT }), +}; +const KUSAMA_BOB_STASH_MULTILOCATION: MultiLocation = MultiLocation { + parents: 1, + interior: X1(AccountId32 { network: None, id: KUSAMA_BOB_STASH_ACCOUNT }), +}; + +/// **************************************************** +/// ********* Preparation section ******************** +/// **************************************************** + +// Preparation: register sub-account index 0. +fn slp_setup() { + cross_ksm_to_bifrost(BIFROST_TREASURY_ACCOUNT, 10000 * KSM_DECIMALS); + // cross_ksm_to_bifrost(ENTRANCE_ACCOUNT, 10000 * KSM_DECIMALS); + cross_ksm_to_bifrost(ALICE, 10000 * KSM_DECIMALS); + cross_ksm_to_bifrost(BOB, 10000 * KSM_DECIMALS); + + KusamaNet::execute_with(|| { + assert_ok!(kusama_runtime::Balances::force_set_balance( + kusama_runtime::RuntimeOrigin::root(), + sp_runtime::MultiAddress::Id(AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + 10000 * KSM_DECIMALS + )); + }); + + Bifrost::execute_with(|| { + assert_ok!(Balances::force_set_balance( + RuntimeOrigin::root(), + sp_runtime::MultiAddress::Id(AccountId::from(BIFROST_TREASURY_ACCOUNT)), + 10000 * BNC_DECIMALS + )); + }); + + vksm_vtoken_minting_setup(); + + Bifrost::execute_with(|| { + // set operate origin to be ALICE for vksm + assert_ok!(Slp::set_operate_origin( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Some(AccountId::from(ALICE)) + )); + // Set OngoingTimeUnitUpdateInterval as 1/3 Era(1800 blocks per Era, 12 seconds per + // block) + assert_ok!(Slp::set_ongoing_time_unit_update_interval( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Some(1) + )); + // Initialize ongoing timeunit as 0. + assert_ok!(Slp::update_ongoing_time_unit( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + TimeUnit::Era(0) + )); + assert_ok!(Slp::set_ongoing_time_unit_update_interval( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Some(600) + )); + + // set fee_source for ksm to be treasury + assert_ok!(Slp::set_fee_source( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Some((BIFROST_TREASURY_MULTILOCATION, 1 * KSM_DECIMALS)) + )); + // set fee_source for ksm to be treasury + assert_ok!(Slp::set_fee_source( + RuntimeOrigin::root(), + NativeCurrencyId::get(), + Some((BIFROST_TREASURY_MULTILOCATION, 1 * BNC_DECIMALS)) + )); + + let mins_and_maxs = MinimumsMaximums { + delegator_bonded_minimum: KSM_DECIMALS / 10, + bond_extra_minimum: KSM_DECIMALS / 1000, + unbond_minimum: KSM_DECIMALS / 1000, + rebond_minimum: KSM_DECIMALS / 1000, + unbond_record_maximum: 32, + validators_back_maximum: 24, + delegator_active_staking_maximum: 80000 * KSM_DECIMALS, + validators_reward_maximum: 256, + delegation_amount_minimum: KSM_DECIMALS / 1000, + delegators_maximum: 100, + validators_maximum: 300, + }; + + // Set minimums and maximums + assert_ok!(Slp::set_minimums_and_maximums( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Some(mins_and_maxs) + )); + + // Initialize currency delays. + let delay = + Delays { unlock_delay: TimeUnit::Era(0), leave_delegators_delay: TimeUnit::Era(0) }; + assert_ok!(Slp::set_currency_delays( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Some(delay) + )); + + assert_ok!(Slp::set_hosting_fees( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Some((Permill::from_parts(1000), BIFROST_TREASURY_MULTILOCATION)) + )); + + assert_ok!(Slp::set_currency_tune_exchange_rate_limit( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Some((10, Permill::from_parts(1000))) + )); + + // add Alice and Bob to validators + assert_ok!(Slp::add_validator( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Box::new(KUSAMA_ALICE_STASH_MULTILOCATION), + )); + assert_ok!(Slp::add_validator( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Box::new(KUSAMA_BOB_STASH_MULTILOCATION), + )); + + // Register Operation weight and fee + assert_ok!( + ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + RelayCurrencyId::get(), + XcmOperation::TransferTo, + Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), + ) + ); + + assert_ok!( + ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + RelayCurrencyId::get(), + XcmOperation::Bond, + Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), + ) + ); + + assert_ok!( + ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + RelayCurrencyId::get(), + XcmOperation::BondExtra, + Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), + ) + ); + + assert_ok!( + ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + RelayCurrencyId::get(), + XcmOperation::Unbond, + Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), + ) + ); + + assert_ok!( + ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + RelayCurrencyId::get(), + XcmOperation::Rebond, + Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), + ) + ); + + assert_ok!( + ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + RelayCurrencyId::get(), + XcmOperation::Delegate, + Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), + ) + ); + + assert_ok!( + ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + RelayCurrencyId::get(), + XcmOperation::Payout, + Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), + ) + ); + + assert_ok!( + ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + RelayCurrencyId::get(), + XcmOperation::Liquidize, + Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), + ) + ); + + assert_ok!( + ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + RelayCurrencyId::get(), + XcmOperation::Chill, + Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), + ) + ); + + assert_ok!( + ::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( + RelayCurrencyId::get(), + XcmOperation::TransferBack, + Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)), + ) + ); + + // initialize two delegators + assert_ok!(Slp::initialize_delegator(RuntimeOrigin::root(), RelayCurrencyId::get(), None)); + }); +} + +fn vksm_vtoken_minting_setup() { + Bifrost::execute_with(|| { + // Set the vtoken-minting mint and redeem fee rate to 0.1% with origin root. This is for all + // tokens, not just vksm. + assert_ok!(VtokenMinting::set_fees( + RuntimeOrigin::root(), + Permill::from_parts(1000), + Permill::from_parts(1000), + )); + // set the number of fast-redeem user unlocking records to be 10 per block. This is for all + // tokens, not just vksm. + assert_ok!(VtokenMinting::set_hook_iteration_limit(RuntimeOrigin::root(), 10)); + // set vksm unlock duration to be 28 eras + assert_ok!(VtokenMinting::set_unlock_duration( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + TimeUnit::Era(28) + )); + // set vksm minimum mint amount to be 1 KSM + assert_ok!(VtokenMinting::set_minimum_mint( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + 1 * KSM_DECIMALS + )); + // set vksm minimum redeem amount to be 0.1 KSM + assert_ok!(VtokenMinting::set_minimum_redeem( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + KSM_DECIMALS / 10 + )); + // add vksm to be a supported rebond token + assert_ok!(VtokenMinting::add_support_rebond_token( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + )); + // set vksm starting fast-redeem timeunit to be era 0 + assert_ok!(VtokenMinting::set_min_time_unit( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + TimeUnit::Era(0) + )); + }) +} + +fn cross_ksm_to_bifrost(to: [u8; 32], amount: u128) { + KusamaNet::execute_with(|| { + assert_ok!(kusama_runtime::Balances::force_set_balance( + kusama_runtime::RuntimeOrigin::root(), + sp_runtime::MultiAddress::Id(AccountId::from(to)), + amount + )); + assert_ok!(kusama_runtime::XcmPallet::reserve_transfer_assets( + kusama_runtime::RuntimeOrigin::signed(to.into()), + Box::new(VersionedMultiLocation::V3(X1(Parachain(2001)).into())), + Box::new(VersionedMultiLocation::V3( + X1(Junction::AccountId32 { id: to, network: None }).into() + )), + Box::new(VersionedMultiAssets::V3((Here, amount).into())), + 0, + )); + }); +} + +#[test] +fn vtoken_minting() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + Bifrost::execute_with(|| { + println!( + "{:?}", + Currencies::free_balance( + CurrencyId::VToken(TokenSymbol::KSM), + &AccountId::from(ALICE) + ) + ); + println!( + "{:?}", + Currencies::free_balance( + CurrencyId::Token(TokenSymbol::KSM), + &AccountId::from(ALICE) + ) + ); + assert_ok!(VtokenMinting::mint( + RuntimeOrigin::signed(AccountId::from(ALICE)), + CurrencyId::Token(TokenSymbol::KSM), + 100 * KSM_DECIMALS, + BoundedVec::default() + )); + // alice account should have 99.9 vKSM + assert_eq!( + Currencies::free_balance( + CurrencyId::VToken(TokenSymbol::KSM), + &AccountId::from(ALICE) + ), + 99900000000000 + ); + assert_eq!( + Currencies::free_balance( + CurrencyId::Token(TokenSymbol::KSM), + &AccountId::from(ENTRANCE_ACCOUNT) + ), + 99900000000000 + ) + }) + }); +} + +#[test] +fn transfer_to() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + 10000 * KSM_DECIMALS + ); + }); + + Bifrost::execute_with(|| { + // Bond 50 ksm for sub-account index 0 + assert_ok!(VtokenMinting::mint( + RuntimeOrigin::signed(AccountId::from(ALICE)), + CurrencyId::Token(TokenSymbol::KSM), + 100 * KSM_DECIMALS, + BoundedVec::default() + )); + + assert_ok!(Slp::transfer_to( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(ENTRANCE_ACCOUNT_MULTILOCATION), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + )); + + assert_eq!( + Currencies::free_balance( + CurrencyId::Token(TokenSymbol::KSM), + &AccountId::from(ENTRANCE_ACCOUNT) + ), + 49900000000000 + ); + }); + + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + 10049999909994200 + ); + }); + }) +} + +#[test] +fn transfer_back() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + KusamaNet::execute_with(|| { + use kusama_runtime::System; + System::reset_events(); + assert_eq!( + kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + 10000 * KSM_DECIMALS + ); + }); + + Bifrost::execute_with(|| { + // Bond 50 ksm for sub-account index 0 + assert_eq!( + Currencies::free_balance( + CurrencyId::Token(TokenSymbol::KSM), + &AccountId::from(EXIT_ACCOUNT) + ), + 0 + ); + + assert_ok!(Slp::transfer_back( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + Box::new(EXIT_ACCOUNT_MULTILOCATION), + 50 * KSM_DECIMALS, + )); + }); + + Bifrost::execute_with(|| { + assert_eq!( + Currencies::free_balance( + CurrencyId::Token(TokenSymbol::KSM), + &AccountId::from(EXIT_ACCOUNT) + ), + 49999929608000 + ); + }); + + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + 9950 * KSM_DECIMALS + ); + }); + }) +} + +#[test] +fn bond_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + Bifrost::execute_with(|| { + // Bond 50 ksm for sub-account index 0 + assert_ok!(Slp::bond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + None + )); + }); + + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + Some(StakingLedger { + stash: AccountId::from(KSM_DELEGATOR_0_ACCOUNT), + total: 50 * KSM_DECIMALS, + active: 50 * KSM_DECIMALS, + unlocking: BoundedVec::try_from(vec![]).unwrap(), + claimed_rewards: BoundedVec::try_from(vec![]).unwrap(), + }) + ); + }); + + Bifrost::execute_with(|| { + // Bond 50 ksm and auto confirm + assert_eq!( + Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), + Some(Ledger::Substrate(SubstrateLedger { + account: KSM_DELEGATOR_0_MULTILOCATION, + total: 50 * KSM_DECIMALS, + active: 50 * KSM_DECIMALS, + unlocking: vec![], + })) + ); + }); + }) +} + +#[test] +fn bond_extra_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + KusamaNet::execute_with(|| { + use kusama_runtime::System; + System::reset_events(); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::bond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + None + )); + }); + Bifrost::execute_with(|| { + // Bond_extra 20 ksm for sub-account index 0 + assert_ok!(Slp::bond_extra( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + None, + 20 * KSM_DECIMALS, + )); + }); + + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + Some(StakingLedger { + stash: AccountId::from(KSM_DELEGATOR_0_ACCOUNT), + total: 70 * KSM_DECIMALS, + active: 70 * KSM_DECIMALS, + unlocking: BoundedVec::try_from(vec![]).unwrap(), + claimed_rewards: BoundedVec::try_from(vec![]).unwrap(), + }) + ); + }); + + Bifrost::execute_with(|| { + // Bond 70 ksm and auto confirm + assert_eq!( + Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), + Some(Ledger::Substrate(SubstrateLedger { + account: KSM_DELEGATOR_0_MULTILOCATION, + total: 70 * KSM_DECIMALS, + active: 70 * KSM_DECIMALS, + unlocking: vec![], + })) + ); + }); + }) +} + +#[test] +fn unbond_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + Bifrost::execute_with(|| { + assert_ok!(Slp::bond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + None + )); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::unbond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + None, + 20 * KSM_DECIMALS, + )); + }); + // KusamaNet::execute_with(|| { + // use kusama_runtime::System; + // assert_eq!( + // kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + // Some(StakingLedger { + // stash: AccountId::from(KSM_DELEGATOR_0_ACCOUNT), + // total: 50 * KSM_DECIMALS, + // active: 30 * KSM_DECIMALS, + // unlocking: _, + // claimed_rewards: BoundedVec::try_from(vec![]).unwrap(), + // }) + // ); + // }); + + Bifrost::execute_with(|| { + // Bond 70 ksm and auto confirm + assert_eq!( + Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), + Some(Ledger::Substrate(SubstrateLedger { + account: KSM_DELEGATOR_0_MULTILOCATION, + total: 50 * KSM_DECIMALS, + active: 30 * KSM_DECIMALS, + unlocking: vec![UnlockChunk { + value: 20 * KSM_DECIMALS, + unlock_time: TimeUnit::Era(0) + }], + })) + ); + }); + }) +} + +#[test] +fn unbond_all_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + Bifrost::execute_with(|| { + // Unbond 0.5 ksm, 0.5 ksm left. + assert_ok!(Slp::bond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + None + )); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::unbond_all( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + )); + }); + + // KusamaNet::execute_with(|| { + // use kusama_runtime::System; + // println!("{:?}", System::events()); + // assert_eq!( + // kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + // Some(StakingLedger { + // stash: AccountId::from(KSM_DELEGATOR_0_ACCOUNT), + // total: 50 * KSM_DECIMALS, + // active: 0, + // unlocking: BoundedVec::try_from(vec![]).unwrap(), + // claimed_rewards: BoundedVec::try_from(vec![]).unwrap(), + // }) + // ); + // }); + + Bifrost::execute_with(|| { + // Bond 70 ksm and auto confirm + assert_eq!( + Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), + Some(Ledger::Substrate(SubstrateLedger { + account: KSM_DELEGATOR_0_MULTILOCATION, + total: 50 * KSM_DECIMALS, + active: 0, + unlocking: vec![UnlockChunk { + value: 50 * KSM_DECIMALS, + unlock_time: TimeUnit::Era(0) + }], + })) + ); + }); + }) +} + +#[test] +fn rebond_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + Bifrost::execute_with(|| { + assert_ok!(Slp::bond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + None + )); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::unbond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + None, + 30 * KSM_DECIMALS + )); + }); + + Bifrost::execute_with(|| { + // rebond 0.5 ksm. + assert_ok!(Slp::rebond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + None, + Some(20 * KSM_DECIMALS), + )); + }); + + // So the bonded amount should be 1 ksm + // KusamaNet::execute_with(|| { + // assert_eq!( + // kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + // Some(StakingLedger { + // stash: AccountId::from(KSM_DELEGATOR_0_ACCOUNT), + // total: 50 * KSM_DECIMALS, + // active: 40 * KSM_DECIMALS, + // unlocking: BoundedVec::try_from(vec![]).unwrap(), + // claimed_rewards: BoundedVec::try_from(vec![]).unwrap(), + // }) + // ); + // }); + Bifrost::execute_with(|| { + // Bond 70 ksm and auto confirm + assert_eq!( + Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), + Some(Ledger::Substrate(SubstrateLedger { + account: KSM_DELEGATOR_0_MULTILOCATION, + total: 50 * KSM_DECIMALS, + active: 40 * KSM_DECIMALS, + unlocking: vec![UnlockChunk { + value: 10 * KSM_DECIMALS, + unlock_time: TimeUnit::Era(0) + }], + })) + ); + }); + }) +} + +#[test] +fn delegate_works() { + sp_io::TestExternalities::default().execute_with(|| { + // bond 1 ksm for sub-account index 0 + slp_setup(); + + KusamaNet::execute_with(|| { + use kusama_runtime::System; + System::reset_events(); + }); + + Bifrost::execute_with(|| { + // Unbond 0.5 ksm, 0.5 ksm left. + assert_ok!(VtokenMinting::mint( + RuntimeOrigin::signed(AccountId::from(ALICE)), + CurrencyId::Token(TokenSymbol::KSM), + 100 * KSM_DECIMALS, + BoundedVec::default() + )); + + assert_ok!(Slp::bond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + None + )); + }); + + KusamaNet::execute_with(|| { + use kusama_runtime::System; + println!("{:?}", System::events()); + System::reset_events(); + }); + + Bifrost::execute_with(|| { + // delegate + assert_ok!(Slp::delegate( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION], + )); + }); + + KusamaNet::execute_with(|| { + use kusama_runtime::System; + println!("{:?}", System::events()); + assert_eq!( + kusama_runtime::Staking::nominators(AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + Some(Nominations { + targets: BoundedVec::try_from(vec![ + KUSAMA_ALICE_STASH_ACCOUNT.into(), + KUSAMA_BOB_STASH_ACCOUNT.into(), + ]) + .unwrap(), + submitted_in: 0, + suppressed: false + }) + ); + }); + }) +} + +#[test] +fn undelegate_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + Bifrost::execute_with(|| { + assert_ok!(Slp::bond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + None + )); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::delegate( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION], + )); + }); + + Bifrost::execute_with(|| { + // Undelegate validator 0. Only validator 1 left. + assert_ok!(Slp::undelegate( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + vec![KUSAMA_ALICE_STASH_MULTILOCATION], + )); + }); + + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Staking::nominators(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + Some(Nominations { + targets: BoundedVec::try_from(vec![KUSAMA_BOB_STASH_ACCOUNT.into()]).unwrap(), + submitted_in: 0, + suppressed: false + },) + ); + }); + }) +} + +#[test] +fn redelegate_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + Bifrost::execute_with(|| { + assert_ok!(Slp::bond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + None + )); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::delegate( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION], + )); + }); + + Bifrost::execute_with(|| { + // Undelegate validator 0. Only validator 1 left. + assert_ok!(Slp::undelegate( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + vec![KUSAMA_ALICE_STASH_MULTILOCATION], + )); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::redelegate( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + Some(vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION]) + )); + }); + + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Staking::nominators(AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + Some(Nominations { + targets: BoundedVec::try_from(vec![ + KUSAMA_ALICE_STASH_ACCOUNT.into(), + KUSAMA_BOB_STASH_ACCOUNT.into(), + ]) + .unwrap(), + submitted_in: 0, + suppressed: false + }) + ); + }); + }) +} + +#[test] +fn payout_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + Bifrost::execute_with(|| { + // Bond 1 ksm for sub-account index 0 + assert_ok!(Slp::payout( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + Box::new(KUSAMA_ALICE_STASH_MULTILOCATION), + Some(TimeUnit::Era(27)) + )); + }); + }) +} + +#[test] +fn liquidize_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + Bifrost::execute_with(|| { + assert_ok!(Slp::bond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + None + )); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::delegate( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION], + )); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::unbond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + None, + 20 * KSM_DECIMALS + )); + }); + + Bifrost::execute_with(|| { + // Bond 70 ksm and auto confirm + assert_eq!( + Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), + Some(Ledger::Substrate(SubstrateLedger { + account: KSM_DELEGATOR_0_MULTILOCATION, + total: 50 * KSM_DECIMALS, + active: 30 * KSM_DECIMALS, + unlocking: vec![UnlockChunk { + value: 20 * KSM_DECIMALS, + unlock_time: TimeUnit::Era(0) + }], + })) + ); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::liquidize( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + Some(TimeUnit::SlashingSpan(5)), + None, + None + )); + }); + + Bifrost::execute_with(|| { + assert_eq!( + Slp::get_delegator_ledger(RelayCurrencyId::get(), KSM_DELEGATOR_0_MULTILOCATION), + Some(Ledger::Substrate(SubstrateLedger { + account: KSM_DELEGATOR_0_MULTILOCATION, + total: 30 * KSM_DECIMALS, + active: 30 * KSM_DECIMALS, + unlocking: vec![], + })) + ); + }); + }) +} + +#[test] +fn chill_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + + Bifrost::execute_with(|| { + assert_ok!(Slp::bond( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + 50 * KSM_DECIMALS, + None + )); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::delegate( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION], + )); + }); + + // check if sub-account index 0 belongs to the group of nominators + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Staking::nominators(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)) + .is_some(), + true + ); + assert_eq!( + kusama_runtime::Staking::ledger(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)) + .is_some(), + true + ); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::chill( + RuntimeOrigin::signed(AccountId::from(ALICE)), + RelayCurrencyId::get(), + Box::new(KSM_DELEGATOR_0_MULTILOCATION), + )); + }); + + // check if sub-account index 0 belongs to the group of nominators + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Staking::nominators(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)) + .is_some(), + false + ); + }); + }) +} + +#[test] +fn supplement_fee_reserve_works() { + sp_io::TestExternalities::default().execute_with(|| { + slp_setup(); + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + 10000 * KSM_DECIMALS + ); + }); + + Bifrost::execute_with(|| { + assert_ok!(Slp::supplement_fee_reserve( + RuntimeOrigin::root(), + RelayCurrencyId::get(), + Box::new(KUSAMA_ALICE_MULTILOCATION), + )); + }); + + KusamaNet::execute_with(|| { + assert_eq!( + kusama_runtime::Balances::free_balance(&AccountId::from(KSM_DELEGATOR_0_ACCOUNT)), + 10000 * KSM_DECIMALS + ); + }); + }) +} diff --git a/integration-tests/bifrost-kusama/src/total_issuance.rs b/integration-tests/bifrost-kusama/src/total_issuance.rs index aa4a299cd..dca1249bf 100644 --- a/integration-tests/bifrost-kusama/src/total_issuance.rs +++ b/integration-tests/bifrost-kusama/src/total_issuance.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/integration-tests/bifrost-kusama/src/vtoken_voting.rs b/integration-tests/bifrost-kusama/src/vtoken_voting.rs index 28e64c639..bcd6ed323 100644 --- a/integration-tests/bifrost-kusama/src/vtoken_voting.rs +++ b/integration-tests/bifrost-kusama/src/vtoken_voting.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/integration-tests/bifrost-kusama/src/statemine.rs b/integration-tests/bifrost-kusama/src/xcm_interface.rs similarity index 98% rename from integration-tests/bifrost-kusama/src/statemine.rs rename to integration-tests/bifrost-kusama/src/xcm_interface.rs index a08ed9559..abbc02af3 100644 --- a/integration-tests/bifrost-kusama/src/statemine.rs +++ b/integration-tests/bifrost-kusama/src/xcm_interface.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ use crate::{kusama_integration_tests::*, kusama_test_net::*}; use bifrost_asset_registry::AssetMetadata; use frame_support::assert_ok; -use node_primitives::XcmOperationType as XcmOperation; +use bifrost_primitives::XcmOperationType as XcmOperation; use polkadot_parachain::primitives::Sibling; use sp_runtime::traits::AccountIdConversion; use xcm::{ diff --git a/integration-tests/bifrost-polkadot/Cargo.toml b/integration-tests/bifrost-polkadot/Cargo.toml index 67b20d510..d5d221059 100644 --- a/integration-tests/bifrost-polkadot/Cargo.toml +++ b/integration-tests/bifrost-polkadot/Cargo.toml @@ -5,83 +5,31 @@ authors = ["Ron Yang "] edition = "2021" [dependencies] -# third-party dependencies -codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"] } -log = { version = "0.4.17" } -serde = { version = "1.0.160", optional = true } -static_assertions = "1.1.0" -hex = { version = "0.4", optional = true } -hex-literal = { version = "0.3.4" } - -# primitives -node-primitives = { default-features = false, path = "../../node/primitives" } - -# frame dependencies -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } - -# Cumulus dependencies -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } - -# Polkadot dependencies -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } - -# bifrost pallets +codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } + +# Substrate +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-asset-conversion = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} + +# Polkadot +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +polkadot-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} + +# Cumulus +parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +asset-hub-kusama-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } + +# Local +xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +integration-tests-common = { path = "../common", default-features = false} +bifrost-primitives = { path = "../../primitives" } bifrost-asset-registry = { path = "../../pallets/asset-registry" } -bifrost-flexible-fee = { path = "../../pallets/flexible-fee" } -bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api" } -bifrost-salp = { path = "../../pallets/salp" } -bifrost-salp-rpc-runtime-api = { path = "../../pallets/salp/rpc/runtime-api" } -bifrost-slp = { path = "../../pallets/slp" } -bifrost-vsbond-auction = { path = "../../pallets/vsbond-auction" } -bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting" } -pallet-vesting = { package = "bifrost-vesting", path = "../../pallets/vesting" } -bifrost-runtime-common = { path = "../../runtime/common" } -bifrost-polkadot-runtime = { path = "../../runtime/bifrost-polkadot" } - -# orml -orml-tokens = { version = "0.4.1-dev" } -orml-traits = { version = "0.4.1-dev" } -orml-xtokens = { version = "0.4.1-dev" } -orml-unknown-tokens = { version = "0.4.1-dev" } -orml-xcm-support = { version = "0.4.1-dev" } - -zenlink-protocol = { version = "*" } -zenlink-protocol-runtime-api = { version = "*" } - -[dev-dependencies] -env_logger = "0.10.0" -hex = "0.4.0" - -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } - -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-test-relay-sproof-builder = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } - -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -#statemine-runtime = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -xcm-emulator = { version = "*" } +bifrost-polkadot-runtime = { path = "../../runtime/bifrost-polkadot" } \ No newline at end of file diff --git a/integration-tests/bifrost-polkadot/src/config.rs b/integration-tests/bifrost-polkadot/src/config.rs deleted file mode 100644 index 9fbe15dd6..000000000 --- a/integration-tests/bifrost-polkadot/src/config.rs +++ /dev/null @@ -1,212 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program 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. - -// This program 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 this program. If not, see . - -//! Relay chain and parachains emulation. - -use frame_support::{traits::GenesisBuild, weights::Weight}; -use polkadot_primitives::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}; -use polkadot_runtime_parachains::configuration::HostConfiguration; -use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; - -pub use codec::Encode; -pub use node_primitives::*; -pub use orml_traits::{Change, GetByKey, MultiCurrency}; -pub use sp_runtime::{ - traits::{BadOrigin, Convert, Zero}, - BuildStorage, DispatchError, DispatchResult, FixedPointNumber, MultiAddress, -}; - -pub const ALICE: [u8; 32] = [0u8; 32]; -pub const BOB: [u8; 32] = [1u8; 32]; - -pub use bifrost_imports::*; - -mod bifrost_imports { - pub use bifrost_polkadot_runtime::{ - create_x2_multilocation, AccountId, AssetRegistry, Balance, Balances, BifrostCrowdloanId, - BlockNumber, Currencies, CurrencyId, ExistentialDeposit, NativeCurrencyId, OriginCaller, - ParachainInfo, ParachainSystem, Proxy, RelayCurrencyId, Runtime, RuntimeCall, RuntimeEvent, - RuntimeOrigin, Salp, Scheduler, Session, SlotLength, Slp, System, Tokens, TreasuryPalletId, - Utility, Vesting, XTokens, - }; - pub use frame_support::parameter_types; - pub use sp_runtime::traits::AccountIdConversion; -} - -pub const GLMR_DECIMALS: u128 = 1_000_000_000_000_000_000; -pub const DOT_DECIMALS: u128 = 10_000_000_000; - -pub const DOT_TOKEN_ID: u8 = 0; -pub const GLMR_TOKEN_ID: u8 = 1; - -decl_test_relay_chain! { - pub struct PolkadotNet { - Runtime = polkadot_runtime::Runtime, - XcmConfig = polkadot_runtime::xcm_config::XcmConfig, - new_ext = polkadot_ext(), - } -} - -decl_test_parachain! { - pub struct Bifrost { - Runtime = Runtime, - RuntimeOrigin = RuntimeOrigin, - XcmpMessageHandler = bifrost_polkadot_runtime ::XcmpQueue, - DmpMessageHandler = bifrost_polkadot_runtime::DmpQueue, - new_ext = para_ext(), - } -} - -decl_test_network! { - pub struct TestNet { - relay_chain = PolkadotNet, - parachains = vec![ - (2030, Bifrost), - ], - } -} - -fn default_parachains_host_configuration() -> HostConfiguration { - HostConfiguration { - minimum_validation_upgrade_delay: 5, - validation_upgrade_cooldown: 5u32, - validation_upgrade_delay: 5, - code_retention_period: 1200, - max_code_size: MAX_CODE_SIZE, - max_pov_size: MAX_POV_SIZE, - max_head_data_size: 32 * 1024, - group_rotation_frequency: 20, - chain_availability_period: 4, - thread_availability_period: 4, - max_upward_queue_count: 8, - max_upward_queue_size: 1024 * 1024, - max_downward_message_size: 1024, - ump_service_total_weight: Weight::from_parts(4 * 1_000_000_000, 0), - max_upward_message_size: 1024 * 50, - max_upward_message_num_per_candidate: 5, - hrmp_sender_deposit: 0, - hrmp_recipient_deposit: 0, - hrmp_channel_max_capacity: 8, - hrmp_channel_max_total_size: 8 * 1024, - hrmp_max_parachain_inbound_channels: 4, - hrmp_max_parathread_inbound_channels: 4, - hrmp_channel_max_message_size: 1024 * 1024, - hrmp_max_parachain_outbound_channels: 4, - hrmp_max_parathread_outbound_channels: 4, - hrmp_max_message_num_per_candidate: 5, - dispute_period: 6, - no_show_slots: 2, - n_delay_tranches: 25, - needed_approvals: 2, - relay_vrf_modulo_samples: 2, - zeroth_delay_tranche_width: 0, - ..Default::default() - } -} - -// Polkadot initial configuration -pub fn polkadot_ext() -> sp_io::TestExternalities { - use polkadot_runtime::{Runtime, System}; - - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - - pallet_balances::GenesisConfig:: { - balances: vec![(AccountId::from(ALICE), 100 * DOT_DECIMALS)], - } - .assimilate_storage(&mut t) - .unwrap(); - - polkadot_runtime_parachains::configuration::GenesisConfig:: { - config: default_parachains_host_configuration(), - } - .assimilate_storage(&mut t) - .unwrap(); - - >::assimilate_storage( - &pallet_xcm::GenesisConfig { safe_xcm_version: Some(3) }, - &mut t, - ) - .unwrap(); - - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| System::set_block_number(1)); - ext -} - -// Bifrost initial configuration -pub fn para_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - - bifrost_asset_registry::GenesisConfig:: { - currency: vec![ - ( - CurrencyId::Token2(DOT_TOKEN_ID), - DOT_DECIMALS / 1000, - Some((String::from("Polkadot DOT"), String::from("DOT"), 10u8)), - ), - ( - CurrencyId::Token2(GLMR_TOKEN_ID), - GLMR_DECIMALS / 1000_000, - Some((String::from("Moonbeam Native Token"), String::from("GLMR"), 18u8)), - ), - ], - vcurrency: vec![CurrencyId::VToken2(DOT_TOKEN_ID)], - vsbond: vec![], - phantom: Default::default(), - } - .assimilate_storage(&mut t) - .unwrap(); - orml_tokens::GenesisConfig:: { - balances: vec![( - AccountId::from(ALICE), - CurrencyId::Token2(DOT_TOKEN_ID), - 10 * DOT_DECIMALS, - )], - } - .assimilate_storage(&mut t) - .unwrap(); - - pallet_membership::GenesisConfig:: { - members: Default::default(), - phantom: Default::default(), - } - .assimilate_storage(&mut t) - .unwrap(); - - >::assimilate_storage( - ¶chain_info::GenesisConfig { parachain_id: 2030.into() }, - &mut t, - ) - .unwrap(); - - >::assimilate_storage( - &pallet_xcm::GenesisConfig { safe_xcm_version: Some(3) }, - &mut t, - ) - .unwrap(); - - as GenesisBuild>::assimilate_storage( - &bifrost_salp::GenesisConfig { initial_multisig_account: Some(AccountId::new(ALICE)) }, - &mut t, - ) - .unwrap(); - - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| System::set_block_number(1)); - ext -} diff --git a/integration-tests/bifrost-polkadot/src/dollor_tests.rs b/integration-tests/bifrost-polkadot/src/dollor_tests.rs deleted file mode 100644 index 5d1f6e4d9..000000000 --- a/integration-tests/bifrost-polkadot/src/dollor_tests.rs +++ /dev/null @@ -1,120 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program 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. - -// This program 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 this program. If not, see . - -use crate::config::{Bifrost, DOT_DECIMALS, DOT_TOKEN_ID, GLMR_DECIMALS, GLMR_TOKEN_ID}; -use bifrost_asset_registry::AssetMetadata; -use bifrost_polkadot_runtime::{AssetRegistry, Runtime}; -use bifrost_runtime_common::{cent, dollar, micro, microcent, milli, millicent}; -use node_primitives::CurrencyId; -use xcm_emulator::TestExt; - -#[test] -fn dollar_should_work() { - sp_io::TestExternalities::default().execute_with(|| { - Bifrost::execute_with(|| { - assert_eq!( - AssetRegistry::currency_metadatas(CurrencyId::Token2(DOT_TOKEN_ID)), - Some(AssetMetadata { - name: b"Polkadot DOT".to_vec(), - symbol: b"DOT".to_vec(), - decimals: 10u8, - minimal_balance: DOT_DECIMALS / 1000, - }) - ); - assert_eq!( - AssetRegistry::currency_metadatas(CurrencyId::Token2(GLMR_TOKEN_ID)), - Some(AssetMetadata { - name: b"Moonbeam Native Token".to_vec(), - symbol: b"GLMR".to_vec(), - decimals: 18u8, - minimal_balance: GLMR_DECIMALS / 1000_000, - }) - ); - assert_eq!(dollar::(CurrencyId::Token2(DOT_TOKEN_ID)), DOT_DECIMALS); - assert_eq!(dollar::(CurrencyId::Token2(GLMR_TOKEN_ID)), GLMR_DECIMALS); - }); - }) -} - -#[test] -fn milli_should_work() { - sp_io::TestExternalities::default().execute_with(|| { - Bifrost::execute_with(|| { - assert_eq!(milli::(CurrencyId::Token2(DOT_TOKEN_ID)), DOT_DECIMALS / 1000); - assert_eq!(milli::(CurrencyId::Token2(GLMR_TOKEN_ID)), GLMR_DECIMALS / 1000); - }) - }) -} - -#[test] -fn micro_should_work() { - sp_io::TestExternalities::default().execute_with(|| { - Bifrost::execute_with(|| { - assert_eq!( - micro::(CurrencyId::Token2(DOT_TOKEN_ID)), - DOT_DECIMALS / 1_000_000 - ); - assert_eq!( - micro::(CurrencyId::Token2(GLMR_TOKEN_ID)), - GLMR_DECIMALS / 1_000_000 - ); - }) - }) -} - -#[test] -fn cent_should_work() { - sp_io::TestExternalities::default().execute_with(|| { - Bifrost::execute_with(|| { - assert_eq!(cent::(CurrencyId::Token2(DOT_TOKEN_ID)), DOT_DECIMALS / 100); - assert_eq!(cent::(CurrencyId::Token2(GLMR_TOKEN_ID)), GLMR_DECIMALS / 100); - }) - }) -} - -#[test] -fn millicent_should_work() { - sp_io::TestExternalities::default().execute_with(|| { - Bifrost::execute_with(|| { - assert_eq!( - millicent::(CurrencyId::Token2(DOT_TOKEN_ID)), - DOT_DECIMALS / 100_000 - ); - assert_eq!( - millicent::(CurrencyId::Token2(GLMR_TOKEN_ID)), - GLMR_DECIMALS / 100_000 - ); - }) - }) -} - -#[test] -fn microcent_should_work() { - sp_io::TestExternalities::default().execute_with(|| { - Bifrost::execute_with(|| { - assert_eq!( - microcent::(CurrencyId::Token2(DOT_TOKEN_ID)), - DOT_DECIMALS / 100_000_000 - ); - assert_eq!( - microcent::(CurrencyId::Token2(GLMR_TOKEN_ID)), - GLMR_DECIMALS / 100_000_000 - ); - }) - }) -} diff --git a/integration-tests/bifrost-polkadot/src/lib.rs b/integration-tests/bifrost-polkadot/src/lib.rs index 02168d8b4..170f8af80 100644 --- a/integration-tests/bifrost-polkadot/src/lib.rs +++ b/integration-tests/bifrost-polkadot/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,7 +18,79 @@ #![cfg(test)] -mod config; -mod dollor_tests; -mod polkadot_cross_chain_transfer; -mod salp; +// mod hrmp_channels; +mod reserve_transfer; + +pub use codec::Encode; +pub use frame_support::{ + assert_err, assert_ok, + pallet_prelude::Weight, + sp_runtime::{AccountId32, DispatchError, DispatchResult}, + traits::fungibles::Inspect, +}; +use integration_tests_common::BifrostPolkadot; +pub use integration_tests_common::{ + constants::{ + asset_hub_polkadot::ED as ASSET_HUB_POLKADOT_ED, polkadot::ED as POLKADOT_ED, + PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + }, + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + AssetHubPolkadot, AssetHubPolkadotPallet, AssetHubPolkadotReceiver, AssetHubPolkadotSender, + BifrostPolkadotReceiver, PenpalPolkadotA, PenpalPolkadotAPallet, PenpalPolkadotAReceiver, + PenpalPolkadotB, PenpalPolkadotBPallet, Polkadot, PolkadotPallet, PolkadotReceiver, + PolkadotSender, +}; +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 SystemParaToRelayTest = Test; +pub type SystemParaToParaTest = Test; + +/// Returns a `TestArgs` instance to de used for the Relay Chain accross integraton tests +pub fn relay_test_args(amount: Balance) -> TestArgs { + TestArgs { + dest: Polkadot::child_location_of(AssetHubPolkadot::para_id()), + beneficiary: AccountId32Junction { + network: None, + id: AssetHubPolkadotReceiver::get().into(), + } + .into(), + amount, + assets: (Here, amount).into(), + asset_id: None, + fee_asset_item: 0, + weight_limit: WeightLimit::Unlimited, + } +} + +/// Returns a `TestArgs` instance to de used for the System Parachain accross integraton tests +pub fn system_para_test_args( + dest: MultiLocation, + beneficiary_id: AccountId32, + amount: Balance, + assets: MultiAssets, + asset_id: Option, +) -> TestArgs { + TestArgs { + dest, + beneficiary: AccountId32Junction { network: None, id: beneficiary_id.into() }.into(), + amount, + assets, + asset_id, + fee_asset_item: 0, + weight_limit: WeightLimit::Unlimited, + } +} diff --git a/integration-tests/bifrost-polkadot/src/polkadot_cross_chain_transfer.rs b/integration-tests/bifrost-polkadot/src/polkadot_cross_chain_transfer.rs deleted file mode 100644 index d48b1d172..000000000 --- a/integration-tests/bifrost-polkadot/src/polkadot_cross_chain_transfer.rs +++ /dev/null @@ -1,90 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program 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. - -// This program 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 this program. If not, see . - -//! Cross-chain transfer tests within Kusama network. -use frame_support::assert_ok; -use node_primitives::CurrencyId; -use orml_traits::MultiCurrency; -use sp_runtime::traits::AccountIdConversion; -use xcm::{v3::prelude::*, VersionedMultiAssets, VersionedMultiLocation}; -use xcm_emulator::{ParaId, TestExt}; - -use crate::config::{Bifrost, PolkadotNet, ALICE, BOB, DOT_DECIMALS, DOT_TOKEN_ID}; -use bifrost_polkadot_runtime::{ - AccountId, Balances, RelayCurrencyId, RuntimeOrigin, Tokens, XTokens, -}; - -#[test] -fn transfer_dot_between_bifrost_and_relay_chain() { - sp_io::TestExternalities::default().execute_with(|| { - PolkadotNet::execute_with(|| { - // Polkadot alice(100 DOT) -> Bifrost bob 10 DOT - assert_ok!(polkadot_runtime::XcmPallet::reserve_transfer_assets( - polkadot_runtime::RuntimeOrigin::signed(ALICE.into()), - Box::new(VersionedMultiLocation::V3(X1(Parachain(2030)).into())), - Box::new(VersionedMultiLocation::V3( - X1(Junction::AccountId32 { id: BOB, network: None }).into() - )), - Box::new(VersionedMultiAssets::V3((Here, 10 * DOT_DECIMALS).into())), - 0, - )); - - // Polkadot alice 90 DOT - assert_eq!(Balances::free_balance(&AccountId::from(ALICE)), 90 * DOT_DECIMALS); - // Parachain account 10 DOT - let parachain_account: AccountId = ParaId::from(2030).into_account_truncating(); - assert_eq!(Balances::free_balance(parachain_account), 10 * DOT_DECIMALS); - }); - - Bifrost::execute_with(|| { - assert_eq!( - Tokens::free_balance(RelayCurrencyId::get(), &AccountId::from(BOB)), - 99992960800 - ); - // Bifrost bob (9.9 DOT) -> Polkadot BoB 2 DOT - assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(BOB.into()), - CurrencyId::Token2(DOT_TOKEN_ID), - 2 * DOT_DECIMALS, - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::new( - 1, - X1(Junction::AccountId32 { id: BOB, network: None }) - ))), - xcm_emulator::Unlimited - )); - - // Bifrost bob 7.9 DOT - assert_eq!( - Tokens::free_balance(RelayCurrencyId::get(), &AccountId::from(BOB)), - 79992960800, - ); - }); - - PolkadotNet::execute_with(|| { - // Parachain account 8 DOT - let parachain_account: AccountId = ParaId::from(2030).into_account_truncating(); - assert_eq!(Balances::free_balance(parachain_account), 8 * DOT_DECIMALS); - - // Polkadot bob 1.9 DOT - assert_eq!( - polkadot_runtime::Balances::free_balance(&AccountId::from(BOB)), - 19635578476, - ); - }); - }) -} diff --git a/integration-tests/bifrost-polkadot/src/reserve_transfer.rs b/integration-tests/bifrost-polkadot/src/reserve_transfer.rs new file mode 100644 index 000000000..21bfc50a1 --- /dev/null +++ b/integration-tests/bifrost-polkadot/src/reserve_transfer.rs @@ -0,0 +1,215 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +use crate::*; + +fn system_para_to_para_assertions(t: SystemParaToParaTest) { + type RuntimeEvent = ::RuntimeEvent; + + AssetHubPolkadot::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( + 676_119_000, + 6196, + ))); + + assert_expected_events!( + AssetHubPolkadot, + vec![ + // Amount to reserve transfer is transferred to Parachain's Sovereing account + RuntimeEvent::Balances( + pallet_balances::Event::Transfer { from, to, amount } + ) => { + from: *from == t.sender.account_id, + to: *to == AssetHubPolkadot::sovereign_account_id_of( + t.args.dest + ), + amount: *amount == t.args.amount, + }, + ] + ); +} + +fn system_para_to_para_assets_assertions(t: SystemParaToParaTest) { + type RuntimeEvent = ::RuntimeEvent; + + AssetHubPolkadot::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( + 676_119_000, + 6196, + ))); + + assert_expected_events!( + AssetHubPolkadot, + vec![ + // Amount to reserve transfer is transferred to Parachain's Sovereing account + RuntimeEvent::Assets( + pallet_assets::Event::Transferred { asset_id, from, to, amount } + ) => { + asset_id: *asset_id == ASSET_ID, + from: *from == t.sender.account_id, + to: *to == AssetHubPolkadot::sovereign_account_id_of( + t.args.dest + ), + amount: *amount == t.args.amount, + }, + ] + ); +} + +fn system_para_to_para_limited_reserve_transfer_assets(t: SystemParaToParaTest) -> DispatchResult { + ::PolkadotXcm::limited_reserve_transfer_assets( + t.signed_origin, + bx!(t.args.dest.into()), + bx!(t.args.beneficiary.into()), + bx!(t.args.assets.into()), + t.args.fee_asset_item, + t.args.weight_limit, + ) +} + +fn system_para_to_para_reserve_transfer_assets(t: SystemParaToParaTest) -> DispatchResult { + ::PolkadotXcm::reserve_transfer_assets( + t.signed_origin, + bx!(t.args.dest.into()), + bx!(t.args.beneficiary.into()), + bx!(t.args.assets.into()), + t.args.fee_asset_item, + ) +} + +/// Limited Reserve Transfers of native asset from AssetHub to BifrostPolkadot should work +#[test] +fn limited_reserve_transfer_native_asset_from_asset_hub_to_bifrost_polkadot() { + // Init values for System Parachain + let destination = AssetHubPolkadot::sibling_location_of(BifrostPolkadot::para_id()); + let beneficiary_id = BifrostPolkadotReceiver::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: system_para_test_args(destination, beneficiary_id, amount_to_send, assets, None), + }; + + let mut test = SystemParaToParaTest::new(test_args); + + let sender_balance_before = test.sender.balance; + + test.set_assertion::(system_para_to_para_assertions); + test.set_dispatchable::(system_para_to_para_limited_reserve_transfer_assets); + test.assert(); + + let sender_balance_after = test.sender.balance; + + assert_eq!(sender_balance_before - amount_to_send, sender_balance_after); +} + +/// Reserve Transfers of native asset from AssetHub to BifrostPolkadot should work +#[test] +fn reserve_transfer_native_asset_from_asset_hub_to_bifrost_polkadot() { + // Init values for System Parachain + let destination = AssetHubPolkadot::sibling_location_of(BifrostPolkadot::para_id()); + let beneficiary_id = BifrostPolkadotReceiver::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: BifrostPolkadotReceiver::get(), + args: system_para_test_args(destination, beneficiary_id, amount_to_send, assets, None), + }; + + let mut test = SystemParaToParaTest::new(test_args); + + let sender_balance_before = test.sender.balance; + + test.set_assertion::(system_para_to_para_assertions); + test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); + test.assert(); + + let sender_balance_after = test.sender.balance; + + assert_eq!(sender_balance_before - amount_to_send, sender_balance_after); +} + +/// Limited Reserve Transfers of a local asset from AssetHub to BifrostPolkadot should work +#[test] +fn limited_reserve_transfer_asset_from_asset_hub_to_bifrost_polkadot() { + // Force create asset from Relay Chain and mint assets for System Parachain's sender account + AssetHubPolkadot::force_create_and_mint_asset( + ASSET_ID, + ASSET_MIN_BALANCE, + true, + AssetHubPolkadotSender::get(), + ASSET_MIN_BALANCE * 1000000, + ); + + // Init values for System Parachain + let destination = AssetHubPolkadot::sibling_location_of(BifrostPolkadot::para_id()); + let beneficiary_id = BifrostPolkadotReceiver::get(); + let amount_to_send = ASSET_MIN_BALANCE * 1000; + let assets = + (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), amount_to_send) + .into(); + + let system_para_test_args = TestContext { + sender: AssetHubPolkadotSender::get(), + receiver: PenpalPolkadotAReceiver::get(), + args: system_para_test_args(destination, beneficiary_id, amount_to_send, assets, None), + }; + + let mut system_para_test = SystemParaToParaTest::new(system_para_test_args); + + system_para_test.set_assertion::(system_para_to_para_assets_assertions); + system_para_test + .set_dispatchable::(system_para_to_para_limited_reserve_transfer_assets); + system_para_test.assert(); +} + +/// Reserve Transfers of a local asset from AssetHub to BifrostPolkadot should work +#[test] +fn reserve_transfer_asset_from_asset_hub_to_bifrost_polkadot() { + // Force create asset from Relay Chain and mint assets for System Parachain's sender account + AssetHubPolkadot::force_create_and_mint_asset( + ASSET_ID, + ASSET_MIN_BALANCE, + true, + AssetHubPolkadotSender::get(), + ASSET_MIN_BALANCE * 1000000, + ); + + // Init values for System Parachain + let destination = AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()); + let beneficiary_id = BifrostPolkadotReceiver::get(); + let amount_to_send = ASSET_MIN_BALANCE * 1000; + let assets = + (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), amount_to_send) + .into(); + + let system_para_test_args = TestContext { + sender: AssetHubPolkadotSender::get(), + receiver: BifrostPolkadotReceiver::get(), + args: system_para_test_args(destination, beneficiary_id, amount_to_send, assets, None), + }; + + let mut system_para_test = SystemParaToParaTest::new(system_para_test_args); + + system_para_test.set_assertion::(system_para_to_para_assets_assertions); + system_para_test + .set_dispatchable::(system_para_to_para_reserve_transfer_assets); + system_para_test.assert(); +} diff --git a/integration-tests/bifrost-polkadot/src/salp.rs b/integration-tests/bifrost-polkadot/src/salp.rs deleted file mode 100644 index a7617f95f..000000000 --- a/integration-tests/bifrost-polkadot/src/salp.rs +++ /dev/null @@ -1,62 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program 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. - -// This program 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 this program. If not, see . - -use crate::config::Bifrost; -use bifrost_asset_registry::AssetIdMaps; -use bifrost_polkadot_runtime::{Runtime, Salp, SlotLength}; -use bifrost_salp::{FundInfo, FundStatus}; -use frame_support::assert_ok; -use frame_system::RawOrigin; -use node_primitives::CurrencyIdRegister; -use xcm_emulator::TestExt; - -const DOT: u128 = 1_000_000_000_000; - -#[test] -fn create_should_work() { - sp_io::TestExternalities::default().execute_with(|| { - Bifrost::execute_with(|| { - assert_eq!(AssetIdMaps::::check_token2_registered(0), true); - assert_eq!(AssetIdMaps::::check_vsbond2_registered(0, 3000, 1, 8), false); - // first_slot + 7 >= last_slot - assert_ok!(Salp::create( - RawOrigin::Root.into(), - //paraid - 3_000, - //cap - 100 * DOT, - //first_slot - 1, - //last_slot - SlotLength::get() - )); - assert_eq!( - Salp::funds(3_000).unwrap(), - FundInfo { - raised: 0, - cap: 100 * DOT, - first_slot: 1, - last_slot: SlotLength::get(), - trie_index: 0, - status: FundStatus::Ongoing, - } - ); - assert_eq!(AssetIdMaps::::check_vsbond2_registered(0, 3000, 1, 8), true); - }); - }) -} diff --git a/integration-tests/common/Cargo.toml b/integration-tests/common/Cargo.toml new file mode 100644 index 000000000..cfea3db98 --- /dev/null +++ b/integration-tests/common/Cargo.toml @@ -0,0 +1,62 @@ +[package] +name = "integration-tests-common" +version = "1.0.0" +license = "Apache-2.0" +description = "Common resources for integration testing with xcm-emulator" +publish = false + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } +paste = "1.0.14" + +# Substrate +grandpa = { package = "sc-consensus-grandpa", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +beefy-primitives = { package = "sp-consensus-beefy", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } + +# Polkadot +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, features = ["full-node"] } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +polkadot-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +polkadot-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +kusama-runtime = { package = "staging-kusama-runtime", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +kusama-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +rococo-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +rococo-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +westend-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} + +# Cumulus +parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +penpal-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +asset-hub-polkadot-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +asset-hub-kusama-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +asset-hub-westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +collectives-polkadot-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bridge-hub-kusama-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bridge-hub-polkadot-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bridge-hub-rococo-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bp-messages = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-bridge-messages = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bridge-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } + +bifrost-polkadot-runtime = { path = "../../runtime/bifrost-polkadot" } +bifrost-kusama-runtime = { path = "../../runtime/bifrost-kusama" } \ No newline at end of file diff --git a/integration-tests/common/src/constants.rs b/integration-tests/common/src/constants.rs new file mode 100644 index 000000000..f429f5e5f --- /dev/null +++ b/integration-tests/common/src/constants.rs @@ -0,0 +1,1212 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +// Substrate +use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId; +use grandpa::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, Pair, Public}; +use sp_runtime::{ + traits::{IdentifyAccount, Verify}, + BuildStorage, MultiSignature, Perbill, +}; + +// Cumulus +use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance, BlockNumber}; +use polkadot_parachain_primitives::primitives::{HeadData, ValidationCode}; +use polkadot_primitives::{AssignmentId, ValidatorId}; +use polkadot_runtime_parachains::{ + configuration::HostConfiguration, + paras::{ParaGenesisArgs, ParaKind}, +}; +use polkadot_service::chain_spec::get_authority_keys_from_seed_no_beefy; +use xcm; + +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. +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, + )> { + vec![get_authority_keys_from_seed_no_beefy("Alice")] + } +} + +/// The default XCM version to set in genesis config. +const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; +// 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, + ) -> polkadot_runtime::SessionKeys { + polkadot_runtime::SessionKeys { + babe, + grandpa, + im_online, + para_validator, + para_assignment, + authority_discovery, + } + } + + pub fn genesis() -> Storage { + let genesis_config = polkadot_runtime::RuntimeGenesisConfig { + system: polkadot_runtime::SystemConfig { + code: polkadot_runtime::WASM_BINARY.unwrap().to_vec(), + ..Default::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(), + ), + ) + }) + .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, + }, + ), + ( + 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() + } +} + +// Westend +pub mod westend { + use super::*; + use westend_runtime_constants::currency::UNITS as WND; + pub const ED: Balance = westend_runtime_constants::currency::EXISTENTIAL_DEPOSIT; + const ENDOWMENT: u128 = 1_000_000 * WND; + const STASH: u128 = 100 * WND; + + 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, + ) -> westend_runtime::SessionKeys { + westend_runtime::SessionKeys { + babe, + grandpa, + im_online, + para_validator, + para_assignment, + authority_discovery, + beefy, + } + } + + pub fn genesis() -> Storage { + let genesis_config = westend_runtime::RuntimeGenesisConfig { + system: westend_runtime::SystemConfig { + code: westend_runtime::WASM_BINARY.unwrap().to_vec(), + ..Default::default() + }, + balances: westend_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .cloned() + .map(|k| (k, ENDOWMENT)) + .collect(), + }, + session: westend_runtime::SessionConfig { + keys: validators::initial_authorities() + .iter() + .map(|x| { + ( + x.0.clone(), + x.0.clone(), + westend::session_keys( + x.2.clone(), + x.3.clone(), + x.4.clone(), + x.5.clone(), + x.6.clone(), + x.7.clone(), + get_from_seed::("Alice"), + ), + ) + }) + .collect::>(), + }, + staking: westend_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, westend_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: westend_runtime::BabeConfig { + authorities: Default::default(), + epoch_config: Some(westend_runtime::BABE_GENESIS_EPOCH_CONFIG), + ..Default::default() + }, + configuration: westend_runtime::ConfigurationConfig { config: get_host_config() }, + ..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 { + code: kusama_runtime::WASM_BINARY.unwrap().to_vec(), + ..Default::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(), + get_from_seed::("Alice"), + ), + ) + }) + .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, + }, + ), + ( + 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() + } +} + +// Rococo +pub mod rococo { + use super::*; + pub const ED: Balance = rococo_runtime_constants::currency::EXISTENTIAL_DEPOSIT; + use rococo_runtime_constants::currency::UNITS as ROC; + const ENDOWMENT: u128 = 1_000_000 * ROC; + + 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: 0, + hrmp_recipient_deposit: 0, + 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, + ) -> rococo_runtime::SessionKeys { + rococo_runtime::SessionKeys { + babe, + grandpa, + im_online, + para_validator, + para_assignment, + authority_discovery, + beefy, + } + } + + pub fn genesis() -> Storage { + let genesis_config = rococo_runtime::RuntimeGenesisConfig { + system: rococo_runtime::SystemConfig { + code: rococo_runtime::WASM_BINARY.unwrap().to_vec(), + ..Default::default() + }, + balances: rococo_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .map(|k| (k.clone(), ENDOWMENT)) + .collect(), + }, + // indices: rococo_runtime::IndicesConfig { indices: vec![] }, + session: rococo_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(), + get_from_seed::("Alice"), + ), + ) + }) + .collect::>(), + }, + babe: rococo_runtime::BabeConfig { + authorities: Default::default(), + epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG), + ..Default::default() + }, + sudo: rococo_runtime::SudoConfig { + key: Some(get_account_id_from_seed::("Alice")), + }, + configuration: rococo_runtime::ConfigurationConfig { config: get_host_config() }, + registrar: rococo_runtime::RegistrarConfig { + next_free_para_id: polkadot_primitives::LOWEST_PUBLIC_ID, + ..Default::default() + }, + ..Default::default() + }; + + genesis_config.build_storage().unwrap() + } +} + +// Asset Hub Polkadot +pub mod bifrost_polkadot { + use super::*; + pub const PARA_ID: u32 = 2030; + pub const ED: Balance = 10_000_000_000; + + pub fn genesis() -> Storage { + let genesis_config = bifrost_polkadot_runtime::RuntimeGenesisConfig { + system: bifrost_polkadot_runtime::SystemConfig { + code: bifrost_polkadot_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + ..Default::default() + }, + balances: bifrost_polkadot_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .cloned() + .map(|k| (k, ED * 4096)) + .collect(), + }, + parachain_info: bifrost_polkadot_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + collator_selection: bifrost_polkadot_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables_asset_hub_polkadot() + .iter() + .cloned() + .map(|(acc, _)| acc) + .collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: bifrost_polkadot_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + bifrost_polkadot_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: bifrost_polkadot_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + ..Default::default() + }; + + genesis_config.build_storage().unwrap() + } +} + +// Asset Hub Polkadot +pub mod bifrost_kusama { + use super::*; + pub const PARA_ID: u32 = 2001; + pub const ED: Balance = 10_000_000_000; + + pub fn genesis() -> Storage { + let genesis_config = bifrost_kusama_runtime::RuntimeGenesisConfig { + system: bifrost_kusama_runtime::SystemConfig { + code: bifrost_kusama_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + ..Default::default() + }, + balances: bifrost_kusama_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .cloned() + .map(|k| (k, ED * 4096)) + .collect(), + }, + parachain_info: bifrost_kusama_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + session: bifrost_kusama_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + bifrost_kusama_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: bifrost_kusama_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..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 = parachains_common::polkadot::currency::EXISTENTIAL_DEPOSIT; + + pub fn genesis() -> Storage { + let genesis_config = asset_hub_polkadot_runtime::RuntimeGenesisConfig { + system: asset_hub_polkadot_runtime::SystemConfig { + code: asset_hub_polkadot_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + ..Default::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_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 Westend +pub mod asset_hub_westend { + use super::*; + pub const PARA_ID: u32 = 1000; + pub const ED: Balance = parachains_common::westend::currency::EXISTENTIAL_DEPOSIT; + + pub fn genesis() -> Storage { + let genesis_config = asset_hub_westend_runtime::RuntimeGenesisConfig { + system: asset_hub_westend_runtime::SystemConfig { + code: asset_hub_westend_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + ..Default::default() + }, + balances: asset_hub_westend_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .cloned() + .map(|k| (k, ED * 4096)) + .collect(), + }, + parachain_info: asset_hub_westend_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + collator_selection: asset_hub_westend_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables() + .iter() + .cloned() + .map(|(acc, _)| acc) + .collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: asset_hub_westend_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + asset_hub_westend_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: asset_hub_westend_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 = parachains_common::kusama::currency::EXISTENTIAL_DEPOSIT; + + pub fn genesis() -> Storage { + let genesis_config = asset_hub_kusama_runtime::RuntimeGenesisConfig { + system: asset_hub_kusama_runtime::SystemConfig { + code: asset_hub_kusama_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + ..Default::default() + }, + balances: asset_hub_kusama_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .cloned() + .map(|k| (k, ED * 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() + } +} + +// 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 { + code: penpal_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + ..Default::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() + }; + + genesis_config.build_storage().unwrap() + } +} + +// Collectives +pub mod collectives { + use super::*; + pub const PARA_ID: u32 = 1001; + pub const ED: Balance = parachains_common::polkadot::currency::EXISTENTIAL_DEPOSIT; + + pub fn genesis() -> Storage { + let genesis_config = collectives_polkadot_runtime::RuntimeGenesisConfig { + system: collectives_polkadot_runtime::SystemConfig { + code: collectives_polkadot_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + ..Default::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() + } +} + +// Bridge Hub Kusama +pub mod bridge_hub_kusama { + use super::*; + pub const PARA_ID: u32 = 1002; + pub const ED: Balance = parachains_common::kusama::currency::EXISTENTIAL_DEPOSIT; + + pub fn genesis() -> Storage { + let genesis_config = bridge_hub_kusama_runtime::RuntimeGenesisConfig { + system: bridge_hub_kusama_runtime::SystemConfig { + code: bridge_hub_kusama_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + ..Default::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() + } +} + +// Bridge Hub Polkadot +pub mod bridge_hub_polkadot { + use super::*; + pub const PARA_ID: u32 = 1002; + pub const ED: Balance = parachains_common::polkadot::currency::EXISTENTIAL_DEPOSIT; + + pub fn genesis() -> Storage { + let genesis_config = bridge_hub_polkadot_runtime::RuntimeGenesisConfig { + system: bridge_hub_polkadot_runtime::SystemConfig { + code: bridge_hub_polkadot_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + ..Default::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 Rococo & Bridge Hub Wococo +pub mod bridge_hub_rococo { + use super::*; + pub const PARA_ID: u32 = 1013; + pub const ED: Balance = parachains_common::rococo::currency::EXISTENTIAL_DEPOSIT; + + pub fn genesis() -> Storage { + let genesis_config = bridge_hub_rococo_runtime::RuntimeGenesisConfig { + system: bridge_hub_rococo_runtime::SystemConfig { + code: bridge_hub_rococo_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + ..Default::default() + }, + balances: bridge_hub_rococo_runtime::BalancesConfig { + balances: accounts::init_balances() + .iter() + .cloned() + .map(|k| (k, ED * 4096)) + .collect(), + }, + parachain_info: bridge_hub_rococo_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + collator_selection: bridge_hub_rococo_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables() + .iter() + .cloned() + .map(|(acc, _)| acc) + .collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: bridge_hub_rococo_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + bridge_hub_rococo_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + polkadot_xcm: bridge_hub_rococo_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + bridge_wococo_grandpa: bridge_hub_rococo_runtime::BridgeWococoGrandpaConfig { + owner: Some(get_account_id_from_seed::(accounts::BOB)), + ..Default::default() + }, + bridge_rococo_grandpa: bridge_hub_rococo_runtime::BridgeRococoGrandpaConfig { + owner: Some(get_account_id_from_seed::(accounts::BOB)), + ..Default::default() + }, + bridge_rococo_messages: bridge_hub_rococo_runtime::BridgeRococoMessagesConfig { + owner: Some(get_account_id_from_seed::(accounts::BOB)), + ..Default::default() + }, + bridge_wococo_messages: bridge_hub_rococo_runtime::BridgeWococoMessagesConfig { + owner: Some(get_account_id_from_seed::(accounts::BOB)), + ..Default::default() + }, + ..Default::default() + }; + + genesis_config.build_storage().unwrap() + } +} diff --git a/integration-tests/common/src/impls.rs b/integration-tests/common/src/impls.rs new file mode 100644 index 000000000..eed61d941 --- /dev/null +++ b/integration-tests/common/src/impls.rs @@ -0,0 +1,654 @@ +// 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::{ + constants::{PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD}, + xcm_helpers::xcm_transact_unpaid_execution, + BridgeHubRococo, BridgeHubWococo, +}; + +// Substrate +pub use frame_support::{assert_ok, traits::fungibles::Inspect}; +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, Instance2, OutboundLanes, Pallet}; +pub use parachains_common::{AccountId, Balance}; +pub use xcm_emulator::{ + assert_expected_events, bx, helpers::weight_within_threshold, BridgeMessage, + BridgeMessageDispatchError, BridgeMessageHandler, Chain, Parachain, RelayChain, TestExt, +}; + +// Polkadot +pub use pallet_xcm; +pub use polkadot_runtime_parachains::{ + dmp, hrmp, + inclusion::{AggregateMessageOrigin, UmpQueueId}, +}; +pub use xcm::{ + prelude::{OriginKind, Outcome, VersionedXcm, Weight}, + 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())) + } +} + +type BridgeHubRococoRuntime = ::Runtime; +type BridgeHubWococoRuntime = ::Runtime; + +// TODO: uncomment when https://github.com/paritytech/cumulus/pull/2528 is merged +// type BridgeHubPolkadotRuntime = ::Runtime; +// type BridgeHubKusamaRuntime = ::Runtime; + +pub type RococoWococoMessageHandler = + BridgeHubMessageHandler; +pub type WococoRococoMessageHandler = + BridgeHubMessageHandler; + +// TODO: uncomment when https://github.com/paritytech/cumulus/pull/2528 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) -> sp_runtime::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_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, + )); + } + }); + } + } + } + }; +} + +#[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>]::DmpQueue($crate::impls::cumulus_pallet_dmp_queue::Event::ExecutedDownward { + 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 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>]::DmpQueue($crate::impls::cumulus_pallet_dmp_queue::Event::ExecutedDownward { + 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 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>]::XcmpQueue( + $crate::impls::cumulus_pallet_xcmp_queue::Event::Success { 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, + amount_to_mint: u128, + ) { + use $crate::impls::{bx, Chain, RelayChain, Parachain, Inspect, TestExt}; + // Init values for Relay Chain + let root_origin = <$relay_chain as Chain>::RuntimeOrigin::root(); + let destination = <$relay_chain>::child_location_of(<$chain>::para_id()); + let xcm = Self::force_create_asset_xcm( + $crate::impls::OriginKind::Superuser, + id, + asset_owner.clone(), + is_sufficient, + min_balance, + ); + + <$relay_chain>::execute_with(|| { + $crate::impls::assert_ok!(<$relay_chain as [<$relay_chain Pallet>]>::XcmPallet::send( + root_origin, + bx!(destination.into()), + bx!(xcm), + )); + + <$relay_chain>::assert_xcm_pallet_sent(); + }); + + Self::execute_with(|| { + Self::assert_dmp_queue_complete(Some($crate::impls::Weight::from_parts(1_019_445_000, 200_000))); + + type RuntimeEvent = <$chain as $crate::impls::Chain>::RuntimeEvent; + + $crate::impls::assert_expected_events!( + Self, + vec![ + // Asset has been created + RuntimeEvent::Assets($crate::impls::pallet_assets::Event::ForceCreated { asset_id, owner }) => { + asset_id: *asset_id == id, + owner: *owner == asset_owner.clone(), + }, + ] + ); + + assert!(]>::Assets::asset_exists(id.into())); + }); + + let signed_origin = ::RuntimeOrigin::signed(asset_owner.clone()); + + // Mint asset for System Parachain's sender + Self::mint_asset(signed_origin, id, asset_owner, amount_to_mint); + } + } + } + }; +} diff --git a/integration-tests/common/src/lib.rs b/integration-tests/common/src/lib.rs new file mode 100644 index 000000000..c0d2cf2b2 --- /dev/null +++ b/integration-tests/common/src/lib.rs @@ -0,0 +1,646 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +pub extern crate beefy_primitives; +pub extern crate bp_messages; +pub extern crate bridge_runtime_common; +pub extern crate codec; +pub extern crate cumulus_pallet_dmp_queue; +pub extern crate cumulus_pallet_parachain_system; +pub extern crate cumulus_pallet_xcmp_queue; +pub extern crate cumulus_primitives_core; +pub extern crate frame_support; +pub extern crate grandpa; +pub extern crate kusama_runtime_constants; +pub extern crate pallet_assets; +pub extern crate pallet_bridge_messages; +pub extern crate pallet_im_online; +pub extern crate pallet_message_queue; +pub extern crate pallet_xcm; +pub extern crate parachains_common; +pub extern crate paste; +pub extern crate polkadot_parachain_primitives; +pub extern crate polkadot_primitives; +pub extern crate polkadot_runtime_parachains; +pub extern crate polkadot_service; +pub extern crate rococo_runtime_constants; +pub extern crate sp_authority_discovery; +pub extern crate sp_consensus_babe; +pub extern crate sp_core; +pub extern crate sp_runtime; +pub extern crate westend_runtime_constants; +pub extern crate xcm; +pub extern crate xcm_emulator; + +pub mod constants; +pub mod impls; +pub mod xcm_helpers; + +pub use constants::{ + accounts::{ALICE, BOB}, + asset_hub_kusama, asset_hub_polkadot, asset_hub_westend, bifrost_kusama, bifrost_polkadot, + bridge_hub_kusama, bridge_hub_polkadot, bridge_hub_rococo, collectives, kusama, penpal, + polkadot, rococo, westend, +}; +use impls::{RococoWococoMessageHandler, WococoRococoMessageHandler}; + +// 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, DefaultMessageProcessor, +}; + +decl_test_relay_chains! { + #[api_version(5)] + pub struct Polkadot { + genesis = polkadot::genesis(), + on_init = (), + runtime = polkadot_runtime, + core = { + MessageProcessor: DefaultMessageProcessor, + SovereignAccountOf: polkadot_runtime::xcm_config::SovereignAccountOf, + }, + pallets = { + XcmPallet: polkadot_runtime::XcmPallet, + Balances: polkadot_runtime::Balances, + Hrmp: polkadot_runtime::Hrmp, + } + }, + #[api_version(5)] + pub struct Kusama { + genesis = kusama::genesis(), + on_init = (), + runtime = kusama_runtime, + core = { + MessageProcessor: DefaultMessageProcessor, + SovereignAccountOf: kusama_runtime::xcm_config::SovereignAccountOf, + }, + pallets = { + XcmPallet: kusama_runtime::XcmPallet, + Balances: kusama_runtime::Balances, + Hrmp: kusama_runtime::Hrmp, + } + }, + #[api_version(6)] + pub struct Westend { + genesis = westend::genesis(), + on_init = (), + runtime = westend_runtime, + core = { + MessageProcessor: DefaultMessageProcessor, + SovereignAccountOf: westend_runtime::xcm_config::LocationConverter, //TODO: rename to SovereignAccountOf, + }, + pallets = { + XcmPallet: westend_runtime::XcmPallet, + Sudo: westend_runtime::Sudo, + Balances: westend_runtime::Balances, + } + }, + #[api_version(5)] + pub struct Rococo { + genesis = rococo::genesis(), + on_init = (), + runtime = rococo_runtime, + core = { + MessageProcessor: DefaultMessageProcessor, + SovereignAccountOf: rococo_runtime::xcm_config::LocationConverter, //TODO: rename to SovereignAccountOf, + }, + pallets = { + XcmPallet: rococo_runtime::XcmPallet, + Sudo: rococo_runtime::Sudo, + Balances: rococo_runtime::Balances, + } + }, + #[api_version(5)] + pub struct Wococo { + genesis = rococo::genesis(), + on_init = (), + runtime = rococo_runtime, + core = { + MessageProcessor: DefaultMessageProcessor, + SovereignAccountOf: rococo_runtime::xcm_config::LocationConverter, //TODO: rename to SovereignAccountOf, + }, + pallets = { + XcmPallet: rococo_runtime::XcmPallet, + Sudo: rococo_runtime::Sudo, + Balances: rococo_runtime::Balances, + } + } +} + +decl_test_parachains! { + // Polkadot Parachains + pub struct BifrostPolkadot { + genesis = bifrost_polkadot::genesis(), + on_init = { + bifrost_polkadot_runtime::AuraExt::on_initialize(1); + }, + runtime = bifrost_polkadot_runtime, + core = { + XcmpMessageHandler: bifrost_polkadot_runtime::XcmpQueue, + DmpMessageHandler: bifrost_polkadot_runtime::DmpQueue, + LocationToAccountId: bifrost_polkadot_runtime::xcm_config::LocationToAccountId, + ParachainInfo: bifrost_polkadot_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: bifrost_polkadot_runtime::PolkadotXcm, + Tokens: bifrost_polkadot_runtime::Tokens, + XTokens: bifrost_polkadot_runtime::XTokens, + Balances: bifrost_polkadot_runtime::Balances, + } + }, + 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, + DmpMessageHandler: asset_hub_polkadot_runtime::DmpQueue, + LocationToAccountId: asset_hub_polkadot_runtime::xcm_config::LocationToAccountId, + ParachainInfo: asset_hub_polkadot_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: asset_hub_polkadot_runtime::PolkadotXcm, + Assets: asset_hub_polkadot_runtime::Assets, + 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, + DmpMessageHandler: collectives_polkadot_runtime::DmpQueue, + LocationToAccountId: collectives_polkadot_runtime::xcm_config::LocationToAccountId, + ParachainInfo: collectives_polkadot_runtime::ParachainInfo, + }, + 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, + DmpMessageHandler: bridge_hub_polkadot_runtime::DmpQueue, + LocationToAccountId: bridge_hub_polkadot_runtime::xcm_config::LocationToAccountId, + ParachainInfo: bridge_hub_polkadot_runtime::ParachainInfo, + }, + 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, + DmpMessageHandler: penpal_runtime::DmpQueue, + LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, + ParachainInfo: penpal_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: penpal_runtime::PolkadotXcm, + Assets: penpal_runtime::Assets, + } + }, + 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, + DmpMessageHandler: penpal_runtime::DmpQueue, + LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, + ParachainInfo: penpal_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: penpal_runtime::PolkadotXcm, + Assets: penpal_runtime::Assets, + } + }, + // Kusama Parachains + pub struct BifrostKusama { + genesis = bifrost_kusama::genesis(), + on_init = { + bifrost_kusama_runtime::AuraExt::on_initialize(1); + }, + runtime = bifrost_kusama_runtime, + core = { + XcmpMessageHandler: bifrost_kusama_runtime::XcmpQueue, + DmpMessageHandler: bifrost_kusama_runtime::DmpQueue, + LocationToAccountId: bifrost_kusama_runtime::xcm_config::LocationToAccountId, + ParachainInfo: bifrost_kusama_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: bifrost_kusama_runtime::PolkadotXcm, + Tokens: bifrost_kusama_runtime::Tokens, + XTokens: bifrost_kusama_runtime::XTokens, + Balances: bifrost_kusama_runtime::Balances, + } + }, + 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, + DmpMessageHandler: asset_hub_kusama_runtime::DmpQueue, + LocationToAccountId: asset_hub_kusama_runtime::xcm_config::LocationToAccountId, + ParachainInfo: asset_hub_kusama_runtime::ParachainInfo, + }, + 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, + DmpMessageHandler: bridge_hub_kusama_runtime::DmpQueue, + LocationToAccountId: bridge_hub_kusama_runtime::xcm_config::LocationToAccountId, + ParachainInfo: bridge_hub_kusama_runtime::ParachainInfo, + }, + 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, + DmpMessageHandler: penpal_runtime::DmpQueue, + LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, + ParachainInfo: penpal_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: penpal_runtime::PolkadotXcm, + Assets: penpal_runtime::Assets, + } + }, + 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, + DmpMessageHandler: penpal_runtime::DmpQueue, + LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, + ParachainInfo: penpal_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: penpal_runtime::PolkadotXcm, + Assets: penpal_runtime::Assets, + } + }, + // Westend Parachains + pub struct AssetHubWestend { + genesis = asset_hub_westend::genesis(), + on_init = { + asset_hub_westend_runtime::AuraExt::on_initialize(1); + }, + runtime = asset_hub_westend_runtime, + core = { + XcmpMessageHandler: asset_hub_westend_runtime::XcmpQueue, + DmpMessageHandler: asset_hub_westend_runtime::DmpQueue, + LocationToAccountId: asset_hub_westend_runtime::xcm_config::LocationToAccountId, + ParachainInfo: asset_hub_westend_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: asset_hub_westend_runtime::PolkadotXcm, + Balances: asset_hub_westend_runtime::Balances, + Assets: asset_hub_westend_runtime::Assets, + ForeignAssets: asset_hub_westend_runtime::ForeignAssets, + PoolAssets: asset_hub_westend_runtime::PoolAssets, + AssetConversion: asset_hub_westend_runtime::AssetConversion, + } + }, + pub struct PenpalWestendA { + genesis = penpal::genesis(penpal::PARA_ID_A), + on_init = { + penpal_runtime::AuraExt::on_initialize(1); + }, + runtime = penpal_runtime, + core = { + XcmpMessageHandler: penpal_runtime::XcmpQueue, + DmpMessageHandler: penpal_runtime::DmpQueue, + LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, + ParachainInfo: penpal_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: penpal_runtime::PolkadotXcm, + Assets: penpal_runtime::Assets, + } + }, + // Rococo Parachains + pub struct BridgeHubRococo { + genesis = bridge_hub_rococo::genesis(), + on_init = { + bridge_hub_rococo_runtime::AuraExt::on_initialize(1); + }, + runtime = bridge_hub_rococo_runtime, + core = { + XcmpMessageHandler: bridge_hub_rococo_runtime::XcmpQueue, + DmpMessageHandler: bridge_hub_rococo_runtime::DmpQueue, + LocationToAccountId: bridge_hub_rococo_runtime::xcm_config::LocationToAccountId, + ParachainInfo: bridge_hub_rococo_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: bridge_hub_rococo_runtime::PolkadotXcm, + Balances: bridge_hub_rococo_runtime::Balances, + } + }, + // AssetHubRococo (aka Rockmine/Rockmine2) mirrors AssetHubKusama + pub struct AssetHubRococo { + genesis = asset_hub_kusama::genesis(), + on_init = { + asset_hub_polkadot_runtime::AuraExt::on_initialize(1); + }, + runtime = asset_hub_kusama_runtime, + core = { + XcmpMessageHandler: asset_hub_kusama_runtime::XcmpQueue, + DmpMessageHandler: asset_hub_kusama_runtime::DmpQueue, + LocationToAccountId: asset_hub_kusama_runtime::xcm_config::LocationToAccountId, + ParachainInfo: asset_hub_kusama_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: asset_hub_kusama_runtime::PolkadotXcm, + Assets: asset_hub_kusama_runtime::Assets, + } + }, + // Wococo Parachains + pub struct BridgeHubWococo { + genesis = bridge_hub_rococo::genesis(), + on_init = { + bridge_hub_rococo_runtime::AuraExt::on_initialize(1); + }, + runtime = bridge_hub_rococo_runtime, + core = { + XcmpMessageHandler: bridge_hub_rococo_runtime::XcmpQueue, + DmpMessageHandler: bridge_hub_rococo_runtime::DmpQueue, + LocationToAccountId: bridge_hub_rococo_runtime::xcm_config::LocationToAccountId, + ParachainInfo: bridge_hub_rococo_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: bridge_hub_rococo_runtime::PolkadotXcm, + } + }, + pub struct AssetHubWococo { + 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, + DmpMessageHandler: asset_hub_polkadot_runtime::DmpQueue, + LocationToAccountId: asset_hub_polkadot_runtime::xcm_config::LocationToAccountId, + ParachainInfo: asset_hub_polkadot_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: asset_hub_polkadot_runtime::PolkadotXcm, + Assets: asset_hub_polkadot_runtime::Assets, + } + }, + pub struct PenpalRococoA { + genesis = penpal::genesis(penpal::PARA_ID_A), + on_init = { + penpal_runtime::AuraExt::on_initialize(1); + }, + runtime = penpal_runtime, + core = { + XcmpMessageHandler: penpal_runtime::XcmpQueue, + DmpMessageHandler: penpal_runtime::DmpQueue, + LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId, + ParachainInfo: penpal_runtime::ParachainInfo, + }, + pallets = { + PolkadotXcm: penpal_runtime::PolkadotXcm, + Assets: penpal_runtime::Assets, + } + } +} + +decl_test_networks! { + pub struct PolkadotMockNet { + relay_chain = Polkadot, + parachains = vec![ + BifrostPolkadot, + AssetHubPolkadot, + Collectives, + BridgeHubPolkadot, + PenpalPolkadotA, + PenpalPolkadotB, + ], + // TODO: uncomment when https://github.com/paritytech/cumulus/pull/2528 is merged + // bridge = PolkadotKusamaMockBridge + bridge = () + }, + pub struct KusamaMockNet { + relay_chain = Kusama, + parachains = vec![ + BifrostKusama, + AssetHubKusama, + PenpalKusamaA, + BridgeHubKusama, + PenpalKusamaB, + ], + // TODO: uncomment when https://github.com/paritytech/cumulus/pull/2528 is merged + // bridge = KusamaPolkadotMockBridge + bridge = () + }, + pub struct WestendMockNet { + relay_chain = Westend, + parachains = vec![ + AssetHubWestend, + PenpalWestendA, + ], + bridge = () + }, + pub struct RococoMockNet { + relay_chain = Rococo, + parachains = vec![ + AssetHubRococo, + BridgeHubRococo, + PenpalRococoA, + ], + bridge = RococoWococoMockBridge + }, + pub struct WococoMockNet { + relay_chain = Wococo, + parachains = vec![ + AssetHubWococo, + BridgeHubWococo, + ], + bridge = WococoRococoMockBridge + } +} + +decl_test_bridges! { + pub struct RococoWococoMockBridge { + source = BridgeHubRococo, + target = BridgeHubWococo, + handler = RococoWococoMessageHandler + }, + pub struct WococoRococoMockBridge { + source = BridgeHubWococo, + target = BridgeHubRococo, + handler = WococoRococoMessageHandler + } + // TODO: uncomment when https://github.com/paritytech/cumulus/pull/2528 is merged + // 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); + +// 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); + +// Westend implementation +impl_accounts_helpers_for_relay_chain!(Westend); +impl_assert_events_helpers_for_relay_chain!(Westend); + +// Rococo implementation +impl_accounts_helpers_for_relay_chain!(Rococo); +impl_assert_events_helpers_for_relay_chain!(Rococo); + +// Wococo implementation +impl_accounts_helpers_for_relay_chain!(Wococo); +impl_assert_events_helpers_for_relay_chain!(Wococo); + +// BifrostPolkadot implementation +impl_accounts_helpers_for_parachain!(BifrostPolkadot); +impl_assert_events_helpers_for_parachain!(BifrostPolkadot); + +// BifrostKusama implementation +impl_accounts_helpers_for_parachain!(BifrostKusama); +impl_assert_events_helpers_for_parachain!(BifrostKusama); + +// AssetHubPolkadot implementation +impl_accounts_helpers_for_parachain!(AssetHubPolkadot); +impl_assets_helpers_for_parachain!(AssetHubPolkadot, Polkadot); +impl_assert_events_helpers_for_parachain!(AssetHubPolkadot); + +// AssetHubKusama implementation +impl_accounts_helpers_for_parachain!(AssetHubKusama); +impl_assets_helpers_for_parachain!(AssetHubKusama, Kusama); +impl_assert_events_helpers_for_parachain!(AssetHubKusama); + +// AssetHubWestend implementation +impl_accounts_helpers_for_parachain!(AssetHubWestend); +impl_assets_helpers_for_parachain!(AssetHubWestend, Westend); +impl_assert_events_helpers_for_parachain!(AssetHubWestend); + +// PenpalPolkadot implementations +impl_assert_events_helpers_for_parachain!(PenpalPolkadotA); +impl_assert_events_helpers_for_parachain!(PenpalPolkadotB); + +// PenpalKusama implementations +impl_assert_events_helpers_for_parachain!(PenpalKusamaA); +impl_assert_events_helpers_for_parachain!(PenpalKusamaB); + +// PenpalWestendA implementation +impl_assert_events_helpers_for_parachain!(PenpalWestendA); + +// Collectives implementation +impl_accounts_helpers_for_parachain!(Collectives); +impl_assert_events_helpers_for_parachain!(Collectives); + +// BridgeHubRococo implementation +impl_accounts_helpers_for_parachain!(BridgeHubRococo); +impl_assert_events_helpers_for_parachain!(BridgeHubRococo); + +decl_test_sender_receiver_accounts_parameter_types! { + // Relays + Polkadot { sender: ALICE, receiver: BOB }, + Kusama { sender: ALICE, receiver: BOB }, + Westend { sender: ALICE, receiver: BOB }, + Rococo { sender: ALICE, receiver: BOB }, + Wococo { sender: ALICE, receiver: BOB }, + // Asset Hubs + BifrostPolkadot { sender: ALICE, receiver: BOB }, + BifrostKusama { sender: ALICE, receiver: BOB }, + AssetHubPolkadot { sender: ALICE, receiver: BOB }, + AssetHubKusama { sender: ALICE, receiver: BOB }, + AssetHubWestend { sender: ALICE, receiver: BOB }, + AssetHubRococo { sender: ALICE, receiver: BOB }, + AssetHubWococo { sender: ALICE, receiver: BOB }, + // Collectives + Collectives { sender: ALICE, receiver: BOB }, + // Bridged Hubs + BridgeHubPolkadot { sender: ALICE, receiver: BOB }, + BridgeHubKusama { sender: ALICE, receiver: BOB }, + BridgeHubRococo { sender: ALICE, receiver: BOB }, + BridgeHubWococo { sender: ALICE, receiver: BOB }, + // Penpals + PenpalPolkadotA { sender: ALICE, receiver: BOB }, + PenpalPolkadotB { sender: ALICE, receiver: BOB }, + PenpalKusamaA { sender: ALICE, receiver: BOB }, + PenpalKusamaB { sender: ALICE, receiver: BOB }, + PenpalWestendA { sender: ALICE, receiver: BOB }, + PenpalRococoA { sender: ALICE, receiver: BOB } +} diff --git a/integration-tests/common/src/xcm_helpers.rs b/integration-tests/common/src/xcm_helpers.rs new file mode 100644 index 000000000..cd5fe1a98 --- /dev/null +++ b/integration-tests/common/src/xcm_helpers.rs @@ -0,0 +1,68 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +use parachains_common::AccountId; +use xcm::{ + prelude::{ + AccountId32, All, BuyExecution, DepositAsset, MultiAsset, MultiAssets, MultiLocation, + OriginKind, RefundSurplus, Transact, UnpaidExecution, VersionedXcm, Weight, WeightLimit, + WithdrawAsset, Xcm, X1, + }, + 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 }, + ])) +} diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 4883f6ab9..25d235f01 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -22,41 +22,41 @@ codec = { package = "parity-scale-codec", version = "3.0.0" } log = "0.4.17" # primitives -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # client dependencies -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true } -sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } +sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # node-specific dependencies node-service = { path = "../service", default-features = false } -node-primitives = { path = "../primitives" } +bifrost-primitives = { path = "../../primitives" } # CLI-specific dependencies -sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true } -try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true } -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true } -node-inspect = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true } +sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } +try-runtime-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } +frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } +frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } +node-inspect = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } # Cumulus dependencies -cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # Polkadot dependencies -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true } +substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } [features] default = ["cli"] diff --git a/node/cli/build.rs b/node/cli/build.rs index 685c43aaa..ae3120b6f 100644 --- a/node/cli/build.rs +++ b/node/cli/build.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/node/cli/src/cli.rs b/node/cli/src/cli.rs index fc35cba50..a2a9caf80 100644 --- a/node/cli/src/cli.rs +++ b/node/cli/src/cli.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -73,6 +73,7 @@ pub enum Subcommand { /// Try some experimental command on the runtime. This includes migration and runtime-upgrade /// testing. #[cfg(feature = "try-runtime")] + #[allow(deprecated)] TryRuntime(try_runtime_cli::TryRuntimeCmd), /// Errors since the binary was not build with `--features try-runtime`. @@ -135,7 +136,7 @@ impl RelayChainCli { let extension = node_service::chain_spec::RelayExtensions::try_get(&*para_config.chain_spec); let chain_id = extension.map(|e| e.relay_chain.clone()); - let base_path = para_config.base_path.as_ref().map(|x| x.path().join("polkadot")); - Self { base_path, chain_id, base: Parser::parse_from(relay_chain_args) } + let base_path = para_config.base_path.path().join("polkadot"); + Self { base_path: Some(base_path), chain_id, base: Parser::parse_from(relay_chain_args) } } } diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index db128fca7..2e09ff9ad 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -16,22 +16,17 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use std::net::SocketAddr; - -use codec::Encode; -use cumulus_client_cli::generate_genesis_block; use cumulus_primitives_core::ParaId; use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; use log::info; -use node_primitives::Block; use node_service::{self as service, IdentifyVariant}; use sc_cli::{ ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, - NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli, + NetworkParams, Result, SharedParams, SubstrateCli, }; +use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; use sc_service::config::{BasePath, PrometheusConfig}; -use sp_core::hexdisplay::HexDisplay; -use sp_runtime::traits::{AccountIdConversion, Block as BlockT}; +use sp_runtime::traits::AccountIdConversion; use crate::{Cli, RelayChainCli, Subcommand}; @@ -159,35 +154,6 @@ impl SubstrateCli for Cli { fn load_spec(&self, id: &str) -> std::result::Result, String> { load_spec(id) } - - fn native_runtime_version(spec: &Box) -> &'static RuntimeVersion { - if spec.is_bifrost_kusama() || spec.is_dev() { - #[cfg(any(feature = "with-bifrost-kusama-runtime", feature = "with-bifrost-runtime"))] - { - &service::collator_kusama::bifrost_kusama_runtime::VERSION - } - #[cfg(not(any( - feature = "with-bifrost-kusama-runtime", - feature = "with-bifrost-runtime" - )))] - panic!("{}", service::BIFROST_KUSAMA_RUNTIME_NOT_AVAILABLE); - } else if spec.is_bifrost_polkadot() { - #[cfg(any( - feature = "with-bifrost-polkadot-runtime", - feature = "with-bifrost-runtime" - ))] - { - &service::collator_polkadot::bifrost_polkadot_runtime::VERSION - } - #[cfg(not(any( - feature = "with-bifrost-polkadot-runtime", - feature = "with-bifrost-runtime" - )))] - panic!("{}", service::BIFROST_POLKADOT_RUNTIME_NOT_AVAILABLE); - } else { - panic!("{}", "unknown runtime!"); - } - } } impl SubstrateCli for RelayChainCli { @@ -222,10 +188,6 @@ impl SubstrateCli for RelayChainCli { fn load_spec(&self, id: &str) -> std::result::Result, String> { polkadot_cli::Cli::from_iter([RelayChainCli::executable_name()].iter()).load_spec(id) } - - fn native_runtime_version(chain_spec: &Box) -> &'static RuntimeVersion { - polkadot_cli::Cli::native_runtime_version(chain_spec) - } } macro_rules! with_runtime_or_err { @@ -322,10 +284,13 @@ pub fn run() -> Result<()> { }, Some(Subcommand::ExportGenesisState(cmd)) => { let runner = cli.create_runner(cmd)?; - runner.sync_run(|_config| { - let spec = cli.load_spec(&cmd.shared_params.chain.clone().unwrap_or_default())?; - let state_version = Cli::native_runtime_version(&spec).state_version(); - cmd.run::(&*spec, state_version) + let chain_spec = &runner.config().chain_spec; + + with_runtime_or_err!(chain_spec, { + return runner.sync_run(|config| { + let partials = new_partial(&config, false)?; + cmd.run(&*config.chain_spec, &*partials.client) + }); }) }, Some(Subcommand::ExportGenesisWasm(cmd)) => { @@ -407,7 +372,12 @@ pub fn run() -> Result<()> { BenchmarkCmd::Pallet(cmd) => if cfg!(feature = "runtime-benchmarks") { with_runtime_or_err!(chain_spec, { - return runner.sync_run(|config| cmd.run::(config)); + return runner.sync_run(|config| { + cmd.run::::ExtendHostFunctions, + >>(config) + }); }) } else { Err("Benchmarking wasn't enabled when building the node. \ @@ -452,8 +422,6 @@ pub fn run() -> Result<()> { }, #[cfg(feature = "try-runtime")] Some(Subcommand::TryRuntime(cmd)) => { - use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; - let runner = cli.create_runner(cmd)?; let chain_spec = &runner.config().chain_spec; @@ -487,11 +455,12 @@ pub fn run() -> Result<()> { let collator_options = cli.run.collator_options(); runner.run_node_until_exit(|config| async move { - let hwbench = (!cli.no_hardware_benchmarks).then_some( - config.database.path().map(|database_path| { + let hwbench = (!cli.no_hardware_benchmarks) + .then_some(config.database.path().map(|database_path| { let _ = std::fs::create_dir_all(database_path); sc_sysinfo::gather_hwbench(Some(database_path)) - })).flatten(); + })) + .flatten(); let para_id = node_service::chain_spec::RelayExtensions::try_get(&*config.chain_spec) @@ -506,31 +475,21 @@ pub fn run() -> Result<()> { let id = ParaId::from(para_id); let parachain_account = - AccountIdConversion::::into_account_truncating(&id); - - let state_version = Cli::native_runtime_version(&config.chain_spec).state_version(); - - let block: node_primitives::Block = - generate_genesis_block(&*config.chain_spec, state_version) - .map_err(|e| format!("{:?}", e))?; - let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode())); + AccountIdConversion::::into_account_truncating( + &id, + ); let polkadot_config = SubstrateCli::create_configuration( &polkadot_cli, &polkadot_cli, config.tokio_handle.clone(), ) - .map_err(|err| format!("Relay chain argument error: {}", err))?; + .map_err(|err| format!("Relay chain argument error: {}", err))?; info!("Parachain id: {:?}", id); info!("Parachain Account: {}", parachain_account); - info!("Parachain genesis state: {}", genesis_state); info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" }); - if !collator_options.relay_chain_rpc_urls.is_empty() && !cli.relay_chain_args.is_empty() { - log::warn!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options."); - } - with_runtime_or_err!(config.chain_spec, { { start_node(config, polkadot_config, collator_options, id, hwbench) @@ -549,14 +508,6 @@ impl DefaultConfigurationValues for RelayChainCli { 30334 } - fn rpc_ws_listen_port() -> u16 { - 9945 - } - - fn rpc_http_listen_port() -> u16 { - 9934 - } - fn prometheus_listen_port() -> u16 { 9616 } @@ -586,18 +537,6 @@ impl CliConfiguration for RelayChainCli { .or_else(|| self.base_path.clone().map(Into::into))) } - fn rpc_http(&self, default_listen_port: u16) -> Result> { - self.base.base.rpc_http(default_listen_port) - } - - fn rpc_ipc(&self) -> Result> { - self.base.base.rpc_ipc() - } - - fn rpc_ws(&self, default_listen_port: u16) -> Result> { - self.base.base.rpc_ws(default_listen_port) - } - fn prometheus_config( &self, default_listen_port: u16, @@ -641,10 +580,6 @@ impl CliConfiguration for RelayChainCli { self.base.base.rpc_methods() } - fn rpc_ws_max_connections(&self) -> Result> { - self.base.base.rpc_ws_max_connections() - } - fn rpc_cors(&self, is_dev: bool) -> Result>> { self.base.base.rpc_cors(is_dev) } diff --git a/node/cli/src/lib.rs b/node/cli/src/lib.rs index 8b021b620..105dd89df 100644 --- a/node/cli/src/lib.rs +++ b/node/cli/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/node/cli/src/main.rs b/node/cli/src/main.rs index 59bdc6f27..e4b57dfdd 100644 --- a/node/cli/src/main.rs +++ b/node/cli/src/main.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/node/primitives/Cargo.toml b/node/primitives/Cargo.toml deleted file mode 100644 index 0c99a426b..000000000 --- a/node/primitives/Cargo.toml +++ /dev/null @@ -1,48 +0,0 @@ -[package] -name = "node-primitives" -version = "0.8.0" -authors = ["Edwin Wang "] -edition = "2021" - -[dependencies] -bstringify = "0.1.2" -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ - "derive", -] } -scale-info = { version = "2.3.1", default-features = false, features = [ - "derive", -] } -serde = { version = "1.0.160", optional = true, features = ["derive"] } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -zenlink-protocol = { version = "*", default-features = false } -orml-oracle = { version = "0.4.1-dev", default-features = false } - -[features] -default = ["std"] -std = [ - "codec/std", - "frame-system/std", - "frame-support/std", - "scale-info/std", - "serde/std", - "sp-core/std", - "sp-runtime/std", - "sp-std/std", - "xcm/std", - "zenlink-protocol/std", - "orml-oracle/std", -] - -with-bifrost-runtime = [ - "with-bifrost-kusama-runtime", - "with-bifrost-polkadot-runtime", -] -with-bifrost-kusama-runtime = [] -with-bifrost-polkadot-runtime = [] -with-all-runtime = ["with-bifrost-runtime"] -runtime-benchmarks = [] \ No newline at end of file diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 8a60bbbc1..559b97b5f 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -9,17 +9,17 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] jsonrpsee = { version = "0.16.2", features = ["server"] } -node-primitives = { path = "../primitives" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +bifrost-primitives = { path = "../../primitives" } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-flexible-fee-rpc = { path = "../../pallets/flexible-fee/rpc" } bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api" } bifrost-salp-rpc-api = { path = "../../pallets/salp/rpc" } diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 6ad002e81..e9a23b3e5 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -37,13 +37,13 @@ use bifrost_farming_rpc_api::{FarmingRpc, FarmingRpcApiServer}; use bifrost_farming_rpc_runtime_api::FarmingRuntimeApi; use bifrost_flexible_fee_rpc::{FeeRpcApiServer, FlexibleFeeRpc}; use bifrost_flexible_fee_rpc_runtime_api::FlexibleFeeRuntimeApi as FeeRuntimeApi; +use bifrost_primitives::{AccountId, Balance, Block, CurrencyId, Nonce, ParaId, PoolId}; use bifrost_salp_rpc_api::{SalpRpc, SalpRpcApiServer}; use bifrost_salp_rpc_runtime_api::SalpRuntimeApi; use bifrost_stable_pool_rpc_api::{StablePoolRpc, StablePoolRpcApiServer}; use bifrost_stable_pool_rpc_runtime_api::StablePoolRuntimeApi; use bifrost_ve_minting_rpc_api::{VeMintingRpc, VeMintingRpcApiServer}; use bifrost_ve_minting_rpc_runtime_api::VeMintingRuntimeApi; -use node_primitives::{AccountId, Balance, Block, CurrencyId, Nonce, ParaId, PoolId}; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use sc_rpc_api::DenyUnsafe; use sc_transaction_pool_api::TransactionPool; diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 496f3ba85..ce3313de6 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -6,73 +6,77 @@ edition = "2021" [dependencies] # Substrate Client -sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} +sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Substrate Primitives -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-storage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-trie = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # Substrate Pallets -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # Substrate Other -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +try-runtime-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # Cumulus dependencies -cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } color-print = "0.3.4" # Polkadot dependencies -polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } parachain-staking = { path = "../../pallets/parachain-staking", default-features = false } @@ -81,12 +85,13 @@ hex-literal = "0.3.4" serde = { version = "1.0.160", features = ["derive"] } serde_json = "1.0.95" log = '0.4' +futures = "0.3.28" # Runtimes bifrost-runtime-common = { path = "../../runtime/common"} bifrost-kusama-runtime = { path = "../../runtime/bifrost-kusama", optional = true } bifrost-polkadot-runtime = { path = "../../runtime/bifrost-polkadot", optional = true } -node-primitives = { path = "../primitives" } +bifrost-primitives = { path = "../../primitives" } node-rpc = { path = "../rpc" } # RPC related dependencies diff --git a/node/service/src/chain_spec/bifrost_kusama.rs b/node/service/src/chain_spec/bifrost_kusama.rs index 1c93e5498..4cc66f08b 100644 --- a/node/service/src/chain_spec/bifrost_kusama.rs +++ b/node/service/src/chain_spec/bifrost_kusama.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -24,15 +24,15 @@ use std::{ use bifrost_kusama_runtime::{ constants::currency::DOLLARS, AccountId, AssetRegistryConfig, Balance, BalancesConfig, BlockNumber, CouncilConfig, CouncilMembershipConfig, DefaultBlocksPerRound, DemocracyConfig, - GenesisConfig, IndicesConfig, InflationInfo, ParachainInfoConfig, ParachainStakingConfig, - PolkadotXcmConfig, Range, SS58Prefix, SalpConfig, SessionConfig, SystemConfig, + IndicesConfig, InflationInfo, ParachainInfoConfig, ParachainStakingConfig, PolkadotXcmConfig, + Range, RuntimeGenesisConfig, SS58Prefix, SalpConfig, SessionConfig, SystemConfig, TechnicalCommitteeConfig, TechnicalMembershipConfig, TokensConfig, VestingConfig, WASM_BINARY, }; +use bifrost_primitives::{CurrencyId, CurrencyId::*, TokenInfo, TokenSymbol, TokenSymbol::*}; use bifrost_runtime_common::AuraId; use cumulus_primitives_core::ParaId; use frame_benchmarking::{account, whitelisted_caller}; use hex_literal::hex; -use node_primitives::{CurrencyId, CurrencyId::*, TokenInfo, TokenSymbol, TokenSymbol::*}; use sc_chain_spec::Properties; use sc_service::ChainType; @@ -50,7 +50,7 @@ const DEFAULT_PROTOCOL_ID: &str = "bifrost"; use sp_runtime::Perbill; /// Specialized `ChainSpec` for the bifrost runtime. -pub type ChainSpec = sc_service::GenericChainSpec; +pub type ChainSpec = sc_service::GenericChainSpec; #[allow(non_snake_case)] pub fn ENDOWMENT() -> u128 { @@ -128,10 +128,11 @@ pub fn bifrost_genesis( Vec, Vec<(CurrencyId, u32, u32, u32)>, ), -) -> GenesisConfig { - GenesisConfig { +) -> RuntimeGenesisConfig { + RuntimeGenesisConfig { system: SystemConfig { code: WASM_BINARY.expect("WASM binary was not build, please build it!").to_vec(), + _config: Default::default(), }, balances: BalancesConfig { balances }, indices: IndicesConfig { indices: vec![] }, @@ -151,7 +152,7 @@ pub fn bifrost_genesis( }, treasury: Default::default(), phragmen_election: Default::default(), - parachain_info: ParachainInfoConfig { parachain_id: id }, + parachain_info: ParachainInfoConfig { parachain_id: id, _config: Default::default() }, session: SessionConfig { keys: candidates .iter() @@ -176,7 +177,7 @@ pub fn bifrost_genesis( vsbond: asset_registry.2, phantom: Default::default(), }, - polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(2) }, + polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(2), _config: Default::default() }, salp: SalpConfig { initial_multisig_account: Some(salp_multisig_key) }, parachain_staking: ParachainStakingConfig { candidates: candidates @@ -187,10 +188,13 @@ pub fn bifrost_genesis( delegations, inflation_config: inflation_config(), }, + vtoken_voting: Default::default(), + transaction_payment: Default::default(), + zenlink_protocol: Default::default(), } } -fn development_config_genesis(id: ParaId) -> GenesisConfig { +fn development_config_genesis(id: ParaId) -> RuntimeGenesisConfig { let endowed_accounts = vec![ get_account_id_from_seed::("Alice"), whitelisted_caller(), // Benchmarking whitelist_account @@ -253,7 +257,7 @@ pub fn development_config() -> Result { )) } -fn local_config_genesis(id: ParaId) -> GenesisConfig { +fn local_config_genesis(id: ParaId) -> RuntimeGenesisConfig { let endowed_accounts = vec![ get_account_id_from_seed::("Alice"), get_account_id_from_seed::("Bob"), @@ -388,7 +392,7 @@ pub fn local_testnet_config() -> Result { )) } -fn rococo_testnet_config_genesis(id: ParaId) -> GenesisConfig { +fn rococo_testnet_config_genesis(id: ParaId) -> RuntimeGenesisConfig { let invulnerables: Vec<(AccountId, AuraId, Balance)> = vec![ ( // e2s2dTSWe9kHebF2FCbPGbXftDT7fY5AMDfib3j86zSi3v7 @@ -482,7 +486,7 @@ pub fn rococo_testnet_config() -> Result { )) } -fn rococo_local_config_genesis(id: ParaId) -> GenesisConfig { +fn rococo_local_config_genesis(id: ParaId) -> RuntimeGenesisConfig { let endowed_accounts: Vec = vec![ get_account_id_from_seed::("Alice"), get_account_id_from_seed::("Bob"), @@ -559,7 +563,7 @@ pub fn chainspec_config() -> ChainSpec { ) } -fn bifrost_config_genesis(id: ParaId) -> GenesisConfig { +fn bifrost_config_genesis(id: ParaId) -> RuntimeGenesisConfig { let invulnerables: Vec<(AccountId, AuraId, Balance)> = vec![ ( // eunwjK45qDugPXhnjxGUcMbifgdtgefzoW7PgMMpr39AXwh diff --git a/node/service/src/chain_spec/bifrost_polkadot.rs b/node/service/src/chain_spec/bifrost_polkadot.rs index b624a1406..9d7a76d44 100644 --- a/node/service/src/chain_spec/bifrost_polkadot.rs +++ b/node/service/src/chain_spec/bifrost_polkadot.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,15 +18,16 @@ use bifrost_polkadot_runtime::{ constants::currency::DOLLARS, AccountId, AssetRegistryConfig, Balance, BalancesConfig, - BlockNumber, CollatorSelectionConfig, CouncilMembershipConfig, GenesisConfig, IndicesConfig, - ParachainInfoConfig, PolkadotXcmConfig, SS58Prefix, SalpConfig, SessionConfig, SystemConfig, - TechnicalMembershipConfig, TokensConfig, VestingConfig, WASM_BINARY, + BlockNumber, CollatorSelectionConfig, CouncilMembershipConfig, IndicesConfig, + ParachainInfoConfig, PolkadotXcmConfig, RuntimeGenesisConfig, SS58Prefix, SalpConfig, + SessionConfig, SystemConfig, TechnicalMembershipConfig, TokensConfig, VestingConfig, + WASM_BINARY, }; +use bifrost_primitives::{CurrencyId, CurrencyId::*, TokenInfo, TokenSymbol, DOT_TOKEN_ID}; use bifrost_runtime_common::AuraId; use cumulus_primitives_core::ParaId; use frame_benchmarking::{account, whitelisted_caller}; use hex_literal::hex; -use node_primitives::{CurrencyId, CurrencyId::*, TokenInfo, TokenSymbol, DOT_TOKEN_ID}; use sc_chain_spec::Properties; use sc_service::ChainType; use sc_telemetry::TelemetryEndpoints; @@ -39,7 +40,7 @@ use crate::chain_spec::{get_account_id_from_seed, get_from_seed, RelayExtensions const DEFAULT_PROTOCOL_ID: &str = "bifrost_polkadot"; /// Specialized `ChainSpec` for the bifrost-polkadot runtime. -pub type ChainSpec = sc_service::GenericChainSpec; +pub type ChainSpec = sc_service::GenericChainSpec; #[allow(non_snake_case)] pub fn ENDOWMENT() -> u128 { @@ -83,10 +84,11 @@ pub fn bifrost_polkadot_genesis( Vec, Vec<(CurrencyId, u32, u32, u32)>, ), -) -> GenesisConfig { - GenesisConfig { +) -> RuntimeGenesisConfig { + RuntimeGenesisConfig { system: SystemConfig { code: WASM_BINARY.expect("WASM binary was not build, please build it!").to_vec(), + _config: Default::default(), }, balances: BalancesConfig { balances }, indices: IndicesConfig { indices: vec![] }, @@ -103,7 +105,7 @@ pub fn bifrost_polkadot_genesis( technical_committee: Default::default(), treasury: Default::default(), phragmen_election: Default::default(), - parachain_info: ParachainInfoConfig { parachain_id: id }, + parachain_info: ParachainInfoConfig { parachain_id: id, _config: Default::default() }, collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: Zero::zero(), @@ -133,12 +135,15 @@ pub fn bifrost_polkadot_genesis( vsbond: asset_registry.2, phantom: Default::default(), }, - polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(2) }, + polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(2), _config: Default::default() }, salp: SalpConfig { initial_multisig_account: Some(salp_multisig_key) }, + vtoken_voting: Default::default(), + transaction_payment: Default::default(), + zenlink_protocol: Default::default(), } } -fn development_config_genesis(id: ParaId) -> GenesisConfig { +fn development_config_genesis(id: ParaId) -> RuntimeGenesisConfig { let endowed_accounts = vec![ get_account_id_from_seed::("Alice"), whitelisted_caller(), // Benchmarking whitelist_account @@ -190,7 +195,7 @@ pub fn development_config() -> Result { )) } -fn local_config_genesis(id: ParaId) -> GenesisConfig { +fn local_config_genesis(id: ParaId) -> RuntimeGenesisConfig { let endowed_accounts = vec![ get_account_id_from_seed::("Alice"), get_account_id_from_seed::("Bob"), @@ -280,7 +285,7 @@ pub fn chainspec_config() -> ChainSpec { ) } -fn bifrost_polkadot_config_genesis(id: ParaId) -> GenesisConfig { +fn bifrost_polkadot_config_genesis(id: ParaId) -> RuntimeGenesisConfig { let invulnerables: Vec<(AccountId, AuraId)> = vec![ ( // dpEZwz5nHxEjQXcm3sjy6NTz83EGcBRXMBSyuuWSguiVGJB diff --git a/node/service/src/chain_spec/mod.rs b/node/service/src/chain_spec/mod.rs index 3f3959aec..b5a8e00f2 100644 --- a/node/service/src/chain_spec/mod.rs +++ b/node/service/src/chain_spec/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,8 +21,8 @@ pub mod bifrost_kusama; #[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))] pub mod bifrost_polkadot; -pub use node_primitives::{AccountId, Block, Signature}; -use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup}; +pub use bifrost_primitives::{AccountId, Block, Signature}; +use sc_chain_spec::ChainSpecExtension; use serde::{Deserialize, Serialize}; use sp_core::{Pair, Public}; use sp_runtime::traits::{IdentifyAccount, Verify}; @@ -37,16 +37,6 @@ type AccountPublic = ::Signer; /// customizable from the chain spec. #[derive(Default, Clone, Serialize, Deserialize, ChainSpecExtension)] #[serde(rename_all = "camelCase")] -pub struct Extensions { - /// Block numbers with known hashes. - pub fork_blocks: sc_client_api::ForkBlocks, - /// Known bad block hashes. - pub bad_blocks: sc_client_api::BadBlocks, -} - -/// The extensions for the [`ChainSpec`]. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)] -#[serde(deny_unknown_fields)] pub struct RelayExtensions { /// The relay chain of the Parachain. pub relay_chain: String, diff --git a/node/service/src/collator_kusama.rs b/node/service/src/collator_kusama.rs index 26fd0a6d1..08a41fd42 100644 --- a/node/service/src/collator_kusama.rs +++ b/node/service/src/collator_kusama.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -23,26 +23,31 @@ use std::{sync::Arc, time::Duration}; pub use bifrost_kusama_runtime; use bifrost_kusama_runtime::RuntimeApi; use cumulus_client_cli::CollatorOptions; -use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion}; -use cumulus_client_consensus_common::{ - ParachainBlockImport as TParachainBlockImport, ParachainConsensus, +use cumulus_client_collator::service::CollatorService; +use cumulus_client_consensus_aura::collators::basic::{ + self as basic_aura, Params as BasicAuraParams, }; + +use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport; +use cumulus_client_consensus_proposer::Proposer; + +use bifrost_primitives::Block; use cumulus_client_service::{ - build_network, build_relay_chain_interface, prepare_node_config, start_collator, - start_full_node, BuildNetworkParams, StartCollatorParams, StartFullNodeParams, + build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks, + BuildNetworkParams, CollatorSybilResistance, DARecoveryProfile, StartRelayChainTasksParams, }; -use cumulus_primitives_core::ParaId; -use cumulus_relay_chain_interface::RelayChainInterface; -use node_primitives::Block; +use cumulus_primitives_core::{relay_chain::Hash, ParaId}; +use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; +use polkadot_primitives::CollatorPair; +use sc_client_api::backend::Backend; use sc_consensus::{ImportQueue, LongestChain}; use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; use sc_network::NetworkBlock; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; +use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_keystore::KeystorePtr; -use sp_runtime::traits::BlakeTwo256; -use sp_trie::PrefixedMemoryDB; use substrate_prometheus_endpoint::Registry; #[cfg(not(feature = "runtime-benchmarks"))] @@ -80,7 +85,7 @@ pub fn new_partial( FullClient, FullBackend, MaybeFullSelectChain, - sc_consensus::import_queue::BasicQueue>, + sc_consensus::import_queue::BasicQueue, sc_transaction_pool::FullPool, (ParachainBlockImport, Option, Option), >, @@ -173,7 +178,7 @@ fn build_import_queue( config: &Configuration, telemetry: Option, task_manager: &TaskManager, -) -> Result, sc_service::Error> { +) -> Result, sc_service::Error> { let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; cumulus_client_consensus_aura::import_queue::< @@ -204,7 +209,7 @@ fn build_import_queue( .map_err(Into::into) } -fn build_consensus( +fn start_consensus( client: Arc, block_import: ParachainBlockImport, prometheus_registry: Option<&Registry>, @@ -214,9 +219,12 @@ fn build_consensus( transaction_pool: Arc>, sync_oracle: Arc>, keystore: KeystorePtr, - force_authoring: bool, - id: ParaId, -) -> Result>, sc_service::Error> { + relay_chain_slot_duration: Duration, + para_id: ParaId, + collator_key: CollatorPair, + overseer_handle: OverseerHandle, + announce_block: Arc>) + Send + Sync>, +) -> Result<(), sc_service::Error> { let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( @@ -227,50 +235,40 @@ fn build_consensus( telemetry.clone(), ); - let params = BuildAuraConsensusParams { - proposer_factory, - create_inherent_data_providers: move |_, (relay_parent, validation_data)| { - let relay_chain_interface = relay_chain_interface.clone(); - async move { - let parachain_inherent = - cumulus_primitives_parachain_inherent::ParachainInherentData::create_at( - relay_parent, - &relay_chain_interface, - &validation_data, - id, - ) - .await; - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - - let slot = - sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *timestamp, - slot_duration, - ); - - let parachain_inherent = parachain_inherent.ok_or_else(|| { - Box::::from( - "Failed to create parachain inherent", - ) - })?; - Ok((slot, timestamp, parachain_inherent)) - } - }, + let proposer = Proposer::new(proposer_factory); + + let collator_service = CollatorService::new( + client.clone(), + Arc::new(task_manager.spawn_handle()), + announce_block, + client.clone(), + ); + + let params = BasicAuraParams { + create_inherent_data_providers: move |_, ()| async move { Ok(()) }, block_import, para_client: client, - backoff_authoring_blocks: Option::<()>::None, + relay_client: relay_chain_interface, sync_oracle, keystore, - force_authoring, + collator_key, + para_id, + overseer_handle, slot_duration, - // We got around 500ms for proposing - block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32), - // And a maximum of 750ms if slots are skipped - max_block_proposal_slot_portion: Some(SlotProportion::new(1f32 / 16f32)), - telemetry, + relay_chain_slot_duration, + proposer, + collator_service, + // Very limited proposal time. + authoring_duration: Duration::from_millis(500), }; - Ok(AuraConsensus::build::(params)) + let fut = + basic_aura::run::( + params, + ); + task_manager.spawn_essential_handle().spawn("aura", None, fut); + + Ok(()) } /// Start a node with the given parachain `Configuration` and relay chain @@ -283,7 +281,8 @@ async fn start_node_impl( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, - id: ParaId, + sybil_resistance_level: CollatorSybilResistance, + para_id: ParaId, hwbench: Option, ) -> sc_service::error::Result<(TaskManager, Arc)> { let parachain_config = prepare_node_config(parachain_config); @@ -306,29 +305,45 @@ async fn start_node_impl( .await .map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?; - let force_authoring = parachain_config.force_authoring; let validator = parachain_config.role.is_authority(); let prometheus_registry = parachain_config.prometheus_registry().cloned(); let transaction_pool = params.transaction_pool.clone(); let import_queue_service = params.import_queue.service(); + let net_config = sc_network::config::FullNetworkConfiguration::new(¶chain_config.network); let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = build_network(BuildNetworkParams { parachain_config: ¶chain_config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), - para_id: id, + para_id, spawn_handle: task_manager.spawn_handle(), relay_chain_interface: relay_chain_interface.clone(), import_queue: params.import_queue, + sybil_resistance_level, }) .await?; if parachain_config.offchain_worker.enabled { - sc_service::build_offchain_workers( - ¶chain_config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), + use futures::FutureExt; + + task_manager.spawn_handle().spawn( + "offchain-workers-runner", + "offchain-work", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + keystore: Some(params.keystore_container.keystore()), + offchain_db: backend.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: network.clone(), + is_validator: parachain_config.role.is_authority(), + enable_http_requests: false, + custom_extensions: move |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } @@ -385,8 +400,25 @@ async fn start_node_impl( .overseer_handle() .map_err(|e| sc_service::Error::Application(Box::new(e)))?; + start_relay_chain_tasks(StartRelayChainTasksParams { + client: client.clone(), + announce_block: announce_block.clone(), + para_id, + relay_chain_interface: relay_chain_interface.clone(), + task_manager: &mut task_manager, + da_recovery_profile: if validator { + DARecoveryProfile::Collator + } else { + DARecoveryProfile::FullNode + }, + import_queue: import_queue_service, + relay_chain_slot_duration, + recovery_handle: Box::new(overseer_handle.clone()), + sync_service: sync_service.clone(), + })?; + if validator { - let parachain_consensus = build_consensus( + start_consensus( client.clone(), block_import, prometheus_registry.as_ref(), @@ -396,43 +428,12 @@ async fn start_node_impl( transaction_pool, sync_service.clone(), params.keystore_container.keystore(), - force_authoring, - id, - )?; - - let spawner = task_manager.spawn_handle(); - - let params = StartCollatorParams { - para_id: id, - block_status: client.clone(), - announce_block, - client: client.clone(), - task_manager: &mut task_manager, - relay_chain_interface, - spawner, - parachain_consensus, - import_queue: import_queue_service, - collator_key: collator_key.expect("Command line arguments do not allow this. qed"), relay_chain_slot_duration, - recovery_handle: Box::new(overseer_handle), - sync_service, - }; - - start_collator(params).await?; - } else { - let params = StartFullNodeParams { - client: client.clone(), + para_id, + collator_key.expect("Command line arguments do not allow this. qed"), + overseer_handle, announce_block, - task_manager: &mut task_manager, - para_id: id, - relay_chain_interface, - import_queue: import_queue_service, - relay_chain_slot_duration, - recovery_handle: Box::new(overseer_handle), - sync_service, - }; - - start_full_node(params)?; + )?; } start_network.start_network(); @@ -445,8 +446,16 @@ pub async fn start_node( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, - id: ParaId, + para_id: ParaId, hwbench: Option, ) -> sc_service::error::Result<(TaskManager, Arc)> { - start_node_impl(parachain_config, polkadot_config, collator_options, id, hwbench).await + start_node_impl( + parachain_config, + polkadot_config, + collator_options, + CollatorSybilResistance::Resistant, + para_id, + hwbench, + ) + .await } diff --git a/node/service/src/collator_polkadot.rs b/node/service/src/collator_polkadot.rs index 75687a3f5..84fc56724 100644 --- a/node/service/src/collator_polkadot.rs +++ b/node/service/src/collator_polkadot.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -23,26 +23,31 @@ use std::{sync::Arc, time::Duration}; pub use bifrost_polkadot_runtime; use bifrost_polkadot_runtime::RuntimeApi; use cumulus_client_cli::CollatorOptions; -use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion}; -use cumulus_client_consensus_common::{ - ParachainBlockImport as TParachainBlockImport, ParachainConsensus, +use cumulus_client_collator::service::CollatorService; +use cumulus_client_consensus_aura::collators::basic::{ + self as basic_aura, Params as BasicAuraParams, }; + +use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport; +use cumulus_client_consensus_proposer::Proposer; + +use bifrost_primitives::Block; use cumulus_client_service::{ - build_network, build_relay_chain_interface, prepare_node_config, start_collator, - start_full_node, BuildNetworkParams, StartCollatorParams, StartFullNodeParams, + build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks, + BuildNetworkParams, CollatorSybilResistance, DARecoveryProfile, StartRelayChainTasksParams, }; -use cumulus_primitives_core::ParaId; -use cumulus_relay_chain_interface::RelayChainInterface; -use node_primitives::Block; +use cumulus_primitives_core::{relay_chain::Hash, ParaId}; +use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; +use polkadot_primitives::CollatorPair; +use sc_client_api::backend::Backend; use sc_consensus::{ImportQueue, LongestChain}; use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; use sc_network::NetworkBlock; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; +use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_keystore::KeystorePtr; -use sp_runtime::traits::BlakeTwo256; -use sp_trie::PrefixedMemoryDB; use substrate_prometheus_endpoint::Registry; #[cfg(not(feature = "runtime-benchmarks"))] @@ -80,7 +85,7 @@ pub fn new_partial( FullClient, FullBackend, MaybeFullSelectChain, - sc_consensus::import_queue::BasicQueue>, + sc_consensus::import_queue::BasicQueue, sc_transaction_pool::FullPool, (ParachainBlockImport, Option, Option), >, @@ -173,7 +178,7 @@ fn build_import_queue( config: &Configuration, telemetry: Option, task_manager: &TaskManager, -) -> Result, sc_service::Error> { +) -> Result, sc_service::Error> { let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; cumulus_client_consensus_aura::import_queue::< @@ -204,7 +209,7 @@ fn build_import_queue( .map_err(Into::into) } -fn build_consensus( +fn start_consensus( client: Arc, block_import: ParachainBlockImport, prometheus_registry: Option<&Registry>, @@ -214,9 +219,12 @@ fn build_consensus( transaction_pool: Arc>, sync_oracle: Arc>, keystore: KeystorePtr, - force_authoring: bool, - id: ParaId, -) -> Result>, sc_service::Error> { + relay_chain_slot_duration: Duration, + para_id: ParaId, + collator_key: CollatorPair, + overseer_handle: OverseerHandle, + announce_block: Arc>) + Send + Sync>, +) -> Result<(), sc_service::Error> { let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( @@ -227,50 +235,40 @@ fn build_consensus( telemetry.clone(), ); - let params = BuildAuraConsensusParams { - proposer_factory, - create_inherent_data_providers: move |_, (relay_parent, validation_data)| { - let relay_chain_interface = relay_chain_interface.clone(); - async move { - let parachain_inherent = - cumulus_primitives_parachain_inherent::ParachainInherentData::create_at( - relay_parent, - &relay_chain_interface, - &validation_data, - id, - ) - .await; - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - - let slot = - sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *timestamp, - slot_duration, - ); - - let parachain_inherent = parachain_inherent.ok_or_else(|| { - Box::::from( - "Failed to create parachain inherent", - ) - })?; - Ok((slot, timestamp, parachain_inherent)) - } - }, + let proposer = Proposer::new(proposer_factory); + + let collator_service = CollatorService::new( + client.clone(), + Arc::new(task_manager.spawn_handle()), + announce_block, + client.clone(), + ); + + let params = BasicAuraParams { + create_inherent_data_providers: move |_, ()| async move { Ok(()) }, block_import, para_client: client, - backoff_authoring_blocks: Option::<()>::None, + relay_client: relay_chain_interface, sync_oracle, keystore, - force_authoring, + collator_key, + para_id, + overseer_handle, slot_duration, - // We got around 500ms for proposing - block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32), - // And a maximum of 750ms if slots are skipped - max_block_proposal_slot_portion: Some(SlotProportion::new(1f32 / 16f32)), - telemetry, + relay_chain_slot_duration, + proposer, + collator_service, + // Very limited proposal time. + authoring_duration: Duration::from_millis(500), }; - Ok(AuraConsensus::build::(params)) + let fut = + basic_aura::run::( + params, + ); + task_manager.spawn_essential_handle().spawn("aura", None, fut); + + Ok(()) } /// Start a node with the given parachain `Configuration` and relay chain @@ -283,7 +281,8 @@ async fn start_node_impl( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, - id: ParaId, + sybil_resistance_level: CollatorSybilResistance, + para_id: ParaId, hwbench: Option, ) -> sc_service::error::Result<(TaskManager, Arc)> { let parachain_config = prepare_node_config(parachain_config); @@ -306,29 +305,45 @@ async fn start_node_impl( .await .map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?; - let force_authoring = parachain_config.force_authoring; let validator = parachain_config.role.is_authority(); let prometheus_registry = parachain_config.prometheus_registry().cloned(); let transaction_pool = params.transaction_pool.clone(); let import_queue_service = params.import_queue.service(); + let net_config = sc_network::config::FullNetworkConfiguration::new(¶chain_config.network); let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = build_network(BuildNetworkParams { parachain_config: ¶chain_config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), - para_id: id, + para_id, spawn_handle: task_manager.spawn_handle(), relay_chain_interface: relay_chain_interface.clone(), import_queue: params.import_queue, + sybil_resistance_level, }) .await?; if parachain_config.offchain_worker.enabled { - sc_service::build_offchain_workers( - ¶chain_config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), + use futures::FutureExt; + + task_manager.spawn_handle().spawn( + "offchain-workers-runner", + "offchain-work", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + keystore: Some(params.keystore_container.keystore()), + offchain_db: backend.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: network.clone(), + is_validator: parachain_config.role.is_authority(), + enable_http_requests: false, + custom_extensions: move |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } @@ -385,8 +400,25 @@ async fn start_node_impl( .overseer_handle() .map_err(|e| sc_service::Error::Application(Box::new(e)))?; + start_relay_chain_tasks(StartRelayChainTasksParams { + client: client.clone(), + announce_block: announce_block.clone(), + para_id, + relay_chain_interface: relay_chain_interface.clone(), + task_manager: &mut task_manager, + da_recovery_profile: if validator { + DARecoveryProfile::Collator + } else { + DARecoveryProfile::FullNode + }, + import_queue: import_queue_service, + relay_chain_slot_duration, + recovery_handle: Box::new(overseer_handle.clone()), + sync_service: sync_service.clone(), + })?; + if validator { - let parachain_consensus = build_consensus( + start_consensus( client.clone(), block_import, prometheus_registry.as_ref(), @@ -396,43 +428,12 @@ async fn start_node_impl( transaction_pool, sync_service.clone(), params.keystore_container.keystore(), - force_authoring, - id, - )?; - - let spawner = task_manager.spawn_handle(); - - let params = StartCollatorParams { - para_id: id, - block_status: client.clone(), - announce_block, - client: client.clone(), - task_manager: &mut task_manager, - relay_chain_interface, - spawner, - parachain_consensus, - import_queue: import_queue_service, - collator_key: collator_key.expect("Command line arguments do not allow this. qed"), relay_chain_slot_duration, - recovery_handle: Box::new(overseer_handle), - sync_service, - }; - - start_collator(params).await?; - } else { - let params = StartFullNodeParams { - client: client.clone(), + para_id, + collator_key.expect("Command line arguments do not allow this. qed"), + overseer_handle, announce_block, - task_manager: &mut task_manager, - para_id: id, - relay_chain_interface, - import_queue: import_queue_service, - relay_chain_slot_duration, - recovery_handle: Box::new(overseer_handle), - sync_service, - }; - - start_full_node(params)?; + )?; } start_network.start_network(); @@ -445,8 +446,16 @@ pub async fn start_node( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, - id: ParaId, + para_id: ParaId, hwbench: Option, ) -> sc_service::error::Result<(TaskManager, Arc)> { - start_node_impl(parachain_config, polkadot_config, collator_options, id, hwbench).await + start_node_impl( + parachain_config, + polkadot_config, + collator_options, + CollatorSybilResistance::Resistant, + para_id, + hwbench, + ) + .await } diff --git a/node/service/src/dev.rs b/node/service/src/dev.rs index b4611af34..c4605d55f 100644 --- a/node/service/src/dev.rs +++ b/node/service/src/dev.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -23,7 +23,7 @@ use futures::StreamExt; use sc_executor::NativeElseWasmExecutor; use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; -pub type Block = node_primitives::Block; +pub type Block = bifrost_primitives::Block; pub type Executor = crate::collator_kusama::BifrostExecutor; pub type RuntimeApi = crate::collator_kusama::bifrost_kusama_runtime::RuntimeApi; pub type FullClient = diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 76162c26e..a476b362a 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/asset-registry/Cargo.toml b/pallets/asset-registry/Cargo.toml index a63a6d64b..eafa2b57b 100644 --- a/pallets/asset-registry/Cargo.toml +++ b/pallets/asset-registry/Cargo.toml @@ -7,22 +7,22 @@ edition = "2021" [dependencies] log = { version = "0.4.17", default-features = false } serde = { version = "1.0.160", optional = true } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -primitives = { package = "node-primitives", path = "../../node/primitives", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +bifrost-primitives = { path = "../../primitives", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] @@ -36,7 +36,7 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking?/std", - "primitives/std", + "bifrost-primitives/std", "xcm/std", "xcm-builder/std", "xcm-executor/std", diff --git a/pallets/asset-registry/src/benchmarking.rs b/pallets/asset-registry/src/benchmarking.rs index e9bcb4338..2bc375dd5 100644 --- a/pallets/asset-registry/src/benchmarking.rs +++ b/pallets/asset-registry/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,9 +20,9 @@ use super::*; use crate::Pallet as AssetRegistry; +use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_benchmarking::{benchmarks, v1::BenchmarkError}; -use frame_support::{assert_ok, dispatch::UnfilteredDispatchable}; -use primitives::{CurrencyId, TokenSymbol}; +use frame_support::{assert_ok, traits::UnfilteredDispatchable}; use sp_runtime::traits::UniqueSaturatedFrom; use xcm::v3::prelude::*; diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index 98254390e..8ab32138f 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -22,31 +22,31 @@ #![cfg_attr(not(feature = "std"), no_std)] +use bifrost_primitives::{ + AssetIds, CurrencyId, + CurrencyId::{Native, Token, Token2}, + CurrencyIdConversion, CurrencyIdMapping, CurrencyIdRegister, ForeignAssetId, LeasePeriod, + ParaId, PoolId, TokenId, TokenInfo, TokenSymbol, +}; use frame_support::{ dispatch::DispatchResult, ensure, pallet_prelude::*, traits::{Currency, EnsureOrigin}, weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight}, - RuntimeDebug, }; use frame_system::pallet_prelude::*; -use primitives::{ - AssetIds, CurrencyId, - CurrencyId::{Native, Token, Token2}, - CurrencyIdConversion, CurrencyIdMapping, CurrencyIdRegister, ForeignAssetId, LeasePeriod, - ParaId, PoolId, TokenId, TokenInfo, TokenSymbol, -}; -use scale_info::TypeInfo; +use scale_info::{prelude::string::String, TypeInfo}; use sp_runtime::{ traits::{One, UniqueSaturatedFrom}, - ArithmeticError, FixedPointNumber, FixedU128, + ArithmeticError, FixedPointNumber, FixedU128, RuntimeDebug, }; use sp_std::{boxed::Box, vec::Vec}; -// NOTE:v1::MultiLocation is used in storages, we would need to do migration if upgrade the -// MultiLocation in the future. use xcm::{ - opaque::v3::{prelude::XcmError, AssetId, Fungibility::Fungible, MultiAsset}, + opaque::{ + lts::XcmContext, + v3::{prelude::XcmError, AssetId, Fungibility::Fungible, MultiAsset}, + }, v3::MultiLocation, VersionedMultiLocation, }; @@ -177,6 +177,7 @@ pub mod pallet { StorageMap<_, Twox64Concat, CurrencyId, AssetMetadata>, OptionQuery>; #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig { pub currency: Vec<(CurrencyId, BalanceOf, Option<(String, String, u8)>)>, pub vcurrency: Vec, @@ -184,20 +185,8 @@ pub mod pallet { pub phantom: PhantomData, } - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - GenesisConfig { - currency: Default::default(), - vcurrency: Default::default(), - vsbond: Default::default(), - phantom: PhantomData, - } - } - } - #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { for (currency_id, metadata) in self.currency.iter().map(|(currency_id, minimal_balance, metadata)| { @@ -883,7 +872,12 @@ where } } - fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { + fn buy_weight( + &mut self, + weight: Weight, + payment: Assets, + _context: &XcmContext, + ) -> Result { log::trace!(target: "asset-registry::weight", "buy_weight weight: {:?}, payment: {:?}", weight, payment); // only support first fungible assets now. @@ -934,7 +928,7 @@ where Err(XcmError::TooExpensive) } - fn refund_weight(&mut self, weight: Weight) -> Option { + fn refund_weight(&mut self, weight: Weight, _context: &XcmContext) -> Option { log::trace!( target: "asset-registry::weight", "refund_weight weight: {:?}, weight: {:?}, amount: {:?}, ed_ratio: {:?}, multi_location: {:?}", weight, self.weight, self.amount, self.ed_ratio, self.multi_location diff --git a/pallets/asset-registry/src/migration.rs b/pallets/asset-registry/src/migration.rs index b8c7c149a..560582a31 100644 --- a/pallets/asset-registry/src/migration.rs +++ b/pallets/asset-registry/src/migration.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -16,11 +16,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#![cfg_attr(not(feature = "std"), no_std)] - use super::{AssetMetadata, Config, CurrencyMetadatas, Weight}; +use bifrost_primitives::CurrencyId; use frame_support::traits::Get; -use primitives::CurrencyId; pub fn update_blp_metadata(pool_count: u32) -> Weight { for pool_id in 0..pool_count { diff --git a/pallets/asset-registry/src/mock.rs b/pallets/asset-registry/src/mock.rs index ed02d1926..855f4c3ea 100644 --- a/pallets/asset-registry/src/mock.rs +++ b/pallets/asset-registry/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,12 +20,13 @@ #![cfg(test)] +use bifrost_primitives::{AccountId, Balance}; use frame_support::{ construct_runtime, ord_parameter_types, pallet_prelude::ConstU32, parameter_types, traits::Everything, }; use frame_system::EnsureSignedBy; -use primitives::{AccountId, Balance}; +use sp_runtime::BuildStorage; use crate as asset_registry; @@ -36,14 +37,13 @@ parameter_types!( impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = u64; + type Nonce = u32; + type Block = Block; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; type Hashing = sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = sp_runtime::traits::IdentityLookup; - type Header = sp_runtime::testing::Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); @@ -74,7 +74,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -90,18 +90,13 @@ impl asset_registry::Config for Runtime { type WeightInfo = (); } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - System: frame_system::{Pallet, Call, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - AssetRegistry: asset_registry::{Pallet, Call, Event, Storage}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + AssetRegistry: asset_registry, } ); @@ -117,7 +112,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self.balances.into_iter().collect::>(), diff --git a/pallets/asset-registry/src/tests.rs b/pallets/asset-registry/src/tests.rs index 6ff166c56..cfae30dd6 100644 --- a/pallets/asset-registry/src/tests.rs +++ b/pallets/asset-registry/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,11 +21,11 @@ #![cfg(test)] use super::*; +use bifrost_primitives::TokenSymbol; use frame_support::{assert_noop, assert_ok}; use mock::{ AssetRegistry, CouncilAccount, ExtBuilder, Runtime, RuntimeEvent, RuntimeOrigin, System, }; -use primitives::TokenSymbol; use xcm::prelude::*; #[test] diff --git a/pallets/asset-registry/src/weights.rs b/pallets/asset-registry/src/weights.rs index 4d5a56813..de8544355 100644 --- a/pallets/asset-registry/src/weights.rs +++ b/pallets/asset-registry/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/call-switchgear/Cargo.toml b/pallets/call-switchgear/Cargo.toml index be03a0937..5bddb400d 100644 --- a/pallets/call-switchgear/Cargo.toml +++ b/pallets/call-switchgear/Cargo.toml @@ -6,20 +6,20 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } [dev-dependencies] orml-traits = "0.4.1-dev" orml-tokens = "0.4.1-dev" -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] @@ -32,7 +32,7 @@ std = [ "sp-io/std", "sp-std/std", "scale-info/std", - "node-primitives/std", + "bifrost-primitives/std", ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/call-switchgear/src/benchmarking.rs b/pallets/call-switchgear/src/benchmarking.rs index c4c1eb299..7cc83cc0c 100644 --- a/pallets/call-switchgear/src/benchmarking.rs +++ b/pallets/call-switchgear/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,9 +18,9 @@ #![cfg(feature = "runtime-benchmarks")] +use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_benchmarking::{benchmarks, v1::BenchmarkError}; -use frame_support::dispatch::UnfilteredDispatchable; -use node_primitives::{CurrencyId, TokenSymbol}; +use frame_support::traits::UnfilteredDispatchable; use super::*; #[allow(unused_imports)] diff --git a/pallets/call-switchgear/src/lib.rs b/pallets/call-switchgear/src/lib.rs index 1d214cc1b..cb1bb8b92 100644 --- a/pallets/call-switchgear/src/lib.rs +++ b/pallets/call-switchgear/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,13 +20,12 @@ extern crate alloc; +use bifrost_primitives::CurrencyId; use frame_support::{ - dispatch::{CallMetadata, GetCallMetadata}, pallet_prelude::*, - traits::{Contains, PalletInfoAccess}, + traits::{CallMetadata, Contains, GetCallMetadata, PalletInfoAccess}, }; use frame_system::pallet_prelude::*; -use node_primitives::CurrencyId; use sp_runtime::DispatchResult; use sp_std::prelude::*; @@ -100,7 +99,7 @@ pub mod pallet { pub struct Pallet(_); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet { diff --git a/pallets/call-switchgear/src/mock.rs b/pallets/call-switchgear/src/mock.rs index 3ae77a325..a26f75b5a 100644 --- a/pallets/call-switchgear/src/mock.rs +++ b/pallets/call-switchgear/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,12 +18,12 @@ #![cfg(test)] +use bifrost_primitives::{Amount, Balance, CurrencyId}; use frame_support::{construct_runtime, ord_parameter_types, parameter_types}; use frame_system::EnsureSignedBy; -use node_primitives::{Amount, Balance, CurrencyId}; use orml_traits::parameter_type_with_key; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup}; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; use super::*; @@ -38,14 +38,13 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = u64; + type Nonce = u32; + type Block = Block; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); @@ -78,7 +77,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = MaxReserves; type ReserveIdentifier = (); type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -114,19 +113,14 @@ impl Config for Runtime { type WeightInfo = (); } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - CallSwitchgear: bifrost_call_switchgear::{Pallet, Storage, Call, Event}, - Balances: pallet_balances::{Pallet, Storage, Call, Event}, - Tokens: orml_tokens::{Pallet, Storage, Call, Event}, + pub enum Runtime { + System: frame_system, + CallSwitchgear: bifrost_call_switchgear, + Balances: pallet_balances, + Tokens: orml_tokens, } ); @@ -140,7 +134,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let t = frame_system::GenesisConfig::::default().build_storage().unwrap(); t.into() } diff --git a/pallets/call-switchgear/src/tests.rs b/pallets/call-switchgear/src/tests.rs index 36e874a5c..0e3e4490b 100644 --- a/pallets/call-switchgear/src/tests.rs +++ b/pallets/call-switchgear/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,9 +18,9 @@ #![cfg(test)] +use bifrost_primitives::currency::KSM; use frame_support::{assert_noop, assert_ok}; use mock::{RuntimeEvent, *}; -use node_primitives::currency::KSM; use sp_runtime::traits::BadOrigin; use super::*; @@ -36,7 +36,7 @@ const TOKENS_TRANSFER: &::RuntimeCall = #[test] fn switchoff_transaction_should_work() { - ExtBuilder::default().build().execute_with(|| { + ExtBuilder.build().execute_with(|| { System::set_block_number(1); assert_noop!( @@ -97,7 +97,7 @@ fn switchoff_transaction_should_work() { #[test] fn switchon_transaction_transaction_should_work() { - ExtBuilder::default().build().execute_with(|| { + ExtBuilder.build().execute_with(|| { System::set_block_number(1); assert_ok!(CallSwitchgear::switchoff_transaction( @@ -160,7 +160,7 @@ fn switchon_transaction_transaction_should_work() { #[test] fn switchoff_transaction_filter_work() { - ExtBuilder::default().build().execute_with(|| { + ExtBuilder.build().execute_with(|| { assert!(!SwitchOffTransactionFilter::::contains(BALANCE_TRANSFER)); assert!(!SwitchOffTransactionFilter::::contains(TOKENS_TRANSFER)); assert_ok!(CallSwitchgear::switchoff_transaction( @@ -192,7 +192,7 @@ fn switchoff_transaction_filter_work() { #[test] fn disable_transfers_filter_should_work() { - ExtBuilder::default().build().execute_with(|| { + ExtBuilder.build().execute_with(|| { assert!(!DisableTransfersFilter::::contains(&KSM)); assert_ok!(CallSwitchgear::disable_transfers(RuntimeOrigin::signed(1), KSM)); assert!(DisableTransfersFilter::::contains(&KSM)); diff --git a/pallets/call-switchgear/src/weights.rs b/pallets/call-switchgear/src/weights.rs index ef73315fe..31b33b7f9 100644 --- a/pallets/call-switchgear/src/weights.rs +++ b/pallets/call-switchgear/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/cross-in-out/Cargo.toml b/pallets/cross-in-out/Cargo.toml index 54f8fd496..00c1eaa6c 100644 --- a/pallets/cross-in-out/Cargo.toml +++ b/pallets/cross-in-out/Cargo.toml @@ -8,25 +8,25 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -scale-info = { version = "2.3.1", default-features = false, features = [ +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -node-primitives = { path = "../../node/primitives", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } log = { version = "0.4.17", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } orml-tokens = { version = "0.4.1-dev" } -bifrost-currencies = { workspace = true } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [features] default = ["std"] @@ -35,7 +35,7 @@ std = [ "scale-info/std", "sp-std/std", "sp-runtime/std", - "node-primitives/std", + "bifrost-primitives/std", "frame-support/std", "frame-system/std", "frame-benchmarking?/std", diff --git a/pallets/cross-in-out/src/benchmarking.rs b/pallets/cross-in-out/src/benchmarking.rs index a86879fc0..3130940da 100644 --- a/pallets/cross-in-out/src/benchmarking.rs +++ b/pallets/cross-in-out/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,10 +20,10 @@ #![cfg(feature = "runtime-benchmarks")] +use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_benchmarking::v1::{account, benchmarks, whitelisted_caller, BenchmarkError}; use frame_support::assert_ok; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, TokenSymbol}; use sp_runtime::traits::UniqueSaturatedFrom; use xcm::v2::prelude::*; diff --git a/pallets/cross-in-out/src/lib.rs b/pallets/cross-in-out/src/lib.rs index 8a336cc8d..1a14206b0 100644 --- a/pallets/cross-in-out/src/lib.rs +++ b/pallets/cross-in-out/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -23,9 +23,9 @@ extern crate alloc; use alloc::{vec, vec::Vec}; +use bifrost_primitives::CurrencyId; use frame_support::{ensure, pallet_prelude::*, sp_runtime::traits::AccountIdConversion, PalletId}; use frame_system::pallet_prelude::*; -use node_primitives::CurrencyId; use orml_traits::MultiCurrency; use sp_std::boxed::Box; pub use weights::WeightInfo; @@ -195,7 +195,7 @@ pub mod pallet { pub struct Pallet(PhantomData); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet { diff --git a/pallets/cross-in-out/src/migrations/mod.rs b/pallets/cross-in-out/src/migrations/mod.rs index fea2101e5..504be9301 100644 --- a/pallets/cross-in-out/src/migrations/mod.rs +++ b/pallets/cross-in-out/src/migrations/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/cross-in-out/src/migrations/v2.rs b/pallets/cross-in-out/src/migrations/v2.rs index 5e11a707b..a24126cd2 100644 --- a/pallets/cross-in-out/src/migrations/v2.rs +++ b/pallets/cross-in-out/src/migrations/v2.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,6 +19,8 @@ use crate::*; use alloc::vec::Vec; use frame_support::traits::OnRuntimeUpgrade; +#[cfg(feature = "try-runtime")] +use sp_runtime::TryRuntimeError; const LOG_TARGET: &str = "cross-in-out::migration"; @@ -61,7 +63,7 @@ impl OnRuntimeUpgrade for CrossInOutMigration { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, TryRuntimeError> { let cnt = IssueWhiteList::::iter().count(); // print out the pre-migrate storage count log::info!(target: LOG_TARGET, "IssueWhiteList pre-migrate storage count: {:?}", cnt); @@ -69,7 +71,7 @@ impl OnRuntimeUpgrade for CrossInOutMigration { } #[cfg(feature = "try-runtime")] - fn post_upgrade(cnt: Vec) -> Result<(), &'static str> { + fn post_upgrade(cnt: Vec) -> Result<(), TryRuntimeError> { let new_count = IssueWhiteList::::iter().count(); let old_count: u64 = Decode::decode(&mut cnt.as_slice()) diff --git a/pallets/cross-in-out/src/mock.rs b/pallets/cross-in-out/src/mock.rs index 8cbe0c77e..c5ddbb641 100644 --- a/pallets/cross-in-out/src/mock.rs +++ b/pallets/cross-in-out/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,21 +19,16 @@ #![cfg(test)] #![allow(non_upper_case_globals)] -use frame_support::{ - ord_parameter_types, parameter_types, - traits::{GenesisBuild, Nothing}, - PalletId, -}; -use frame_system::EnsureSignedBy; -use node_primitives::{ +use bifrost_primitives::{ currency::{BNC, DOT, KSM, VDOT}, CurrencyId, TokenSymbol, }; +use frame_support::{ord_parameter_types, parameter_types, traits::Nothing, PalletId}; +use frame_system::EnsureSignedBy; use sp_core::{ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{AccountIdConversion, BlakeTwo256, IdentityLookup}, - AccountId32, + AccountId32, BuildStorage, }; use crate as bifrost_cross_in_out; @@ -49,20 +44,15 @@ pub const BOB: AccountId = AccountId32::new([1u8; 32]); pub const CHARLIE: AccountId = AccountId32::new([3u8; 32]); frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - CrossInOut: bifrost_cross_in_out::{Pallet, Call, Storage, Event} + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + Balances: pallet_balances, + Currencies: bifrost_currencies, + CrossInOut: bifrost_cross_in_out } ); -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -74,15 +64,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -123,7 +112,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -199,7 +188,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/cross-in-out/src/tests.rs b/pallets/cross-in-out/src/tests.rs index cc047d62e..2a7e8b836 100644 --- a/pallets/cross-in-out/src/tests.rs +++ b/pallets/cross-in-out/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,8 +19,8 @@ #![cfg(test)] use crate::{mock::*, *}; +use bifrost_primitives::currency::KSM; use frame_support::{assert_noop, assert_ok, WeakBoundedVec}; -use node_primitives::currency::KSM; use sp_runtime::DispatchError::BadOrigin; use xcm::opaque::v2::{Junction, Junctions::X1}; diff --git a/pallets/cross-in-out/src/weights.rs b/pallets/cross-in-out/src/weights.rs index c6b33e419..bb190417d 100644 --- a/pallets/cross-in-out/src/weights.rs +++ b/pallets/cross-in-out/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/currencies/Cargo.toml b/pallets/currencies/Cargo.toml index c68c06c48..1c1a56f5f 100644 --- a/pallets/currencies/Cargo.toml +++ b/pallets/currencies/Cargo.toml @@ -9,21 +9,21 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } serde = { version = "1.0.160", optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.42" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.42" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.42" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.42" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false , branch = "release-polkadot-v1.1.0" } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false , branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false , branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false , branch = "release-polkadot-v1.1.0" } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false , branch = "release-polkadot-v1.1.0" } orml-traits = { version = "0.4.1-dev", default-features = false } orml-utilities = { version = "0.4.1-dev", default-features = false } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } orml-tokens = { version = "0.4.1-dev", default-features = false } diff --git a/pallets/currencies/src/lib.rs b/pallets/currencies/src/lib.rs index 238e0b14c..3be077f6f 100644 --- a/pallets/currencies/src/lib.rs +++ b/pallets/currencies/src/lib.rs @@ -144,7 +144,7 @@ pub mod module { pub struct Pallet(_); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet { @@ -335,7 +335,7 @@ impl MultiCurrencyExtended for Pallet { } impl MultiLockableCurrency for Pallet { - type Moment = T::BlockNumber; + type Moment = BlockNumberFor; fn set_lock( lock_id: LockIdentifier, @@ -777,7 +777,7 @@ where T: Config, GetCurrencyId: Get>, { - type Moment = T::BlockNumber; + type Moment = BlockNumberFor; fn set_lock( lock_id: LockIdentifier, @@ -1027,7 +1027,7 @@ where + MaybeSerializeDeserialize + Debug + Default - + codec::MaxEncodedLen, + + MaxEncodedLen, Currency: PalletCurrency, T: Config, { diff --git a/pallets/currencies/src/mock.rs b/pallets/currencies/src/mock.rs index 9cac9eaaa..3480f5c69 100644 --- a/pallets/currencies/src/mock.rs +++ b/pallets/currencies/src/mock.rs @@ -11,9 +11,8 @@ use frame_support::{ use orml_traits::{currency::MutationHooks, parameter_type_with_key}; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{AccountIdConversion, IdentityLookup}, - AccountId32, + AccountId32, BuildStorage, }; use crate as currencies; @@ -24,13 +23,12 @@ pub type AccountId = AccountId32; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u32; + type Block = Block; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -61,10 +59,10 @@ impl pallet_balances::Config for Runtime { type MaxReserves = ConstU32<2>; type ReserveIdentifier = ReserveIdentifier; type WeightInfo = (); - type HoldIdentifier = [u8; 8]; type FreezeIdentifier = [u8; 8]; type MaxHolds = (); type MaxFreezes = (); + type RuntimeHoldReason = (); } parameter_type_with_key! { @@ -123,19 +121,14 @@ impl Config for Runtime { pub type NativeCurrency = NativeCurrencyOf; pub type AdaptedBasicCurrency = BasicCurrencyAdapter; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Currencies: currencies::{Pallet, Call}, - Tokens: orml_tokens::{Pallet, Storage, Event, Config}, - PalletBalances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + pub enum Runtime { + System: frame_system, + Currencies: currencies, + Tokens: orml_tokens, + PalletBalances: pallet_balances, } ); @@ -167,7 +160,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/farming/Cargo.toml b/pallets/farming/Cargo.toml index da3c05ee5..7e9c62b7e 100644 --- a/pallets/farming/Cargo.toml +++ b/pallets/farming/Cargo.toml @@ -9,27 +9,27 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -node-primitives = { path = "../../node/primitives", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -hex-literal = { version = "0.3.1" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +hex-literal = { version = "0.4.1" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } bifrost-ve-minting = { path = "../../pallets/ve-minting", default-features = false } log = { version = "0.4.17", default-features = false } [dev-dependencies] orml-tokens = "0.4.1-dev" -bifrost-currencies = { workspace = true } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-ve-minting = { path = "../../pallets/ve-minting", default-features = false } bifrost-asset-registry = { path = "../asset-registry", default-features = false } bifrost-runtime-common = { package = "bifrost-runtime-common", path = "../../runtime/common", default-features = false } @@ -43,7 +43,7 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking/std", - "node-primitives/std", + "bifrost-primitives/std", "bifrost-asset-registry/std", "bifrost-runtime-common/std", "log/std", diff --git a/pallets/farming/rpc/Cargo.toml b/pallets/farming/rpc/Cargo.toml index b6dbf2181..2a942f64e 100644 --- a/pallets/farming/rpc/Cargo.toml +++ b/pallets/farming/rpc/Cargo.toml @@ -8,10 +8,10 @@ edition = "2021" serde = { version = "1.0.140", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server", "macros"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -node-primitives = { path = "../../../node/primitives", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bifrost-primitives = { path = "../../../primitives", default-features = false } bifrost-farming-rpc-runtime-api = { path = "./runtime-api" } diff --git a/pallets/farming/rpc/runtime-api/Cargo.toml b/pallets/farming/rpc/runtime-api/Cargo.toml index 68a248c7e..a5302298c 100644 --- a/pallets/farming/rpc/runtime-api/Cargo.toml +++ b/pallets/farming/rpc/runtime-api/Cargo.toml @@ -6,14 +6,14 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../../../node/primitives", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../../../primitives", default-features = false } [features] default = ["std"] std = [ "codec/std", "sp-api/std", - "node-primitives/std", + "bifrost-primitives/std", ] diff --git a/pallets/farming/rpc/runtime-api/src/lib.rs b/pallets/farming/rpc/runtime-api/src/lib.rs index 34188be13..e5e844ff3 100644 --- a/pallets/farming/rpc/runtime-api/src/lib.rs +++ b/pallets/farming/rpc/runtime-api/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,8 +18,8 @@ #![cfg_attr(not(feature = "std"), no_std)] +use bifrost_primitives::{Balance, CurrencyId}; use codec::Codec; -use node_primitives::{Balance, CurrencyId}; use sp_api::decl_runtime_apis; use sp_std::vec::Vec; diff --git a/pallets/farming/rpc/src/lib.rs b/pallets/farming/rpc/src/lib.rs index 1d854ba07..3afa0a2f7 100644 --- a/pallets/farming/rpc/src/lib.rs +++ b/pallets/farming/rpc/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,13 +19,13 @@ use std::{marker::PhantomData, sync::Arc}; pub use bifrost_farming_rpc_runtime_api::{self as runtime_api, FarmingRuntimeApi}; +use bifrost_primitives::{Balance, CurrencyId}; use codec::Codec; use jsonrpsee::{ core::{async_trait, RpcResult}, proc_macros::rpc, types::error::{CallError, ErrorCode, ErrorObject}, }; -use node_primitives::{Balance, CurrencyId}; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_rpc::number::NumberOrHex; diff --git a/pallets/farming/src/benchmarking.rs b/pallets/farming/src/benchmarking.rs index db46b280c..f2eb7f575 100644 --- a/pallets/farming/src/benchmarking.rs +++ b/pallets/farming/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,15 +19,16 @@ // Ensure we're `no_std` when compiling for Wasm. #![cfg(feature = "runtime-benchmarks")] -use frame_benchmarking::{benchmarks, vec, whitelisted_caller}; +use bifrost_primitives::{CurrencyId, TokenSymbol}; +use frame_benchmarking::{benchmarks, whitelisted_caller}; use frame_support::{assert_ok, sp_runtime::traits::UniqueSaturatedFrom}; use frame_system::{Pallet as System, RawOrigin}; -use node_primitives::{CurrencyId, TokenSymbol}; +use sp_std::vec; use crate::{Pallet as Farming, *}; benchmarks! { - on_initialize {}:{Farming::::on_initialize(T::BlockNumber::from(10u32));} + on_initialize {}:{Farming::::on_initialize(BlockNumberFor::::from(10u32));} create_farming_pool { let token_amount = BalanceOf::::unique_saturated_from(1000u128); diff --git a/pallets/farming/src/boost.rs b/pallets/farming/src/boost.rs index fe6b5e9ec..6601caf2c 100644 --- a/pallets/farming/src/boost.rs +++ b/pallets/farming/src/boost.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -104,7 +104,7 @@ impl Pallet { } Self::send_boost_rewards(&boost_pool_info)?; - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); boost_pool_info.start_round = current_block_number; boost_pool_info.round_length = round_length; boost_pool_info.end_round = current_block_number.saturating_add(round_length); @@ -150,7 +150,7 @@ impl Pallet { Self::deposit_event(Event::RoundStartError { info: e }); }) .ok(); - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); boost_pool_info.start_round = current_block_number; boost_pool_info.end_round = current_block_number.saturating_add(boost_pool_info.round_length); diff --git a/pallets/farming/src/gauge.rs b/pallets/farming/src/gauge.rs index 432804b5f..f9936a912 100644 --- a/pallets/farming/src/gauge.rs +++ b/pallets/farming/src/gauge.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/farming/src/lib.rs b/pallets/farming/src/lib.rs index b0a21f862..6c163674e 100644 --- a/pallets/farming/src/lib.rs +++ b/pallets/farming/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -34,6 +34,7 @@ pub mod weights; pub use weights::WeightInfo; use crate::boost::*; +use bifrost_primitives::{CurrencyId, FarmingInfo, PoolId}; use frame_support::{ pallet_prelude::*, sp_runtime::{ @@ -47,7 +48,6 @@ use frame_support::{ }; use frame_system::pallet_prelude::*; pub use gauge::*; -use node_primitives::{CurrencyId, FarmingInfo, PoolId}; use orml_traits::MultiCurrency; pub use pallet::*; pub use rewards::*; @@ -98,10 +98,10 @@ pub mod pallet { AccountIdOf, CurrencyIdOf, BalanceOf, - Self::BlockNumber, + BlockNumberFor, >; - type BlockNumberToBalance: Convert>; + type BlockNumberToBalance: Convert, BalanceOf>; #[pallet::constant] type WhitelistMaximumLimit: Get; diff --git a/pallets/farming/src/mock.rs b/pallets/farming/src/mock.rs index 9a377203b..863ac0e91 100644 --- a/pallets/farming/src/mock.rs +++ b/pallets/farming/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,18 +21,13 @@ #![cfg(test)] #![allow(non_upper_case_globals)] -use frame_support::{ - ord_parameter_types, parameter_types, - traits::{GenesisBuild, Nothing}, - PalletId, -}; +use bifrost_primitives::{CurrencyId, TokenSymbol}; +use frame_support::{ord_parameter_types, parameter_types, traits::Nothing, PalletId}; use frame_system::EnsureSignedBy; -use node_primitives::{CurrencyId, TokenSymbol}; use sp_core::{ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, ConvertInto, IdentityLookup}, - AccountId32, + AccountId32, BuildStorage, }; use crate as bifrost_farming; @@ -55,22 +50,17 @@ pub const vsBond: CurrencyId = CurrencyId::VSBond(TokenSymbol::BNC, 2001, 0, 8); pub const TREASURY_ACCOUNT: AccountId = AccountId32::new([9u8; 32]); frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - Farming: bifrost_farming::{Pallet, Call, Storage, Event}, - VeMinting: bifrost_ve_minting::{Pallet, Call, Storage, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Event, Storage}, + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + Balances: pallet_balances, + Currencies: bifrost_currencies, + Farming: bifrost_farming, + VeMinting: bifrost_ve_minting, + AssetRegistry: bifrost_asset_registry, } ); -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -82,15 +72,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -131,7 +120,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -250,7 +239,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/farming/src/rewards.rs b/pallets/farming/src/rewards.rs index 9baf46902..cf71056d0 100644 --- a/pallets/farming/src/rewards.rs +++ b/pallets/farming/src/rewards.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/farming/src/tests.rs b/pallets/farming/src/tests.rs index cad6cc496..10b2b080e 100644 --- a/pallets/farming/src/tests.rs +++ b/pallets/farming/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -22,10 +22,10 @@ use crate::{mock::*, *}; use bifrost_asset_registry::AssetMetadata; +use bifrost_primitives::TokenInfo; use bifrost_runtime_common::milli; use bifrost_ve_minting::VeMintingInterface; use frame_support::{assert_err, assert_noop, assert_ok}; -use node_primitives::TokenInfo; fn asset_registry() { let items = vec![(KSM, 10 * milli::(KSM)), (BNC, 10 * milli::(BNC))]; diff --git a/pallets/farming/src/weights.rs b/pallets/farming/src/weights.rs index 1b582cbdd..383f21518 100644 --- a/pallets/farming/src/weights.rs +++ b/pallets/farming/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/fee-share/Cargo.toml b/pallets/fee-share/Cargo.toml index 6d9e6b76e..f1e0aee47 100644 --- a/pallets/fee-share/Cargo.toml +++ b/pallets/fee-share/Cargo.toml @@ -10,34 +10,34 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] log = { version = "0.4.17", default-features = false } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -node-primitives = { path = "../../node/primitives", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -hex-literal = { version = "0.3.1" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +hex-literal = { version = "0.4.1" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-features = false } zenlink-protocol = { version = "*", default-features = false } bifrost-slp = { path = "../../pallets/slp", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [dev-dependencies] orml-tokens = "0.4.1-dev" orml-xtokens = "0.4.1-dev" orml-traits = "0.4.1-dev" -bifrost-currencies = { workspace = true } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-asset-registry = { path = "../asset-registry", default-features = false } [features] @@ -48,7 +48,7 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking/std", - "node-primitives/std", + "bifrost-primitives/std", "orml-traits/std", "bifrost-vtoken-minting/std", "zenlink-protocol/std", diff --git a/pallets/fee-share/src/benchmarking.rs b/pallets/fee-share/src/benchmarking.rs index db2b9ac0f..e7f3a75a2 100644 --- a/pallets/fee-share/src/benchmarking.rs +++ b/pallets/fee-share/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,15 +19,16 @@ // Ensure we're `no_std` when compiling for Wasm. #![cfg(feature = "runtime-benchmarks")] -use frame_benchmarking::{benchmarks, vec, whitelisted_caller}; -use frame_support::{assert_ok, dispatch::Weight}; +use bifrost_primitives::{CurrencyId, TokenSymbol}; +use frame_benchmarking::{benchmarks, whitelisted_caller}; +use frame_support::assert_ok; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, TokenSymbol}; +use sp_std::vec; use crate::{Pallet as FeeShare, *}; benchmarks! { - on_initialize {}:{FeeShare::::on_idle(T::BlockNumber::from(10u32),Weight::from_parts(0, 0));} + on_initialize {}:{FeeShare::::on_idle(BlockNumberFor::::from(10u32),Weight::from_parts(0, 0));} create_distribution { let caller: T::AccountId = whitelisted_caller(); @@ -55,7 +56,7 @@ benchmarks! { None, Some(tokens_proportion.clone()), Some(true)) - set_era_length {}: _(RawOrigin::Root,T::BlockNumber::from(10u32)) + set_era_length {}: _(RawOrigin::Root,BlockNumberFor::::from(10u32)) execute_distribute { let caller: T::AccountId = whitelisted_caller(); let tokens_proportion = vec![(caller.clone(), Perbill::from_percent(100))]; diff --git a/pallets/fee-share/src/lib.rs b/pallets/fee-share/src/lib.rs index 668358a08..4c5eee0f7 100644 --- a/pallets/fee-share/src/lib.rs +++ b/pallets/fee-share/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -30,6 +30,7 @@ mod benchmarking; pub mod weights; +use bifrost_primitives::{CurrencyId, DistributionId}; use frame_support::{ pallet_prelude::*, sp_runtime::{ @@ -39,7 +40,6 @@ use frame_support::{ PalletId, }; use frame_system::pallet_prelude::*; -use node_primitives::{CurrencyId, DistributionId}; use orml_traits::MultiCurrency; pub use pallet::*; use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; diff --git a/pallets/fee-share/src/mock.rs b/pallets/fee-share/src/mock.rs index 8f744fa8f..80e782168 100644 --- a/pallets/fee-share/src/mock.rs +++ b/pallets/fee-share/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -22,6 +22,7 @@ #![allow(non_upper_case_globals)] use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{CurrencyId, SlpxOperator, TokenSymbol}; use bifrost_slp::{QueryId, QueryResponseManager}; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; @@ -30,23 +31,21 @@ use frame_support::{ pallet_prelude::Get, parameter_types, sp_runtime::{DispatchError, DispatchResult}, - sp_std::marker::PhantomData, - traits::{Everything, GenesisBuild, Nothing}, + traits::{Everything, Nothing}, PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; -use node_primitives::{CurrencyId, SlpxOperator, TokenSymbol}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; use sp_core::{hashing::blake2_256, ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{ AccountIdConversion, BlakeTwo256, Convert, IdentityLookup, TrailingZeroInput, UniqueSaturatedInto, }, - AccountId32, SaturatedConversion, + AccountId32, BuildStorage, SaturatedConversion, }; +use sp_std::marker::PhantomData; use xcm::{prelude::*, v3::Weight}; use xcm_builder::FixedWeightBounds; use xcm_executor::XcmExecutor; @@ -74,22 +73,18 @@ pub const vsBond: CurrencyId = CurrencyId::VSBond(TokenSymbol::BNC, 2001, 0, 8); pub const TREASURY_ACCOUNT: AccountId = AccountId32::new([9u8; 32]); frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - XTokens: orml_xtokens::{Pallet, Call, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - FeeShare: bifrost_fee_share::{Pallet, Call, Storage, Event}, - Slp: bifrost_slp::{Pallet, Call, Storage, Event}, - VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event}, - ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Event, Storage}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + XTokens: orml_xtokens, + Balances: pallet_balances, + Currencies: bifrost_currencies, + FeeShare: bifrost_fee_share, + Slp: bifrost_slp, + VtokenMinting: bifrost_vtoken_minting, + ZenlinkProtocol: zenlink_protocol, + AssetRegistry: bifrost_asset_registry, + PolkadotXcm: pallet_xcm, } ); @@ -103,7 +98,6 @@ impl bifrost_asset_registry::Config for Runtime { type WeightInfo = (); } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -115,15 +109,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -164,7 +157,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -484,6 +477,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } #[cfg(feature = "runtime-benchmarks")] @@ -515,6 +509,8 @@ impl pallet_xcm::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } pub struct ExtBuilder { @@ -549,7 +545,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/fee-share/src/tests.rs b/pallets/fee-share/src/tests.rs index e9a1eac0c..18575d021 100644 --- a/pallets/fee-share/src/tests.rs +++ b/pallets/fee-share/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/fee-share/src/weights.rs b/pallets/fee-share/src/weights.rs index ce493aaec..1d4a4a9ed 100644 --- a/pallets/fee-share/src/weights.rs +++ b/pallets/fee-share/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/flexible-fee/Cargo.toml b/pallets/flexible-fee/Cargo.toml index dd047c2cb..9cdb9128f 100644 --- a/pallets/flexible-fee/Cargo.toml +++ b/pallets/flexible-fee/Cargo.toml @@ -8,38 +8,38 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -scale-info = { version = "2.3.1", default-features = false, features = [ +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } zenlink-protocol = { version = "*", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } impl-trait-for-tuples = "0.2.1" -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } bifrost-asset-registry = { path = "../../pallets/asset-registry", default-features = false } log = { version = "0.4.17", default-features = false } [dev-dependencies] orml-tokens = "0.4.1-dev" -bifrost-currencies = { workspace = true } -balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.42" } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} +balances = { package = "pallet-balances", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" } bifrost-salp = { path = "../salp" } bifrost-asset-registry = { path = "../asset-registry" } -xcm-interface = { path = "../xcm-interface" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +bifrost-xcm-interface = { path = "../xcm-interface" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-vtoken-voting = { path = "../vtoken-voting", features = ["kusama"] } [features] @@ -49,7 +49,7 @@ std = [ "scale-info/std", "frame-support/std", "frame-system/std", - "node-primitives/std", + "bifrost-primitives/std", "sp-runtime/std", "sp-std/std", "pallet-transaction-payment/std", diff --git a/pallets/flexible-fee/rpc/Cargo.toml b/pallets/flexible-fee/rpc/Cargo.toml index 66947a8ca..c54ef8d86 100644 --- a/pallets/flexible-fee/rpc/Cargo.toml +++ b/pallets/flexible-fee/rpc/Cargo.toml @@ -7,14 +7,14 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0" } jsonrpsee = { version = "0.16.2", features = ["server", "macros"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-flexible-fee-rpc-runtime-api = { path = "./runtime-api" } -node-primitives = { path = "../../../node/primitives", default-features = false } +bifrost-primitives = { path = "../../../primitives", default-features = false } [features] default = ["std"] @@ -25,5 +25,5 @@ std = [ "sp-core/std", "pallet-transaction-payment-rpc-runtime-api/std", "bifrost-flexible-fee-rpc-runtime-api/std", - "node-primitives/std", + "bifrost-primitives/std", ] diff --git a/pallets/flexible-fee/rpc/runtime-api/Cargo.toml b/pallets/flexible-fee/rpc/runtime-api/Cargo.toml index b5a985206..468e0c61b 100644 --- a/pallets/flexible-fee/rpc/runtime-api/Cargo.toml +++ b/pallets/flexible-fee/rpc/runtime-api/Cargo.toml @@ -6,13 +6,13 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../../../node/primitives", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../../../primitives", default-features = false } [features] default = ["std"] std = [ "codec/std", "sp-api/std", - "node-primitives/std", + "bifrost-primitives/std", ] diff --git a/pallets/flexible-fee/rpc/runtime-api/src/lib.rs b/pallets/flexible-fee/rpc/runtime-api/src/lib.rs index 2ffc4b13a..8565a3048 100644 --- a/pallets/flexible-fee/rpc/runtime-api/src/lib.rs +++ b/pallets/flexible-fee/rpc/runtime-api/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,8 +18,8 @@ #![cfg_attr(not(feature = "std"), no_std)] +use bifrost_primitives::{Balance, CurrencyId}; use codec::Codec; -use node_primitives::{Balance, CurrencyId}; use sp_api::decl_runtime_apis; decl_runtime_apis! { diff --git a/pallets/flexible-fee/rpc/src/lib.rs b/pallets/flexible-fee/rpc/src/lib.rs index 9e4f86a28..122c6e9f6 100644 --- a/pallets/flexible-fee/rpc/src/lib.rs +++ b/pallets/flexible-fee/rpc/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,13 +19,13 @@ use std::{convert::TryInto, marker::PhantomData, sync::Arc}; pub use bifrost_flexible_fee_rpc_runtime_api::FlexibleFeeRuntimeApi as FeeRuntimeApi; +use bifrost_primitives::{Balance, CurrencyId}; use codec::{Codec, Decode}; use jsonrpsee::{ core::{async_trait, RpcResult}, proc_macros::rpc, types::error::{CallError, ErrorObject}, }; -use node_primitives::{Balance, CurrencyId}; pub use pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi as TransactionPaymentRuntimeApi; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; diff --git a/pallets/flexible-fee/src/benchmarking.rs b/pallets/flexible-fee/src/benchmarking.rs index e86e75e04..5ba6961ca 100644 --- a/pallets/flexible-fee/src/benchmarking.rs +++ b/pallets/flexible-fee/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,8 +21,8 @@ use frame_benchmarking::v1::{benchmarks, whitelisted_caller}; use frame_support::BoundedVec; +use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, TokenSymbol}; use sp_std::vec; use crate::{Call, Config, Pallet}; diff --git a/pallets/flexible-fee/src/lib.rs b/pallets/flexible-fee/src/lib.rs index d6ed82692..71ac0b428 100644 --- a/pallets/flexible-fee/src/lib.rs +++ b/pallets/flexible-fee/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,6 +18,10 @@ #![cfg_attr(not(feature = "std"), no_std)] +use bifrost_primitives::{ + traits::{FeeGetter, XcmDestWeightAndFeeHandler}, + CurrencyId, ExtraFeeName, TryConvertFrom, XcmOperationType, BNC, +}; use core::convert::Into; use cumulus_primitives_core::ParaId; use frame_support::{ @@ -28,10 +32,6 @@ use frame_support::{ }, }; use frame_system::pallet_prelude::*; -use node_primitives::{ - traits::{FeeGetter, XcmDestWeightAndFeeHandler}, - CurrencyId, ExtraFeeName, TryConvertFrom, XcmOperationType, BNC, -}; use orml_traits::MultiCurrency; pub use pallet::*; use pallet_transaction_payment::OnChargeTransaction; @@ -54,7 +54,7 @@ pub mod weights; #[frame_support::pallet] pub mod pallet { - use node_primitives::XcmDestWeightAndFeeHandler; + use bifrost_primitives::XcmDestWeightAndFeeHandler; use super::*; diff --git a/pallets/flexible-fee/src/migrations/mod.rs b/pallets/flexible-fee/src/migrations/mod.rs index fea2101e5..504be9301 100644 --- a/pallets/flexible-fee/src/migrations/mod.rs +++ b/pallets/flexible-fee/src/migrations/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/flexible-fee/src/migrations/v2.rs b/pallets/flexible-fee/src/migrations/v2.rs index d39a5ef88..ac7c34c1c 100644 --- a/pallets/flexible-fee/src/migrations/v2.rs +++ b/pallets/flexible-fee/src/migrations/v2.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,6 +18,8 @@ use crate::*; use frame_support::{storage_alias, traits::OnRuntimeUpgrade}; +#[cfg(feature = "try-runtime")] +use sp_runtime::TryRuntimeError; const LOG_TARGET: &str = "flexible-fee::migration"; @@ -52,7 +54,7 @@ impl OnRuntimeUpgrade for FlexibleFeeMigration { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, TryRuntimeError> { let cnt = UserFeeChargeOrderList::::iter().count(); // print out the pre-migrate storage count @@ -65,7 +67,7 @@ impl OnRuntimeUpgrade for FlexibleFeeMigration { } #[cfg(feature = "try-runtime")] - fn post_upgrade(_cnt: Vec) -> Result<(), &'static str> { + fn post_upgrade(_cnt: Vec) -> Result<(), TryRuntimeError> { let new_count = UserFeeChargeOrderList::::iter().count(); // print out the post-migrate storage count diff --git a/pallets/flexible-fee/src/mock.rs b/pallets/flexible-fee/src/mock.rs index 372c08860..bda4ff3ad 100644 --- a/pallets/flexible-fee/src/mock.rs +++ b/pallets/flexible-fee/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -22,39 +22,38 @@ use super::*; use crate::{self as flexible_fee, tests::CHARLIE}; use balances::Call as BalancesCall; use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{ + Balance, CurrencyId, DerivativeAccountHandler, DerivativeIndex, ExtraFeeInfo, MessageId, + ParaId, TokenSymbol, VTokenSupplyProvider, VKSM, +}; use bifrost_vtoken_voting::AccountVote; +use bifrost_xcm_interface::traits::XcmHelper; use cumulus_primitives_core::ParaId as Pid; use frame_support::{ ord_parameter_types, parameter_types, sp_runtime::{DispatchError, DispatchResult}, - sp_std::marker::PhantomData, traits::{Everything, Get, Nothing}, weights::{ConstantMultiplier, IdentityFee}, PalletId, }; use frame_system as system; use frame_system::{EnsureRoot, EnsureSignedBy}; -use node_primitives::{ - Balance, CurrencyId, DerivativeAccountHandler, DerivativeIndex, ExtraFeeInfo, MessageId, - ParaId, TokenSymbol, VTokenSupplyProvider, VKSM, -}; use orml_traits::MultiCurrency; use pallet_xcm::EnsureResponse; use sp_arithmetic::Percent; use sp_core::H256; use sp_runtime::{ - generic, testing::Header, traits::{ AccountIdConversion, BlakeTwo256, BlockNumberProvider, IdentityLookup, UniqueSaturatedInto, }, - AccountId32, SaturatedConversion, + AccountId32, BuildStorage, SaturatedConversion, }; +use sp_std::marker::PhantomData; use std::convert::TryInto; use xcm::prelude::*; use xcm_builder::FixedWeightBounds; use xcm_executor::XcmExecutor; -use xcm_interface::traits::XcmHelper; use zenlink_protocol::{ AssetId as ZenlinkAssetId, LocalAssetHandler, PairLpGenerate, ZenlinkMultiAssets, }; @@ -70,22 +69,18 @@ pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic}, - Tokens: orml_tokens::{Pallet, Storage, Event}, - Balances: balances::{Pallet, Call, Storage, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, - FlexibleFee: flexible_fee::{Pallet, Call, Storage,Event}, - ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - Salp: bifrost_salp::{Pallet, Call, Storage, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Storage, Event}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, - VtokenVoting: bifrost_vtoken_voting::{Pallet, Call, Storage, Event}, + pub enum Test { + System: system, + Tokens: orml_tokens, + Balances: balances, + TransactionPayment: pallet_transaction_payment, + FlexibleFee: flexible_fee, + ZenlinkProtocol: zenlink_protocol, + Currencies: bifrost_currencies, + Salp: bifrost_salp, + AssetRegistry: bifrost_asset_registry, + PolkadotXcm: pallet_xcm, + VtokenVoting: bifrost_vtoken_voting, } ); @@ -119,15 +114,14 @@ impl system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u32; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = generic::Header; - type Index = u128; + type Nonce = u128; + type Block = Block; // needs to be u128 against u64, otherwise the account address will be half cut. type Lookup = IdentityLookup; type OnKilledAccount = (); @@ -169,7 +163,7 @@ impl balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -361,7 +355,7 @@ where // Build genesis storage according to the mock runtime. pub(crate) fn new_test_ext() -> sp_io::TestExternalities { - system::GenesisConfig::default().build_storage::().unwrap().into() + system::GenesisConfig::::default().build_storage().unwrap().into() } //************** Salp mock start ***************** @@ -465,6 +459,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } #[cfg(feature = "runtime-benchmarks")] @@ -496,6 +491,8 @@ impl pallet_xcm::Config for Test { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } //************** Salp mock end ***************** @@ -582,10 +579,10 @@ impl RelaychainDataProvider { } impl BlockNumberProvider for RelaychainDataProvider { - type BlockNumber = BlockNumber; + type BlockNumber = BlockNumberFor; fn current_block_number() -> Self::BlockNumber { - RelaychainBlockNumber::get() + RelaychainBlockNumber::get().into() } } diff --git a/pallets/flexible-fee/src/tests.rs b/pallets/flexible-fee/src/tests.rs index 05a69e90a..1d57badb8 100644 --- a/pallets/flexible-fee/src/tests.rs +++ b/pallets/flexible-fee/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,18 +20,18 @@ #![cfg(test)] -use node_primitives::TryConvertFrom; +use bifrost_primitives::TryConvertFrom; // use balances::Call as BalancesCall; use crate::{ mock::*, BlockNumberFor, BoundedVec, Config, DispatchError::BadOrigin, UserDefaultFeeCurrency, }; +use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_support::{ assert_noop, assert_ok, dispatch::{GetDispatchInfo, Pays, PostDispatchInfo}, traits::WithdrawReasons, weights::Weight, }; -use node_primitives::{CurrencyId, TokenSymbol}; use orml_traits::MultiCurrency; use pallet_transaction_payment::OnChargeTransaction; use sp_runtime::{testing::TestXt, AccountId32}; @@ -110,8 +110,8 @@ fn basic_setup() { asset_4_currency_id )); - let mut deadline: BlockNumberFor = >::block_number() + - ::BlockNumber::from(100u32); + let mut deadline: BlockNumberFor = + >::block_number() + BlockNumberFor::::from(100u32); assert_ok!(ZenlinkProtocol::add_liquidity( RuntimeOrigin::signed(DICK), asset_0_currency_id, @@ -124,8 +124,7 @@ fn basic_setup() { )); // pool 0 2 - deadline = >::block_number() + - ::BlockNumber::from(100u32); + deadline = >::block_number() + BlockNumberFor::::from(100u32); assert_ok!(ZenlinkProtocol::add_liquidity( RuntimeOrigin::signed(DICK), asset_0_currency_id, @@ -138,8 +137,7 @@ fn basic_setup() { )); // pool 0 3 - deadline = >::block_number() + - ::BlockNumber::from(100u32); + deadline = >::block_number() + BlockNumberFor::::from(100u32); assert_ok!(ZenlinkProtocol::add_liquidity( RuntimeOrigin::signed(DICK), asset_0_currency_id, @@ -152,8 +150,7 @@ fn basic_setup() { )); // pool 0 4 - deadline = >::block_number() + - ::BlockNumber::from(100u32); + deadline = >::block_number() + BlockNumberFor::::from(100u32); assert_ok!(ZenlinkProtocol::add_liquidity( RuntimeOrigin::signed(DICK), asset_0_currency_id, diff --git a/pallets/flexible-fee/src/weights.rs b/pallets/flexible-fee/src/weights.rs index a67119b94..5425f2241 100644 --- a/pallets/flexible-fee/src/weights.rs +++ b/pallets/flexible-fee/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/lend-market/Cargo.toml b/pallets/lend-market/Cargo.toml index 39d39f80c..d7af2ceb4 100644 --- a/pallets/lend-market/Cargo.toml +++ b/pallets/lend-market/Cargo.toml @@ -8,33 +8,31 @@ version = "0.8.0" targets = ['x86_64-unknown-linux-gnu'] [dependencies] -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ - "derive", -] } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +log = { version = "0.4.17", default-features = false } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } num-traits = { version = '0.2.15', default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -pallet-assets = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.42', default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } pallet-prices = { path = "../prices", default-features = false } -node-primitives = { package = "node-primitives", path = "../../node/primitives", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } pallet-traits = { path = "../traits", default-features = false } -scale-info = { version = "2.3.1", default-features = false, features = [ +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } serde = { version = "1.0.160", features = ['derive'], optional = true } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false} +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} [dev-dependencies] orml-oracle = "0.4.1-dev" orml-tokens = "0.4.1-dev" -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } bifrost-asset-registry = { path = "../asset-registry", default-features = false } bifrost-currencies = { path = "../currencies", default-features = false } @@ -45,16 +43,16 @@ runtime-benchmarks = [ "xcm-builder/runtime-benchmarks", ] std = [ + 'log/std', 'codec/std', 'frame-support/std', 'frame-system/std', 'frame-benchmarking/std', 'orml-traits/std', - 'node-primitives/std', + 'bifrost-primitives/std', 'sp-runtime/std', 'sp-std/std', 'sp-io/std', - 'pallet-assets/std', 'pallet-prices/std', 'pallet-balances/std', 'pallet-timestamp/std', @@ -66,6 +64,3 @@ std = [ "xcm-builder/std", ] try-runtime = ['frame-support/try-runtime'] - -[lib] -doctest = false diff --git a/pallets/lend-market/rpc/Cargo.toml b/pallets/lend-market/rpc/Cargo.toml index b8b26d6be..c59064090 100644 --- a/pallets/lend-market/rpc/Cargo.toml +++ b/pallets/lend-market/rpc/Cargo.toml @@ -9,17 +9,17 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = "derive", ] } jsonrpsee = { version = "0.16.2", features = ["server", "macros"] } -node-primitives = { path = "../../../node/primitives", default-features = false } +bifrost-primitives = { path = "../../../primitives", default-features = false } serde = { version = "1.0.160", features = ["derive"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", features = [ +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", features = [ 'std', ] } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", features = [ +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", features = [ 'std', ] } -sp-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", features = [ +sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", features = [ 'std', ] } diff --git a/pallets/lend-market/rpc/runtime-api/Cargo.toml b/pallets/lend-market/rpc/runtime-api/Cargo.toml index 33c1668ac..270aa3a5a 100644 --- a/pallets/lend-market/rpc/runtime-api/Cargo.toml +++ b/pallets/lend-market/rpc/runtime-api/Cargo.toml @@ -8,9 +8,9 @@ version = "0.8.0" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -node-primitives = { path = "../../../../node/primitives", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +bifrost-primitives = { path = "../../../../primitives", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [features] default = ['std'] diff --git a/pallets/lend-market/rpc/runtime-api/src/lib.rs b/pallets/lend-market/rpc/runtime-api/src/lib.rs index 913091de9..54aaf99d6 100644 --- a/pallets/lend-market/rpc/runtime-api/src/lib.rs +++ b/pallets/lend-market/rpc/runtime-api/src/lib.rs @@ -14,8 +14,8 @@ #![cfg_attr(not(feature = "std"), no_std)] +use bifrost_primitives::{CurrencyId, Liquidity, Rate, Ratio, Shortfall}; use codec::Codec; -use node_primitives::{CurrencyId, Liquidity, Rate, Ratio, Shortfall}; use sp_runtime::{DispatchError, FixedU128}; sp_api::decl_runtime_apis! { diff --git a/pallets/lend-market/rpc/src/lib.rs b/pallets/lend-market/rpc/src/lib.rs index 5660c1b0c..71cf64f8e 100644 --- a/pallets/lend-market/rpc/src/lib.rs +++ b/pallets/lend-market/rpc/src/lib.rs @@ -16,13 +16,13 @@ use std::sync::Arc; pub use lend_market_rpc_runtime_api::LendMarketApi as LendMarketRuntimeApi; +use bifrost_primitives::{CurrencyId, Liquidity, Rate, Ratio, Shortfall}; use codec::Codec; use jsonrpsee::{ core::{async_trait, Error as JsonRpseeError, RpcResult}, proc_macros::rpc, types::error::{CallError, ErrorCode, ErrorObject}, }; -use node_primitives::{CurrencyId, Liquidity, Rate, Ratio, Shortfall}; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_rpc::number::NumberOrHex; diff --git a/pallets/lend-market/src/benchmarking.rs b/pallets/lend-market/src/benchmarking.rs index 6dd509bc4..dfdff93b9 100644 --- a/pallets/lend-market/src/benchmarking.rs +++ b/pallets/lend-market/src/benchmarking.rs @@ -2,13 +2,13 @@ #![cfg(feature = "runtime-benchmarks")] pub use crate::{AccountBorrows, Pallet as LendMarket, *}; +use bifrost_primitives::{currency::PHA, Balance, CurrencyId, DOT, DOT_U, KSM, VKSM, VSKSM}; use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite, whitelisted_caller}; use frame_support::{ assert_ok, traits::tokens::{Fortitude, Precision}, }; use frame_system::{self, RawOrigin as SystemOrigin}; -use node_primitives::{currency::PHA, Balance, CurrencyId, DOT, DOT_U, KSM, VKSM, VSKSM}; use rate_model::{InterestRateModel, JumpModel}; use sp_std::prelude::*; diff --git a/pallets/lend-market/src/farming.rs b/pallets/lend-market/src/farming.rs index 86e836dab..2b542d1d0 100644 --- a/pallets/lend-market/src/farming.rs +++ b/pallets/lend-market/src/farming.rs @@ -29,7 +29,7 @@ impl Pallet { } fn calculate_reward_delta_index( - delta_block: T::BlockNumber, + delta_block: BlockNumberFor, reward_speed: BalanceOf, total_share: BalanceOf, ) -> Result { diff --git a/pallets/lend-market/src/interest.rs b/pallets/lend-market/src/interest.rs index eea3cc479..f12daa6fb 100644 --- a/pallets/lend-market/src/interest.rs +++ b/pallets/lend-market/src/interest.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use node_primitives::{Timestamp, SECONDS_PER_YEAR}; +use bifrost_primitives::{Timestamp, SECONDS_PER_YEAR}; use sp_runtime::{traits::Zero, DispatchResult}; use crate::*; diff --git a/pallets/lend-market/src/lib.rs b/pallets/lend-market/src/lib.rs index c009ed776..d9297af37 100644 --- a/pallets/lend-market/src/lib.rs +++ b/pallets/lend-market/src/lib.rs @@ -25,9 +25,10 @@ use core::cmp::max; pub use crate::rate_model::*; - +use bifrost_primitives::{ + Balance, CurrencyId, Liquidity, Price, Rate, Ratio, Shortfall, Timestamp, +}; use frame_support::{ - log, pallet_prelude::*, require_transactional, traits::{ @@ -38,7 +39,6 @@ use frame_support::{ transactional, PalletId, }; use frame_system::pallet_prelude::*; -use node_primitives::{Balance, CurrencyId, Liquidity, Price, Rate, Ratio, Shortfall, Timestamp}; use num_traits::cast::ToPrimitive; pub use pallet::*; use pallet_traits::{ @@ -54,6 +54,7 @@ use sp_runtime::{ }; use sp_std::{result::Result, vec::Vec}; +use log; use sp_io::hashing::blake2_256; pub use types::{BorrowSnapshot, Deposits, EarnedSnapshot, Market, MarketState, RewardMarketState}; pub use weights::WeightInfo; @@ -397,7 +398,7 @@ pub mod pallet { _, Blake2_128Concat, AssetIdOf, - RewardMarketState>, + RewardMarketState, BalanceOf>, ValueQuery, >; @@ -408,7 +409,7 @@ pub mod pallet { _, Blake2_128Concat, AssetIdOf, - RewardMarketState>, + RewardMarketState, BalanceOf>, ValueQuery, >; @@ -447,14 +448,14 @@ pub mod pallet { /// DefaultVersion is using for initialize the StorageVersion #[pallet::type_value] - pub(super) fn DefaultVersion() -> Versions { + pub(super) fn DefaultVersion() -> Versions { Versions::V0 } /// Storage version of the pallet. #[pallet::storage] pub(crate) type StorageVersion = - StorageValue<_, Versions, ValueQuery, DefaultVersion>; + StorageValue<_, Versions, ValueQuery, DefaultVersion>; #[pallet::pallet] #[pallet::without_storage_info] diff --git a/pallets/lend-market/src/mock.rs b/pallets/lend-market/src/mock.rs index 9909b8707..78cd6bdb8 100644 --- a/pallets/lend-market/src/mock.rs +++ b/pallets/lend-market/src/mock.rs @@ -13,18 +13,19 @@ // limitations under the License. pub use super::*; +use sp_runtime::BuildStorage; use bifrost_asset_registry::AssetIdMaps; +pub use bifrost_primitives::*; use frame_support::{ construct_runtime, parameter_types, traits::{AsEnsureOriginWithArg, Everything, Nothing, SortedMembers}, PalletId, }; use frame_system::{EnsureRoot, EnsureSigned, EnsureSignedBy}; -pub use node_primitives::*; use orml_traits::{DataFeeder, DataProvider, DataProviderExtended}; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; +use sp_runtime::{traits::IdentityLookup, AccountId32}; use sp_std::vec::Vec; use std::{ cell::RefCell, @@ -32,9 +33,8 @@ use std::{ hash::{Hash, Hasher}, }; -pub use node_primitives::{Price, BNC, DOT, DOT_U, KSM, VBNC, VDOT, VKSM, VSKSM}; +pub use bifrost_primitives::{Price, BNC, DOT, DOT_U, KSM, VBNC, VDOT, VKSM, VSKSM}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; pub const LDOT: CurrencyId = CurrencyId::Token2(10); @@ -44,20 +44,16 @@ pub const PHA: CurrencyId = CurrencyId::Token2(5); pub const VPHA: CurrencyId = CurrencyId::VToken2(5); construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Event}, - Currencies: bifrost_currencies::{Pallet, Call}, + pub enum Test { + System: frame_system, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: bifrost_currencies, AssetRegistry: bifrost_asset_registry, - LendMarket: crate::{Pallet, Storage, Call, Event}, - TimestampPallet: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Assets: pallet_assets::{Pallet, Call, Storage, Event}, - Prices: pallet_prices::{Pallet, Storage, Call, Event}, + LendMarket: crate, + TimestampPallet: pallet_timestamp, + Assets: pallet_assets, + Prices: pallet_prices, } ); @@ -73,13 +69,12 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u32; + type Block = Block; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -133,7 +128,7 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -215,7 +210,11 @@ impl DataProviderExtended for MockDataProvider { } impl DataFeeder for MockDataProvider { - fn feed_value(_: AccountId, _: CurrencyId, _: TimeStampedPrice) -> sp_runtime::DispatchResult { + fn feed_value( + _: Option, + _: CurrencyId, + _: TimeStampedPrice, + ) -> sp_runtime::DispatchResult { Ok(()) } } @@ -343,7 +342,7 @@ impl Config for Test { } pub(crate) fn new_test_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); bifrost_asset_registry::GenesisConfig:: { currency: vec![ diff --git a/pallets/lend-market/src/rate_model.rs b/pallets/lend-market/src/rate_model.rs index 387409ec9..8d674d36a 100644 --- a/pallets/lend-market/src/rate_model.rs +++ b/pallets/lend-market/src/rate_model.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use node_primitives::{Rate, Ratio}; +use bifrost_primitives::{Rate, Ratio}; use scale_info::TypeInfo; use sp_runtime::traits::{CheckedAdd, CheckedDiv, CheckedSub, Saturating}; diff --git a/pallets/lend-market/src/tests/interest_rate.rs b/pallets/lend-market/src/tests/interest_rate.rs index 7122dd16e..62c5bd776 100644 --- a/pallets/lend-market/src/tests/interest_rate.rs +++ b/pallets/lend-market/src/tests/interest_rate.rs @@ -1,6 +1,6 @@ use crate::{mock::*, tests::LendMarket, Markets}; +use bifrost_primitives::{Rate, Ratio, SECONDS_PER_YEAR}; use frame_support::assert_ok; -use node_primitives::{Rate, Ratio, SECONDS_PER_YEAR}; use sp_runtime::{ traits::{CheckedDiv, One, Saturating}, FixedPointNumber, diff --git a/pallets/lend-market/src/tests/liquidate_borrow.rs b/pallets/lend-market/src/tests/liquidate_borrow.rs index 6873fa7b3..27262d056 100644 --- a/pallets/lend-market/src/tests/liquidate_borrow.rs +++ b/pallets/lend-market/src/tests/liquidate_borrow.rs @@ -5,8 +5,8 @@ use crate::{ tests::unit, Error, MarketState, }; +use bifrost_primitives::Rate; use frame_support::{assert_err, assert_noop, assert_ok}; -use node_primitives::Rate; use sp_runtime::FixedPointNumber; #[test] diff --git a/pallets/lend-market/src/tests/market.rs b/pallets/lend-market/src/tests/market.rs index 059e6a01d..2bba9182f 100644 --- a/pallets/lend-market/src/tests/market.rs +++ b/pallets/lend-market/src/tests/market.rs @@ -5,8 +5,8 @@ use crate::{ }, Error, InterestRateModel, MarketState, }; +use bifrost_primitives::{Rate, Ratio}; use frame_support::{assert_noop, assert_ok, error::BadOrigin}; -use node_primitives::{Rate, Ratio}; use sp_runtime::{traits::Zero, FixedPointNumber}; macro_rules! rate_model_sanity_check { diff --git a/pallets/lend-market/src/types.rs b/pallets/lend-market/src/types.rs index 2c260fb82..b35083e77 100644 --- a/pallets/lend-market/src/types.rs +++ b/pallets/lend-market/src/types.rs @@ -1,6 +1,6 @@ use crate::InterestRateModel; +use bifrost_primitives::{CurrencyId, Rate, Ratio}; use frame_support::pallet_prelude::*; -use node_primitives::{CurrencyId, Rate, Ratio}; use scale_info::TypeInfo; /// Container for borrow balance information diff --git a/pallets/lightening-redeem/Cargo.toml b/pallets/lightening-redeem/Cargo.toml index e6fa8572b..d9b93cb12 100644 --- a/pallets/lightening-redeem/Cargo.toml +++ b/pallets/lightening-redeem/Cargo.toml @@ -8,20 +8,20 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } serde = { version = "1.0.160", optional = true } orml-traits = { version = "0.4.1-dev", default-features = false } orml-tokens = { version = "0.4.1-dev", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [features] default = ["std"] @@ -35,7 +35,7 @@ std = [ "serde/std", "orml-traits/std", "orml-tokens/std", - "node-primitives/std", + "bifrost-primitives/std", "sp-core/std", "sp-io/std", "sp-std/std", diff --git a/pallets/lightening-redeem/src/benchmarking.rs b/pallets/lightening-redeem/src/benchmarking.rs index 4c51df58e..42e50cda5 100644 --- a/pallets/lightening-redeem/src/benchmarking.rs +++ b/pallets/lightening-redeem/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -69,9 +69,9 @@ benchmarks! { let caller: T::AccountId = whitelisted_caller(); let amount: u128 = 1_000; LighteningRedeem::::add_ksm_to_pool(RawOrigin::Signed(caller.clone()).into(), BalanceOf::::unique_saturated_from(amount))?; - StartEndReleaseBlock::::mutate(|interval| *interval = (T::BlockNumber::from(0u32), T::BlockNumber::from(100u32))); + StartEndReleaseBlock::::mutate(|interval| *interval = (BlockNumberFor::::from(0u32),BlockNumberFor::::from(100u32))); - let block_num = T::BlockNumber::from(10u32); + let block_num =BlockNumberFor::::from(10u32); }:{LighteningRedeem::::on_initialize(block_num);} } diff --git a/pallets/lightening-redeem/src/lib.rs b/pallets/lightening-redeem/src/lib.rs index 5ed3631d0..0561ab7d8 100644 --- a/pallets/lightening-redeem/src/lib.rs +++ b/pallets/lightening-redeem/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,7 +20,7 @@ use frame_support::{pallet_prelude::*, PalletId}; use frame_system::pallet_prelude::*; -use node_primitives::{CurrencyId, TokenSymbol}; +use bifrost_primitives::{CurrencyId, TokenSymbol}; use orml_traits::MultiCurrency; use sp_arithmetic::per_things::Percent; use sp_runtime::traits::{AccountIdConversion, Saturating, UniqueSaturatedFrom, Zero}; @@ -127,8 +127,8 @@ pub mod pallet { pub struct Pallet(PhantomData); #[pallet::hooks] - impl Hooks for Pallet { - fn on_initialize(n: T::BlockNumber) -> Weight { + impl Hooks> for Pallet { + fn on_initialize(n: BlockNumberFor) -> Weight { let (start, end) = Self::get_start_and_end_release_block(); // relsease fixed amount every day if within release interval and has enough balance in // the pool account diff --git a/pallets/lightening-redeem/src/mock.rs b/pallets/lightening-redeem/src/mock.rs index 915df7ba9..bdf14c461 100644 --- a/pallets/lightening-redeem/src/mock.rs +++ b/pallets/lightening-redeem/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,10 +21,10 @@ use frame_support::{ parameter_types, - traits::{GenesisBuild, Nothing, OnFinalize, OnInitialize}, + traits::{Nothing, OnFinalize, OnInitialize}, PalletId, }; -use node_primitives::{ +use bifrost_primitives::{ currency::{BNC, KSM, VSKSM}, CurrencyId, TokenSymbol, }; @@ -48,15 +48,11 @@ pub const BOB: AccountId = AccountId32::new([1u8; 32]); pub const CHARLIE: AccountId = AccountId32::new([3u8; 32]); frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - Council: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config}, - LighteningRedeem: bifrost_lightening_redeem::{Pallet, Call, Storage, Event} + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + Council: pallet_collective::, + LighteningRedeem: bifrost_lightening_redeem } ); @@ -72,15 +68,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -189,7 +184,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); orml_tokens::GenesisConfig:: { balances: self diff --git a/pallets/lightening-redeem/src/tests.rs b/pallets/lightening-redeem/src/tests.rs index 3a0195edc..b6b6b0493 100644 --- a/pallets/lightening-redeem/src/tests.rs +++ b/pallets/lightening-redeem/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/liquidity-mining/Cargo.toml b/pallets/liquidity-mining/Cargo.toml index 123f5da04..c7044fbc4 100644 --- a/pallets/liquidity-mining/Cargo.toml +++ b/pallets/liquidity-mining/Cargo.toml @@ -8,22 +8,22 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } log = { version = "0.4.17", default-features = false } serde = { version = "1.0.160", optional = true, features = ["derive"] } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } orml-tokens = "0.4.1-dev" -bifrost-currencies = { workspace = true } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} [features] default = ["std"] @@ -34,7 +34,7 @@ std = [ "frame-system/std", "frame-support/std", "sp-std/std", - "node-primitives/std", + "bifrost-primitives/std", "orml-traits/std", "log/std", "serde/std", diff --git a/pallets/liquidity-mining/rpc/Cargo.toml b/pallets/liquidity-mining/rpc/Cargo.toml index c9c3f04f3..6b6712bc5 100644 --- a/pallets/liquidity-mining/rpc/Cargo.toml +++ b/pallets/liquidity-mining/rpc/Cargo.toml @@ -8,10 +8,10 @@ edition = "2021" serde = { version = "1.0.140", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server", "macros"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -node-primitives = { path = "../../../node/primitives", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bifrost-primitives = { path = "../../../primitives", default-features = false } bifrost-liquidity-mining-rpc-runtime-api = { path = "./runtime-api" } diff --git a/pallets/liquidity-mining/rpc/runtime-api/Cargo.toml b/pallets/liquidity-mining/rpc/runtime-api/Cargo.toml index 2ea8c0de1..fa40d0379 100644 --- a/pallets/liquidity-mining/rpc/runtime-api/Cargo.toml +++ b/pallets/liquidity-mining/rpc/runtime-api/Cargo.toml @@ -6,14 +6,14 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../../../node/primitives", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../../../primitives", default-features = false } [features] default = ["std"] std = [ "codec/std", "sp-api/std", - "node-primitives/std", + "bifrost-primitives/std", ] diff --git a/pallets/liquidity-mining/rpc/runtime-api/src/lib.rs b/pallets/liquidity-mining/rpc/runtime-api/src/lib.rs index fc15ef5f7..6374bfbe1 100644 --- a/pallets/liquidity-mining/rpc/runtime-api/src/lib.rs +++ b/pallets/liquidity-mining/rpc/runtime-api/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::Codec; -use node_primitives::{Balance, CurrencyId}; +use bifrost_primitives::{Balance, CurrencyId}; use sp_api::decl_runtime_apis; use sp_std::vec::Vec; diff --git a/pallets/liquidity-mining/rpc/src/lib.rs b/pallets/liquidity-mining/rpc/src/lib.rs index b7d19bc0b..1ed3136fe 100644 --- a/pallets/liquidity-mining/rpc/src/lib.rs +++ b/pallets/liquidity-mining/rpc/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -27,7 +27,7 @@ use jsonrpsee::{ proc_macros::rpc, types::error::{CallError, ErrorCode, ErrorObject}, }; -use node_primitives::{Balance, CurrencyId}; +use bifrost_primitives::{Balance, CurrencyId}; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_rpc::number::NumberOrHex; diff --git a/pallets/liquidity-mining/src/benchmarking.rs b/pallets/liquidity-mining/src/benchmarking.rs index b44bcdf8c..2e5b9c33c 100644 --- a/pallets/liquidity-mining/src/benchmarking.rs +++ b/pallets/liquidity-mining/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -30,7 +30,7 @@ use frame_support::{ sp_std::prelude::*, }; use frame_system::RawOrigin; -use node_primitives::Balance; +use bifrost_primitives::Balance; use crate::{Pallet as LM, *}; diff --git a/pallets/liquidity-mining/src/lib.rs b/pallets/liquidity-mining/src/lib.rs index b41ac854c..7267ef0f1 100644 --- a/pallets/liquidity-mining/src/lib.rs +++ b/pallets/liquidity-mining/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -35,12 +35,13 @@ use frame_support::{ vec::Vec, }, traits::EnsureOrigin, - PalletId, RuntimeDebug, + PalletId }; +use sp_runtime::RuntimeDebug; #[cfg(feature = "std")] use frame_support::{Deserialize, Serialize}; use frame_system::pallet_prelude::*; -use node_primitives::{CurrencyId, CurrencyIdExt, LeasePeriod, ParaId, TokenInfo, TokenSymbol}; +use bifrost_primitives::{CurrencyId, CurrencyIdExt, LeasePeriod, ParaId, TokenInfo, TokenSymbol}; use orml_traits::{MultiCurrency, MultiLockableCurrency, MultiReservableCurrency}; pub use pallet::*; use scale_info::TypeInfo; @@ -655,20 +656,14 @@ pub mod pallet { StorageValue<_, StorageVersion, ValueQuery>; #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig, I: 'static = ()> { pub pallet_version: StorageVersion, pub _phantom: PhantomData<(T, I)>, } - #[cfg(feature = "std")] - impl, I: 'static> Default for GenesisConfig { - fn default() -> Self { - GenesisConfig { pallet_version: Default::default(), _phantom: PhantomData } - } - } - #[pallet::genesis_build] - impl, I: 'static> GenesisBuild for GenesisConfig { + impl, I: 'static> BuildGenesisConfig for GenesisConfig { fn build(&self) { PalletVersion::::put(self.pallet_version); } diff --git a/pallets/liquidity-mining/src/migration.rs b/pallets/liquidity-mining/src/migration.rs index 4616eb221..ac85f6e8d 100644 --- a/pallets/liquidity-mining/src/migration.rs +++ b/pallets/liquidity-mining/src/migration.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -205,7 +205,7 @@ pub mod v2 { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result,TryRuntimeError> { let pallet_name = T::PalletInfo::name::>().unwrap_or("none"); ensure!( @@ -225,7 +225,7 @@ pub mod v2 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(state: Vec) -> Result<(), &'static str> { + fn post_upgrade(state: Vec) -> Result<(),TryRuntimeError> { let (tp_nums_old, td_nums_old): (u32, u32) = Decode::decode(&mut &state[..]).expect("pre_upgrade provides a valid state; qed"); diff --git a/pallets/liquidity-mining/src/mock.rs b/pallets/liquidity-mining/src/mock.rs index 30023d8eb..bae62a103 100644 --- a/pallets/liquidity-mining/src/mock.rs +++ b/pallets/liquidity-mining/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -27,7 +27,7 @@ use frame_support::{ traits::Contains, PalletId, }; -use node_primitives::{traits::CheckSubAccount, Amount, Balance, CurrencyId, TokenSymbol}; +use bifrost_primitives::{traits::CheckSubAccount, Amount, Balance, CurrencyId, TokenSymbol}; use sp_core::H256; use crate as lm; @@ -41,17 +41,13 @@ pub(crate) type Signature = MultiSignature; pub(crate) type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Event}, - Currencies: bifrost_currencies::{Pallet, Call}, - Tokens: orml_tokens::{Pallet, Call, Storage, Event, Config}, - Collective: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config}, - LM: lm::{Pallet, Call, Storage, Event, Config}, + pub enum Test { + System: frame_system, + Balances: pallet_balances, + Currencies: bifrost_currencies, + Tokens: orml_tokens, + Collective: pallet_collective::, + LM: lm, } ); @@ -70,15 +66,14 @@ impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = generic::Header; - type Index = Index; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); diff --git a/pallets/liquidity-mining/src/tests.rs b/pallets/liquidity-mining/src/tests.rs index 5a7fd0c02..5617f033e 100644 --- a/pallets/liquidity-mining/src/tests.rs +++ b/pallets/liquidity-mining/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -25,7 +25,7 @@ use frame_support::{ traits::Hooks, }; use frame_system::pallet_prelude::OriginFor; -use node_primitives::{Balance, CurrencyId, TokenSymbol}; +use bifrost_primitives::{Balance, CurrencyId, TokenSymbol}; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use crate::{ diff --git a/pallets/liquidity-mining/src/weights.rs b/pallets/liquidity-mining/src/weights.rs index 2abcd6602..47b4f7f44 100644 --- a/pallets/liquidity-mining/src/weights.rs +++ b/pallets/liquidity-mining/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/parachain-staking/Cargo.toml b/pallets/parachain-staking/Cargo.toml index 1a7eab385..2ebe4525c 100644 --- a/pallets/parachain-staking/Cargo.toml +++ b/pallets/parachain-staking/Cargo.toml @@ -7,33 +7,33 @@ version = "3.0.1" [dependencies] log = "0.4.17" -serde = { version = "1.0.160", optional = true } +serde = { version = "1.0.160", default-features = false, features = ["alloc", "derive"] } # Substrate -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true, default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true, default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } parity-scale-codec = { version = "3.1.5", default-features = false, features = [ "derive", "max-encoded-len", ] } -scale-info = { version = "2.3.1", default-features = false, features = [ +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", "decode", ] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [dev-dependencies] similar-asserts = "1.2.0" -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] diff --git a/pallets/parachain-staking/src/benchmarks.rs b/pallets/parachain-staking/src/benchmarks.rs index 68e116a10..a28b9bf64 100644 --- a/pallets/parachain-staking/src/benchmarks.rs +++ b/pallets/parachain-staking/src/benchmarks.rs @@ -17,12 +17,11 @@ #![cfg(feature = "runtime-benchmarks")] //! Benchmarking -use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite, vec}; +use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite}; use frame_support::traits::{Currency, Get, OnFinalize, OnInitialize, ReservableCurrency}; -use frame_system::RawOrigin; -// use nimbus_primitives::EventHandler; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use sp_runtime::{Perbill, Percent}; -use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; +use sp_std::{collections::btree_map::BTreeMap, vec, vec::Vec}; use crate::{ AccountIdOf, BalanceOf, Call, CandidateBondLessRequest, Config, DelegationAction, Pallet, @@ -94,7 +93,7 @@ fn create_funded_collator( /// Run to end block and author fn roll_to_and_author(round_delay: u32, author: AccountIdOf) { let total_rounds = round_delay + 1u32; - let round_length: T::BlockNumber = Pallet::::round().length.into(); + let round_length: BlockNumberFor = Pallet::::round().length.into(); let mut now = >::block_number() + 1u32.into(); let end = Pallet::::round().first + (round_length * total_rounds.into()); while now < end { @@ -911,7 +910,7 @@ benchmarks! { )> = delegators.iter().map(|x| (x.clone(), T::Currency::free_balance(x))).collect(); // PREPARE RUN_TO_BLOCK LOOP let before_running_round_index = Pallet::::round().current; - let round_length: T::BlockNumber = Pallet::::round().length.into(); + let round_length: BlockNumberFor = Pallet::::round().length.into(); let reward_delay = <::RewardPaymentDelay as Get>::get() + 2u32; let mut now = >::block_number() + 1u32.into(); let mut counter = 0usize; @@ -1067,11 +1066,12 @@ benchmarks! { mod tests { use frame_support::assert_ok; use sp_io::TestExternalities; + use sp_runtime::BuildStorage; use crate::{benchmarks::*, mock::Test}; pub fn new_test_ext() -> TestExternalities { - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let t = frame_system::GenesisConfig::::default().build_storage().unwrap(); TestExternalities::new(t) } diff --git a/pallets/parachain-staking/src/delegation_requests.rs b/pallets/parachain-staking/src/delegation_requests.rs index 8daa29a65..6de853800 100644 --- a/pallets/parachain-staking/src/delegation_requests.rs +++ b/pallets/parachain-staking/src/delegation_requests.rs @@ -16,10 +16,10 @@ //! Scheduled requests functionality for delegators -use frame_support::{dispatch::DispatchResultWithPostInfo, ensure, traits::Get, RuntimeDebug}; +use frame_support::{dispatch::DispatchResultWithPostInfo, ensure, traits::Get}; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; -use sp_runtime::traits::Saturating; +use sp_runtime::{traits::Saturating, RuntimeDebug}; use sp_std::{vec, vec::Vec}; use crate::{ diff --git a/pallets/parachain-staking/src/inflation.rs b/pallets/parachain-staking/src/inflation.rs index 1d9b3878f..591062b6e 100644 --- a/pallets/parachain-staking/src/inflation.rs +++ b/pallets/parachain-staking/src/inflation.rs @@ -18,7 +18,6 @@ use frame_support::traits::Currency; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; -#[cfg(feature = "std")] use serde::{Deserialize, Serialize}; use sp_runtime::{PerThing, Perbill, RuntimeDebug}; use substrate_fixed::{ @@ -37,9 +36,19 @@ fn rounds_per_year() -> u32 { BLOCKS_PER_YEAR / blocks_per_round } -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[derive( - Eq, PartialEq, Clone, Copy, Encode, Decode, Default, RuntimeDebug, MaxEncodedLen, TypeInfo, + Eq, + PartialEq, + Clone, + Copy, + Encode, + Decode, + Default, + RuntimeDebug, + MaxEncodedLen, + TypeInfo, + Serialize, + Deserialize, )] pub struct Range { pub min: T, @@ -97,8 +106,9 @@ pub fn round_issuance_range(round: Range) -> Range { /// Staking expectations pub expect: Range, diff --git a/pallets/parachain-staking/src/lib.rs b/pallets/parachain-staking/src/lib.rs index 36a052372..1c650b309 100755 --- a/pallets/parachain-staking/src/lib.rs +++ b/pallets/parachain-staking/src/lib.rs @@ -258,7 +258,7 @@ pub mod pallet { pub enum Event { /// Started new round. NewRound { - starting_block: T::BlockNumber, + starting_block: BlockNumberFor, round: RoundIndex, selected_collators_number: u32, total_balance: BalanceOf, @@ -417,7 +417,7 @@ pub mod pallet { /// Set blocks per round BlocksPerRoundSet { current_round: RoundIndex, - first_block: T::BlockNumber, + first_block: BlockNumberFor, old: u32, new: u32, new_per_round_inflation_min: Perbill, @@ -428,7 +428,7 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn on_initialize(n: T::BlockNumber) -> Weight { + fn on_initialize(n: BlockNumberFor) -> Weight { let mut weight = T::WeightInfo::base_on_initialize(); let mut round = >::get(); @@ -483,7 +483,7 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn round)] /// Current round index and next round scheduled transition - pub type Round = StorageValue<_, RoundInfo, ValueQuery>; + pub type Round = StorageValue<_, RoundInfo>, ValueQuery>; #[pallet::storage] #[pallet::getter(fn delegator_state)] @@ -609,6 +609,7 @@ pub mod pallet { >; #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig { pub candidates: Vec<(AccountIdOf, BalanceOf)>, /// Vec of tuples of the format (delegator AccountId, collator AccountId, delegation @@ -617,15 +618,8 @@ pub mod pallet { pub inflation_config: InflationInfo>, } - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - Self { candidates: vec![], delegations: vec![], inflation_config: Default::default() } - } - } - #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { >::put(self.inflation_config.clone()); let mut candidate_count = 0u32; @@ -696,13 +690,13 @@ pub mod pallet { // Choose top TotalSelected collator candidates let (v_count, _, total_staked) = >::select_top_candidates(1u32); // Start Round 1 at Block 0 - let round: RoundInfo = + let round: RoundInfo> = RoundInfo::new(1u32, 0u32.into(), T::DefaultBlocksPerRound::get()); >::put(round); // Snapshot total stake >::insert(1u32, >::get()); >::deposit_event(Event::NewRound { - starting_block: T::BlockNumber::zero(), + starting_block: BlockNumberFor::::zero(), round: 1u32, selected_collators_number: v_count, total_balance: total_staked, @@ -1875,7 +1869,7 @@ pub mod pallet { } } - impl pallet_authorship::EventHandler, T::BlockNumber> for Pallet + impl pallet_authorship::EventHandler, BlockNumberFor> for Pallet where T: Config + pallet_authorship::Config + pallet_session::Config, { @@ -1920,33 +1914,36 @@ pub mod pallet { } } - impl ShouldEndSession for Pallet { - fn should_end_session(now: T::BlockNumber) -> bool { + impl ShouldEndSession> for Pallet { + fn should_end_session(now: BlockNumberFor) -> bool { let round = >::get(); // always update when a new round should start round.should_update(now) } } - impl EstimateNextSessionRotation for Pallet { - fn average_session_length() -> T::BlockNumber { - T::BlockNumber::from(>::get().length) + impl EstimateNextSessionRotation> for Pallet { + fn average_session_length() -> BlockNumberFor { + BlockNumberFor::::from(>::get().length) } - fn estimate_current_session_progress(now: T::BlockNumber) -> (Option, Weight) { + fn estimate_current_session_progress(now: BlockNumberFor) -> (Option, Weight) { let round = >::get(); let passed_blocks = now.saturating_sub(round.first); ( - Some(Permill::from_rational(passed_blocks, T::BlockNumber::from(round.length))), + Some(Permill::from_rational( + passed_blocks, + BlockNumberFor::::from(round.length), + )), // One read for the round info, blocknumber is read free T::DbWeight::get().reads(1), ) } fn estimate_next_session_rotation( - _now: T::BlockNumber, - ) -> (Option, Weight) { + _now: BlockNumberFor, + ) -> (Option>, Weight) { let round = >::get(); ( diff --git a/pallets/parachain-staking/src/migrations.rs b/pallets/parachain-staking/src/migrations.rs index 9bfb15b92..971a035e0 100644 --- a/pallets/parachain-staking/src/migrations.rs +++ b/pallets/parachain-staking/src/migrations.rs @@ -31,11 +31,12 @@ extern crate alloc; #[cfg(feature = "try-runtime")] use alloc::{format, string::ToString}; +use frame_system::pallet_prelude::BlockNumberFor; #[cfg(feature = "try-runtime")] use scale_info::prelude::string::String; use sp_runtime::{ traits::{AccountIdConversion, Saturating, Zero}, - Perbill, + Perbill, TryRuntimeError, }; use sp_std::{convert::TryInto, vec::Vec}; @@ -109,7 +110,7 @@ impl OnRuntimeUpgrade for InitGenesisMigration { // Choose top TotalSelected collator candidates >::select_top_candidates(1u32); // Start Round 1 at Block 0 - let round: RoundInfo = + let round: RoundInfo> = RoundInfo::new(1u32, 0u32.into(), T::DefaultBlocksPerRound::get()); >::put(round); // Snapshot total stake @@ -119,7 +120,7 @@ impl OnRuntimeUpgrade for InitGenesisMigration { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, TryRuntimeError> { log::info!(target: "Staking", "pre-init migraion"); let candidates = >::get(); let old_count = candidates.0.len() as u32; @@ -128,7 +129,7 @@ impl OnRuntimeUpgrade for InitGenesisMigration { } #[cfg(feature = "try-runtime")] - fn post_upgrade(_state: Vec) -> Result<(), &'static str> { + fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { log::info!(target: "Staking", "post-init migraion"); let candidates = >::get(); let new_count = candidates.0.len(); @@ -243,7 +244,7 @@ impl OnRuntimeUpgrade for SplitDelegatorStateIntoDelegationScheduledR } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, TryRuntimeError> { use sp_std::collections::btree_map::BTreeMap; let mut expected_delegator_state_entries = 0u64; @@ -293,7 +294,7 @@ impl OnRuntimeUpgrade for SplitDelegatorStateIntoDelegationScheduledR } #[cfg(feature = "try-runtime")] - fn post_upgrade(state: Vec) -> Result<(), &'static str> { + fn post_upgrade(state: Vec) -> Result<(), TryRuntimeError> { use sp_std::collections::btree_map::BTreeMap; let ( @@ -420,7 +421,7 @@ impl OnRuntimeUpgrade for PatchIncorrectDelegationSums { Weight::from_parts(top.saturating_add(bottom).saturating_add(100_000_000_000), 0) } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, TryRuntimeError> { use sp_std::collections::btree_map::BTreeMap; let mut candidate_total_counted_map: BTreeMap> = BTreeMap::new(); @@ -435,7 +436,7 @@ impl OnRuntimeUpgrade for PatchIncorrectDelegationSums { } #[cfg(feature = "try-runtime")] - fn post_upgrade(state: Vec) -> Result<(), &'static str> { + fn post_upgrade(state: Vec) -> Result<(), TryRuntimeError> { use sp_std::collections::btree_map::BTreeMap; let candidate_total_counted_map: BTreeMap> = @@ -492,13 +493,13 @@ impl OnRuntimeUpgrade for PurgeStaleStorage { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, TryRuntimeError> { // trivial migration Ok(Vec::new()) } #[cfg(feature = "try-runtime")] - fn post_upgrade(_state: Vec) -> Result<(), &'static str> { + fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { // expect only the storage items for the last 2 rounds to be stored let staked_count = Staked::::iter().count() as u32; let points_count = Points::::iter().count() as u32; diff --git a/pallets/parachain-staking/src/mock.rs b/pallets/parachain-staking/src/mock.rs index 37294f5c4..f5dd609cd 100644 --- a/pallets/parachain-staking/src/mock.rs +++ b/pallets/parachain-staking/src/mock.rs @@ -18,14 +18,12 @@ use frame_support::{ construct_runtime, parameter_types, traits::{ - Everything, GenesisBuild, LockIdentifier, LockableCurrency, OnFinalize, OnInitialize, - ReservableCurrency, + Everything, LockIdentifier, LockableCurrency, OnFinalize, OnInitialize, ReservableCurrency, }, PalletId, }; use sp_core::{ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, Perbill, Percent, }; @@ -36,24 +34,19 @@ use crate::{ DelegatorReserveToLockMigrations, DelegatorState, InflationInfo, Points, Range, COLLATOR_LOCK_ID, DELEGATOR_LOCK_ID, }; +use sp_runtime::BuildStorage; pub type AccountId = u64; pub type Balance = u128; -pub type BlockNumber = u64; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - ParachainStaking: pallet_parachain_staking::{Pallet, Call, Storage, Config, Event}, + pub enum Test { + System: frame_system, + Balances: pallet_balances, + ParachainStaking: pallet_parachain_staking, } ); @@ -67,14 +60,13 @@ impl frame_system::Config for Test { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u32; + type Block = Block; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -102,7 +94,7 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -227,8 +219,8 @@ impl ExtBuilder { } pub(crate) fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .expect("Frame system builds valid default genesis config"); pallet_balances::GenesisConfig:: { balances: self.balances } diff --git a/pallets/parachain-staking/src/tests.rs b/pallets/parachain-staking/src/tests.rs index a79624328..4866a8172 100644 --- a/pallets/parachain-staking/src/tests.rs +++ b/pallets/parachain-staking/src/tests.rs @@ -6145,7 +6145,7 @@ fn test_hotfix_remove_delegation_requests_exited_candidates_errors_when_candidat } #[test] -fn locking_zero_amount_is_ignored() { +fn locking_zero_amount_removes_lock() { use frame_support::traits::{LockableCurrency, WithdrawReasons}; // this test demonstrates the behavior of pallet Balance's `LockableCurrency` implementation of @@ -6158,8 +6158,8 @@ fn locking_zero_amount_is_ignored() { assert_eq!(crate::mock::query_lock_amount(1, DELEGATOR_LOCK_ID), Some(1)); Balances::set_lock(DELEGATOR_LOCK_ID, &1, 0, WithdrawReasons::all()); - // Note that we tried to call `set_lock(0)` and it ignored it, we still have our lock - assert_eq!(crate::mock::query_lock_amount(1, DELEGATOR_LOCK_ID), Some(1)); + // Note that we tried to call `set_lock(0)` and the previous lock gets removed + assert_eq!(crate::mock::query_lock_amount(1, DELEGATOR_LOCK_ID), None); }); } diff --git a/pallets/prices/Cargo.toml b/pallets/prices/Cargo.toml index e0145ce0c..42d937833 100644 --- a/pallets/prices/Cargo.toml +++ b/pallets/prices/Cargo.toml @@ -5,29 +5,30 @@ name = 'pallet-prices' version = "0.8.0" [dependencies] +log = { version = "0.4.17", default-features = false } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } num-traits = { version = '0.2.15', default-features = false } orml-oracle = { version = "0.4.1-dev", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -pallet-assets = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.42', default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-assets = { git = 'https://github.com/paritytech/polkadot-sdk.git', branch = 'release-polkadot-v1.1.0', default-features = false } pallet-traits = { path = '../traits', default-features = false } -node-primitives = { package = "node-primitives", path = "../../node/primitives", default-features = false } -scale-info = { version = "2.3.1", default-features = false, features = [ +bifrost-primitives = { path = "../../primitives", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } serde = { version = "1.0.160", optional = true, features = ["derive"] } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } bifrost-asset-registry = { path = "../asset-registry", default-features = false } [dev-dependencies] bifrost-currencies = { path = "../currencies", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } orml-tokens = { version = "0.4.1-dev", default-features = false } [features] @@ -42,7 +43,7 @@ std = [ 'sp-core/std', 'orml-traits/std', 'orml-oracle/std', - 'node-primitives/std', + 'bifrost-primitives/std', 'scale-info/std', 'num-traits/std', 'pallet-traits/std', diff --git a/pallets/prices/src/lib.rs b/pallets/prices/src/lib.rs index 6a01bbabc..89281e53f 100644 --- a/pallets/prices/src/lib.rs +++ b/pallets/prices/src/lib.rs @@ -23,17 +23,17 @@ #![cfg_attr(not(feature = "std"), no_std)] use bifrost_asset_registry::AssetMetadata; -use frame_support::{dispatch::DispatchClass, log, pallet_prelude::*, transactional}; +use bifrost_primitives::*; +use frame_support::{dispatch::DispatchClass, pallet_prelude::*, transactional}; use frame_system::pallet_prelude::*; -use node_primitives::*; +use log; use orml_traits::{DataFeeder, DataProvider, DataProviderExtended}; +pub use pallet::*; +use pallet_traits::*; use sp_runtime::{traits::CheckedDiv, FixedU128}; use sp_std::vec::Vec; use xcm::v3::MultiLocation; -pub use pallet::*; -use pallet_traits::*; - #[cfg(test)] mod mock; #[cfg(test)] diff --git a/pallets/prices/src/mock.rs b/pallets/prices/src/mock.rs index 1b8daa8e6..1cbd7d99f 100644 --- a/pallets/prices/src/mock.rs +++ b/pallets/prices/src/mock.rs @@ -21,13 +21,14 @@ use frame_support::{ }; use frame_system::{EnsureRoot, EnsureSigned, EnsureSignedBy}; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup, FixedPointNumber}; +use sp_runtime::{traits::IdentityLookup, FixedPointNumber}; use bifrost_asset_registry::AssetIdMaps; -pub use node_primitives::{ +pub use bifrost_primitives::{ currency::{FIL, VFIL}, DOT, KSM, VDOT, VKSM, }; +use sp_runtime::BuildStorage; pub type AccountId = u128; pub type BlockNumber = u64; @@ -42,14 +43,13 @@ parameter_types! { impl frame_system::Config for Test { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u32; + type Block = Block; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); @@ -110,7 +110,11 @@ impl DataProviderExtended for MockDataProvider { } impl DataFeeder for MockDataProvider { - fn feed_value(_: AccountId, _: CurrencyId, _: TimeStampedPrice) -> sp_runtime::DispatchResult { + fn feed_value( + _: Option, + _: CurrencyId, + _: TimeStampedPrice, + ) -> sp_runtime::DispatchResult { Ok(()) } } @@ -135,7 +139,7 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -235,27 +239,22 @@ impl orml_tokens::Config for Test { type CurrencyHooks = (); } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Event}, - Assets: pallet_assets::{Pallet, Call, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Event}, - Currencies: bifrost_currencies::{Pallet, Call}, - Prices: crate::{Pallet, Storage, Call, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Storage, Call, Event}, + pub enum Test { + System: frame_system, + Balances: pallet_balances, + Assets: pallet_assets, + Tokens: orml_tokens, + Currencies: bifrost_currencies, + Prices: crate, + AssetRegistry: bifrost_asset_registry, } ); pub fn new_test_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); bifrost_asset_registry::GenesisConfig:: { currency: vec![ diff --git a/pallets/salp-lite/Cargo.toml b/pallets/salp-lite/Cargo.toml index bf7f13a0e..78c05ac97 100644 --- a/pallets/salp-lite/Cargo.toml +++ b/pallets/salp-lite/Cargo.toml @@ -6,34 +6,34 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } [dev-dependencies] -pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} smallvec = "1.10.0" -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } orml-tokens = "0.4.1-dev" -bifrost-currencies = { workspace = true } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] std = [ "codec/std", "log/std", - "node-primitives/std", + "bifrost-primitives/std", "frame-support/std", "frame-system/std", "sp-std/std", diff --git a/pallets/salp-lite/src/benchmarking.rs b/pallets/salp-lite/src/benchmarking.rs index 28fc05aac..6c046c8cb 100644 --- a/pallets/salp-lite/src/benchmarking.rs +++ b/pallets/salp-lite/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,7 +21,7 @@ use frame_benchmarking::{benchmarks, whitelisted_caller}; use frame_support::assert_ok; use frame_system::RawOrigin; -use node_primitives::ParaId; +use bifrost_primitives::ParaId; use sp_runtime::{traits::Bounded, SaturatedConversion}; use sp_std::prelude::*; diff --git a/pallets/salp-lite/src/lib.rs b/pallets/salp-lite/src/lib.rs index 70322304d..c28e845cd 100644 --- a/pallets/salp-lite/src/lib.rs +++ b/pallets/salp-lite/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -30,7 +30,7 @@ pub use weights::WeightInfo; // Re-export pallet items so that they can be accessed from the crate namespace. use frame_support::pallet_prelude::*; -use node_primitives::{ContributionStatus, TokenInfo, TokenSymbol, TrieIndex}; +use bifrost_primitives::{ContributionStatus, TokenInfo, TokenSymbol, TrieIndex}; use orml_traits::MultiCurrency; pub use pallet::*; use scale_info::TypeInfo; @@ -93,7 +93,7 @@ pub mod pallet { PalletId, }; use frame_system::pallet_prelude::*; - use node_primitives::{BancorHandler, CurrencyId, LeasePeriod, MessageId, ParaId}; + use bifrost_primitives::{BancorHandler, CurrencyId, LeasePeriod, MessageId, ParaId}; use orml_traits::{currency::TransferAll, MultiCurrency, MultiReservableCurrency}; use sp_arithmetic::Percent; use sp_std::prelude::*; @@ -263,19 +263,13 @@ pub mod pallet { pub(super) type RedeemPool = StorageValue<_, BalanceOf, ValueQuery>; #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig { pub initial_multisig_account: Option>, } - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - Self { initial_multisig_account: None } - } - } - #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { if let Some(ref key) = self.initial_multisig_account { MultisigConfirmAccount::::put(key) diff --git a/pallets/salp-lite/src/mock.rs b/pallets/salp-lite/src/mock.rs index 8ec24f994..962f5232d 100644 --- a/pallets/salp-lite/src/mock.rs +++ b/pallets/salp-lite/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -24,7 +24,7 @@ use frame_support::{ PalletId, }; use frame_system::RawOrigin; -use node_primitives::{Amount, Balance, CurrencyId, MessageId, TokenSymbol}; +use bifrost_primitives::{Amount, Balance, CurrencyId, MessageId, TokenSymbol}; use smallvec::smallvec; use sp_arithmetic::Percent; use sp_core::H256; @@ -45,17 +45,13 @@ pub(crate) type Signature = sp_runtime::MultiSignature; pub(crate) type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call}, - Tokens: orml_tokens::{Pallet, Call, Storage, Event}, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event}, - Salp: salp::{Pallet, Call, Storage, Event}, + pub enum Test { + System: frame_system, + Balances: pallet_balances, + Currencies: bifrost_currencies, + Tokens: orml_tokens, + Multisig: pallet_multisig, + Salp: salp, } ); @@ -75,15 +71,14 @@ impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = generic::Header; - type Index = Index; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -284,7 +279,7 @@ impl WeightInfo for SalpWeightInfo { } pub(crate) fn new_test_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); orml_tokens::GenesisConfig:: { balances: vec![ diff --git a/pallets/salp-lite/src/tests.rs b/pallets/salp-lite/src/tests.rs index c17de6320..92d63dac0 100644 --- a/pallets/salp-lite/src/tests.rs +++ b/pallets/salp-lite/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ // Ensure we're `no_std` when compiling for Wasm. use frame_support::{assert_noop, assert_ok, dispatch::DispatchError}; -use node_primitives::ContributionStatus; +use bifrost_primitives::ContributionStatus; use orml_traits::MultiCurrency; use crate::{mock::*, Error, FundStatus}; diff --git a/pallets/salp-lite/src/weights.rs b/pallets/salp-lite/src/weights.rs index e5c8647a7..779473df6 100644 --- a/pallets/salp-lite/src/weights.rs +++ b/pallets/salp-lite/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/salp/Cargo.toml b/pallets/salp/Cargo.toml index 516c42c71..2f5288986 100644 --- a/pallets/salp/Cargo.toml +++ b/pallets/salp/Cargo.toml @@ -8,40 +8,40 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -scale-info = { version = "2.3.1", default-features = false, features = [ +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } log = { version = "0.4.17", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } orml-tokens = { version = "0.4.1-dev", default-features = false } -xcm-interface = { path = "../xcm-interface", default-features = false } +bifrost-xcm-interface = { path = "../xcm-interface", default-features = false } zenlink-protocol = { version = "*", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.42" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot",default-features = false , branch = "release-v0.9.42" } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false , branch = "release-polkadot-v1.1.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", default-features = false , branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk",default-features = false , branch = "release-polkadot-v1.1.0" } bifrost-stable-pool = { path = "../stable-pool", default-features = false } nutsfinance-stable-asset = { path = "../../pallets/stable-asset", default-features = false } bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-features = false } [dev-dependencies] -pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -bifrost-currencies = { workspace = true } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} orml-xtokens = "0.4.1-dev" -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-asset-registry = { path = "../asset-registry", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] @@ -50,7 +50,7 @@ std = [ "codec/std", "scale-info/std", "log/std", - "node-primitives/std", + "bifrost-primitives/std", "frame-support/std", "frame-system/std", "sp-std/std", @@ -58,7 +58,7 @@ std = [ "sp-runtime/std", "sp-arithmetic/std", "orml-traits/std", - "xcm-interface/std", + "bifrost-xcm-interface/std", "xcm-builder/std", "zenlink-protocol/std", "bifrost-asset-registry/std", diff --git a/pallets/salp/rpc/Cargo.toml b/pallets/salp/rpc/Cargo.toml index 5077e02bd..d4852865c 100644 --- a/pallets/salp/rpc/Cargo.toml +++ b/pallets/salp/rpc/Cargo.toml @@ -7,10 +7,10 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server", "macros"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -node-primitives = { path = "../../../node/primitives", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bifrost-primitives = { path = "../../../primitives", default-features = false } bifrost-salp-rpc-runtime-api = { path = "./runtime-api" } diff --git a/pallets/salp/rpc/runtime-api/Cargo.toml b/pallets/salp/rpc/runtime-api/Cargo.toml index 0785dc4db..ba4134ffe 100644 --- a/pallets/salp/rpc/runtime-api/Cargo.toml +++ b/pallets/salp/rpc/runtime-api/Cargo.toml @@ -6,13 +6,13 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../../../node/primitives", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../../../primitives", default-features = false } [features] default = ["std"] std = [ "codec/std", "sp-api/std", - "node-primitives/std", + "bifrost-primitives/std", ] diff --git a/pallets/salp/rpc/runtime-api/src/lib.rs b/pallets/salp/rpc/runtime-api/src/lib.rs index 72b858708..f6d14cb50 100644 --- a/pallets/salp/rpc/runtime-api/src/lib.rs +++ b/pallets/salp/rpc/runtime-api/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,8 +18,8 @@ #![cfg_attr(not(feature = "std"), no_std)] +use bifrost_primitives::{Balance, RpcContributionStatus}; use codec::Codec; -use node_primitives::{Balance, RpcContributionStatus}; use sp_api::decl_runtime_apis; decl_runtime_apis! { diff --git a/pallets/salp/rpc/src/lib.rs b/pallets/salp/rpc/src/lib.rs index dbc29c964..49055de0f 100644 --- a/pallets/salp/rpc/src/lib.rs +++ b/pallets/salp/rpc/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,6 +18,7 @@ use std::{marker::PhantomData, sync::Arc}; +use bifrost_primitives::{Balance, RpcContributionStatus}; pub use bifrost_salp_rpc_runtime_api::{self as runtime_api, SalpRuntimeApi}; use codec::Codec; use jsonrpsee::{ @@ -25,7 +26,6 @@ use jsonrpsee::{ proc_macros::rpc, types::error::{CallError, ErrorCode, ErrorObject}, }; -use node_primitives::{Balance, RpcContributionStatus}; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_rpc::number::NumberOrHex; diff --git a/pallets/salp/src/benchmarking.rs b/pallets/salp/src/benchmarking.rs index af27e0f85..591a062bf 100644 --- a/pallets/salp/src/benchmarking.rs +++ b/pallets/salp/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,18 +18,18 @@ // Ensure we're `no_std` when compiling for Wasm. #[cfg(feature = "runtime-benchmarks")] -pub use crate::{Pallet as Salp, *}; +use crate::{Pallet as Salp, *}; +use bifrost_primitives::{CurrencyId, ParaId, XcmOperationType, KSM, VSKSM}; use bifrost_stable_pool::AtLeast64BitUnsignedOf; +use bifrost_xcm_interface::XcmWeightAndFee; use frame_benchmarking::v2::*; use frame_support::assert_ok; -use frame_system::RawOrigin; -use node_primitives::{CurrencyId, ParaId, XcmOperationType, KSM, VSKSM}; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use sp_runtime::{ traits::{AccountIdConversion, Bounded, UniqueSaturatedFrom}, SaturatedConversion, }; use sp_std::prelude::*; -use xcm_interface::XcmWeightAndFee; fn assert_last_event(generic_event: ::RuntimeEvent) { let events = frame_system::Pallet::::events(); @@ -50,9 +50,11 @@ fn create_fund(id: u32) -> ParaId { para_id } -fn contribute_fund(index: ParaId) -> (T::AccountId, BalanceOf) +fn contribute_fund( + index: ParaId, +) -> (T::AccountId, BalanceOf) where - <::MultiCurrency as MultiCurrency< + <::MultiCurrency as MultiCurrency< ::AccountId, >>::CurrencyId: From, { @@ -60,11 +62,11 @@ where let value = T::MinContribution::get(); assert_ok!(Salp::::set_balance(&who, value)); XcmWeightAndFee::::insert( - xcm_interface::CurrencyIdOf::::from(KSM.into()), + bifrost_xcm_interface::CurrencyIdOf::::from(KSM.into()), XcmOperationType::UmpContributeTransact, ( Weight::from_parts(4000000000, 100000), - xcm_interface::BalanceOf::::from(4000000000u32), + bifrost_xcm_interface::BalanceOf::::from(4000000000u32), ), ); assert_ok!(Salp::::contribute(RawOrigin::Signed(who.clone()).into(), index, value)); @@ -74,8 +76,8 @@ where } #[benchmarks( -where T: Config + bifrost_stable_pool::Config + nutsfinance_stable_asset::Config + orml_tokens::Config + bifrost_vtoken_minting::Config + xcm_interface::Config + zenlink_protocol::Config, -<::MultiCurrency as MultiCurrency<::AccountId>>::CurrencyId: From +where T: Config + bifrost_stable_pool::Config + nutsfinance_stable_asset::Config + orml_tokens::Config + bifrost_vtoken_minting::Config + bifrost_xcm_interface::Config + zenlink_protocol::Config, +<::MultiCurrency as MultiCurrency<::AccountId>>::CurrencyId: From )] mod benchmarks { use super::*; @@ -87,11 +89,11 @@ mod benchmarks { let caller: T::AccountId = whitelisted_caller(); let contribution = T::MinContribution::get(); XcmWeightAndFee::::insert( - xcm_interface::CurrencyIdOf::::from(KSM.into()), + bifrost_xcm_interface::CurrencyIdOf::::from(KSM.into()), XcmOperationType::UmpContributeTransact, ( Weight::from_parts(4000000000, 100000), - xcm_interface::BalanceOf::::from(4000000000u32), + bifrost_xcm_interface::BalanceOf::::from(4000000000u32), ), ); assert_ok!(Salp::::set_balance(&caller, contribution)); @@ -393,7 +395,7 @@ mod benchmarks { 100_000_000_000_000u128, 0u128, 0u128, - T::BlockNumber::from(10u32), + BlockNumberFor::::from(10u32), )); #[extrinsic_call] diff --git a/pallets/salp/src/lib.rs b/pallets/salp/src/lib.rs index 87d828129..107f3fd16 100644 --- a/pallets/salp/src/lib.rs +++ b/pallets/salp/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -23,25 +23,25 @@ pub mod benchmarking; #[cfg(test)] pub mod mock; -pub mod remove_storage; #[cfg(test)] mod tests; pub mod weights; pub use weights::WeightInfo; // Re-export pallet items so that they can be accessed from the crate namespace. -use bifrost_stable_pool::{traits::StablePoolHandler, StableAssetPoolId}; -use cumulus_primitives_core::{QueryId, Response}; -use frame_support::{pallet_prelude::*, sp_runtime::SaturatedConversion}; -use node_primitives::{ +use bifrost_primitives::{ ContributionStatus, CurrencyIdConversion, CurrencyIdRegister, TrieIndex, TryConvertFrom, VtokenMintingInterface, }; +use bifrost_stable_pool::{traits::StablePoolHandler, StableAssetPoolId}; +use bifrost_xcm_interface::ChainId; +use cumulus_primitives_core::{QueryId, Response}; +use frame_support::{pallet_prelude::*, sp_runtime::SaturatedConversion}; use orml_traits::MultiCurrency; pub use pallet::*; use pallet_xcm::ensure_response; use scale_info::TypeInfo; -use xcm_interface::ChainId; +use sp_runtime::traits::One; use zenlink_protocol::{AssetId, ExportZenlink}; pub type AccountIdOf = ::AccountId; @@ -91,27 +91,26 @@ pub struct FundInfo { #[frame_support::pallet] pub mod pallet { // Import various types used to declare pallet in scope. + use bifrost_primitives::{ + BancorHandler, CurrencyId, CurrencyId::VSBond, LeasePeriod, MessageId, Nonce, ParaId, + }; + use bifrost_xcm_interface::traits::XcmHelper; use frame_support::{ pallet_prelude::{storage::child, *}, sp_runtime::traits::{AccountIdConversion, CheckedAdd, Hash, Saturating, Zero}, - sp_std::convert::TryInto, storage::ChildTriePrefixIterator, PalletId, }; use frame_system::pallet_prelude::*; - use node_primitives::{ - BancorHandler, CurrencyId, CurrencyId::VSBond, LeasePeriod, MessageId, Nonce, ParaId, - }; use orml_traits::{currency::TransferAll, MultiCurrency, MultiReservableCurrency}; use sp_arithmetic::Percent; - use sp_std::prelude::*; + use sp_std::{convert::TryInto, prelude::*}; use xcm::v3::{MaybeErrorCode, MultiLocation}; - use xcm_interface::traits::XcmHelper; use super::*; #[pallet::config] - pub trait Config: frame_system::Config { + pub trait Config: frame_system::Config { type RuntimeEvent: From> + IsType<::RuntimeEvent>; type RuntimeOrigin: IsType<::RuntimeOrigin> + Into::RuntimeOrigin>>; @@ -337,19 +336,13 @@ pub mod pallet { >; #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig { pub initial_multisig_account: Option>, } - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - Self { initial_multisig_account: None } - } - } - #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { if let Some(ref key) = self.initial_multisig_account { MultisigConfirmAccount::::put(key) @@ -1303,7 +1296,7 @@ pub mod pallet { impl Hooks> for Pallet { fn on_initialize(n: BlockNumberFor) -> Weight { // Release x% KSM/DOT from redeem-pool to bancor-pool per cycle - if n != 0 && (n % T::ReleaseCycle::get()) == 0 { + if n != Zero::zero() && (n % T::ReleaseCycle::get()) == Zero::zero() { if let Ok(rp_balance) = TryInto::::try_into(Self::redeem_pool()) { // Calculate the release amount let release_amount = T::ReleaseRatio::get() * rp_balance; @@ -1337,7 +1330,7 @@ pub mod pallet { block: BlockNumberFor, last_slot: LeasePeriod, ) -> Result> { - let block_begin_redeem = Self::block_end_of_lease_period_index(last_slot)?; + let block_begin_redeem = Self::block_end_of_lease_period_index(last_slot); let block_end_redeem = block_begin_redeem.saturating_add(T::VSBondValidPeriod::get()); Ok(block >= block_end_redeem) @@ -1349,19 +1342,14 @@ pub mod pallet { block: BlockNumberFor, last_slot: LeasePeriod, ) -> Result> { - let block_begin_redeem = Self::block_end_of_lease_period_index(last_slot)?; + let block_begin_redeem = Self::block_end_of_lease_period_index(last_slot); let block_end_redeem = block_begin_redeem.saturating_add(T::VSBondValidPeriod::get()); Ok(block >= block_begin_redeem && block < block_end_redeem) } - pub(crate) fn block_end_of_lease_period_index( - slot: LeasePeriod, - ) -> Result, Error> { - let end_block = - (slot + 1).checked_mul(T::LeasePeriod::get()).ok_or(Error::::Overflow)?; - - Ok(end_block) + pub(crate) fn block_end_of_lease_period_index(slot: LeasePeriod) -> BlockNumberFor { + (BlockNumberFor::::from(slot) + One::one()).saturating_mul(T::LeasePeriod::get()) } pub fn find_fund( @@ -1451,7 +1439,8 @@ pub mod pallet { } } -impl xcm_interface::SalpHelper, ::RuntimeCall, BalanceOf> +impl + bifrost_xcm_interface::SalpHelper, ::RuntimeCall, BalanceOf> for Pallet { fn confirm_contribute_call() -> ::RuntimeCall { diff --git a/pallets/salp/src/mock.rs b/pallets/salp/src/mock.rs index b59bcae5b..2279bf37b 100644 --- a/pallets/salp/src/mock.rs +++ b/pallets/salp/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,32 +21,32 @@ #![cfg(test)] use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{ + Amount, Balance, CurrencyId, CurrencyId::*, DoNothingExecuteXcm, MessageId, ParaId, + SlpOperator, SlpxOperator, TokenSymbol, TokenSymbol::*, VKSM, +}; +use bifrost_xcm_interface::traits::XcmHelper; use cumulus_primitives_core::ParaId as Pid; use frame_support::{ construct_runtime, ord_parameter_types, parameter_types, sp_runtime::{DispatchError, DispatchResult, SaturatedConversion}, - sp_std::marker::PhantomData, - traits::{ConstU128, EnsureOrigin, Everything, GenesisBuild, Get, Nothing}, + traits::{ConstU128, ConstU64, EnsureOrigin, Everything, Get, Nothing}, weights::Weight, PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy, RawOrigin}; -use node_primitives::{ - Amount, Balance, CurrencyId, CurrencyId::*, DoNothingExecuteXcm, MessageId, ParaId, - SlpOperator, SlpxOperator, TokenSymbol, TokenSymbol::*, VKSM, -}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; use sp_arithmetic::Percent; use sp_core::{ConstU32, H256}; pub use sp_runtime::Perbill; use sp_runtime::{ - generic, traits::{BlakeTwo256, Convert, IdentityLookup, UniqueSaturatedInto}, + BuildStorage, }; +use sp_std::marker::PhantomData; use xcm::prelude::*; use xcm_builder::FixedWeightBounds; use xcm_executor::XcmExecutor; -use xcm_interface::traits::XcmHelper; use zenlink_protocol::{ AssetBalance, AssetId as ZenlinkAssetId, LocalAssetHandler, PairLpGenerate, ZenlinkMultiAssets, }; @@ -56,31 +56,25 @@ use crate as salp; pub(crate) type AccountId = <::Signer as sp_runtime::traits::IdentifyAccount>::AccountId; pub(crate) type Block = frame_system::mocking::MockBlock; pub(crate) type BlockNumber = u32; -pub(crate) type Index = u32; pub(crate) type Signature = sp_runtime::MultiSignature; -pub(crate) type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call}, - Tokens: orml_tokens::{Pallet, Call, Storage, Event}, - XTokens: orml_xtokens::{Pallet, Call, Event}, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event}, - Salp: salp::{Pallet, Call, Storage, Event}, - ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Call,Config, Event, Storage}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, - StableAsset: nutsfinance_stable_asset::{Pallet, Storage, Event}, - StablePool: bifrost_stable_pool::{Pallet, Call, Storage}, - VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event}, - XcmInterface: xcm_interface::{Pallet, Call, Storage, Event}, + pub enum Test { + System: frame_system, + Sudo: pallet_sudo, + Balances: pallet_balances, + Currencies: bifrost_currencies, + Tokens: orml_tokens, + XTokens: orml_xtokens, + Multisig: pallet_multisig, + Salp: salp, + ZenlinkProtocol: zenlink_protocol, + AssetRegistry: bifrost_asset_registry, + PolkadotXcm: pallet_xcm, + StableAsset: nutsfinance_stable_asset, + StablePool: bifrost_stable_pool, + VtokenMinting: bifrost_vtoken_minting, + XcmInterface: bifrost_xcm_interface, } ); @@ -100,15 +94,14 @@ impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = generic::Header; - type Index = Index; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -142,7 +135,7 @@ impl pallet_balances::Config for Test { type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = pallet_balances::weights::SubstrateWeight; - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -167,6 +160,7 @@ impl pallet_multisig::Config for Test { impl pallet_sudo::Config for Test { type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); } orml_traits::parameter_type_with_key! { @@ -516,6 +510,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } #[cfg(feature = "runtime-benchmarks")] @@ -547,6 +542,8 @@ impl pallet_xcm::Config for Test { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } pub struct BifrostAccountIdToMultiLocation; @@ -556,7 +553,7 @@ impl Convert for BifrostAccountIdToMultiLocation { } } -impl xcm_interface::Config for Test { +impl bifrost_xcm_interface::Config for Test { type RuntimeEvent = RuntimeEvent; type UpdateOrigin = EnsureRoot; type MultiCurrency = Currencies; @@ -567,7 +564,7 @@ impl xcm_interface::Config for Test { type AccountIdToMultiLocation = BifrostAccountIdToMultiLocation; type SalpHelper = Salp; type ParachainId = ParaInfo; - type CallBackTimeOut = ConstU32<10>; + type CallBackTimeOut = ConstU64<10>; type CurrencyIdConvert = AssetIdMaps; } @@ -579,7 +576,7 @@ impl Get for ParaInfo { } pub(crate) fn new_test_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pub const DOLLARS: Balance = 1_000_000_000_000; let currency = vec![ diff --git a/pallets/salp/src/remove_storage.rs b/pallets/salp/src/remove_storage.rs deleted file mode 100644 index 3f058ce75..000000000 --- a/pallets/salp/src/remove_storage.rs +++ /dev/null @@ -1,42 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program 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. - -// This program 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 this program. If not, see . - -use crate::{Config, QueryIdContributionInfo}; -use frame_support::{log, pallet_prelude::*, traits::OnRuntimeUpgrade}; -use sp_std::marker::PhantomData; - -pub struct RemoveUnusedQueryIdContributionInfo(PhantomData); -impl OnRuntimeUpgrade for RemoveUnusedQueryIdContributionInfo { - fn on_runtime_upgrade() -> Weight { - log::info!("RemoveUnusedQueryIdContributionInfo::on_runtime_upgrade execute"); - - for query_id in QueryIdContributionInfo::::iter_keys() { - let remove_list = - [969u64, 949, 937, 938, 966, 954, 948, 968, 973, 956, 974, 950, 932, 962]; - if remove_list.contains(&query_id) { - log::info!( - "RemoveUnusedQueryIdContributionInfo::on_runtime_upgrade execute {:?}", - query_id - ); - QueryIdContributionInfo::::remove(query_id) - } - } - - T::DbWeight::get().reads_writes(14u64, 14u64) - } -} diff --git a/pallets/salp/src/tests.rs b/pallets/salp/src/tests.rs index 563d15a89..7593bcca4 100644 --- a/pallets/salp/src/tests.rs +++ b/pallets/salp/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,12 +19,12 @@ // Ensure we're `no_std` when compiling for Wasm. use crate::{mock::*, Error, FundStatus, *}; -use frame_support::{assert_noop, assert_ok, dispatch::DispatchError}; +use bifrost_primitives::{ContributionStatus, CurrencyId, TokenSymbol, KSM, VKSM, VSKSM}; +use bifrost_xcm_interface::SalpHelper; +use frame_support::{assert_noop, assert_ok}; use frame_system::pallet_prelude::BlockNumberFor; -use node_primitives::{ContributionStatus, CurrencyId, TokenSymbol, KSM, VKSM, VSKSM}; use orml_traits::{MultiCurrency, MultiReservableCurrency}; -use sp_runtime::traits::AccountIdConversion; -use xcm_interface::SalpHelper; +use sp_runtime::{traits::AccountIdConversion, DispatchError}; use zenlink_protocol::AssetId; #[test] @@ -901,7 +901,7 @@ fn redeem_should_work() { // Mock the BlockNumber let block_begin_redeem = (SlotLength::get() + 1) * LeasePeriod::get(); - System::set_block_number(block_begin_redeem); + System::set_block_number(block_begin_redeem.into()); assert_ok!(Salp::fund_retire(Some(ALICE).into(), 3_000)); assert_ok!(Salp::withdraw(Some(ALICE).into(), 3_000)); @@ -970,7 +970,7 @@ fn redeem_with_speical_vsbond_should_work() { // Mock the BlockNumber let block_begin_redeem = (SlotLength::get() + 1) * LeasePeriod::get(); - System::set_block_number(block_begin_redeem); + System::set_block_number(block_begin_redeem.into()); assert_ok!(Salp::fund_retire(Some(ALICE).into(), 2001)); assert_ok!(Salp::withdraw(Some(ALICE).into(), 2001)); @@ -1027,7 +1027,7 @@ fn redeem_with_wrong_origin_should_fail() { // Mock the BlockNumber let block_begin_redeem = (SlotLength::get() + 1) * LeasePeriod::get(); - System::set_block_number(block_begin_redeem); + System::set_block_number(block_begin_redeem.into()); assert_ok!(Salp::fund_retire(Some(ALICE).into(), 3_000)); assert_ok!(Salp::withdraw(Some(ALICE).into(), 3_000)); @@ -1049,7 +1049,7 @@ fn redeem_with_not_redeemable_vsbond_should_fail() { // Mock the BlockNumber let block_not_redeemable = LeasePeriod::get(); - System::set_block_number(block_not_redeemable); + System::set_block_number(block_not_redeemable.into()); let vs_token = ::CurrencyIdConversion::convert_to_vstoken(RelayCurrencyId::get()) @@ -1083,7 +1083,7 @@ fn redeem_without_enough_vsassets_should_fail() { // Mock the BlockNumber let block_begin_redeem = (SlotLength::get() + 1) * LeasePeriod::get(); - System::set_block_number(block_begin_redeem); + System::set_block_number(block_begin_redeem.into()); assert_ok!(Salp::fund_retire(Some(ALICE).into(), 3_000)); assert_ok!(Salp::withdraw(Some(ALICE).into(), 3_000)); @@ -1126,7 +1126,7 @@ fn redeem_without_enough_balance_in_pool_should_fail() { // Mock the BlockNumber let block_begin_redeem = (SlotLength::get() + 1) * LeasePeriod::get(); - System::set_block_number(block_begin_redeem); + System::set_block_number(block_begin_redeem.into()); assert_ok!(Salp::fund_retire(Some(ALICE).into(), 3_000)); assert_ok!(Salp::withdraw(Some(ALICE).into(), 3_000)); @@ -1148,7 +1148,7 @@ fn redeem_with_when_ump_wrong_should_fail() { fn release_from_redeem_to_bancor_should_work() { fn run_to_block(n: BlockNumber) { use frame_support::traits::Hooks; - while System::block_number() <= n { + while System::block_number() <= n.into() { Salp::on_finalize(System::block_number()); System::on_finalize(System::block_number()); System::set_block_number(System::block_number() + 1); @@ -1348,8 +1348,8 @@ fn refund_meanwhile_issue_should_work() { asset_0_currency_id, asset_1_currency_id )); - let deadline: BlockNumberFor = >::block_number() + - ::BlockNumber::from(100u32); + let deadline: BlockNumberFor = + >::block_number() + BlockNumberFor::::from(100u32); assert_ok!(ZenlinkProtocol::add_liquidity( RuntimeOrigin::signed(ALICE), asset_0_currency_id, diff --git a/pallets/salp/src/weights.rs b/pallets/salp/src/weights.rs index 83d248640..ca4ef774d 100644 --- a/pallets/salp/src/weights.rs +++ b/pallets/salp/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/Cargo.toml b/pallets/slp/Cargo.toml index 3a259dd69..01f5623f9 100644 --- a/pallets/slp/Cargo.toml +++ b/pallets/slp/Cargo.toml @@ -8,31 +8,31 @@ edition = "2021" [dependencies] log = { version = "0.4.17", default-features = false } -hex-literal = "0.3.1" +hex-literal = "0.4.1" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -scale-info = { version = "2.3.1", default-features = false, features = [ +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } orml-traits = { version = "0.4.1-dev", default-features = false } orml-tokens = { version = "0.4.1-dev", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm-interface = { path = "../xcm-interface", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-xcm-interface = { path = "../xcm-interface", default-features = false } bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-features = false } bifrost-asset-registry = { path = "../asset-registry", default-features = false } parachain-staking = { path = "../../pallets/parachain-staking", default-features = false} @@ -41,12 +41,12 @@ parachain-staking = { path = "../../pallets/parachain-staking", default-features orml-tokens = "0.4.1-dev" orml-xtokens = "0.4.1-dev" orml-traits = "0.4.1-dev" -bifrost-currencies = { workspace = true } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} bifrost-asset-registry = { path = "../asset-registry"} -pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +pallet-indices = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } env_logger = "0.10.0" @@ -61,7 +61,7 @@ std = [ "sp-arithmetic/std", "orml-traits/std", "orml-tokens/std", - "node-primitives/std", + "bifrost-primitives/std", "sp-core/std", "sp-io/std", "sp-std/std", @@ -69,6 +69,7 @@ std = [ "pallet-xcm/std", "cumulus-primitives-core/std", "pallet-balances/std", + "pallet-indices/std", "pallet-utility/std", "bifrost-vtoken-minting/std", "bifrost-asset-registry/std", @@ -81,6 +82,6 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "xcm-builder/runtime-benchmarks", - "node-primitives/runtime-benchmarks", + "bifrost-primitives/runtime-benchmarks", ] try-runtime = [ "frame-support/try-runtime" ] diff --git a/pallets/slp/src/agents/astar_agent/agent.rs b/pallets/slp/src/agents/astar_agent/agent.rs index e976103d5..3807f5c01 100644 --- a/pallets/slp/src/agents/astar_agent/agent.rs +++ b/pallets/slp/src/agents/astar_agent/agent.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -28,12 +28,12 @@ use crate::{ DelegatorsMultilocation2Index, LedgerUpdateEntry, MinimumsAndMaximums, Pallet, TimeUnit, Validators, }; +use bifrost_primitives::{CurrencyId, VtokenMintingOperator, XcmOperationType, ASTR_TOKEN_ID}; use codec::Encode; use core::marker::PhantomData; pub use cumulus_primitives_core::ParaId; use frame_support::{ensure, traits::Get}; use frame_system::pallet_prelude::BlockNumberFor; -use node_primitives::{CurrencyId, VtokenMintingOperator, XcmOperationType, ASTR_TOKEN_ID}; use sp_runtime::{ traits::{CheckedAdd, CheckedSub, Convert, UniqueSaturatedInto, Zero}, DispatchResult, diff --git a/pallets/slp/src/agents/astar_agent/mod.rs b/pallets/slp/src/agents/astar_agent/mod.rs index f6042191e..7a71d81b8 100644 --- a/pallets/slp/src/agents/astar_agent/mod.rs +++ b/pallets/slp/src/agents/astar_agent/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/agents/astar_agent/types.rs b/pallets/slp/src/agents/astar_agent/types.rs index 95aea6bc9..e7186aaa5 100644 --- a/pallets/slp/src/agents/astar_agent/types.rs +++ b/pallets/slp/src/agents/astar_agent/types.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,9 +18,9 @@ use crate::{BalanceOf, Config}; use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; use scale_info::TypeInfo; use sp_core::H160; +use sp_runtime::RuntimeDebug; use sp_std::{boxed::Box, vec::Vec}; use xcm::{opaque::v3::WeightLimit, VersionedMultiAssets, VersionedMultiLocation}; diff --git a/pallets/slp/src/agents/common.rs b/pallets/slp/src/agents/common.rs index 14f194243..299dee585 100644 --- a/pallets/slp/src/agents/common.rs +++ b/pallets/slp/src/agents/common.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -30,8 +30,8 @@ use crate::{ Vec, Weight, Xcm, XcmOperationType, XcmWeight, Zero, ASTR, BNC, DOT, GLMR, KSM, MANTA, MOVR, PHA, }; +use bifrost_primitives::{CurrencyId, VtokenMintingOperator, XcmDestWeightAndFeeHandler}; use frame_support::{ensure, traits::Len}; -use node_primitives::{CurrencyId, VtokenMintingOperator, XcmDestWeightAndFeeHandler}; use orml_traits::{MultiCurrency, XcmTransfer}; use polkadot_parachain::primitives::Sibling; use sp_core::{Get, U256}; @@ -380,7 +380,7 @@ impl Pallet { ) -> Result<(QueryId, BlockNumberFor, BalanceOf, Xcm<()>), Error> { // prepare the query_id for reporting back transact status let now = frame_system::Pallet::::block_number(); - let timeout = T::BlockNumber::from(TIMEOUT_BLOCKS).saturating_add(now); + let timeout = BlockNumberFor::::from(TIMEOUT_BLOCKS).saturating_add(now); let query_id = Self::get_query_id(currency_id, &operation)?; let (call_as_subaccount, fee, weight) = @@ -402,7 +402,7 @@ impl Pallet { operation: &XcmOperationType, ) -> Result> { let now = frame_system::Pallet::::block_number(); - let timeout = T::BlockNumber::from(TIMEOUT_BLOCKS).saturating_add(now); + let timeout = BlockNumberFor::::from(TIMEOUT_BLOCKS).saturating_add(now); let responder = Self::get_para_multilocation_by_currency_id(currency_id)?; let callback_option = match (currency_id, operation) { diff --git a/pallets/slp/src/agents/filecoin_agent/agent.rs b/pallets/slp/src/agents/filecoin_agent/agent.rs index 40abcc6d8..8d51632b0 100644 --- a/pallets/slp/src/agents/filecoin_agent/agent.rs +++ b/pallets/slp/src/agents/filecoin_agent/agent.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -23,10 +23,10 @@ use crate::{ LedgerUpdateEntry, MinimumsAndMaximums, MultiLocation, Pallet, TimeUnit, Validators, ValidatorsByDelegator, ValidatorsByDelegatorUpdateEntry, }; +use bifrost_primitives::{CurrencyId, VtokenMintingOperator}; use core::marker::PhantomData; pub use cumulus_primitives_core::ParaId; use frame_support::ensure; -use node_primitives::{CurrencyId, VtokenMintingOperator}; use orml_traits::MultiCurrency; use sp_core::Get; use sp_runtime::{ diff --git a/pallets/slp/src/agents/filecoin_agent/mod.rs b/pallets/slp/src/agents/filecoin_agent/mod.rs index a3ae3bfe3..7e49baf64 100644 --- a/pallets/slp/src/agents/filecoin_agent/mod.rs +++ b/pallets/slp/src/agents/filecoin_agent/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/agents/mod.rs b/pallets/slp/src/agents/mod.rs index be0ab150d..13df73702 100644 --- a/pallets/slp/src/agents/mod.rs +++ b/pallets/slp/src/agents/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/agents/parachain_staking_agent/agent.rs b/pallets/slp/src/agents/parachain_staking_agent/agent.rs index c27a988c3..3803b46c2 100644 --- a/pallets/slp/src/agents/parachain_staking_agent/agent.rs +++ b/pallets/slp/src/agents/parachain_staking_agent/agent.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -32,14 +32,14 @@ use crate::{ DelegatorsMultilocation2Index, LedgerUpdateEntry, MinimumsAndMaximums, Pallet, TimeUnit, Validators, ValidatorsByDelegatorUpdateEntry, BNC, }; +use bifrost_primitives::{ + currency::{GLMR, MANTA, MOVR}, + CurrencyId, VtokenMintingOperator, XcmOperationType, +}; use codec::alloc::collections::BTreeMap; use core::marker::PhantomData; pub use cumulus_primitives_core::ParaId; use frame_support::{ensure, traits::Get}; -use node_primitives::{ - currency::{GLMR, MANTA, MOVR}, - CurrencyId, VtokenMintingOperator, XcmOperationType, -}; use orml_traits::MultiCurrency; use parachain_staking::ParachainStakingInterface; use sp_arithmetic::Percent; diff --git a/pallets/slp/src/agents/parachain_staking_agent/mod.rs b/pallets/slp/src/agents/parachain_staking_agent/mod.rs index f6042191e..7a71d81b8 100644 --- a/pallets/slp/src/agents/parachain_staking_agent/mod.rs +++ b/pallets/slp/src/agents/parachain_staking_agent/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/agents/parachain_staking_agent/types/manta_types.rs b/pallets/slp/src/agents/parachain_staking_agent/types/manta_types.rs index 7e4969a05..9482613fa 100644 --- a/pallets/slp/src/agents/parachain_staking_agent/types/manta_types.rs +++ b/pallets/slp/src/agents/parachain_staking_agent/types/manta_types.rs @@ -16,9 +16,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . use crate::{BalanceOf, Config, Decode, Encode}; -use frame_support::RuntimeDebug; use scale_info::TypeInfo; -use sp_runtime::traits::StaticLookup; +use sp_runtime::{traits::StaticLookup, RuntimeDebug}; use sp_std::{boxed::Box, vec::Vec}; use xcm::{opaque::v3::WeightLimit, VersionedMultiLocation}; diff --git a/pallets/slp/src/agents/parachain_staking_agent/types/mod.rs b/pallets/slp/src/agents/parachain_staking_agent/types/mod.rs index fab7acbb0..6f2efe98c 100644 --- a/pallets/slp/src/agents/parachain_staking_agent/types/mod.rs +++ b/pallets/slp/src/agents/parachain_staking_agent/types/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/agents/parachain_staking_agent/types/moonbeam_types.rs b/pallets/slp/src/agents/parachain_staking_agent/types/moonbeam_types.rs index 113bab412..45049c82d 100644 --- a/pallets/slp/src/agents/parachain_staking_agent/types/moonbeam_types.rs +++ b/pallets/slp/src/agents/parachain_staking_agent/types/moonbeam_types.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,11 +18,13 @@ use crate::{BalanceOf, Config}; use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; use scale_info::TypeInfo; use sp_arithmetic::Percent; use sp_core::H160; -use sp_runtime::traits::{IdentityLookup, StaticLookup}; +use sp_runtime::{ + traits::{IdentityLookup, StaticLookup}, + RuntimeDebug, +}; use sp_std::{boxed::Box, vec::Vec}; use xcm::{opaque::v3::WeightLimit, VersionedMultiLocation}; diff --git a/pallets/slp/src/agents/phala_agent/agent.rs b/pallets/slp/src/agents/phala_agent/agent.rs index d2b32aac6..65cfd882c 100644 --- a/pallets/slp/src/agents/phala_agent/agent.rs +++ b/pallets/slp/src/agents/phala_agent/agent.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -26,12 +26,12 @@ use crate::{ DelegatorsMultilocation2Index, Hash, LedgerUpdateEntry, MinimumsAndMaximums, Pallet, TimeUnit, Validators, ValidatorsByDelegatorUpdateEntry, }; +use bifrost_primitives::{TokenSymbol, VtokenMintingOperator, XcmOperationType}; use codec::Encode; use core::marker::PhantomData; pub use cumulus_primitives_core::ParaId; use frame_support::{ensure, traits::Get}; use frame_system::pallet_prelude::BlockNumberFor; -use node_primitives::{TokenSymbol, VtokenMintingOperator, XcmOperationType}; use sp_core::U256; use sp_runtime::{ traits::{CheckedAdd, CheckedSub, Convert, UniqueSaturatedFrom, UniqueSaturatedInto, Zero}, diff --git a/pallets/slp/src/agents/phala_agent/mod.rs b/pallets/slp/src/agents/phala_agent/mod.rs index f6042191e..7a71d81b8 100644 --- a/pallets/slp/src/agents/phala_agent/mod.rs +++ b/pallets/slp/src/agents/phala_agent/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/agents/phala_agent/types.rs b/pallets/slp/src/agents/phala_agent/types.rs index 94f150758..c96db1a66 100644 --- a/pallets/slp/src/agents/phala_agent/types.rs +++ b/pallets/slp/src/agents/phala_agent/types.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,7 +18,7 @@ use crate::{agents::BalancesCall, BalanceOf, Config, MultiLocation}; use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; +use sp_runtime::RuntimeDebug; use sp_std::{boxed::Box, vec::Vec}; use xcm::{opaque::v3::MultiAsset, v3::Weight as XCMWeight}; diff --git a/pallets/slp/src/agents/polkadot_agent/agent.rs b/pallets/slp/src/agents/polkadot_agent/agent.rs index 97da8baf1..61feb6455 100644 --- a/pallets/slp/src/agents/polkadot_agent/agent.rs +++ b/pallets/slp/src/agents/polkadot_agent/agent.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -29,14 +29,14 @@ use crate::{ DelegatorsMultilocation2Index, LedgerUpdateEntry, MinimumsAndMaximums, Pallet, TimeUnit, ValidatorsByDelegator, ValidatorsByDelegatorXcmUpdateQueue, }; +use bifrost_primitives::{ + currency::KSM, CurrencyId, VtokenMintingOperator, XcmDestWeightAndFeeHandler, XcmOperationType, + DOT, +}; use core::marker::PhantomData; pub use cumulus_primitives_core::ParaId; use frame_support::{ensure, traits::Get}; use frame_system::pallet_prelude::BlockNumberFor; -use node_primitives::{ - currency::KSM, CurrencyId, VtokenMintingOperator, XcmDestWeightAndFeeHandler, XcmOperationType, - DOT, -}; use sp_runtime::{ traits::{CheckedAdd, CheckedSub, Convert, StaticLookup, UniqueSaturatedInto, Zero}, DispatchResult, diff --git a/pallets/slp/src/agents/polkadot_agent/mod.rs b/pallets/slp/src/agents/polkadot_agent/mod.rs index f6042191e..7a71d81b8 100644 --- a/pallets/slp/src/agents/polkadot_agent/mod.rs +++ b/pallets/slp/src/agents/polkadot_agent/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/agents/polkadot_agent/types.rs b/pallets/slp/src/agents/polkadot_agent/types.rs index 455cc48e1..da3061b0a 100644 --- a/pallets/slp/src/agents/polkadot_agent/types.rs +++ b/pallets/slp/src/agents/polkadot_agent/types.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,9 +18,8 @@ use crate::{BalanceOf, Config}; use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; use scale_info::TypeInfo; -use sp_runtime::traits::StaticLookup; +use sp_runtime::{traits::StaticLookup, RuntimeDebug}; use sp_std::{boxed::Box, vec::Vec}; use xcm::{v3::prelude::*, VersionedMultiAssets, VersionedMultiLocation}; diff --git a/pallets/slp/src/agents/utils.rs b/pallets/slp/src/agents/utils.rs index 2cf07fb9c..6639f5932 100644 --- a/pallets/slp/src/agents/utils.rs +++ b/pallets/slp/src/agents/utils.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,10 +20,11 @@ use crate::{ Pallet, TrailingZeroInput, Validators, ValidatorsByDelegatorUpdateEntry, ASTR, DOT, GLMR, H160, KSM, MANTA, MOVR, PHA, }; +use bifrost_primitives::CurrencyId; +use bifrost_xcm_interface::traits::parachains; use codec::Encode; pub use cumulus_primitives_core::ParaId; use frame_support::ensure; -use node_primitives::CurrencyId; use sp_core::Get; use sp_std::prelude::*; use xcm::{ @@ -34,7 +35,6 @@ use xcm::{ }, v3::prelude::*, }; -use xcm_interface::traits::parachains; // Some untilities. impl Pallet { diff --git a/pallets/slp/src/benchmarking.rs b/pallets/slp/src/benchmarking.rs index bc9408281..dd65b35e7 100644 --- a/pallets/slp/src/benchmarking.rs +++ b/pallets/slp/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -81,8 +81,8 @@ pub fn init_ongoing_time(origin: ::Runtime mod benchmarks { use super::*; use crate::primitives::{PhalaLedger, SubstrateValidatorsByDelegatorUpdateEntry}; + use bifrost_primitives::VKSM; use frame_benchmarking::impl_benchmark_test_suite; - use node_primitives::VKSM; use sp_arithmetic::traits::SaturatedConversion; #[benchmark] @@ -488,8 +488,8 @@ mod benchmarks { let origin = ::ControlOrigin::try_successful_origin() .map_err(|_| BenchmarkError::Weightless)?; - OngoingTimeUnitUpdateInterval::::insert(KSM, T::BlockNumber::from(0u32)); - LastTimeUpdatedOngoingTimeUnit::::insert(KSM, T::BlockNumber::from(0u32)); + OngoingTimeUnitUpdateInterval::::insert(KSM, BlockNumberFor::::from(0u32)); + LastTimeUpdatedOngoingTimeUnit::::insert(KSM, BlockNumberFor::::from(0u32)); #[extrinsic_call] _(origin as ::RuntimeOrigin, KSM, TimeUnit::Era(0)); @@ -780,7 +780,7 @@ mod benchmarks { _( origin as ::RuntimeOrigin, KSM, - Some(T::BlockNumber::from(100u32)), + Some(BlockNumberFor::::from(100u32)), ); Ok(()) @@ -866,7 +866,7 @@ mod benchmarks { validators: vec![], }, ), - T::BlockNumber::from(10u32), + BlockNumberFor::::from(10u32), ), ); #[extrinsic_call] @@ -904,7 +904,7 @@ mod benchmarks { validators: vec![], }, ), - T::BlockNumber::from(10u32), + BlockNumberFor::::from(10u32), ), ); #[extrinsic_call] diff --git a/pallets/slp/src/lib.rs b/pallets/slp/src/lib.rs index dc41f0596..65dcc96ca 100644 --- a/pallets/slp/src/lib.rs +++ b/pallets/slp/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -31,18 +31,18 @@ pub use crate::{ Junction::AccountId32, Junctions::X1, }; +use bifrost_primitives::{ + currency::{BNC, KSM, MANTA, MOVR, PHA}, + traits::XcmDestWeightAndFeeHandler, + CurrencyId, CurrencyIdExt, DerivativeAccountHandler, DerivativeIndex, SlpOperator, TimeUnit, + VtokenMintingOperator, XcmOperationType, ASTR, DOT, FIL, GLMR, +}; use cumulus_primitives_core::{relay_chain::HashT, ParaId}; use frame_support::{pallet_prelude::*, traits::Contains, weights::Weight}; use frame_system::{ pallet_prelude::{BlockNumberFor, OriginFor}, RawOrigin, }; -use node_primitives::{ - currency::{BNC, KSM, MANTA, MOVR, PHA}, - traits::XcmDestWeightAndFeeHandler, - CurrencyId, CurrencyIdExt, DerivativeAccountHandler, DerivativeIndex, SlpOperator, TimeUnit, - VtokenMintingOperator, XcmOperationType, ASTR, DOT, FIL, GLMR, -}; use orml_traits::MultiCurrency; use parachain_staking::ParachainStakingInterface; pub use primitives::Ledger; @@ -92,7 +92,7 @@ const SIX_MONTHS: u32 = 5 * 60 * 24 * 180; pub mod pallet { use super::*; use crate::agents::{AstarAgent, FilecoinAgent, ParachainStakingAgent, PhalaAgent}; - use node_primitives::{RedeemType, SlpxOperator}; + use bifrost_primitives::{RedeemType, SlpxOperator}; use orml_traits::XcmTransfer; use pallet_xcm::ensure_response; use xcm::v3::{MaybeErrorCode, Response}; @@ -2081,7 +2081,7 @@ pub mod pallet { let current_block_number = >::block_number(); // get the due block number let due_block_number = current_block_number - .checked_add(&T::BlockNumber::from(SIX_MONTHS)) + .checked_add(&BlockNumberFor::::from(SIX_MONTHS)) .ok_or(Error::::OverFlow)?; let mut validator_boost_list: Vec<(MultiLocation, BlockNumberFor)> = vec![]; @@ -2154,7 +2154,7 @@ pub mod pallet { // get the due block number if the validator is not in the validator boost list let mut due_block_number = current_block_number - .checked_add(&T::BlockNumber::from(SIX_MONTHS)) + .checked_add(&BlockNumberFor::::from(SIX_MONTHS)) .ok_or(Error::::OverFlow)?; let validator_boost_list_op = ValidatorBoostList::::get(currency_id); @@ -2170,7 +2170,7 @@ pub mod pallet { let original_due_block = validator_boost_vec[index].1; // get the due block number due_block_number = original_due_block - .checked_add(&T::BlockNumber::from(SIX_MONTHS)) + .checked_add(&BlockNumberFor::::from(SIX_MONTHS)) .ok_or(Error::::OverFlow)?; validator_boost_vec[index].1 = due_block_number; diff --git a/pallets/slp/src/migrations/mod.rs b/pallets/slp/src/migrations/mod.rs index 906b14e70..f5231cb7b 100644 --- a/pallets/slp/src/migrations/mod.rs +++ b/pallets/slp/src/migrations/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/migrations/v2.rs b/pallets/slp/src/migrations/v2.rs index ddb8234f8..d5463f5cf 100644 --- a/pallets/slp/src/migrations/v2.rs +++ b/pallets/slp/src/migrations/v2.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,6 +18,8 @@ use crate::*; use frame_support::traits::OnRuntimeUpgrade; +#[cfg(feature = "try-runtime")] +use sp_runtime::TryRuntimeError; const LOG_TARGET: &str = "SLP::migration"; @@ -104,7 +106,7 @@ impl OnRuntimeUpgrade for SlpMigration { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, TryRuntimeError> { let validator_cnt = Validators::::iter().count(); // print out the pre-migrate storage count log::info!(target: LOG_TARGET, "Validators pre-migrate storage count: {:?}", validator_cnt); @@ -132,7 +134,7 @@ impl OnRuntimeUpgrade for SlpMigration { } #[cfg(feature = "try-runtime")] - fn post_upgrade(cnt: Vec) -> Result<(), &'static str> { + fn post_upgrade(cnt: Vec) -> Result<(), TryRuntimeError> { let (validator_cnt_old, validator_by_delegator_cnt_old, validator_boost_list_cnt_old): ( u32, u32, diff --git a/pallets/slp/src/migrations/v3.rs b/pallets/slp/src/migrations/v3.rs index 6bf3f989c..dfc1fece8 100644 --- a/pallets/slp/src/migrations/v3.rs +++ b/pallets/slp/src/migrations/v3.rs @@ -68,33 +68,33 @@ impl OnRuntimeUpgrade for SlpMigration3 { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { - let delegator_Ledgers_cnt = DelegatorLedgers::::iter().count(); + fn pre_upgrade() -> Result, sp_runtime::DispatchError> { + let delegator_ledgers_cnt = DelegatorLedgers::::iter().count(); // print out the pre-migrate storage count log::info!( target: LOG_TARGET, "DelegatorLedgers pre-migrate storage count: {:?}", - delegator_Ledgers_cnt + delegator_ledgers_cnt ); - let cnt = (delegator_Ledgers_cnt as u32); + let cnt = delegator_ledgers_cnt as u32; Ok(cnt.encode()) } #[cfg(feature = "try-runtime")] - fn post_upgrade(cnt: Vec) -> Result<(), &'static str> { - let (delegator_Ledgers_old): (u32) = Decode::decode(&mut cnt.as_slice()) + fn post_upgrade(cnt: Vec) -> Result<(), sp_runtime::DispatchError> { + let delegator_ledgers_old: u32 = Decode::decode(&mut cnt.as_slice()) .expect("the state parameter should be something that was generated by pre_upgrade"); - let delegator_Ledgers_new = DelegatorLedgers::::iter().count(); + let delegator_ledgers_new = DelegatorLedgers::::iter().count(); // print out the post-migrate storage count log::info!( target: LOG_TARGET, "DelegatorLedgers post-migrate storage count: {:?}", - delegator_Ledgers_new + delegator_ledgers_new ); ensure!( - delegator_Ledgers_new as u32 == delegator_Ledgers_old, + delegator_ledgers_new as u32 == delegator_ledgers_old, "DelegatorLedgers post-migrate storage count not match" ); diff --git a/pallets/slp/src/mocks/mock.rs b/pallets/slp/src/mocks/mock.rs index 68d1a4a29..058951255 100644 --- a/pallets/slp/src/mocks/mock.rs +++ b/pallets/slp/src/mocks/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -23,27 +23,27 @@ use crate as bifrost_slp; use crate::{Config, DispatchResult, QueryResponseManager, XcmDestWeightAndFeeHandler}; use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{ + currency::{BNC, KSM}, + Amount, Balance, CurrencyId, SlpxOperator, TokenSymbol, XcmOperationType, +}; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; use frame_support::{ construct_runtime, ord_parameter_types, pallet_prelude::Get, parameter_types, - traits::{Everything, GenesisBuild, Nothing}, + traits::{Everything, Nothing}, PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; -use node_primitives::{ - currency::{BNC, KSM}, - Amount, Balance, CurrencyId, SlpxOperator, TokenSymbol, XcmOperationType, -}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_core::{bounded::BoundedVec, hashing::blake2_256, ConstU32, H256}; pub use sp_runtime::{testing::Header, Perbill}; use sp_runtime::{ traits::{AccountIdConversion, Convert, IdentityLookup, TrailingZeroInput}, - AccountId32, Percent, + AccountId32, BuildStorage, Percent, }; use sp_std::{boxed::Box, vec::Vec}; use xcm::v3::{prelude::*, Weight}; @@ -52,7 +52,6 @@ use xcm_executor::XcmExecutor; pub type AccountId = AccountId32; pub type Block = frame_system::mocking::MockBlock; -pub type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; pub const ALICE: AccountId = AccountId32::new([1u8; 32]); pub const BOB: AccountId = AccountId32::new([2u8; 32]); @@ -60,22 +59,18 @@ pub const CHARLIE: AccountId = AccountId32::new([3u8; 32]); pub const DAVE: AccountId = AccountId32::new([4u8; 32]); construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call}, - Tokens: orml_tokens::{Pallet, Call, Storage, Event}, - XTokens: orml_xtokens::{Pallet, Call, Event}, - Slp: bifrost_slp::{Pallet, Call, Storage, Event}, - VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Event, Storage}, - ParachainStaking: parachain_staking::{Pallet, Call, Storage, Event}, - Utility: pallet_utility::{Pallet, Call, Event}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + Currencies: bifrost_currencies, + Tokens: orml_tokens, + XTokens: orml_xtokens, + Slp: bifrost_slp, + VtokenMinting: bifrost_vtoken_minting, + AssetRegistry: bifrost_asset_registry, + ParachainStaking: parachain_staking, + Utility: pallet_utility, + PolkadotXcm: pallet_xcm, } ); @@ -97,14 +92,13 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = u64; + type Nonce = u32; + type Block = Block; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); @@ -140,7 +134,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = pallet_balances::weights::SubstrateWeight; - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -519,6 +513,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } #[cfg(feature = "runtime-benchmarks")] @@ -550,6 +545,8 @@ impl pallet_xcm::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } pub struct ExtBuilder { @@ -584,7 +581,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/slp/src/mocks/mock_kusama.rs b/pallets/slp/src/mocks/mock_kusama.rs index a32599484..93cceccf7 100644 --- a/pallets/slp/src/mocks/mock_kusama.rs +++ b/pallets/slp/src/mocks/mock_kusama.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -23,37 +23,36 @@ use crate as bifrost_slp; use crate::{Config, DispatchResult, QueryResponseManager}; use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{ + currency::{BNC, KSM, VKSM}, + Amount, Balance, CurrencyId, DoNothingExecuteXcm, DoNothingRouter, SlpxOperator, TokenSymbol, + XcmDestWeightAndFeeHandler, XcmOperationType, +}; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; use frame_support::{ construct_runtime, ord_parameter_types, pallet_prelude::Get, parameter_types, - traits::{Everything, GenesisBuild, Nothing, ProcessMessageError}, + traits::{Everything, Nothing, ProcessMessageError}, PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; -use node_primitives::{ - currency::{BNC, KSM, VKSM}, - Amount, Balance, CurrencyId, DoNothingExecuteXcm, DoNothingRouter, SlpxOperator, TokenSymbol, - XcmDestWeightAndFeeHandler, XcmOperationType, -}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_core::{bounded::BoundedVec, hashing::blake2_256, ConstU32, H256}; pub use sp_runtime::{testing::Header, Perbill}; use sp_runtime::{ traits::{AccountIdConversion, Convert, TrailingZeroInput}, - AccountId32, Percent, + AccountId32, BuildStorage, Percent, }; use sp_std::{boxed::Box, vec::Vec}; use xcm::v3::{prelude::*, Weight}; use xcm_builder::FixedWeightBounds; -use xcm_executor::traits::ShouldExecute; +use xcm_executor::traits::{Properties, ShouldExecute}; pub type AccountId = AccountId32; pub type Block = frame_system::mocking::MockBlock; -pub type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; pub const ALICE: AccountId = AccountId32::new([1u8; 32]); pub const BOB: AccountId = AccountId32::new([2u8; 32]); @@ -62,23 +61,19 @@ pub const DAVE: AccountId = AccountId32::new([4u8; 32]); pub const EDDIE: AccountId = AccountId32::new([5u8; 32]); construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - Indices: pallet_indices::{Pallet, Call, Storage, Event} = 2, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - Currencies: bifrost_currencies::{Pallet, Call} = 72, - Tokens: orml_tokens::{Pallet, Call, Storage, Event} = 71, - XTokens: orml_xtokens::{Pallet, Call, Event} = 70, - Slp: bifrost_slp::{Pallet, Call, Storage, Event} = 116, - VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event} = 115, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Event, Storage} = 114, - ParachainStaking: parachain_staking::{Pallet, Call, Storage, Event} = 25, - Utility: pallet_utility::{Pallet, Call, Event} = 50, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, + pub enum Runtime { + System: frame_system, + Indices: pallet_indices, + Balances: pallet_balances, + Currencies: bifrost_currencies, + Tokens: orml_tokens, + XTokens: orml_xtokens, + Slp: bifrost_slp, + VtokenMinting: bifrost_vtoken_minting, + AssetRegistry: bifrost_asset_registry, + ParachainStaking: parachain_staking, + Utility: pallet_utility, + PolkadotXcm: pallet_xcm, } ); @@ -100,14 +95,13 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = u64; + type Nonce = u32; + type Block = Block; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = Indices; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); @@ -155,7 +149,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = pallet_balances::weights::SubstrateWeight; - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -516,7 +510,7 @@ impl ShouldExecute for Barrier { _origin: &MultiLocation, _message: &mut [Instruction], _max_weight: Weight, - _weight_credit: &mut Weight, + _weight_credit: &mut Properties, ) -> Result<(), ProcessMessageError> { Ok(()) } @@ -547,6 +541,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } #[cfg(feature = "runtime-benchmarks")] @@ -578,6 +573,8 @@ impl pallet_xcm::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } pub struct ExtBuilder { @@ -601,7 +598,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/slp/src/mocks/mod.rs b/pallets/slp/src/mocks/mod.rs index 41a7bc9bd..1fd19540b 100644 --- a/pallets/slp/src/mocks/mod.rs +++ b/pallets/slp/src/mocks/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/primitives/filecoin_primitives.rs b/pallets/slp/src/primitives/filecoin_primitives.rs index 7779d2bc4..3813878ab 100644 --- a/pallets/slp/src/primitives/filecoin_primitives.rs +++ b/pallets/slp/src/primitives/filecoin_primitives.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,8 +18,8 @@ use crate::{CurrencyId, MultiLocation}; use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; use scale_info::TypeInfo; +use sp_runtime::RuntimeDebug; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct FilecoinLedger { diff --git a/pallets/slp/src/primitives/mod.rs b/pallets/slp/src/primitives/mod.rs index e3f2bbc3f..5476cdf04 100644 --- a/pallets/slp/src/primitives/mod.rs +++ b/pallets/slp/src/primitives/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -26,10 +26,10 @@ pub use parachain_staking_primitives::*; pub use phala_primitives::*; pub use polkadot_primitives::*; +use bifrost_primitives::TimeUnit; use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; -use node_primitives::TimeUnit; use scale_info::TypeInfo; +use sp_runtime::RuntimeDebug; pub type QueryId = u64; pub const TIMEOUT_BLOCKS: u32 = 1000; diff --git a/pallets/slp/src/primitives/parachain_staking_primitives.rs b/pallets/slp/src/primitives/parachain_staking_primitives.rs index a0e0f88b9..24ef48fb0 100644 --- a/pallets/slp/src/primitives/parachain_staking_primitives.rs +++ b/pallets/slp/src/primitives/parachain_staking_primitives.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,10 +17,10 @@ // along with this program. If not, see . use crate::MultiLocation; +use bifrost_primitives::{CurrencyId, TimeUnit}; use codec::{alloc::collections::BTreeMap, Decode, Encode}; -use frame_support::RuntimeDebug; -use node_primitives::{CurrencyId, TimeUnit}; use scale_info::TypeInfo; +use sp_runtime::RuntimeDebug; use sp_std::vec::Vec; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] diff --git a/pallets/slp/src/primitives/phala_primitives.rs b/pallets/slp/src/primitives/phala_primitives.rs index ee4a7895a..8f9363966 100644 --- a/pallets/slp/src/primitives/phala_primitives.rs +++ b/pallets/slp/src/primitives/phala_primitives.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,10 +17,10 @@ // along with this program. If not, see . use crate::{MultiLocation, TimeUnit}; +use bifrost_primitives::{CurrencyId, TokenSymbol}; use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; -use node_primitives::{CurrencyId, TokenSymbol}; use scale_info::TypeInfo; +use sp_runtime::RuntimeDebug; pub const PHA: CurrencyId = CurrencyId::Token(TokenSymbol::PHA); diff --git a/pallets/slp/src/primitives/polkadot_primitives.rs b/pallets/slp/src/primitives/polkadot_primitives.rs index 577617401..f0ec2a1fe 100644 --- a/pallets/slp/src/primitives/polkadot_primitives.rs +++ b/pallets/slp/src/primitives/polkadot_primitives.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,10 +17,10 @@ // along with this program. If not, see . use crate::MultiLocation; +use bifrost_primitives::{CurrencyId, TimeUnit}; use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; -use node_primitives::{CurrencyId, TimeUnit}; use scale_info::TypeInfo; +use sp_runtime::RuntimeDebug; use sp_std::vec::Vec; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] diff --git a/pallets/slp/src/tests/filecoin_tests.rs b/pallets/slp/src/tests/filecoin_tests.rs index cbc339c77..934c25f64 100644 --- a/pallets/slp/src/tests/filecoin_tests.rs +++ b/pallets/slp/src/tests/filecoin_tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,8 +19,8 @@ #![cfg(test)] use crate::{mocks::mock::*, primitives::FilecoinLedger, *}; +use bifrost_primitives::currency::{FIL, VFIL}; use frame_support::{assert_noop, assert_ok, PalletId}; -use node_primitives::currency::{FIL, VFIL}; use sp_runtime::traits::AccountIdConversion; fn mins_maxs_setup() { diff --git a/pallets/slp/src/tests/kusama_tests.rs b/pallets/slp/src/tests/kusama_tests.rs index 99aa2c0d5..837547b42 100644 --- a/pallets/slp/src/tests/kusama_tests.rs +++ b/pallets/slp/src/tests/kusama_tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,11 +19,11 @@ #![cfg(test)] use crate::{mocks::mock_kusama::*, *}; -use frame_support::{assert_noop, assert_ok, PalletId}; -use node_primitives::{ +use bifrost_primitives::{ currency::{BNC, KSM, VKSM}, RedeemType, }; +use frame_support::{assert_noop, assert_ok, PalletId}; use orml_traits::MultiCurrency; use sp_runtime::{traits::AccountIdConversion, MultiAddress}; diff --git a/pallets/slp/src/tests/mod.rs b/pallets/slp/src/tests/mod.rs index 9d3abfe1f..caf9e65a0 100644 --- a/pallets/slp/src/tests/mod.rs +++ b/pallets/slp/src/tests/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/tests/moonriver_tests.rs b/pallets/slp/src/tests/moonriver_tests.rs index 67df601f2..1e4973077 100644 --- a/pallets/slp/src/tests/moonriver_tests.rs +++ b/pallets/slp/src/tests/moonriver_tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -29,9 +29,9 @@ use crate::{ Junctions::X2, *, }; +use bifrost_primitives::{currency::VMOVR, Balance}; use codec::alloc::collections::BTreeMap; use frame_support::{assert_noop, assert_ok, PalletId}; -use node_primitives::{currency::VMOVR, Balance}; use polkadot_parachain::primitives::Sibling; use sp_runtime::traits::AccountIdConversion; diff --git a/pallets/slp/src/tests/parachain_staking_tests.rs b/pallets/slp/src/tests/parachain_staking_tests.rs index 9f53f7403..ffd9586f4 100644 --- a/pallets/slp/src/tests/parachain_staking_tests.rs +++ b/pallets/slp/src/tests/parachain_staking_tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slp/src/tests/phala_tests.rs b/pallets/slp/src/tests/phala_tests.rs index 8b495fa2a..7d3f3f973 100644 --- a/pallets/slp/src/tests/phala_tests.rs +++ b/pallets/slp/src/tests/phala_tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -25,8 +25,8 @@ use crate::{ Junctions::X2, *, }; +use bifrost_primitives::currency::VPHA; use frame_support::{assert_noop, assert_ok, PalletId}; -use node_primitives::currency::VPHA; use polkadot_parachain::primitives::Sibling; use sp_runtime::traits::AccountIdConversion; diff --git a/pallets/slp/src/traits.rs b/pallets/slp/src/traits.rs index a3a0b5f87..930a5ef4f 100644 --- a/pallets/slp/src/traits.rs +++ b/pallets/slp/src/traits.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -15,8 +15,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::{primitives::QueryId, Box, MultiLocation, TimeUnit}; -use node_primitives::CurrencyId; +use bifrost_primitives::CurrencyId; use sp_runtime::DispatchResult; use sp_std::vec::Vec; diff --git a/pallets/slp/src/weights.rs b/pallets/slp/src/weights.rs index 4c6ab8b1e..1f4733b93 100644 --- a/pallets/slp/src/weights.rs +++ b/pallets/slp/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/slpx/Cargo.toml b/pallets/slpx/Cargo.toml index 6c2e5e571..3ec79ee07 100644 --- a/pallets/slpx/Cargo.toml +++ b/pallets/slpx/Cargo.toml @@ -11,41 +11,42 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] hex-literal = "0.3.4" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } serde = { version = "1.0.152", default-features = false, features = ["derive"] } -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42",default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42",default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42",default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42",default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42",default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42",default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0",default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0",default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0",default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0",default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0",default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0",default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } orml-xtokens = { version = "0.4.1-dev", default-features = false } zenlink-protocol = { version = "*", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } -xcm-interface = { path = "../xcm-interface", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } +bifrost-xcm-interface = { path = "../xcm-interface", default-features = false } bifrost-asset-registry = { path = "../asset-registry", default-features = false } bifrost-stable-pool = { path = "../stable-pool", default-features = false } nutsfinance-stable-asset = { path = "../stable-asset" , default-features = false } orml-tokens = { version = "0.4.1-dev", default-features = false } [dev-dependencies] -pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-vtoken-minting = { path = "../vtoken-minting" } bifrost-slp = { path = "../slp" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -bifrost-currencies = { workspace = true } -xcm-executor = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-simulator = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-simulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-runtime-common = { package = "bifrost-runtime-common", path = "../../runtime/common", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} -parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} +parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] @@ -60,7 +61,7 @@ std = [ "zenlink-protocol/std", "orml-traits/std", "orml-xtokens/std", - "node-primitives/std", + "bifrost-primitives/std", "cumulus-primitives-core/std", "sp-std/std", "bifrost-slp/std", diff --git a/pallets/slpx/src/benchmarking.rs b/pallets/slpx/src/benchmarking.rs index 356c030df..c20883ba5 100644 --- a/pallets/slpx/src/benchmarking.rs +++ b/pallets/slpx/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,10 +19,10 @@ use crate::*; use bifrost_asset_registry::CurrencyIdToLocations; +use bifrost_primitives::{CurrencyId, KSM}; use frame_benchmarking::v2::*; use frame_support::{assert_ok, sp_runtime::traits::UniqueSaturatedFrom, BoundedVec}; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, KSM}; fn init_whitelist() -> (T::AccountId, H160) { let caller: T::AccountId = whitelisted_caller(); diff --git a/pallets/slpx/src/lib.rs b/pallets/slpx/src/lib.rs index f8ead2785..e3121223b 100644 --- a/pallets/slpx/src/lib.rs +++ b/pallets/slpx/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,6 +18,10 @@ #![cfg_attr(not(feature = "std"), no_std)] use bifrost_asset_registry::AssetMetadata; +use bifrost_primitives::{ + currency::{BNC, FIL, VBNC, VDOT, VFIL, VGLMR, VKSM, VMOVR}, + CurrencyId, CurrencyIdMapping, SlpxOperator, TokenInfo, TryConvertFrom, VtokenMintingInterface, +}; use codec::{Decode, Encode, MaxEncodedLen}; use cumulus_primitives_core::ParaId; use frame_support::{ @@ -25,20 +29,15 @@ use frame_support::{ ensure, sp_runtime::SaturatedConversion, traits::Get, - RuntimeDebug, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; -use node_primitives::{ - currency::{BNC, FIL, VBNC, VDOT, VFIL, VGLMR, VKSM, VMOVR}, - CurrencyId, CurrencyIdMapping, SlpxOperator, TokenInfo, TryConvertFrom, VtokenMintingInterface, -}; use orml_traits::{MultiCurrency, XcmTransfer}; pub use pallet::*; use scale_info::TypeInfo; use sp_core::{Hasher, H160}; use sp_runtime::{ traits::{BlakeTwo256, CheckedSub}, - DispatchError, + DispatchError, RuntimeDebug, }; use sp_std::vec; use xcm::{latest::prelude::*, v3::MultiLocation}; @@ -103,9 +102,9 @@ pub enum TargetChain { #[frame_support::pallet] pub mod pallet { use super::*; + use bifrost_primitives::RedeemType; use bifrost_stable_pool::{traits::StablePoolHandler, PoolTokenIndex, StableAssetPoolId}; use frame_support::pallet_prelude::{ValueQuery, *}; - use node_primitives::RedeemType; use zenlink_protocol::{AssetId, ExportZenlink}; #[pallet::pallet] diff --git a/pallets/slpx/src/mock.rs b/pallets/slpx/src/mock.rs index b2ceb667d..93a5eccda 100644 --- a/pallets/slpx/src/mock.rs +++ b/pallets/slpx/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,6 +19,9 @@ use crate as slpx; use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{ + CurrencyId, CurrencyIdMapping, DoNothingExecuteXcm, SlpxOperator, TokenSymbol, +}; use bifrost_slp::{QueryId, QueryResponseManager}; use cumulus_primitives_core::ParaId; use frame_support::{ @@ -30,13 +33,9 @@ use frame_support::{ }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; -use node_primitives::{ - CurrencyId, CurrencyIdMapping, DoNothingExecuteXcm, SlpxOperator, TokenSymbol, -}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; use sp_core::{blake2_256, ConstU128, H256}; use sp_runtime::{ - testing::Header, traits::{ AccountIdConversion, BlakeTwo256, Convert, IdentityLookup, TrailingZeroInput, UniqueSaturatedInto, @@ -73,15 +72,10 @@ pub const KSM: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); pub const ALICE: AccountId = AccountId32::new([1u8; 32]); pub const BOB: AccountId = AccountId32::new([2u8; 32]); -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { + pub enum Test { System: frame_system, Balances: pallet_balances, Tokens: orml_tokens, @@ -108,14 +102,13 @@ impl frame_system::Config for Test { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u32; + type Block = Block; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -146,7 +139,7 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -350,6 +343,7 @@ impl xcm_executor::Config for XcmConfig { type CallDispatcher = RuntimeCall; type SafeCallFilter = Everything; type AssetLocker = (); + type Aliasers = Nothing; type AssetExchanger = (); } @@ -529,6 +523,8 @@ impl pallet_xcm::Config for Test { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } pub struct EnsurePoolAssetId; @@ -588,6 +584,7 @@ impl slpx::Config for Test { } #[cfg(feature = "runtime-benchmarks")] -pub fn new_test_ext() -> frame_support::sp_io::TestExternalities { - frame_system::GenesisConfig::default().build_storage::().unwrap().into() +pub fn new_test_ext() -> sp_io::TestExternalities { + use sp_runtime::BuildStorage; + frame_system::GenesisConfig::::default().build_storage().unwrap().into() } diff --git a/pallets/slpx/src/tests.rs b/pallets/slpx/src/tests.rs index 0ce0c5e9b..4b60ffe29 100644 --- a/pallets/slpx/src/tests.rs +++ b/pallets/slpx/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,10 +18,11 @@ #![cfg(test)] use crate::{mock::*, *}; -use frame_support::{assert_noop, assert_ok, dispatch::RawOrigin, sp_io}; +use bifrost_primitives::TokenSymbol; +use frame_support::{assert_noop, assert_ok, dispatch::RawOrigin}; use hex_literal::hex; -use node_primitives::TokenSymbol; use sp_core::{bounded::BoundedVec, ConstU32}; +use sp_io; use zenlink_protocol::AssetId; const EVM_ADDR: [u8; 20] = hex!["573394b77fC17F91E9E67F147A9ECe24d67C5073"]; diff --git a/pallets/slpx/src/weights.rs b/pallets/slpx/src/weights.rs index 4b75e5ada..0dd1a9be0 100644 --- a/pallets/slpx/src/weights.rs +++ b/pallets/slpx/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/stable-asset/Cargo.toml b/pallets/stable-asset/Cargo.toml index 83f120a4f..9e3006809 100644 --- a/pallets/stable-asset/Cargo.toml +++ b/pallets/stable-asset/Cargo.toml @@ -13,55 +13,55 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } orml-traits = { version = "0.4.1-dev", default-features = false } log = { version = "0.4.17", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } [dependencies.frame-support] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.42" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dependencies.frame-system] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.42" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dependencies.sp-core] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.42" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dev-dependencies] serde = { version = "1.0.101" } orml-tokens = { version = "0.4.1-dev", default-features = false } -bifrost-currencies = { workspace = true } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} [dev-dependencies.sp-core] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.42" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dev-dependencies.sp-io] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.42" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dependencies.sp-std] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.42" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dependencies.sp-runtime] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.42" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dev-dependencies.pallet-balances] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.42" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [features] default = ["std"] @@ -72,7 +72,7 @@ std = [ "scale-info/std", "sp-std/std", "sp-runtime/std", - "node-primitives/std", + "bifrost-primitives/std", "orml-traits/std", ] runtime-benchmarks = [ diff --git a/pallets/stable-asset/src/lib.rs b/pallets/stable-asset/src/lib.rs index e6c6acb12..126d29815 100644 --- a/pallets/stable-asset/src/lib.rs +++ b/pallets/stable-asset/src/lib.rs @@ -19,8 +19,6 @@ #![allow(clippy::type_complexity)] #![allow(clippy::too_many_arguments)] -extern crate sp_runtime; - pub use pallet::*; #[cfg(test)] @@ -32,19 +30,15 @@ mod tests; pub mod weights; pub use crate::traits::StableAsset; -use frame_support::{ - codec::{Decode, Encode}, - dispatch::{DispatchError, DispatchResult}, - ensure, - traits::Get, - weights::Weight, -}; +use codec::{Decode, Encode}; +use frame_support::{dispatch::DispatchResult, ensure, traits::Get, weights::Weight}; +use frame_system::pallet_prelude::BlockNumberFor; use orml_traits::MultiCurrency; use scale_info::TypeInfo; use sp_core::{U256, U512}; use sp_runtime::{ traits::{AccountIdConversion, CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, One, Zero}, - SaturatedConversion, + DispatchError, SaturatedConversion, }; use sp_std::prelude::*; @@ -91,7 +85,8 @@ pub mod traits { use crate::{ MintResult, PoolTokenIndex, RedeemProportionResult, StableAssetPoolId, StableAssetPoolInfo, SwapResult, }; - use frame_support::dispatch::{DispatchError, DispatchResult}; + use frame_support::dispatch::DispatchResult; + use sp_runtime::DispatchError; use sp_std::prelude::*; pub trait ValidateAssetId { @@ -336,12 +331,8 @@ pub mod pallet { use super::{PoolTokenIndex, StableAssetPoolId, StableAssetPoolInfo}; use crate::traits::{StableAsset, ValidateAssetId}; use crate::WeightInfo; - use frame_support::{ - dispatch::{Codec, DispatchResult}, - pallet_prelude::*, - traits::EnsureOrigin, - transactional, PalletId, - }; + use codec::Codec; + use frame_support::{dispatch::DispatchResult, pallet_prelude::*, traits::EnsureOrigin, transactional, PalletId}; use frame_system::pallet_prelude::*; use orml_traits::MultiCurrency; use sp_runtime::{ @@ -368,7 +359,7 @@ pub mod pallet { + From + From + From - + From + + From> + TryFrom + Zero + One @@ -404,7 +395,7 @@ pub mod pallet { _, Blake2_128Concat, StableAssetPoolId, - StableAssetPoolInfo, + StableAssetPoolInfo>, >; #[pallet::storage] @@ -510,7 +501,7 @@ pub mod pallet { AModified { pool_id: StableAssetPoolId, value: T::AtLeast64BitUnsigned, - time: T::BlockNumber, + time: BlockNumberFor, }, FeeModified { pool_id: StableAssetPoolId, @@ -711,7 +702,7 @@ pub mod pallet { origin: OriginFor, pool_id: StableAssetPoolId, a: T::AtLeast64BitUnsigned, - future_a_block: T::BlockNumber, + future_a_block: BlockNumberFor, ) -> DispatchResult { T::ListingOrigin::ensure_origin(origin)?; ::modify_a(pool_id, a, future_a_block) @@ -788,9 +779,9 @@ impl Pallet { pub fn get_a( a0: T::AtLeast64BitUnsigned, - t0: T::BlockNumber, + t0: BlockNumberFor, a1: T::AtLeast64BitUnsigned, - t1: T::BlockNumber, + t1: BlockNumberFor, ) -> Option { let current_block = frame_system::Pallet::::block_number(); if current_block < t1 { @@ -927,7 +918,13 @@ impl Pallet { } pub fn get_mint_amount( - pool_info: &StableAssetPoolInfo, + pool_info: &StableAssetPoolInfo< + T::AssetId, + T::AtLeast64BitUnsigned, + T::Balance, + T::AccountId, + BlockNumberFor, + >, amounts_bal: &[T::Balance], ) -> Result, Error> { // update pool balances and total supply to avoid stale data @@ -996,7 +993,13 @@ impl Pallet { } pub fn get_swap_amount( - pool_info: &StableAssetPoolInfo, + pool_info: &StableAssetPoolInfo< + T::AssetId, + T::AtLeast64BitUnsigned, + T::Balance, + T::AccountId, + BlockNumberFor, + >, input_index: PoolTokenIndex, output_index: PoolTokenIndex, dx_bal: T::Balance, @@ -1070,7 +1073,13 @@ impl Pallet { } pub fn get_swap_amount_exact( - pool_info: &StableAssetPoolInfo, + pool_info: &StableAssetPoolInfo< + T::AssetId, + T::AtLeast64BitUnsigned, + T::Balance, + T::AccountId, + BlockNumberFor, + >, input_index: PoolTokenIndex, output_index: PoolTokenIndex, dy_bal: T::Balance, @@ -1137,7 +1146,13 @@ impl Pallet { } pub fn get_redeem_proportion_amount( - pool_info: &StableAssetPoolInfo, + pool_info: &StableAssetPoolInfo< + T::AssetId, + T::AtLeast64BitUnsigned, + T::Balance, + T::AccountId, + BlockNumberFor, + >, amount_bal: T::Balance, ) -> Result, Error> { // update pool balances and total supply to avoid stale data @@ -1199,7 +1214,13 @@ impl Pallet { } pub fn get_redeem_single_amount( - pool_info: &StableAssetPoolInfo, + pool_info: &StableAssetPoolInfo< + T::AssetId, + T::AtLeast64BitUnsigned, + T::Balance, + T::AccountId, + BlockNumberFor, + >, amount_bal: T::Balance, i: PoolTokenIndex, ) -> Result, Error> { @@ -1268,7 +1289,13 @@ impl Pallet { } pub fn get_redeem_multi_amount( - pool_info: &StableAssetPoolInfo, + pool_info: &StableAssetPoolInfo< + T::AssetId, + T::AtLeast64BitUnsigned, + T::Balance, + T::AccountId, + BlockNumberFor, + >, amounts: &[T::Balance], ) -> Result, Error> { // update pool balances and total supply to avoid stale data @@ -1333,7 +1360,13 @@ impl Pallet { } pub fn get_pending_fee_amount( - pool_info: &StableAssetPoolInfo, + pool_info: &StableAssetPoolInfo< + T::AssetId, + T::AtLeast64BitUnsigned, + T::Balance, + T::AccountId, + BlockNumberFor, + >, ) -> Result, Error> { let mut balances: Vec = Self::convert_vec_balance_to_number(pool_info.balances.clone()); @@ -1387,9 +1420,15 @@ impl Pallet { } pub fn get_collect_yield_amount( - pool_info: &StableAssetPoolInfo, + pool_info: &StableAssetPoolInfo< + T::AssetId, + T::AtLeast64BitUnsigned, + T::Balance, + T::AccountId, + BlockNumberFor, + >, ) -> Result< - StableAssetPoolInfo, + StableAssetPoolInfo>, Error, > { let a: T::AtLeast64BitUnsigned = Self::get_a( @@ -1407,9 +1446,15 @@ impl Pallet { } pub fn get_balance_update_amount( - pool_info: &StableAssetPoolInfo, + pool_info: &StableAssetPoolInfo< + T::AssetId, + T::AtLeast64BitUnsigned, + T::Balance, + T::AccountId, + BlockNumberFor, + >, ) -> Result< - StableAssetPoolInfo, + StableAssetPoolInfo>, Error, > { let mut updated_balances = pool_info.balances.clone(); @@ -1443,7 +1488,7 @@ impl StableAsset for Pallet { type AtLeast64BitUnsigned = T::AtLeast64BitUnsigned; type Balance = T::Balance; type AccountId = T::AccountId; - type BlockNumber = T::BlockNumber; + type BlockNumber = BlockNumberFor; type Config = T; fn set_token_rate( @@ -2054,7 +2099,7 @@ impl StableAsset for Pallet { fn modify_a( pool_id: StableAssetPoolId, a: Self::AtLeast64BitUnsigned, - future_a_block: T::BlockNumber, + future_a_block: BlockNumberFor, ) -> DispatchResult { Pools::::try_mutate_exists(pool_id, |maybe_pool_info| -> DispatchResult { let pool_info = maybe_pool_info.as_mut().ok_or(Error::::PoolNotFound)?; @@ -2081,8 +2126,14 @@ impl StableAsset for Pallet { } fn get_collect_yield_amount( - pool_info: &StableAssetPoolInfo, - ) -> Option> { + pool_info: &StableAssetPoolInfo< + T::AssetId, + T::AtLeast64BitUnsigned, + T::Balance, + T::AccountId, + BlockNumberFor, + >, + ) -> Option>> { Self::get_collect_yield_amount(pool_info).ok() } @@ -2207,9 +2258,9 @@ impl StableAsset for Pallet { fn get_a( a0: T::AtLeast64BitUnsigned, - t0: T::BlockNumber, + t0: BlockNumberFor, a1: T::AtLeast64BitUnsigned, - t1: T::BlockNumber, + t1: BlockNumberFor, ) -> Option { Self::get_a(a0, t0, a1, t1) } diff --git a/pallets/stable-asset/src/mock.rs b/pallets/stable-asset/src/mock.rs index 278972559..f7518cdc6 100644 --- a/pallets/stable-asset/src/mock.rs +++ b/pallets/stable-asset/src/mock.rs @@ -17,7 +17,7 @@ use crate as stable_asset; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, + dispatch::DispatchResult, parameter_types, traits::{ConstU128, ConstU16, ConstU32, ConstU64, Currency, EnsureOrigin, Everything, Nothing, OnUnbalanced}, PalletId, @@ -25,25 +25,18 @@ use frame_support::{ use frame_system::RawOrigin; use orml_traits::MultiCurrency; use sp_core::H256; -use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, -}; +use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; +use sp_runtime::{BuildStorage, DispatchError}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call}, - StableAsset: stable_asset::{Pallet, Call, Storage, Event}, + pub enum Test { + System: frame_system, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: bifrost_currencies, + StableAsset: stable_asset, } ); @@ -56,13 +49,12 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u32; + type Block = Block; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type Version = (); @@ -86,7 +78,7 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type MaxReserves = (); type ReserveIdentifier = [u8; 8]; - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = (); type MaxFreezes = (); @@ -303,8 +295,8 @@ impl stable_asset::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - frame_system::GenesisConfig::default() - .build_storage::() + frame_system::GenesisConfig::::default() + .build_storage() .unwrap() .into() } diff --git a/pallets/stable-asset/src/tests.rs b/pallets/stable-asset/src/tests.rs index 72ad9415d..38a5f477d 100644 --- a/pallets/stable-asset/src/tests.rs +++ b/pallets/stable-asset/src/tests.rs @@ -22,8 +22,8 @@ use crate::{ }; use frame_support::assert_noop; use frame_support::assert_ok; -use frame_support::dispatch::DispatchError; use orml_traits::MultiCurrency; +use sp_runtime::DispatchError; pub const BALANCE_OFF: u128 = 1; diff --git a/pallets/stable-pool/Cargo.toml b/pallets/stable-pool/Cargo.toml index 50351428e..899974677 100644 --- a/pallets/stable-pool/Cargo.toml +++ b/pallets/stable-pool/Cargo.toml @@ -9,33 +9,33 @@ edition = "2021" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -node-primitives = { path = "../../node/primitives", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } nutsfinance-stable-asset = { path = "../../pallets/stable-asset", default-features = false } log = { version = "0.4.17", default-features = false } bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } orml-tokens = "0.4.1-dev" -bifrost-currencies = { workspace = true } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} orml-xtokens = "0.4.1-dev" env_logger = "0.10.0" bifrost-runtime-common = { package = "bifrost-runtime-common", path = "../../runtime/common", default-features = false } bifrost-asset-registry = { path = "../asset-registry", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] @@ -48,7 +48,7 @@ std = [ "pallet-balances/std", "nutsfinance-stable-asset/std", "orml-traits/std", - "node-primitives/std", + "bifrost-primitives/std", "bifrost-asset-registry/std", "bifrost-runtime-common/std", ] diff --git a/pallets/stable-pool/rpc/Cargo.toml b/pallets/stable-pool/rpc/Cargo.toml index a7afe2c9a..c3bbd0ba1 100644 --- a/pallets/stable-pool/rpc/Cargo.toml +++ b/pallets/stable-pool/rpc/Cargo.toml @@ -8,10 +8,10 @@ edition = "2021" serde = { version = "1.0.140", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server", "macros"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -node-primitives = { path = "../../../node/primitives", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bifrost-primitives = { path = "../../../primitives", default-features = false } bifrost-stable-pool-rpc-runtime-api = { path = "./runtime-api" } diff --git a/pallets/stable-pool/rpc/runtime-api/Cargo.toml b/pallets/stable-pool/rpc/runtime-api/Cargo.toml index d1f10ee2a..8cb9eeb45 100644 --- a/pallets/stable-pool/rpc/runtime-api/Cargo.toml +++ b/pallets/stable-pool/rpc/runtime-api/Cargo.toml @@ -6,14 +6,14 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../../../node/primitives", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../../../primitives", default-features = false } [features] default = ["std"] std = [ "codec/std", "sp-api/std", - "node-primitives/std", + "bifrost-primitives/std", ] diff --git a/pallets/stable-pool/rpc/runtime-api/src/lib.rs b/pallets/stable-pool/rpc/runtime-api/src/lib.rs index 0b05b3bf5..3038aa97e 100644 --- a/pallets/stable-pool/rpc/runtime-api/src/lib.rs +++ b/pallets/stable-pool/rpc/runtime-api/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,7 +18,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use node_primitives::Balance; +use bifrost_primitives::Balance; use sp_api::decl_runtime_apis; use sp_std::vec::Vec; diff --git a/pallets/stable-pool/rpc/src/lib.rs b/pallets/stable-pool/rpc/src/lib.rs index 95c3c6401..6e35b4d15 100644 --- a/pallets/stable-pool/rpc/src/lib.rs +++ b/pallets/stable-pool/rpc/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,13 +18,13 @@ use std::{marker::PhantomData, sync::Arc}; +use bifrost_primitives::Balance; pub use bifrost_stable_pool_rpc_runtime_api::{self as runtime_api, StablePoolRuntimeApi}; use jsonrpsee::{ core::{async_trait, RpcResult}, proc_macros::rpc, types::error::{CallError, ErrorCode, ErrorObject}, }; -use node_primitives::Balance; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_rpc::number::NumberOrHex; diff --git a/pallets/stable-pool/src/benchmarking.rs b/pallets/stable-pool/src/benchmarking.rs index 9a2a98422..c870bef1b 100644 --- a/pallets/stable-pool/src/benchmarking.rs +++ b/pallets/stable-pool/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,13 +18,14 @@ #![cfg(feature = "runtime-benchmarks")] use crate::{Pallet as StablePool, *}; -use frame_benchmarking::{account, benchmarks, vec, whitelisted_caller}; -use frame_support::assert_ok; -use frame_system::RawOrigin; -pub use node_primitives::{ +pub use bifrost_primitives::{ AccountId, Balance, CurrencyId, CurrencyIdMapping, SlpOperator, SlpxOperator, TokenSymbol, BNC, DOT, DOT_TOKEN_ID, GLMR, KSM, VDOT, }; +use frame_benchmarking::{account, benchmarks, whitelisted_caller}; +use frame_support::assert_ok; +use frame_system::RawOrigin; +use sp_std::vec; benchmarks! { create_pool { diff --git a/pallets/stable-pool/src/lib.rs b/pallets/stable-pool/src/lib.rs index 1c98eaf53..d5b9bdaec 100644 --- a/pallets/stable-pool/src/lib.rs +++ b/pallets/stable-pool/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -30,12 +30,12 @@ pub mod weights; pub use weights::*; pub mod traits; -use frame_support::{self, pallet_prelude::*, sp_runtime::traits::Zero, transactional}; -use frame_system::pallet_prelude::*; -use node_primitives::{ +use bifrost_primitives::{ CurrencyId, CurrencyIdConversion, CurrencyIdExt, CurrencyIdRegister, TimeUnit, VtokenMintingOperator, }; +use frame_support::{self, pallet_prelude::*, sp_runtime::traits::Zero, transactional}; +use frame_system::pallet_prelude::*; pub use nutsfinance_stable_asset::{ MintResult, PoolCount, PoolTokenIndex, Pools, RedeemMultiResult, RedeemProportionResult, RedeemSingleResult, StableAsset, StableAssetPoolId, SwapResult, @@ -88,7 +88,7 @@ pub mod pallet { AccountId = AccountIdOf, AtLeast64BitUnsigned = Self::AtLeast64BitUnsigned, Config = Self, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, >; type VtokenMinting: VtokenMintingOperator< @@ -224,7 +224,7 @@ pub mod pallet { origin: OriginFor, pool_id: StableAssetPoolId, a: T::AtLeast64BitUnsigned, - future_a_block: T::BlockNumber, + future_a_block: BlockNumberFor, ) -> DispatchResult { T::ControlOrigin::ensure_origin(origin)?; T::StableAsset::modify_a(pool_id, a, future_a_block) diff --git a/pallets/stable-pool/src/mock.rs b/pallets/stable-pool/src/mock.rs index d0b82188f..1912c9d28 100644 --- a/pallets/stable-pool/src/mock.rs +++ b/pallets/stable-pool/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,23 +17,23 @@ // along with this program. If not, see . use crate as bifrost_stable_pool; use bifrost_asset_registry::AssetIdMaps; +pub use bifrost_primitives::{ + currency::{MOVR, VMOVR}, + AccountId, Balance, CurrencyId, CurrencyIdMapping, SlpOperator, SlpxOperator, TokenSymbol, + ASTR, BNC, DOT, DOT_TOKEN_ID, GLMR, VBNC, VDOT, +}; use bifrost_runtime_common::milli; use frame_support::{ ord_parameter_types, parameter_types, - traits::{ConstU128, ConstU16, ConstU32, ConstU64, Everything, GenesisBuild, Nothing}, + traits::{ConstU128, ConstU16, ConstU32, ConstU64, Everything, Nothing}, PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; -pub use node_primitives::{ - currency::{MOVR, VMOVR}, - AccountId, Balance, CurrencyId, CurrencyIdMapping, SlpOperator, SlpxOperator, TokenSymbol, - ASTR, BNC, DOT, DOT_TOKEN_ID, GLMR, VBNC, VDOT, -}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use xcm::{ prelude::*, @@ -42,26 +42,21 @@ use xcm::{ use xcm_builder::FixedWeightBounds; use xcm_executor::XcmExecutor; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { + pub enum Test { System: frame_system, Tokens: orml_tokens, - Currencies: bifrost_currencies::{Pallet, Call}, + Currencies: bifrost_currencies, Balances: pallet_balances, - XTokens: orml_xtokens::{Pallet, Call, Event}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, + XTokens: orml_xtokens, + PolkadotXcm: pallet_xcm, AssetRegistry: bifrost_asset_registry, - StableAsset: nutsfinance_stable_asset::{Pallet, Storage, Event}, + StableAsset: nutsfinance_stable_asset, StablePool: bifrost_stable_pool, - VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event}, + VtokenMinting: bifrost_vtoken_minting, } ); @@ -72,13 +67,12 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u32; + type Block = Block; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u128; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type Version = (); @@ -175,6 +169,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } parameter_type_with_key! { @@ -226,7 +221,7 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -357,6 +352,8 @@ impl pallet_xcm::Config for Test { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureSignedBy; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } pub struct ExtBuilder { @@ -398,7 +395,7 @@ impl ExtBuilder { // Build genesis storage according to the mock runtime. pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap().into(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap().into(); bifrost_asset_registry::GenesisConfig:: { currency: vec![ diff --git a/pallets/stable-pool/src/tests.rs b/pallets/stable-pool/src/tests.rs index 92063177d..f02bbe63c 100644 --- a/pallets/stable-pool/src/tests.rs +++ b/pallets/stable-pool/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -204,7 +204,8 @@ fn mint_successful_equal_amounts() { assert_eq!(Tokens::free_balance(coin0, &swap_id), 10000000u128 - BALANCE_OFF); assert_eq!(Tokens::free_balance(coin1, &swap_id), 10000000u128 - BALANCE_OFF); assert_eq!(Tokens::free_balance(pool_asset, &3), 199800000000000000u128 - BALANCE_OFF); - assert_eq!(Tokens::free_balance(pool_asset, &2), 200000000000000u128 - BALANCE_OFF); // fee_recipient + assert_eq!(Tokens::free_balance(pool_asset, &2), 200000000000000u128 - BALANCE_OFF); + // fee_recipient }); } diff --git a/pallets/stable-pool/src/traits.rs b/pallets/stable-pool/src/traits.rs index c7ea992db..25d1d537f 100644 --- a/pallets/stable-pool/src/traits.rs +++ b/pallets/stable-pool/src/traits.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/stable-pool/src/weights.rs b/pallets/stable-pool/src/weights.rs index f14efeef2..8ecdd622c 100644 --- a/pallets/stable-pool/src/weights.rs +++ b/pallets/stable-pool/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/system-maker/Cargo.toml b/pallets/system-maker/Cargo.toml index 1f1fe6339..c72c6d77f 100644 --- a/pallets/system-maker/Cargo.toml +++ b/pallets/system-maker/Cargo.toml @@ -10,34 +10,34 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] log = { version = "0.4.17", default-features = false } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -node-primitives = { path = "../../node/primitives", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -hex-literal = { version = "0.3.1" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +hex-literal = { version = "0.4.1" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-features = false } zenlink-protocol = { version = "*", default-features = false } bifrost-slp = { path = "../../pallets/slp", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [dev-dependencies] orml-tokens = "0.4.1-dev" orml-xtokens = "0.4.1-dev" orml-traits = "0.4.1-dev" -bifrost-currencies = { workspace = true } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-asset-registry = { path = "../asset-registry", default-features = false } [features] @@ -49,7 +49,7 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking/std", - "node-primitives/std", + "bifrost-primitives/std", "orml-traits/std", "bifrost-vtoken-minting/std", "zenlink-protocol/std", diff --git a/pallets/system-maker/src/benchmarking.rs b/pallets/system-maker/src/benchmarking.rs index d048f5d23..27049526b 100644 --- a/pallets/system-maker/src/benchmarking.rs +++ b/pallets/system-maker/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,13 +21,13 @@ #![cfg(feature = "runtime-benchmarks")] use crate::{BalanceOf, Call, Config, Info, Pallet as SystemMaker, Pallet, *}; +use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_benchmarking::v1::{account, benchmarks, BenchmarkError}; use frame_support::{ assert_ok, traits::{EnsureOrigin, Hooks}, }; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, TokenSymbol}; use orml_traits::MultiCurrency; use sp_core::Get; use sp_runtime::traits::{AccountIdConversion, UniqueSaturatedFrom}; diff --git a/pallets/system-maker/src/lib.rs b/pallets/system-maker/src/lib.rs index 42f1f5c95..553ec6247 100644 --- a/pallets/system-maker/src/lib.rs +++ b/pallets/system-maker/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -30,6 +30,9 @@ mod benchmarking; pub mod weights; +use bifrost_primitives::{ + CurrencyId, CurrencyIdConversion, TryConvertFrom, VtokenMintingInterface, +}; use cumulus_primitives_core::ParaId; use frame_support::{ pallet_prelude::*, @@ -37,7 +40,6 @@ use frame_support::{ transactional, PalletId, }; use frame_system::pallet_prelude::*; -use node_primitives::{CurrencyId, CurrencyIdConversion, TryConvertFrom, VtokenMintingInterface}; use orml_traits::MultiCurrency; pub use pallet::*; use sp_core::U256; diff --git a/pallets/system-maker/src/mock.rs b/pallets/system-maker/src/mock.rs index f701049ff..0d5285a3f 100644 --- a/pallets/system-maker/src/mock.rs +++ b/pallets/system-maker/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -22,6 +22,7 @@ #![allow(non_upper_case_globals)] use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{CurrencyId, SlpxOperator, TokenSymbol}; use bifrost_slp::{QueryId, QueryResponseManager}; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; @@ -30,23 +31,21 @@ use frame_support::{ pallet_prelude::Get, parameter_types, sp_runtime::{DispatchError, DispatchResult}, - sp_std::marker::PhantomData, - traits::{Everything, GenesisBuild, Nothing}, + traits::{Everything, Nothing}, PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; -use node_primitives::{CurrencyId, SlpxOperator, TokenSymbol}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; use sp_core::{hashing::blake2_256, ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{ AccountIdConversion, BlakeTwo256, Convert, IdentityLookup, TrailingZeroInput, UniqueSaturatedInto, }, - AccountId32, SaturatedConversion, + AccountId32, BuildStorage, SaturatedConversion, }; +use sp_std::marker::PhantomData; use xcm::{prelude::*, v3::Weight}; use xcm_builder::FixedWeightBounds; use xcm_executor::XcmExecutor; @@ -74,22 +73,18 @@ pub const vsBond: CurrencyId = CurrencyId::VSBond(TokenSymbol::BNC, 2001, 0, 8); pub const TREASURY_ACCOUNT: AccountId = AccountId32::new([9u8; 32]); frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - XTokens: orml_xtokens::{Pallet, Call, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - SystemMaker: bifrost_system_maker::{Pallet, Call, Storage, Event}, - Slp: bifrost_slp::{Pallet, Call, Storage, Event}, - VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event}, - ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Event, Storage}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + XTokens: orml_xtokens, + Balances: pallet_balances, + Currencies: bifrost_currencies, + SystemMaker: bifrost_system_maker, + Slp: bifrost_slp, + VtokenMinting: bifrost_vtoken_minting, + ZenlinkProtocol: zenlink_protocol, + AssetRegistry: bifrost_asset_registry, + PolkadotXcm: pallet_xcm, } ); @@ -103,7 +98,6 @@ impl bifrost_asset_registry::Config for Runtime { type WeightInfo = (); } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -115,15 +109,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u64; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -164,7 +157,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -491,6 +484,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } #[cfg(feature = "runtime-benchmarks")] @@ -522,6 +516,8 @@ impl pallet_xcm::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } pub struct ExtBuilder { @@ -556,7 +552,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/system-maker/src/tests.rs b/pallets/system-maker/src/tests.rs index 5475a6605..1fc01c654 100644 --- a/pallets/system-maker/src/tests.rs +++ b/pallets/system-maker/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,8 +21,8 @@ #![cfg(test)] use crate::{mock::*, *}; +use bifrost_primitives::{TimeUnit, VtokenMintingOperator}; use frame_support::assert_ok; -use node_primitives::{TimeUnit, VtokenMintingOperator}; use sp_arithmetic::per_things::Permill; #[test] @@ -80,8 +80,8 @@ fn init_zenlink(para_id: u32) -> AccountIdOf { asset_0_currency_id, asset_1_currency_id )); - let deadline: BlockNumberFor = >::block_number() + - ::BlockNumber::from(100u32); + let deadline: BlockNumberFor = + >::block_number() + BlockNumberFor::::from(100u32); assert_ok!(ZenlinkProtocol::add_liquidity( RuntimeOrigin::signed(ALICE), asset_0_currency_id, diff --git a/pallets/system-maker/src/weights.rs b/pallets/system-maker/src/weights.rs index 2591f3389..f84810dcf 100644 --- a/pallets/system-maker/src/weights.rs +++ b/pallets/system-maker/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/system-staking/Cargo.toml b/pallets/system-staking/Cargo.toml index 05cc9fcb3..c0af5df1d 100644 --- a/pallets/system-staking/Cargo.toml +++ b/pallets/system-staking/Cargo.toml @@ -17,21 +17,21 @@ log = "0.4.17" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -frame-support = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42"} -frame-system = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -frame-benchmarking = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", optional = true } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +frame-support = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0"} +frame-system = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0", optional = true } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -sp-runtime = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -node-primitives = { path = "../../node/primitives", default-features = false } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } +bifrost-primitives = { path = "../../primitives", default-features = false } [dev-dependencies] -sp-core = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -sp-io = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -pallet-balances = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -bifrost-currencies = { workspace = true } +sp-core = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } +sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} orml-tokens = "0.4.1-dev" orml-xtokens = "0.4.1-dev" orml-traits = "0.4.1-dev" @@ -40,11 +40,11 @@ bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-featur bifrost-slp = { path = "../../pallets/slp", default-features = false } bifrost-farming = { path = "../../pallets/farming", default-features = false } bifrost-asset-registry = { path = "../../pallets/asset-registry" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-runtime-common = { package = "bifrost-runtime-common", path = "../../runtime/common" } [features] @@ -57,7 +57,7 @@ std = [ "frame-benchmarking/std", "sp-std/std", "sp-runtime/std", - "node-primitives/std", + "bifrost-primitives/std", "orml-traits/std", "sp-arithmetic/std", "bifrost-slp/std", diff --git a/pallets/system-staking/src/benchmarking.rs b/pallets/system-staking/src/benchmarking.rs index 4cee8edac..fc962f2fb 100644 --- a/pallets/system-staking/src/benchmarking.rs +++ b/pallets/system-staking/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,14 +18,15 @@ #![cfg(feature = "runtime-benchmarks")] use crate::{Pallet as SystemStaking, *}; -use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, vec, whitelisted_caller}; +use bifrost_primitives::{CurrencyId, PoolId, TokenSymbol}; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller}; use frame_support::{ assert_ok, sp_runtime::{traits::UniqueSaturatedFrom, Perbill, Permill}, traits::OnInitialize, }; use frame_system::{Pallet as System, RawOrigin}; -use node_primitives::{CurrencyId, PoolId, TokenSymbol}; +use sp_std::vec; benchmarks! { on_initialize { diff --git a/pallets/system-staking/src/lib.rs b/pallets/system-staking/src/lib.rs index 3156edc1f..d72e6cc1c 100644 --- a/pallets/system-staking/src/lib.rs +++ b/pallets/system-staking/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,15 +20,16 @@ pub mod types; pub mod weights; pub use weights::WeightInfo; +use bifrost_primitives::{CurrencyId, FarmingInfo, PoolId, VtokenMintingInterface}; pub use frame_support::weights::Weight; -use frame_support::{dispatch::DispatchResultWithPostInfo, inherent::Vec, traits::Get, PalletId}; -use node_primitives::{CurrencyId, FarmingInfo, PoolId, VtokenMintingInterface}; +use frame_support::{dispatch::DispatchResultWithPostInfo, traits::Get, PalletId}; use orml_traits::MultiCurrency; pub use pallet::*; use sp_runtime::{ traits::{AccountIdConversion, Saturating, Zero}, BoundedVec, }; +use sp_std::vec::Vec; pub use types::*; pub use RoundIndex; #[cfg(test)] @@ -109,7 +110,7 @@ pub mod pallet { /// Current Round Information #[pallet::storage] #[pallet::getter(fn round)] - pub(crate) type Round = StorageValue<_, RoundInfo, OptionQuery>; + pub(crate) type Round = StorageValue<_, RoundInfo>, OptionQuery>; /// The tokenInfo for each currency #[pallet::storage] @@ -128,7 +129,7 @@ pub mod pallet { pub enum Event { NewRound { current: RoundIndex, - first: T::BlockNumber, + first: BlockNumberFor, length: u32, }, TokenConfigChanged { @@ -230,7 +231,7 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn on_initialize(n: T::BlockNumber) -> Weight { + fn on_initialize(n: BlockNumberFor) -> Weight { // Get token list let token_list = Self::token_list(); diff --git a/pallets/system-staking/src/mock.rs b/pallets/system-staking/src/mock.rs index 756346199..9b90608d6 100644 --- a/pallets/system-staking/src/mock.rs +++ b/pallets/system-staking/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,6 +19,7 @@ #![allow(non_upper_case_globals)] use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{CurrencyId, SlpxOperator, TokenSymbol}; use bifrost_slp::{QueryId, QueryResponseManager}; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; @@ -27,20 +28,18 @@ use frame_support::{ ord_parameter_types, pallet_prelude::Get, parameter_types, - traits::{Everything, GenesisBuild, Nothing, OnFinalize, OnInitialize}, + traits::{Everything, Nothing, OnFinalize, OnInitialize}, PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; -use node_primitives::{CurrencyId, SlpxOperator, TokenSymbol}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_core::{blake2_256, ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{ AccountIdConversion, BlakeTwo256, Convert, ConvertInto, IdentityLookup, TrailingZeroInput, }, - AccountId32, + AccountId32, BuildStorage, }; use sp_std::vec; use xcm::v3::Weight; @@ -66,26 +65,21 @@ pub const CHARLIE: AccountId = AccountId32::new([3u8; 32]); pub const TREASURY_ACCOUNT: AccountId32 = AccountId32::new([9u8; 32]); frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - XTokens: orml_xtokens::{Pallet, Call, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - Slp: bifrost_slp::{Pallet, Call, Storage, Event}, - VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event}, - Farming: bifrost_farming::{Pallet, Call, Storage, Event}, - SystemStaking: system_staking::{Pallet, Call, Storage, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Event, Storage}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + XTokens: orml_xtokens, + Balances: pallet_balances, + Currencies: bifrost_currencies, + Slp: bifrost_slp, + VtokenMinting: bifrost_vtoken_minting, + Farming: bifrost_farming, + SystemStaking: system_staking, + AssetRegistry: bifrost_asset_registry, + PolkadotXcm: pallet_xcm, } ); -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -97,15 +91,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -146,7 +139,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -420,6 +413,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } #[cfg(feature = "runtime-benchmarks")] @@ -451,6 +445,8 @@ impl pallet_xcm::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } pub struct ExtBuilder { @@ -484,7 +480,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/system-staking/src/tests.rs b/pallets/system-staking/src/tests.rs index 39a9a52f1..ceef35ec6 100644 --- a/pallets/system-staking/src/tests.rs +++ b/pallets/system-staking/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,12 +18,12 @@ #![cfg(test)] use crate::{mock::*, *}; use bifrost_asset_registry::AssetMetadata; +use bifrost_primitives::{TimeUnit, TokenInfo, VtokenMintingOperator}; use bifrost_runtime_common::milli; use frame_support::{ assert_ok, sp_runtime::{Perbill, Permill}, }; -use node_primitives::{TimeUnit, TokenInfo, VtokenMintingOperator}; use sp_std::{collections::btree_map::BTreeMap, prelude::*}; #[test] diff --git a/pallets/system-staking/src/types.rs b/pallets/system-staking/src/types.rs index 3402e3bb5..eec19306e 100644 --- a/pallets/system-staking/src/types.rs +++ b/pallets/system-staking/src/types.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -16,9 +16,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . use crate::RoundIndex; +use bifrost_primitives::PoolId; use codec::{Decode, Encode}; use frame_support::pallet_prelude::*; -use node_primitives::PoolId; use sp_arithmetic::per_things::{Perbill, Permill}; use sp_runtime::traits::Zero; use sp_std::prelude::*; diff --git a/pallets/system-staking/src/weights.rs b/pallets/system-staking/src/weights.rs index fa40d07ab..4c03afc00 100644 --- a/pallets/system-staking/src/weights.rs +++ b/pallets/system-staking/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/token-issuer/Cargo.toml b/pallets/token-issuer/Cargo.toml index 135cefb60..600c5f636 100644 --- a/pallets/token-issuer/Cargo.toml +++ b/pallets/token-issuer/Cargo.toml @@ -6,30 +6,30 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } orml-tokens = { version = "0.4.1-dev", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } log = { version = "0.4.17", default-features = false } [dev-dependencies] -bifrost-currencies = { workspace = true } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} [features] default = ["std"] std = [ "codec/std", "scale-info/std", - "node-primitives/std", + "bifrost-primitives/std", "frame-support/std", "frame-system/std", "sp-std/std", diff --git a/pallets/token-issuer/src/benchmarking.rs b/pallets/token-issuer/src/benchmarking.rs index 277105658..e910c8ea6 100644 --- a/pallets/token-issuer/src/benchmarking.rs +++ b/pallets/token-issuer/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,12 +17,12 @@ // along with this program. If not, see . #![cfg(feature = "runtime-benchmarks")] +use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_benchmarking::{ account, benchmarks, impl_benchmark_test_suite, v1::BenchmarkError, whitelisted_caller, }; -use frame_support::{dispatch::UnfilteredDispatchable, sp_runtime::traits::UniqueSaturatedFrom}; +use frame_support::{sp_runtime::traits::UniqueSaturatedFrom, traits::UnfilteredDispatchable}; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, TokenSymbol}; use super::*; #[allow(unused_imports)] diff --git a/pallets/token-issuer/src/lib.rs b/pallets/token-issuer/src/lib.rs index 936880d31..3ec8c0a2c 100644 --- a/pallets/token-issuer/src/lib.rs +++ b/pallets/token-issuer/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -22,9 +22,9 @@ extern crate alloc; use alloc::{vec, vec::Vec}; +use bifrost_primitives::CurrencyId; use frame_support::{ensure, pallet_prelude::*}; use frame_system::pallet_prelude::*; -use node_primitives::CurrencyId; use orml_traits::MultiCurrency; use sp_core::bounded::BoundedVec; pub use weights::WeightInfo; @@ -116,7 +116,7 @@ pub mod pallet { pub struct Pallet(PhantomData); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet { diff --git a/pallets/token-issuer/src/migrations/mod.rs b/pallets/token-issuer/src/migrations/mod.rs index fea2101e5..504be9301 100644 --- a/pallets/token-issuer/src/migrations/mod.rs +++ b/pallets/token-issuer/src/migrations/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/token-issuer/src/migrations/v2.rs b/pallets/token-issuer/src/migrations/v2.rs index 475d2891f..1ebcc9247 100644 --- a/pallets/token-issuer/src/migrations/v2.rs +++ b/pallets/token-issuer/src/migrations/v2.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,6 +18,8 @@ use crate::*; use frame_support::traits::OnRuntimeUpgrade; +#[cfg(feature = "try-runtime")] +use sp_runtime::TryRuntimeError; const LOG_TARGET: &str = "token-issuer::migration"; @@ -79,7 +81,7 @@ impl OnRuntimeUpgrade for TokenIssuerMigration { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, TryRuntimeError> { let issue_white_list_cnt = IssueWhiteList::::iter().count(); // print out the pre-migrate storage count log::info!(target: LOG_TARGET, "IssueWhiteList storage count: {:?}", issue_white_list_cnt); @@ -96,7 +98,7 @@ impl OnRuntimeUpgrade for TokenIssuerMigration { } #[cfg(feature = "try-runtime")] - fn post_upgrade(cnt: Vec) -> Result<(), &'static str> { + fn post_upgrade(cnt: Vec) -> Result<(), TryRuntimeError> { let (issue_white_list_cnt_old, transfer_white_list_cnt_old): (u32, u32) = Decode::decode( &mut cnt.as_slice(), ) diff --git a/pallets/token-issuer/src/mock.rs b/pallets/token-issuer/src/mock.rs index 94f721986..757d11de6 100644 --- a/pallets/token-issuer/src/mock.rs +++ b/pallets/token-issuer/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,21 +20,16 @@ #![allow(non_upper_case_globals)] use crate::Weight; -use frame_support::{ - parameter_types, - traits::{GenesisBuild, Nothing}, - PalletId, -}; -use frame_system::EnsureRoot; -use node_primitives::{ +use bifrost_primitives::{ currency::{BNC, DOT, KSM, VDOT}, CurrencyId, TokenSymbol, }; +use frame_support::{parameter_types, traits::Nothing, PalletId}; +use frame_system::EnsureRoot; use sp_core::{ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{AccountIdConversion, BlakeTwo256, IdentityLookup}, - AccountId32, + AccountId32, BuildStorage, }; use crate as bifrost_token_issuer; @@ -50,21 +45,16 @@ pub const BOB: AccountId = AccountId32::new([1u8; 32]); pub const CHARLIE: AccountId = AccountId32::new([3u8; 32]); frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - Council: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config}, - TokenIssuer: bifrost_token_issuer::{Pallet, Call, Storage, Event} + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + Balances: pallet_balances, + Currencies: bifrost_currencies, + Council: pallet_collective::, + TokenIssuer: bifrost_token_issuer } ); -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -76,15 +66,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -125,7 +114,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -224,7 +213,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/token-issuer/src/tests.rs b/pallets/token-issuer/src/tests.rs index 9af4ec691..f646577b0 100644 --- a/pallets/token-issuer/src/tests.rs +++ b/pallets/token-issuer/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,8 +18,8 @@ #![cfg(test)] +use bifrost_primitives::currency::ZLK; use frame_support::{assert_noop, assert_ok}; -use node_primitives::currency::ZLK; use crate::{mock::*, *}; diff --git a/pallets/token-issuer/src/weights.rs b/pallets/token-issuer/src/weights.rs index 7ffa3b23c..4b18dc31d 100644 --- a/pallets/token-issuer/src/weights.rs +++ b/pallets/token-issuer/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/traits/Cargo.toml b/pallets/traits/Cargo.toml index 4e49c7a2a..32ca11f51 100644 --- a/pallets/traits/Cargo.toml +++ b/pallets/traits/Cargo.toml @@ -11,27 +11,27 @@ targets = ['x86_64-unknown-linux-gnu'] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } log = { version = "0.4.17", default-features = false } num-bigint = { version = '0.4.3', default-features = false } num-traits = { version = '0.2.15', default-features = false } impl-trait-for-tuples = "0.2.2" -primitives = { package = "node-primitives", path = "../../node/primitives", default-features = false } -scale-info = { version = "2.3.1", default-features = false, features = [ +bifrost-primitives = { path = "../../primitives", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } serde = { version = "1.0.160", features = ['derive'], optional = true } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, features = [ +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, features = [ 'std', ] } @@ -45,7 +45,7 @@ std = [ 'sp-runtime/std', 'scale-info/std', 'sp-std/std', - 'primitives/std', + 'bifrost-primitives/std', 'num-bigint/std', 'num-traits/std', 'sp-core/std', diff --git a/pallets/traits/src/lend_market.rs b/pallets/traits/src/lend_market.rs index 38093e4d3..dc7b9d459 100644 --- a/pallets/traits/src/lend_market.rs +++ b/pallets/traits/src/lend_market.rs @@ -12,11 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +use bifrost_primitives::{Rate, Ratio}; use codec::{Decode, Encode}; -use frame_support::dispatch::DispatchError; -use primitives::{Rate, Ratio}; use scale_info::TypeInfo; -use sp_runtime::{FixedU128, RuntimeDebug}; +use sp_runtime::{DispatchError, FixedU128, RuntimeDebug}; use sp_std::prelude::*; pub trait LendMarket { diff --git a/pallets/traits/src/lib.rs b/pallets/traits/src/lib.rs index 1fcdb4e5d..bfedd1594 100644 --- a/pallets/traits/src/lib.rs +++ b/pallets/traits/src/lib.rs @@ -1,7 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std)] +use bifrost_primitives::{CurrencyId, PriceDetail}; use num_bigint::{BigUint, ToBigUint}; -use primitives::{CurrencyId, PriceDetail}; pub mod lend_market; pub use lend_market::*; diff --git a/pallets/ve-minting/Cargo.toml b/pallets/ve-minting/Cargo.toml index eb165fe72..b6101df8d 100644 --- a/pallets/ve-minting/Cargo.toml +++ b/pallets/ve-minting/Cargo.toml @@ -11,33 +11,33 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -scale-info = { version = "2.1.2", default-features = false, features = [ +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } log = { version = "0.4.17", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -node-primitives = { path = "../../node/primitives", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -hex-literal = { version = "0.3.1" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +hex-literal = { version = "0.4.1" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [dev-dependencies] orml-tokens = "0.4.1-dev" -bifrost-currencies = { workspace = true } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} orml-xtokens = "0.4.1-dev" -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-slp = { path = "../../pallets/slp", default-features = false } bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-features = false } bifrost-asset-registry = { path = "../asset-registry", default-features = false } @@ -53,7 +53,7 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking/std", - "node-primitives/std", + "bifrost-primitives/std", "orml-traits/std", "bifrost-slp/std", "bifrost-asset-registry/std", diff --git a/pallets/ve-minting/rpc/Cargo.toml b/pallets/ve-minting/rpc/Cargo.toml index 78e2524cb..4d8850e2d 100644 --- a/pallets/ve-minting/rpc/Cargo.toml +++ b/pallets/ve-minting/rpc/Cargo.toml @@ -8,10 +8,10 @@ edition = "2021" serde = { version = "1.0.140", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server", "macros"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -node-primitives = { path = "../../../node/primitives", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +bifrost-primitives = { path = "../../../primitives", default-features = false } bifrost-ve-minting-rpc-runtime-api = { path = "./runtime-api" } diff --git a/pallets/ve-minting/rpc/runtime-api/Cargo.toml b/pallets/ve-minting/rpc/runtime-api/Cargo.toml index 22539c054..d9172d267 100644 --- a/pallets/ve-minting/rpc/runtime-api/Cargo.toml +++ b/pallets/ve-minting/rpc/runtime-api/Cargo.toml @@ -6,15 +6,15 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../../../node/primitives", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../../../primitives", default-features = false } [features] default = ["std"] std = [ "codec/std", "sp-api/std", - "node-primitives/std", + "bifrost-primitives/std", ] diff --git a/pallets/ve-minting/rpc/runtime-api/src/lib.rs b/pallets/ve-minting/rpc/runtime-api/src/lib.rs index f6eb1cb15..37e1c63cf 100644 --- a/pallets/ve-minting/rpc/runtime-api/src/lib.rs +++ b/pallets/ve-minting/rpc/runtime-api/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,8 +18,8 @@ #![cfg_attr(not(feature = "std"), no_std)] +use bifrost_primitives::{Balance, BlockNumber}; use codec::Codec; -use node_primitives::{Balance, BlockNumber}; use sp_api::decl_runtime_apis; use sp_core::U256; diff --git a/pallets/ve-minting/rpc/src/lib.rs b/pallets/ve-minting/rpc/src/lib.rs index 1eeec790e..ab0199bef 100644 --- a/pallets/ve-minting/rpc/src/lib.rs +++ b/pallets/ve-minting/rpc/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,6 +18,7 @@ use std::{marker::PhantomData, sync::Arc}; +use bifrost_primitives::Balance; pub use bifrost_ve_minting_rpc_runtime_api::{self as runtime_api, VeMintingRuntimeApi}; use codec::Codec; use jsonrpsee::{ @@ -25,7 +26,6 @@ use jsonrpsee::{ proc_macros::rpc, types::error::{CallError, ErrorCode, ErrorObject}, }; -use node_primitives::Balance; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_core::U256; diff --git a/pallets/ve-minting/src/benchmarking.rs b/pallets/ve-minting/src/benchmarking.rs index ed2707f04..12032e855 100644 --- a/pallets/ve-minting/src/benchmarking.rs +++ b/pallets/ve-minting/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -22,8 +22,8 @@ use frame_benchmarking::{account, benchmarks, v1::BenchmarkError}; use frame_support::{assert_ok, traits::EnsureOrigin}; +use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, TokenSymbol}; use sp_runtime::traits::UniqueSaturatedFrom; use sp_std::vec; diff --git a/pallets/ve-minting/src/incentive.rs b/pallets/ve-minting/src/incentive.rs index 738ad8d11..6650faf61 100644 --- a/pallets/ve-minting/src/incentive.rs +++ b/pallets/ve-minting/src/incentive.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -33,8 +33,8 @@ pub struct IncentiveConfig { } impl Pallet { - pub fn last_time_reward_applicable() -> T::BlockNumber { - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + pub fn last_time_reward_applicable() -> BlockNumberFor { + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); if current_block_number < Self::incentive_configs().period_finish { current_block_number } else { @@ -44,7 +44,7 @@ impl Pallet { pub fn reward_per_token() -> Result, BalanceOf>, DispatchError> { let mut conf = Self::incentive_configs(); - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); let _total_supply = Self::total_supply(current_block_number)?; if _total_supply == BalanceOf::::zero() { return Ok(conf.reward_per_token_stored); @@ -160,7 +160,7 @@ impl Pallet { ) -> DispatchResult { Self::update_reward(None)?; let mut conf = Self::incentive_configs(); - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); if current_block_number >= conf.period_finish { Self::add_reward(addr, &mut conf, &rewards, Zero::zero())?; diff --git a/pallets/ve-minting/src/lib.rs b/pallets/ve-minting/src/lib.rs index d33de65a8..a8818ca4e 100644 --- a/pallets/ve-minting/src/lib.rs +++ b/pallets/ve-minting/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -33,6 +33,7 @@ pub mod traits; pub mod weights; use crate::traits::Incentive; +use bifrost_primitives::CurrencyId; use frame_support::{ pallet_prelude::*, sp_runtime::{ @@ -46,7 +47,6 @@ use frame_support::{ }; use frame_system::pallet_prelude::*; pub use incentive::*; -use node_primitives::CurrencyId; use orml_traits::{MultiCurrency, MultiLockableCurrency}; pub use pallet::*; use sp_core::U256; @@ -112,13 +112,13 @@ pub mod pallet { type IncentivePalletId: Get; /// Convert the block number into a balance. - type BlockNumberToBalance: Convert>; + type BlockNumberToBalance: Convert, BalanceOf>; #[pallet::constant] - type Week: Get; + type Week: Get>; #[pallet::constant] - type MaxBlock: Get; + type MaxBlock: Get>; #[pallet::constant] type Multiplier: Get>; @@ -131,13 +131,13 @@ pub mod pallet { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { ConfigSet { - config: VeConfig, T::BlockNumber>, + config: VeConfig, BlockNumberFor>, }, Minted { addr: AccountIdOf, value: BalanceOf, - end: T::BlockNumber, - now: T::BlockNumber, + end: BlockNumberFor, + now: BlockNumberFor, }, Supply { supply_before: BalanceOf, @@ -146,11 +146,11 @@ pub mod pallet { LockCreated { addr: AccountIdOf, value: BalanceOf, - unlock_time: T::BlockNumber, + unlock_time: BlockNumberFor, }, UnlockTimeIncreased { addr: AccountIdOf, - unlock_time: T::BlockNumber, + unlock_time: BlockNumberFor, }, AmountIncreased { addr: AccountIdOf, @@ -161,7 +161,7 @@ pub mod pallet { value: BalanceOf, }, IncentiveSet { - rewards_duration: T::BlockNumber, + rewards_duration: BlockNumberFor, }, RewardAdded { rewards: Vec<(CurrencyIdOf, BalanceOf)>, @@ -189,7 +189,7 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn ve_configs)] pub type VeConfigs = - StorageValue<_, VeConfig, T::BlockNumber>, ValueQuery>; + StorageValue<_, VeConfig, BlockNumberFor>, ValueQuery>; #[pallet::storage] #[pallet::getter(fn epoch)] @@ -201,7 +201,7 @@ pub mod pallet { _, Blake2_128Concat, AccountIdOf, - LockedBalance, T::BlockNumber>, + LockedBalance, BlockNumberFor>, ValueQuery, >; @@ -209,7 +209,7 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn point_history)] pub type PointHistory = - StorageMap<_, Twox64Concat, U256, Point, T::BlockNumber>, ValueQuery>; + StorageMap<_, Twox64Concat, U256, Point, BlockNumberFor>, ValueQuery>; #[pallet::storage] #[pallet::getter(fn user_point_history)] @@ -219,7 +219,7 @@ pub mod pallet { AccountIdOf, Blake2_128Concat, U256, - Point, T::BlockNumber>, + Point, BlockNumberFor>, ValueQuery, >; @@ -231,13 +231,16 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn slope_changes)] pub type SlopeChanges = - StorageMap<_, Twox64Concat, T::BlockNumber, i128, ValueQuery>; + StorageMap<_, Twox64Concat, BlockNumberFor, i128, ValueQuery>; // Incentive #[pallet::storage] #[pallet::getter(fn incentive_configs)] - pub type IncentiveConfigs = - StorageValue<_, IncentiveConfig, BalanceOf, T::BlockNumber>, ValueQuery>; + pub type IncentiveConfigs = StorageValue< + _, + IncentiveConfig, BalanceOf, BlockNumberFor>, + ValueQuery, + >; #[pallet::storage] #[pallet::getter(fn user_reward_per_token_paid)] @@ -260,8 +263,8 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::set_config())] pub fn set_config( origin: OriginFor, - min_mint: Option>, // Minimum mint balance - min_block: Option, // Minimum lockup time + min_mint: Option>, // Minimum mint balance + min_block: Option>, // Minimum lockup time ) -> DispatchResult { T::ControlOrigin::ensure_origin(origin)?; @@ -283,7 +286,7 @@ pub mod pallet { pub fn create_lock( origin: OriginFor, value: BalanceOf, - unlock_time: T::BlockNumber, + unlock_time: BlockNumberFor, ) -> DispatchResult { let exchanger: AccountIdOf = ensure_signed(origin)?; Self::create_lock_inner(&exchanger, value, unlock_time) @@ -298,7 +301,10 @@ pub mod pallet { #[pallet::call_index(3)] #[pallet::weight(T::WeightInfo::increase_unlock_time())] - pub fn increase_unlock_time(origin: OriginFor, time: T::BlockNumber) -> DispatchResult { + pub fn increase_unlock_time( + origin: OriginFor, + time: BlockNumberFor, + ) -> DispatchResult { let exchanger = ensure_signed(origin)?; Self::increase_unlock_time_inner(&exchanger, time) } @@ -315,7 +321,7 @@ pub mod pallet { pub fn notify_rewards( origin: OriginFor, incentive_from: AccountIdOf, - rewards_duration: Option, + rewards_duration: Option>, rewards: Vec<(CurrencyIdOf, BalanceOf)>, ) -> DispatchResult { T::ControlOrigin::ensure_origin(origin)?; @@ -334,16 +340,16 @@ pub mod pallet { impl Pallet { pub fn _checkpoint( addr: &AccountIdOf, - old_locked: LockedBalance, T::BlockNumber>, - new_locked: LockedBalance, T::BlockNumber>, + old_locked: LockedBalance, BlockNumberFor>, + new_locked: LockedBalance, BlockNumberFor>, ) -> DispatchResult { Self::update_reward(Some(addr))?; - let mut u_old = Point::, T::BlockNumber>::default(); - let mut u_new = Point::, T::BlockNumber>::default(); + let mut u_old = Point::, BlockNumberFor>::default(); + let mut u_new = Point::, BlockNumberFor>::default(); let mut new_dslope = 0_i128; let mut g_epoch: U256 = Self::epoch(); - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); if old_locked.end > current_block_number && old_locked.amount > BalanceOf::::zero() { u_old.slope = U256::from(old_locked.amount.saturated_into::()) @@ -382,7 +388,7 @@ pub mod pallet { } } - let mut last_point: Point, T::BlockNumber> = Point { + let mut last_point: Point, BlockNumberFor> = Point { bias: 0_i128, slope: 0_i128, block: current_block_number, @@ -397,7 +403,7 @@ pub mod pallet { ); } let mut last_checkpoint = last_point.block; - let mut t_i: T::BlockNumber = last_checkpoint + let mut t_i: BlockNumberFor = last_checkpoint .checked_div(&T::Week::get()) .ok_or(ArithmeticError::Overflow)? .checked_mul(&T::Week::get()) @@ -508,10 +514,10 @@ pub mod pallet { pub fn _deposit_for( addr: &AccountIdOf, value: BalanceOf, - unlock_time: T::BlockNumber, - locked_balance: LockedBalance, T::BlockNumber>, + unlock_time: BlockNumberFor, + locked_balance: LockedBalance, BlockNumberFor>, ) -> DispatchResult { - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); let mut _locked = locked_balance; let supply_before = Self::supply(); Supply::::set(supply_before.checked_add(&value).ok_or(ArithmeticError::Overflow)?); @@ -550,12 +556,12 @@ pub mod pallet { pub(crate) fn balance_of_current_block( addr: &AccountIdOf, ) -> Result, DispatchError> { - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); let u_epoch = Self::user_point_epoch(addr); if u_epoch == U256::zero() { return Ok(Zero::zero()); } else { - let mut last_point: Point, T::BlockNumber> = + let mut last_point: Point, BlockNumberFor> = Self::user_point_history(addr, u_epoch); last_point.bias = last_point @@ -590,9 +596,9 @@ pub mod pallet { // Measure voting power of `addr` at block height `block` pub(crate) fn balance_of_at( addr: &AccountIdOf, - block: T::BlockNumber, + block: BlockNumberFor, ) -> Result, DispatchError> { - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); ensure!(block <= current_block_number, Error::::Expired); // Binary search @@ -617,7 +623,7 @@ pub mod pallet { } } - let mut upoint: Point, T::BlockNumber> = + let mut upoint: Point, BlockNumberFor> = Self::user_point_history(addr, _min); upoint.bias = upoint .bias diff --git a/pallets/ve-minting/src/mock.rs b/pallets/ve-minting/src/mock.rs index 3e67d3237..438b1fde6 100644 --- a/pallets/ve-minting/src/mock.rs +++ b/pallets/ve-minting/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -23,6 +23,7 @@ use crate as bifrost_ve_minting; use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{CurrencyId, CurrencyIdMapping, SlpxOperator, TokenSymbol}; use bifrost_runtime_common::{micro, milli}; use bifrost_slp::{QueryId, QueryResponseManager}; use codec::{Decode, Encode}; @@ -31,20 +32,18 @@ use frame_support::{ ord_parameter_types, pallet_prelude::Get, parameter_types, - traits::{Everything, GenesisBuild, Nothing}, + traits::{Everything, Nothing}, PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; -use node_primitives::{CurrencyId, CurrencyIdMapping, SlpxOperator, TokenSymbol}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_core::{blake2_256, ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{ AccountIdConversion, BlakeTwo256, Convert, ConvertInto, IdentityLookup, TrailingZeroInput, }, - AccountId32, + AccountId32, BuildStorage, }; use xcm::{prelude::*, v3::Weight}; use xcm_builder::FixedWeightBounds; @@ -66,25 +65,20 @@ pub const BOB: AccountId = AccountId32::new([1u8; 32]); pub const CHARLIE: AccountId = AccountId32::new([3u8; 32]); frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - XTokens: orml_xtokens::{Pallet, Call, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event}, - Slp: bifrost_slp::{Pallet, Call, Storage, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Event, Storage}, - VeMinting: bifrost_ve_minting::{Pallet, Call, Storage, Event}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + XTokens: orml_xtokens, + Balances: pallet_balances, + Currencies: bifrost_currencies, + VtokenMinting: bifrost_vtoken_minting, + Slp: bifrost_slp, + AssetRegistry: bifrost_asset_registry, + VeMinting: bifrost_ve_minting, + PolkadotXcm: pallet_xcm, } ); -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -98,15 +92,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -152,7 +145,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -419,6 +412,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } #[cfg(feature = "runtime-benchmarks")] @@ -450,6 +444,8 @@ impl pallet_xcm::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } pub struct ExtBuilder { @@ -483,7 +479,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/ve-minting/src/tests.rs b/pallets/ve-minting/src/tests.rs index a330c1285..bbeacecf4 100644 --- a/pallets/ve-minting/src/tests.rs +++ b/pallets/ve-minting/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -22,9 +22,9 @@ use crate::{mock::*, traits::VeMintingInterface, *}; use bifrost_asset_registry::AssetMetadata; +use bifrost_primitives::TokenInfo; use bifrost_runtime_common::milli; use frame_support::{assert_noop, assert_ok}; -use node_primitives::TokenInfo; #[test] fn _checkpoint() { diff --git a/pallets/ve-minting/src/traits.rs b/pallets/ve-minting/src/traits.rs index e162f57ca..3038a437f 100644 --- a/pallets/ve-minting/src/traits.rs +++ b/pallets/ve-minting/src/traits.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -38,25 +38,25 @@ pub trait VeMintingInterface { fn increase_unlock_time_inner(addr: &AccountId, _unlock_time: BlockNumber) -> DispatchResult; // Extend the unlock time for `addr` to `_unlock_time` } -impl VeMintingInterface, CurrencyIdOf, BalanceOf, T::BlockNumber> +impl VeMintingInterface, CurrencyIdOf, BalanceOf, BlockNumberFor> for Pallet { fn create_lock_inner( addr: &AccountIdOf, _value: BalanceOf, - _unlock_time: T::BlockNumber, + _unlock_time: BlockNumberFor, ) -> DispatchResult { let ve_config = Self::ve_configs(); ensure!(_value >= ve_config.min_mint, Error::::BelowMinimumMint); - let _locked: LockedBalance, T::BlockNumber> = Self::locked(addr); - let unlock_time: T::BlockNumber = _unlock_time + let _locked: LockedBalance, BlockNumberFor> = Self::locked(addr); + let unlock_time: BlockNumberFor = _unlock_time .checked_div(&T::Week::get()) .ok_or(ArithmeticError::Overflow)? .checked_mul(&T::Week::get()) .ok_or(ArithmeticError::Overflow)?; - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); ensure!( unlock_time >= ve_config.min_block.saturating_add(current_block_number), Error::::Expired @@ -78,17 +78,17 @@ impl VeMintingInterface, CurrencyIdOf, BalanceOf fn increase_unlock_time_inner( addr: &AccountIdOf, - _unlock_time: T::BlockNumber, + _unlock_time: BlockNumberFor, ) -> DispatchResult { let ve_config = Self::ve_configs(); - let _locked: LockedBalance, T::BlockNumber> = Self::locked(addr); - let unlock_time: T::BlockNumber = _unlock_time + let _locked: LockedBalance, BlockNumberFor> = Self::locked(addr); + let unlock_time: BlockNumberFor = _unlock_time .checked_div(&T::Week::get()) .ok_or(ArithmeticError::Overflow)? .checked_mul(&T::Week::get()) .ok_or(ArithmeticError::Overflow)?; - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); ensure!( unlock_time >= ve_config.min_block.saturating_add(_locked.end), Error::::Expired @@ -111,9 +111,9 @@ impl VeMintingInterface, CurrencyIdOf, BalanceOf fn increase_amount_inner(addr: &AccountIdOf, value: BalanceOf) -> DispatchResult { let ve_config = Self::ve_configs(); ensure!(value >= ve_config.min_mint, Error::::BelowMinimumMint); - let _locked: LockedBalance, T::BlockNumber> = Self::locked(addr); + let _locked: LockedBalance, BlockNumberFor> = Self::locked(addr); ensure!(_locked.amount > Zero::zero(), Error::::LockNotExist); // Need to be executed after create_lock - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); ensure!(_locked.end > current_block_number, Error::::Expired); // Cannot add to expired/non-existent lock Self::_deposit_for(addr, value, Zero::zero(), _locked)?; Self::deposit_event(Event::AmountIncreased { addr: addr.to_owned(), value }); @@ -121,16 +121,16 @@ impl VeMintingInterface, CurrencyIdOf, BalanceOf } fn deposit_for(addr: &AccountIdOf, value: BalanceOf) -> DispatchResult { - let _locked: LockedBalance, T::BlockNumber> = Self::locked(addr); + let _locked: LockedBalance, BlockNumberFor> = Self::locked(addr); Self::_deposit_for(addr, value, Zero::zero(), _locked) } fn withdraw_inner(addr: &AccountIdOf) -> DispatchResult { let mut _locked = Self::locked(addr); - let current_block_number: T::BlockNumber = frame_system::Pallet::::block_number(); + let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); ensure!(current_block_number >= _locked.end, Error::::Expired); let value = _locked.amount; - let old_locked: LockedBalance, T::BlockNumber> = _locked.clone(); + let old_locked: LockedBalance, BlockNumberFor> = _locked.clone(); _locked.end = Zero::zero(); _locked.amount = Zero::zero(); Locked::::insert(addr, _locked.clone()); @@ -158,7 +158,7 @@ impl VeMintingInterface, CurrencyIdOf, BalanceOf fn balance_of( addr: &AccountIdOf, - time: Option, + time: Option>, ) -> Result, DispatchError> { match time { Some(_t) => Self::balance_of_at(addr, _t), @@ -166,7 +166,7 @@ impl VeMintingInterface, CurrencyIdOf, BalanceOf } } - fn find_block_epoch(_block: T::BlockNumber, max_epoch: U256) -> U256 { + fn find_block_epoch(_block: BlockNumberFor, max_epoch: U256) -> U256 { let mut _min = U256::zero(); let mut _max = max_epoch; for _i in 0..128 { @@ -184,18 +184,18 @@ impl VeMintingInterface, CurrencyIdOf, BalanceOf _min } - fn total_supply(t: T::BlockNumber) -> Result, DispatchError> { + fn total_supply(t: BlockNumberFor) -> Result, DispatchError> { let g_epoch: U256 = Self::epoch(); let last_point = Self::point_history(g_epoch); Self::supply_at(last_point, t) } fn supply_at( - point: Point, T::BlockNumber>, - t: T::BlockNumber, + point: Point, BlockNumberFor>, + t: BlockNumberFor, ) -> Result, DispatchError> { let mut last_point = point; - let mut t_i: T::BlockNumber = last_point + let mut t_i: BlockNumberFor = last_point .block .checked_div(&T::Week::get()) .ok_or(ArithmeticError::Overflow)? @@ -256,10 +256,10 @@ pub trait Incentive { ) -> DispatchResult; } -impl Incentive, CurrencyIdOf, BalanceOf, T::BlockNumber> +impl Incentive, CurrencyIdOf, BalanceOf, BlockNumberFor> for Pallet { - fn set_incentive(rewards_duration: Option) { + fn set_incentive(rewards_duration: Option>) { if let Some(rewards_duration) = rewards_duration { let mut incentive_config = Self::incentive_configs(); incentive_config.rewards_duration = rewards_duration; @@ -269,7 +269,7 @@ impl Incentive, CurrencyIdOf, BalanceOf, T::Bloc } fn add_reward( addr: &AccountIdOf, - conf: &mut IncentiveConfig, BalanceOf, T::BlockNumber>, + conf: &mut IncentiveConfig, BalanceOf, BlockNumberFor>, rewards: &Vec<(CurrencyIdOf, BalanceOf)>, remaining: BalanceOf, ) -> DispatchResult { diff --git a/pallets/ve-minting/src/weights.rs b/pallets/ve-minting/src/weights.rs index 57f2ed4f8..752e89a71 100644 --- a/pallets/ve-minting/src/weights.rs +++ b/pallets/ve-minting/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/vesting/Cargo.toml b/pallets/vesting/Cargo.toml index 0e97b5e9e..41667c1d1 100644 --- a/pallets/vesting/Cargo.toml +++ b/pallets/vesting/Cargo.toml @@ -6,17 +6,17 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] diff --git a/pallets/vesting/src/benchmarking.rs b/pallets/vesting/src/benchmarking.rs index 93a0da597..c53a43607 100644 --- a/pallets/vesting/src/benchmarking.rs +++ b/pallets/vesting/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -69,7 +69,7 @@ benchmarks! { add_locks::(&caller, l as u8); add_vesting_schedule::(&caller)?; // At block zero, everything is vested. - System::::set_block_number(T::BlockNumber::zero()); + System::::set_block_number(BlockNumberFor::::zero()); assert_eq!( Vesting::::vesting_balance(&caller), Some(100u32.into()), @@ -118,7 +118,7 @@ benchmarks! { add_locks::(&other, l as u8); add_vesting_schedule::(&other)?; // At block zero, everything is vested. - System::::set_block_number(T::BlockNumber::zero()); + System::::set_block_number(BlockNumberFor::::zero()); assert_eq!( Vesting::::vesting_balance(&other), Some(100u32.into()), diff --git a/pallets/vesting/src/lib.rs b/pallets/vesting/src/lib.rs index 55a66ee6e..a53e3f646 100644 --- a/pallets/vesting/src/lib.rs +++ b/pallets/vesting/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -126,7 +126,7 @@ pub mod pallet { type Currency: LockableCurrency; /// Convert the block number into a balance. - type BlockNumberToBalance: Convert>; + type BlockNumberToBalance: Convert, BalanceOf>; /// The minimum amount transferred to call `vested_transfer`. #[pallet::constant] @@ -139,38 +139,32 @@ pub mod pallet { /// Start at #[pallet::storage] #[pallet::getter(fn vesting_start_at)] - pub(super) type VestingStartAt = StorageValue<_, T::BlockNumber>; + pub(super) type VestingStartAt = StorageValue<_, BlockNumberFor>; /// Cliff vesting #[pallet::storage] #[pallet::getter(fn cliffs)] pub(super) type Cliff = - StorageMap<_, Blake2_128Concat, T::AccountId, T::BlockNumber>; + StorageMap<_, Blake2_128Concat, T::AccountId, BlockNumberFor>; /// Information regarding the vesting of a given account. #[pallet::storage] #[pallet::getter(fn vesting)] pub type Vesting = - StorageMap<_, Blake2_128Concat, T::AccountId, VestingInfo, T::BlockNumber>>; + StorageMap<_, Blake2_128Concat, T::AccountId, VestingInfo, BlockNumberFor>>; #[pallet::pallet] #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig { - pub vesting: Vec<(T::AccountId, T::BlockNumber, T::BlockNumber, BalanceOf)>, - } - - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - GenesisConfig { vesting: Default::default() } - } + pub vesting: Vec<(T::AccountId, BlockNumberFor, BlockNumberFor, BalanceOf)>, } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { use sp_runtime::traits::Saturating; @@ -302,7 +296,7 @@ pub mod pallet { pub fn vested_transfer( origin: OriginFor, target: ::Source, - schedule: VestingInfo, T::BlockNumber>, + schedule: VestingInfo, BlockNumberFor>, ) -> DispatchResult { let transactor = ensure_signed(origin)?; ensure!(schedule.locked >= T::MinVestedTransfer::get(), Error::::AmountLow); @@ -351,7 +345,7 @@ pub mod pallet { origin: OriginFor, source: ::Source, target: ::Source, - schedule: VestingInfo, T::BlockNumber>, + schedule: VestingInfo, BlockNumberFor>, ) -> DispatchResult { ensure_root(origin)?; ensure!(schedule.locked >= T::MinVestedTransfer::get(), Error::::AmountLow); @@ -384,7 +378,7 @@ pub mod pallet { origin: OriginFor, source: ::Source, target: ::Source, - schedule: VestingInfo, T::BlockNumber>, + schedule: VestingInfo, BlockNumberFor>, ) -> DispatchResult { ensure_root(origin)?; ensure!(schedule.locked >= T::MinVestedTransfer::get(), Error::::AmountLow); @@ -413,7 +407,7 @@ pub mod pallet { #[pallet::weight({0})] pub fn init_vesting_start_at( origin: OriginFor, - vesting_start_at: T::BlockNumber, + vesting_start_at: BlockNumberFor, ) -> DispatchResult { ensure_root(origin)?; @@ -470,7 +464,7 @@ pub mod pallet { pub fn force_set_cliff( origin: OriginFor, target: ::Source, - cliff_block: T::BlockNumber, + cliff_block: BlockNumberFor, ) -> DispatchResult { ensure_root(origin)?; @@ -521,7 +515,7 @@ where BalanceOf: MaybeSerializeDeserialize + Debug, { type Currency = T::Currency; - type Moment = T::BlockNumber; + type Moment = BlockNumberFor; /// Get the amount that is currently being vested and cannot be transferred out of this account. fn vesting_balance(who: &T::AccountId) -> Option> { @@ -551,7 +545,7 @@ where who: &T::AccountId, locked: BalanceOf, per_block: BalanceOf, - starting_block: T::BlockNumber, + starting_block: BlockNumberFor, ) -> DispatchResult { if locked.is_zero() { return Ok(()); @@ -573,7 +567,7 @@ where _who: &T::AccountId, _locked: BalanceOf, _per_block: BalanceOf, - _starting_block: T::BlockNumber, + _starting_block: BlockNumberFor, ) -> DispatchResult { Ok(()) } @@ -592,8 +586,8 @@ mod tests { use frame_system::RawOrigin; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BadOrigin, BlakeTwo256, Identity, IdentityLookup}, + BuildStorage, DispatchError::Token, ModuleError, TokenError::Frozen, @@ -602,18 +596,13 @@ mod tests { use super::*; use crate as pallet_vesting; - type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config}, + pub enum Test { + System: frame_system, + Balances: pallet_balances, + Vesting: pallet_vesting, } ); @@ -626,15 +615,14 @@ mod tests { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -659,7 +647,7 @@ mod tests { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -692,7 +680,7 @@ mod tests { pub fn build(self) -> sp_io::TestExternalities { EXISTENTIAL_DEPOSIT.with(|v| *v.borrow_mut() = self.existential_deposit); - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: vec![ (1, 10 * self.existential_deposit), diff --git a/pallets/vesting/src/weights.rs b/pallets/vesting/src/weights.rs index c3baeba84..53dd5f989 100644 --- a/pallets/vesting/src/weights.rs +++ b/pallets/vesting/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/vsbond-auction/Cargo.toml b/pallets/vsbond-auction/Cargo.toml index d7dcf2f66..36f4946c2 100644 --- a/pallets/vsbond-auction/Cargo.toml +++ b/pallets/vsbond-auction/Cargo.toml @@ -8,21 +8,21 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } log = { version = "0.4.17", default-features = false } [dev-dependencies] orml-tokens = "0.4.1-dev" -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] @@ -32,7 +32,7 @@ std = [ "sp-std/std", "frame-system/std", "frame-support/std", - "node-primitives/std", + "bifrost-primitives/std", "orml-traits/std", "frame-benchmarking/std", "sp-arithmetic/std", diff --git a/pallets/vsbond-auction/src/benchmarking.rs b/pallets/vsbond-auction/src/benchmarking.rs index 7f9d80044..a145c70e3 100644 --- a/pallets/vsbond-auction/src/benchmarking.rs +++ b/pallets/vsbond-auction/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,12 +18,12 @@ #![cfg(feature = "runtime-benchmarks")] +use bifrost_primitives::TokenSymbol; use frame_benchmarking::{ account, benchmarks, impl_benchmark_test_suite, v1::BenchmarkError, whitelisted_caller, }; -use frame_support::{dispatch::UnfilteredDispatchable, sp_runtime::traits::UniqueSaturatedFrom}; +use frame_support::{sp_runtime::traits::UniqueSaturatedFrom, traits::UnfilteredDispatchable}; use frame_system::RawOrigin; -use node_primitives::TokenSymbol; use super::*; #[allow(unused_imports)] diff --git a/pallets/vsbond-auction/src/lib.rs b/pallets/vsbond-auction/src/lib.rs index 33bed4a32..890cc45ca 100644 --- a/pallets/vsbond-auction/src/lib.rs +++ b/pallets/vsbond-auction/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -28,6 +28,7 @@ use core::fmt::Debug; +use bifrost_primitives::{CurrencyId, LeasePeriod, ParaId, TokenSymbol}; use frame_support::{ pallet_prelude::*, sp_runtime::{ @@ -37,7 +38,6 @@ use frame_support::{ PalletId, }; use frame_system::pallet_prelude::*; -use node_primitives::{CurrencyId, LeasePeriod, ParaId, TokenSymbol}; use orml_traits::{MultiCurrency, MultiReservableCurrency}; pub use pallet::*; use scale_info::TypeInfo; @@ -112,14 +112,12 @@ type AccountIdOf = ::AccountId; type BalanceOf, I: 'static = ()> = <>::MultiCurrency as MultiCurrency>>::Balance; -type LeasePeriodOf = ::BlockNumber; - #[frame_support::pallet] pub mod pallet { use super::*; #[pallet::config] - pub trait Config: frame_system::Config { + pub trait Config: frame_system::Config { type RuntimeEvent: From> + IsType<::RuntimeEvent>; @@ -266,8 +264,8 @@ pub mod pallet { origin: OriginFor, #[pallet::compact] index: ParaId, token_symbol: TokenSymbol, - #[pallet::compact] first_slot: LeasePeriodOf, - #[pallet::compact] last_slot: LeasePeriodOf, + #[pallet::compact] first_slot: LeasePeriod, + #[pallet::compact] last_slot: LeasePeriod, #[pallet::compact] amount: BalanceOf, #[pallet::compact] total_price: BalanceOf, order_type: OrderType, diff --git a/pallets/vsbond-auction/src/migration.rs b/pallets/vsbond-auction/src/migration.rs index 2139f60e9..726203aa8 100644 --- a/pallets/vsbond-auction/src/migration.rs +++ b/pallets/vsbond-auction/src/migration.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ // along with this program. If not, see . // Ensure we're `no_std` when compiling for Wasm. -// #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(not(feature = "std"), no_std)] use super::*; use crate::{Pallet, TotalOrderInfos}; diff --git a/pallets/vsbond-auction/src/mock.rs b/pallets/vsbond-auction/src/mock.rs index bb5035b5a..aa0bf6b94 100644 --- a/pallets/vsbond-auction/src/mock.rs +++ b/pallets/vsbond-auction/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -16,37 +16,30 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +use bifrost_primitives::{Amount, Balance, CurrencyId, TokenSymbol}; #[cfg(feature = "runtime-benchmarks")] use frame_benchmarking::{account, whitelisted_caller}; use frame_support::{ - construct_runtime, ord_parameter_types, parameter_types, - traits::{Contains, GenesisBuild}, - PalletId, + construct_runtime, ord_parameter_types, parameter_types, traits::Contains, PalletId, }; use frame_system::EnsureSignedBy; -use node_primitives::{Amount, Balance, CurrencyId, TokenSymbol}; use sp_core::H256; use sp_runtime::{ - generic, traits::{AccountIdConversion, BlakeTwo256, IdentityLookup}, + BuildStorage, }; use crate as vsbond_auction; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type AccountId = u64; type BlockNumber = u32; construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Event}, - Auction: vsbond_auction::{Pallet, Call, Storage, Event}, + pub enum Test { + System: frame_system, + Tokens: orml_tokens, + Auction: vsbond_auction, } ); @@ -60,15 +53,14 @@ impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = generic::Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -142,7 +134,7 @@ impl vsbond_auction::Config for Test { // mockup runtime pub(crate) fn new_test_ext() -> sp_io::TestExternalities { - let mut fs_gc = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut fs_gc = frame_system::GenesisConfig::::default().build_storage().unwrap(); #[cfg(feature = "runtime-benchmarks")] let whitelist_caller: AccountId = whitelisted_caller(); #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/vsbond-auction/src/tests.rs b/pallets/vsbond-auction/src/tests.rs index 402ef7b52..5a36a263b 100644 --- a/pallets/vsbond-auction/src/tests.rs +++ b/pallets/vsbond-auction/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -16,10 +16,10 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use frame_support::{assert_noop, assert_ok, dispatch::DispatchError}; -use orml_traits::{LockIdentifier, MultiLockableCurrency}; - use crate::{mock::*, *}; +use frame_support::{assert_noop, assert_ok}; +use orml_traits::{LockIdentifier, MultiLockableCurrency}; +use sp_runtime::DispatchError; #[test] fn create_sell_order_should_work() { diff --git a/pallets/vsbond-auction/src/weights.rs b/pallets/vsbond-auction/src/weights.rs index 948ee3e44..1bbafc816 100644 --- a/pallets/vsbond-auction/src/weights.rs +++ b/pallets/vsbond-auction/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/vstoken-conversion/Cargo.toml b/pallets/vstoken-conversion/Cargo.toml index 499bb95fa..e1461dd2e 100644 --- a/pallets/vstoken-conversion/Cargo.toml +++ b/pallets/vstoken-conversion/Cargo.toml @@ -9,26 +9,26 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -node-primitives = { path = "../../node/primitives", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -hex-literal = { version = "0.3.1" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +hex-literal = { version = "0.4.1" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [dev-dependencies] orml-tokens = "0.4.1-dev" -bifrost-currencies = { workspace = true } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-asset-registry = { path = "../asset-registry", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] @@ -39,7 +39,7 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking/std", - "node-primitives/std", + "bifrost-primitives/std", "orml-traits/std", "bifrost-asset-registry/std", ] diff --git a/pallets/vstoken-conversion/src/benchmarking.rs b/pallets/vstoken-conversion/src/benchmarking.rs index 7e8228fe9..c0ee2dfc6 100644 --- a/pallets/vstoken-conversion/src/benchmarking.rs +++ b/pallets/vstoken-conversion/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,13 +19,13 @@ // Ensure we're `no_std` when compiling for Wasm. #![cfg(feature = "runtime-benchmarks")] +use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_benchmarking::v1::{account, benchmarks, BenchmarkError}; use frame_support::{ assert_ok, traits::{EnsureOrigin, Get}, }; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, TokenSymbol}; use orml_traits::MultiCurrency; use sp_runtime::traits::{AccountIdConversion, UniqueSaturatedFrom}; diff --git a/pallets/vstoken-conversion/src/lib.rs b/pallets/vstoken-conversion/src/lib.rs index bfdf82755..e68fa928f 100644 --- a/pallets/vstoken-conversion/src/lib.rs +++ b/pallets/vstoken-conversion/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -31,13 +31,13 @@ mod benchmarking; pub mod primitives; pub mod weights; +use bifrost_primitives::{CurrencyId, CurrencyIdConversion, TokenSymbol}; use frame_support::{ pallet_prelude::*, sp_runtime::traits::{AccountIdConversion, CheckedSub}, PalletId, }; use frame_system::pallet_prelude::*; -use node_primitives::{CurrencyId, CurrencyIdConversion, TokenSymbol}; use orml_traits::MultiCurrency; pub use pallet::*; pub use primitives::{VstokenConversionExchangeFee, VstokenConversionExchangeRate}; diff --git a/pallets/vstoken-conversion/src/mock.rs b/pallets/vstoken-conversion/src/mock.rs index 56d1d3fc2..6bb76a27a 100644 --- a/pallets/vstoken-conversion/src/mock.rs +++ b/pallets/vstoken-conversion/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,18 +21,13 @@ #![cfg(test)] #![allow(non_upper_case_globals)] -use frame_support::{ - ord_parameter_types, parameter_types, - traits::{GenesisBuild, Nothing}, - PalletId, -}; +use bifrost_primitives::{CurrencyId, TokenSymbol}; +use frame_support::{ord_parameter_types, parameter_types, traits::Nothing, PalletId}; use frame_system::EnsureSignedBy; -use node_primitives::{CurrencyId, TokenSymbol}; use sp_core::{ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, - AccountId32, + AccountId32, BuildStorage, }; use crate as bifrost_vstoken_conversion; @@ -55,21 +50,16 @@ pub const vsBond: CurrencyId = CurrencyId::VSBond(TokenSymbol::BNC, 2001, 0, 8); pub const TREASURY_ACCOUNT: AccountId = AccountId32::new([9u8; 32]); frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - VstokenConversion: bifrost_vstoken_conversion::{Pallet, Call, Storage, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Event, Storage}, + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + Balances: pallet_balances, + Currencies: bifrost_currencies, + VstokenConversion: bifrost_vstoken_conversion, + AssetRegistry: bifrost_asset_registry, } ); -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -81,15 +71,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -130,7 +119,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -217,7 +206,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/vstoken-conversion/src/primitives.rs b/pallets/vstoken-conversion/src/primitives.rs index ae3f91317..4f468806b 100644 --- a/pallets/vstoken-conversion/src/primitives.rs +++ b/pallets/vstoken-conversion/src/primitives.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,9 +17,9 @@ // along with this program. If not, see . use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::RuntimeDebug; use scale_info::TypeInfo; use sp_arithmetic::per_things::Percent; +use sp_runtime::RuntimeDebug; /// Exchange rate of vstoken-conversion #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen, Default)] diff --git a/pallets/vstoken-conversion/src/tests.rs b/pallets/vstoken-conversion/src/tests.rs index 796820a29..25b32f417 100644 --- a/pallets/vstoken-conversion/src/tests.rs +++ b/pallets/vstoken-conversion/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/vstoken-conversion/src/weights.rs b/pallets/vstoken-conversion/src/weights.rs index 20bce5e91..e1e22dee8 100644 --- a/pallets/vstoken-conversion/src/weights.rs +++ b/pallets/vstoken-conversion/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/vtoken-minting/Cargo.toml b/pallets/vtoken-minting/Cargo.toml index 348ddcb03..72afc2497 100644 --- a/pallets/vtoken-minting/Cargo.toml +++ b/pallets/vtoken-minting/Cargo.toml @@ -11,34 +11,34 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -scale-info = { version = "2.3.1", default-features = false, features = [ +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } log = { version = "0.4.17", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -node-primitives = { path = "../../node/primitives", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -hex-literal = { version = "0.3.1" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +hex-literal = { version = "0.4.1" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [dev-dependencies] orml-tokens = "0.4.1-dev" -bifrost-currencies = { workspace = true } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} orml-xtokens = "0.4.1-dev" orml-traits = "0.4.1-dev" -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } bifrost-slp = { path = "../../pallets/slp", default-features = false } bifrost-asset-registry = { path = "../asset-registry", default-features = false } bifrost-runtime-common = { package = "bifrost-runtime-common", path = "../../runtime/common", default-features = false } @@ -52,7 +52,7 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking/std", - "node-primitives/std", + "bifrost-primitives/std", "orml-traits/std", "bifrost-slp/std", "bifrost-asset-registry/std", diff --git a/pallets/vtoken-minting/src/benchmarking.rs b/pallets/vtoken-minting/src/benchmarking.rs index 634e7de31..a60da362a 100644 --- a/pallets/vtoken-minting/src/benchmarking.rs +++ b/pallets/vtoken-minting/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,10 +20,10 @@ #![cfg(feature = "runtime-benchmarks")] use crate::{Pallet as VtokenMinting, *}; +use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_benchmarking::v1::{benchmarks, whitelisted_caller, BenchmarkError}; use frame_support::{assert_ok, sp_runtime::traits::UniqueSaturatedFrom}; use frame_system::RawOrigin; -use node_primitives::{CurrencyId, TokenSymbol}; benchmarks! { set_minimum_mint { @@ -126,7 +126,7 @@ benchmarks! { }: _(RawOrigin::Signed(caller), KSM, unlock_id) on_initialize { - let block_num = T::BlockNumber::from(10u32); + let block_num =BlockNumberFor::::from(10u32); }:{VtokenMinting::::on_initialize(block_num);} impl_benchmark_test_suite!( diff --git a/pallets/vtoken-minting/src/lib.rs b/pallets/vtoken-minting/src/lib.rs index 4de8e9b44..008f71dbe 100644 --- a/pallets/vtoken-minting/src/lib.rs +++ b/pallets/vtoken-minting/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -33,6 +33,10 @@ pub mod traits; pub mod weights; pub use weights::WeightInfo; +use bifrost_primitives::{ + CurrencyId, CurrencyIdConversion, CurrencyIdExt, CurrencyIdRegister, RedeemType, SlpOperator, + SlpxOperator, TimeUnit, VTokenSupplyProvider, VtokenMintingInterface, VtokenMintingOperator, +}; use frame_support::{ pallet_prelude::*, sp_runtime::{ @@ -42,10 +46,7 @@ use frame_support::{ transactional, BoundedVec, PalletId, }; use frame_system::pallet_prelude::*; -use node_primitives::{ - CurrencyId, CurrencyIdConversion, CurrencyIdExt, CurrencyIdRegister, RedeemType, SlpOperator, - SlpxOperator, TimeUnit, VTokenSupplyProvider, VtokenMintingInterface, VtokenMintingOperator, -}; +use log; use orml_traits::MultiCurrency; pub use pallet::*; use sp_core::U256; @@ -65,8 +66,8 @@ pub type UnlockId = u32; #[frame_support::pallet] pub mod pallet { use super::*; + use bifrost_primitives::{currency::BNC, FIL}; use frame_support::pallet_prelude::DispatchResultWithPostInfo; - use node_primitives::{currency::BNC, FIL}; use orml_traits::XcmTransfer; use xcm::{prelude::*, v3::MultiLocation}; @@ -322,8 +323,8 @@ pub mod pallet { pub type HookIterationLimit = StorageValue<_, u32, ValueQuery>; #[pallet::hooks] - impl Hooks for Pallet { - fn on_initialize(_n: T::BlockNumber) -> Weight { + impl Hooks> for Pallet { + fn on_initialize(_n: BlockNumberFor) -> Weight { Self::handle_on_initialize() .map_err(|err| { Self::deposit_event(Event::FastRedeemFailed { err }); @@ -667,10 +668,11 @@ pub mod pallet { if !T::CurrencyIdRegister::check_vtoken_registered(token_symbol) { T::CurrencyIdRegister::register_vtoken_metadata(token_symbol)?; }, - CurrencyId::Token2(token_id) => + CurrencyId::Token2(token_id) => { if !T::CurrencyIdRegister::check_vtoken2_registered(token_id) { T::CurrencyIdRegister::register_vtoken2_metadata(token_id)?; - }, + } + }, _ => (), } diff --git a/pallets/vtoken-minting/src/migration.rs b/pallets/vtoken-minting/src/migration.rs index 0b4e0544f..72cee2a8e 100644 --- a/pallets/vtoken-minting/src/migration.rs +++ b/pallets/vtoken-minting/src/migration.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,8 +17,8 @@ // along with this program. If not, see . use crate::{BalanceOf, Config, TokenUnlockLedger}; -use frame_support::{log, pallet_prelude::*, traits::OnRuntimeUpgrade}; -use node_primitives::{RedeemType, TimeUnit}; +use bifrost_primitives::{RedeemType, TimeUnit}; +use frame_support::{pallet_prelude::*, traits::OnRuntimeUpgrade}; use sp_std::marker::PhantomData; /// Migrate TokenUnlockLedger diff --git a/pallets/vtoken-minting/src/mock.rs b/pallets/vtoken-minting/src/mock.rs index befd4e7ea..c710b3fe1 100644 --- a/pallets/vtoken-minting/src/mock.rs +++ b/pallets/vtoken-minting/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -22,6 +22,10 @@ #![allow(non_upper_case_globals)] use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{ + currency::{BNC, DOT, FIL, KSM, MOVR, VBNC, VFIL, VKSM, VMOVR}, + CurrencyId, CurrencyIdMapping, SlpxOperator, TokenSymbol, +}; use bifrost_runtime_common::{micro, milli}; use bifrost_slp::{QueryId, QueryResponseManager}; use codec::{Decode, Encode}; @@ -30,23 +34,18 @@ use frame_support::{ ord_parameter_types, pallet_prelude::Get, parameter_types, - traits::{Everything, GenesisBuild, Nothing}, + traits::{Everything, Nothing}, PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; -use node_primitives::{ - currency::{BNC, DOT, FIL, KSM, MOVR, VBNC, VFIL, VKSM, VMOVR}, - CurrencyId, CurrencyIdMapping, SlpxOperator, TokenSymbol, -}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_core::{blake2_256, H256}; use sp_runtime::{ - testing::Header, traits::{ AccountIdConversion, BlakeTwo256, ConstU32, Convert, IdentityLookup, TrailingZeroInput, }, - AccountId32, + AccountId32, BuildStorage, }; use xcm::{prelude::*, v3::Weight}; use xcm_builder::FixedWeightBounds; @@ -65,24 +64,19 @@ pub const BOB: AccountId = AccountId32::new([1u8; 32]); pub const CHARLIE: AccountId = AccountId32::new([3u8; 32]); frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - XTokens: orml_xtokens::{Pallet, Call, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - VtokenMinting: vtoken_minting::{Pallet, Call, Storage, Event}, - Slp: bifrost_slp::{Pallet, Call, Storage, Event}, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Event, Storage}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + XTokens: orml_xtokens, + Balances: pallet_balances, + Currencies: bifrost_currencies, + VtokenMinting: vtoken_minting, + Slp: bifrost_slp, + AssetRegistry: bifrost_asset_registry, + PolkadotXcm: pallet_xcm, } ); -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -94,15 +88,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; + type Nonce = u32; + type Block = Block; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -148,7 +141,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -395,6 +388,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } #[cfg(feature = "runtime-benchmarks")] @@ -426,6 +420,8 @@ impl pallet_xcm::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } pub struct ExtBuilder { @@ -458,7 +454,7 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: self diff --git a/pallets/vtoken-minting/src/tests.rs b/pallets/vtoken-minting/src/tests.rs index 6ec6c27a8..7b1fbacee 100644 --- a/pallets/vtoken-minting/src/tests.rs +++ b/pallets/vtoken-minting/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,8 +21,8 @@ #![cfg(test)] use crate::{mock::*, *}; +use bifrost_primitives::currency::{BNC, FIL, KSM, MOVR, VBNC, VFIL, VKSM, VMOVR}; use frame_support::{assert_noop, assert_ok, sp_runtime::Permill, BoundedVec}; -use node_primitives::currency::{BNC, FIL, KSM, MOVR, VBNC, VFIL, VKSM, VMOVR}; #[test] fn mint_bnc() { diff --git a/pallets/vtoken-minting/src/traits.rs b/pallets/vtoken-minting/src/traits.rs index e6a06707c..d61ad5a77 100644 --- a/pallets/vtoken-minting/src/traits.rs +++ b/pallets/vtoken-minting/src/traits.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/vtoken-minting/src/weights.rs b/pallets/vtoken-minting/src/weights.rs index 9b9d4db34..f83fd7ca5 100644 --- a/pallets/vtoken-minting/src/weights.rs +++ b/pallets/vtoken-minting/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/vtoken-voting/Cargo.toml b/pallets/vtoken-voting/Cargo.toml index 1881e7d05..a494644ac 100644 --- a/pallets/vtoken-voting/Cargo.toml +++ b/pallets/vtoken-voting/Cargo.toml @@ -12,30 +12,30 @@ assert_matches = "1.3.0" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -scale-info = { version = "2.3.1", default-features = false, features = [ +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } log = { version = "0.4.17", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -node-primitives = { path = "../../node/primitives", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +bifrost-primitives = { path = "../../primitives", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -pallet-conviction-voting = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } +pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [dev-dependencies] orml-tokens = "0.4.1-dev" -bifrost-currencies = { workspace = true } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] @@ -46,7 +46,7 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking/std", - "node-primitives/std", + "bifrost-primitives/std", "orml-traits/std", "pallet-conviction-voting/std", "pallet-xcm/std", @@ -58,7 +58,7 @@ kusama = [] polkadot = [] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", - "node-primitives/runtime-benchmarks", + "bifrost-primitives/runtime-benchmarks", "pallet-conviction-voting/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "xcm-builder/runtime-benchmarks", diff --git a/pallets/vtoken-voting/src/benchmarking.rs b/pallets/vtoken-voting/src/benchmarking.rs index 1c3f6c11f..11da157bf 100644 --- a/pallets/vtoken-voting/src/benchmarking.rs +++ b/pallets/vtoken-voting/src/benchmarking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,10 +18,10 @@ use crate::*; use assert_matches::assert_matches; +use bifrost_primitives::{currency::VKSM, XcmOperationType as XcmOperation}; use frame_benchmarking::v2::*; use frame_support::assert_ok; use frame_system::RawOrigin; -use node_primitives::{currency::VKSM, XcmOperationType as XcmOperation}; use pallet_conviction_voting::{Conviction, Vote}; use sp_runtime::traits::UniqueSaturatedFrom; diff --git a/pallets/vtoken-voting/src/call.rs b/pallets/vtoken-voting/src/call.rs index 4fa4cb2b5..1ba9a01bf 100644 --- a/pallets/vtoken-voting/src/call.rs +++ b/pallets/vtoken-voting/src/call.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,8 +18,7 @@ use crate::{AccountVote, BalanceOf, Config, DerivativeIndex, PollIndex}; use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; -use sp_runtime::traits::StaticLookup; +use sp_runtime::{traits::StaticLookup, RuntimeDebug}; use sp_std::boxed::Box; #[cfg(feature = "kusama")] diff --git a/pallets/vtoken-voting/src/lib.rs b/pallets/vtoken-voting/src/lib.rs index aa3b5ed13..eafdda21b 100644 --- a/pallets/vtoken-voting/src/lib.rs +++ b/pallets/vtoken-voting/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -38,6 +38,11 @@ pub use crate::{ call::*, vote::{AccountVote, PollStatus, ReferendumInfo, ReferendumStatus, VoteRole}, }; +use bifrost_primitives::{ + currency::{VDOT, VKSM}, + traits::{DerivativeAccountHandler, VTokenSupplyProvider, XcmDestWeightAndFeeHandler}, + CurrencyId, DerivativeIndex, XcmOperationType, +}; use cumulus_primitives_core::{ParaId, QueryId, Response}; use frame_support::{ dispatch::GetDispatchInfo, @@ -45,11 +50,6 @@ use frame_support::{ traits::{Get, LockIdentifier}, }; use frame_system::pallet_prelude::{BlockNumberFor, *}; -use node_primitives::{ - currency::{VDOT, VKSM}, - traits::{DerivativeAccountHandler, VTokenSupplyProvider, XcmDestWeightAndFeeHandler}, - CurrencyId, DerivativeIndex, XcmOperationType, -}; use orml_traits::{MultiCurrency, MultiLockableCurrency}; pub use pallet::*; use pallet_conviction_voting::UnvoteScope; @@ -336,20 +336,14 @@ pub mod pallet { >; #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig { pub delegator_vote_roles: Vec<(CurrencyIdOf, u8, DerivativeIndex)>, pub undeciding_timeouts: Vec<(CurrencyIdOf, BlockNumberFor)>, } - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - GenesisConfig { delegator_vote_roles: vec![], undeciding_timeouts: vec![] } - } - } - #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { self.delegator_vote_roles.iter().for_each(|(vtoken, role, derivative_index)| { let vote_role = VoteRole::try_from(*role).unwrap(); diff --git a/pallets/vtoken-voting/src/migration.rs b/pallets/vtoken-voting/src/migration.rs index 8be115336..8c0f6499c 100644 --- a/pallets/vtoken-voting/src/migration.rs +++ b/pallets/vtoken-voting/src/migration.rs @@ -52,7 +52,7 @@ pub mod v1 { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, sp_runtime::DispatchError> { log::info!( "vtoken-voting before migration: version: {:?}", StorageVersion::get::>(), @@ -70,7 +70,7 @@ pub mod v1 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(_: Vec) -> Result<(), &'static str> { + fn post_upgrade(_: Vec) -> Result<(), sp_runtime::DispatchError> { log::info!( "vtoken-voting after migration: version: {:?}", StorageVersion::get::>(), diff --git a/pallets/vtoken-voting/src/mock.rs b/pallets/vtoken-voting/src/mock.rs index 45871b118..f8d350147 100644 --- a/pallets/vtoken-voting/src/mock.rs +++ b/pallets/vtoken-voting/src/mock.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,25 +20,25 @@ use crate as vtoken_voting; use crate::{BalanceOf, DerivativeAccountHandler, DerivativeIndex, DispatchResult}; +use bifrost_primitives::{ + currency::{KSM, VBNC, VKSM}, + traits::XcmDestWeightAndFeeHandler, + CurrencyId, DoNothingRouter, TokenSymbol, VTokenSupplyProvider, XcmOperationType, +}; use cumulus_primitives_core::ParaId; use frame_support::{ ord_parameter_types, pallet_prelude::Weight, parameter_types, - traits::{Everything, GenesisBuild, Get, Nothing}, + traits::{Everything, Get, Nothing}, weights::RuntimeDbWeight, }; use frame_system::EnsureRoot; -use node_primitives::{ - currency::{KSM, VBNC, VKSM}, - traits::XcmDestWeightAndFeeHandler, - CurrencyId, DoNothingRouter, TokenSymbol, VTokenSupplyProvider, XcmOperationType, -}; use pallet_xcm::EnsureResponse; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, BlockNumberProvider, ConstU32, IdentityLookup}, + BuildStorage, }; use xcm::prelude::*; use xcm_builder::FixedWeightBounds; @@ -49,7 +49,6 @@ pub type Amount = i128; pub type Balance = u128; pub type AccountId = u64; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; pub const ALICE: u64 = 1; @@ -58,17 +57,13 @@ pub const CHARLIE: u64 = 3; pub const CONTROLLER: u64 = 1000; frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Currencies: bifrost_currencies::{Pallet, Call, Storage}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, - VtokenVoting: vtoken_voting::{Pallet, Call, Storage, Event}, + pub enum Runtime { + System: frame_system, + Tokens: orml_tokens, + Balances: pallet_balances, + Currencies: bifrost_currencies, + PolkadotXcm: pallet_xcm, + VtokenVoting: vtoken_voting, } ); @@ -82,15 +77,14 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; + type Nonce = u64; + type Block = Block; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = DbWeight; type RuntimeEvent = RuntimeEvent; type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); @@ -131,7 +125,7 @@ impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; @@ -193,6 +187,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type AssetLocker = (); type AssetExchanger = (); + type Aliasers = Nothing; } #[cfg(feature = "runtime-benchmarks")] @@ -224,6 +219,8 @@ impl pallet_xcm::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } ord_parameter_types! { @@ -342,7 +339,7 @@ impl vtoken_voting::Config for Runtime { } pub fn new_test_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: vec![(ALICE, 10), (BOB, 20), (CHARLIE, 30)], } @@ -381,8 +378,8 @@ pub fn new_test_ext() -> sp_io::TestExternalities { #[cfg(feature = "runtime-benchmarks")] pub fn new_test_ext_benchmark() -> sp_io::TestExternalities { - frame_system::GenesisConfig::default() - .build_storage::() + frame_system::GenesisConfig::::default() + .build_storage() .unwrap() .into() } diff --git a/pallets/vtoken-voting/src/tests.rs b/pallets/vtoken-voting/src/tests.rs index dd7fd457a..ce131fe17 100644 --- a/pallets/vtoken-voting/src/tests.rs +++ b/pallets/vtoken-voting/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,6 +20,7 @@ use super::*; use crate::mock::*; +use bifrost_primitives::currency::{VBNC, VKSM}; use frame_support::{ assert_noop, assert_ok, traits::{ @@ -28,7 +29,6 @@ use frame_support::{ }, weights::RuntimeDbWeight, }; -use node_primitives::currency::{VBNC, VKSM}; use pallet_conviction_voting::Vote; use pallet_xcm::Origin as XcmOrigin; diff --git a/pallets/vtoken-voting/src/vote.rs b/pallets/vtoken-voting/src/vote.rs index d9f9e58db..50cbe8293 100644 --- a/pallets/vtoken-voting/src/vote.rs +++ b/pallets/vtoken-voting/src/vote.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -16,11 +16,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +use bifrost_primitives::DerivativeIndex; use codec::{Codec, Decode, Encode, EncodeLike, MaxEncodedLen}; use frame_support::{ pallet_prelude::*, traits::Get, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, }; -use node_primitives::DerivativeIndex; use pallet_conviction_voting::{Conviction, Delegations, Vote}; use scale_info::TypeInfo; use sp_runtime::{ diff --git a/pallets/vtoken-voting/src/weights.rs b/pallets/vtoken-voting/src/weights.rs index 8dbad08c2..4dd34b6e6 100644 --- a/pallets/vtoken-voting/src/weights.rs +++ b/pallets/vtoken-voting/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/pallets/xcm-interface/Cargo.toml b/pallets/xcm-interface/Cargo.toml index b91ab8771..21aa317e1 100644 --- a/pallets/xcm-interface/Cargo.toml +++ b/pallets/xcm-interface/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "xcm-interface" +name = "bifrost-xcm-interface" version = "0.8.0" authors = ["Ron yang"] edition = "2021" @@ -8,27 +8,27 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -scale-info = { version = "2.3.1", default-features = false, features = [ +scale-info = { version = "2.9.0", default-features = false, features = [ "derive", ] } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } orml-traits = { version = "0.4.1-dev", default-features = false } -node-primitives = { path = "../../node/primitives", default-features = false } +bifrost-primitives = { path = "../../primitives", default-features = false } bifrost-asset-registry = { path = "../asset-registry", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] @@ -46,7 +46,7 @@ std = [ "xcm/std", "orml-traits/std", "cumulus-primitives-core/std", - "node-primitives/std", + "bifrost-primitives/std", ] runtime-benchmarks = [ "frame-benchmarking", diff --git a/pallets/xcm-interface/src/calls.rs b/pallets/xcm-interface/src/calls.rs index e43abcc71..52994f96d 100644 --- a/pallets/xcm-interface/src/calls.rs +++ b/pallets/xcm-interface/src/calls.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -17,7 +17,8 @@ // along with this program. If not, see . use codec::{Decode, Encode}; -use frame_support::{sp_runtime::MultiSignature, RuntimeDebug}; +use frame_support::sp_runtime::MultiSignature; +use sp_runtime::RuntimeDebug; use sp_std::vec::Vec; use crate::ChainId; diff --git a/pallets/xcm-interface/src/lib.rs b/pallets/xcm-interface/src/lib.rs index b0b1bfb62..884e83f41 100644 --- a/pallets/xcm-interface/src/lib.rs +++ b/pallets/xcm-interface/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,8 +21,8 @@ pub mod calls; pub mod traits; use bifrost_asset_registry::AssetMetadata; +use bifrost_primitives::{traits::XcmDestWeightAndFeeHandler, CurrencyIdMapping, XcmOperationType}; pub use calls::*; -use node_primitives::{traits::XcmDestWeightAndFeeHandler, CurrencyIdMapping, XcmOperationType}; use orml_traits::MultiCurrency; pub use pallet::*; pub use traits::{ChainId, MessageId, Nonce, SalpHelper}; @@ -116,7 +116,7 @@ pub mod pallet { type ParachainId: Get; #[pallet::constant] - type CallBackTimeOut: Get; + type CallBackTimeOut: Get>; } #[pallet::error] @@ -167,7 +167,7 @@ pub mod pallet { pub struct Pallet(_); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet { diff --git a/pallets/xcm-interface/src/traits.rs b/pallets/xcm-interface/src/traits.rs index 97301cbd5..32e02537a 100644 --- a/pallets/xcm-interface/src/traits.rs +++ b/pallets/xcm-interface/src/traits.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml new file mode 100644 index 000000000..1307e764f --- /dev/null +++ b/primitives/Cargo.toml @@ -0,0 +1,45 @@ +[package] +name = "bifrost-primitives" +version = "0.8.0" +authors = ["Edwin Wang "] +edition = "2021" + +[dependencies] +bstringify = "0.1.2" +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.160", default-features = false, features = ["derive"] } + +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } + +zenlink-protocol = { version = "*", default-features = false } + +[features] +default = ["std"] +std = [ + "codec/std", + "serde/std", + "scale-info/std", + + "frame-support/std", + "sp-core/std", + "sp-runtime/std", + "sp-std/std", + + "xcm/std", + + "zenlink-protocol/std", +] + +with-bifrost-runtime = [ + "with-bifrost-kusama-runtime", + "with-bifrost-polkadot-runtime", +] +with-bifrost-kusama-runtime = [] +with-bifrost-polkadot-runtime = [] +with-all-runtime = ["with-bifrost-runtime"] +runtime-benchmarks = [] diff --git a/node/primitives/src/currency.rs b/primitives/src/currency.rs similarity index 98% rename from node/primitives/src/currency.rs rename to primitives/src/currency.rs index 18635b7f1..9181277d4 100644 --- a/node/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,7 +21,6 @@ use bstringify::bstringify; use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; -#[cfg(feature = "std")] use serde::{Deserialize, Serialize}; use sp_runtime::RuntimeDebug; use sp_std::{ @@ -320,8 +319,7 @@ create_currency_id! { // Bit 8 : 0 for Pokladot Ecosystem, 1 for Kusama Ecosystem // Bit 7 : Reserved // Bit 6 - 1 : The token ID - #[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo, MaxEncodedLen)] - #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] + #[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo, MaxEncodedLen, Serialize, Deserialize)] #[repr(u8)] pub enum TokenSymbol { ASG("Asgard", 12) = 0, @@ -360,8 +358,9 @@ pub type TokenId = u8; PartialOrd, Ord, TypeInfo, + Serialize, + Deserialize, )] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[non_exhaustive] pub enum CurrencyId { Native(TokenSymbol), diff --git a/node/primitives/src/lib.rs b/primitives/src/lib.rs similarity index 97% rename from node/primitives/src/lib.rs rename to primitives/src/lib.rs index e3fdeda7d..6a8de3660 100644 --- a/node/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,7 +21,6 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::MaxEncodedLen; -use frame_support::dispatch::Weight; use scale_info::TypeInfo; use sp_core::{Decode, Encode, RuntimeDebug, H160}; use sp_runtime::{ @@ -151,8 +150,6 @@ pub type Shortfall = FixedU128; pub const SECONDS_PER_YEAR: Timestamp = 365 * 24 * 60 * 60; -pub type TimeStampedPrice = orml_oracle::TimestampedValue; - pub type DerivativeIndex = u16; #[derive( @@ -276,7 +273,7 @@ impl ExecuteXcm for DoNothingExecuteXcm { fn execute( _origin: impl Into, _pre: Self::Prepared, - _hash: XcmHash, + _hash: &mut XcmHash, _weight_credit: Weight, ) -> Outcome { Outcome::Complete(Weight::default()) diff --git a/node/primitives/src/salp.rs b/primitives/src/salp.rs similarity index 89% rename from node/primitives/src/salp.rs rename to primitives/src/salp.rs index d6722a3d2..b34ac3e12 100644 --- a/node/primitives/src/salp.rs +++ b/primitives/src/salp.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -16,7 +16,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; +use serde::{Deserialize, Serialize}; +use sp_runtime::RuntimeDebug; #[derive(Encode, Decode, Clone, PartialEq, Eq, Copy, RuntimeDebug)] pub enum ContributionStatus { @@ -28,8 +29,18 @@ pub enum ContributionStatus { MigrateToIdle, } -#[derive(Encode, Decode, Clone, PartialEq, Eq, Copy, RuntimeDebug, scale_info::TypeInfo)] -#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] +#[derive( + Encode, + Decode, + Clone, + PartialEq, + Eq, + Copy, + RuntimeDebug, + scale_info::TypeInfo, + Serialize, + Deserialize, +)] pub enum RpcContributionStatus { Idle, Contributing, diff --git a/node/primitives/src/tests.rs b/primitives/src/tests.rs similarity index 99% rename from node/primitives/src/tests.rs rename to primitives/src/tests.rs index 562a9661d..f34949cff 100644 --- a/node/primitives/src/tests.rs +++ b/primitives/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/node/primitives/src/traits.rs b/primitives/src/traits.rs similarity index 99% rename from node/primitives/src/traits.rs rename to primitives/src/traits.rs index a900a866c..e405eda0a 100644 --- a/node/primitives/src/traits.rs +++ b/primitives/src/traits.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -26,13 +26,12 @@ use crate::{ }; use codec::{Decode, Encode, FullCodec}; use frame_support::{ - dispatch::DispatchError, pallet_prelude::{DispatchResultWithPostInfo, Weight}, sp_runtime::{traits::AccountIdConversion, TokenError, TypeId}, }; use sp_runtime::{ traits::{AtLeast32BitUnsigned, ConstU32, MaybeSerializeDeserialize, Zero}, - BoundedVec, DispatchResult, + BoundedVec, DispatchError, DispatchResult, }; use sp_std::{fmt::Debug, vec::Vec}; diff --git a/runtime/bifrost-kusama/Cargo.toml b/runtime/bifrost-kusama/Cargo.toml index e54835263..246a02606 100644 --- a/runtime/bifrost-kusama/Cargo.toml +++ b/runtime/bifrost-kusama/Cargo.toml @@ -7,239 +7,250 @@ build = "build.rs" [dependencies] # third-party dependencies -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ - "derive", - "max-encoded-len", -] } -hex-literal = { version = "0.3.1" } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } +hex-literal = { version = "0.4.1" } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.3.1", default-features = false, features = [ - "derive", -] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } smallvec = "1.10.0" static_assertions = "1.1.0" -strum = { version = "0.24", default-features = false, features = [ "derive" ] } +strum = { version = "0.24", features = [ "derive" ], default-features = false } strum_macros = "0.24" -# primitives -node-primitives = { default-features = false, path = "../../node/primitives" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } # frame dependencies -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -frame-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, features = ["tuples-96"] } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-bounties = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-conviction-voting = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-preimage = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.42', default-features = false } -pallet-ranked-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-referenda = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-whitelist = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, features = ["tuples-96"] } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-bounties = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-preimage = { git = 'https://github.com/paritytech/polkadot-sdk.git', branch = 'release-polkadot-v1.1.0', default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-ranked-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-tips = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-whitelist = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } + # Cumulus dependencies -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false ,features = ["parameterized-consensus-hook"] } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Polkadot dependencies -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } + +# orml +orml-tokens = { version = "0.4.1-dev", default-features = false } +orml-traits = { version = "0.4.1-dev", default-features = false } +orml-unknown-tokens = { version = "0.4.1-dev", default-features = false } +orml-xcm = { version = "0.4.1-dev", default-features = false } +orml-xcm-support = { version = "0.4.1-dev", default-features = false } +orml-xtokens = { version = "0.4.1-dev", default-features = false } + +# zenlink +merkle-distributor = { version = "*", default-features = false } +zenlink-protocol = { version = "*", default-features = false } +zenlink-protocol-runtime-api = { version = "*", default-features = false } +zenlink-stable-amm = { version = "*", default-features = false } +zenlink-stable-amm-runtime-api = { version = "*", default-features = false } +zenlink-swap-router = { version = "*", default-features = false } # Nuts Finance nutsfinance-stable-asset = { path = "../../pallets/stable-asset", default-features = false } # Bifrost +bifrost-asset-registry = { path = "../../pallets/asset-registry", default-features = false } +bifrost-call-switchgear = { path = "../../pallets/call-switchgear", default-features = false } +bifrost-cross-in-out = { path = "../../pallets/cross-in-out", default-features = false } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false } +bifrost-farming = { path = "../../pallets/farming", default-features = false } +bifrost-farming-rpc-runtime-api = { path = "../../pallets/farming/rpc/runtime-api", default-features = false } +bifrost-fee-share = { path = "../../pallets/fee-share", default-features = false } bifrost-flexible-fee = { path = "../../pallets/flexible-fee", default-features = false } bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api", default-features = false } +bifrost-primitives = { path = "../../primitives" , default-features = false } bifrost-runtime-common = { package = "bifrost-runtime-common", path = "../common", default-features = false } bifrost-salp = { path = "../../pallets/salp", default-features = false } bifrost-salp-rpc-runtime-api = { path = "../../pallets/salp/rpc/runtime-api", default-features = false } -pallet-vesting = { package = "bifrost-vesting", path = "../../pallets/vesting", default-features = false } -bifrost-vsbond-auction = { path = "../../pallets/vsbond-auction", default-features = false } -bifrost-token-issuer = { path = "../../pallets/token-issuer", default-features = false } -bifrost-call-switchgear = { path = "../../pallets/call-switchgear", default-features = false } bifrost-slp = { path = "../../pallets/slp", default-features = false } -# xcm-support = { path = "../../xcm-support", default-features = false } -bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-features = false } -bifrost-system-staking = { path = "../../pallets/system-staking", default-features = false } -bifrost-system-maker = { path = "../../pallets/system-maker", default-features = false } -bifrost-cross-in-out = { path = "../../pallets/cross-in-out", default-features = false } -bifrost-asset-registry = { path = "../../pallets/asset-registry", default-features = false } -bifrost-vstoken-conversion = { path = "../../pallets/vstoken-conversion", default-features = false } -bifrost-farming = { path = "../../pallets/farming", default-features = false } -bifrost-farming-rpc-runtime-api = { path = "../../pallets/farming/rpc/runtime-api", default-features = false } -parachain-staking = { path = "../../pallets/parachain-staking", default-features = false } -bifrost-fee-share = { path = "../../pallets/fee-share", default-features = false } bifrost-slpx = { path = "../../pallets/slpx", default-features = false } bifrost-stable-pool = { path = "../../pallets/stable-pool", default-features = false } bifrost-stable-pool-rpc-runtime-api = { path = "../../pallets/stable-pool/rpc/runtime-api", default-features = false } -bifrost-currencies = { workspace = true } +bifrost-system-maker = { path = "../../pallets/system-maker", default-features = false } +bifrost-system-staking = { path = "../../pallets/system-staking", default-features = false } +bifrost-token-issuer = { path = "../../pallets/token-issuer", default-features = false } +bifrost-vesting = { path = "../../pallets/vesting", default-features = false } +bifrost-vsbond-auction = { path = "../../pallets/vsbond-auction", default-features = false } +bifrost-vstoken-conversion = { path = "../../pallets/vstoken-conversion", default-features = false } +bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-features = false } bifrost-vtoken-voting = { path = "../../pallets/vtoken-voting", default-features = false, features = [ "kusama" ] } - -# orml -orml-tokens = { version = "0.4.1-dev", default-features = false } -orml-traits = { version = "0.4.1-dev", default-features = false } -orml-xtokens = { version = "0.4.1-dev", default-features = false } -orml-unknown-tokens = { version = "0.4.1-dev", default-features = false } -orml-xcm = { version = "0.4.1-dev", default-features = false } -orml-xcm-support = { version = "0.4.1-dev", default-features = false } - -merkle-distributor = { version = "*", default-features = false } -zenlink-protocol = { version = "*", default-features = false } -zenlink-protocol-runtime-api = { version = "*", default-features = false } -xcm-interface = { path = "../../pallets/xcm-interface", default-features = false } - -zenlink-stable-amm = { version = "*", default-features = false } -zenlink-stable-amm-runtime-api = { version = "*", default-features = false } -zenlink-swap-router = { version = "*", default-features = false } +bifrost-xcm-interface = { path = "../../pallets/xcm-interface", default-features = false } +parachain-staking = { path = "../../pallets/parachain-staking", default-features = false } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true } +substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } [features] default = ["std"] std = [ + "strum/std", "codec/std", "scale-info/std", "log/std", + + "frame-benchmarking?/std", "frame-executive/std", - "frame-try-runtime/std", "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", - "frame-benchmarking/std", - "node-primitives/std", + "frame-system-benchmarking?/std", + "frame-try-runtime/std", + "pallet-aura/std", + "pallet-authorship/std", "pallet-balances/std", "pallet-bounties/std", "pallet-collective/std", "pallet-conviction-voting/std", "pallet-democracy/std", + "pallet-elections-phragmen/std", "pallet-identity/std", "pallet-indices/std", + "pallet-membership/std", "pallet-multisig/std", + "pallet-preimage/std", "pallet-proxy/std", "pallet-ranked-collective/std", "pallet-referenda/std", + "pallet-scheduler/std", + "pallet-session/std", "pallet-timestamp/std", + "pallet-tips/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", "pallet-treasury/std", - "pallet-preimage/std", - "pallet-scheduler/std", - "pallet-elections-phragmen/std", - "pallet-tips/std", + "pallet-utility/std", "pallet-whitelist/std", "sp-api/std", - "sp-io/std", "sp-arithmetic/std", "sp-block-builder/std", "sp-consensus-aura/std", + "sp-core/std", "sp-inherents/std", + "sp-io/std", "sp-offchain/std", - "sp-core/std", "sp-runtime/std", - "sp-std/std", "sp-session/std", + "sp-staking/std", + "sp-std/std", "sp-transaction-pool/std", - "parachain-info/std", + "sp-version/std", + "cumulus-pallet-aura-ext/std", "cumulus-pallet-dmp-queue/std", "cumulus-pallet-parachain-system/std", - "cumulus-pallet-xcmp-queue/std", "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-core/std", "cumulus-primitives-timestamp/std", "cumulus-primitives-utility/std", + "parachain-info/std", + + "pallet-xcm/std", + "polkadot-parachain/std", + "polkadot-primitives/std", "xcm/std", "xcm-builder/std", "xcm-executor/std", - "polkadot-primitives/std", - "pallet-aura/std", - "pallet-collator-selection/std", - "pallet-session/std", - "pallet-vesting/std", - "bifrost-currencies/std", - "orml-traits/std", + "orml-tokens/std", - "orml-xtokens/std", + "orml-traits/std", "orml-unknown-tokens/std", - "orml-xcm/std", "orml-xcm-support/std", - "nutsfinance-stable-asset/std", - "bifrost-runtime-common/std", - "bifrost-farming/std", + "orml-xcm/std", + "orml-xtokens/std", + + "zenlink-protocol/std", + "zenlink-protocol-runtime-api/std", + "zenlink-stable-amm/std", + "zenlink-stable-amm-runtime-api/std", + "zenlink-swap-router/std", + "merkle-distributor/std", + + "bifrost-primitives/std", + "bifrost-asset-registry/std", + "bifrost-call-switchgear/std", + "bifrost-cross-in-out/std", + "bifrost-currencies/std", "bifrost-farming-rpc-runtime-api/std", - "bifrost-flexible-fee/std", + "bifrost-farming/std", + "bifrost-fee-share/std", "bifrost-flexible-fee-rpc-runtime-api/std", - "bifrost-salp/std", + "bifrost-flexible-fee/std", + "bifrost-runtime-common/std", "bifrost-salp-rpc-runtime-api/std", - "bifrost-vsbond-auction/std", - "bifrost-token-issuer/std", + "bifrost-salp/std", "bifrost-slp/std", - "bifrost-vtoken-minting/std", - "bifrost-asset-registry/std", - "bifrost-system-staking/std", - "bifrost-system-maker/std", - "bifrost-cross-in-out/std", - "parachain-staking/std", - "bifrost-fee-share/std", "bifrost-slpx/std", - "bifrost-stable-pool/std", "bifrost-stable-pool-rpc-runtime-api/std", + "bifrost-stable-pool/std", + "bifrost-system-maker/std", + "bifrost-system-staking/std", + "bifrost-token-issuer/std", + "bifrost-vesting/std", + "bifrost-vsbond-auction/std", + "bifrost-vstoken-conversion/std", + "bifrost-vtoken-minting/std", "bifrost-vtoken-voting/std", - "zenlink-protocol/std", - "zenlink-protocol-runtime-api/std", - "zenlink-stable-amm/std", - "zenlink-stable-amm-runtime-api/std", - "zenlink-swap-router/std", - "merkle-distributor/std", - "xcm-interface/std", - "substrate-wasm-builder", + "nutsfinance-stable-asset/std", + "parachain-staking/std", + "bifrost-xcm-interface/std", + + "substrate-wasm-builder" ] with-tracing = ["frame-executive/with-tracing"] @@ -259,7 +270,7 @@ runtime-benchmarks = [ "pallet-timestamp/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-utility/runtime-benchmarks", - "pallet-vesting/runtime-benchmarks", + "bifrost-vesting/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "pallet-tips/runtime-benchmarks", "pallet-elections-phragmen/runtime-benchmarks", @@ -319,7 +330,7 @@ try-runtime = [ "pallet-identity/try-runtime", "pallet-ranked-collective/try-runtime", "pallet-referenda/try-runtime", - "pallet-vesting/try-runtime", + "bifrost-vesting/try-runtime", "pallet-treasury/try-runtime", "pallet-bounties/try-runtime", "pallet-tips/try-runtime", @@ -342,7 +353,7 @@ try-runtime = [ "bifrost-asset-registry/try-runtime", "bifrost-vtoken-minting/try-runtime", "bifrost-slp/try-runtime", - "xcm-interface/try-runtime", + "bifrost-xcm-interface/try-runtime", "bifrost-vstoken-conversion/try-runtime", "bifrost-farming/try-runtime", "bifrost-system-staking/try-runtime", @@ -368,4 +379,4 @@ disable-runtime-api = [] on-chain-release-build = ["sp-api/disable-logging"] # Set timing constants (e.g. session period) to faster versions to speed up testing. -fast-runtime = [] +fast-runtime = [] \ No newline at end of file diff --git a/runtime/bifrost-kusama/build.rs b/runtime/bifrost-kusama/build.rs index 4d68d940e..a6d8f457d 100644 --- a/runtime/bifrost-kusama/build.rs +++ b/runtime/bifrost-kusama/build.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/constants.rs b/runtime/bifrost-kusama/src/constants.rs index 92d59e86b..f380305a6 100644 --- a/runtime/bifrost-kusama/src/constants.rs +++ b/runtime/bifrost-kusama/src/constants.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -22,12 +22,12 @@ pub mod currency { use crate::Runtime; use bifrost_asset_registry::Config; + use bifrost_primitives::{Balance, CurrencyId, TokenSymbol}; use bifrost_runtime_common::{cent, milli}; use frame_support::weights::{ constants::{ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }; - use node_primitives::{Balance, CurrencyId, TokenSymbol}; use smallvec::smallvec; pub use sp_runtime::Perbill; diff --git a/runtime/bifrost-kusama/src/governance/mod.rs b/runtime/bifrost-kusama/src/governance/mod.rs index 019de14ae..1751d465e 100644 --- a/runtime/bifrost-kusama/src/governance/mod.rs +++ b/runtime/bifrost-kusama/src/governance/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/governance/origins.rs b/runtime/bifrost-kusama/src/governance/origins.rs index 133b6dea6..e033ca963 100644 --- a/runtime/bifrost-kusama/src/governance/origins.rs +++ b/runtime/bifrost-kusama/src/governance/origins.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/governance/referenda.rs b/runtime/bifrost-kusama/src/governance/referenda.rs index e9bfea6e5..907a1b3f9 100644 --- a/runtime/bifrost-kusama/src/governance/referenda.rs +++ b/runtime/bifrost-kusama/src/governance/referenda.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/governance/tracks.rs b/runtime/bifrost-kusama/src/governance/tracks.rs index e4b7bcb64..fc0213782 100644 --- a/runtime/bifrost-kusama/src/governance/tracks.rs +++ b/runtime/bifrost-kusama/src/governance/tracks.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index 2cb858d44..23bdcfb07 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,8 +19,8 @@ //! The Bifrost Node runtime. This can be compiled with `#[no_std]`, ready for Wasm. #![cfg_attr(not(feature = "std"), no_std)] -// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. -#![recursion_limit = "256"] +// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 512. +#![recursion_limit = "512"] // Make the WASM binary available. #[cfg(feature = "std")] @@ -41,7 +41,7 @@ pub use frame_support::{ }, ConstantMultiplier, IdentityFee, Weight, }, - PalletId, RuntimeDebug, StorageValue, + PalletId, StorageValue, }; use frame_system::limits::{BlockLength, BlockWeights}; pub use pallet_balances::Call as BalancesCall; @@ -49,16 +49,15 @@ pub use pallet_timestamp::Call as TimestampCall; pub use parachain_staking::{InflationInfo, Range}; use sp_api::impl_runtime_apis; use sp_arithmetic::Percent; -use sp_core::OpaqueMetadata; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; +use sp_core::{ConstBool, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, StaticLookup, Zero, }, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, DispatchError, DispatchResult, Perbill, Permill, SaturatedConversion, + ApplyExtrinsicResult, DispatchError, DispatchResult, Perbill, Permill, RuntimeDebug, + SaturatedConversion, }; use sp_std::{marker::PhantomData, prelude::*}; #[cfg(feature = "std")] @@ -70,6 +69,15 @@ pub mod constants; pub mod weights; use bifrost_asset_registry::AssetIdMaps; +pub use bifrost_primitives::{ + traits::{ + CheckSubAccount, FarmingInfo, FeeGetter, VtokenMintingInterface, VtokenMintingOperator, + XcmDestWeightAndFeeHandler, + }, + AccountId, Amount, AssetIds, Balance, BlockNumber, CurrencyId, CurrencyIdMapping, + DistributionId, ExtraFeeInfo, ExtraFeeName, Liquidity, Moment, ParaId, PoolId, Price, Rate, + Ratio, RpcContributionStatus, Shortfall, TimeUnit, TokenSymbol, +}; pub use bifrost_runtime_common::{ cent, constants::time::*, dollar, micro, milli, millicent, prod_or_test, AuraId, CouncilCollective, EnsureRootOrAllTechnicalCommittee, MoreThanHalfCouncil, @@ -86,15 +94,6 @@ use frame_support::{ }; use frame_system::{EnsureRoot, EnsureSigned, EnsureWithSuccess}; use hex_literal::hex; -pub use node_primitives::{ - traits::{ - CheckSubAccount, FarmingInfo, FeeGetter, VtokenMintingInterface, VtokenMintingOperator, - XcmDestWeightAndFeeHandler, - }, - AccountId, Amount, AssetIds, Balance, BlockNumber, CurrencyId, CurrencyIdMapping, - DistributionId, ExtraFeeInfo, ExtraFeeName, Liquidity, Moment, Nonce, ParaId, PoolId, Price, - Rate, Ratio, RpcContributionStatus, Shortfall, TimeUnit, TokenSymbol, -}; // zenlink imports use zenlink_protocol::{ @@ -111,7 +110,7 @@ use governance::{ }; // xcm config -mod xcm_config; +pub mod xcm_config; use pallet_xcm::{EnsureResponse, QueryStatus}; use xcm::v3::prelude::*; pub use xcm_config::{ @@ -119,7 +118,7 @@ pub use xcm_config::{ ExistentialDeposits, MultiCurrency, SelfParaChainId, Sibling, SiblingParachainConvertsVia, XcmConfig, XcmRouter, }; -use xcm_executor::XcmExecutor; +use xcm_executor::{traits::QueryHandler, XcmExecutor}; impl_opaque_keys! { pub struct SessionKeys { @@ -157,6 +156,14 @@ const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64, ); +/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included +/// into the relay chain. +const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1; +/// How many parachain blocks are processed by the relay chain per parent. Limits the +/// number of blocks authored per slot. +const BLOCK_PROCESSING_VELOCITY: u32 = 1; +/// Relay chain slot duration, in milliseconds. +const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000; parameter_types! { pub const BlockHashCount: BlockNumber = 250; @@ -337,8 +344,9 @@ impl frame_system::Config for Runtime { type BlockHashCount = BlockHashCount; type BlockLength = RuntimeBlockLength; /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; type BlockWeights = RuntimeBlockWeights; + type Block = Block; /// The aggregated dispatch type that is available for extrinsics. type RuntimeCall = RuntimeCall; type DbWeight = RocksDbWeight; @@ -348,10 +356,6 @@ impl frame_system::Config for Runtime { type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; - /// The index type for storing how many extrinsics an account has signed. - type Index = Index; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = Indices; type OnKilledAccount = (); @@ -458,16 +462,17 @@ impl InstanceFilter for ProxyType { RuntimeCall::FellowshipCollective(..) | RuntimeCall::FellowshipReferenda(..) | RuntimeCall::Whitelist(..) | - RuntimeCall::Vesting(pallet_vesting::Call::vest{..}) | - RuntimeCall::Vesting(pallet_vesting::Call::vest_other{..}) | + RuntimeCall::Vesting(bifrost_vesting::Call::vest{..}) | + RuntimeCall::Vesting(bifrost_vesting::Call::vest_other{..}) | // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` RuntimeCall::Utility(..) | RuntimeCall::Proxy(..) | RuntimeCall::Multisig(..) | RuntimeCall::ParachainStaking(..) ), - ProxyType::Staking => - matches!(c, RuntimeCall::ParachainStaking(..) | RuntimeCall::Utility(..)), + ProxyType::Staking => { + matches!(c, RuntimeCall::ParachainStaking(..) | RuntimeCall::Utility(..)) + }, ProxyType::Governance => matches!( c, RuntimeCall::Democracy(..) | @@ -634,11 +639,11 @@ impl pallet_balances::Config for Runtime { type MaxLocks = ConstU32<50>; type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; - type HoldIdentifier = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; type WeightInfo = pallet_balances::weights::SubstrateWeight; + type RuntimeHoldReason = (); } parameter_types! { @@ -729,7 +734,7 @@ impl pallet_elections_phragmen::Config for Runtime { type CandidacyBond = CandidacyBond; type ChangeMembers = Council; type Currency = Balances; - type CurrencyToVote = frame_support::traits::U128CurrencyToVote; + type CurrencyToVote = sp_staking::currency_to_vote::U128CurrencyToVote; type DesiredMembers = DesiredMembers; type DesiredRunnersUp = DesiredRunnersUp; type RuntimeEvent = RuntimeEvent; @@ -966,6 +971,12 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type SelfParaId = parachain_info::Pallet; type XcmpMessageHandler = XcmpQueue; type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; + type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, + >; } impl parachain_info::Config for Runtime {} @@ -1081,16 +1092,17 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } // culumus runtime end -impl pallet_vesting::Config for Runtime { +impl bifrost_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type Currency = Balances; type RuntimeEvent = RuntimeEvent; type MinVestedTransfer = ExistentialDeposit; - type WeightInfo = pallet_vesting::weights::SubstrateWeight; + type WeightInfo = bifrost_vesting::weights::SubstrateWeight; } // Bifrost modules start @@ -1103,7 +1115,7 @@ impl FeeGetter for ExtraFeeMatcher { extra_fee_name: ExtraFeeName::SalpContribute, extra_fee_currency: RelayCurrencyId::get(), }, - RuntimeCall::XcmInterface(xcm_interface::Call::transfer_statemine_assets { + RuntimeCall::XcmInterface(bifrost_xcm_interface::Call::transfer_statemine_assets { .. }) => ExtraFeeInfo { extra_fee_name: ExtraFeeName::StatemineTransfer, @@ -1767,96 +1779,92 @@ where // zenlink runtime end construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = generic::Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { + pub enum Runtime { // Basic stuff - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 1, - Indices: pallet_indices::{Pallet, Call, Storage, Config, Event} = 2, - ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned} = 5, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 6, + System: frame_system = 0, + Timestamp: pallet_timestamp = 1, + Indices: pallet_indices = 2, + ParachainSystem: cumulus_pallet_parachain_system = 5, + ParachainInfo: parachain_info = 6, // Monetary stuff - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, // Collator support. the order of these 4 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, - ParachainStaking: parachain_staking::{Pallet, Call, Storage, Event, Config} = 25, + Authorship: pallet_authorship = 20, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, + ParachainStaking: parachain_staking = 25, // Governance stuff - Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event} = 30, - Council: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 31, - TechnicalCommittee: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 32, - PhragmenElection: pallet_elections_phragmen::{Pallet, Call, Storage, Event, Config} = 33, - CouncilMembership: pallet_membership::::{Pallet, Call, Storage, Event, Config} = 34, - TechnicalMembership: pallet_membership::::{Pallet, Call, Storage, Event, Config} = 35, - ConvictionVoting: pallet_conviction_voting::{Pallet, Call, Storage, Event} = 36, - Referenda: pallet_referenda::{Pallet, Call, Storage, Event} = 37, - Origins: custom_origins::{Origin} = 38, - Whitelist: pallet_whitelist::{Pallet, Call, Storage, Event} = 39, + Democracy: pallet_democracy = 30, + Council: pallet_collective:: = 31, + TechnicalCommittee: pallet_collective:: = 32, + PhragmenElection: pallet_elections_phragmen = 33, + CouncilMembership: pallet_membership:: = 34, + TechnicalMembership: pallet_membership:: = 35, + ConvictionVoting: pallet_conviction_voting = 36, + Referenda: pallet_referenda = 37, + Origins: custom_origins = 38, + Whitelist: pallet_whitelist = 39, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 40, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 41, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 42, - DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 43, + XcmpQueue: cumulus_pallet_xcmp_queue = 40, + PolkadotXcm: pallet_xcm = 41, + CumulusXcm: cumulus_pallet_xcm = 42, + DmpQueue: cumulus_pallet_dmp_queue = 43, // utilities - Utility: pallet_utility::{Pallet, Call, Event} = 50, - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 51, - Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 52, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 53, - Identity: pallet_identity::{Pallet, Call, Storage, Event} = 54, + Utility: pallet_utility = 50, + Scheduler: pallet_scheduler = 51, + Proxy: pallet_proxy = 52, + Multisig: pallet_multisig = 53, + Identity: pallet_identity = 54, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config} = 60, + Vesting: bifrost_vesting = 60, // Treasury stuff - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 61, - Bounties: pallet_bounties::{Pallet, Call, Storage, Event} = 62, - Tips: pallet_tips::{Pallet, Call, Storage, Event} = 63, - Preimage: pallet_preimage::{Pallet, Call, Storage, Event} = 64, + Treasury: pallet_treasury = 61, + Bounties: pallet_bounties = 62, + Tips: pallet_tips = 63, + Preimage: pallet_preimage = 64, // Third party modules - XTokens: orml_xtokens::{Pallet, Call, Event} = 70, - Tokens: orml_tokens::{Pallet, Call, Storage, Event, Config} = 71, - Currencies: bifrost_currencies::{Pallet, Call} = 72, - UnknownTokens: orml_unknown_tokens::{Pallet, Storage, Event} = 73, - OrmlXcm: orml_xcm::{Pallet, Call, Event} = 74, - ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event} = 80, - MerkleDistributor: merkle_distributor::{Pallet, Call, Storage, Event} = 81, - ZenlinkStableAMM: zenlink_stable_amm::{Pallet, Call, Storage, Event} = 82, - ZenlinkSwapRouter: zenlink_swap_router::{Pallet, Call, Event} = 83, + XTokens: orml_xtokens = 70, + Tokens: orml_tokens = 71, + Currencies: bifrost_currencies = 72, + UnknownTokens: orml_unknown_tokens = 73, + OrmlXcm: orml_xcm = 74, + ZenlinkProtocol: zenlink_protocol = 80, + MerkleDistributor: merkle_distributor = 81, + ZenlinkStableAMM: zenlink_stable_amm = 82, + ZenlinkSwapRouter: zenlink_swap_router = 83, // Bifrost modules - FlexibleFee: bifrost_flexible_fee::{Pallet, Call, Storage, Event} = 100, - Salp: bifrost_salp::{Pallet, Call, Storage, Event, Config} = 105, - TokenIssuer: bifrost_token_issuer::{Pallet, Call, Storage, Event} = 109, - CallSwitchgear: bifrost_call_switchgear::{Pallet, Storage, Call, Event} = 112, - VSBondAuction: bifrost_vsbond_auction::{Pallet, Call, Storage, Event} = 113, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Storage, Event, Config} = 114, - VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event} = 115, - Slp: bifrost_slp::{Pallet, Call, Storage, Event} = 116, - XcmInterface: xcm_interface::{Pallet, Call, Storage, Event} = 117, - VstokenConversion: bifrost_vstoken_conversion::{Pallet, Call, Storage, Event} = 118, - Farming: bifrost_farming::{Pallet, Call, Storage, Event} = 119, - SystemStaking: bifrost_system_staking::{Pallet, Call, Storage, Event} = 120, - SystemMaker: bifrost_system_maker::{Pallet, Call, Storage, Event} = 121, - FeeShare: bifrost_fee_share::{Pallet, Call, Storage, Event} = 122, - CrossInOut: bifrost_cross_in_out::{Pallet, Call, Storage, Event} = 123, - Slpx: bifrost_slpx::{Pallet, Call, Storage, Event} = 125, - FellowshipCollective: pallet_ranked_collective::::{Pallet, Call, Storage, Event} = 126, - FellowshipReferenda: pallet_referenda::::{Pallet, Call, Storage, Event} = 127, + FlexibleFee: bifrost_flexible_fee = 100, + Salp: bifrost_salp = 105, + TokenIssuer: bifrost_token_issuer = 109, + CallSwitchgear: bifrost_call_switchgear = 112, + VSBondAuction: bifrost_vsbond_auction = 113, + AssetRegistry: bifrost_asset_registry = 114, + VtokenMinting: bifrost_vtoken_minting = 115, + Slp: bifrost_slp = 116, + XcmInterface: bifrost_xcm_interface = 117, + VstokenConversion: bifrost_vstoken_conversion = 118, + Farming: bifrost_farming = 119, + SystemStaking: bifrost_system_staking = 120, + SystemMaker: bifrost_system_maker = 121, + FeeShare: bifrost_fee_share = 122, + CrossInOut: bifrost_cross_in_out = 123, + Slpx: bifrost_slpx = 125, + FellowshipCollective: pallet_ranked_collective:: = 126, + FellowshipReferenda: pallet_referenda:: = 127, StableAsset: nutsfinance_stable_asset::{Pallet, Storage, Event} = 128, - StablePool: bifrost_stable_pool::{Pallet, Call, Storage} = 129, - VtokenVoting: bifrost_vtoken_voting::{Pallet, Call, Storage, Event} = 130, + StablePool: bifrost_stable_pool = 129, + VtokenVoting: bifrost_vtoken_voting = 130, } } @@ -1865,7 +1873,7 @@ pub type AccountIndex = u32; /// Alias to 512-bit hash when used in the context of a transaction signature on the chain. pub type Signature = sp_runtime::MultiSignature; /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; /// The address format for describing accounts. @@ -1905,10 +1913,8 @@ pub type Migrations = migrations::Unreleased; /// The runtime migrations per release. pub mod migrations { - use super::*; - /// Unreleased migrations. Add new ones here: - pub type Unreleased = bifrost_slp::migrations::v3::SlpMigration3; + pub type Unreleased = (); } /// Executive: handles dispatch to the various modules. @@ -2258,7 +2264,8 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch}; + use frame_support::traits::TrackedStorageKey; impl frame_system_benchmarking::Config for Runtime {} @@ -2304,31 +2311,7 @@ impl_runtime_apis! { } } -struct CheckInherents; - -impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { - fn check_inherents( - block: &Block, - relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof, - ) -> sp_inherents::CheckInherentsResult { - let relay_chain_slot = relay_state_proof - .read_slot() - .expect("Could not read the relay chain slot from the proof"); - - let inherent_data = - cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration( - relay_chain_slot, - sp_std::time::Duration::from_secs(6), - ) - .create_inherent_data() - .expect("Could not create the timestamp inherent data"); - - inherent_data.check_extrinsics(&block) - } -} - cumulus_pallet_parachain_system::register_validate_block! { Runtime = Runtime, - BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, - CheckInherents = CheckInherents, + BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor:: } diff --git a/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs b/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs index 1ab2267b4..2ebcdcc3a 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs b/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs index c56319b60..439245f52 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_cross_in_out.rs b/runtime/bifrost-kusama/src/weights/bifrost_cross_in_out.rs index 2fcb40922..870af08ca 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_cross_in_out.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_cross_in_out.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_currencies.rs b/runtime/bifrost-kusama/src/weights/bifrost_currencies.rs index e61432c75..887a44be1 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_currencies.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_currencies.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_farming.rs b/runtime/bifrost-kusama/src/weights/bifrost_farming.rs index 6d36c92de..71c982085 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_farming.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_farming.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_fee_share.rs b/runtime/bifrost-kusama/src/weights/bifrost_fee_share.rs index 2e7902d09..2050da409 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_fee_share.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_fee_share.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_flexible_fee.rs b/runtime/bifrost-kusama/src/weights/bifrost_flexible_fee.rs index 881576d80..6a6e53a34 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_flexible_fee.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_flexible_fee.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_salp.rs b/runtime/bifrost-kusama/src/weights/bifrost_salp.rs index 15bec40ae..90284da6c 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_salp.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_salp.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_slp.rs b/runtime/bifrost-kusama/src/weights/bifrost_slp.rs index cce095967..52bdd66e0 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_slp.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_slp.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_slpx.rs b/runtime/bifrost-kusama/src/weights/bifrost_slpx.rs index 0ac0da0d3..e9c0cddc2 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_slpx.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_slpx.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_stable_pool.rs b/runtime/bifrost-kusama/src/weights/bifrost_stable_pool.rs index 42173ec5d..0a5a8a795 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_stable_pool.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_stable_pool.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_system_maker.rs b/runtime/bifrost-kusama/src/weights/bifrost_system_maker.rs index 346c74f41..e2109a2d2 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_system_maker.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_system_maker.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_system_staking.rs b/runtime/bifrost-kusama/src/weights/bifrost_system_staking.rs index f498d3d9e..ad7e3aed0 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_system_staking.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_system_staking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_token_issuer.rs b/runtime/bifrost-kusama/src/weights/bifrost_token_issuer.rs index 770f5587b..6c4799180 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_token_issuer.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_token_issuer.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vsbond_auction.rs b/runtime/bifrost-kusama/src/weights/bifrost_vsbond_auction.rs index 3dcf1d92c..b74cd417a 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_vsbond_auction.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_vsbond_auction.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vstoken_conversion.rs b/runtime/bifrost-kusama/src/weights/bifrost_vstoken_conversion.rs index 3ead07648..dc9a50fe5 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_vstoken_conversion.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_vstoken_conversion.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs index 417757860..357805ee9 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs index e6fe0ba43..bb84d9973 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/mod.rs b/runtime/bifrost-kusama/src/weights/mod.rs index af2596d47..3a6d87883 100644 --- a/runtime/bifrost-kusama/src/weights/mod.rs +++ b/runtime/bifrost-kusama/src/weights/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/orml_tokens.rs b/runtime/bifrost-kusama/src/weights/orml_tokens.rs index 767421ecf..2c3d2973b 100644 --- a/runtime/bifrost-kusama/src/weights/orml_tokens.rs +++ b/runtime/bifrost-kusama/src/weights/orml_tokens.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/weights/pallet_xcm.rs b/runtime/bifrost-kusama/src/weights/pallet_xcm.rs index f3086a25e..6743ec7bd 100644 --- a/runtime/bifrost-kusama/src/weights/pallet_xcm.rs +++ b/runtime/bifrost-kusama/src/weights/pallet_xcm.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-kusama/src/xcm_config.rs b/runtime/bifrost-kusama/src/xcm_config.rs index 0226d0fb4..fde878fce 100644 --- a/runtime/bifrost-kusama/src/xcm_config.rs +++ b/runtime/bifrost-kusama/src/xcm_config.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,6 +18,8 @@ use super::*; use bifrost_asset_registry::{AssetIdMaps, FixedRateOfAsset}; +use bifrost_primitives::{AccountId, CurrencyId, CurrencyIdMapping, TokenSymbol}; +pub use bifrost_xcm_interface::traits::{parachains, XcmBaseWeight}; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; use frame_support::{ @@ -25,7 +27,6 @@ use frame_support::{ sp_runtime::traits::{CheckedConversion, Convert}, traits::Get, }; -use node_primitives::{AccountId, CurrencyId, CurrencyIdMapping, TokenSymbol}; pub use polkadot_parachain::primitives::Sibling; use sp_std::{convert::TryFrom, marker::PhantomData}; pub use xcm_builder::{ @@ -36,7 +37,6 @@ pub use xcm_builder::{ SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, }; use xcm_executor::traits::{MatchesFungible, ShouldExecute}; -pub use xcm_interface::traits::{parachains, XcmBaseWeight}; // orml imports use bifrost_currencies::BasicCurrencyAdapter; @@ -53,7 +53,8 @@ pub use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key use pallet_xcm::XcmPassthrough; use sp_core::bounded::BoundedVec; use xcm::v3::prelude::*; -use xcm_builder::Account32Hash; +use xcm_builder::{Account32Hash, TrailingSetTopicAsId}; +use xcm_executor::traits::Properties; /// Bifrost Asset Matcher pub struct BifrostAssetMatcher( @@ -203,11 +204,13 @@ impl> Convert> for BifrostCurre X3(Parachain(id), PalletInstance(index), GeneralIndex(key)) if (id == parachains::Statemine::ID && index == parachains::Statemine::PALLET_ID) => + { if key == parachains::Statemine::RMRK_ID as u128 { Some(Token(RMRK)) } else { None - }, + } + }, X1(Parachain(id)) if id == parachains::phala::ID => Some(Token(PHA)), X2(Parachain(id), PalletInstance(index)) if ((id == parachains::moonriver::ID) && @@ -305,7 +308,7 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionDes origin: &MultiLocation, message: &mut [Instruction], max_weight: Weight, - _weight_credit: &mut Weight, + _weight_credit: &mut Properties, ) -> Result<(), ProcessMessageError> { log::trace!( target: "xcm::barriers", @@ -353,31 +356,6 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionDes } } -/// Sets the message ID to `t` using a `SetTopic(t)` in the last position if present. -/// -/// Requires some inner barrier to pass on the rest of the message. -pub struct TrailingSetTopicAsId(PhantomData); -impl ShouldExecute for TrailingSetTopicAsId { - fn should_execute( - origin: &MultiLocation, - instructions: &mut [Instruction], - max_weight: Weight, - weight_credit: &mut Weight, - ) -> Result<(), ProcessMessageError> { - log::trace!( - target: "xcm::barriers", - "TrailingSetTopicAsId origin: {:?}, instructions: {:?}, max_weight: {:?}", - origin, instructions, max_weight, - ); - let until = if let Some(SetTopic(_)) = instructions.last() { - instructions.len() - 1 - } else { - instructions.len() - }; - InnerBarrier::should_execute(&origin, &mut instructions[..until], max_weight, weight_credit) - } -} - pub type Barrier = TrailingSetTopicAsId<( // Weight that is paid for may be consumed. TakeWeightCredit, @@ -650,7 +628,7 @@ impl Contains for SafeCallFilter { bifrost_vtoken_minting::Call::redeem { .. } ) | RuntimeCall::XcmInterface( - xcm_interface::Call::transfer_statemine_assets { .. } + bifrost_xcm_interface::Call::transfer_statemine_assets { .. } ) | RuntimeCall::Slpx(..) | RuntimeCall::ZenlinkProtocol( @@ -696,6 +674,7 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type FeeManager = (); type MessageExporter = (); + type Aliasers = Nothing; } /// Local origins on this chain are allowed to dispatch XCM sends/executions. @@ -723,12 +702,12 @@ impl pallet_xcm::Config for Runtime { type Weigher = FixedWeightBounds; type XcmExecuteFilter = Nothing; #[cfg(feature = "runtime-benchmarks")] - type XcmExecutor = node_primitives::DoNothingExecuteXcm; + type XcmExecutor = bifrost_primitives::DoNothingExecuteXcm; #[cfg(not(feature = "runtime-benchmarks"))] type XcmExecutor = XcmExecutor; type XcmReserveTransferFilter = Everything; #[cfg(feature = "runtime-benchmarks")] - type XcmRouter = node_primitives::DoNothingRouter; + type XcmRouter = bifrost_primitives::DoNothingRouter; #[cfg(not(feature = "runtime-benchmarks"))] type XcmRouter = XcmRouter; type XcmTeleportFilter = Nothing; @@ -745,6 +724,8 @@ impl pallet_xcm::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } impl cumulus_pallet_xcm::Config for Runtime { @@ -904,7 +885,7 @@ impl orml_xtokens::Config for Runtime { type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; #[cfg(feature = "runtime-benchmarks")] - type XcmExecutor = node_primitives::DoNothingExecuteXcm; + type XcmExecutor = bifrost_primitives::DoNothingExecuteXcm; #[cfg(not(feature = "runtime-benchmarks"))] type XcmExecutor = XcmExecutor; type Weigher = FixedWeightBounds; @@ -929,7 +910,7 @@ parameter_types! { } -impl xcm_interface::Config for Runtime { +impl bifrost_xcm_interface::Config for Runtime { type RuntimeEvent = RuntimeEvent; type UpdateOrigin = TechAdminOrCouncil; type MultiCurrency = Currencies; @@ -937,7 +918,7 @@ impl xcm_interface::Config for Runtime { type RelaychainCurrencyId = RelayCurrencyId; type ParachainSovereignAccount = ParachainAccount; #[cfg(feature = "runtime-benchmarks")] - type XcmExecutor = node_primitives::DoNothingExecuteXcm; + type XcmExecutor = bifrost_primitives::DoNothingExecuteXcm; #[cfg(not(feature = "runtime-benchmarks"))] type XcmExecutor = XcmExecutor; type AccountIdToMultiLocation = BifrostAccountIdToMultiLocation; diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index 78f6e5b19..7ceb55760 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -7,148 +7,147 @@ build = "build.rs" [dependencies] # third-party dependencies -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ - "derive", - "max-encoded-len", -] } -hex-literal = { version = "0.3.1" } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } +hex-literal = { version = "0.4.1" } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.3.1", default-features = false, features = [ - "derive", -] } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } smallvec = "1.10.0" static_assertions = "1.1.0" strum = { version = "0.24", default-features = false, features = [ "derive" ] } strum_macros = "0.24" -# primitives -node-primitives = { default-features = false, path = "../../node/primitives", features=["with-bifrost-polkadot-runtime"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } # frame dependencies -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -frame-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, features = ["tuples-96"] } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-bounties = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-conviction-voting = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-preimage = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.42', default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-whitelist = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, features = ["tuples-96"] } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-bounties = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-preimage = { git = 'https://github.com/paritytech/polkadot-sdk.git', branch = 'release-polkadot-v1.1.0', default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-ranked-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-tips = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-whitelist = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Cumulus dependencies -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false ,features = ["parameterized-consensus-hook"] } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Polkadot dependencies -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } + +# orml +orml-tokens = { version = "0.4.1-dev", default-features = false } +orml-traits = { version = "0.4.1-dev", default-features = false } +orml-xtokens = { version = "0.4.1-dev", default-features = false } +orml-unknown-tokens = { version = "0.4.1-dev", default-features = false } +orml-xcm = { version = "0.4.1-dev", default-features = false } +orml-xcm-support = { version = "0.4.1-dev", default-features = false } + +# zenlink +merkle-distributor = { version = "*", default-features = false } +zenlink-protocol = { version = "*", default-features = false } +zenlink-protocol-runtime-api = { version = "*", default-features = false } # Nuts Finance nutsfinance-stable-asset = { path = "../../pallets/stable-asset", default-features = false } # Bifrost +bifrost-asset-registry = { path = "../../pallets/asset-registry", default-features = false } +bifrost-call-switchgear = { path = "../../pallets/call-switchgear", default-features = false } +bifrost-cross-in-out = { path = "../../pallets/cross-in-out", default-features = false } +bifrost-currencies = { path = "../../pallets/currencies", default-features = false} +bifrost-farming = { path = "../../pallets/farming", default-features = false } +bifrost-farming-rpc-runtime-api = { path = "../../pallets/farming/rpc/runtime-api", default-features = false } +bifrost-fee-share = { path = "../../pallets/fee-share", default-features = false } bifrost-flexible-fee = { path = "../../pallets/flexible-fee", default-features = false } bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api", default-features = false } +bifrost-primitives = { default-features = false, path = "../../primitives" } +bifrost-runtime-common = { package = "bifrost-runtime-common", path = "../common", default-features = false } bifrost-salp = { path = "../../pallets/salp", default-features = false } bifrost-salp-rpc-runtime-api = { path = "../../pallets/salp/rpc/runtime-api", default-features = false } -pallet-vesting = { package = "bifrost-vesting", path = "../../pallets/vesting", default-features = false } -bifrost-runtime-common = { package = "bifrost-runtime-common", path = "../common", default-features = false } -bifrost-call-switchgear = { path = "../../pallets/call-switchgear", default-features = false } bifrost-slp = { path = "../../pallets/slp", default-features = false } -bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-features = false } -bifrost-system-staking = { path = "../../pallets/system-staking", default-features = false } +bifrost-slpx = { path = "../../pallets/slpx", default-features = false } +bifrost-stable-pool = { path = "../../pallets/stable-pool", default-features = false } +bifrost-stable-pool-rpc-runtime-api = { path = "../../pallets/stable-pool/rpc/runtime-api", default-features = false } bifrost-system-maker = { path = "../../pallets/system-maker", default-features = false } -bifrost-cross-in-out = { path = "../../pallets/cross-in-out", default-features = false } -bifrost-asset-registry = { path = "../../pallets/asset-registry", default-features = false } -bifrost-vstoken-conversion = { path = "../../pallets/vstoken-conversion", default-features = false } -bifrost-farming = { path = "../../pallets/farming", default-features = false } -bifrost-farming-rpc-runtime-api = { path = "../../pallets/farming/rpc/runtime-api", default-features = false } -bifrost-fee-share = { path = "../../pallets/fee-share", default-features = false } +bifrost-system-staking = { path = "../../pallets/system-staking", default-features = false } bifrost-ve-minting = { path = "../../pallets/ve-minting", default-features = false } bifrost-ve-minting-rpc-runtime-api = { path = "../../pallets/ve-minting/rpc/runtime-api", default-features = false } -bifrost-slpx = { path = "../../pallets/slpx", default-features = false, features=["with-bifrost-polkadot-runtime"] } -pallet-ranked-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-referenda = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -bifrost-currencies = { workspace = true } -bifrost-stable-pool = { path = "../../pallets/stable-pool", default-features = false } -bifrost-stable-pool-rpc-runtime-api = { path = "../../pallets/stable-pool/rpc/runtime-api", default-features = false } +bifrost-vesting = { path = "../../pallets/vesting", default-features = false } +bifrost-vstoken-conversion = { path = "../../pallets/vstoken-conversion", default-features = false } +bifrost-vtoken-minting = { path = "../../pallets/vtoken-minting", default-features = false } bifrost-vtoken-voting = { path = "../../pallets/vtoken-voting", default-features = false, features = [ "polkadot" ] } - -# orml -orml-tokens = { version = "0.4.1-dev", default-features = false } -orml-traits = { version = "0.4.1-dev", default-features = false } -orml-xtokens = { version = "0.4.1-dev", default-features = false } -orml-unknown-tokens = { version = "0.4.1-dev", default-features = false } -orml-xcm = { version = "0.4.1-dev", default-features = false } -orml-xcm-support = { version = "0.4.1-dev", default-features = false } - -merkle-distributor = { version = "*", default-features = false } -zenlink-protocol = { version = "*", default-features = false } -zenlink-protocol-runtime-api = { version = "*", default-features = false } -xcm-interface = { path = "../../pallets/xcm-interface", default-features = false } +bifrost-xcm-interface = { path = "../../pallets/xcm-interface", default-features = false } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true } +substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } [features] default = ["std"] std = [ "codec/std", - "scale-info/std", "log/std", + "scale-info/std", + "strum/std", + "frame-executive/std", - "frame-try-runtime/std", "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", - "node-primitives/std", + "frame-try-runtime/std", + "pallet-aura/std", "pallet-balances/std", "pallet-bounties/std", + "pallet-collator-selection/std", "pallet-collective/std", "pallet-conviction-voting/std", "pallet-democracy/std", @@ -157,77 +156,84 @@ std = [ "pallet-indices/std", "pallet-membership/std", "pallet-multisig/std", + "pallet-preimage/std", "pallet-proxy/std", "pallet-ranked-collective/std", "pallet-referenda/std", + "pallet-scheduler/std", + "pallet-session/std", "pallet-timestamp/std", "pallet-tips/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", "pallet-treasury/std", - "pallet-preimage/std", - "pallet-scheduler/std", + "pallet-whitelist/std", "sp-api/std", "sp-arithmetic/std", "sp-block-builder/std", "sp-consensus-aura/std", + "sp-core/std", "sp-inherents/std", + "sp-io/std", "sp-offchain/std", - "sp-core/std", "sp-runtime/std", - "sp-std/std", "sp-session/std", + "sp-staking/std", + "sp-std/std", "sp-transaction-pool/std", - "sp-io/std", - "parachain-info/std", + "cumulus-pallet-aura-ext/std", "cumulus-pallet-dmp-queue/std", "cumulus-pallet-parachain-system/std", - "cumulus-pallet-xcmp-queue/std", "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-core/std", "cumulus-primitives-timestamp/std", "cumulus-primitives-utility/std", - "xcm/std", + "parachain-info/std", + + "polkadot-primitives/std", "xcm-builder/std", "xcm-executor/std", - "polkadot-primitives/std", - "pallet-aura/std", - "pallet-collator-selection/std", - "pallet-session/std", - "pallet-vesting/std", - "pallet-whitelist/std", - "bifrost-currencies/std", - "orml-traits/std", + "xcm/std", + "orml-tokens/std", - "orml-xtokens/std", + "orml-traits/std", "orml-unknown-tokens/std", - "orml-xcm/std", "orml-xcm-support/std", - "bifrost-runtime-common/std", - "bifrost-farming/std", + "orml-xcm/std", + "orml-xtokens/std", + + "merkle-distributor/std", + "zenlink-protocol-runtime-api/std", + "zenlink-protocol/std", + + "bifrost-asset-registry/std", + "bifrost-cross-in-out/std", + "bifrost-currencies/std", "bifrost-farming-rpc-runtime-api/std", - "bifrost-flexible-fee/std", + "bifrost-farming/std", + "bifrost-fee-share/std", "bifrost-flexible-fee-rpc-runtime-api/std", - "bifrost-salp/std", + "bifrost-flexible-fee/std", + "bifrost-primitives/std", + "bifrost-runtime-common/std", "bifrost-salp-rpc-runtime-api/std", + "bifrost-salp/std", "bifrost-slp/std", - "bifrost-vtoken-minting/std", - "bifrost-asset-registry/std", - "bifrost-system-staking/std", + "bifrost-slpx/std", + "bifrost-stable-pool-rpc-runtime-api/std", + "bifrost-stable-pool/std", "bifrost-system-maker/std", - "bifrost-fee-share/std", - "bifrost-ve-minting/std", + "bifrost-system-staking/std", "bifrost-ve-minting-rpc-runtime-api/std", + "bifrost-ve-minting/std", + "bifrost-vesting/std", + "bifrost-vtoken-minting/std", "bifrost-vtoken-voting/std", - "zenlink-protocol/std", - "zenlink-protocol-runtime-api/std", - "merkle-distributor/std", - "bifrost-cross-in-out/std", - "substrate-wasm-builder", - "bifrost-slpx/std", - "bifrost-stable-pool/std", - "bifrost-stable-pool-rpc-runtime-api/std", + "bifrost-xcm-interface/std", + + "substrate-wasm-builder" ] with-tracing = ["frame-executive/with-tracing"] @@ -247,7 +253,7 @@ runtime-benchmarks = [ "pallet-timestamp/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-utility/runtime-benchmarks", - "pallet-vesting/runtime-benchmarks", + "bifrost-vesting/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", @@ -295,7 +301,7 @@ try-runtime = [ "pallet-identity/try-runtime", "pallet-ranked-collective/try-runtime", "pallet-referenda/try-runtime", - "pallet-vesting/try-runtime", + "bifrost-vesting/try-runtime", "pallet-treasury/try-runtime", "pallet-bounties/try-runtime", "pallet-tips/try-runtime", @@ -314,7 +320,7 @@ try-runtime = [ "bifrost-asset-registry/try-runtime", "bifrost-vtoken-minting/try-runtime", "bifrost-slp/try-runtime", - "xcm-interface/try-runtime", + "bifrost-xcm-interface/try-runtime", "bifrost-vstoken-conversion/try-runtime", "bifrost-farming/try-runtime", "bifrost-system-staking/try-runtime", diff --git a/runtime/bifrost-polkadot/build.rs b/runtime/bifrost-polkadot/build.rs index 4d68d940e..8b3550ecf 100644 --- a/runtime/bifrost-polkadot/build.rs +++ b/runtime/bifrost-polkadot/build.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -15,7 +15,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . - #[cfg(feature = "std")] fn main() { substrate_wasm_builder::WasmBuilder::new() diff --git a/runtime/bifrost-polkadot/src/constants.rs b/runtime/bifrost-polkadot/src/constants.rs index 27fa77a6e..a6c5cd6ec 100644 --- a/runtime/bifrost-polkadot/src/constants.rs +++ b/runtime/bifrost-polkadot/src/constants.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -21,12 +21,12 @@ /// Money matters. pub mod currency { use crate::Runtime; + use bifrost_primitives::{Balance, CurrencyId, TokenSymbol}; use bifrost_runtime_common::{cent, milli}; use frame_support::weights::{ constants::{ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }; - use node_primitives::{Balance, CurrencyId, TokenSymbol}; use smallvec::smallvec; pub use sp_runtime::Perbill; @@ -79,7 +79,7 @@ pub mod currency { /// Time. pub mod time { - use node_primitives::{BlockNumber, Moment}; + use bifrost_primitives::{BlockNumber, Moment}; /// Since BABE is probabilistic this is the average expected block time that /// we are targetting. Blocks will be produced at a minimum duration defined diff --git a/runtime/bifrost-polkadot/src/governance/mod.rs b/runtime/bifrost-polkadot/src/governance/mod.rs index 019de14ae..1751d465e 100644 --- a/runtime/bifrost-polkadot/src/governance/mod.rs +++ b/runtime/bifrost-polkadot/src/governance/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/governance/origins.rs b/runtime/bifrost-polkadot/src/governance/origins.rs index 133b6dea6..474fa1c45 100644 --- a/runtime/bifrost-polkadot/src/governance/origins.rs +++ b/runtime/bifrost-polkadot/src/governance/origins.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -50,7 +50,6 @@ pub mod custom_origins { /// Origin able to configure SystemStaking. SystemStakingAdmin, /// Origin able to execute SALP protocol. - #[strum(serialize = "salp_admin")] SALPAdmin, /// Origin commanded by any members of the Polkadot Fellowship (no Dan grade needed). FellowshipInitiates, diff --git a/runtime/bifrost-polkadot/src/governance/referenda.rs b/runtime/bifrost-polkadot/src/governance/referenda.rs index e9bfea6e5..907a1b3f9 100644 --- a/runtime/bifrost-polkadot/src/governance/referenda.rs +++ b/runtime/bifrost-polkadot/src/governance/referenda.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/governance/tracks.rs b/runtime/bifrost-polkadot/src/governance/tracks.rs index e4b7bcb64..fc0213782 100644 --- a/runtime/bifrost-polkadot/src/governance/tracks.rs +++ b/runtime/bifrost-polkadot/src/governance/tracks.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 31c4e5cc6..efd0f1ea2 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -19,8 +19,8 @@ //! The Bifrost Node runtime. This can be compiled with `#[no_std]`, ready for Wasm. #![cfg_attr(not(feature = "std"), no_std)] -// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. -#![recursion_limit = "256"] +// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 512. +#![recursion_limit = "512"] // Make the WASM binary available. #[cfg(feature = "std")] @@ -31,12 +31,11 @@ use core::convert::TryInto; // A few exports that help ease life for downstream crates. use cumulus_pallet_parachain_system::{RelayNumberStrictlyIncreases, RelaychainDataProvider}; pub use frame_support::{ - construct_runtime, - inherent::Vec, - match_types, parameter_types, + construct_runtime, match_types, parameter_types, traits::{ - ConstU128, ConstU32, ConstU64, ConstU8, Contains, EqualPrivilegeOnly, Everything, - Imbalance, InstanceFilter, IsInVec, LockIdentifier, Nothing, OnUnbalanced, Randomness, + ConstBool, ConstU128, ConstU32, ConstU64, ConstU8, Contains, EqualPrivilegeOnly, + Everything, Imbalance, InstanceFilter, IsInVec, LockIdentifier, NeverEnsureOrigin, Nothing, + OnUnbalanced, Randomness, }, weights::{ constants::{ @@ -44,7 +43,7 @@ pub use frame_support::{ }, ConstantMultiplier, IdentityFee, Weight, }, - PalletId, RuntimeDebug, StorageValue, + PalletId, StorageValue, }; use frame_system::limits::{BlockLength, BlockWeights}; pub use pallet_balances::Call as BalancesCall; @@ -52,13 +51,11 @@ pub use pallet_timestamp::Call as TimestampCall; use sp_api::impl_runtime_apis; use sp_arithmetic::Percent; use sp_core::{OpaqueMetadata, U256}; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, Zero}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, DispatchError, DispatchResult, Perbill, Permill, + ApplyExtrinsicResult, DispatchError, DispatchResult, Perbill, Permill, RuntimeDebug, }; use sp_std::{marker::PhantomData, prelude::*}; #[cfg(feature = "std")] @@ -69,6 +66,16 @@ use sp_version::RuntimeVersion; pub mod constants; pub mod weights; use bifrost_asset_registry::{AssetIdMaps, FixedRateOfAsset}; +pub use bifrost_primitives::{ + traits::{ + CheckSubAccount, FarmingInfo, FeeGetter, VtokenMintingInterface, VtokenMintingOperator, + XcmDestWeightAndFeeHandler, + }, + AccountId, Amount, AssetIds, Balance, BlockNumber, CurrencyId, CurrencyIdMapping, + DistributionId, ExtraFeeInfo, ExtraFeeName, Liquidity, Moment, Nonce, ParaId, PoolId, Price, + Rate, Ratio, RpcContributionStatus, Shortfall, TimeUnit, TokenSymbol, DOT_TOKEN_ID, + GLMR_TOKEN_ID, +}; use bifrost_runtime_common::{ constants::time::*, dollar, micro, milli, prod_or_test, AuraId, CouncilCollective, EnsureRootOrAllTechnicalCommittee, MoreThanHalfCouncil, SlowAdjustingFeeUpdate, @@ -86,23 +93,13 @@ use frame_support::{ }; use frame_system::{EnsureRoot, EnsureSigned, EnsureWithSuccess}; use hex_literal::hex; -pub use node_primitives::{ - traits::{ - CheckSubAccount, FarmingInfo, FeeGetter, VtokenMintingInterface, VtokenMintingOperator, - XcmDestWeightAndFeeHandler, - }, - AccountId, Amount, AssetIds, Balance, BlockNumber, CurrencyId, CurrencyIdMapping, - DistributionId, ExtraFeeInfo, ExtraFeeName, Liquidity, Moment, Nonce, ParaId, PoolId, Price, - Rate, Ratio, RpcContributionStatus, Shortfall, TimeUnit, TokenSymbol, DOT_TOKEN_ID, - GLMR_TOKEN_ID, -}; // zenlink imports use zenlink_protocol::{ AssetBalance, AssetId as ZenlinkAssetId, LocalAssetHandler, MultiAssetsHandler, PairInfo, PairLpGenerate, ZenlinkMultiAssets, }; // xcm config -mod xcm_config; +pub mod xcm_config; use orml_traits::{currency::MutationHooks, location::RelativeReserveProvider}; use pallet_xcm::{EnsureResponse, QueryStatus}; use static_assertions::const_assert; @@ -110,7 +107,10 @@ use xcm::v3::prelude::*; use xcm_config::{ parachains, BifrostCurrencyIdConvert, BifrostTreasuryAccount, MultiCurrency, SelfParaChainId, }; -use xcm_executor::XcmExecutor; +use xcm_executor::{ + traits::{Properties, QueryHandler}, + XcmExecutor, +}; pub mod governance; use governance::{ @@ -154,6 +154,14 @@ const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64, ); +/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included +/// into the relay chain. +const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1; +/// How many parachain blocks are processed by the relay chain per parent. Limits the +/// number of blocks authored per slot. +const BLOCK_PROCESSING_VELOCITY: u32 = 1; +/// Relay chain slot duration, in milliseconds. +const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000; parameter_types! { pub const BlockHashCount: BlockNumber = 250; @@ -320,7 +328,7 @@ impl frame_system::Config for Runtime { type BlockHashCount = BlockHashCount; type BlockLength = RuntimeBlockLength; /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; type BlockWeights = RuntimeBlockWeights; /// The aggregated dispatch type that is available for extrinsics. type RuntimeCall = RuntimeCall; @@ -331,10 +339,7 @@ impl frame_system::Config for Runtime { type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; - /// The index type for storing how many extrinsics an account has signed. - type Index = Index; + type Block = Block; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = Indices; type OnKilledAccount = (); @@ -435,8 +440,8 @@ impl InstanceFilter for ProxyType { RuntimeCall::Treasury(..) | RuntimeCall::Bounties(..) | RuntimeCall::Tips(..) | - RuntimeCall::Vesting(pallet_vesting::Call::vest{..}) | - RuntimeCall::Vesting(pallet_vesting::Call::vest_other{..}) | + RuntimeCall::Vesting(bifrost_vesting::Call::vest{..}) | + RuntimeCall::Vesting(bifrost_vesting::Call::vest_other{..}) | // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` RuntimeCall::Utility(..) | RuntimeCall::Proxy(..) | @@ -603,11 +608,11 @@ impl pallet_balances::Config for Runtime { type MaxLocks = ConstU32<50>; type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; - type HoldIdentifier = (); type FreezeIdentifier = (); type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; type WeightInfo = pallet_balances::weights::SubstrateWeight; + type RuntimeHoldReason = (); } parameter_types! { @@ -698,7 +703,7 @@ impl pallet_elections_phragmen::Config for Runtime { type CandidacyBond = CandidacyBond; type ChangeMembers = Council; type Currency = Balances; - type CurrencyToVote = frame_support::traits::U128CurrencyToVote; + type CurrencyToVote = sp_staking::currency_to_vote::U128CurrencyToVote; type DesiredMembers = DesiredMembers; type DesiredRunnersUp = DesiredRunnersUp; type RuntimeEvent = RuntimeEvent; @@ -879,6 +884,12 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type SelfParaId = parachain_info::Pallet; type XcmpMessageHandler = XcmpQueue; type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; + type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, + >; } impl parachain_info::Config for Runtime {} @@ -913,11 +924,11 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_types! { pub const PotId: PalletId = PalletId(*b"PotStake"); - pub const MinCandidates: u32 = 5; pub const SessionLength: BlockNumber = 6 * HOURS; pub const MaxInvulnerables: u32 = 100; } @@ -929,23 +940,23 @@ impl pallet_collator_selection::Config for Runtime { type KickThreshold = Period; type MaxCandidates = MaxCandidates; type MaxInvulnerables = MaxInvulnerables; - type MinCandidates = MinCandidates; type PotId = PotId; type UpdateOrigin = EnsureRoot; type ValidatorId = ::AccountId; type ValidatorIdOf = pallet_collator_selection::IdentityCollator; type ValidatorRegistration = Session; type WeightInfo = (); + type MinEligibleCollators = ConstU32<5>; } // culumus runtime end -impl pallet_vesting::Config for Runtime { +impl bifrost_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type Currency = Balances; type RuntimeEvent = RuntimeEvent; type MinVestedTransfer = ExistentialDeposit; - type WeightInfo = pallet_vesting::weights::SubstrateWeight; + type WeightInfo = bifrost_vesting::weights::SubstrateWeight; } // Bifrost modules start @@ -958,7 +969,7 @@ impl FeeGetter for ExtraFeeMatcher { extra_fee_name: ExtraFeeName::SalpContribute, extra_fee_currency: RelayCurrencyId::get(), }, - RuntimeCall::XcmInterface(xcm_interface::Call::transfer_statemine_assets { + RuntimeCall::XcmInterface(bifrost_xcm_interface::Call::transfer_statemine_assets { .. }) => ExtraFeeInfo { extra_fee_name: ExtraFeeName::StatemineTransfer, @@ -1574,93 +1585,89 @@ where // zenlink runtime end construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = generic::Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { + pub enum Runtime { // Basic stuff - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 1, - Indices: pallet_indices::{Pallet, Call, Storage, Config, Event} = 2, - ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned} = 5, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 6, + System: frame_system = 0, + Timestamp: pallet_timestamp = 1, + Indices: pallet_indices = 2, + ParachainSystem: cumulus_pallet_parachain_system = 5, + ParachainInfo: parachain_info = 6, // Monetary stuff - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, // Collator support. the order of these 4 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, // Governance stuff - Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event} = 30, - Council: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 31, - TechnicalCommittee: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 32, - PhragmenElection: pallet_elections_phragmen::{Pallet, Call, Storage, Event, Config} = 33, - CouncilMembership: pallet_membership::::{Pallet, Call, Storage, Event, Config} = 34, - TechnicalMembership: pallet_membership::::{Pallet, Call, Storage, Event, Config} = 35, - ConvictionVoting: pallet_conviction_voting::{Pallet, Call, Storage, Event} = 36, - Referenda: pallet_referenda::{Pallet, Call, Storage, Event} = 37, - Origins: custom_origins::{Origin} = 38, - Whitelist: pallet_whitelist::{Pallet, Call, Storage, Event} = 39, + Democracy: pallet_democracy = 30, + Council: pallet_collective:: = 31, + TechnicalCommittee: pallet_collective:: = 32, + PhragmenElection: pallet_elections_phragmen = 33, + CouncilMembership: pallet_membership:: = 34, + TechnicalMembership: pallet_membership:: = 35, + ConvictionVoting: pallet_conviction_voting = 36, + Referenda: pallet_referenda = 37, + Origins: custom_origins = 38, + Whitelist: pallet_whitelist = 39, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 40, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 41, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 42, - DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 43, + XcmpQueue: cumulus_pallet_xcmp_queue = 40, + PolkadotXcm: pallet_xcm = 41, + CumulusXcm: cumulus_pallet_xcm = 42, + DmpQueue: cumulus_pallet_dmp_queue = 43, // utilities - Utility: pallet_utility::{Pallet, Call, Event} = 50, - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 51, - Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 52, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 53, - Identity: pallet_identity::{Pallet, Call, Storage, Event} = 54, + Utility: pallet_utility = 50, + Scheduler: pallet_scheduler = 51, + Proxy: pallet_proxy = 52, + Multisig: pallet_multisig = 53, + Identity: pallet_identity = 54, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config} = 60, + Vesting: bifrost_vesting = 60, // Treasury stuff - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 61, - Bounties: pallet_bounties::{Pallet, Call, Storage, Event} = 62, - Tips: pallet_tips::{Pallet, Call, Storage, Event} = 63, - Preimage: pallet_preimage::{Pallet, Call, Storage, Event} = 64, + Treasury: pallet_treasury = 61, + Bounties: pallet_bounties = 62, + Tips: pallet_tips = 63, + Preimage: pallet_preimage = 64, // Third party modules - XTokens: orml_xtokens::{Pallet, Call, Event} = 70, - Tokens: orml_tokens::{Pallet, Call, Storage, Event, Config} = 71, - Currencies: bifrost_currencies::{Pallet, Call} = 72, - UnknownTokens: orml_unknown_tokens::{Pallet, Storage, Event} = 73, - OrmlXcm: orml_xcm::{Pallet, Call, Event} = 74, - ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event} = 80, - MerkleDistributor: merkle_distributor::{Pallet, Call, Storage, Event} = 81, + XTokens: orml_xtokens = 70, + Tokens: orml_tokens = 71, + Currencies: bifrost_currencies = 72, + UnknownTokens: orml_unknown_tokens = 73, + OrmlXcm: orml_xcm = 74, + ZenlinkProtocol: zenlink_protocol = 80, + MerkleDistributor: merkle_distributor = 81, // Bifrost modules - FlexibleFee: bifrost_flexible_fee::{Pallet, Call, Storage, Event} = 100, - Salp: bifrost_salp::{Pallet, Call, Storage, Event, Config} = 105, - CallSwitchgear: bifrost_call_switchgear::{Pallet, Storage, Call, Event} = 112, - AssetRegistry: bifrost_asset_registry::{Pallet, Call, Storage, Event, Config} = 114, - VtokenMinting: bifrost_vtoken_minting::{Pallet, Call, Storage, Event} = 115, - Slp: bifrost_slp::{Pallet, Call, Storage, Event} = 116, - XcmInterface: xcm_interface::{Pallet, Call, Storage, Event} = 117, - TokenConversion: bifrost_vstoken_conversion::{Pallet, Call, Storage, Event} = 118, - Farming: bifrost_farming::{Pallet, Call, Storage, Event} = 119, - SystemStaking: bifrost_system_staking::{Pallet, Call, Storage, Event} = 120, - SystemMaker: bifrost_system_maker::{Pallet, Call, Storage, Event} = 121, - FeeShare: bifrost_fee_share::{Pallet, Call, Storage, Event} = 122, - CrossInOut: bifrost_cross_in_out::{Pallet, Call, Storage, Event} = 123, - VeMinting: bifrost_ve_minting::{Pallet, Call, Storage, Event} = 124, - Slpx: bifrost_slpx::{Pallet, Call, Storage, Event} = 125, - FellowshipCollective: pallet_ranked_collective::::{Pallet, Call, Storage, Event} = 126, - FellowshipReferenda: pallet_referenda::::{Pallet, Call, Storage, Event} = 127, + FlexibleFee: bifrost_flexible_fee = 100, + Salp: bifrost_salp = 105, + CallSwitchgear: bifrost_call_switchgear = 112, + AssetRegistry: bifrost_asset_registry = 114, + VtokenMinting: bifrost_vtoken_minting = 115, + Slp: bifrost_slp = 116, + XcmInterface: bifrost_xcm_interface = 117, + TokenConversion: bifrost_vstoken_conversion = 118, + Farming: bifrost_farming = 119, + SystemStaking: bifrost_system_staking = 120, + SystemMaker: bifrost_system_maker = 121, + FeeShare: bifrost_fee_share = 122, + CrossInOut: bifrost_cross_in_out = 123, + VeMinting: bifrost_ve_minting = 124, + Slpx: bifrost_slpx = 125, + FellowshipCollective: pallet_ranked_collective:: = 126, + FellowshipReferenda: pallet_referenda:: = 127, StableAsset: nutsfinance_stable_asset::{Pallet, Storage, Event} = 128, - StablePool: bifrost_stable_pool::{Pallet, Call, Storage} = 129, - VtokenVoting: bifrost_vtoken_voting::{Pallet, Call, Storage, Event} = 130, + StablePool: bifrost_stable_pool = 129, + VtokenVoting: bifrost_vtoken_voting = 130, } } @@ -1709,10 +1716,8 @@ pub type Migrations = migrations::Unreleased; /// The runtime migrations per release. pub mod migrations { - use super::*; - /// Unreleased migrations. Add new ones here: - pub type Unreleased = bifrost_slp::migrations::v3::SlpMigration3; + pub type Unreleased = (); } /// Executive: handles dispatch to the various modules. @@ -1951,19 +1956,19 @@ impl_runtime_apis! { impl bifrost_ve_minting_rpc_runtime_api::VeMintingRuntimeApi for Runtime { fn balance_of( who: AccountId, - t: Option, + t: Option, ) -> Balance{ VeMinting::balance_of(&who, t).unwrap_or(Zero::zero()) } fn total_supply( - t: node_primitives::BlockNumber, + t: bifrost_primitives::BlockNumber, ) -> Balance{ VeMinting::total_supply(t).unwrap_or(Zero::zero()) } fn find_block_epoch( - block: node_primitives::BlockNumber, + block: bifrost_primitives::BlockNumber, max_epoch: U256, ) -> U256{ VeMinting::find_block_epoch(block, max_epoch) @@ -2007,7 +2012,8 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch}; + use frame_support::traits::TrackedStorageKey; impl frame_system_benchmarking::Config for Runtime {} @@ -2044,31 +2050,7 @@ impl_runtime_apis! { } } -struct CheckInherents; - -impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { - fn check_inherents( - block: &Block, - relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof, - ) -> sp_inherents::CheckInherentsResult { - let relay_chain_slot = relay_state_proof - .read_slot() - .expect("Could not read the relay chain slot from the proof"); - - let inherent_data = - cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration( - relay_chain_slot, - sp_std::time::Duration::from_secs(6), - ) - .create_inherent_data() - .expect("Could not create the timestamp inherent data"); - - inherent_data.check_extrinsics(&block) - } -} - cumulus_pallet_parachain_system::register_validate_block! { Runtime = Runtime, - BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, - CheckInherents = CheckInherents, + BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor:: } diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs b/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs index 1ab2267b4..2ebcdcc3a 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs b/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs index c56319b60..439245f52 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_cross_in_out.rs b/runtime/bifrost-polkadot/src/weights/bifrost_cross_in_out.rs index 2fcb40922..870af08ca 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_cross_in_out.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_cross_in_out.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_currencies.rs b/runtime/bifrost-polkadot/src/weights/bifrost_currencies.rs index e61432c75..887a44be1 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_currencies.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_currencies.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_farming.rs b/runtime/bifrost-polkadot/src/weights/bifrost_farming.rs index 6d36c92de..71c982085 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_farming.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_farming.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_fee_share.rs b/runtime/bifrost-polkadot/src/weights/bifrost_fee_share.rs index 2e7902d09..2050da409 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_fee_share.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_fee_share.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_flexible_fee.rs b/runtime/bifrost-polkadot/src/weights/bifrost_flexible_fee.rs index 881576d80..6a6e53a34 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_flexible_fee.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_flexible_fee.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_salp.rs b/runtime/bifrost-polkadot/src/weights/bifrost_salp.rs index 15bec40ae..90284da6c 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_salp.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_salp.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_slp.rs b/runtime/bifrost-polkadot/src/weights/bifrost_slp.rs index cce095967..52bdd66e0 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_slp.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_slp.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_slpx.rs b/runtime/bifrost-polkadot/src/weights/bifrost_slpx.rs index 0ac0da0d3..e9c0cddc2 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_slpx.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_slpx.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_stable_pool.rs b/runtime/bifrost-polkadot/src/weights/bifrost_stable_pool.rs index 42173ec5d..0a5a8a795 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_stable_pool.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_stable_pool.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_system_maker.rs b/runtime/bifrost-polkadot/src/weights/bifrost_system_maker.rs index 346c74f41..e2109a2d2 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_system_maker.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_system_maker.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_system_staking.rs b/runtime/bifrost-polkadot/src/weights/bifrost_system_staking.rs index f498d3d9e..ad7e3aed0 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_system_staking.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_system_staking.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_ve_minting.rs b/runtime/bifrost-polkadot/src/weights/bifrost_ve_minting.rs index 459a687a3..b618c420b 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_ve_minting.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_ve_minting.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_vstoken_conversion.rs b/runtime/bifrost-polkadot/src/weights/bifrost_vstoken_conversion.rs index 3ead07648..dc9a50fe5 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_vstoken_conversion.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_vstoken_conversion.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs index 417757860..357805ee9 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs index e6fe0ba43..bb84d9973 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/mod.rs b/runtime/bifrost-polkadot/src/weights/mod.rs index 239b4103b..8179b7b0a 100644 --- a/runtime/bifrost-polkadot/src/weights/mod.rs +++ b/runtime/bifrost-polkadot/src/weights/mod.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/orml_tokens.rs b/runtime/bifrost-polkadot/src/weights/orml_tokens.rs index 767421ecf..2c3d2973b 100644 --- a/runtime/bifrost-polkadot/src/weights/orml_tokens.rs +++ b/runtime/bifrost-polkadot/src/weights/orml_tokens.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/weights/pallet_xcm.rs b/runtime/bifrost-polkadot/src/weights/pallet_xcm.rs index f3086a25e..6743ec7bd 100644 --- a/runtime/bifrost-polkadot/src/weights/pallet_xcm.rs +++ b/runtime/bifrost-polkadot/src/weights/pallet_xcm.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/runtime/bifrost-polkadot/src/xcm_config.rs b/runtime/bifrost-polkadot/src/xcm_config.rs index 809744930..6edb0e024 100644 --- a/runtime/bifrost-polkadot/src/xcm_config.rs +++ b/runtime/bifrost-polkadot/src/xcm_config.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,6 +18,10 @@ use super::*; use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{ + AccountId, CurrencyId, CurrencyIdMapping, TokenSymbol, DOT_TOKEN_ID, GLMR_TOKEN_ID, +}; +pub use bifrost_xcm_interface::traits::{parachains, XcmBaseWeight}; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; use frame_support::{ @@ -25,9 +29,6 @@ use frame_support::{ sp_runtime::traits::{CheckedConversion, Convert}, traits::{ContainsPair, Get, ProcessMessageError}, }; -use node_primitives::{ - AccountId, CurrencyId, CurrencyIdMapping, TokenSymbol, DOT_TOKEN_ID, GLMR_TOKEN_ID, -}; pub use polkadot_parachain::primitives::Sibling; use sp_std::{convert::TryFrom, marker::PhantomData}; pub use xcm_builder::{ @@ -38,7 +39,6 @@ pub use xcm_builder::{ SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, }; use xcm_executor::traits::{MatchesFungible, ShouldExecute}; -pub use xcm_interface::traits::{parachains, XcmBaseWeight}; // orml imports use bifrost_currencies::BasicCurrencyAdapter; @@ -258,7 +258,7 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionDes origin: &MultiLocation, message: &mut [Instruction], max_weight: Weight, - _weight_credit: &mut Weight, + _weight_credit: &mut Properties, ) -> Result<(), ProcessMessageError> { log::trace!( target: "xcm::barriers", @@ -484,7 +484,7 @@ impl Contains for SafeCallFilter { bifrost_vtoken_minting::Call::redeem { .. } ) | RuntimeCall::XcmInterface( - xcm_interface::Call::transfer_statemine_assets { .. } + bifrost_xcm_interface::Call::transfer_statemine_assets { .. } ) | RuntimeCall::Slpx(..) | RuntimeCall::ZenlinkProtocol( @@ -522,6 +522,7 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type FeeManager = (); type MessageExporter = (); + type Aliasers = Nothing; } /// Local origins on this chain are allowed to dispatch XCM sends/executions. @@ -551,7 +552,7 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmReserveTransferFilter = Everything; #[cfg(feature = "runtime-benchmarks")] - type XcmRouter = node_primitives::DoNothingRouter; + type XcmRouter = bifrost_primitives::DoNothingRouter; #[cfg(not(feature = "runtime-benchmarks"))] type XcmRouter = XcmRouter; type XcmTeleportFilter = Nothing; @@ -568,6 +569,8 @@ impl pallet_xcm::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); } impl cumulus_pallet_xcm::Config for Runtime { @@ -716,7 +719,7 @@ parameter_types! { pub ParachainAccount: AccountId = ParachainInfo::get().into_account_truncating(); } -impl xcm_interface::Config for Runtime { +impl bifrost_xcm_interface::Config for Runtime { type RuntimeEvent = RuntimeEvent; type UpdateOrigin = TechAdminOrCouncil; type MultiCurrency = Currencies; diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 46d6d93cf..1acc034e2 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -10,52 +10,52 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = log = { version = "0.4.14", default-features = false } # primitives -node-primitives = { default-features = false, path = "../../node/primitives" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +bifrost-primitives = { default-features = false, path = "../../primitives" } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # frame dependencies -frame-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Cumulus dependencies -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } -pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Polkadot dependencies -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42", default-features = false } +polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # orml orml-tokens = { version = "0.4.1-dev", default-features = false } @@ -65,7 +65,7 @@ orml-xcm-support = { version = "0.4.1-dev", default-features = false } zenlink-protocol = { version = "*", default-features = false } zenlink-protocol-runtime-api = { version = "*", default-features = false } -xcm-interface = { path = "../../pallets/xcm-interface", default-features = false } +bifrost-xcm-interface = { path = "../../pallets/xcm-interface", default-features = false } bifrost-asset-registry = { path = "../../pallets/asset-registry", default-features = false } [features] @@ -77,7 +77,7 @@ std = [ "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", - "node-primitives/std", + "bifrost-primitives/std", "sp-block-builder/std", "sp-inherents/std", "sp-offchain/std", @@ -114,6 +114,6 @@ std = [ "orml-xcm-support/std", "zenlink-protocol/std", "zenlink-protocol-runtime-api/std", - "xcm-interface/std", + "bifrost-xcm-interface/std", "bifrost-asset-registry/std", ] diff --git a/runtime/common/src/constants.rs b/runtime/common/src/constants.rs index 5b48a3b4d..f53504944 100644 --- a/runtime/common/src/constants.rs +++ b/runtime/common/src/constants.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -20,7 +20,7 @@ /// Time. pub mod time { - use node_primitives::{BlockNumber, Moment}; + use bifrost_primitives::{BlockNumber, Moment}; pub const MILLISECS_PER_BLOCK: Moment = 12000; pub const SECS_PER_BLOCK: Moment = MILLISECS_PER_BLOCK / 1000; diff --git a/runtime/common/src/currency_adapter.rs b/runtime/common/src/currency_adapter.rs index 192d6f2d9..8e2f6ad74 100644 --- a/runtime/common/src/currency_adapter.rs +++ b/runtime/common/src/currency_adapter.rs @@ -15,7 +15,7 @@ use sp_std::{ use xcm::v3::{prelude::*, Error as XcmError, MultiAsset, MultiLocation, Result, Weight}; use xcm_builder::TakeRevenue; use xcm_executor::{ - traits::{Convert as MoreConvert, DropAssets, MatchesFungible, TransactAsset}, + traits::{ConvertLocation, DropAssets, MatchesFungible, TransactAsset}, Assets, }; @@ -132,7 +132,7 @@ impl< UnknownAsset: UnknownAssetT, Match: MatchesFungible, AccountId: sp_std::fmt::Debug + Clone, - AccountIdConvert: MoreConvert, + AccountIdConvert: ConvertLocation, CurrencyId: FullCodec + Eq + PartialEq + Copy + MaybeSerializeDeserialize + Debug, CurrencyIdConvert: Convert>, DepositFailureHandler: OnDepositFail, @@ -154,17 +154,17 @@ impl< _context: &XcmContext, ) -> Result { match ( - AccountIdConvert::convert_ref(location), + AccountIdConvert::convert_location(location), CurrencyIdConvert::convert(asset.clone()), Match::matches_fungible(asset), ) { // known asset - (Ok(who), Some(currency_id), Some(amount)) => + (Some(who), Some(currency_id), Some(amount)) => MultiCurrency::deposit(currency_id, &who, amount).or_else(|err| { DepositFailureHandler::on_deposit_currency_fail(err, currency_id, &who, amount) }), // bad beneficiary - (Err(_), Some(currency_id), Some(amount)) => + (None, Some(currency_id), Some(amount)) => DepositFailureHandler::on_account_id_convert_fail(currency_id, amount), // unknown asset _ => UnknownAsset::deposit(asset, location).or_else(|err| { @@ -179,8 +179,8 @@ impl< _maybe_context: Option<&XcmContext>, ) -> result::Result { UnknownAsset::withdraw(asset, location).or_else(|_| { - let who = AccountIdConvert::convert_ref(location) - .map_err(|_| XcmError::from(Error::AccountIdConversionFailed))?; + let who = AccountIdConvert::convert_location(location) + .ok_or(XcmError::from(Error::AccountIdConversionFailed))?; let currency_id = CurrencyIdConvert::convert(asset.clone()) .ok_or_else(|| XcmError::from(Error::CurrencyIdConversionFailed))?; let amount: MultiCurrency::Balance = Match::matches_fungible(asset) @@ -199,10 +199,10 @@ impl< to: &MultiLocation, _context: &XcmContext, ) -> result::Result { - let from_account = AccountIdConvert::convert_ref(from) - .map_err(|_| XcmError::from(Error::AccountIdConversionFailed))?; - let to_account = AccountIdConvert::convert_ref(to) - .map_err(|_| XcmError::from(Error::AccountIdConversionFailed))?; + let from_account = AccountIdConvert::convert_location(from) + .ok_or(XcmError::from(Error::AccountIdConversionFailed))?; + let to_account = AccountIdConvert::convert_location(to) + .ok_or(XcmError::from(Error::AccountIdConversionFailed))?; let currency_id = CurrencyIdConvert::convert(asset.clone()) .ok_or_else(|| XcmError::from(Error::CurrencyIdConversionFailed))?; let amount: MultiCurrency::Balance = Match::matches_fungible(asset) diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 26c31eac6..3f4b184e2 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -18,11 +18,13 @@ #![cfg_attr(not(feature = "std"), no_std)] use bifrost_asset_registry::{AssetIdMaps, Config}; +use bifrost_primitives::{ + AccountId, Balance, BlockNumber, CurrencyId, CurrencyIdMapping, TokenInfo, +}; use frame_support::{ parameter_types, sp_runtime::traits::BlockNumberProvider, traits::EitherOfDiverse, }; use frame_system::EnsureRoot; -use node_primitives::{AccountId, Balance, BlockNumber, CurrencyId, CurrencyIdMapping, TokenInfo}; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_runtime::{traits::Bounded, FixedPointNumber, Perquintill}; diff --git a/runtime/common/src/tests.rs b/runtime/common/src/tests.rs index 29284a71b..af2f2f7bd 100644 --- a/runtime/common/src/tests.rs +++ b/runtime/common/src/tests.rs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -// use node_primitives::{CurrencyId, TokenSymbol}; +// use bifrost_primitives::{CurrencyId, TokenSymbol}; // use crate::{cent, micro}; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4115a9530..b54157581 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2022-11-15" +channel = "nightly-2023-05-22" components = ["cargo", "clippy", "rustc", "rustfmt", "rust-src"] profile = "minimal" targets = ["wasm32-unknown-unknown"] diff --git a/scripts/init.sh b/scripts/init.sh index 824ac9131..19a13ceef 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -4,6 +4,6 @@ set -e echo "*** Initializing WASM build environment" -rustup default nightly-2022-11-15 +rustup default nightly-2023-05-22 -rustup target add wasm32-unknown-unknown --toolchain nightly-2022-11-15 +rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 diff --git a/weight-template/pallet-weight-template.hbs b/weight-template/pallet-weight-template.hbs index 0c5fb87e6..fe4d10675 100644 --- a/weight-template/pallet-weight-template.hbs +++ b/weight-template/pallet-weight-template.hbs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify diff --git a/weight-template/runtime-weight-template.hbs b/weight-template/runtime-weight-template.hbs index 357185b68..64719e25c 100644 --- a/weight-template/runtime-weight-template.hbs +++ b/weight-template/runtime-weight-template.hbs @@ -1,6 +1,6 @@ // This file is part of Bifrost. -// Copyright (C) 2019-2022 Liebi Technologies (UK) Ltd. +// Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify