diff --git a/Cargo.lock b/Cargo.lock index 6e566d356..9e7440541 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "aquamarine" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074b80d14d0240b6ce94d68f059a2d26a5d77280ae142662365a21ef6e2594ef" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" dependencies = [ "include_dir", "itertools 0.10.5", @@ -2027,9 +2027,9 @@ dependencies = [ [[package]] name = "binary-merkle-tree" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf2706ac2641485d35ed06ebfe0b3b2c43e19a7ad8a90215580a91dd1766114" +checksum = "2bf857f8f411164ce1af14a778626af96251de7a77837711efbc440807e7053f" dependencies = [ "hash-db 0.16.0", "log", @@ -2209,9 +2209,9 @@ dependencies = [ [[package]] name = "bounded-collections" -version = "0.1.9" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" +checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" dependencies = [ "log", "parity-scale-codec", @@ -2230,9 +2230,9 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub-router" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f58cd5d7880f4bc8fc569e5bb0174302cd3f7e18a322e0fec2a4733cced35cb" +checksum = "86ff4abe93be7bc1663adc41817b1aa3476fbec953ce361537419924310d5dd4" dependencies = [ "parity-scale-codec", "scale-info", @@ -2266,16 +2266,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "bstr" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "bstringify" version = "0.1.2" @@ -2524,9 +2514,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.14" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e92c5c1a78c62968ec57dbc2440366a2d6e5a23faf829970ff1585dc6b18e2" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -2534,9 +2524,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.14" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4323769dc8a61e2c39ad7dc26f6f2800524691a44d74fe3d1071a5c24db6370" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -2547,11 +2537,11 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.60", @@ -2559,9 +2549,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "coarsetime" @@ -2943,9 +2933,9 @@ dependencies = [ [[package]] name = "cumulus-client-cli" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88972dcd58e7d411ebfd9d82d7399aad567afe737ba8ad0943abfaf1a8b3903b" +checksum = "70d2597fe3235d263457aaff65d0fb5bed506698b81530e2e6afecd6d6c9af32" dependencies = [ "clap", "parity-scale-codec", @@ -2961,9 +2951,9 @@ dependencies = [ [[package]] name = "cumulus-client-collator" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab9d9114479da745e34b1a4529dca9e51a61860593b61681107249bc68024bd4" +checksum = "3c06ae72a125d056da3b722f00f87881a2afbb2af8fe9fa9a91587f139b9667e" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -2985,9 +2975,9 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00378c991116820c354713b3d3be2c9789f84bfb86d0a3c97676cc9e8a39c174" +checksum = "18f4977f6a88af39c46832d571ac0d95e8322bf22eab42550fec34f72da9f034" dependencies = [ "async-trait", "cumulus-client-collator", @@ -3028,9 +3018,9 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385c403c208f654e276f6d7ae30316d3d64f0975c9e19a18ed5943a963cc48c6" +checksum = "350db1fc8841a44f344474b791d2ebe61b79bf6061043a7d826b3d02d1935a56" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -3058,9 +3048,9 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614b239940f64843c65ec19e157ee769c556f74f084077dc2f0425f0a671e9ba" +checksum = "38028f75597a34d447f059d6a7fd9c1c91bce0b8c48b08b1cbd19eb3def9c376" dependencies = [ "anyhow", "async-trait", @@ -3074,9 +3064,9 @@ dependencies = [ [[package]] name = "cumulus-client-network" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee9b8802b76850237bbf2c1afb869a9673b49ef9545b31698e1bffbffcaa4254" +checksum = "0ac095ef439c595ccb998be5a9d40778d8963c5a8ebbaed838fed6293232915b" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -3098,9 +3088,9 @@ dependencies = [ [[package]] name = "cumulus-client-parachain-inherent" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bcc095540bb3ad848b1d5cd8708d8b493729370d4671df5a0c38ea53382e46b" +checksum = "0b516290cd4a6efc117824135761f3642dc57685e13da00727c460053ce978fe" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3111,7 +3101,7 @@ dependencies = [ "sc-client-api", "scale-info", "sp-api", - "sp-core", + "sp-crypto-hashing", "sp-inherents", "sp-runtime", "sp-state-machine", @@ -3123,9 +3113,9 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd12cbdd57209ffc68d167b0c22c90d5680185b57d03e4c2436aef7dfd918a2" +checksum = "b4d55e96004ca9aa9d9b96a28ab2d97b1ca8d303c9d2405ea34cdf1462d4c4f0" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3148,9 +3138,9 @@ dependencies = [ [[package]] name = "cumulus-client-service" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5be0615943319f8750eb54793f8ec8721b2081852c23ed450da54cfcf6aca97" +checksum = "657f57c56159bb6cb74d9221de8f11c9e09962666381357896562662d3019799" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -3185,9 +3175,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8100a3283be2c46905345141e9a063f092949c6630a1fb70993b04c97f309e55" +checksum = "9e8e78b18548ae3454bc8a46e2bc2e3f521ea547844cbaecc9344d4741f4b1ef" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -3204,9 +3194,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f461956a4a85c053657fe64e73852940c8a52e7d8fc20ccb4f91688e73f0820b" +checksum = "06ebf036bcb1e61c943cf588d14b903234594fb2538f2d7dae36e20fcc3c86e8" dependencies = [ "cumulus-primitives-core", "frame-benchmarking", @@ -3223,9 +3213,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1a0e6800ea92447eab2c9170cc77d21987fd0e61ed79a6e1318f7b127b3e2c" +checksum = "1a215fe4d66d23e8f3956bd21b9d80d2b33239f3b150b36d56fa238cfc9421a5" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -3241,6 +3231,7 @@ dependencies = [ "pallet-message-queue", "parity-scale-codec", "polkadot-parachain-primitives", + "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", "sp-core", @@ -3270,9 +3261,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9e5e8dd3f9c98620e32cbb1783725a3e75a3147cb351b43de37663824311cd9" +checksum = "8e802291060763f8d1176bf808da97aafe5afe7351f62bb093c317c1d35c5cee" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -3287,9 +3278,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439cdba45813623e7f45374f160f3356d27fb1aaca2536dd7f60ef2a7e9b30cd" +checksum = "0fa22d6e479a4d3a2790bab291269ba0917a1ac384255a54a2ebc3f7c37e505e" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", @@ -3313,9 +3304,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-aura" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ad9d2b1454d6957a92b3f8755d7bfa2b5b70ab2fa7751215f6897de5ac4cf6" +checksum = "2f07d6177692154043d7ddcc0b87ca5365ae8e4d94b90d9931f6b2f76e162f09" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -3328,9 +3319,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "036b64697b5fd04c8039ccf15b9891104c496afb6c418c2cea1234d4898d0a28" +checksum = "9df07f6825fd50ea30aae335e43dc1a615a05de7465f5f329b9e414f2c886a12" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -3346,9 +3337,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cb6fe06744fed6e84682c48816181ad63652003570c2135c425481440fcd2f2" +checksum = "38ad140a065a6b8001fb26ec42b91391e90fde120f5b4e57986698249a9b98c8" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3362,9 +3353,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-proof-size-hostfunction" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a132e17ac2c79436bc5004b0d56cb35ca65b966434f14e5ff8a9bc1afcfca5a4" +checksum = "c1b74f9141190b9f4bf96a947ade46da64097b77f1ebfa8d611c81724250e119" dependencies = [ "sp-externalities", "sp-runtime-interface", @@ -3373,9 +3364,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d1d900bd9e76607a4a0734cbb2b004d86177d2d6938b5d25eb812c6c1b7500" +checksum = "34584abda4aeac69abe08ba3146d0ca059cd5636a8c4ccf680f2b9f99fc5f8ee" dependencies = [ "cumulus-primitives-core", "futures 0.3.30", @@ -3387,14 +3378,14 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ece52eeb7e87faea0d374356571ebc13f279df3bf79a1dc8a0db6c49d6ba23" +checksum = "e65466e56d642f979b556d098a03755ae51972fff5fa0f9b1cdcfdb3df062ea3" dependencies = [ "cumulus-primitives-core", "frame-support", "log", - "pallet-xcm-benchmarks", + "pallet-asset-conversion", "parity-scale-codec", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -3408,9 +3399,9 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6801c53e543614ce1b9f87cfca8ed69aab5318ba51439c0db8a910c8c3d77a15" +checksum = "cff27dec2eab6cd1d854756d62bd7053721ccd115f36f9e8b0976b1e46b70ef7" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3433,9 +3424,9 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf9bd710caacdee77f50f01a40f37f8c9af1040e895de3e0b421f2c4ad0a291" +checksum = "40c736f39b50eecf194707e15d0359677bb8fe8138b01f6493ab9b7e10d2d1ae" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3452,9 +3443,9 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b1e0847e45d6a5090ee32b4dc3497cb0671b9a6a9259f9a263a769560c5b60e" +checksum = "4c7718fe298d567adc44fae3dd7024418d6eff08264041e4b0544d1892861cd6" dependencies = [ "array-bytes 6.2.2", "async-trait", @@ -3494,9 +3485,9 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cb8a4c98335aeac261bde9b21e7518c099bfacc96592a052750051cebda158c" +checksum = "d8e2269d4c1f37593257b3d7b90f8b56adab0793d9b9f5c1b5334c9ca7e3b10b" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3534,9 +3525,9 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ec12490a40b00427119fd1e12a6d1fe0652d2df3e992dea1bc4f331effed12" +checksum = "bfff604ad01c5c0c397f9a971c8cec6443aea3658813778875b4f64de07847d5" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -4016,7 +4007,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 1.0.109", @@ -4419,9 +4410,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b16f7f853f64ec6fbc981b3e224cc3400752662da140ec62c160b5b859bab68" +checksum = "4090659c6aaa3c4d5b6c6ec909b4b0a25dec10ad92aad5f729efa8d5bd4d806a" dependencies = [ "frame-support", "frame-support-procedural", @@ -4445,9 +4436,9 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" -version = "32.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fec078a73892cb5a7146671cf76e3abf23201fefe431a013399ac2e5b03b54" +checksum = "efe02c96362e3c7308cdea7545859f767194a1f3f00928f0e1357f4b8a0b3b2c" dependencies = [ "Inflector", "array-bytes 6.2.2", @@ -4506,9 +4497,9 @@ dependencies = [ [[package]] name = "frame-election-provider-support" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c596d956c4eedaffbe2fd6f75562e63e3e60001222bc6f8cc45fa77f3ea51791" +checksum = "87da19ee99e6473cd057ead84337d20011fe5e299c6750e88e43b8b7963b8852" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -4524,9 +4515,9 @@ dependencies = [ [[package]] name = "frame-executive" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5247e367912fe95f813e96542921ab4edf671860fd557625b55f40155abf90" +checksum = "09bff9574ee2dcc349f646e1d2faadf76afd688c2ea1bbac5e4a0e19a0c19c59" dependencies = [ "frame-support", "frame-system", @@ -4555,9 +4546,9 @@ dependencies = [ [[package]] name = "frame-remote-externalities" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26ac8b505de5aa10e9c9548a3642fc708fc47fe3843b840992e6e6ab139f39d0" +checksum = "360bfdb6821372164a65933d9a6d5998f38c722360b59b69d2bf78a87ef58b2a" dependencies = [ "futures 0.3.30", "indicatif", @@ -4566,6 +4557,7 @@ dependencies = [ "parity-scale-codec", "serde", "sp-core", + "sp-crypto-hashing", "sp-io", "sp-runtime", "sp-state-machine", @@ -4577,9 +4569,9 @@ dependencies = [ [[package]] name = "frame-support" -version = "28.0.0" +version = "29.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48b00bb3e82c465a435b08827e7abe5144345bc1a998848bdd7ce72fa203bb5" +checksum = "b8e52c84b611d2049d9253f83a62ab0f093e4be5c42a7ef42ea5bb16d6611e32" dependencies = [ "aquamarine", "array-bytes 6.2.2", @@ -4601,7 +4593,7 @@ dependencies = [ "sp-api", "sp-arithmetic", "sp-core", - "sp-core-hashing-proc-macro", + "sp-crypto-hashing-proc-macro", "sp-debug-derive", "sp-genesis-builder", "sp-inherents", @@ -4619,9 +4611,9 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be717139a0da9b31b559356db73f6ce48876d331e833ebdc32de3a9ad581e15" +checksum = "3bf1d648c4007d421b9677b3c893256913498fff159dc2d85022cdd9cc432f3c" dependencies = [ "Inflector", "cfg-expr", @@ -4633,7 +4625,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "sp-core-hashing", + "sp-crypto-hashing", "syn 2.0.60", ] @@ -4663,9 +4655,9 @@ dependencies = [ [[package]] name = "frame-system" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "983b3215c8d97775b90dc1db88f858c46401682bd2fb8572bdd102ff8c2ca2a6" +checksum = "5bc20a793c3cec0b11165c1075fe11a255b2491f3eef8230bb3073cb296e7383" dependencies = [ "cfg-if", "docify", @@ -4684,9 +4676,9 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f78a2fe203b01b596156b2514e0b890b4a628dbdb50925316e755aa623b6fe53" +checksum = "ac47ee48fee3a0b49c9ab9ee68997dee3733776a355f780cf2858449cf495d69" dependencies = [ "frame-benchmarking", "frame-support", @@ -4700,9 +4692,9 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d183819ea7df1d89acd61fe423ae6bec24a29d87db5c18182339a751c0837a" +checksum = "4c1b20433c3c76b56ce905ed971631ec8c34fa64cf6c20e590afe46455fc0cc8" dependencies = [ "parity-scale-codec", "sp-api", @@ -4710,9 +4702,9 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b3dab79d14d2e8f6329d7e5cb49f2bdb81b9ef3019b1c405d94defa137a353" +checksum = "0eab87d07bc2f9a2160b818d1b7506c303b3b28b6a8a5f01dc5e2641390450b5" dependencies = [ "frame-support", "parity-scale-codec", @@ -5002,19 +4994,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "globset" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" -dependencies = [ - "aho-corasick", - "bstr 1.9.1", - "log", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", -] - [[package]] name = "group" version = "0.13.0" @@ -5124,6 +5103,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.3.9" @@ -5301,7 +5286,6 @@ dependencies = [ "rustls-native-certs", "tokio", "tokio-rustls", - "webpki-roots 0.25.4", ] [[package]] @@ -5606,9 +5590,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" +checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc" dependencies = [ "jsonrpsee-core", "jsonrpsee-http-client", @@ -5616,19 +5600,19 @@ dependencies = [ "jsonrpsee-server", "jsonrpsee-types", "jsonrpsee-ws-client", + "tokio", "tracing", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" +checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" dependencies = [ "futures-util", "http", "jsonrpsee-core", - "jsonrpsee-types", "pin-project", "rustls-native-certs", "soketto", @@ -5637,24 +5621,21 @@ dependencies = [ "tokio-rustls", "tokio-util", "tracing", - "webpki-roots 0.25.4", + "url", ] [[package]] name = "jsonrpsee-core" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" +checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" dependencies = [ "anyhow", - "arrayvec 0.7.4", "async-lock 2.8.0", "async-trait", "beef", - "futures-channel", "futures-timer", "futures-util", - "globset", "hyper", "jsonrpsee-types", "parking_lot 0.12.2", @@ -5670,30 +5651,31 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" +checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" dependencies = [ "async-trait", "hyper", "hyper-rustls", "jsonrpsee-core", "jsonrpsee-types", - "rustc-hash", "serde", "serde_json", "thiserror", "tokio", + "tower", "tracing", + "url", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" +checksum = "29110019693a4fa2dbda04876499d098fa16d70eba06b1e6e2b3f1b251419515" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro-crate 1.3.1", "proc-macro2", "quote", @@ -5702,19 +5684,20 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" +checksum = "82c39a00449c9ef3f50b84fc00fc4acba20ef8f559f07902244abf4c15c5ab9c" dependencies = [ - "futures-channel", "futures-util", "http", "hyper", "jsonrpsee-core", "jsonrpsee-types", + "route-recognizer", "serde", "serde_json", "soketto", + "thiserror", "tokio", "tokio-stream", "tokio-util", @@ -5724,9 +5707,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" +checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" dependencies = [ "anyhow", "beef", @@ -5738,14 +5721,15 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" +checksum = "bca9cb3933ccae417eb6b08c3448eb1cb46e39834e5b503e395e5e5bd08546c0" dependencies = [ "http", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", + "url", ] [[package]] @@ -6255,7 +6239,7 @@ version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" dependencies = [ - "heck", + "heck 0.4.1", "quote", "syn 1.0.109", ] @@ -6325,7 +6309,7 @@ dependencies = [ "rw-stream-sink", "soketto", "url", - "webpki-roots 0.22.6", + "webpki-roots", ] [[package]] @@ -6666,6 +6650,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.8.0" @@ -6687,7 +6680,7 @@ dependencies = [ [[package]] name = "merkle-distributor" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.6.0#af308c7f73ab244000201be3619056b2c62eff6a" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" dependencies = [ "frame-support", "frame-system", @@ -6779,9 +6772,9 @@ dependencies = [ [[package]] name = "mmr-gadget" -version = "29.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d0ba6676a84f182dabd7c3ec2c92f0e882fe4e4179ddf76f02ac132e6eb0ab" +checksum = "6f62cddc29c17965ab16a051a745520d41c28d8b4c2b6188aaf661db056d67c9" dependencies = [ "futures 0.3.30", "log", @@ -6799,11 +6792,10 @@ dependencies = [ [[package]] name = "mmr-rpc" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19066d17147f6819ec25f5f6fc3b9fca2008ae745ac7fa2d55ddb1d207119eae" +checksum = "2634b45039e064c343a0a77ed45e03ca027c84e1b250b2f3988af7cde9b7e79e" dependencies = [ - "anyhow", "jsonrpsee", "parity-scale-codec", "serde", @@ -7109,6 +7101,17 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "libc", +] + [[package]] name = "no-std-net" version = "0.6.0" @@ -7298,7 +7301,7 @@ dependencies = [ "futures-timer", "orchestra-proc-macro", "pin-project", - "prioritized-metered-channel 0.6.1", + "prioritized-metered-channel", "thiserror", "tracing", ] @@ -7330,9 +7333,8 @@ dependencies = [ [[package]] name = "orml-oracle" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "094597ad71aba7e116d93af4d68ceaed95273c75c065dd89aeab43051083c485" +version = "0.8.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" dependencies = [ "frame-support", "frame-system", @@ -7349,9 +7351,8 @@ dependencies = [ [[package]] name = "orml-tokens" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02dce1f619f42d2a520423da923fd8f2eb8abb8dc3f5cdff3f853c7791abef3e" +version = "0.8.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" dependencies = [ "frame-support", "frame-system", @@ -7367,9 +7368,8 @@ dependencies = [ [[package]] name = "orml-traits" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f4617d5262e9a8f3b5e7ab5961e8d0a3d4e25ef0c9d34e6ff87766c406898b" +version = "0.8.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -7388,9 +7388,8 @@ dependencies = [ [[package]] name = "orml-unknown-tokens" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12c26e74a7407bd6bccc8d123a4f6d60e5b01188c135804dc1e48ca98c49dbf6" +version = "0.8.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" dependencies = [ "frame-support", "frame-system", @@ -7404,9 +7403,8 @@ dependencies = [ [[package]] name = "orml-utilities" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1756d8ca7c433fdb538ff14bbb60a343fc6cf7b0684af4a73889f89de364e18f" +version = "0.8.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" dependencies = [ "frame-support", "parity-scale-codec", @@ -7420,9 +7418,8 @@ dependencies = [ [[package]] name = "orml-xcm" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c3bdb23468f0532c78941c122a37c4f3d8629bb8fc69810ecf3b5f20fa7f81" +version = "0.8.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" dependencies = [ "frame-support", "frame-system", @@ -7435,9 +7432,8 @@ dependencies = [ [[package]] name = "orml-xcm-support" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb61790b9ce5698f7026bbf9ebd932df782a425b3551e9dd04300cb4eace179" +version = "0.8.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" dependencies = [ "frame-support", "orml-traits", @@ -7450,9 +7446,8 @@ dependencies = [ [[package]] name = "orml-xtokens" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d1f2b938ce3c789a749e2214ec23a946e5110e0df16c605d1f75a1b852afa6" +version = "0.8.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" dependencies = [ "frame-support", "frame-system", @@ -7470,11 +7465,30 @@ dependencies = [ "staging-xcm-executor", ] +[[package]] +name = "pallet-asset-conversion" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4079f12db3cf98daa717337ab5b7e5ef15aa3bec3b497f501dc715d129b500da" +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-rate" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6f4917bc6c9ed6864813bbb828e94c63e1878a21af89d25dd0ff7da742f53e" +checksum = "571ce57fd846911041749832b46a8c2b01f0b79ffebcd7585e3973865607036d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7488,9 +7502,9 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e967664d86219ca9f7d33504e8d914225cdb92e9e793d35edaab1fd2574f162f" +checksum = "9ed783679921ad8b96807d683d320c314e305753b230d5c04dc713bab7aca64c" dependencies = [ "frame-support", "frame-system", @@ -7505,9 +7519,9 @@ dependencies = [ [[package]] name = "pallet-assets" -version = "29.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aca79db2bc70c269170893604d8a56d0f32d52c75a23a3d887b6b4df132366b7" +checksum = "46728a98a910af13f6a77033dd053456650773bb7adc71e0ba845bff7e31b33e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7522,9 +7536,9 @@ dependencies = [ [[package]] name = "pallet-aura" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c6ecf016520a6883df14b2f1d469d98166377eba4b299af7b76eee0130e3a6" +checksum = "a611bef3c8cf281e41a43f32a4153260bdc8b7b61b901e65c7a4442529224e11" dependencies = [ "frame-support", "frame-system", @@ -7540,9 +7554,9 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "28.0.0" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9224b0a0bb4fa721d51f56947c73d4189710691b4cb40e7f7a8abf59795759a" +checksum = "7cd9a381c613e6538638391fb51f353fd13b16f849d0d1ac66a388326bd456f1" dependencies = [ "frame-support", "frame-system", @@ -7557,9 +7571,9 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "817b0420f9c14bd9bfbaf9e2f769a7e8124ab4fe3da0d07c80485c0901947ab8" +checksum = "3d83773e731a1760f99684b09961ed7b92acafe335f36f08ebb8313d3b9c72e2" dependencies = [ "frame-support", "frame-system", @@ -7572,9 +7586,9 @@ dependencies = [ [[package]] name = "pallet-babe" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ba445228a941062d7c4d6295810a359df7757d6182c36ddb824f8c3bf350380" +checksum = "d3f2020c52667a650d64e84a4bbb63388e25bc1c9bc872a8243d03bfcb285049" dependencies = [ "frame-benchmarking", "frame-support", @@ -7597,9 +7611,9 @@ dependencies = [ [[package]] name = "pallet-bags-list" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0d7b6922a6bed960591efb49da6637312c034337faf4c85d8b35f2e2c611a" +checksum = "dd27bfa4bfa5751652842b81241c7eff3e68f2806d9dacc17b03d2cb20a39756" dependencies = [ "aquamarine", "docify", @@ -7620,10 +7634,11 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "28.0.0" +version = "29.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8406b5616e468d80972b6365f3cd8211d0dbf4d107b379fac85fddcfdf0b5562" +checksum = "a9a54b5d0c7c4c3731883d6b1ac18aff44db20c3d0a3470c8861001a17afdc85" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -7636,9 +7651,9 @@ dependencies = [ [[package]] name = "pallet-beefy" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03f71d32d9681e9d78102dad00377629cac24b4bf43f6371c0dc7e5b25981eb4" +checksum = "4bedd80e9d8b196f31ea134efd271fdc1b8380ca3aa2d8af6ea8b5a0dc4fa460" dependencies = [ "frame-support", "frame-system", @@ -7657,9 +7672,9 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b8eaa5c053d9cbf20faa397f21b80b9b5bafbe428890b0171fd1bba16f52ce" +checksum = "7d334f24d3c0c016d16aa87d069485847d622e8ebebace18ec5cf56609ca3a67" dependencies = [ "array-bytes 6.2.2", "binary-merkle-tree", @@ -7683,9 +7698,9 @@ dependencies = [ [[package]] name = "pallet-bounties" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d421e3228bc4e8170d817d657aa87761b77ee4675a9e16328e1ca070cb4c41" +checksum = "4765879e96676c13cdbed746d66fd59dcde1e9e65fda1f064fa2fffa3bc5d597" dependencies = [ "frame-benchmarking", "frame-support", @@ -7702,9 +7717,9 @@ dependencies = [ [[package]] name = "pallet-broker" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904983f117ff92ee24b251f2a883ff01b6f8e9063649877f3892ecbb516e3cbd" +checksum = "3626d7e8e49b153b84c74594e1fb4b6d64720b5a9588297d3ba3c049c3b3b9e3" dependencies = [ "bitvec", "frame-benchmarking", @@ -7720,9 +7735,9 @@ dependencies = [ [[package]] name = "pallet-child-bounties" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb62c44d3ab8dcbf106b22acc138eaea6e51563d16a8d4a246303f2e20eeb9e5" +checksum = "00fd06f2d719f5bb16ab3e836c6b053bbd92631ba694f8c2bf810013b2548167" dependencies = [ "frame-benchmarking", "frame-support", @@ -7740,9 +7755,9 @@ dependencies = [ [[package]] name = "pallet-collator-selection" -version = "9.0.2" +version = "10.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cc67e8233b748a0c0b1ecc2cbecfc6deb08be633fedba9c3d6b1ade6c2a036" +checksum = "49d1157d9a4b7966040158a7b4f1fb29f0cefa8deb6eb9b3452df7ce4161a31c" dependencies = [ "frame-benchmarking", "frame-support", @@ -7761,9 +7776,9 @@ dependencies = [ [[package]] name = "pallet-collective" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed22cf9d91c120695063cfa95ae0ffabcadefdf2581657ddb5fd68555b3a2e0" +checksum = "4c362a0b8f30895c15ecc7d8c24b0d94bb586c4b9bbd37ac8053b4629d9cc80b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7779,9 +7794,9 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a189b5fb4a473edc7b2d52109fe10d0017b9b56f7c0324018b5970125db3ce3" +checksum = "6aee3a8b6fcde893f862993f9d45eb0fcd492dde0967fd56ef78d79fc7b53dc0" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7797,9 +7812,9 @@ dependencies = [ [[package]] name = "pallet-democracy" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b687c8a22b37f9b8444a29959f9cd0cf0be2f8efb8cd9bf91860d5dbafdab8b3" +checksum = "aa781d632063087bcd3ff46eb1a668f15647ab116f1c8a7c573b7168f62d72c3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7816,9 +7831,9 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc5e1f80bb4ce08b27f5a8a733d5c2d72d083a7d48afa4bdbb1ef3594a31e353" +checksum = "b54d1d3fe9ae61a144d581147e699b7c3009169de0019a0f87cca0bed82681e7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7840,9 +7855,9 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193a8592c5fd534d56d07b2abe14e830d23947fb66f31867083e4f3ef80c8caa" +checksum = "46ec87816a1e32a1ab6deececa99e21e6684b111efe87b11b8298328dbbefd01" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7855,9 +7870,9 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" -version = "29.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dd2f70c57cbb3dcde39f141721dd34a8c852e0caaf61ae6b0bbd23138b6e1d3" +checksum = "10cb0158cc7461fda5db04c5791d0df34635bec37181763aca449bade677d12d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7875,9 +7890,9 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6e0b51b82075b046792cdde2d4a2f6c9301f3deba44c26d30ab152060b9028" +checksum = "2222607a0dba10a9d57cab5360a6549b5fda925181c3c7af481246c0964998df" dependencies = [ "docify", "frame-benchmarking", @@ -7895,9 +7910,9 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "935e91fa8936381aff2b88d8a7dad38ac30a1c8d2310340d73ce1c07b5ae72ce" +checksum = "a5b20be8592eed7ebca2ee661fc43450088552ebe0bd483d7b101cf5968ab12d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7919,9 +7934,9 @@ dependencies = [ [[package]] name = "pallet-identity" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3259bb87d50529027fa40267c3662dc80c683f253f121f391c032b019c88fcb" +checksum = "e9e1cae19e30e7dc822c419988b30bb1318d79a8d5da92733822d0e84fe760ca" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7937,9 +7952,9 @@ dependencies = [ [[package]] name = "pallet-im-online" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4be3f0165158828e4e77fae106a93bc1f48cc751755bdb012edb3ac0ef1d246" +checksum = "598ea5c87351edc953d1f455f32ff456cf2f1daf7bbada1f1e03be8e384852ab" dependencies = [ "frame-benchmarking", "frame-support", @@ -7958,9 +7973,9 @@ dependencies = [ [[package]] name = "pallet-indices" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ead239524e40e55d172f024ff6795998068a2ba1c0950e74c4db7f347cfa91e" +checksum = "2e880ebdb429ca76fb400b1b361ed7fce018a5ea2fc2da4764de5156fffdfa73" dependencies = [ "frame-benchmarking", "frame-support", @@ -7976,9 +7991,9 @@ dependencies = [ [[package]] name = "pallet-membership" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2dfdff5a7e5b21355b34245312ba2ea687444d9003960e7b876e1df518dab" +checksum = "ad901cdf3de23daf23ff8b092ab318b13faebfc1aa4d84263f2fdc84feaf3e9b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7994,9 +8009,9 @@ dependencies = [ [[package]] name = "pallet-message-queue" -version = "31.0.0" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab6302efb264a65fd175f3082b72004df125f646a3c68b72fd08e657a468c0d6" +checksum = "9ccb23dee70b184a214d729db550117a0965a69107d466d35181d60a6feede38" dependencies = [ "environmental", "frame-benchmarking", @@ -8015,9 +8030,9 @@ dependencies = [ [[package]] name = "pallet-mmr" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6565b91d1d585047648793feece7c2c70080b37e1f55ab3a4fb50b4c1bec86" +checksum = "a6f1f23a70764dad2b4094d8be12ebbb82df210f2e80dd36fa941a5ac191c6cd" dependencies = [ "frame-benchmarking", "frame-support", @@ -8034,9 +8049,9 @@ dependencies = [ [[package]] name = "pallet-multisig" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dbcdea9d3d7963aab57078a5bd6f3596186bfcf181d666db6ea2bfdc0184ec" +checksum = "176f6a5c170185f892a047c0ae189bc52eb390f2c0b94d4261ed0ebc7f82a548" dependencies = [ "frame-benchmarking", "frame-support", @@ -8051,9 +8066,9 @@ dependencies = [ [[package]] name = "pallet-nis" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86c541b2785051ebe1ae378be4b086055fbb8b13ee18fd949dfcf68dbd1c3325" +checksum = "32a64a0e80dec2c60d5962dd249061a47dc4356db440f26cdec50b8acaded1d3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8068,9 +8083,9 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" -version = "25.0.3" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5989ca1100694371c9951118d58e84e93b60c1919006e9d4ad0f7537952c388" +checksum = "0f14519c1c613d2f8c95c27015864c11a37969a23deeba9f6dbaff4276e1b81c" dependencies = [ "frame-support", "frame-system", @@ -8088,9 +8103,9 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01847415cd33a92c65e8d13cb0041a32b2f2523c84d9d944287ae5c0d920c82" +checksum = "18a1eba3078e2492cad15e4695f90eb3fc570386d9f71f8b81f709c7123fc6b5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8109,9 +8124,9 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64b17d862b833ca07a375646ecc80e164e5618c3aed4e5631816aa7288bf9b1" +checksum = "bc5b35e6c471a669437b987ff02e11e2283412c9ebaeec5334dec3f73bcea652" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -8121,9 +8136,9 @@ dependencies = [ [[package]] name = "pallet-offences" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de7b17230f58ff6b1ec2a70b3c639c49f585841dacf63f30c78db6387a833e0b" +checksum = "60b5bcfdc4f6032d7570929094fd459de12d840c440c395fb4d365d679e13eda" dependencies = [ "frame-support", "frame-system", @@ -8139,9 +8154,9 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060483993358293d041e5173635082c68c7783a800c0874e8df87c324232f0d1" +checksum = "bbc33e3086c19235cb903cbbbde1bc1c4f428519ad4c23446dc84c75d0061582" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8164,9 +8179,9 @@ dependencies = [ [[package]] name = "pallet-preimage" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce688c68f117b1916a844579aa5a945d786059b119a1cc80ace370afd1e50da4" +checksum = "7344a30c304771beb90aec34604100185e47cdc0366e268ad18922de602a0c7e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8209,9 +8224,9 @@ dependencies = [ [[package]] name = "pallet-proxy" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3162924576a70509136eb4d8513497fb640a8b3ea753883fe29bd454c511485" +checksum = "f7aa31a0b91e8060b808c3e3407e4578a5e94503b174b9e99769147b24fb2c56" dependencies = [ "frame-benchmarking", "frame-support", @@ -8225,13 +8240,14 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86c6d11592a6ba9039bd3486dba15f0cb045889b2746f4619f5ec78188fdd151" +checksum = "3733dbfc44d8f5e1a08287a9064e5794e9d0e92b1bd68cdad2e22202b1964528" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", @@ -8244,9 +8260,9 @@ dependencies = [ [[package]] name = "pallet-recovery" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8649310b8f00e3b2983331cdb7173d1e66e5eeb3a3d21479e7a65386244f883" +checksum = "797b554ddc87082c18223440d61a81cf35ccab6573321ce473a099e7a709a760" dependencies = [ "frame-benchmarking", "frame-support", @@ -8260,9 +8276,9 @@ dependencies = [ [[package]] name = "pallet-referenda" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c6645c0c09ff8484c6c7ac1546d908202ed555b18169ea956955e4e2d77b210" +checksum = "da850889e7101b63cadb980b7f39df67feb6d63bc6092769b9b708e9eb596db1" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8280,9 +8296,9 @@ dependencies = [ [[package]] name = "pallet-root-testing" -version = "4.0.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bd13ad045bda70f0d2023333d36620bd7b48172646274572332dc9f62fd3c8" +checksum = "59171cbf2b823c13685b1b80dd3e1e84425680ff4e006d8016f8c14d2ec44974" dependencies = [ "frame-support", "frame-system", @@ -8296,9 +8312,9 @@ dependencies = [ [[package]] name = "pallet-scheduler" -version = "29.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc26a27b77170c18261af7be04a6569e3d0d58788255b9f283ccd089aac37887" +checksum = "45e2a4ebe6a5f98b14a26deed8d7a1ea28bb2c2d3ad4d6dc129a725523a2042d" dependencies = [ "docify", "frame-benchmarking", @@ -8315,9 +8331,9 @@ dependencies = [ [[package]] name = "pallet-session" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e23ca2bfcffb5194de952050557bdd1fe9bce18b2bc81e8f8c01c8a3c3c3e5d8" +checksum = "7412ac59247b300feee53709f7009a23d1c6f8c70528599f48f44e102d896d03" dependencies = [ "frame-support", "frame-system", @@ -8338,9 +8354,9 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc660786028d46e03fb0a419d6a15df3fa556db7ce74efebf5a35037b32b4bc4" +checksum = "b9c2731415381020db1e78db8b40207f8423a16099e78f2fde599cbcb57ea8db" dependencies = [ "frame-benchmarking", "frame-support", @@ -8356,9 +8372,9 @@ dependencies = [ [[package]] name = "pallet-society" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c19c1f5a410c0b03dc1e3245ffc0269e6c9085e6f6a64ee023f7515b6f8d9b" +checksum = "dba64f96619c25ae7a0b41f4a5111c2d3102e8b8c6cbce80ece6955e825f9de2" dependencies = [ "frame-benchmarking", "frame-support", @@ -8375,9 +8391,9 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "28.0.1" +version = "29.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a83fe4c845d10988b78022f1b0e197ceefc0b68c148efb6370d9e9b53a53baf4" +checksum = "668b7d28c499f0d9f295fad26cf6c342472e21842e3b13bcaaac8536358b2d6c" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8411,9 +8427,9 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" -version = "19.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e23336e4da87101633f95f9932946564c926ca7f87499654b38923b1579c605e" +checksum = "505d45e08bad052f55fb51f00a6b6244d23ee46ffdc8091f6cddf4e3a880319d" dependencies = [ "log", "sp-arithmetic", @@ -8421,9 +8437,9 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" -version = "14.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27156b772eccb539cb1a1ea1b1b6e98d9c6589e18b913a30f67913fcf67fe7e" +checksum = "237d7b5a10cb6cba727c3e957fb241776302aa3cce589e6759ba53f50129c1a5" dependencies = [ "parity-scale-codec", "sp-api", @@ -8432,9 +8448,9 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" -version = "29.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a48713905a318b0307e523fd3d3ca4b197ce74b2520203ded0d02e8a6c6bbd7" +checksum = "d76e52dedc146b7a9c3b7c5a6ff4c4c442a8ab8cc58ec30e90e1e98cdc51ad34" dependencies = [ "frame-benchmarking", "frame-support", @@ -8450,9 +8466,9 @@ dependencies = [ [[package]] name = "pallet-sudo" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053dae9119d2d828af80e8ac98f497dc27155d6b5d42264dab8fae40f2314c41" +checksum = "b6d02f7855d411913e77e57126f4a8b8a32d90d9bf47d0b747e367a1301729c3" dependencies = [ "docify", "frame-benchmarking", @@ -8467,9 +8483,9 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688b89bdd377609b592bd094b304ebca33f4767fe72935465e2fd7db0e797968" +checksum = "c1b8810ddfb254c7fb8cd7698229cce513d309a43ff117b38798dae6120f477b" dependencies = [ "docify", "frame-benchmarking", @@ -8488,9 +8504,9 @@ dependencies = [ [[package]] name = "pallet-tips" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "facf64cab7f7a4762c57e5827597b2ca073755de4c9716444cf0847db34836df" +checksum = "8ca4b9921c9e9b59e8eeb64677ba6ec49743ef5fe98e0b63f77411b2b9f6cc99" dependencies = [ "frame-benchmarking", "frame-support", @@ -8531,9 +8547,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b4ca7a1af9b1f091900a354a96319c7614d7a32106ba86cb7f0b6f90239065" +checksum = "39f690f5c287ad34b28ca951ef7fae80b08cc9218d970723b7a70e4d29396872" dependencies = [ "frame-support", "frame-system", @@ -8548,9 +8564,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" -version = "30.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1486d58f38892df779a7812f28ff962d0b0632b955ea3c348f605caa01ba6d" +checksum = "08ef209d2d5d077e325bf49b024fd2eff109a5c2ca0d84ce0d50a65839e6b026" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -8565,9 +8581,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdfd7c882439b8198c99ece57b5bf785965545a6fa6d0bb7b56b264df1e437a" +checksum = "c78bcba80c7c61712b98a6b5640975ebd25ceb688c18e975af78a0fac81785b0" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8578,9 +8594,9 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75cb7498228e1a150fa09ce64acafe7105ff39b75dae1c266ba58b7e3eb225e" +checksum = "1605eb5083a2cd172544f33c6e59eca2e23ac49f02f13d1562b1b8a409df9c60" dependencies = [ "docify", "frame-benchmarking", @@ -8598,9 +8614,9 @@ dependencies = [ [[package]] name = "pallet-utility" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384c1d740c019410f6b40586cc387726c2e3c417c0e3e6f7e4774cd46bc6c1d0" +checksum = "954f15b98c3fdebb763bb5cea4ec6803fd180d540ec5b07a9fcb2c118251d52c" dependencies = [ "frame-benchmarking", "frame-support", @@ -8615,9 +8631,9 @@ dependencies = [ [[package]] name = "pallet-vesting" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55f3ac517a10c14beee86a737b9ea5d592af9ab21cc5354474bc5f7019210358" +checksum = "4525f3038cdf078fea39d913c563ca626f09a615e7724f0c9eac97743c75ff44" dependencies = [ "frame-benchmarking", "frame-support", @@ -8631,9 +8647,9 @@ dependencies = [ [[package]] name = "pallet-whitelist" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de259e3329422bf3eb10b7e966f4b1c5caadcb29cd2d45af3a000cb2d184e60d" +checksum = "da0ad4ce05688bdddcdb682cbed2f3edff0ee5349f0b745ebacc27d179582432" dependencies = [ "frame-benchmarking", "frame-support", @@ -8647,9 +8663,9 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "7.0.0" +version = "8.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee3520e03ac679125e8dcaa00ce4afeeb106a9623e79b5acf970d72af7f5d02" +checksum = "c13f5c598737e84294880333170d1df3868a11ad7ee79d0b1d1af37365e1c277" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8671,9 +8687,9 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "7.0.4" +version = "8.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da15171c2dc870ad636fcdb16d9aa37eb84cfe6001c3f1c77cf2c97446ebfbe5" +checksum = "3c10e1c92086ce2069a3d2387d9431f48660b6ec92054c4d0a4e30a9f54e7ad3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8691,16 +8707,15 @@ dependencies = [ [[package]] name = "parachains-common" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceadd4f51620023871ece5eeda64734acd17d84d49b45473d335e900a012fdde" +checksum = "d34aa00981a24a2b772afaa49e258f9bcd6bb372db060a05614becc1c74d4456" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", "frame-support", "frame-system", "log", - "num-traits", "pallet-asset-tx-payment", "pallet-assets", "pallet-authorship", @@ -8709,11 +8724,8 @@ dependencies = [ "pallet-message-queue", "pallet-xcm", "parity-scale-codec", - "polkadot-core-primitives", "polkadot-primitives", - "rococo-runtime-constants", "scale-info", - "smallvec", "sp-consensus-aura", "sp-core", "sp-io", @@ -8721,10 +8733,8 @@ dependencies = [ "sp-std", "staging-parachain-info", "staging-xcm", - "staging-xcm-builder", "staging-xcm-executor", "substrate-wasm-builder", - "westend-runtime-constants", ] [[package]] @@ -8740,7 +8750,7 @@ dependencies = [ "libc", "log", "lz4", - "memmap2", + "memmap2 0.5.10", "parking_lot 0.12.2", "rand", "siphasher", @@ -9020,9 +9030,9 @@ checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "polkadot-approval-distribution" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98fd276eccca3ada04cb274f4b8c51f669087d8b334c775f1231a9194d5260d0" +checksum = "8cdfa52beecc446ccf733dede1a0089e6396d3df13401004d27c0ce2530816bc" dependencies = [ "bitvec", "futures 0.3.30", @@ -9041,9 +9051,9 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51c43e54e0cc47dfb4f7c3917a774ccc796524087515b212d9fe109bde71846e" +checksum = "80ffc856dfbdb31178625760824ae320ddb7dd5694b217f489bd2832b8de15a5" dependencies = [ "always-assert", "futures 0.3.30", @@ -9058,9 +9068,9 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121ded25722b8505335b05a77f1def84278802ed3f4774c7fe6ab7c961affe06" +checksum = "c9d05c26cc8d6fa0f5f432d9de880f20ad0d24ca51a618834ea6612d1bd96ab1" dependencies = [ "derive_more", "fatality", @@ -9082,9 +9092,9 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3902495dbba25e7526168c8f88b26cc0dbb96cfe10813238a650c67b34bf9f31" +checksum = "4d77e0b979f43861ab4c78c216c2729644bb12812f9bc859858bd3b8fc56b4d6" dependencies = [ "async-trait", "fatality", @@ -9106,9 +9116,9 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93cafe0d136732ad69bce9cd82a34a7b1ff0cd2268d84309aeb673622d40a013" +checksum = "ef362c44280e3883a39ca452acc4a4fb61a18250d634d68578b22df7edd8290c" dependencies = [ "cfg-if", "clap", @@ -9135,9 +9145,9 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70007b246c3679ee43f11123bda6d715f659f7b6d4134d0fcbe8980e049386b" +checksum = "507391f1be9f9b9a8fbf28ca13b0ab3f04947a54a1115d423d115aacf8889bf4" dependencies = [ "bitvec", "fatality", @@ -9158,9 +9168,9 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda2b0f0c580c38f12445a4af10e0a23acf48381b2a95653e0be48ba787e10e5" +checksum = "b6a08e4e014c853b252ecbbe3ccd67b2d33d78e46988d309b8cccf4ac06e25ef" dependencies = [ "parity-scale-codec", "scale-info", @@ -9171,15 +9181,15 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a9b173e02d1f600a422269b3b5a1db203d39f436f7db7d7e41ef6dda6f42e0" +checksum = "ae32e83ef6bc0ec2874c76c19dff8f3795832ccc27f0abc587a7137994c42d26" dependencies = [ "derive_more", "fatality", "futures 0.3.30", "futures-timer", - "indexmap 1.9.3", + "indexmap 2.2.6", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -9197,9 +9207,9 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8347b3528fe94e47ec1b818b06bf821010a5f180d0ac5c89138da0d382debc" +checksum = "1b10514ace3272d38b602e1795a5a340b265285c4af875473d682a5c9d6c831c" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -9212,9 +9222,9 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4de739371a4b5f036848de5c7185dfee88587016d2bb32af07f38fb909b80d8" +checksum = "01f05f7f60022d4beb30414f1f7c7e4ae728fea02086a4a0f8ff0a73e73ea4aa" dependencies = [ "futures 0.3.30", "futures-timer", @@ -9228,15 +9238,16 @@ dependencies = [ "sc-network-common", "sp-application-crypto", "sp-core", + "sp-crypto-hashing", "sp-keystore", "tracing-gum", ] [[package]] name = "polkadot-network-bridge" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4598c9d00dbc017c0f01e82a7c0740805cc500c3b8946ad0b7945ab4d68dd7ee" +checksum = "049ec1298ac6e96bcf4d980cd5864aceeee73b3298ab5d6dd7a3193d47578abc" dependencies = [ "always-assert", "async-trait", @@ -9258,9 +9269,9 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba987629ab789f529426d6187dbafaa8209f5ee479c645184e4c1e33a59e2135" +checksum = "6f1211ab8b154c2e2b4b89c64f57f96056c881e4fcfa2ce29b6e5cbc978e74f1" dependencies = [ "futures 0.3.30", "parity-scale-codec", @@ -9277,9 +9288,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5910fa99def47accbb4505bef91f74614f62347bc0c53c11296d5ce70d8e255" +checksum = "c61a17b7e4edd3b73afbe0c6e8b5369bf3b721361a232baf11fb1698077067a4" dependencies = [ "bitvec", "derive_more", @@ -9311,9 +9322,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1583533dc82a719607323432c013e01c2a8c971eb7e7703ff5eadd762f4e3" +checksum = "84b334f06423ff701e4b807d6832741ec24e0e97ebc13b560fc99bc0652926c0" dependencies = [ "bitvec", "futures 0.3.30", @@ -9334,9 +9345,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "7.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7b5468fa618ccbeb4611b073d2c28b9440b51f4012e69c117e43192f9de8b17" +checksum = "f07f8840f3f2f0bee6264c18ce471c99c925f9afb65952e1d584b6d773cf4115" dependencies = [ "bitvec", "fatality", @@ -9347,6 +9358,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "polkadot-statement-table", + "schnellru", "sp-keystore", "thiserror", "tracing-gum", @@ -9354,9 +9366,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4975e2ecc81d34605748781e9449a7b7ff956c385b46496005257a1a7dd56f0d" +checksum = "0687006f843d6da8687eb24da735a04cbdcf4c3a98d82055b9b3a9047537e17e" dependencies = [ "futures 0.3.30", "polkadot-node-subsystem", @@ -9370,9 +9382,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcfd720b86c1ddf6616cf083a2cb273147687521c1d13a7f3c991b1d5ae03444" +checksum = "c3035acf9069801e980b91b5178591f8a7052b4409de13824db7a6c798b36b98" dependencies = [ "async-trait", "futures 0.3.30", @@ -9392,9 +9404,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9f00bd39f433a2e8281524529853a3be54970e799a451e2c14fc5b75cf226f" +checksum = "c990b9ffdde6725fe79f55e3b7c4c32ce2134a06103708476fa595a4ac652e95" dependencies = [ "futures 0.3.30", "polkadot-node-metrics", @@ -9407,9 +9419,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea28475a96dfb6419432314d8021780e5c5b0f50a5525fd332e8b2a947a2deb5" +checksum = "451965f3ace786d392c407872d61324765061b87027890b02ffd625554531f97" dependencies = [ "futures 0.3.30", "futures-timer", @@ -9425,9 +9437,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad9cfb3e775dc4c611a79e294549fe4b244052ddaacf14133380e793c25a99f" +checksum = "c13ea9d5b4aa43b5b1f718c3ec951adff0b0d74909cb1fe28206f5d88492247d" dependencies = [ "fatality", "futures 0.3.30", @@ -9445,9 +9457,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb2535ef374a218b1e9d05b98a903edbdddf4eea47f9e137fcc09c8e1bc199dd" +checksum = "6574c0bda4e10d722f761d4b8ab5d1708f0f963e5840370aa9cee8f559c90a23" dependencies = [ "async-trait", "futures 0.3.30", @@ -9463,9 +9475,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-prospective-parachains" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a8876cc0aa627190f1d41c01061a7acee9621703501d9a60118d35e81579f9" +checksum = "160f80a11b9d2b8e36e510ea54ce5b06e77179c0c502f7e19e5a5809bc1523ee" dependencies = [ "bitvec", "fatality", @@ -9481,9 +9493,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "7.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25c88b17b93bf410a72bfb4543b1ae01bb0d33fd6cba9af1f0e74c4ef2b906ad" +checksum = "b0d0a64371700537c3dc15b3956536e4541f093b7c38ac21737ea9fea3562a83" dependencies = [ "bitvec", "fatality", @@ -9499,9 +9511,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c80f2810b2eb843f3282b11e7ce1624866b6dd1ee6a95541b5882b5df3f36f25" +checksum = "f3bbb1b5f4b966f21a0336e94c0a0222958d2f3cba451da1157af271d07f9748" dependencies = [ "always-assert", "array-bytes 6.2.2", @@ -9533,9 +9545,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d8ddb21cb3ad1868967b116fbf289610880cb95313b2798762cdd8653d36b7" +checksum = "94ab4a91e62a9f7e67cf400931578f2505417cc43a32ac29458163604f2b277b" dependencies = [ "futures 0.3.30", "polkadot-node-primitives", @@ -9550,15 +9562,16 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80bbf311b112a8552e89e5be55b0305d86328ba04528e47d3203cd27751405bc" +checksum = "003981d3b63e4f527ef7f03cbe280e41ec649d9be365668887f0b107610640f4" dependencies = [ "cfg-if", "cpu-time", "futures 0.3.30", "landlock", "libc", + "nix 0.27.1", "parity-scale-codec", "polkadot-parachain-primitives", "polkadot-primitives", @@ -9567,6 +9580,7 @@ dependencies = [ "sc-executor-wasmtime", "seccompiler", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-io", "sp-tracing", @@ -9576,9 +9590,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17345f76b7ebcf2f1e1be5411a6420971ef60d69070f115e459b2f017f91bcb5" +checksum = "6ba6ea6a03f297b7387fc59c41c3c32285803971cb27e81d7e9ca696824d6773" dependencies = [ "futures 0.3.30", "polkadot-node-metrics", @@ -9592,9 +9606,9 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b099624af4597bac5d1617a3cab057785ee47e657de7ad078957bfa397d82c4" +checksum = "f7d113b48e7b6126964c3a790b101d99e17fd3cb75a92e94d54587ce1340df21" dependencies = [ "lazy_static", "log", @@ -9611,9 +9625,9 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b5b00a9646875f22ab45e61ede04f623a3fbbc03bae52263b3d558c964bc32" +checksum = "aef2e2a934f0d0d606fcfc53fc26f4cacd8b9f18fb2118829203fa813af2cdae" dependencies = [ "bs58 0.5.1", "futures 0.3.30", @@ -9621,7 +9635,7 @@ dependencies = [ "log", "parity-scale-codec", "polkadot-primitives", - "prioritized-metered-channel 0.5.1", + "prioritized-metered-channel", "sc-cli", "sc-service", "sc-tracing", @@ -9631,9 +9645,9 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e420ba9220abaa468a393ff2834b7c2b4d7d87b6d903d9046dfd682c97d35d4c" +checksum = "07f9e67b0f25d695947a15b6fe8ee6f8e83f3dfcbca124a13281c0edd0dc4703" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -9656,9 +9670,9 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "366d18f1498426975c610246063149ad84788eb1e924cab6ee44a4d8958ecf61" +checksum = "375744eee7a53576387e14856e1c65be8ecef8b449567bb2cff85706266c8912" dependencies = [ "bitvec", "bounded-vec", @@ -9680,9 +9694,9 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831cf07bf6588d7d8ab872f8f214b4b24b2c4243faf8028534f8a11a3f03c466" +checksum = "24d6c226cdbcd48ab1e506d8512f0fb01839f9a72eec2fc0cf7771f6d3352171" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -9691,9 +9705,9 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd132afdfcdf2e30f7924c9561bbc1208b0838ab9c2275bf0ef32525f63b8bd0" +checksum = "1404525da0ab9d44bac1041449bf0c5576240f9031b305dc41654567e98b6021" dependencies = [ "async-trait", "bitvec", @@ -9720,9 +9734,9 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32c2f2027689777bd61681d769ed5ec726144905c4e3cb16c5f8a4edb55250a" +checksum = "65a7d101f28bf718d15f01a060ed8cf7a7e2d8d5705c494b49ece696cada0adf" dependencies = [ "async-trait", "derive_more", @@ -9743,7 +9757,7 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-overseer", "polkadot-primitives", - "prioritized-metered-channel 0.5.1", + "prioritized-metered-channel", "rand", "sc-client-api", "schnellru", @@ -9756,9 +9770,9 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa0b71f50f0be1959bcb10a46105ca66b9c6868d549385a247750e5b7a45c77" +checksum = "bd5ed988deffeddf440473586f62efc5dd498f6016e6650881db09dd60b3b24f" dependencies = [ "async-trait", "futures 0.3.30", @@ -9779,9 +9793,9 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b37c55955147479e7b2f3c2e5385db4846ac3e3b997cd4a4ad52344524b5447" +checksum = "248ab090959a92e61493277e33b7e85104280a4beb4cb0815137d3c8c50a07f4" dependencies = [ "bounded-collections", "derive_more", @@ -9797,12 +9811,13 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "7.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aefd230a654f5b2aee18ebbd9c081835def0e1898ee6c018501dd77c18f5929" +checksum = "e0d5f9930210cab0233d81204415c9ef4a8889cdf3e60de1435250481a2773ca" dependencies = [ "bitvec", "hex-literal 0.4.1", + "log", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain-primitives", @@ -9824,9 +9839,9 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "382eada9005c73375778e1dca58116e0660431cf90989fe0dde54ebe1f621a1e" +checksum = "bb4747cb8faa532e8446b38b74266fd626d6b660fe6b00776dd6c4543cc0457f" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -9858,9 +9873,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "7.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4641a850b7415a42e56bd262aba243ed77a9280cb2b825a427c425bdc8961d70" +checksum = "06afbb3bd10245ad1907242a98ddffc3c0c1e209738b8382bc5bcfc1f28c0429" dependencies = [ "bitvec", "frame-benchmarking", @@ -9885,7 +9900,6 @@ dependencies = [ "pallet-transaction-payment", "pallet-treasury", "pallet-vesting", - "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-primitives", "polkadot-runtime-parachains", @@ -9911,9 +9925,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac3c6ee03f38556274b26049c51c5c7095abfd4ebfd11cd492918a4344f2851" +checksum = "e3566c6fd0c21b5dd555309427c984cf506f875ee90f710acea295b478fecbe0" dependencies = [ "bs58 0.5.1", "frame-benchmarking", @@ -9925,9 +9939,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "7.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d253ef2952097398d98ed12729e47f9328bcd1baa92c3acc1524a4baca7d1ac" +checksum = "9bcfd672be236fd1c38c702e7e99fe3f3e54df0ddb8127e542423221d1f50669" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -9975,9 +9989,9 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75bf984471c2608905176b62726b3552bbfdc3e04ebdc7fe75e5179ff215588" +checksum = "b2fd665185877bec296588c7cf1ec0ef75e0545050b5e1d42d94240a284149da" dependencies = [ "async-trait", "frame-benchmarking", @@ -10093,16 +10107,16 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82b48ff9204ea663ccccde78aefa8a524958aadff5c84a4f1fd773c291057d" +checksum = "8ff6d16cbd994987f48a9f107f12e4c7fff26cdd71df6288e9521adc7cff3427" dependencies = [ "arrayvec 0.7.4", "bitvec", "fatality", "futures 0.3.30", "futures-timer", - "indexmap 1.9.3", + "indexmap 2.2.6", "parity-scale-codec", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -10117,13 +10131,14 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "7.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478dea03265eb2465010dae149616e4f28fe858e103671b1a96dc19e9e388c8f" +checksum = "de5e010da3c6a65d8f263d0f825a04d995ffc8a37f886f674fcbbc73bf158d01" dependencies = [ "parity-scale-codec", "polkadot-primitives", "sp-core", + "tracing-gum", ] [[package]] @@ -10272,22 +10287,6 @@ dependencies = [ "uint", ] -[[package]] -name = "prioritized-metered-channel" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e99f0c89bd88f393aab44a4ab949351f7bc7e7e1179d11ecbfe50cbe4c47e342" -dependencies = [ - "coarsetime", - "crossbeam-queue", - "derive_more", - "futures 0.3.30", - "futures-timer", - "nanorand", - "thiserror", - "tracing", -] - [[package]] name = "prioritized-metered-channel" version = "0.6.1" @@ -10420,7 +10419,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +dependencies = [ + "bytes", + "prost-derive 0.12.5", ] [[package]] @@ -10430,14 +10439,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", - "heck", + "heck 0.4.1", "itertools 0.10.5", "lazy_static", "log", "multimap", "petgraph", "prettyplease 0.1.11", - "prost", + "prost 0.11.9", "prost-types", "regex", "syn 1.0.109", @@ -10458,13 +10467,26 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prost-derive" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "prost-types" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "prost", + "prost 0.11.9", ] [[package]] @@ -10694,13 +10716,12 @@ dependencies = [ [[package]] name = "reed-solomon-novelpoly" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58130877ca403ab42c864fbac74bb319a0746c07a634a92a5cfc7f54af272582" +checksum = "87413ebb313323d431e85d0afc5a68222aaed972843537cbfe5f061cf1b4bcab" dependencies = [ "derive_more", "fs-err", - "itertools 0.11.0", "static_init", "thiserror", ] @@ -10874,9 +10895,9 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e5ae118c3f3189a376703a4ca8569eb51ce1b121bc6b571c051b68c31e10a16" +checksum = "d089e93be2b8b76dd0d4b794a6a995ca3a1d6cb0ea3dd1cd42462f048bcfc926" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -10971,9 +10992,9 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b5b507493a19b5061eb2860c394847261216c7ea7f8f62ba2cb02e55c27d611" +checksum = "0b45c21ccb0f8777512a65510c106aeee4b59682944b9a5cb31cd7b8ed4ccb47" dependencies = [ "frame-support", "polkadot-primitives", @@ -10986,6 +11007,12 @@ dependencies = [ "staging-xcm-builder", ] +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + [[package]] name = "rpassword" version = "7.3.1" @@ -11007,7 +11034,7 @@ dependencies = [ "log", "netlink-packet-route", "netlink-proto", - "nix", + "nix 0.24.3", "thiserror", "tokio", ] @@ -11208,9 +11235,9 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b05714bc70605d5f8983612d1643d875cd4782ef53a8720907a0eb75070cba" +checksum = "357127c91373ed6d1ae582f6e3300ab5b13bcde43bbf270a891f44194ef48b70" dependencies = [ "log", "sp-core", @@ -11220,9 +11247,9 @@ dependencies = [ [[package]] name = "sc-authority-discovery" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1c23040352415cdcc22203d3b18e56f3516e51865f106f8bbf7efa95b411a59" +checksum = "7fb3c14cb8022844835a6f7209196b8c6544d389fe5d2972d8df2ae4ca75afbe" dependencies = [ "async-trait", "futures 0.3.30", @@ -11233,7 +11260,7 @@ dependencies = [ "multihash 0.18.1", "multihash-codetable", "parity-scale-codec", - "prost", + "prost 0.12.4", "prost-build", "rand", "sc-client-api", @@ -11250,9 +11277,9 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c016e38155386e23649a4a995ea67c55a1fe25a54c7cc7509954d454ee75eb3b" +checksum = "724c3a6eee5f0829a1b79a15e12d63ed81b33281b14004a6331a8883b2fd8fd1" dependencies = [ "futures 0.3.30", "futures-timer", @@ -11273,9 +11300,9 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "656b85de8aad8dd758f2e5f250f300e4711f294f238c9299064fbd624cb263f7" +checksum = "8e8b0640994965c6ff3afa13242d95a61611b83da21fd86ac2b1ebd03e241a02" dependencies = [ "parity-scale-codec", "sp-api", @@ -11289,14 +11316,14 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7f6a6926973e084fe9b23ffee9784cd41d84ea0627c605891542661bd9ff958" +checksum = "0f73880050f8b04fed7f6301279ef3899df13a3891bd06156d56f9a1c50fefba" dependencies = [ "array-bytes 6.2.2", "docify", "log", - "memmap2", + "memmap2 0.9.4", "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", @@ -11307,6 +11334,7 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-core", + "sp-crypto-hashing", "sp-genesis-builder", "sp-io", "sp-runtime", @@ -11327,9 +11355,9 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9819b656041094ca4e97402be145c2bcf3f47d00d854708b25ecd3211eafcd62" +checksum = "e8a284c10ea92b1fe789b9f0e5815d393f3a1e3bf6a4adaa884f24e36143b83b" dependencies = [ "array-bytes 6.2.2", "bip39", @@ -11369,9 +11397,9 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af05565a0f6467ebe0b430f3a44524fecee9e4aff621647ea5eab8833f775b6f" +checksum = "3e914dfadaaf384d8869ae47f3ec783bf6a1ac24e7827f5fec2e0e649a450a91" dependencies = [ "fnv", "futures 0.3.30", @@ -11397,9 +11425,9 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9fbd18eb275120fdf2e9558a5006a69022405abb9c260c91d218ddb05db39" +checksum = "1f08c4f29e6d2b8915bab6435b8817fa39ef7708c04a7cf6226f803e133b017c" dependencies = [ "hash-db 0.16.0", "kvdb", @@ -11424,9 +11452,9 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0409758bb01f2e975b01c7cb2203aa27746e9796a483b18c57123e6e78fae5" +checksum = "c8e1ac2c698b828073982b6f5b1a466fcc345a452983356af74254ade8e9987d" dependencies = [ "async-trait", "futures 0.3.30", @@ -11450,9 +11478,9 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cc4ebc06768af3e5457a5780aa6dbebeefe27131e70d11b62cfc8136e41747a" +checksum = "a16fd09794291795ad43ea1df7190083f9a47fc0a73e9b8ec0ae98fbe53a2b34" dependencies = [ "async-trait", "futures 0.3.30", @@ -11480,9 +11508,9 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7d698d9d2bde7e0b80e7ada57ede9255a6382da79d2ad9a4e9e70805c40e74" +checksum = "82ec3dc31f8fd024684d1306488836680558b680a8ec38219e19f20854811f02" dependencies = [ "async-trait", "fork-tree", @@ -11507,6 +11535,7 @@ dependencies = [ "sp-consensus-babe", "sp-consensus-slots", "sp-core", + "sp-crypto-hashing", "sp-inherents", "sp-keystore", "sp-runtime", @@ -11516,9 +11545,9 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f55379d0ce6f87026f896f03bce33862b57f77a46fbb4fb7e974182d20d458" +checksum = "bf2b3004672f9eea0d9af6c9b944fa3ef0bc72fd88cea9075cdf6dc96d1439ac" dependencies = [ "futures 0.3.30", "jsonrpsee", @@ -11539,9 +11568,9 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3664a3cddc718187e058f67d9075ef9078c8f8347c0408304ead8565d4ba8164" +checksum = "e9ce3ee15eff7fa642791966d427f185184df3c7f4e58893705f3e7781da8ef5" dependencies = [ "array-bytes 6.2.2", "async-channel 1.9.0", @@ -11564,6 +11593,7 @@ dependencies = [ "sp-consensus", "sp-consensus-beefy", "sp-core", + "sp-crypto-hashing", "sp-keystore", "sp-mmr-primitives", "sp-runtime", @@ -11575,9 +11605,9 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4e3602efe1e206032164772c24365642e3dab807c5f8db0af166f6ef63af3e" +checksum = "2a1ed5e8ac2cb53c6a248c8f469353f55bd23c72f23fe371ac19c1d46618de1a" dependencies = [ "futures 0.3.30", "jsonrpsee", @@ -11595,9 +11625,9 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0befddf2ca16d5f222968fceeab8625532f2d49303fafd17ae2e5d0e939da6" +checksum = "19f68ddb91626f901578515eed93c7919f739660161f4e9f7b9407e2d0ede981" dependencies = [ "fork-tree", "parity-scale-codec", @@ -11609,9 +11639,9 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a824457a3384e7bc19d7ee587dffa5b646deb81a2351be0dd075c2110a3d677a" +checksum = "7ae91e5b5a120be4d13a59eaf94fd85d7c7af528482b8e21d861fa1167df3083" dependencies = [ "ahash 0.8.11", "array-bytes 6.2.2", @@ -11644,6 +11674,7 @@ dependencies = [ "sp-consensus", "sp-consensus-grandpa", "sp-core", + "sp-crypto-hashing", "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", @@ -11652,9 +11683,9 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694328880bf11fce67f5e066d7884dbdf1f2a41c42a7dfce9b0a6bc6b90448a1" +checksum = "697cbd528516561dbc818a8990d5477169e86d9335a0b29207cf6f6a90269e7c" dependencies = [ "finality-grandpa", "futures 0.3.30", @@ -11673,9 +11704,9 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b87636dd0b8aa3d294200100196b0fb51c389ed73e6722ff648feb0fd4adafdb" +checksum = "4c26241f1846c897626b141e2568dbf9088036a1b18b241de23fcebc7a8f5e2e" dependencies = [ "assert_matches", "async-trait", @@ -11709,9 +11740,9 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6649665fcf91d89c16bfb08e9326baf6547e5fe719d6438197434e5b642d716b" +checksum = "567bddd65d52951fb9bc7a7e05d1dfdfc47ff2c594ec5ca9756d27e7226635bb" dependencies = [ "async-trait", "futures 0.3.30", @@ -11733,9 +11764,9 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3129f8af1f8aa5b05829ffec942feff61163054a536704ba48fdcc2276f6042a" +checksum = "aa2ac6c356538d67987bbb867e11a12a84ba87250c70fd50005b6d74f570a4f7" dependencies = [ "parity-scale-codec", "parking_lot 0.12.2", @@ -11756,9 +11787,9 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0285a4a14c0d2c1d04380ff83cddd79181ded510c605d36804cb9c6eb3bbf2ae" +checksum = "07498138dee3ddf2c71299ca372d8449880bb3a8a8a299a483094e9c26b0823e" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -11769,9 +11800,9 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c2ba6ea0e68400caf4847fbcfca6123952b05a817e06f024e9cbafa665ac9d8" +checksum = "30a387779ab54ec1ffce0bf3a6631faada079459d42796c1895683767918a642" dependencies = [ "anyhow", "cfg-if", @@ -11788,9 +11819,9 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e07d2dde727c30974767aed4cddd241447c0a800b702662b529dd2e32a10db1" +checksum = "eb603a0a703f1bc10a4e6462bec1036d8fb8b3e3eff5513a9c07f98ccb8d662d" dependencies = [ "ansi_term", "futures 0.3.30", @@ -11806,9 +11837,9 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93acb7f7c6e5e4be067e78b782a35d1a6d34dafcd955975a1aec05cab9dbf8fe" +checksum = "4cc4f6a558dd23e3bae2e9f195da822465258b9aaf211c34360d7f6efb944e54" dependencies = [ "array-bytes 6.2.2", "parking_lot 0.12.2", @@ -11821,9 +11852,9 @@ dependencies = [ [[package]] name = "sc-mixnet" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cac7d7145c712c4a8b184b3979fe1a154c200ebb1b9f11f1e4e39db97a389f8" +checksum = "45fb213c15679fe5b87c383815d7fb758c70d3e7c573948bd7fe26ff344d2272" dependencies = [ "array-bytes 4.2.0", "arrayvec 0.7.4", @@ -11851,9 +11882,9 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2f49eccabc1de61ff976a184f5380a230f07baa5cb075a31c8ec9459fcd076" +checksum = "f231c7d5e749ec428b4cfa669d759ae76cd3da4f50d7352a2d711acdc7532891" dependencies = [ "array-bytes 6.2.2", "async-channel 1.9.0", @@ -11895,16 +11926,16 @@ dependencies = [ [[package]] name = "sc-network-bitswap" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2779d97eff742c1ebcce812bfd154a7273c2c2eb02e11fad76cf7eb583365834" +checksum = "e2f89b0134738cb3d982b6e625ca93ae8dbe83ce2a06e4b6a396e4df09ed3499" dependencies = [ "async-channel 1.9.0", "cid", "futures 0.3.30", "libp2p-identity", "log", - "prost", + "prost 0.12.4", "prost-build", "sc-client-api", "sc-network", @@ -11916,9 +11947,9 @@ dependencies = [ [[package]] name = "sc-network-common" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b798acc12d5b3120b2d5e8a078fcec39d6732089261136ac31c993235ade917" +checksum = "3504bbff5ab016948dbab0f21a8be26324810b76eff3627ce744adb5bfc1b3ce" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -11934,9 +11965,9 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd92792f3a04fcb1f21018c9f8a5d6d438d705a2548ffcdc7730280c667b8386" +checksum = "dad02cf809c34b53614fa61377e3289064edf6c78eb11df071d11fbf7546d7e9" dependencies = [ "ahash 0.8.11", "futures 0.3.30", @@ -11954,9 +11985,9 @@ dependencies = [ [[package]] name = "sc-network-light" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34e7a126492850dbbd5cf0b77ec3ad350422c2822d165941ddbe618a76af0153" +checksum = "38d84ef0b212c775f58e0304ec09166089f6b09afddf559b7c2b5702933b3be4" dependencies = [ "array-bytes 6.2.2", "async-channel 1.9.0", @@ -11964,7 +11995,7 @@ dependencies = [ "libp2p-identity", "log", "parity-scale-codec", - "prost", + "prost 0.12.4", "prost-build", "sc-client-api", "sc-network", @@ -11976,9 +12007,9 @@ dependencies = [ [[package]] name = "sc-network-sync" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4c92fd35c49f748abf0bf420e1e99aa76b0f48ab43c183ea5dacef951116d7e" +checksum = "9aa9377059deece4e7d419d9ec456f657268c0c603e1cf98df4a920f6da83461" dependencies = [ "array-bytes 6.2.2", "async-channel 1.9.0", @@ -11990,7 +12021,7 @@ dependencies = [ "log", "mockall", "parity-scale-codec", - "prost", + "prost 0.12.4", "prost-build", "sc-client-api", "sc-consensus", @@ -12013,9 +12044,9 @@ dependencies = [ [[package]] name = "sc-network-transactions" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99a1af3b9e158fa91df0cd92916b3ee5d8b8a14a2b61eb5dd9e36e045808f644" +checksum = "16c9cad4baf348725bd82eadcd1747fc112ec49c76b863755ce79c588fa73fe4" dependencies = [ "array-bytes 6.2.2", "futures 0.3.30", @@ -12033,9 +12064,9 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "29.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd5408dbdc3fe345813e983bd2b7ecf8f20e996141fa39a36336f511ab1859bb" +checksum = "1aee89f2abd406356bfd688bd7a51155dc963259e4b752bb85d1f8a061a194fd" dependencies = [ "array-bytes 6.2.2", "bytes", @@ -12078,9 +12109,9 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "29.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac0d83b9117c9c004e58331a593a28044eaf6414e5b3c605d1571b4a6981966" +checksum = "4a5acf6d89f062d1334a0c5b67e9dea97666cd47a49acb2696eab55ff1a1bf74" dependencies = [ "futures 0.3.30", "jsonrpsee", @@ -12111,9 +12142,9 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630e81a436f32487452ae1a57ad0ba31f320ddf864bb7faefd7490fe16b3e139" +checksum = "e9db6aaabfa7e0c27ec15d0f0a11b994cd4bcf86e362f0d9732b4a414d793f0f" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12132,9 +12163,9 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b623908525a2f22aafa079080aa7fbce8b58ca8de53b9f31e3cc8547e0ad8b2" +checksum = "691440bbaddd3bc2675309c965cc75f8bf694f51e0a28039bfc9658299fbc394" dependencies = [ "http", "jsonrpsee", @@ -12148,9 +12179,9 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a54150c808fa10364b73faedd97aff0977a911a521d1caa8bad2bdc7943ad579" +checksum = "a7f10275c62296a785f6e2ac716521e3b6e0fae470416fdf86491cbbfcc2e23d" dependencies = [ "array-bytes 6.2.2", "futures 0.3.30", @@ -12162,6 +12193,7 @@ dependencies = [ "parking_lot 0.12.2", "sc-chain-spec", "sc-client-api", + "sc-rpc", "sc-transaction-pool-api", "sc-utils", "serde", @@ -12178,9 +12210,9 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703bd8b1fc0a137185bfa0b654e04283a58a1d8a2751380e7a0eca919961f150" +checksum = "e14ea779b8c5bdb0d0199c8beebcf1fdc5641e468c480e1c4684be660c8c90af" dependencies = [ "async-trait", "directories", @@ -12242,9 +12274,9 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fac20128b09ac6305aaf482a72c918b35400f3955d7032971df499b0661a5e76" +checksum = "aa842052c41ad379eaecdfddc0d5c953d57e311ae688233f68f461b91d38da0a" dependencies = [ "log", "parity-scale-codec", @@ -12254,9 +12286,9 @@ dependencies = [ [[package]] name = "sc-storage-monitor" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "838d31b4316424d1c2c3a2f06f4e76cd56b53f38d366fc9882444d4ce8faabec" +checksum = "26cb401aad6732700c8d866cbbef1175b9aeb8230908aff27059ef14bd058ef3" dependencies = [ "clap", "fs4", @@ -12268,9 +12300,9 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb310dce9d2474a74152605dc0ca0f81a46f61ba4e7a39752f1203121f47c0c6" +checksum = "9bc382c7d997f4531eee5e5d57f970eaf2761d722298d7747385a4ad69fa6b12" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12288,9 +12320,9 @@ dependencies = [ [[package]] name = "sc-sysinfo" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfc9a5da78281735c6ff3b8d0287e95dcf32fc001415ac20cb2844c0ab4e6d05" +checksum = "25d2ab8f15021916a07cfbe7a08be484c5dc7d57f07bc0e2aa03260b55a5632f" dependencies = [ "derive_more", "futures 0.3.30", @@ -12303,15 +12335,16 @@ dependencies = [ "serde", "serde_json", "sp-core", + "sp-crypto-hashing", "sp-io", "sp-std", ] [[package]] name = "sc-telemetry" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96841bdc22e1ad5931e6cb7557b06ef33aeda7f5eef3864653359840f9fd025a" +checksum = "0673a93aa0684b606abfc5fce6c882ada7bb5fad8a2ddc66a09a42bcc9664d91" dependencies = [ "chrono", "futures 0.3.30", @@ -12329,9 +12362,9 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90864e5e042d1238bcb082b0fa73ce58b7eb4897127783dae1dd66eee59cdaef" +checksum = "e77b4fdb4f359f19c395ba862430f3ca0efb50b0310b09753caaa06997edd606" dependencies = [ "ansi_term", "chrono", @@ -12372,9 +12405,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7985fab634814ee28fe3ecd2131fa2cb4c8eee88a7e60f1cd59dc0afa826fe2" +checksum = "326dc8ea417c53b6787bd1bb27431d44768504451f5ce4efdde0c15877c7c121" dependencies = [ "async-trait", "futures 0.3.30", @@ -12390,6 +12423,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-core", + "sp-crypto-hashing", "sp-runtime", "sp-tracing", "sp-transaction-pool", @@ -12399,9 +12433,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3402336f81a52fd6b1fd5a16fa3f4279032de1e113fe4a973865bf0b0e28679c" +checksum = "93ae888ce3491acb1b489c3dba930d0c46c7ef9f9893ba0ab8af9125362f3d14" dependencies = [ "async-trait", "futures 0.3.30", @@ -12416,9 +12450,9 @@ dependencies = [ [[package]] name = "sc-utils" -version = "14.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4d5d1f106d670dd0c56fe540e8b0916aaeff6960bb39440ed8f3c80b52f8d4" +checksum = "28b1a238f5baa56405db4e440e2d2f697583736fa2e2f1aac345c438a42975f1" dependencies = [ "async-channel 1.9.0", "futures 0.3.30", @@ -12790,7 +12824,7 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" dependencies = [ - "bstr 0.2.17", + "bstr", "unicode-segmentation", ] @@ -12833,9 +12867,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d9bb569dc58f1e139c20f532a2ad13d54795060c0000c2c49dc812b17684197" +checksum = "d40fa5e14772407fd2ccffdd5971bf055bbf46a40727c0ea96d2bb6563d17e1c" dependencies = [ "enumn", "parity-scale-codec", @@ -13028,9 +13062,9 @@ dependencies = [ [[package]] name = "sp-api" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dea138c6dbf282ab57756492f0232ea0a08575ca9cbe2b7b1ead49000f238a7" +checksum = "6ef42aa652381ade883c14ffbbb5c0fec36d382d2217b5bace01b8a0e8634778" dependencies = [ "hash-db 0.16.0", "log", @@ -13065,9 +13099,9 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "30.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4fe7a9b7fa9da76272b201e2fb3c7900d97d32a46b66af9a04dad457f73c71" +checksum = "547cad7a6eabb52c639ec117b3db9c6b43cf1b29a9393b18feb19e101a91833f" dependencies = [ "parity-scale-codec", "scale-info", @@ -13079,9 +13113,9 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42721f072b421f292a072e8f52a3b3c0fbc27428f0c9fe24067bc47046bad63" +checksum = "afa823ca5adc490d47dccb41d69ad482bc57a317bd341de275868378f48f131c" dependencies = [ "integer-sqrt", "num-traits", @@ -13094,9 +13128,9 @@ dependencies = [ [[package]] name = "sp-authority-discovery" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a740c05e9096eb17e93b5ab6aa5fe8ce0c9b4243777826d92133b3dd682e14" +checksum = "c92b177c72b5d2973c36d60f6ef942d791d9fd91eae8b08c71882e4118d4fbfc" dependencies = [ "parity-scale-codec", "scale-info", @@ -13108,9 +13142,9 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d2aa0943101367b955f5806c3ecea2e23df7c90059708107470dbfb9d3d7ab" +checksum = "1b36ce171caa7eb2bbe682c089f755fdefa71d3702e4fb1ba30d10146aef99d5" dependencies = [ "sp-api", "sp-inherents", @@ -13120,9 +13154,9 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9adee5ddcf0682d0302ed640a285b9f922d933a205b63c7819a74d6092b6f78" +checksum = "a31303e766d2e53812641bbc1f1cec03a85793fc9e627e55f0a6854b28708758" dependencies = [ "futures 0.3.30", "log", @@ -13139,9 +13173,9 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcac16e85f78db9c99c9424659bb25790be079a0b758a3674ee8e1e7ef635b0" +checksum = "cb6e512b862c4ff7a26cdcd364898cc42e181ff5cb35fbb226ff27d88c81569a" dependencies = [ "async-trait", "futures 0.3.30", @@ -13155,9 +13189,9 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8e878a116b0885eaefd068235657737cb72fdce60a8c080dfd092f7d645cc" +checksum = "4bf13c293685319751f72fa5216c7fb5f25f3e8e8fe29b4503296ed5f5466b3d" dependencies = [ "async-trait", "parity-scale-codec", @@ -13173,9 +13207,9 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebfedfdea5b22fb3625cd664e72503dcbd1087373181d5be0d092b3e7b4c61f5" +checksum = "b9be2f86a2f0ce2a78b455feb547aa27604fd76a7f7a691995cbad44e0b1b9dd" dependencies = [ "async-trait", "parity-scale-codec", @@ -13193,9 +13227,9 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e09a424196a673f0e6b5fe79e4ab97da416491cfecab7bc835fa595134ac1b5c" +checksum = "90ff890a84ef57628b010df0e1d75b3a78fb7f575e4ceeba7215c276902c403e" dependencies = [ "lazy_static", "parity-scale-codec", @@ -13204,6 +13238,7 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-core", + "sp-crypto-hashing", "sp-io", "sp-mmr-primitives", "sp-runtime", @@ -13213,9 +13248,9 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a906b20409a5a69b1d9580848f502af20cf2c51a1ae028ba208375eb11f332b" +checksum = "64b606164600db36e596db7abf32b4533dc9a74526d9444c4c45035427b2199b" dependencies = [ "finality-grandpa", "log", @@ -13232,9 +13267,9 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc5c1620d81196391daa15e78ea20cc11c59f08c509381c276d5d6a3d4d36af" +checksum = "73a5bd1fcd84bbdc7255528c7cdb92f9357fd555f06ee553af7e340cbdab517c" dependencies = [ "parity-scale-codec", "scale-info", @@ -13245,9 +13280,9 @@ dependencies = [ [[package]] name = "sp-core" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f230cb12575455070da0fc174815958423a0b9a641d5e304a9457113c7cb4007" +checksum = "7c33c7a1568175250628567d50c4e1c54a6ac5bc1190413b9be29a9e810cbe73" dependencies = [ "array-bytes 6.2.2", "bip39", @@ -13275,7 +13310,7 @@ dependencies = [ "secp256k1", "secrecy", "serde", - "sp-core-hashing", + "sp-crypto-hashing", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", @@ -13290,10 +13325,10 @@ dependencies = [ ] [[package]] -name = "sp-core-hashing" -version = "15.0.0" +name = "sp-crypto-hashing" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0f4990add7b2cefdeca883c0efa99bb4d912cb2196120e1500c0cc099553b0" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" dependencies = [ "blake2b_simd", "byteorder", @@ -13304,13 +13339,13 @@ dependencies = [ ] [[package]] -name = "sp-core-hashing-proc-macro" -version = "15.0.0" +name = "sp-crypto-hashing-proc-macro" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7527f8dda7667c41009b2cd0efaddcb81709b9741bd5ee6d17b11bad835cc698" +checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", - "sp-core-hashing", + "sp-crypto-hashing", "syn 2.0.60", ] @@ -13337,9 +13372,9 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63867ec85950ced90d4ab1bba902a47db1b1efdf2829f653945669b2bb470a9c" +checksum = "e7096ed024cec397804864898b093b51e14c7299f1d00c67dd5800330e02bb82" dependencies = [ "environmental", "parity-scale-codec", @@ -13349,9 +13384,9 @@ dependencies = [ [[package]] name = "sp-genesis-builder" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfdc79df83221ec5a279cbbd08fd6f8be164b9b081c8e84593ce2c2ebd5d66c0" +checksum = "fd865540ec19479c7349b584ccd78cc34c3f3a628a2a69dbb6365ceec36295ee" dependencies = [ "serde_json", "sp-api", @@ -13361,9 +13396,9 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3caf2d1288549d7e6c32b453f2d4855d498bb88600101011e35653e022a6f2" +checksum = "607c9e35e96966645ff180a9e9f976433b96e905d0a91d8d5315e605a21f4bc0" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -13376,9 +13411,9 @@ dependencies = [ [[package]] name = "sp-io" -version = "30.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55f26d89feedaf0faf81688b6e1e1e81329cd8b4c6a4fd6c5b97ed9dd068b8a" +checksum = "ec43aa073eab35fcb920d7592474d5427ea3be2bf938706a3ad955d7ba54fd8d" dependencies = [ "bytes", "ed25519-dalek", @@ -13388,6 +13423,7 @@ dependencies = [ "rustversion", "secp256k1", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-keystore", "sp-runtime-interface", @@ -13401,9 +13437,9 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "31.0.0" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98165ce7c625a8cdb88d39c6bbd56fe8b32ada64ed0894032beba99795f557da" +checksum = "69cf0a2f881958466fc92bc9b39bbc2c0d815ded4a21f8f953372b0ac2e11b02" dependencies = [ "sp-core", "sp-runtime", @@ -13412,9 +13448,9 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96806a28a62ed9ddecd0b28857b1344d029390f7c5c42a2ff9199cbf5638635c" +checksum = "444f2d53968b1ce5e908882710ff1f3873fcf3e95f59d57432daf685bbacb959" dependencies = [ "parity-scale-codec", "parking_lot 0.12.2", @@ -13447,9 +13483,9 @@ dependencies = [ [[package]] name = "sp-mixnet" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ed83d2f899484bde61c72cbae6edfb25708d43e6b19934e206f3c706df67df" +checksum = "7bebd44b915c65aeb7e7eeaea466aba3b27cdd915c83ea83d4643c54f21ffbbf" dependencies = [ "parity-scale-codec", "scale-info", @@ -13460,9 +13496,9 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7526a73d518c03fa2447588b1544019a194a4f113cf34d2610d3b5925c80c86" +checksum = "891b7263b7c44a569173ee1078f68fb1a01991a44914607c0100aa5ae41f6562" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -13479,9 +13515,9 @@ dependencies = [ [[package]] name = "sp-npos-elections" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8efff28b504b4b928288976e5f72c00c7ece9d2348a7ca2496c77849dd4c8f" +checksum = "195d7e1154c91cce5c3abc8c778689c3e5799da6411328dd32ac7a974c68e526" dependencies = [ "parity-scale-codec", "scale-info", @@ -13494,9 +13530,9 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb45b3e397dc9c7b81cb2d8d641d0bcb1f525b60e83835783413ba73b3f61ac9" +checksum = "4d83b955dce0b6d143bec3f60571311168f362b1c16cf044da7037a407b66c19" dependencies = [ "sp-api", "sp-core", @@ -13516,9 +13552,9 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a55f2c7660b579627d22932ecfe2e5f001a7671d2fa77667387517c7f80e6fb" +checksum = "9af4b73fe7ddd88b1641cca90048c4e525e721763199e6fd29c4f590884f4d16" dependencies = [ "rustc-hash", "serde", @@ -13527,9 +13563,9 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "31.0.1" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3bb49a4475d390198dfd3d41bef4564ab569fbaf1b5e38ae69b35fc01199d91" +checksum = "0a95e71603a6281e91b0f1fd3d68057644be16d75a4602013187b8137db8abee" dependencies = [ "docify", "either", @@ -13552,9 +13588,9 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f66b66d8cec3d785fa6289336c1d9cbd4305d5d84f7134378c4d79ed7983e6fb" +checksum = "4e2321ab29d4bcc31f1ba1b4f076a81fb2a666465231e5c981c72320d74dbe63" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -13585,9 +13621,9 @@ dependencies = [ [[package]] name = "sp-session" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8048981db53d4f5171e6003f5e11fbfc27a8c196b0827619907a4214746a623b" +checksum = "3b86531090cc04d2ab3535df07146258e2fb3ab6257b0a77ef14aa08282c3d4a" dependencies = [ "parity-scale-codec", "scale-info", @@ -13601,9 +13637,9 @@ dependencies = [ [[package]] name = "sp-staking" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0e68be3fff84dd8ee552f9d13dd2e9eab3663e0bddfc6c6c88de02aaca1e311" +checksum = "1e14d003ecf0b610bf1305a92bdab875289b39d514c073f30e75e78c2763a788" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -13616,9 +13652,9 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718c779ad1d6fcc0be64c7ce030b33fa44b5c8914b3a1319ef63bb5f27fb98df" +checksum = "a67297e702aa32027d7766803f362a420d6d3ec9e2f84961f3c64e2e52b5aaf9" dependencies = [ "hash-db 0.16.0", "log", @@ -13638,9 +13674,9 @@ dependencies = [ [[package]] name = "sp-statement-store" -version = "10.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee6d4ceb2513f180e6e017fd6d6f3c9a1a122dcedee5fc8e4254d8a7ecf793d" +checksum = "309a9ae4e8134bbed8ffc510cf4d461a4a651f9250b556de782cedd876abe1ff" dependencies = [ "aes-gcm", "curve25519-dalek 4.1.2", @@ -13653,6 +13689,7 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-runtime", "sp-runtime-interface", @@ -13669,9 +13706,9 @@ checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-storage" -version = "19.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb92d7b24033a8a856d6e20dd980b653cbd7af7ec471cc988b1b7c1d2e3a32b" +checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13683,9 +13720,9 @@ dependencies = [ [[package]] name = "sp-timestamp" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "347eaddd5b07856ccec69ac3300e72e392a5efc3aea5fb4b7230888a0b447b9e" +checksum = "249cd06624f2edb53b25af528ab216a508dc9d0870e158b43caac3a97e86699f" dependencies = [ "async-trait", "parity-scale-codec", @@ -13710,9 +13747,9 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97c4052e69eacdb7a411e050c56a838f460b8a879071125451e9bb2d4814df34" +checksum = "9742861c5330bdcb42856a6eed3d3745b58ee1c92ca4c9260032ff4e6c387165" dependencies = [ "sp-api", "sp-runtime", @@ -13720,9 +13757,9 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2a2c693bc7ca363c9d2cd412276582aef10c794399aaffbd1fe2351099a1a5" +checksum = "ece8e22a5419c7a336a2544654e1389fec8cac19b93081a30912842b44e8167f" dependencies = [ "async-trait", "parity-scale-codec", @@ -13736,9 +13773,9 @@ dependencies = [ [[package]] name = "sp-trie" -version = "29.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e4d24d84a0beb44a71dcac1b41980e1edf7fb722c7f3046710136a283cd479b" +checksum = "eed48dfd05081e8b36741b10ce4eb686c135a2952227a11fe71caec89890ddbb" dependencies = [ "ahash 0.8.11", "hash-db 0.16.0", @@ -13761,16 +13798,16 @@ dependencies = [ [[package]] name = "sp-version" -version = "29.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afd1b053394347e22f541696bca4a9ac3ec848b50d1b86f5018d2b771f39f11a" +checksum = "ff4a660c68995663d6778df324f4e2b4efc48d55a8e9c92c22a5fb7dae7899cd" dependencies = [ "impl-serde", "parity-scale-codec", "parity-wasm", "scale-info", "serde", - "sp-core-hashing-proc-macro", + "sp-crypto-hashing-proc-macro", "sp-runtime", "sp-std", "sp-version-proc-macro", @@ -13805,9 +13842,9 @@ dependencies = [ [[package]] name = "sp-weights" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e874bdf9dd3fd3242f5b7867a4eaedd545b02f29041a46d222a9d9d5caaaa5c" +checksum = "a3be30aec904994451dcacf841a9168cfbbaf817de6b24b6a1c1418cbf1af2fe" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -13875,9 +13912,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-node-inspect" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c55152a6c1d08faa7aef9b838c7d6d5d240e3cd638e1504d06a798b4652dd0" +checksum = "394fb14c6e056213bfc3a97a246492604a6c6a0813b786f87cc2d585270c0a0b" dependencies = [ "clap", "parity-scale-codec", @@ -13894,9 +13931,9 @@ dependencies = [ [[package]] name = "staging-parachain-info" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad554ffd27fbcafd82e234d7e7188e458e51bfe2b3b5000dd236dce762e3e95f" +checksum = "da7dc139d104f676a18c13380a09c3f72d59450a7471116387cbf8cb5f845a0e" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -13909,9 +13946,9 @@ dependencies = [ [[package]] name = "staging-xcm" -version = "7.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0df18af00766d22926916bb443f14742c65cc6b2f0fe997b8f26da0d0f9ee9ca" +checksum = "48fa328b87de3466bc38cc9a07244c42c647b7755b81115e1dfeb47cc13fc6e6" dependencies = [ "array-bytes 6.2.2", "bounded-collections", @@ -13928,9 +13965,9 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "7.0.3" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ba4f214fe99d79ffcc266f431abbb32d3596788327b925d469c7bb6a3c84d3c" +checksum = "a8f6cfc27c1d45f9a67e20ed3f7e60296299688825350291606add10bf3bbff2" dependencies = [ "frame-support", "frame-system", @@ -13951,9 +13988,9 @@ dependencies = [ [[package]] name = "staging-xcm-executor" -version = "7.0.3" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f1dea1e33eefee513c197c24255670951a2c515a6ce2c7049fe86385400074f" +checksum = "a638f4c8735cc04b5c93920a1f59e679f48b131315a07d146798e0decebf7720" dependencies = [ "environmental", "frame-benchmarking", @@ -14020,9 +14057,9 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -14054,7 +14091,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -14067,7 +14104,7 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -14080,7 +14117,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -14119,9 +14156,9 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcee7812a1e1cec85e3095c5d1c1627ceb084c0c81e66c2f9df7cb7b3a5938f3" +checksum = "332f903d2f34703204f0003136c9abbc569d691028279996a1daf8f248a7369f" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.30", @@ -14152,9 +14189,9 @@ dependencies = [ [[package]] name = "substrate-rpc-client" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9076480cc6f480429b081bf93607d32183bdac4d6f0d2969d5e08de08bea1701" +checksum = "40e5235d8460ec81e9a382345aa80d75e2943f224a332559847344bb62fa13b3" dependencies = [ "async-trait", "jsonrpsee", @@ -14166,9 +14203,9 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92c25dcb3e4aee5559c2bd9b4d105786220cad116719d7ebb39e4f359865d44" +checksum = "5768a5d3c76eebfdf94c23a3fde6c832243a043d60561e5ac1a2b475b9ad09f3" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -14194,13 +14231,13 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "17.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac08d23ff4da66fe6cb0300f249be010d78e5abeafef0390cae39736a374e6cd" +checksum = "511bbc2df035f5fe2556d855369a1bbb45df620360391a1f6e3fa1a1d64af79a" dependencies = [ - "ansi_term", "build-helper", "cargo_metadata", + "console", "filetime", "parity-wasm", "sp-maybe-compressed-blob", @@ -14647,6 +14684,10 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite 0.2.14", "tower-layer", "tower-service", "tracing", @@ -14727,9 +14768,9 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f134d9dda0e872989ddf57b90ca73bcad27f1fba2cc19cfada7b76549c590b0" +checksum = "9690af7fe11d125786fa1b5ca802192f631b61a4411277865c8e0581c887e286" dependencies = [ "coarsetime", "polkadot-primitives", @@ -14880,9 +14921,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "try-runtime-cli" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb82b8de45dabaaba00c8c7394f18c6f97dd0e27954d4de08b352a24886d8407" +checksum = "9454e1af0a0be675f837d63080ef8f43510c05df8c059570622386a0cf40b548" dependencies = [ "async-trait", "clap", @@ -15209,9 +15250,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-instrument" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" +checksum = "2a47ecb37b9734d1085eaa5ae1a81e60801fd8c28d4cabdd8aedb982021918bc" dependencies = [ "parity-wasm", ] @@ -15545,17 +15586,11 @@ dependencies = [ "webpki", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "westend-runtime" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "390ccc949904980061c181f0a1507ceb793f3b57f8f930ef60222839e08cb2ca" +checksum = "db2a5cebb4c678a0d1291bb21f9d44ddebceae044b0fb5200fa3bed108a31595" dependencies = [ "binary-merkle-tree", "bitvec", @@ -15660,9 +15695,9 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c410b8a17b87e5228f9c27ba4a8020e7ece4a8afb0f452b989834623afe84a2" +checksum = "3b080c193714605ce1033311d85035247adca170181cd68a3ad7e3ca87755a14" dependencies = [ "frame-support", "polkadot-primitives", @@ -16047,9 +16082,9 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7998facd751c42ec9b11a4cf71fcdb41fb147c5c8db8bcd1281fe84f8760d515" +checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" dependencies = [ "Inflector", "proc-macro2", @@ -16059,9 +16094,9 @@ dependencies = [ [[package]] name = "xcm-simulator" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958836c9a2dc17a9b3a8b23fab47903a7dbc934f8d447386813c813139dbba8a" +checksum = "c65d85900081973f0c2cf0aad76e61f2d2560ea57ee2c7c886a68a0e4cf81c8a" dependencies = [ "frame-support", "parity-scale-codec", @@ -16102,7 +16137,7 @@ dependencies = [ [[package]] name = "zenlink-protocol" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.6.0#af308c7f73ab244000201be3619056b2c62eff6a" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" dependencies = [ "cumulus-primitives-core", "frame-benchmarking", @@ -16124,7 +16159,7 @@ dependencies = [ [[package]] name = "zenlink-protocol-rpc" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.6.0#af308c7f73ab244000201be3619056b2c62eff6a" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -16140,7 +16175,7 @@ dependencies = [ [[package]] name = "zenlink-protocol-runtime-api" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.6.0#af308c7f73ab244000201be3619056b2c62eff6a" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" dependencies = [ "parity-scale-codec", "sp-api", @@ -16151,7 +16186,7 @@ dependencies = [ [[package]] name = "zenlink-stable-amm" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.6.0#af308c7f73ab244000201be3619056b2c62eff6a" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" dependencies = [ "frame-support", "frame-system", @@ -16168,7 +16203,7 @@ dependencies = [ [[package]] name = "zenlink-stable-amm-rpc" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.6.0#af308c7f73ab244000201be3619056b2c62eff6a" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -16182,7 +16217,7 @@ dependencies = [ [[package]] name = "zenlink-stable-amm-runtime-api" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.6.0#af308c7f73ab244000201be3619056b2c62eff6a" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" dependencies = [ "parity-scale-codec", "sp-api", @@ -16193,7 +16228,7 @@ dependencies = [ [[package]] name = "zenlink-swap-router" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.6.0#af308c7f73ab244000201be3619056b2c62eff6a" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" dependencies = [ "frame-support", "frame-system", diff --git a/Cargo.toml b/Cargo.toml index 6a8b54a4f..36d17fcee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,181 +98,181 @@ bifrost-clouds-convert = { path = "pallets/clouds-convert", default-features bifrost-vtoken-minting-rpc-runtime-api = { path = "pallets/vtoken-minting/rpc/runtime-api", default-features = false } # Zenlink -merkle-distributor = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.6.0", default-features = false } -zenlink-protocol = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.6.0", default-features = false } -zenlink-protocol-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.6.0" } -zenlink-protocol-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.6.0", default-features = false } -zenlink-stable-amm = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.6.0", default-features = false } -zenlink-stable-amm-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.6.0" } -zenlink-stable-amm-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.6.0", default-features = false } -zenlink-swap-router = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.6.0", default-features = false } +merkle-distributor = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } +zenlink-protocol = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } +zenlink-protocol-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0" } +zenlink-protocol-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } +zenlink-stable-amm = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } +zenlink-stable-amm-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0" } +zenlink-stable-amm-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } +zenlink-swap-router = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } # Orml -orml-tokens = { version = "0.7.0", default-features = false } -orml-traits = { version = "0.7.0", default-features = false } -orml-unknown-tokens = { version = "0.7.0", default-features = false } -orml-utilities = { version = "0.7.0", default-features = false } -orml-xcm = { version = "0.7.0", default-features = false } -orml-xcm-support = { version = "0.7.0", default-features = false } -orml-xtokens = { version = "0.7.0", default-features = false } -orml-oracle = { version = "0.7.0", default-features = false } +orml-tokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } +orml-traits = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } +orml-unknown-tokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } +orml-utilities = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } +orml-xcm = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } +orml-xcm-support = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } +orml-xtokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } +orml-oracle = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } # polkadot-sdk (wasm) -cumulus-client-collator = { version = "0.7.0", default-features = false } -cumulus-client-consensus-proposer = { version = "0.7.0", default-features = false } -cumulus-pallet-aura-ext = { version = "0.7.0", default-features = false } -cumulus-pallet-dmp-queue = { version = "0.7.0", default-features = false } -cumulus-pallet-parachain-system = { version = "0.7.0", default-features = false, features = ["parameterized-consensus-hook"] } -cumulus-pallet-xcm = { version = "0.7.0", default-features = false } -cumulus-pallet-xcmp-queue = { version = "0.7.0", default-features = false } -cumulus-primitives-core = { version = "0.7.0", default-features = false } -cumulus-primitives-parachain-inherent = { version = "0.7.0", default-features = false } -cumulus-primitives-timestamp = { version = "0.7.0", default-features = false } -cumulus-primitives-utility = { version = "0.7.3", default-features = false } -cumulus-test-relay-sproof-builder = { version = "0.7.0", default-features = false } -frame-benchmarking = { version = "28.0.0", default-features = false } -frame-executive = { version = "28.0.0", default-features = false } -frame-support = { version = "28.0.0", default-features = false } -frame-system = { version = "28.0.0", default-features = false } -frame-system-benchmarking = { version = "28.0.0", default-features = false } -frame-system-rpc-runtime-api = { version = "26.0.0", default-features = false } -frame-try-runtime = { version = "0.34.0", default-features = false } -pallet-assets = { version = "29.0.0", default-features = false } -pallet-asset-rate = { version = "7.0.0", default-features = false } -pallet-aura = { version = "27.0.0", default-features = false } -pallet-authority-discovery = { version = "28.0.0", default-features = false } -pallet-authorship = { version = "28.0.0", default-features = false } -pallet-balances = { version = "28.0.0", default-features = false } -pallet-bounties = { version = "27.0.0", default-features = false } -pallet-collator-selection = { version = "9.0.0", default-features = false } -pallet-collective = { version = "28.0.0", default-features = false } -pallet-conviction-voting = { version = "28.0.0", default-features = false } -pallet-democracy = { version = "28.0.0", default-features = false } -pallet-elections-phragmen = { version = "29.0.0", default-features = false } -pallet-identity = { version = "28.0.0", default-features = false } -pallet-im-online = { version = "27.0.0", default-features = false } -pallet-indices = { version = "28.0.0", default-features = false } -pallet-membership = { version = "28.0.0", default-features = false } -pallet-message-queue = { version = "31.0.0", default-features = false } -pallet-multisig = { version = "28.0.0", default-features = false } -pallet-preimage = { version = "28.0.0", default-features = false } -pallet-proxy = { version = "28.0.0", default-features = false } -pallet-ranked-collective = { version = "28.0.0", default-features = false } -pallet-recovery = { version = "28.0.0", default-features = false } -pallet-referenda = { version = "28.0.0", default-features = false } -pallet-scheduler = { version = "29.0.0", default-features = false } -pallet-session = { version = "28.0.0", default-features = false } -pallet-staking = { version = "28.0.0", default-features = false } -pallet-sudo = { version = "28.0.0", default-features = false } -pallet-timestamp = { version = "27.0.0", default-features = false } -pallet-tips = { version = "27.0.0", default-features = false } -pallet-transaction-payment = { version = "28.0.0", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { version = "28.0.0", default-features = false } -pallet-treasury = { version = "27.0.0", default-features = false } -pallet-utility = { version = "28.0.0", default-features = false } -pallet-whitelist = { version = "27.0.0", default-features = false } -pallet-xcm = { version = "7.0.0", default-features = false } -parachains-common = { version = "7.0.0", default-features = false } -parachain-info = { version = "0.7.0", package = "staging-parachain-info", default-features = false } -polkadot-core-primitives = { version = "7.0.0", default-features = false } -polkadot-parachain-primitives = { version = "6.0.0", default-features = false } -polkadot-primitives = { version = "7.0.0", default-features = false } -polkadot-runtime-common = { version = "7.0.0", default-features = false } -polkadot-runtime-parachains = { version = "7.0.0", default-features = false } -sp-api = { version = "26.0.0", default-features = false } -sp-application-crypto = { version = "30.0.0", default-features = false } -sp-arithmetic = { version = "23.0.0", default-features = false } -sp-authority-discovery = { version = "26.0.0", default-features = false } -sp-block-builder = { version = "26.0.0", default-features = false } -sp-blockchain = { version = "28.0.0", default-features = false } -sp-consensus = { version = "0.32.0", default-features = false } -sp-consensus-aura = { version = "0.32.0", default-features = false } -sp-consensus-slots = { version = "0.32.0", default-features = false } -sp-core = { version = "28.0.0", default-features = false } +cumulus-client-collator = { version = "0.8.0", default-features = false } +cumulus-client-consensus-proposer = { version = "0.8.0", default-features = false } +cumulus-pallet-aura-ext = { version = "0.8.0", default-features = false } +cumulus-pallet-dmp-queue = { version = "0.8.0", default-features = false } +cumulus-pallet-parachain-system = { version = "0.8.0", default-features = false, features = ["parameterized-consensus-hook"] } +cumulus-pallet-xcm = { version = "0.8.0", default-features = false } +cumulus-pallet-xcmp-queue = { version = "0.8.0", default-features = false } +cumulus-primitives-core = { version = "0.8.0", default-features = false } +cumulus-primitives-parachain-inherent = { version = "0.8.0", default-features = false } +cumulus-primitives-timestamp = { version = "0.8.0", default-features = false } +cumulus-primitives-utility = { version = "0.8.0", default-features = false } +cumulus-test-relay-sproof-builder = { version = "0.8.0", default-features = false } +frame-benchmarking = { version = "29.0.0", default-features = false } +frame-executive = { version = "29.0.0", default-features = false } +frame-support = { version = "29.0.0", default-features = false } +frame-system = { version = "29.0.0", default-features = false } +frame-system-benchmarking = { version = "29.0.0", default-features = false } +frame-system-rpc-runtime-api = { version = "27.0.0", default-features = false } +frame-try-runtime = { version = "0.35.0", default-features = false } +pallet-assets = { version = "30.0.0", default-features = false } +pallet-asset-rate = { version = "8.0.0", default-features = false } +pallet-aura = { version = "28.0.0", default-features = false } +pallet-authority-discovery = { version = "29.0.0", default-features = false } +pallet-authorship = { version = "29.0.0", default-features = false } +pallet-balances = { version = "29.0.0", default-features = false } +pallet-bounties = { version = "28.0.0", default-features = false } +pallet-collator-selection = { version = "10.0.0", default-features = false } +pallet-collective = { version = "29.0.0", default-features = false } +pallet-conviction-voting = { version = "29.0.0", default-features = false } +pallet-democracy = { version = "29.0.0", default-features = false } +pallet-elections-phragmen = { version = "30.0.0", default-features = false } +pallet-identity = { version = "29.0.0", default-features = false } +pallet-im-online = { version = "28.0.0", default-features = false } +pallet-indices = { version = "29.0.0", default-features = false } +pallet-membership = { version = "29.0.0", default-features = false } +pallet-message-queue = { version = "32.0.0", default-features = false } +pallet-multisig = { version = "29.0.0", default-features = false } +pallet-preimage = { version = "29.0.0", default-features = false } +pallet-proxy = { version = "29.0.0", default-features = false } +pallet-ranked-collective = { version = "29.0.0", default-features = false } +pallet-recovery = { version = "29.0.0", default-features = false } +pallet-referenda = { version = "29.0.0", default-features = false } +pallet-scheduler = { version = "30.0.0", default-features = false } +pallet-session = { version = "29.0.0", default-features = false } +pallet-staking = { version = "29.0.0", default-features = false } +pallet-sudo = { version = "29.0.0", default-features = false } +pallet-timestamp = { version = "28.0.0", default-features = false } +pallet-tips = { version = "28.0.0", default-features = false } +pallet-transaction-payment = { version = "29.0.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { version = "29.0.0", default-features = false } +pallet-treasury = { version = "28.0.0", default-features = false } +pallet-utility = { version = "29.0.0", default-features = false } +pallet-whitelist = { version = "28.0.0", default-features = false } +pallet-xcm = { version = "8.0.0", default-features = false } +parachains-common = { version = "8.0.0", default-features = false } +parachain-info = { version = "0.8.0", package = "staging-parachain-info", default-features = false } +polkadot-core-primitives = { version = "8.0.0", default-features = false } +polkadot-parachain-primitives = { version = "7.0.0", default-features = false } +polkadot-primitives = { version = "8.0.0", default-features = false } +polkadot-runtime-common = { version = "8.0.0", default-features = false } +polkadot-runtime-parachains = { version = "8.0.0", default-features = false } +sp-api = { version = "27.0.0", default-features = false } +sp-application-crypto = { version = "31.0.0", default-features = false } +sp-arithmetic = { version = "24.0.0", default-features = false } +sp-authority-discovery = { version = "27.0.0", default-features = false } +sp-block-builder = { version = "27.0.0", default-features = false } +sp-blockchain = { version = "29.0.0", default-features = false } +sp-consensus = { version = "0.33.0", default-features = false } +sp-consensus-aura = { version = "0.33.0", default-features = false } +sp-consensus-slots = { version = "0.33.0", default-features = false } +sp-core = { version = "29.0.0", default-features = false } sp-debug-derive = { version = "14.0.0", default-features = false } -sp-externalities = { version = "0.25.0", default-features = false } -sp-genesis-builder = { version = "0.7.0", default-features = false } -sp-inherents = { version = "26.0.0", default-features = false } -sp-io = { version = "30.0.0", default-features = false } -sp-keyring = { version = "31.0.0", default-features = false } -sp-keystore = { version = "0.34.0", default-features = false } +sp-externalities = { version = "0.26.0", default-features = false } +sp-genesis-builder = { version = "0.8.0", default-features = false } +sp-inherents = { version = "27.0.0", default-features = false } +sp-io = { version = "31.0.0", default-features = false } +sp-keyring = { version = "32.0.0", default-features = false } +sp-keystore = { version = "0.35.0", default-features = false } sp-maybe-compressed-blob = { version = "11.0.0", default-features = false } -sp-npos-elections = { version = "26.0.0", default-features = false } -sp-offchain = { version = "26.0.0", default-features = false } -sp-runtime = { version = "31.0.0", default-features = false } -sp-runtime-interface = { version = "24.0.0", default-features = false } -sp-session = { version = "27.0.0", default-features = false } -sp-staking = { version = "26.0.0", default-features = false } -sp-state-machine = { version = "0.35.0", default-features = false } +sp-npos-elections = { version = "27.0.0", default-features = false } +sp-offchain = { version = "27.0.0", default-features = false } +sp-runtime = { version = "32.0.0", default-features = false } +sp-runtime-interface = { version = "25.0.0", default-features = false } +sp-session = { version = "28.0.0", default-features = false } +sp-staking = { version = "27.0.0", default-features = false } +sp-state-machine = { version = "0.36.0", default-features = false } sp-std = { version = "14.0.0", default-features = false } -sp-storage = { version = "19.0.0", default-features = false } -sp-timestamp = { version = "26.0.0", default-features = false } +sp-storage = { version = "20.0.0", default-features = false } +sp-timestamp = { version = "27.0.0", default-features = false } sp-tracing = { version = "16.0.0", default-features = false } -sp-transaction-pool = { version = "26.0.0", default-features = false } -sp-trie = { version = "29.0.0", default-features = false } -sp-version = { version = "29.0.0", default-features = false } +sp-transaction-pool = { version = "27.0.0", default-features = false } +sp-trie = { version = "30.0.0", default-features = false } +sp-version = { version = "30.0.0", default-features = false } sp-wasm-interface = { version = "20.0.0", default-features = false } -sp-weights = { version = "27.0.0", default-features = false } +sp-weights = { version = "28.0.0", default-features = false } substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } -xcm = { version = "7.0.0", package = "staging-xcm", default-features = false } -xcm-builder = { version = "7.0.3", package = "staging-xcm-builder", default-features = false } -xcm-executor = { version = "7.0.3", package = "staging-xcm-executor", default-features = false } +xcm = { version = "8.0.0", package = "staging-xcm", default-features = false } +xcm-builder = { version = "8.0.0", package = "staging-xcm-builder", default-features = false } +xcm-executor = { version = "8.0.1", package = "staging-xcm-executor", default-features = false } # polkadot-sdk (client) -cumulus-client-cli = { version = "0.7.0" } -cumulus-client-consensus-aura = { version = "0.7.0" } -cumulus-client-consensus-common = { version = "0.7.0" } -cumulus-client-consensus-relay-chain = { version = "0.7.0" } -cumulus-client-network = { version = "0.7.0" } -cumulus-client-pov-recovery = { version = "0.7.0" } -cumulus-client-service = { version = "0.7.0" } -cumulus-relay-chain-inprocess-interface = { version = "0.7.0" } -cumulus-relay-chain-interface = { version = "0.7.0" } -cumulus-relay-chain-minimal-node = { version = "0.7.0" } -cumulus-relay-chain-rpc-interface = { version = "0.7.0" } -frame-benchmarking-cli = { version = "32.0.0" } -node-inspect = { version = "0.12.0", package = "staging-node-inspect" } -pallet-transaction-payment-rpc = { version = "30.0.0" } -polkadot-cli = { version = "7.0.0" } -polkadot-service = { version = "7.0.0" } -sc-basic-authorship = { version = "0.34.0" } -sc-chain-spec = { version = "27.0.0" } -sc-cli = { version = "0.36.0" } -sc-client-api = { version = "28.0.0" } -sc-consensus = { version = "0.33.0" } -sc-consensus-aura = { version = "0.34.0" } -sc-consensus-grandpa = { version = "0.19.0" } -sc-consensus-manual-seal = { version = "0.35.0" } -sc-consensus-slots = { version = "0.33.0" } -sc-executor = { version = "0.32.0" } -sc-keystore = { version = "25.0.0" } -sc-network = { version = "0.34.0" } -sc-network-common = { version = "0.33.0" } -sc-network-sync = { version = "0.33.0" } -sc-offchain = { version = "29.0.0" } -sc-rpc = { version = "29.0.0" } -sc-rpc-api = { version = "0.33.0" } -sc-rpc-server = { version = "11.0.0" } -sc-service = { version = "0.35.0" } -sc-sysinfo = { version = "27.0.0" } -sc-telemetry = { version = "15.0.0" } -sc-tracing = { version = "28.0.0" } -sc-transaction-pool = { version = "28.0.0" } -sc-transaction-pool-api = { version = "28.0.0" } -sp-consensus-babe = { version = "0.32.0" } -sp-rpc = { version = "26.0.0" } +cumulus-client-cli = { version = "0.8.0" } +cumulus-client-consensus-aura = { version = "0.8.0" } +cumulus-client-consensus-common = { version = "0.8.0" } +cumulus-client-consensus-relay-chain = { version = "0.8.0" } +cumulus-client-network = { version = "0.8.0" } +cumulus-client-pov-recovery = { version = "0.8.0" } +cumulus-client-service = { version = "0.8.0" } +cumulus-relay-chain-inprocess-interface = { version = "0.8.0" } +cumulus-relay-chain-interface = { version = "0.8.0" } +cumulus-relay-chain-minimal-node = { version = "0.8.0" } +cumulus-relay-chain-rpc-interface = { version = "0.8.0" } +frame-benchmarking-cli = { version = "33.0.0" } +node-inspect = { version = "0.13.0", package = "staging-node-inspect" } +pallet-transaction-payment-rpc = { version = "31.0.0" } +polkadot-cli = { version = "8.0.0" } +polkadot-service = { version = "8.0.0" } +sc-basic-authorship = { version = "0.35.0" } +sc-chain-spec = { version = "28.0.0" } +sc-cli = { version = "0.37.0" } +sc-client-api = { version = "29.0.0" } +sc-consensus = { version = "0.34.0" } +sc-consensus-aura = { version = "0.35.0" } +sc-consensus-grandpa = { version = "0.20.0" } +sc-consensus-manual-seal = { version = "0.36.0" } +sc-consensus-slots = { version = "0.34.0" } +sc-executor = { version = "0.33.0" } +sc-keystore = { version = "26.0.0" } +sc-network = { version = "0.35.0" } +sc-network-common = { version = "0.34.0" } +sc-network-sync = { version = "0.34.0" } +sc-offchain = { version = "30.0.0" } +sc-rpc = { version = "30.0.0" } +sc-rpc-api = { version = "0.34.0" } +sc-rpc-server = { version = "12.0.0" } +sc-service = { version = "0.36.0" } +sc-sysinfo = { version = "28.0.0" } +sc-telemetry = { version = "16.0.0" } +sc-tracing = { version = "29.0.0" } +sc-transaction-pool = { version = "29.0.0" } +sc-transaction-pool-api = { version = "29.0.0" } +sp-consensus-babe = { version = "0.33.0" } +sp-rpc = { version = "27.0.0" } substrate-build-script-utils = { version = "11.0.0" } -substrate-frame-rpc-system = { version = "28.0.0" } +substrate-frame-rpc-system = { version = "29.0.0" } substrate-prometheus-endpoint = { version = "0.17.0" } -substrate-wasm-builder = { version = "17.0.0" } -try-runtime-cli = { version = "0.38.0" } -xcm-emulator = { version = "0.5.0" } -xcm-simulator = { version = "7.0.0" } +substrate-wasm-builder = { version = "18.0.0" } +try-runtime-cli = { version = "0.39.0" } +xcm-emulator = { version = "0.6.0" } +xcm-simulator = { version = "8.0.0" } # Other async-trait = { version = "0.1.76" } bstringify = { version = "0.1.2" } -clap = { version = "=4.4.14" } +clap = { version = "4.4.14" } env_logger = { version = "0.10.2" } ethabi = { version = "18.0.0", default-features = false } ethereum = { version = "0.14.0", default-features = false, features = ["with-codec"] } @@ -280,7 +280,7 @@ futures = { version = "0.3.30" } hex = { version = "0.4.3", default-features = false } hex-literal = { version = "0.4.1" } impl-trait-for-tuples = { version = "0.2.2" } -jsonrpsee = { version = "0.16.3" } +jsonrpsee = { version = "0.20.3" } log = { version = "0.4.21", default-features = false } num-bigint = { version = "0.4.3", default-features = false } num-traits = { version = "0.2.18", default-features = false } diff --git a/Makefile b/Makefile index e6bac077a..e7e8d7986 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ copy-genesis-config-release: .PHONY: format # cargo fmt format: - cargo +nightly fmt --all -- --check + cargo +nightly fmt --all .PHONY: clippy # cargo clippy clippy: diff --git a/pallets/asset-registry/src/benchmarking.rs b/pallets/asset-registry/src/benchmarking.rs index 468aa3af2..309065886 100644 --- a/pallets/asset-registry/src/benchmarking.rs +++ b/pallets/asset-registry/src/benchmarking.rs @@ -24,16 +24,15 @@ use bifrost_primitives::{CurrencyId, TokenSymbol}; use frame_benchmarking::{benchmarks, v1::BenchmarkError}; use frame_support::{assert_ok, traits::UnfilteredDispatchable}; use sp_runtime::traits::UniqueSaturatedFrom; -use xcm::v3::prelude::*; benchmarks! { register_native_asset { let origin = T::RegisterOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let v3_location = VersionedMultiLocation::V3(MultiLocation::from(X1(Junction::Parachain(1000)))); + let versioned_location = VersionedLocation::V4(Location::from([Parachain(1000)])); let call = Call::::register_native_asset { - currency_id: CurrencyId::Token(TokenSymbol::DOT), - location: Box::new(v3_location.clone()), + currency_id: Token(TokenSymbol::DOT), + location: Box::new(versioned_location.clone()), metadata: Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -44,7 +43,7 @@ benchmarks! { }: {call.dispatch_bypass_filter(origin)?} verify { assert_eq!( - AssetMetadatas::::get(AssetIds::NativeAssetId(CurrencyId::Token( + AssetMetadatas::::get(AssetIds::NativeAssetId(Token( TokenSymbol::DOT ))), Some(AssetMetadata { @@ -58,12 +57,12 @@ benchmarks! { update_native_asset { let origin = T::RegisterOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let v3_location = VersionedMultiLocation::V3(MultiLocation::from(X1(Junction::Parachain(1000)))); + let versioned_location = VersionedLocation::V4(Location::from([Parachain(1000)])); assert_ok!(AssetRegistry::::register_native_asset( origin.clone(), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(v3_location.clone()), + Token(TokenSymbol::DOT), + Box::new(versioned_location.clone()), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -73,8 +72,8 @@ benchmarks! { )); let call = Call::::update_native_asset { - currency_id: CurrencyId::Token(TokenSymbol::DOT), - location: Box::new(v3_location.clone()), + currency_id: Token(TokenSymbol::DOT), + location: Box::new(versioned_location.clone()), metadata: Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -85,7 +84,7 @@ benchmarks! { }: {call.dispatch_bypass_filter(origin)?} verify { assert_eq!( - AssetMetadatas::::get(AssetIds::NativeAssetId(CurrencyId::Token( + AssetMetadatas::::get(AssetIds::NativeAssetId(Token( TokenSymbol::DOT ))), Some(AssetMetadata { @@ -111,7 +110,7 @@ benchmarks! { }; }: {call.dispatch_bypass_filter(origin)?} verify { - assert_eq!(CurrencyMetadatas::::get(CurrencyId::Token2(0)), Some(metadata.clone())) + assert_eq!(CurrencyMetadatas::::get(Token2(0)), Some(metadata.clone())) } register_vtoken_metadata { @@ -208,7 +207,7 @@ benchmarks! { ) } - register_multilocation { + register_location { let origin = T::RegisterOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; let metadata = AssetMetadata { name: b"Bifrost Native Coin".to_vec(), @@ -216,38 +215,34 @@ benchmarks! { decimals: 12, minimal_balance: BalanceOf::::unique_saturated_from(0u128), }; - // v3 - let location = VersionedMultiLocation::V3(MultiLocation { - parents: 1, - interior: Junctions::X1(Parachain(2001)), - }); + let versioned_location = VersionedLocation::V4(Location::new(1, [Parachain(2001)])); - let multi_location: MultiLocation = location.clone().try_into().unwrap(); + let location: xcm::v3::Location = versioned_location.clone().try_into().unwrap(); assert_ok!(AssetRegistry::::register_token_metadata( origin.clone(), Box::new(metadata.clone()) )); - let call = Call::::register_multilocation { - currency_id: CurrencyId::Token2(0), - location:Box::new(location.clone()), + let call = Call::::register_location { + currency_id: Token2(0), + location:Box::new(versioned_location.clone()), weight:Weight::from_parts(2000_000_000, u64::MAX), }; }: {call.dispatch_bypass_filter(origin)?} verify { assert_eq!( - LocationToCurrencyIds::::get(multi_location.clone()), - Some(CurrencyId::Token2(0)) + LocationToCurrencyIds::::get(location.clone()), + Some(Token2(0)) ); assert_eq!( - CurrencyIdToLocations::::get(CurrencyId::Token2(0)), - Some(multi_location.clone()) + CurrencyIdToLocations::::get(Token2(0)), + Some(location.clone()) ); - assert_eq!(CurrencyIdToWeights::::get(CurrencyId::Token2(0)), Some(Weight::from_parts(2000_000_000, u64::MAX))); + assert_eq!(CurrencyIdToWeights::::get(Token2(0)), Some(Weight::from_parts(2000_000_000, u64::MAX))); } - force_set_multilocation { + force_set_location { let origin = T::RegisterOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; let metadata = AssetMetadata { name: b"Bifrost Native Coin".to_vec(), @@ -255,22 +250,18 @@ benchmarks! { decimals: 12, minimal_balance: BalanceOf::::unique_saturated_from(0u128), }; - // v3 - let location = VersionedMultiLocation::V3(MultiLocation { - parents: 1, - interior: Junctions::X1(Parachain(2001)), - }); + let versioned_location = VersionedLocation::V4(Location::new(1, [Parachain(2001)])); - let multi_location: MultiLocation = location.clone().try_into().unwrap(); + let location: xcm::v3::Location = versioned_location.clone().try_into().unwrap(); assert_ok!(AssetRegistry::::register_token_metadata( origin.clone(), Box::new(metadata.clone()) )); - let call = Call::::force_set_multilocation { - currency_id: CurrencyId::Token2(0), - location:Box::new(location.clone()), + let call = Call::::force_set_location { + currency_id: Token2(0), + location:Box::new(versioned_location.clone()), weight:Weight::from_parts(2000_000_000, u64::MAX), }; }: {call.dispatch_bypass_filter(origin)?} diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index c41a12286..b7bab37f0 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -22,7 +22,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use bifrost_primitives::{ +pub use bifrost_primitives::{ AssetIds, CurrencyId, CurrencyId::{Native, Token, Token2}, CurrencyIdConversion, CurrencyIdMapping, CurrencyIdRegister, ForeignAssetId, LeasePeriod, @@ -43,15 +43,13 @@ use sp_runtime::{ }; use sp_std::{boxed::Box, vec::Vec}; use xcm::{ - opaque::{ - lts::XcmContext, - v3::{prelude::XcmError, AssetId, Fungibility::Fungible, MultiAsset}, - }, + opaque::lts::XcmContext, v3::MultiLocation, - VersionedMultiLocation, + v4::{prelude::*, Asset, Location}, + VersionedLocation, }; use xcm_builder::TakeRevenue; -use xcm_executor::{traits::WeightTrader, Assets}; +use xcm_executor::{traits::WeightTrader, AssetsInHolding}; pub mod migration; mod mock; @@ -100,8 +98,8 @@ pub mod pallet { /// The given location could not be used (e.g. because it cannot be expressed in the /// desired version of XCM). BadLocation, - /// MultiLocation existed - MultiLocationExisted, + /// Location existed + LocationExisted, /// AssetId not exists AssetIdNotExists, /// AssetId exists @@ -121,10 +119,10 @@ pub mod pallet { AssetUpdated { asset_id: AssetIds, metadata: AssetMetadata> }, /// The CurrencyId registered. CurrencyIdRegistered { currency_id: CurrencyId, metadata: AssetMetadata> }, + /// Location Force set. + LocationSet { currency_id: CurrencyId, location: Location, weight: Weight }, /// The CurrencyId updated. CurrencyIdUpdated { currency_id: CurrencyId, metadata: AssetMetadata> }, - /// MultiLocation Force set. - MultiLocationSet { currency_id: CurrencyId, location: MultiLocation, weight: Weight }, } /// Next available Foreign AssetId ID. @@ -141,21 +139,21 @@ pub mod pallet { #[pallet::getter(fn next_token_id)] pub type NextTokenId = StorageValue<_, TokenId, ValueQuery>; - /// The storages for MultiLocations. + /// The storages for Locations. /// - /// CurrencyIdToLocations: map CurrencyId => Option + /// CurrencyIdToLocations: map CurrencyId => Option #[pallet::storage] #[pallet::getter(fn currency_id_to_locations)] pub type CurrencyIdToLocations = - StorageMap<_, Twox64Concat, CurrencyId, MultiLocation, OptionQuery>; + StorageMap<_, Twox64Concat, CurrencyId, xcm::v3::Location, OptionQuery>; /// The storages for CurrencyIds. /// - /// LocationToCurrencyIds: map MultiLocation => Option + /// LocationToCurrencyIds: map Location => Option #[pallet::storage] #[pallet::getter(fn location_to_currency_ids)] pub type LocationToCurrencyIds = - StorageMap<_, Twox64Concat, MultiLocation, CurrencyId, OptionQuery>; + StorageMap<_, Twox64Concat, xcm::v3::Location, CurrencyId, OptionQuery>; #[pallet::storage] #[pallet::getter(fn currency_id_to_weight)] @@ -281,12 +279,12 @@ pub mod pallet { pub fn register_native_asset( origin: OriginFor, currency_id: CurrencyId, - location: Box, + location: Box, metadata: Box>>, ) -> DispatchResult { T::RegisterOrigin::ensure_origin(origin)?; - let location: MultiLocation = + let location: Location = (*location).try_into().map_err(|()| Error::::BadLocation)?; Self::do_register_native_asset(currency_id, &location, &metadata)?; @@ -302,12 +300,12 @@ pub mod pallet { pub fn update_native_asset( origin: OriginFor, currency_id: CurrencyId, - location: Box, + location: Box, metadata: Box>>, ) -> DispatchResult { T::RegisterOrigin::ensure_origin(origin)?; - let location: MultiLocation = + let location: Location = (*location).try_into().map_err(|()| Error::::BadLocation)?; Self::do_update_native_asset(currency_id, &location, &metadata)?; @@ -327,7 +325,7 @@ pub mod pallet { T::RegisterOrigin::ensure_origin(origin)?; let token_id = Self::get_next_token_id()?; - let currency_id = CurrencyId::Token2(token_id); + let currency_id = Token2(token_id); Self::do_register_metadata(currency_id, &metadata)?; Ok(()) @@ -338,8 +336,7 @@ pub mod pallet { pub fn register_vtoken_metadata(origin: OriginFor, token_id: TokenId) -> DispatchResult { T::RegisterOrigin::ensure_origin(origin)?; - if let Some(token_metadata) = CurrencyMetadatas::::get(CurrencyId::Token2(token_id)) - { + if let Some(token_metadata) = CurrencyMetadatas::::get(Token2(token_id)) { let vtoken_metadata = Self::convert_to_vtoken_metadata(token_metadata); Self::do_register_metadata(CurrencyId::VToken2(token_id), &vtoken_metadata)?; @@ -399,50 +396,49 @@ pub mod pallet { } #[pallet::call_index(6)] - #[pallet::weight(T::WeightInfo::register_multilocation())] - pub fn register_multilocation( + #[pallet::weight(T::WeightInfo::register_location())] + pub fn register_location( origin: OriginFor, currency_id: CurrencyId, - location: Box, + location: Box, weight: Weight, ) -> DispatchResult { T::RegisterOrigin::ensure_origin(origin)?; - let location: MultiLocation = + let location: Location = (*location).try_into().map_err(|()| Error::::BadLocation)?; - Self::do_register_multilocation(currency_id, &location)?; + Self::do_register_location(currency_id, &location)?; Self::do_register_weight(currency_id, weight)?; Ok(()) } #[pallet::call_index(7)] - #[pallet::weight(T::WeightInfo::force_set_multilocation())] - pub fn force_set_multilocation( + #[pallet::weight(T::WeightInfo::force_set_location())] + pub fn force_set_location( origin: OriginFor, currency_id: CurrencyId, - location: Box, + location: Box, weight: Weight, ) -> DispatchResult { T::RegisterOrigin::ensure_origin(origin)?; - let location: MultiLocation = + let location: Location = (*location).try_into().map_err(|()| Error::::BadLocation)?; + let v3_location = xcm::v3::Location::try_from(location.clone()) + .map_err(|()| Error::::BadLocation)?; + ensure!( CurrencyMetadatas::::get(currency_id).is_some(), Error::::CurrencyIdNotExists ); - LocationToCurrencyIds::::insert(location, currency_id); - CurrencyIdToLocations::::insert(currency_id, location); + LocationToCurrencyIds::::insert(v3_location, currency_id); + CurrencyIdToLocations::::insert(currency_id, v3_location); CurrencyIdToWeights::::insert(currency_id, weight); - Pallet::::deposit_event(Event::::MultiLocationSet { - currency_id, - location, - weight, - }); + Pallet::::deposit_event(Event::::LocationSet { currency_id, location, weight }); Ok(()) } @@ -497,21 +493,24 @@ impl Pallet { pub fn do_register_native_asset( currency_id: CurrencyId, - location: &MultiLocation, + location: &Location, metadata: &AssetMetadata>, ) -> DispatchResult { - ensure!(LocationToCurrencyIds::::get(location).is_none(), Error::::AssetIdExisted); + let v3_location = + xcm::v3::Location::try_from(location.clone()).map_err(|()| Error::::BadLocation)?; + + ensure!(LocationToCurrencyIds::::get(v3_location).is_none(), Error::::AssetIdExisted); ensure!( CurrencyIdToLocations::::get(currency_id).is_none(), - Error::::MultiLocationExisted + Error::::LocationExisted ); ensure!( AssetMetadatas::::get(AssetIds::NativeAssetId(currency_id)).is_none(), Error::::AssetIdExisted ); - LocationToCurrencyIds::::insert(location, currency_id); - CurrencyIdToLocations::::insert(currency_id, location); + LocationToCurrencyIds::::insert(v3_location, currency_id); + CurrencyIdToLocations::::insert(currency_id, v3_location); AssetMetadatas::::insert(AssetIds::NativeAssetId(currency_id), metadata); Ok(()) @@ -571,30 +570,29 @@ impl Pallet { Ok(()) } - pub fn do_register_multilocation( - currency_id: CurrencyId, - location: &MultiLocation, - ) -> DispatchResult { + pub fn do_register_location(currency_id: CurrencyId, location: &Location) -> DispatchResult { + let v3_location = + xcm::v3::Location::try_from(location.clone()).map_err(|()| Error::::BadLocation)?; + ensure!( CurrencyMetadatas::::get(currency_id).is_some(), Error::::CurrencyIdNotExists ); - ensure!(LocationToCurrencyIds::::get(location).is_none(), Error::::CurrencyIdExisted); + ensure!( + LocationToCurrencyIds::::get(v3_location).is_none(), + Error::::CurrencyIdExisted + ); ensure!( CurrencyIdToLocations::::get(currency_id).is_none(), - Error::::MultiLocationExisted + Error::::LocationExisted ); - LocationToCurrencyIds::::insert(location, currency_id); - CurrencyIdToLocations::::insert(currency_id, location); + LocationToCurrencyIds::::insert(v3_location, currency_id); + CurrencyIdToLocations::::insert(currency_id, v3_location); Ok(()) } - pub fn do_remove_multilocation(location: &MultiLocation) { - LocationToCurrencyIds::::remove(location); - } - pub fn do_register_weight(currency_id: CurrencyId, weight: Weight) -> DispatchResult { ensure!( CurrencyMetadatas::::get(currency_id).is_some(), @@ -608,21 +606,27 @@ impl Pallet { fn do_update_native_asset( currency_id: CurrencyId, - location: &MultiLocation, + location: &Location, metadata: &AssetMetadata>, ) -> DispatchResult { - ensure!(LocationToCurrencyIds::::get(location).is_some(), Error::::AssetIdNotExists); + let v3_location = + xcm::v3::Location::try_from(location.clone()).map_err(|()| Error::::BadLocation)?; + + ensure!( + LocationToCurrencyIds::::get(v3_location).is_some(), + Error::::AssetIdNotExists + ); ensure!( CurrencyIdToLocations::::get(currency_id).is_some(), - Error::::MultiLocationExisted + Error::::LocationExisted ); ensure!( AssetMetadatas::::get(AssetIds::NativeAssetId(currency_id)).is_some(), Error::::AssetIdNotExists ); - LocationToCurrencyIds::::insert(location, currency_id); - CurrencyIdToLocations::::insert(currency_id, location); + LocationToCurrencyIds::::insert(v3_location, currency_id); + CurrencyIdToLocations::::insert(currency_id, v3_location); AssetMetadatas::::insert(AssetIds::NativeAssetId(currency_id), metadata); Ok(()) @@ -646,12 +650,14 @@ impl CurrencyIdMapping::iter_keys().collect() } - fn get_multi_location(currency_id: CurrencyId) -> Option { + fn get_location(currency_id: CurrencyId) -> Option { Pallet::::currency_id_to_locations(currency_id) + .map(|location| location.try_into().ok())? } - fn get_currency_id(multi_location: MultiLocation) -> Option { - Pallet::::location_to_currency_ids(multi_location) + fn get_currency_id(multi_location: Location) -> Option { + let v3_location = xcm::v3::Location::try_from(multi_location).ok()?; + Pallet::::location_to_currency_ids(v3_location) } } @@ -896,7 +902,7 @@ pub struct FixedRateOfAsset, R: TakeRevenue> { weight: u64, amount: u128, ed_ratio: FixedU128, - multi_location: Option, + location: Option, _marker: PhantomData<(T, FixedRate, R)>, } @@ -910,7 +916,7 @@ where weight: 0, amount: 0, ed_ratio: Default::default(), - multi_location: None, + location: None, _marker: PhantomData, } } @@ -918,9 +924,9 @@ where fn buy_weight( &mut self, weight: Weight, - payment: Assets, + payment: AssetsInHolding, _context: &XcmContext, - ) -> Result { + ) -> Result { log::trace!(target: "asset-registry::weight", "buy_weight weight: {:?}, payment: {:?}", weight, payment); // only support first fungible assets now. @@ -930,51 +936,51 @@ where .next() .map_or(Err(XcmError::TooExpensive), |v| Ok(v.0))?; - if let AssetId::Concrete(ref multi_location) = asset_id { - log::debug!(target: "asset-registry::weight", "buy_weight multi_location: {:?}", multi_location); - - if let Some(currency_id) = Pallet::::location_to_currency_ids(multi_location) { - if let Some(currency_metadatas) = Pallet::::currency_metadatas(currency_id) { - // The integration tests can ensure the ed is non-zero. - let ed_ratio = FixedU128::saturating_from_rational( - currency_metadatas.minimal_balance.into(), - T::Currency::minimum_balance().into(), - ); - // The WEIGHT_REF_TIME_PER_SECOND is non-zero. - let weight_ratio = FixedU128::saturating_from_rational( - weight.ref_time(), - WEIGHT_REF_TIME_PER_SECOND, - ); - let amount = ed_ratio - .saturating_mul_int(weight_ratio.saturating_mul_int(FixedRate::get())); - - let required = MultiAsset { id: *asset_id, fun: Fungible(amount) }; - - log::trace!( - target: "asset-registry::weight", "buy_weight payment: {:?}, required: {:?}, fixed_rate: {:?}, ed_ratio: {:?}, weight_ratio: {:?}", - payment, required, FixedRate::get(), ed_ratio, weight_ratio - ); - let unused = payment - .clone() - .checked_sub(required) - .map_err(|_| XcmError::TooExpensive)?; - self.weight = self.weight.saturating_add(weight.ref_time()); - self.amount = self.amount.saturating_add(amount); - self.ed_ratio = ed_ratio; - self.multi_location = Some(*multi_location); - return Ok(unused); - } + let AssetId(ref location) = asset_id.clone(); + log::debug!(target: "asset-registry::weight", "buy_weight location: {:?}", location); + + let v3_location = + xcm::v3::Location::try_from(location.clone()).map_err(|_| XcmError::InvalidLocation)?; + + if let Some(currency_id) = Pallet::::location_to_currency_ids(v3_location) { + if let Some(currency_metadatas) = Pallet::::currency_metadatas(currency_id) { + // The integration tests can ensure the ed is non-zero. + let ed_ratio = FixedU128::saturating_from_rational( + currency_metadatas.minimal_balance.into(), + T::Currency::minimum_balance().into(), + ); + // The WEIGHT_REF_TIME_PER_SECOND is non-zero. + let weight_ratio = FixedU128::saturating_from_rational( + weight.ref_time(), + WEIGHT_REF_TIME_PER_SECOND, + ); + let amount = + ed_ratio.saturating_mul_int(weight_ratio.saturating_mul_int(FixedRate::get())); + + let required = Asset { id: asset_id.clone(), fun: Fungible(amount) }; + + log::trace!( + target: "asset-registry::weight", "buy_weight payment: {:?}, required: {:?}, fixed_rate: {:?}, ed_ratio: {:?}, weight_ratio: {:?}", + payment, required, FixedRate::get(), ed_ratio, weight_ratio + ); + let unused = + payment.clone().checked_sub(required).map_err(|_| XcmError::TooExpensive)?; + self.weight = self.weight.saturating_add(weight.ref_time()); + self.amount = self.amount.saturating_add(amount); + self.ed_ratio = ed_ratio; + self.location = Some(location.clone()); + return Ok(unused); } - } + }; log::trace!(target: "asset-registry::weight", "no concrete fungible asset"); Err(XcmError::TooExpensive) } - fn refund_weight(&mut self, weight: Weight, _context: &XcmContext) -> 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 + target: "asset-registry::weight", "refund_weight weight: {:?}, weight: {:?}, amount: {:?}, ed_ratio: {:?}, location: {:?}", + weight, self.weight, self.amount, self.ed_ratio, self.location ); let weight = weight.min(Weight::from_parts(self.weight, 0)); let weight_ratio = @@ -987,8 +993,13 @@ where self.amount = self.amount.saturating_sub(amount); log::trace!(target: "asset-registry::weight", "refund_weight amount: {:?}", amount); - if amount > 0 && self.multi_location.is_some() { - Some((*self.multi_location.as_ref().expect("checked is non-empty; qed"), amount).into()) + if amount > 0 && self.location.is_some() { + Some(Asset { + fun: Fungible(amount), + id: AssetId( + self.location.clone().expect("checked is non-empty; qed").try_into().unwrap(), + ), + }) } else { None } @@ -997,12 +1008,14 @@ where impl, R: TakeRevenue> Drop for FixedRateOfAsset { fn drop(&mut self) { - log::trace!(target: "asset-registry::weight", "take revenue, weight: {:?}, amount: {:?}, multi_location: {:?}", self.weight, self.amount, self.multi_location); - if self.amount > 0 && self.multi_location.is_some() { - R::take_revenue( - (*self.multi_location.as_ref().expect("checked is non-empty; qed"), self.amount) - .into(), - ); + log::trace!(target: "asset-registry::weight", "take revenue, weight: {:?}, amount: {:?}, location: {:?}", self.weight, self.amount, self.location); + if self.amount > 0 && self.location.is_some() { + R::take_revenue(Asset { + fun: Fungible(self.amount), + id: AssetId( + self.location.clone().expect("checked is non-empty; qed").try_into().unwrap(), + ), + }); } } } diff --git a/pallets/asset-registry/src/migration.rs b/pallets/asset-registry/src/migration.rs index 21937d0b7..9e9a21b9d 100644 --- a/pallets/asset-registry/src/migration.rs +++ b/pallets/asset-registry/src/migration.rs @@ -21,7 +21,7 @@ use bifrost_primitives::{CurrencyId, BNC}; use frame_support::traits::{Get, OnRuntimeUpgrade}; #[cfg(feature = "try-runtime")] use sp_runtime::TryRuntimeError; -use xcm::prelude::{GeneralKey, X1}; +use xcm::v3::prelude::{GeneralKey, X1}; const LOG_TARGET: &str = "asset-registry::migration"; @@ -42,7 +42,7 @@ pub fn update_blp_metadata(pool_count: u32) -> Weight { T::DbWeight::get().reads(pool_count.into()) + T::DbWeight::get().writes(pool_count.into()) } -const BNC_LOCATION: MultiLocation = MultiLocation { +const BNC_LOCATION: xcm::v3::Location = xcm::v3::Location { parents: 0, interior: X1(GeneralKey { length: 2, diff --git a/pallets/asset-registry/src/mock.rs b/pallets/asset-registry/src/mock.rs index 349037759..a948e290c 100644 --- a/pallets/asset-registry/src/mock.rs +++ b/pallets/asset-registry/src/mock.rs @@ -59,7 +59,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/pallets/asset-registry/src/tests.rs b/pallets/asset-registry/src/tests.rs index d35dcf8a7..470a22438 100644 --- a/pallets/asset-registry/src/tests.rs +++ b/pallets/asset-registry/src/tests.rs @@ -26,49 +26,25 @@ use frame_support::{assert_noop, assert_ok}; use mock::{ AssetRegistry, CouncilAccount, ExtBuilder, Runtime, RuntimeEvent, RuntimeOrigin, System, }; -use xcm::prelude::*; #[test] fn versioned_multi_location_convert_work() { ExtBuilder::default().build().execute_with(|| { - // V3 - let v3_location = - VersionedMultiLocation::V3(MultiLocation::from(X1(Junction::Parachain(1000)))); - let location: MultiLocation = v3_location.try_into().unwrap(); - assert_eq!( - location, - MultiLocation { parents: 0, interior: Junctions::X1(Junction::Parachain(1000)) } - ); - - // V3 - let v3_location = VersionedMultiLocation::V3(MultiLocation { - parents: 0, - interior: Junctions::X1(Junction::Parachain(1000)), - }); - let location: MultiLocation = v3_location.clone().try_into().unwrap(); - assert_eq!( - location, - MultiLocation { parents: 0, interior: Junctions::X1(Junction::Parachain(1000)) } - ); - - // handle all of VersionedMultiLocation - assert!(match v3_location { - VersionedMultiLocation::V3 { .. } => true, - _ => false, - }); + let versioned_location = VersionedLocation::V4(Location::from([Parachain(1000)])); + let location: Location = versioned_location.try_into().unwrap(); + assert_eq!(location, Location::new(0, [Parachain(1000)])); }); } #[test] fn register_native_asset_works() { ExtBuilder::default().build().execute_with(|| { - let v3_location = - VersionedMultiLocation::V3(MultiLocation::from(X1(Junction::Parachain(1000)))); + let versioned_location = VersionedLocation::V4(Location::from([Parachain(1000)])); assert_ok!(AssetRegistry::register_native_asset( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(v3_location.clone()), + Token(TokenSymbol::DOT), + Box::new(versioned_location.clone()), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -76,8 +52,8 @@ fn register_native_asset_works() { minimal_balance: 1, }) )); - System::assert_last_event(RuntimeEvent::AssetRegistry(crate::Event::AssetRegistered { - asset_id: AssetIds::NativeAssetId(CurrencyId::Token(TokenSymbol::DOT)), + System::assert_last_event(RuntimeEvent::AssetRegistry(Event::AssetRegistered { + asset_id: AssetIds::NativeAssetId(Token(TokenSymbol::DOT)), metadata: AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -87,9 +63,7 @@ fn register_native_asset_works() { })); assert_eq!( - AssetMetadatas::::get(AssetIds::NativeAssetId(CurrencyId::Token( - TokenSymbol::DOT - ))), + AssetMetadatas::::get(AssetIds::NativeAssetId(Token(TokenSymbol::DOT))), Some(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -101,8 +75,8 @@ fn register_native_asset_works() { assert_noop!( AssetRegistry::register_native_asset( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(v3_location), + Token(TokenSymbol::DOT), + Box::new(versioned_location), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -117,15 +91,14 @@ fn register_native_asset_works() { #[test] fn update_native_asset_works() { - let v3_location = - VersionedMultiLocation::V3(MultiLocation::from(X1(Junction::Parachain(1000)))); + let versioned_location = VersionedLocation::V4(Location::from([Parachain(1000)])); ExtBuilder::default().build().execute_with(|| { assert_noop!( AssetRegistry::update_native_asset( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(v3_location.clone()), + Token(TokenSymbol::DOT), + Box::new(versioned_location.clone()), Box::new(AssetMetadata { name: b"New Token Name".to_vec(), symbol: b"NTN".to_vec(), @@ -138,8 +111,8 @@ fn update_native_asset_works() { assert_ok!(AssetRegistry::register_native_asset( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(v3_location.clone()), + Token(TokenSymbol::DOT), + Box::new(versioned_location.clone()), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -150,8 +123,8 @@ fn update_native_asset_works() { assert_ok!(AssetRegistry::update_native_asset( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token(TokenSymbol::DOT), - Box::new(v3_location.clone()), + Token(TokenSymbol::DOT), + Box::new(versioned_location.clone()), Box::new(AssetMetadata { name: b"New Token Name".to_vec(), symbol: b"NTN".to_vec(), @@ -160,8 +133,8 @@ fn update_native_asset_works() { }) )); - System::assert_last_event(RuntimeEvent::AssetRegistry(crate::Event::AssetUpdated { - asset_id: AssetIds::NativeAssetId(CurrencyId::Token(TokenSymbol::DOT)), + System::assert_last_event(RuntimeEvent::AssetRegistry(Event::AssetUpdated { + asset_id: AssetIds::NativeAssetId(Token(TokenSymbol::DOT)), metadata: AssetMetadata { name: b"New Token Name".to_vec(), symbol: b"NTN".to_vec(), @@ -171,9 +144,7 @@ fn update_native_asset_works() { })); assert_eq!( - AssetMetadatas::::get(AssetIds::NativeAssetId(CurrencyId::Token( - TokenSymbol::DOT - ))), + AssetMetadatas::::get(AssetIds::NativeAssetId(Token(TokenSymbol::DOT))), Some(AssetMetadata { name: b"New Token Name".to_vec(), symbol: b"NTN".to_vec(), @@ -199,7 +170,7 @@ fn register_token_metadata_should_work() { Box::new(metadata.clone()) )); - assert_eq!(CurrencyMetadatas::::get(CurrencyId::Token2(0)), Some(metadata.clone())) + assert_eq!(CurrencyMetadatas::::get(Token2(0)), Some(metadata.clone())) }) } @@ -332,18 +303,15 @@ fn register_multilocation_should_work() { decimals: 12, minimal_balance: 0, }; - // V3 - let location = VersionedMultiLocation::V3(MultiLocation { - parents: 1, - interior: Junctions::X1(Junction::Parachain(2001)), - }); - let multi_location: MultiLocation = location.clone().try_into().unwrap(); + + let versioned_location = VersionedLocation::V4(Location::new(1, [Parachain(2001)])); + let location: xcm::v3::Location = versioned_location.clone().try_into().unwrap(); assert_noop!( - AssetRegistry::register_multilocation( + AssetRegistry::register_location( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token2(0), - Box::new(location.clone()), + Token2(0), + Box::new(versioned_location.clone()), Weight::from_parts(2000_000_000, 0) ), Error::::CurrencyIdNotExists @@ -354,33 +322,27 @@ fn register_multilocation_should_work() { Box::new(metadata.clone()) )); - assert_ok!(AssetRegistry::register_multilocation( + assert_ok!(AssetRegistry::register_location( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token2(0), - Box::new(location.clone()), + Token2(0), + Box::new(versioned_location.clone()), Weight::from_parts(2000_000_000, 0) )); assert_noop!( - AssetRegistry::register_multilocation( + AssetRegistry::register_location( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token2(0), - Box::new(location.clone()), + Token2(0), + Box::new(versioned_location.clone()), Weight::from_parts(2000_000_000, 0) ), Error::::CurrencyIdExisted ); + assert_eq!(LocationToCurrencyIds::::get(location), Some(Token2(0))); + assert_eq!(CurrencyIdToLocations::::get(Token2(0)), Some(location)); 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)), + CurrencyIdToWeights::::get(Token2(0)), Some(Weight::from_parts(2000_000_000, 0)) ); }) @@ -395,18 +357,14 @@ fn force_set_multilocation_should_work() { decimals: 12, minimal_balance: 0, }; - // V3 - let location = VersionedMultiLocation::V3(MultiLocation { - parents: 1, - interior: Junctions::X1(Junction::Parachain(2001)), - }); - let multi_location: MultiLocation = location.clone().try_into().unwrap(); + let versioned_location = VersionedLocation::V4(Location::new(1, [Parachain(2001)])); + let location: xcm::v3::Location = versioned_location.clone().try_into().unwrap(); assert_noop!( - AssetRegistry::force_set_multilocation( + AssetRegistry::force_set_location( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token2(0), - Box::new(location.clone()), + Token2(0), + Box::new(versioned_location.clone()), Weight::from_parts(2000_000_000, 0) ), Error::::CurrencyIdNotExists @@ -417,30 +375,24 @@ fn force_set_multilocation_should_work() { Box::new(metadata.clone()) )); - assert_ok!(AssetRegistry::force_set_multilocation( + assert_ok!(AssetRegistry::force_set_location( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token2(0), - Box::new(location.clone()), + Token2(0), + Box::new(versioned_location.clone()), Weight::from_parts(2000_000_000, 0) )); - assert_ok!(AssetRegistry::force_set_multilocation( + assert_ok!(AssetRegistry::force_set_location( RuntimeOrigin::signed(CouncilAccount::get()), - CurrencyId::Token2(0), - Box::new(location.clone()), + Token2(0), + Box::new(versioned_location.clone()), Weight::from_parts(2000_000_000, 0) )); + assert_eq!(LocationToCurrencyIds::::get(location), Some(Token2(0))); + assert_eq!(CurrencyIdToLocations::::get(Token2(0)), Some(location)); 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)), + CurrencyIdToWeights::::get(Token2(0)), Some(Weight::from_parts(2000_000_000, 0)) ); }) diff --git a/pallets/asset-registry/src/weights.rs b/pallets/asset-registry/src/weights.rs index 7f63d304b..162c6fad6 100644 --- a/pallets/asset-registry/src/weights.rs +++ b/pallets/asset-registry/src/weights.rs @@ -59,8 +59,8 @@ pub trait WeightInfo { fn register_vtoken_metadata() -> Weight; fn register_vstoken_metadata() -> Weight; fn register_vsbond_metadata() -> Weight; - fn register_multilocation() -> Weight; - fn force_set_multilocation() -> Weight; + fn register_location() -> Weight; + fn force_set_location() -> Weight; fn update_currency_metadata() -> Weight; } @@ -150,7 +150,7 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) /// Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) /// Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) - fn register_multilocation() -> Weight { + fn register_location() -> Weight { // Proof Size summary in bytes: // Measured: `683` // Estimated: `4148` @@ -167,7 +167,7 @@ impl WeightInfo for () { /// Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) /// Storage: AssetRegistry CurrencyIdToLocations (r:0 w:1) /// Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) - fn force_set_multilocation() -> Weight { + fn force_set_location() -> Weight { // Proof Size summary in bytes: // Measured: `683` // Estimated: `4148` diff --git a/pallets/buy-back/src/mock.rs b/pallets/buy-back/src/mock.rs index 589995877..bfff6fa69 100644 --- a/pallets/buy-back/src/mock.rs +++ b/pallets/buy-back/src/mock.rs @@ -36,16 +36,13 @@ use frame_support::{ use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; -use parity_scale_codec::{Decode, Encode}; -use sp_core::{hashing::blake2_256, ConstU32}; +use sp_core::ConstU32; use sp_runtime::{ - traits::{ - AccountIdConversion, Convert, IdentityLookup, TrailingZeroInput, UniqueSaturatedInto, - }, + traits::{AccountIdConversion, IdentityLookup, UniqueSaturatedInto}, AccountId32, BuildStorage, SaturatedConversion, }; use sp_std::marker::PhantomData; -use xcm::{prelude::*, v3::Weight}; +use xcm::{v3::Weight, v4::prelude::*}; use xcm_builder::{FixedWeightBounds, FrameTransactionalProcessor}; use xcm_executor::XcmExecutor; use zenlink_protocol::{ @@ -136,7 +133,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -195,48 +191,6 @@ impl Get for ParaInfo { } } -pub struct SubAccountIndexMultiLocationConvertor; -impl Convert<(u16, CurrencyId), MultiLocation> for SubAccountIndexMultiLocationConvertor { - fn convert((sub_account_index, currency_id): (u16, CurrencyId)) -> MultiLocation { - match currency_id { - CurrencyId::Token(TokenSymbol::MOVR) => MultiLocation::new( - 1, - X2( - Parachain(2023), - AccountKey20 { - network: None, - key: Slp::derivative_account_id_20( - hex!["7369626cd1070000000000000000000000000000"].into(), - sub_account_index, - ) - .into(), - }, - ), - ), - _ => MultiLocation::new( - 1, - X1(Junction::AccountId32 { - network: None, - id: Self::derivative_account_id( - ParaId::from(2001u32).into_account_truncating(), - sub_account_index, - ) - .into(), - }), - ), - } - } -} - -// Mock Utility::derivative_account_id function. -impl SubAccountIndexMultiLocationConvertor { - pub fn derivative_account_id(who: AccountId, index: u16) -> AccountId { - let entropy = (b"modlpy/utilisuba", who, index).using_encoded(blake2_256); - Decode::decode(&mut TrailingZeroInput::new(entropy.as_ref())) - .expect("infinite length input; no invalid inputs for type; qed") - } -} - pub struct ParachainId; impl Get for ParachainId { fn get() -> ParaId { @@ -251,12 +205,12 @@ parameter_types! { } pub struct SubstrateResponseManager; -impl QueryResponseManager for SubstrateResponseManager { +impl QueryResponseManager for SubstrateResponseManager { fn get_query_response_record(_query_id: QueryId) -> bool { Default::default() } fn create_query_record( - _responder: &MultiLocation, + _responder: Location, _call_back: Option, _timeout: u64, ) -> u64 { @@ -283,7 +237,7 @@ impl bifrost_slp::Config for Runtime { type WeightInfo = (); type VtokenMinting = VtokenMinting; type BifrostSlpx = SlpxInterface; - type AccountConverter = SubAccountIndexMultiLocationConvertor; + type AccountConverter = (); type ParachainId = ParachainId; type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; @@ -300,13 +254,13 @@ impl bifrost_slp::Config for Runtime { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: Location = Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } @@ -316,7 +270,7 @@ impl orml_xtokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = (); - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -324,8 +278,10 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } parameter_types! { @@ -449,7 +405,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -483,7 +439,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { diff --git a/pallets/call-switchgear/src/mock.rs b/pallets/call-switchgear/src/mock.rs index d93dde0f4..f75e1e5d8 100644 --- a/pallets/call-switchgear/src/mock.rs +++ b/pallets/call-switchgear/src/mock.rs @@ -61,7 +61,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/pallets/channel-commission/src/mock.rs b/pallets/channel-commission/src/mock.rs index 29e7b2ec5..69ef466b2 100644 --- a/pallets/channel-commission/src/mock.rs +++ b/pallets/channel-commission/src/mock.rs @@ -96,7 +96,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/pallets/clouds-convert/src/mock.rs b/pallets/clouds-convert/src/mock.rs index b1062a5fa..cf44d4be6 100644 --- a/pallets/clouds-convert/src/mock.rs +++ b/pallets/clouds-convert/src/mock.rs @@ -120,7 +120,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/pallets/cross-in-out/src/mock.rs b/pallets/cross-in-out/src/mock.rs index 4b5623f3c..527975bec 100644 --- a/pallets/cross-in-out/src/mock.rs +++ b/pallets/cross-in-out/src/mock.rs @@ -95,7 +95,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/pallets/currencies/src/mock.rs b/pallets/currencies/src/mock.rs index a4520ea5b..66005251b 100644 --- a/pallets/currencies/src/mock.rs +++ b/pallets/currencies/src/mock.rs @@ -42,7 +42,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = ReserveIdentifier; type WeightInfo = (); type FreezeIdentifier = [u8; 8]; - type MaxHolds = (); type MaxFreezes = (); type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; diff --git a/pallets/farming/rpc/src/lib.rs b/pallets/farming/rpc/src/lib.rs index 5a02dbbb4..9a926babd 100644 --- a/pallets/farming/rpc/src/lib.rs +++ b/pallets/farming/rpc/src/lib.rs @@ -23,7 +23,7 @@ use bifrost_primitives::Balance; use jsonrpsee::{ core::{async_trait, RpcResult}, proc_macros::rpc, - types::error::{CallError, ErrorCode, ErrorObject}, + types::error::{ErrorCode, ErrorObject}, }; use parity_scale_codec::Codec; use sp_api::ProvideRuntimeApi; @@ -92,13 +92,12 @@ where .into_iter() .map(|(token, amount)| (token, NumberOrHex::Hex(amount.into()))) .collect()), - Err(e) => Err(CallError::Custom(ErrorObject::owned( + Err(e) => Err(ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get farming rewards.", Some(format!("{:?}", e)), - ))), + )), } - .map_err(|e| jsonrpsee::core::Error::Call(e)) } fn get_gauge_rewards( @@ -117,12 +116,11 @@ where .into_iter() .map(|(token, amount)| (token, NumberOrHex::Hex(amount.into()))) .collect()), - Err(e) => Err(CallError::Custom(ErrorObject::owned( + Err(e) => Err(ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get gauge rewards.", Some(format!("{:?}", e)), - ))), + )), } - .map_err(|e| jsonrpsee::core::Error::Call(e)) } } diff --git a/pallets/farming/src/mock.rs b/pallets/farming/src/mock.rs index 969ff2ec3..899a71430 100644 --- a/pallets/farming/src/mock.rs +++ b/pallets/farming/src/mock.rs @@ -100,7 +100,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/pallets/fee-share/src/mock.rs b/pallets/fee-share/src/mock.rs index fc5984428..ca03d7b8b 100644 --- a/pallets/fee-share/src/mock.rs +++ b/pallets/fee-share/src/mock.rs @@ -36,12 +36,9 @@ use frame_support::{ use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; -use parity_scale_codec::{Decode, Encode}; -use sp_core::{hashing::blake2_256, ConstU32}; +use sp_core::ConstU32; use sp_runtime::{ - traits::{ - AccountIdConversion, Convert, IdentityLookup, TrailingZeroInput, UniqueSaturatedInto, - }, + traits::{AccountIdConversion, IdentityLookup, UniqueSaturatedInto}, AccountId32, BuildStorage, SaturatedConversion, }; use sp_std::marker::PhantomData; @@ -135,7 +132,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -184,48 +180,6 @@ impl Get for ParaInfo { } } -pub struct SubAccountIndexMultiLocationConvertor; -impl Convert<(u16, CurrencyId), MultiLocation> for SubAccountIndexMultiLocationConvertor { - fn convert((sub_account_index, currency_id): (u16, CurrencyId)) -> MultiLocation { - match currency_id { - CurrencyId::Token(TokenSymbol::MOVR) => MultiLocation::new( - 1, - X2( - Parachain(2023), - Junction::AccountKey20 { - network: None, - key: Slp::derivative_account_id_20( - hex_literal::hex!["7369626cd1070000000000000000000000000000"].into(), - sub_account_index, - ) - .into(), - }, - ), - ), - _ => MultiLocation::new( - 1, - X1(Junction::AccountId32 { - network: None, - id: Self::derivative_account_id( - ParaId::from(2001u32).into_account_truncating(), - sub_account_index, - ) - .into(), - }), - ), - } - } -} - -// Mock Utility::derivative_account_id function. -impl SubAccountIndexMultiLocationConvertor { - pub fn derivative_account_id(who: AccountId, index: u16) -> AccountId { - let entropy = (b"modlpy/utilisuba", who, index).using_encoded(blake2_256); - Decode::decode(&mut TrailingZeroInput::new(entropy.as_ref())) - .expect("infinite length input; no invalid inputs for type; qed") - } -} - pub struct ParachainId; impl Get for ParachainId { fn get() -> ParaId { @@ -240,12 +194,12 @@ parameter_types! { } pub struct SubstrateResponseManager; -impl QueryResponseManager for SubstrateResponseManager { +impl QueryResponseManager for SubstrateResponseManager { fn get_query_response_record(_query_id: QueryId) -> bool { Default::default() } fn create_query_record( - _responder: &MultiLocation, + _responder: Location, _call_back: Option, _timeout: u64, ) -> u64 { @@ -272,7 +226,7 @@ impl bifrost_slp::Config for Runtime { type WeightInfo = (); type VtokenMinting = VtokenMinting; type BifrostSlpx = SlpxInterface; - type AccountConverter = SubAccountIndexMultiLocationConvertor; + type AccountConverter = (); type ParachainId = ParachainId; type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; @@ -289,13 +243,13 @@ impl bifrost_slp::Config for Runtime { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: Location = Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } @@ -305,7 +259,7 @@ impl orml_xtokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = (); - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -313,8 +267,10 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } parameter_types! { @@ -438,7 +394,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -472,7 +428,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { diff --git a/pallets/flexible-fee/rpc/src/lib.rs b/pallets/flexible-fee/rpc/src/lib.rs index 00997feb0..c99fb3cdd 100644 --- a/pallets/flexible-fee/rpc/src/lib.rs +++ b/pallets/flexible-fee/rpc/src/lib.rs @@ -23,7 +23,7 @@ use bifrost_primitives::{Balance, CurrencyId}; use jsonrpsee::{ core::{async_trait, RpcResult}, proc_macros::rpc, - types::error::{CallError, ErrorObject}, + types::error::ErrorObject, }; pub use pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi as TransactionPaymentRuntimeApi; use parity_scale_codec::{Codec, Decode}; @@ -100,19 +100,19 @@ where let encoded_len = encoded_xt.len() as u32; let uxt: Block::Extrinsic = Decode::decode(&mut &*encoded_xt).map_err(|e| { - CallError::Custom(ErrorObject::owned( + ErrorObject::owned( Error::DecodeError.into(), "Unable to query fee details.", Some(format!("{:?}", e)), - )) + ) })?; let fee_details = api.query_fee_details(at, uxt.clone(), encoded_len).map_err(|e| { - CallError::Custom(ErrorObject::owned( + ErrorObject::owned( Error::RuntimeError.into(), "Unable to query fee details.", Some(format!("{:?}", e)), - )) + ) })?; let total_inclusion_fee: Balance = { @@ -131,22 +131,21 @@ where let try_into_rpc_balance = |value: Balance| { value.try_into().map_err(|e| { - CallError::Custom(ErrorObject::owned( + ErrorObject::owned( Error::RuntimeError.into(), format!("{} doesn't fit in NumberOrHex representation", value), Some(format!("{:?}", e)), - )) + ) }) }; match rs { Ok((id, val)) => try_into_rpc_balance(val).map(|value| (id, value)), - Err(e) => Err(CallError::Custom(ErrorObject::owned( + Err(e) => Err(ErrorObject::owned( Error::RuntimeError.into(), "Unable to query fee token and amount.", Some(format!("{:?}", e)), - ))), + )), } - .map_err(|e| jsonrpsee::core::Error::Call(e)) } } diff --git a/pallets/flexible-fee/src/mock.rs b/pallets/flexible-fee/src/mock.rs index 7c26edd90..5d7948e7d 100644 --- a/pallets/flexible-fee/src/mock.rs +++ b/pallets/flexible-fee/src/mock.rs @@ -48,7 +48,7 @@ use sp_runtime::{ }; use sp_std::marker::PhantomData; use std::convert::TryInto; -use xcm::prelude::*; +use xcm::{prelude::*, v3::MultiLocation}; use xcm_builder::{FixedWeightBounds, FrameTransactionalProcessor}; use xcm_executor::XcmExecutor; use zenlink_protocol::{ @@ -144,7 +144,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -414,7 +413,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -448,7 +447,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Test { @@ -527,7 +526,7 @@ impl DerivativeAccountHandler for DerivativeAccount { _token: CurrencyId, _derivative_index: DerivativeIndex, ) -> Option { - Some(Parent.into()) + Some(xcm::v3::Parent.into()) } fn get_stake_info( diff --git a/pallets/lend-market/rpc/src/lib.rs b/pallets/lend-market/rpc/src/lib.rs index 6ea27754b..f99569287 100644 --- a/pallets/lend-market/rpc/src/lib.rs +++ b/pallets/lend-market/rpc/src/lib.rs @@ -18,9 +18,9 @@ pub use lend_market_rpc_runtime_api::LendMarketApi as LendMarketRuntimeApi; use bifrost_primitives::{CurrencyId, Liquidity, Rate, Ratio, Shortfall}; use jsonrpsee::{ - core::{async_trait, Error as JsonRpseeError, RpcResult}, + core::{async_trait, RpcResult}, proc_macros::rpc, - types::error::{CallError, ErrorCode, ErrorObject}, + types::error::{ErrorCode, ErrorObject}, }; use parity_scale_codec::Codec; use sp_api::ProvideRuntimeApi; @@ -158,40 +158,36 @@ where } /// Converts a runtime trap into an RPC error. -fn runtime_error_into_rpc_error(err: impl std::fmt::Debug) -> JsonRpseeError { - JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( - Error::RuntimeError.into(), - "Runtime trapped", - Some(format!("{:?}", err)), - ))) +fn runtime_error_into_rpc_error(err: impl std::fmt::Debug) -> ErrorObject<'static> { + ErrorObject::owned(Error::RuntimeError.into(), "Runtime trapped", Some(format!("{:?}", err))) } /// Converts an account liquidity error into an RPC error. -fn account_liquidity_error_into_rpc_error(err: impl std::fmt::Debug) -> JsonRpseeError { - JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( +fn account_liquidity_error_into_rpc_error(err: impl std::fmt::Debug) -> ErrorObject<'static> { + ErrorObject::owned( Error::AccountLiquidityError.into(), "Not able to get account liquidity", Some(format!("{:?}", err)), - ))) + ) } /// Converts an market status error into an RPC error. -fn market_status_error_into_rpc_error(err: impl std::fmt::Debug) -> JsonRpseeError { - JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( +fn market_status_error_into_rpc_error(err: impl std::fmt::Debug) -> ErrorObject<'static> { + ErrorObject::owned( Error::MarketStatusError.into(), "Not able to get market status", Some(format!("{:?}", err)), - ))) + ) } fn try_into_rpc_balance>( value: T, ) -> RpcResult { value.try_into().map_err(|_| { - JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( + ErrorObject::owned( ErrorCode::InvalidParams.code(), format!("{} doesn't fit in NumberOrHex representation", value), None::<()>, - ))) + ) }) } diff --git a/pallets/lend-market/src/mock.rs b/pallets/lend-market/src/mock.rs index c9c303c2b..79b560c3a 100644 --- a/pallets/lend-market/src/mock.rs +++ b/pallets/lend-market/src/mock.rs @@ -106,7 +106,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/pallets/leverage-staking/src/mock.rs b/pallets/leverage-staking/src/mock.rs index de1b35cc7..c909670c6 100644 --- a/pallets/leverage-staking/src/mock.rs +++ b/pallets/leverage-staking/src/mock.rs @@ -40,10 +40,7 @@ use std::{ collections::HashMap, hash::{Hash, Hasher}, }; -use xcm::{ - prelude::*, - v3::{MultiLocation, Weight}, -}; +use xcm::{prelude::*, v3::Weight}; use xcm_builder::{FixedWeightBounds, FrameTransactionalProcessor}; use xcm_executor::XcmExecutor; @@ -133,7 +130,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -166,16 +163,16 @@ impl xcm_executor::Config for XcmConfig { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: xcm::v4::Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: xcm::v4::Location = xcm::v4::Location::here(); // pub const BaseXcmWeight: Weight = Weight::from_ref_time(1000_000_000u64); pub const MaxAssetsForTransfer: usize = 2; - // pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + // pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } impl orml_xtokens::Config for Test { @@ -183,7 +180,7 @@ impl orml_xtokens::Config for Test { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = (); - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -191,8 +188,10 @@ impl orml_xtokens::Config for Test { type BaseXcmWeight = (); type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } parameter_types! { @@ -210,7 +209,6 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type WeightInfo = (); type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; @@ -451,11 +449,6 @@ impl pallet_prices::Config for Test { type WeightInfo = (); } -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Test { type RuntimeEvent = RuntimeEvent; type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; diff --git a/pallets/parachain-staking/src/mock.rs b/pallets/parachain-staking/src/mock.rs index 01d101b83..29303a027 100644 --- a/pallets/parachain-staking/src/mock.rs +++ b/pallets/parachain-staking/src/mock.rs @@ -74,7 +74,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } parameter_types! { diff --git a/pallets/prices/src/lib.rs b/pallets/prices/src/lib.rs index 89281e53f..28339aa0b 100644 --- a/pallets/prices/src/lib.rs +++ b/pallets/prices/src/lib.rs @@ -75,7 +75,7 @@ pub mod pallet { #[pallet::constant] type RelayCurrency: Get; - /// Convert MultiLocation to `T::CurrencyId`. + /// Convert Location to `T::CurrencyId`. type CurrencyIdConvert: CurrencyIdMapping< CurrencyId, MultiLocation, diff --git a/pallets/prices/src/mock.rs b/pallets/prices/src/mock.rs index 991eef464..c01150e0e 100644 --- a/pallets/prices/src/mock.rs +++ b/pallets/prices/src/mock.rs @@ -123,7 +123,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/pallets/salp/rpc/src/lib.rs b/pallets/salp/rpc/src/lib.rs index f2d97354d..ebd2a8222 100644 --- a/pallets/salp/rpc/src/lib.rs +++ b/pallets/salp/rpc/src/lib.rs @@ -23,7 +23,7 @@ pub use bifrost_salp_rpc_runtime_api::{self as runtime_api, SalpRuntimeApi}; use jsonrpsee::{ core::{async_trait, RpcResult}, proc_macros::rpc, - types::error::{CallError, ErrorCode, ErrorObject}, + types::error::{ErrorCode, ErrorObject}, }; use parity_scale_codec::Codec; use sp_api::ProvideRuntimeApi; @@ -44,16 +44,13 @@ impl SalpRpc { } fn convert_rpc_params(value: Balance) -> RpcResult { - value - .try_into() - .map_err(|e| { - CallError::Custom(ErrorObject::owned( - ErrorCode::InvalidParams.code(), - format!("{} doesn't fit in NumberOrHex representation", value), - Some(format!("{:?}", e)), - )) - }) - .map_err(|e| jsonrpsee::core::Error::Call(e)) + value.try_into().map_err(|e| { + ErrorObject::owned( + ErrorCode::InvalidParams.code(), + format!("{} doesn't fit in NumberOrHex representation", value), + Some(format!("{:?}", e)), + ) + }) } #[rpc(client, server)] @@ -94,12 +91,11 @@ where Ok(value) => Ok((value, status)), Err(e) => Err(e), }, - Err(e) => Err(CallError::Custom(ErrorObject::owned( + Err(e) => Err(ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get salp contribution.", Some(format!("{:?}", e)), - ))) - .map_err(|e| jsonrpsee::core::Error::Call(e)), + )), } } } diff --git a/pallets/salp/src/benchmarking.rs b/pallets/salp/src/benchmarking.rs index 7d93a0976..ee8d173a9 100644 --- a/pallets/salp/src/benchmarking.rs +++ b/pallets/salp/src/benchmarking.rs @@ -75,12 +75,6 @@ where (who, value) } -pub fn lookup_of_account( - who: T::AccountId, -) -> <::Lookup as StaticLookup>::Source { - ::Lookup::unlookup(who) -} - #[benchmarks( where T: Config + bifrost_stable_pool::Config + bifrost_stable_asset::Config + orml_tokens::Config + bifrost_vtoken_minting::Config + bifrost_xcm_interface::Config + zenlink_protocol::Config, <::MultiCurrency as MultiCurrency<::AccountId>>::CurrencyId: From @@ -375,11 +369,13 @@ mod benchmarks { let relay_vstoken_id = ::CurrencyIdConversion::convert_to_vstoken(relay_currency_id).unwrap(); + let caller_lookup: ::Source = + T::Lookup::unlookup(caller.clone()); assert_ok!(zenlink_protocol::Pallet::::create_pair( RawOrigin::Root.into(), zenlink_protocol::AssetId { chain_id: 2001, asset_type: 2, asset_index: 516 }, zenlink_protocol::AssetId { chain_id: 2001, asset_type: 2, asset_index: 1028 }, - lookup_of_account::(caller.clone()), + caller_lookup )); let buybck_caller = T::BuybackPalletId::get().into_account_truncating(); diff --git a/pallets/salp/src/lib.rs b/pallets/salp/src/lib.rs index eb338ada9..82a9749e2 100644 --- a/pallets/salp/src/lib.rs +++ b/pallets/salp/src/lib.rs @@ -113,7 +113,7 @@ pub mod pallet { }; use sp_arithmetic::Percent; use sp_std::{convert::TryInto, prelude::*}; - use xcm::v3::{MaybeErrorCode, MultiLocation}; + use xcm::v3::MaybeErrorCode; use super::*; @@ -1212,7 +1212,7 @@ pub mod pallet { response: Response, ) -> DispatchResult { let responder = ensure_response(::RuntimeOrigin::from(origin))?; - ensure!(responder == MultiLocation::parent(), Error::::ResponderNotRelayChain); + ensure!(responder == xcm::v4::Location::parent(), Error::::ResponderNotRelayChain); let (index, contributer, _amount) = QueryIdContributionInfo::::get(query_id) .ok_or(Error::::NotFindContributionValue)?; diff --git a/pallets/salp/src/mock.rs b/pallets/salp/src/mock.rs index 6a55e0557..628dd72e9 100644 --- a/pallets/salp/src/mock.rs +++ b/pallets/salp/src/mock.rs @@ -121,7 +121,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -378,13 +377,13 @@ impl SlpxOperator for SlpxInterface { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: Location = Location::here(); pub const MaxAssetsForTransfer: usize = 2; } @@ -393,7 +392,7 @@ impl orml_xtokens::Config for Test { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = (); - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -401,8 +400,10 @@ impl orml_xtokens::Config for Test { type BaseXcmWeight = (); type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } pub struct Slp; @@ -481,7 +482,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); pub const RelayNetwork: NetworkId = NetworkId::Kusama; } @@ -516,7 +517,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Test { @@ -546,9 +547,9 @@ impl pallet_xcm::Config for Test { } pub struct BifrostAccountIdToMultiLocation; -impl Convert for BifrostAccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { - X1(AccountId32 { network: None, id: account.into() }).into() +impl Convert for BifrostAccountIdToMultiLocation { + fn convert(account: AccountId) -> Location { + (AccountId32 { network: None, id: account.into() }).into() } } @@ -560,7 +561,7 @@ impl bifrost_xcm_interface::Config for Test { type RelaychainCurrencyId = RelayCurrencyId; type ParachainSovereignAccount = TreasuryAccount; type XcmExecutor = DoNothingExecuteXcm; - type AccountIdToMultiLocation = BifrostAccountIdToMultiLocation; + type AccountIdToLocation = BifrostAccountIdToMultiLocation; type SalpHelper = Salp; type ParachainId = ParaInfo; type CallBackTimeOut = ConstU64<10>; diff --git a/pallets/salp/src/tests.rs b/pallets/salp/src/tests.rs index 52d04c0bf..fc15ce71f 100644 --- a/pallets/salp/src/tests.rs +++ b/pallets/salp/src/tests.rs @@ -1347,7 +1347,7 @@ fn refund_meanwhile_issue_should_work() { RuntimeOrigin::root(), asset_0_currency_id, asset_1_currency_id, - ALICE, + ALICE )); let deadline: BlockNumberFor = >::block_number() + BlockNumberFor::::from(100u32); diff --git a/pallets/slp/src/agents/astar_agent/agent.rs b/pallets/slp/src/agents/astar_agent/agent.rs index d9df3383b..ce09f0f54 100644 --- a/pallets/slp/src/agents/astar_agent/agent.rs +++ b/pallets/slp/src/agents/astar_agent/agent.rs @@ -41,7 +41,7 @@ use sp_std::prelude::*; use xcm::{ opaque::v3::{Junction::Parachain, Junctions::X1, MultiLocation}, v3::prelude::*, - VersionedMultiAssets, VersionedMultiLocation, + VersionedAssets, VersionedLocation, }; /// StakingAgent implementation for Astar @@ -153,7 +153,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) } @@ -252,7 +255,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) } @@ -395,7 +401,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) } @@ -436,24 +445,22 @@ impl // Prepare parameter dest and beneficiary. let to_32: [u8; 32] = Pallet::::multilocation_to_account_32(to)?; - let dest = Box::new(VersionedMultiLocation::from(MultiLocation::new( + let dest = Box::new(VersionedLocation::V3(MultiLocation::new( 1, X1(Parachain(T::ParachainId::get().into())), ))); - let beneficiary = - Box::new(VersionedMultiLocation::from(MultiLocation::from(X1(AccountId32 { - network: None, - id: to_32, - })))); + let beneficiary = Box::new(VersionedLocation::V3(MultiLocation::from(X1(AccountId32 { + network: None, + id: to_32, + })))); // Prepare parameter assets. let asset = MultiAsset { fun: Fungible(amount.unique_saturated_into()), id: Concrete(MultiLocation { parents: 0, interior: Here }), }; - let assets: Box = - Box::new(VersionedMultiAssets::from(MultiAssets::from(asset))); + let assets: Box = Box::new(VersionedAssets::V3(MultiAssets::from(asset))); // Prepare parameter fee_asset_item. let fee_asset_item: u32 = 0; diff --git a/pallets/slp/src/agents/astar_agent/types.rs b/pallets/slp/src/agents/astar_agent/types.rs index 14ea9ed42..c9d270afb 100644 --- a/pallets/slp/src/agents/astar_agent/types.rs +++ b/pallets/slp/src/agents/astar_agent/types.rs @@ -22,7 +22,7 @@ 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}; +use xcm::{opaque::v3::WeightLimit, VersionedAssets, VersionedLocation}; #[derive(Encode, Decode, RuntimeDebug, Clone)] pub enum AstarCall { @@ -66,9 +66,9 @@ pub enum AstarDappsStakingCall { pub enum XcmCall { #[codec(index = 8)] LimitedReserveTransferAssets( - Box, - Box, - Box, + Box, + Box, + Box, u32, WeightLimit, ), diff --git a/pallets/slp/src/agents/common.rs b/pallets/slp/src/agents/common.rs index 085213f8a..9bab67f01 100644 --- a/pallets/slp/src/agents/common.rs +++ b/pallets/slp/src/agents/common.rs @@ -24,11 +24,9 @@ use crate::{ vec, AccountIdOf, BalanceOf, BlockNumberFor, BoundedVec, Box, Config, CurrencyDelays, DelegationsOccupied, DelegatorLatestTuneRecord, DelegatorLedgerXcmUpdateQueue, DelegatorLedgers, DelegatorNextIndex, DelegatorsIndex2Multilocation, - DelegatorsMultilocation2Index, Encode, Event, FeeSources, - Junction::{AccountId32, Parachain}, - Junctions::X1, - Ledger, LedgerUpdateEntry, MinimumsAndMaximums, MultiLocation, Pallet, TimeUnit, Validators, - Vec, Weight, Xcm, XcmOperationType, Zero, ASTR, BNC, DOT, GLMR, KSM, MANTA, MOVR, PHA, + DelegatorsMultilocation2Index, Encode, Event, FeeSources, Ledger, LedgerUpdateEntry, + MinimumsAndMaximums, Pallet, TimeUnit, Validators, Vec, Weight, XcmOperationType, Zero, ASTR, + BNC, DOT, GLMR, KSM, MANTA, MOVR, PHA, }; use bifrost_primitives::{CurrencyId, VtokenMintingOperator, XcmDestWeightAndFeeHandler}; use frame_support::{dispatch::GetDispatchInfo, ensure, traits::Len}; @@ -39,7 +37,10 @@ use sp_runtime::{ traits::{AccountIdConversion, CheckedAdd, UniqueSaturatedFrom, UniqueSaturatedInto}, DispatchResult, Saturating, }; -use xcm::{opaque::v3::Instruction, v3::prelude::*, VersionedMultiLocation}; +use xcm::{ + v3::{prelude::*, MultiLocation}, + VersionedLocation, +}; // Some common business functions for all agents impl Pallet { @@ -210,7 +211,7 @@ impl Pallet { from: &MultiLocation, to: &MultiLocation, currency_id: CurrencyId, - ) -> Result<(Box, Box), Error> { + ) -> Result<(Box, Box), Error> { // Check if from is one of our delegators. If not, return error. DelegatorsMultilocation2Index::::get(currency_id, from) .ok_or(Error::::DelegatorNotExist)?; @@ -223,15 +224,14 @@ impl Pallet { // Prepare parameter dest and beneficiary. let to_32: [u8; 32] = Self::multilocation_to_account_32(to)?; - let dest = Box::new(VersionedMultiLocation::from(MultiLocation::from(X1(Parachain( + let dest = Box::new(VersionedLocation::V3(Location::from([Parachain( T::ParachainId::get().into(), - ))))); + )]))); - let beneficiary = - Box::new(VersionedMultiLocation::from(MultiLocation::from(X1(AccountId32 { - network: None, - id: to_32, - })))); + let beneficiary = Box::new(VersionedLocation::V3(Location::from([AccountId32 { + network: None, + id: to_32, + }]))); Ok((dest, beneficiary)) } @@ -301,7 +301,7 @@ impl Pallet { pub(crate) fn inner_construct_xcm_message( currency_id: CurrencyId, extra_fee: BalanceOf, - ) -> Result, Error> { + ) -> Result>, Error> { let multi = Self::get_currency_local_multilocation(currency_id); let asset = @@ -315,7 +315,7 @@ impl Pallet { RefundSurplus, DepositAsset { assets: AllCounted(8).into(), - beneficiary: MultiLocation { parents: 0, interior }, + beneficiary: Location { parents: 0, interior }, }, ]) } @@ -405,7 +405,10 @@ impl Pallet { ) -> Result<(QueryId, Weight), Error> { let now = frame_system::Pallet::::block_number(); let timeout = BlockNumberFor::::from(TIMEOUT_BLOCKS).saturating_add(now); - let responder = Self::get_para_multilocation_by_currency_id(currency_id)?; + let responder: xcm::v4::Location = + Self::get_para_multilocation_by_currency_id(currency_id)? + .try_into() + .map_err(|_| Error::::FailToConvert)?; let (notify_call_weight, callback_option) = match (currency_id, operation) { (DOT, &XcmOperationType::Delegate) | @@ -422,7 +425,7 @@ impl Pallet { }; let query_id = - T::SubstrateResponseManager::create_query_record(&responder, callback_option, timeout); + T::SubstrateResponseManager::create_query_record(responder, callback_option, timeout); return Ok((query_id, notify_call_weight)); } @@ -452,7 +455,10 @@ impl Pallet { )?; let dest = Self::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; Ok(withdraw_fee) } @@ -461,7 +467,7 @@ impl Pallet { query_id: QueryId, max_weight: Weight, currency_id: CurrencyId, - ) -> Instruction { + ) -> Instruction<()> { let dest_location = match currency_id { DOT | KSM => MultiLocation::from(X1(Parachain(u32::from(T::ParachainId::get())))), _ => MultiLocation::new(1, X1(Parachain(u32::from(T::ParachainId::get())))), @@ -520,7 +526,8 @@ impl Pallet { ensure!(from.parents.is_zero(), Error::::InvalidTransferSource); let from_account = Pallet::::multilocation_to_account(from)?; - T::XcmTransfer::transfer(from_account, currency_id, amount, *to, Unlimited) + let v4_location = (*to).try_into().map_err(|()| Error::::FailToConvert)?; + T::XcmTransfer::transfer(from_account, currency_id, amount, v4_location, Unlimited) .map_err(|_| Error::::TransferToError)?; Ok(()) diff --git a/pallets/slp/src/agents/filecoin_agent/agent.rs b/pallets/slp/src/agents/filecoin_agent/agent.rs index e03f132ec..f1a69b595 100644 --- a/pallets/slp/src/agents/filecoin_agent/agent.rs +++ b/pallets/slp/src/agents/filecoin_agent/agent.rs @@ -20,8 +20,8 @@ use crate::{ primitives::{FilecoinLedger, Ledger}, traits::StakingAgent, AccountIdOf, BalanceOf, BoundedVec, Config, DelegatorLatestTuneRecord, DelegatorLedgers, - LedgerUpdateEntry, MinimumsAndMaximums, MultiLocation, Pallet, TimeUnit, Validators, - ValidatorsByDelegator, ValidatorsByDelegatorUpdateEntry, + LedgerUpdateEntry, MinimumsAndMaximums, Pallet, TimeUnit, Validators, ValidatorsByDelegator, + ValidatorsByDelegatorUpdateEntry, }; use bifrost_primitives::{CurrencyId, VtokenMintingOperator}; use core::marker::PhantomData; diff --git a/pallets/slp/src/agents/parachain_staking_agent/agent.rs b/pallets/slp/src/agents/parachain_staking_agent/agent.rs index bd551f091..975fd7bb0 100644 --- a/pallets/slp/src/agents/parachain_staking_agent/agent.rs +++ b/pallets/slp/src/agents/parachain_staking_agent/agent.rs @@ -53,7 +53,7 @@ use xcm::{ MultiLocation, WeightLimit, }, v3::prelude::*, - VersionedMultiLocation, + VersionedLocation, }; /// StakingAgent implementation for Moonriver/Moonbeam @@ -308,7 +308,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; query_index = query_id; } @@ -456,7 +459,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; query_index = query_id; } @@ -620,7 +626,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; query_index = query_id; } @@ -836,7 +845,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; query_index = query_id; } @@ -984,7 +996,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; query_index = query_id; } @@ -1329,7 +1344,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; query_index = query_id; } @@ -1375,7 +1393,7 @@ impl } else { // Prepare parameter dest and beneficiary. let to_32: [u8; 32] = Pallet::::multilocation_to_account_32(&to)?; - let dest = Box::new(VersionedMultiLocation::from(MultiLocation { + let dest = Box::new(VersionedLocation::V3(MultiLocation { parents: 1, interior: X2( Parachain(T::ParachainId::get().into()), 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 f716e8c64..0ee7e0504 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 @@ -19,7 +19,7 @@ use crate::{BalanceOf, Config, Decode, Encode}; use scale_info::TypeInfo; use sp_runtime::{traits::StaticLookup, RuntimeDebug}; use sp_std::{boxed::Box, vec::Vec}; -use xcm::{opaque::v3::WeightLimit, VersionedMultiLocation}; +use xcm::{opaque::v3::WeightLimit, VersionedLocation}; #[derive(Encode, Decode, RuntimeDebug)] pub enum MantaCall { @@ -86,7 +86,7 @@ pub enum MantaParachainStakingCall { #[derive(Encode, Decode, RuntimeDebug, Clone)] pub enum MantaXtokensCall { #[codec(index = 0)] - Transfer(MantaCurrencyId, BalanceOf, Box, WeightLimit), + Transfer(MantaCurrencyId, BalanceOf, Box, WeightLimit), } #[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)] 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 a94b207ea..abb20ae39 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 @@ -26,7 +26,7 @@ use sp_runtime::{ RuntimeDebug, }; use sp_std::{boxed::Box, vec::Vec}; -use xcm::{opaque::v3::WeightLimit, VersionedMultiLocation}; +use xcm::{opaque::v3::WeightLimit, VersionedLocation}; #[derive(Encode, Decode, RuntimeDebug, Clone)] pub enum MoonbeamCall { @@ -91,7 +91,7 @@ pub enum MoonbeamParachainStakingCall { #[derive(Encode, Decode, RuntimeDebug, Clone)] pub enum MoonbeamXtokensCall { #[codec(index = 0)] - Transfer(MoonbeamCurrencyId, BalanceOf, Box, WeightLimit), + Transfer(MoonbeamCurrencyId, BalanceOf, Box, WeightLimit), } #[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] diff --git a/pallets/slp/src/agents/phala_agent/agent.rs b/pallets/slp/src/agents/phala_agent/agent.rs index 15407628c..ccb742436 100644 --- a/pallets/slp/src/agents/phala_agent/agent.rs +++ b/pallets/slp/src/agents/phala_agent/agent.rs @@ -171,7 +171,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) } @@ -281,7 +284,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) } @@ -509,7 +515,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) } @@ -691,7 +700,10 @@ impl // Send out the xcm message. let dest = Pallet::::get_para_multilocation_by_currency_id(currency_id)?; - send_xcm::(dest, xcm_message).map_err(|_e| Error::::XcmFailure)?; + let v4_dest = dest.try_into().map_err(|()| Error::::FailToConvert)?; + let v4_message = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(v4_dest, v4_message) + .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) } @@ -918,10 +930,7 @@ impl PhalaAgent { DelegatorLedgerXcmUpdateQueue::::remove(query_id); // Delete the query in pallet_xcm. - ensure!( - T::SubstrateResponseManager::remove_query_record(query_id), - Error::::QueryResponseRemoveError - ); + T::SubstrateResponseManager::remove_query_record(query_id); Ok(()) } diff --git a/pallets/slp/src/agents/phala_agent/types.rs b/pallets/slp/src/agents/phala_agent/types.rs index ed9a3d4b6..cfdba6ee2 100644 --- a/pallets/slp/src/agents/phala_agent/types.rs +++ b/pallets/slp/src/agents/phala_agent/types.rs @@ -16,11 +16,14 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::{agents::BalancesCall, BalanceOf, Config, MultiLocation}; +use crate::{agents::BalancesCall, BalanceOf, Config}; use parity_scale_codec::{Decode, Encode}; use sp_runtime::RuntimeDebug; use sp_std::{boxed::Box, vec::Vec}; -use xcm::{opaque::v3::MultiAsset, v3::Weight as XCMWeight}; +use xcm::{ + opaque::v3::MultiAsset, + v3::{MultiLocation, Weight as XCMWeight}, +}; #[derive(Encode, Decode, RuntimeDebug)] pub enum PhalaCall { diff --git a/pallets/slp/src/agents/polkadot_agent/agent.rs b/pallets/slp/src/agents/polkadot_agent/agent.rs index 57dffc09f..22f3ece81 100644 --- a/pallets/slp/src/agents/polkadot_agent/agent.rs +++ b/pallets/slp/src/agents/polkadot_agent/agent.rs @@ -41,7 +41,7 @@ use sp_runtime::{ DispatchResult, }; use sp_std::prelude::*; -use xcm::{opaque::v3::MultiLocation, v3::prelude::*, VersionedMultiAssets}; +use xcm::{opaque::v3::MultiLocation, v3::prelude::*, VersionedAssets}; /// StakingAgent implementation for Kusama/Polkadot pub struct PolkadotAgent(PhantomData); @@ -154,7 +154,8 @@ impl )?; // Send out the xcm message. - send_xcm::(Parent.into(), xcm_message) + let v4_location = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(xcm::v4::Parent.into(), v4_location) .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) @@ -223,7 +224,8 @@ impl )?; // Send out the xcm message. - send_xcm::(Parent.into(), xcm_message) + let v4_location = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(xcm::v4::Parent.into(), v4_location) .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) @@ -300,7 +302,8 @@ impl )?; // Send out the xcm message. - send_xcm::(Parent.into(), xcm_message) + let v4_location = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(xcm::v4::Parent.into(), v4_location) .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) @@ -353,7 +356,8 @@ impl )?; // Send out the xcm message. - send_xcm::(Parent.into(), xcm_message) + let v4_location = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(xcm::v4::Parent.into(), v4_location) .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) @@ -428,7 +432,8 @@ impl )?; // Send out the xcm message. - send_xcm::(Parent.into(), xcm_message) + let v4_location = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(xcm::v4::Parent.into(), v4_location) .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) @@ -499,7 +504,8 @@ impl )?; // Send out the xcm message. - send_xcm::(Parent.into(), xcm_message) + let v4_location = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(xcm::v4::Parent.into(), v4_location) .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) @@ -577,7 +583,8 @@ impl )?; // Send out the xcm message. - send_xcm::(Parent.into(), xcm_message) + let v4_location = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(xcm::v4::Parent.into(), v4_location) .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) @@ -705,7 +712,8 @@ impl )?; // Send out the xcm message. - send_xcm::(Parent.into(), xcm_message) + let v4_location = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(xcm::v4::Parent.into(), v4_location) .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) @@ -769,7 +777,8 @@ impl } // Send out the xcm message. - send_xcm::(Parent.into(), xcm_message) + let v4_location = xcm_message.try_into().map_err(|()| Error::::FailToConvert)?; + xcm::v4::send_xcm::(xcm::v4::Parent.into(), v4_location) .map_err(|_e| Error::::XcmFailure)?; Ok(query_id) @@ -795,8 +804,7 @@ impl fun: Fungible(amount.unique_saturated_into()), id: Concrete(MultiLocation { parents: 0, interior: Here }), }; - let assets: Box = - Box::new(VersionedMultiAssets::from(MultiAssets::from(asset))); + let assets: Box = Box::new(VersionedAssets::V3(MultiAssets::from(asset))); // Prepare parameter fee_asset_item. let fee_asset_item: u32 = 0; diff --git a/pallets/slp/src/agents/polkadot_agent/types.rs b/pallets/slp/src/agents/polkadot_agent/types.rs index 089a212a0..c2689c93f 100644 --- a/pallets/slp/src/agents/polkadot_agent/types.rs +++ b/pallets/slp/src/agents/polkadot_agent/types.rs @@ -21,7 +21,7 @@ use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_runtime::{traits::StaticLookup, RuntimeDebug}; use sp_std::{boxed::Box, vec::Vec}; -use xcm::{v3::prelude::*, VersionedMultiAssets, VersionedMultiLocation}; +use xcm::{v3::prelude::*, VersionedAssets, VersionedLocation}; #[derive(Encode, Decode, RuntimeDebug)] pub enum KusamaCall { @@ -116,9 +116,9 @@ pub enum StakingCall { pub enum XcmCall { #[codec(index = 8)] LimitedReserveTransferAssets( - Box, - Box, - Box, + Box, + Box, + Box, u32, WeightLimit, ), diff --git a/pallets/slp/src/agents/utils.rs b/pallets/slp/src/agents/utils.rs index 41b2c26a7..4b6099a27 100644 --- a/pallets/slp/src/agents/utils.rs +++ b/pallets/slp/src/agents/utils.rs @@ -26,14 +26,7 @@ use frame_support::ensure; use parity_scale_codec::Encode; use sp_core::Get; use sp_std::prelude::*; -use xcm::{ - opaque::v3::{ - Junction::{AccountId32, Parachain}, - Junctions::X1, - MultiLocation, - }, - v3::prelude::*, -}; +use xcm::v3::{prelude::*, MultiLocation}; // Some untilities. impl Pallet { diff --git a/pallets/slp/src/lib.rs b/pallets/slp/src/lib.rs index f422ea973..ffdb38f1f 100644 --- a/pallets/slp/src/lib.rs +++ b/pallets/slp/src/lib.rs @@ -58,7 +58,7 @@ use sp_std::{boxed::Box, vec, vec::Vec}; pub use weights::WeightInfo; use xcm::{ prelude::*, - v3::{Junction, Junctions, MultiLocation, Xcm}, + v3::{Junction, Junctions, MultiLocation}, }; mod agents; @@ -142,7 +142,7 @@ pub mod pallet { /// Substrate response manager. type SubstrateResponseManager: QueryResponseManager< QueryId, - MultiLocation, + xcm::v4::Location, BlockNumberFor, ::RuntimeCall, >; @@ -1307,16 +1307,16 @@ pub mod pallet { )?; }, RedeemType::Astar(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::VtokenMinting::get_astar_parachain_id()), - AccountId32 { + xcm::v4::Junction::AccountId32 { network: None, id: receiver.encode().try_into().unwrap(), }, - ), - }; + ], + ); T::XcmTransfer::transfer( user_account.clone(), currency_id, @@ -1326,16 +1326,16 @@ pub mod pallet { )?; }, RedeemType::Hydradx(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = xcm::v4::Location::new( + 1, + [ Parachain(T::VtokenMinting::get_hydradx_parachain_id()), - AccountId32 { + xcm::v4::Junction::AccountId32 { network: None, id: receiver.encode().try_into().unwrap(), }, - ), - }; + ], + ); T::XcmTransfer::transfer( user_account.clone(), currency_id, @@ -1345,16 +1345,16 @@ pub mod pallet { )?; }, RedeemType::Interlay(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = xcm::v4::Location::new( + 1, + [ Parachain(T::VtokenMinting::get_interlay_parachain_id()), - AccountId32 { + xcm::v4::Junction::AccountId32 { network: None, id: receiver.encode().try_into().unwrap(), }, - ), - }; + ], + ); T::XcmTransfer::transfer( user_account.clone(), currency_id, @@ -1364,16 +1364,16 @@ pub mod pallet { )?; }, RedeemType::Manta(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = xcm::v4::Location::new( + 1, + [ Parachain(T::VtokenMinting::get_manta_parachain_id()), - AccountId32 { + xcm::v4::Junction::AccountId32 { network: None, id: receiver.encode().try_into().unwrap(), }, - ), - }; + ], + ); T::XcmTransfer::transfer( user_account.clone(), currency_id, @@ -1383,16 +1383,16 @@ pub mod pallet { )?; }, RedeemType::Moonbeam(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = xcm::v4::Location::new( + 1, + [ Parachain(T::VtokenMinting::get_moonbeam_parachain_id()), AccountKey20 { network: None, key: receiver.to_fixed_bytes(), }, - ), - }; + ], + ); if currency_id == FIL { let assets = vec![ (currency_id, deduct_amount), @@ -2618,7 +2618,7 @@ impl>> currency_id, &who, Ledger::Substrate(SubstrateLedger { - account: Parent.into(), + account: xcm::v3::Parent.into(), total: u32::MAX.into(), active: u32::MAX.into(), unlocking: vec![], diff --git a/pallets/slp/src/migrations/mod.rs b/pallets/slp/src/migrations/mod.rs index f5231cb7b..cab834f9d 100644 --- a/pallets/slp/src/migrations/mod.rs +++ b/pallets/slp/src/migrations/mod.rs @@ -16,6 +16,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -/// Version 2. -pub mod v2; -pub mod v3; +// Version 2. +// pub mod v2; +// pub mod v3; diff --git a/pallets/slp/src/migrations/v2.rs b/pallets/slp/src/migrations/v2.rs index d5463f5cf..542916d86 100644 --- a/pallets/slp/src/migrations/v2.rs +++ b/pallets/slp/src/migrations/v2.rs @@ -32,15 +32,15 @@ impl OnRuntimeUpgrade for SlpMigration { // Transform storage values // We transform the storage values from the old into the new format. log::info!(target: LOG_TARGET, "Start to migrate Validators storage..."); - Validators::::translate(|k: CurrencyId, value: Vec| { + Validators::::translate(|k: CurrencyId, value: Vec| { log::info!(target: LOG_TARGET, "Migrated to boundedvec for {:?}...", k); - let target_bounded_vec: BoundedVec; + let target_bounded_vec: BoundedVec; if value.len() != 0 { target_bounded_vec = BoundedVec::try_from(value).unwrap(); } else { - target_bounded_vec = BoundedVec::::default(); + target_bounded_vec = BoundedVec::::default(); } Some(target_bounded_vec) @@ -48,7 +48,7 @@ impl OnRuntimeUpgrade for SlpMigration { log::info!(target: LOG_TARGET, "Start to migrate ValidatorsByDelegator storage..."); //migrate the value type of ValidatorsByDelegator - ValidatorsByDelegator::::translate(|key1, key2, value: Vec| { + ValidatorsByDelegator::::translate(|key1, key2, value: Vec| { log::info!( target: LOG_TARGET, "Migrated to boundedvec for {:?} - {:?}...", @@ -56,12 +56,12 @@ impl OnRuntimeUpgrade for SlpMigration { key2 ); - let target_bounded_vec: BoundedVec; + let target_bounded_vec: BoundedVec; if value.len() != 0 { target_bounded_vec = BoundedVec::try_from(value).unwrap(); } else { - target_bounded_vec = BoundedVec::::default(); + target_bounded_vec = BoundedVec::::default(); } Some(target_bounded_vec) @@ -70,11 +70,11 @@ impl OnRuntimeUpgrade for SlpMigration { log::info!(target: LOG_TARGET, "Start to migrate ValidatorBoostList storage..."); //migrate the value type of ValidatorBoostList ValidatorBoostList::::translate( - |k: CurrencyId, value: Vec<(MultiLocation, BlockNumberFor)>| { + |k: CurrencyId, value: Vec<(Location, BlockNumberFor)>| { log::info!(target: LOG_TARGET, "Migrated to boundedvec for {:?}...", k); let target_bounded_vec: BoundedVec< - (MultiLocation, BlockNumberFor), + (Location, BlockNumberFor), T::MaxLengthLimit, >; @@ -82,7 +82,7 @@ impl OnRuntimeUpgrade for SlpMigration { target_bounded_vec = BoundedVec::try_from(value).unwrap(); } else { target_bounded_vec = BoundedVec::< - (MultiLocation, BlockNumberFor), + (Location, BlockNumberFor), T::MaxLengthLimit, >::default(); } diff --git a/pallets/slp/src/mocks/mock.rs b/pallets/slp/src/mocks/mock.rs index 158fe2fb6..308f27db0 100644 --- a/pallets/slp/src/mocks/mock.rs +++ b/pallets/slp/src/mocks/mock.rs @@ -46,7 +46,7 @@ use sp_runtime::{ AccountId32, BuildStorage, Percent, }; use sp_std::{boxed::Box, vec::Vec}; -use xcm::v3::{prelude::*, Weight}; +use xcm::v3::{prelude::*, MultiLocation, Weight}; use xcm_builder::{FixedWeightBounds, FrameTransactionalProcessor}; use xcm_executor::XcmExecutor; @@ -119,7 +119,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -153,13 +152,13 @@ impl bifrost_currencies::Config for Runtime { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: xcm::v4::Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: xcm::v4::Location = xcm::v4::Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } @@ -169,7 +168,7 @@ impl orml_xtokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = (); - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -177,8 +176,10 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } parameter_types! { @@ -394,12 +395,12 @@ parameter_types! { pub BifrostTreasuryAccount: AccountId = PalletId(*b"bf/trsry").into_account_truncating(); } -impl QueryResponseManager for () { +impl QueryResponseManager for () { fn get_query_response_record(_query_id: QueryId) -> bool { Default::default() } fn create_query_record( - _responder: &MultiLocation, + _responder: Location, _call_back: Option, _timeout: u64, ) -> u64 { @@ -411,19 +412,19 @@ impl QueryResponseManager for () { } pub struct BifrostCurrencyIdConvert; -impl Convert> for BifrostCurrencyIdConvert { - fn convert(id: CurrencyId) -> Option { +impl Convert> for BifrostCurrencyIdConvert { + fn convert(id: CurrencyId) -> Option { use CurrencyId::*; use TokenSymbol::*; match id { - Token(MOVR) => Some(MultiLocation::new(1, X2(Parachain(2023), PalletInstance(10)))), - Token(KSM) => Some(MultiLocation::parent()), - Native(BNC) => Some(MultiLocation::new( + Token(MOVR) => Some(Location::new(1, [Parachain(2023), PalletInstance(10)])), + Token(KSM) => Some(Location::parent()), + Native(BNC) => Some(Location::new( 0, - X1(Junction::from(BoundedVec::try_from("0x0001".encode()).unwrap())), + Junction::from(BoundedVec::try_from("0x0001".encode()).unwrap()), )), - Token(PHA) => Some(MultiLocation::new(1, X1(Parachain(2004)))), + Token(PHA) => Some(Location::new(1, [Parachain(2004)])), _ => None, } } @@ -436,6 +437,25 @@ impl SlpxOperator for SlpxInterface { } } +pub struct SubstrateResponseManager; +impl QueryResponseManager + for SubstrateResponseManager +{ + fn get_query_response_record(_query_id: QueryId) -> bool { + Default::default() + } + fn create_query_record( + _responder: xcm::v4::Location, + _call_back: Option, + _timeout: u64, + ) -> u64 { + Default::default() + } + fn remove_query_record(_query_id: QueryId) -> bool { + Default::default() + } +} + impl Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; @@ -447,7 +467,7 @@ impl Config for Runtime { type BifrostSlpx = SlpxInterface; type AccountConverter = SubAccountIndexMultiLocationConvertor; type ParachainId = ParachainId; - type SubstrateResponseManager = (); + type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; type MaxRefundPerBlock = MaxRefundPerBlock; type OnRefund = (); @@ -484,7 +504,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: xcm::v4::InteriorLocation = xcm::v4::Junction::Parachain(2001).into(); } pub struct XcmConfig; @@ -518,7 +538,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { diff --git a/pallets/slp/src/mocks/mock_kusama.rs b/pallets/slp/src/mocks/mock_kusama.rs index 79380a7d9..78319b7c7 100644 --- a/pallets/slp/src/mocks/mock_kusama.rs +++ b/pallets/slp/src/mocks/mock_kusama.rs @@ -173,7 +173,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -207,13 +206,13 @@ impl bifrost_currencies::Config for Runtime { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: xcm::v4::Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: xcm::v4::Location = xcm::v4::Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } @@ -223,7 +222,7 @@ impl orml_xtokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = BifrostCurrencyIdConvert; - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = DoNothingExecuteXcm; @@ -231,8 +230,10 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } parameter_types! { @@ -402,7 +403,8 @@ impl Convert<(u16, CurrencyId), MultiLocation> for SubAccountIndexMultiLocationC MANTA => { // get parachain id if let Some(location) = BifrostCurrencyIdConvert::convert(currency_id) { - if let Some(Parachain(para_id)) = location.interior().first() { + let v3_location = xcm::v3::Location::try_from(location).unwrap(); + if let Some(Parachain(para_id)) = v3_location.interior().first() { MultiLocation::new( 1, X2( @@ -431,7 +433,8 @@ impl Convert<(u16, CurrencyId), MultiLocation> for SubAccountIndexMultiLocationC _ => { // get parachain id if let Some(location) = BifrostCurrencyIdConvert::convert(currency_id) { - if let Some(Parachain(para_id)) = location.interior().first() { + let v3_location = xcm::v3::Location::try_from(location).unwrap(); + if let Some(Parachain(para_id)) = v3_location.interior().first() { MultiLocation::new( 1, X2( @@ -483,32 +486,37 @@ parameter_types! { } pub struct BifrostCurrencyIdConvert; -impl Convert> for BifrostCurrencyIdConvert { - fn convert(id: CurrencyId) -> Option { +impl Convert> for BifrostCurrencyIdConvert { + fn convert(id: CurrencyId) -> Option { use CurrencyId::*; use TokenSymbol::*; match id { - Token(MOVR) => Some(MultiLocation::new(1, X2(Parachain(2023), PalletInstance(10)))), - Token(KSM) => Some(MultiLocation::parent()), - Native(BNC) => Some(MultiLocation::new( + Token(MOVR) => Some(xcm::v4::Location::new( + 1, + [xcm::v4::Junction::Parachain(2023), xcm::v4::Junction::PalletInstance(10)], + )), + Token(KSM) => Some(xcm::v4::Location::parent()), + Native(BNC) => Some(xcm::v4::Location::new( 0, - X1(Junction::from(BoundedVec::try_from("0x0001".encode()).unwrap())), + [xcm::v4::Junction::from(BoundedVec::try_from("0x0001".encode()).unwrap())], )), - Token(PHA) => Some(MultiLocation::new(1, X1(Parachain(2004)))), - MANTA => Some(MultiLocation::new(1, X1(Parachain(2104)))), + Token(PHA) => Some(xcm::v4::Location::new(1, [xcm::v4::Junction::Parachain(2004)])), + MANTA => Some(xcm::v4::Location::new(1, [xcm::v4::Junction::Parachain(2104)])), _ => None, } } } pub struct SubstrateResponseManager; -impl QueryResponseManager for SubstrateResponseManager { +impl QueryResponseManager + for SubstrateResponseManager +{ fn get_query_response_record(_query_id: QueryId) -> bool { Default::default() } fn create_query_record( - _responder: &MultiLocation, + _responder: xcm::v4::Location, _call_back: Option, _timeout: u64, ) -> u64 { @@ -571,14 +579,14 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: xcm::v4::InteriorLocation = xcm::v4::Junction::Parachain(2001).into(); } pub struct Barrier; impl ShouldExecute for Barrier { fn should_execute( - _origin: &MultiLocation, - _message: &mut [Instruction], + _origin: &xcm::v4::Location, + _message: &mut [xcm::v4::Instruction], _max_weight: Weight, _weight_credit: &mut Properties, ) -> Result<(), ProcessMessageError> { @@ -617,7 +625,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { diff --git a/pallets/slp/src/primitives/filecoin_primitives.rs b/pallets/slp/src/primitives/filecoin_primitives.rs index ab99bab93..ab7880001 100644 --- a/pallets/slp/src/primitives/filecoin_primitives.rs +++ b/pallets/slp/src/primitives/filecoin_primitives.rs @@ -16,10 +16,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::{CurrencyId, MultiLocation}; +use crate::CurrencyId; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_runtime::RuntimeDebug; +use xcm::v3::MultiLocation; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct FilecoinLedger { diff --git a/pallets/slp/src/primitives/parachain_staking_primitives.rs b/pallets/slp/src/primitives/parachain_staking_primitives.rs index 49ad86659..99bfa14be 100644 --- a/pallets/slp/src/primitives/parachain_staking_primitives.rs +++ b/pallets/slp/src/primitives/parachain_staking_primitives.rs @@ -16,12 +16,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::MultiLocation; use bifrost_primitives::{CurrencyId, TimeUnit}; use parity_scale_codec::{alloc::collections::BTreeMap, Decode, Encode}; use scale_info::TypeInfo; use sp_runtime::RuntimeDebug; use sp_std::vec::Vec; +use xcm::v3::MultiLocation; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct OneToManyLedger { diff --git a/pallets/slp/src/primitives/phala_primitives.rs b/pallets/slp/src/primitives/phala_primitives.rs index 8926c1dfa..9eda26110 100644 --- a/pallets/slp/src/primitives/phala_primitives.rs +++ b/pallets/slp/src/primitives/phala_primitives.rs @@ -16,10 +16,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::{MultiLocation, TimeUnit}; +use crate::TimeUnit; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_runtime::RuntimeDebug; +use xcm::v3::MultiLocation; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct PhalaLedger { diff --git a/pallets/slp/src/primitives/polkadot_primitives.rs b/pallets/slp/src/primitives/polkadot_primitives.rs index f764dc892..5e5050703 100644 --- a/pallets/slp/src/primitives/polkadot_primitives.rs +++ b/pallets/slp/src/primitives/polkadot_primitives.rs @@ -16,12 +16,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::MultiLocation; use bifrost_primitives::{CurrencyId, TimeUnit}; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_runtime::RuntimeDebug; use sp_std::vec::Vec; +use xcm::v3::MultiLocation; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct SubstrateLedger { diff --git a/pallets/slp/src/tests/kusama_tests.rs b/pallets/slp/src/tests/kusama_tests.rs index 217695b50..037f18778 100644 --- a/pallets/slp/src/tests/kusama_tests.rs +++ b/pallets/slp/src/tests/kusama_tests.rs @@ -26,6 +26,7 @@ use bifrost_primitives::{ use frame_support::{assert_noop, assert_ok, PalletId}; use orml_traits::MultiCurrency; use sp_runtime::{traits::AccountIdConversion, MultiAddress}; +use xcm::v3::{prelude::*, MultiAsset}; const SUBACCOUNT_0_32: [u8; 32] = hex_literal::hex!["5a53736d8e96f1c007cf0d630acf5209b20611617af23ce924c8e25328eb5d28"]; @@ -694,17 +695,17 @@ fn test_construct_xcm() { assert_eq!( messsage.0[1], - BuyExecution { + xcm::v3::prelude::BuyExecution { fees: MultiAsset { - id: Concrete(MultiLocation { parents: 0, interior: Here }), - fun: Fungible(10000000000) + id: Concrete(MultiLocation { parents: 0, interior: xcm::v3::prelude::Here }), + fun: xcm::v3::prelude::Fungible(10000000000) }, weight_limit: Unlimited } ); assert_eq!( messsage.0[2], - Transact { + xcm::v3::prelude::Transact { origin_kind: OriginKind::SovereignAccount, require_weight_at_most: weight, call: [26, 1, 0, 0].to_vec().into() @@ -723,17 +724,17 @@ fn test_construct_xcm() { .unwrap(); assert_eq!( messsage.0[1], - BuyExecution { + xcm::v3::prelude::BuyExecution { fees: MultiAsset { - id: Concrete(MultiLocation { parents: 0, interior: Here }), - fun: Fungible(100) + id: Concrete(MultiLocation { parents: 0, interior: xcm::v3::prelude::Here }), + fun: xcm::v3::prelude::Fungible(100) }, weight_limit: Unlimited } ); assert_eq!( messsage.0[2], - Transact { + xcm::v3::prelude::Transact { origin_kind: OriginKind::SovereignAccount, require_weight_at_most: weight, call: [26, 1, 0, 0].to_vec().into() diff --git a/pallets/slp/src/traits.rs b/pallets/slp/src/traits.rs index d83775ba8..8b1c0f426 100644 --- a/pallets/slp/src/traits.rs +++ b/pallets/slp/src/traits.rs @@ -235,7 +235,7 @@ pub trait QueryResponseManager { // False is returned. fn get_query_response_record(query_id: QueryId) -> bool; fn create_query_record( - responder: &AccountId, + responder: AccountId, call_back: Option, timeout: BlockNumber, ) -> u64; diff --git a/pallets/slpx/src/benchmarking.rs b/pallets/slpx/src/benchmarking.rs index 891d104bc..b1d50b97c 100644 --- a/pallets/slpx/src/benchmarking.rs +++ b/pallets/slpx/src/benchmarking.rs @@ -46,8 +46,8 @@ fn init_whitelist() -> (T::AccountId BalanceOf::::unique_saturated_from(100_000_000_000_000u128), )); - CurrencyIdToLocations::::insert(KSM, MultiLocation::default()); - CurrencyIdToLocations::::insert(VKSM, MultiLocation::default()); + CurrencyIdToLocations::::insert(KSM, xcm::v3::Location::default()); + CurrencyIdToLocations::::insert(VKSM, xcm::v3::Location::default()); (caller, receiver) } diff --git a/pallets/slpx/src/lib.rs b/pallets/slpx/src/lib.rs index f0a4e4a9b..f142612c0 100644 --- a/pallets/slpx/src/lib.rs +++ b/pallets/slpx/src/lib.rs @@ -51,7 +51,7 @@ use sp_runtime::{ BoundedVec, DispatchError, }; use sp_std::{vec, vec::Vec}; -use xcm::{latest::prelude::*, v3::MultiLocation}; +use xcm::v4::{prelude::*, Location}; use zenlink_protocol::AssetBalance; pub mod migration; @@ -115,10 +115,10 @@ pub mod pallet { /// type XcmSender: SendXcm; - /// Convert MultiLocation to `T::CurrencyId`. + /// Convert Location to `T::CurrencyId`. type CurrencyIdConvert: CurrencyIdMapping< CurrencyId, - MultiLocation, + xcm::v3::MultiLocation, AssetMetadata>, >; @@ -759,14 +759,12 @@ impl Pallet { xcm_weight: Weight, xcm_fee: u128, ) -> DispatchResult { - let dest = MultiLocation { - parents: 1, - interior: X1(Parachain(T::VtokenMintingInterface::get_moonbeam_parachain_id())), - }; + let dest = + Location::new(1, [Parachain(T::VtokenMintingInterface::get_moonbeam_parachain_id())]); // Moonbeam Native Token - let asset = MultiAsset { - id: Concrete(MultiLocation { parents: 0, interior: X1(PalletInstance(10)) }), + let asset = Asset { + id: AssetId::from(Location::new(0, [PalletInstance(10)])), fun: Fungible(xcm_fee), }; @@ -781,13 +779,13 @@ impl Pallet { RefundSurplus, DepositAsset { assets: AllCounted(8).into(), - beneficiary: MultiLocation { - parents: 0, - interior: X1(AccountKey20 { + beneficiary: Location::new( + 0, + [AccountKey20 { network: None, key: Sibling::from(T::ParachainId::get()).into_account_truncating(), - }), - }, + }], + ), }, ]); @@ -903,57 +901,57 @@ impl Pallet { match target_chain { TargetChain::Astar(receiver) => { let receiver = Self::h160_to_account_id(*receiver); - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::VtokenMintingInterface::get_astar_parachain_id()), AccountId32 { network: None, id: receiver.encode().try_into().unwrap() }, - ), - }; + ], + ); T::XcmTransfer::transfer(caller, currency_id, amount, dest, Unlimited)?; }, TargetChain::Hydradx(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::VtokenMintingInterface::get_hydradx_parachain_id()), AccountId32 { network: None, id: receiver.encode().try_into().unwrap() }, - ), - }; + ], + ); T::XcmTransfer::transfer(caller, currency_id, amount, dest, Unlimited)?; }, TargetChain::Interlay(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::VtokenMintingInterface::get_interlay_parachain_id()), AccountId32 { network: None, id: receiver.encode().try_into().unwrap() }, - ), - }; + ], + ); T::XcmTransfer::transfer(caller, currency_id, amount, dest, Unlimited)?; }, TargetChain::Manta(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::VtokenMintingInterface::get_manta_parachain_id()), AccountId32 { network: None, id: receiver.encode().try_into().unwrap() }, - ), - }; + ], + ); T::XcmTransfer::transfer(caller, currency_id, amount, dest, Unlimited)?; }, TargetChain::Moonbeam(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::VtokenMintingInterface::get_moonbeam_parachain_id()), AccountKey20 { network: None, key: receiver.to_fixed_bytes() }, - ), - }; + ], + ); if SupportXcmFeeList::::get().contains(¤cy_id) { T::XcmTransfer::transfer(caller, currency_id, amount, dest, Unlimited)?; } else { diff --git a/pallets/slpx/src/mock.rs b/pallets/slpx/src/mock.rs index 3243a9c8e..ee437c902 100644 --- a/pallets/slpx/src/mock.rs +++ b/pallets/slpx/src/mock.rs @@ -37,21 +37,16 @@ use orml_traits::{ location::RelativeReserveProvider, parameter_type_with_key, xcm_transfer::Transferred, MultiCurrency, XcmTransfer, }; -use sp_core::{blake2_256, ConstU128}; +use sp_core::ConstU128; use sp_runtime::{ - traits::{ - AccountIdConversion, Convert, IdentityLookup, TrailingZeroInput, UniqueSaturatedInto, - }, + traits::{Convert, IdentityLookup, UniqueSaturatedInto}, AccountId32, SaturatedConversion, }; use sp_std::vec; pub use xcm::latest::prelude::*; use xcm::{ - latest::{Junction, MultiLocation}, - opaque::latest::{ - Junction::Parachain, - Junctions::{X1, X2}, - }, + latest::{Junction, Location}, + opaque::latest::Junction::Parachain, }; use xcm_builder::FrameTransactionalProcessor; pub use xcm_builder::{EnsureXcmOrigin, FixedWeightBounds}; @@ -119,7 +114,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -292,10 +286,10 @@ impl zenlink_protocol::Config for Test { type LpGenerate = PairLpGenerate; } -pub struct AccountIdToMultiLocation; -impl Convert for AccountIdToMultiLocation { - fn convert(account_id: AccountId) -> MultiLocation { - MultiLocation::from(Junction::AccountId32 { network: None, id: account_id.into() }) +pub struct AccountIdToLocation; +impl Convert for AccountIdToLocation { + fn convert(account_id: AccountId) -> Location { + Location::from(Junction::AccountId32 { network: None, id: account_id.into() }) } } @@ -303,7 +297,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -336,26 +330,26 @@ impl xcm_executor::Config for XcmConfig { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { None }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: Location = Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } pub struct BifrostCurrencyIdConvert(sp_std::marker::PhantomData); -impl> Convert> for BifrostCurrencyIdConvert { - fn convert(id: CurrencyId) -> Option { - AssetIdMaps::::get_multi_location(id) +impl> Convert> for BifrostCurrencyIdConvert { + fn convert(id: CurrencyId) -> Option { + AssetIdMaps::::get_location(id) } } -impl> Convert> for BifrostCurrencyIdConvert { - fn convert(location: MultiLocation) -> Option { +impl> Convert> for BifrostCurrencyIdConvert { + fn convert(location: Location) -> Option { AssetIdMaps::::get_currency_id(location) } } @@ -367,7 +361,7 @@ impl orml_xtokens::Config for Test { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = BifrostCurrencyIdConvert; - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = DoNothingExecuteXcm; @@ -375,8 +369,10 @@ impl orml_xtokens::Config for Test { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } ord_parameter_types! { @@ -389,48 +385,6 @@ impl bifrost_asset_registry::Config for Test { type WeightInfo = (); } -pub struct SubAccountIndexMultiLocationConvertor; -impl Convert<(u16, CurrencyId), MultiLocation> for SubAccountIndexMultiLocationConvertor { - fn convert((sub_account_index, currency_id): (u16, CurrencyId)) -> MultiLocation { - match currency_id { - CurrencyId::Token(TokenSymbol::MOVR) => MultiLocation::new( - 1, - X2( - Parachain(2023), - Junction::AccountKey20 { - network: None, - key: Slp::derivative_account_id_20( - hex!["7369626cd1070000000000000000000000000000"].into(), - sub_account_index, - ) - .into(), - }, - ), - ), - _ => MultiLocation::new( - 1, - X1(Junction::AccountId32 { - network: None, - id: Self::derivative_account_id( - ParaId::from(2001u32).into_account_truncating(), - sub_account_index, - ) - .into(), - }), - ), - } - } -} - -// Mock Utility::derivative_account_id function. -impl SubAccountIndexMultiLocationConvertor { - pub fn derivative_account_id(who: AccountId, index: u16) -> AccountId { - let entropy = (b"modlpy/utilisuba", who, index).using_encoded(blake2_256); - Decode::decode(&mut TrailingZeroInput::new(entropy.as_ref())) - .expect("infinite length input; no invalid inputs for type; qed") - } -} - pub struct ParachainId; impl Get for ParachainId { fn get() -> ParaId { @@ -445,12 +399,12 @@ parameter_types! { } pub struct SubstrateResponseManager; -impl QueryResponseManager for SubstrateResponseManager { +impl QueryResponseManager for SubstrateResponseManager { fn get_query_response_record(_query_id: QueryId) -> bool { Default::default() } fn create_query_record( - _responder: &MultiLocation, + _responder: Location, _call_back: Option, _timeout: u64, ) -> u64 { @@ -470,7 +424,7 @@ impl bifrost_slp::Config for Test { type WeightInfo = (); type VtokenMinting = VtokenMinting; type BifrostSlpx = Slpx; - type AccountConverter = SubAccountIndexMultiLocationConvertor; + type AccountConverter = (); type ParachainId = ParachainId; type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; @@ -488,7 +442,7 @@ impl bifrost_slp::Config for Test { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Test { @@ -566,7 +520,7 @@ impl XcmTransfer for XTokensMock { who: AccountId, currency_id: CurrencyId, amount: Balance, - dest: MultiLocation, + dest: Location, _dest_weight_limit: WeightLimit, ) -> Result, DispatchError> { Currencies::withdraw(currency_id, &who, amount).ok(); @@ -574,15 +528,15 @@ impl XcmTransfer for XTokensMock { Ok(Transferred { sender: who, assets: Default::default(), - fee: MultiAsset { id: [0u8; 32].into(), fun: Fungible(0u128) }, + fee: Asset { id: AssetId(Location::new(1, Here)), fun: Fungible(0u128) }, dest, }) } fn transfer_multiasset( _who: AccountId, - _asset: MultiAsset, - _dest: MultiLocation, + _asset: Asset, + _dest: Location, _dest_weight_limit: WeightLimit, ) -> Result, DispatchError> { todo!() @@ -593,7 +547,7 @@ impl XcmTransfer for XTokensMock { _currency_id: CurrencyId, _amount: Balance, _fee: Balance, - _dest: MultiLocation, + _dest: Location, _dest_weight_limit: WeightLimit, ) -> Result, DispatchError> { todo!() @@ -601,9 +555,9 @@ impl XcmTransfer for XTokensMock { fn transfer_multiasset_with_fee( _who: AccountId, - _asset: MultiAsset, - _fee: MultiAsset, - _dest: MultiLocation, + _asset: Asset, + _fee: Asset, + _dest: Location, _dest_weight_limit: WeightLimit, ) -> Result, DispatchError> { todo!() @@ -613,7 +567,7 @@ impl XcmTransfer for XTokensMock { _who: AccountId, _currencies: Vec<(CurrencyId, Balance)>, _fee_item: u32, - _dest: MultiLocation, + _dest: Location, _dest_weight_limit: WeightLimit, ) -> Result, DispatchError> { todo!() @@ -621,9 +575,9 @@ impl XcmTransfer for XTokensMock { fn transfer_multiassets( _who: AccountId, - _assets: cumulus_primitives_core::MultiAssets, - _fee: MultiAsset, - _dest: MultiLocation, + _assets: Assets, + _fee: Asset, + _dest: Location, _dest_weight_limit: WeightLimit, ) -> Result, DispatchError> { todo!() diff --git a/pallets/stable-asset/src/mock.rs b/pallets/stable-asset/src/mock.rs index 4c6769d34..ef1811eff 100644 --- a/pallets/stable-asset/src/mock.rs +++ b/pallets/stable-asset/src/mock.rs @@ -63,7 +63,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); } diff --git a/pallets/stable-pool/rpc/src/lib.rs b/pallets/stable-pool/rpc/src/lib.rs index 6e35b4d15..05e4906a4 100644 --- a/pallets/stable-pool/rpc/src/lib.rs +++ b/pallets/stable-pool/rpc/src/lib.rs @@ -23,7 +23,7 @@ pub use bifrost_stable_pool_rpc_runtime_api::{self as runtime_api, StablePoolRun use jsonrpsee::{ core::{async_trait, RpcResult}, proc_macros::rpc, - types::error::{CallError, ErrorCode, ErrorObject}, + types::error::{ErrorCode, ErrorObject}, }; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; @@ -87,13 +87,12 @@ where match rs { Ok(amount) => Ok(NumberOrHex::Hex(amount.into())), - Err(e) => Err(CallError::Custom(ErrorObject::owned( + Err(e) => Err(ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get stable_pool swap output amount.", Some(format!("{:?}", e)), - ))), + )), } - .map_err(|e| jsonrpsee::core::Error::Call(e)) } fn add_liquidity_amount( @@ -109,12 +108,11 @@ where match rs { Ok(amount) => Ok(NumberOrHex::Hex(amount.into())), - Err(e) => Err(CallError::Custom(ErrorObject::owned( + Err(e) => Err(ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get stable_pool add liquidity amount.", Some(format!("{:?}", e)), - ))), + )), } - .map_err(|e| jsonrpsee::core::Error::Call(e)) } } diff --git a/pallets/stable-pool/src/mock.rs b/pallets/stable-pool/src/mock.rs index 7f5730fec..b5f3e9c6e 100644 --- a/pallets/stable-pool/src/mock.rs +++ b/pallets/stable-pool/src/mock.rs @@ -31,10 +31,7 @@ use frame_support::{ use frame_system::{EnsureRoot, EnsureSignedBy}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_runtime::{traits::IdentityLookup, BuildStorage}; -use xcm::{ - prelude::*, - v3::{MultiLocation, Weight}, -}; +use xcm::{prelude::*, v3::Weight}; use xcm_builder::{FixedWeightBounds, FrameTransactionalProcessor}; use xcm_executor::XcmExecutor; @@ -119,7 +116,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -152,16 +149,16 @@ impl xcm_executor::Config for XcmConfig { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: xcm::v4::Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: xcm::v4::Location = xcm::v4::Location::here(); // pub const BaseXcmWeight: Weight = Weight::from_ref_time(1000_000_000u64); pub const MaxAssetsForTransfer: usize = 2; - // pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + // pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } impl orml_xtokens::Config for Test { @@ -169,7 +166,7 @@ impl orml_xtokens::Config for Test { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = (); - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -177,8 +174,10 @@ impl orml_xtokens::Config for Test { type BaseXcmWeight = (); type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } parameter_types! { @@ -203,7 +202,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -311,11 +309,6 @@ impl SlpOperator for Slp { } } -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Test { type RuntimeEvent = RuntimeEvent; type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; diff --git a/pallets/system-maker/src/mock.rs b/pallets/system-maker/src/mock.rs index 752ce7695..0338a3068 100644 --- a/pallets/system-maker/src/mock.rs +++ b/pallets/system-maker/src/mock.rs @@ -36,12 +36,9 @@ use frame_support::{ use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; -use parity_scale_codec::{Decode, Encode}; -use sp_core::{hashing::blake2_256, ConstU32}; +use sp_core::ConstU32; use sp_runtime::{ - traits::{ - AccountIdConversion, Convert, IdentityLookup, TrailingZeroInput, UniqueSaturatedInto, - }, + traits::{AccountIdConversion, IdentityLookup, UniqueSaturatedInto}, AccountId32, BuildStorage, SaturatedConversion, }; use sp_std::marker::PhantomData; @@ -135,7 +132,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -191,48 +187,6 @@ impl Get for ParaInfo { } } -pub struct SubAccountIndexMultiLocationConvertor; -impl Convert<(u16, CurrencyId), MultiLocation> for SubAccountIndexMultiLocationConvertor { - fn convert((sub_account_index, currency_id): (u16, CurrencyId)) -> MultiLocation { - match currency_id { - CurrencyId::Token(TokenSymbol::MOVR) => MultiLocation::new( - 1, - X2( - Parachain(2023), - AccountKey20 { - network: None, - key: Slp::derivative_account_id_20( - hex!["7369626cd1070000000000000000000000000000"].into(), - sub_account_index, - ) - .into(), - }, - ), - ), - _ => MultiLocation::new( - 1, - X1(Junction::AccountId32 { - network: None, - id: Self::derivative_account_id( - ParaId::from(2001u32).into_account_truncating(), - sub_account_index, - ) - .into(), - }), - ), - } - } -} - -// Mock Utility::derivative_account_id function. -impl SubAccountIndexMultiLocationConvertor { - pub fn derivative_account_id(who: AccountId, index: u16) -> AccountId { - let entropy = (b"modlpy/utilisuba", who, index).using_encoded(blake2_256); - Decode::decode(&mut TrailingZeroInput::new(entropy.as_ref())) - .expect("infinite length input; no invalid inputs for type; qed") - } -} - pub struct ParachainId; impl Get for ParachainId { fn get() -> ParaId { @@ -247,12 +201,12 @@ parameter_types! { } pub struct SubstrateResponseManager; -impl QueryResponseManager for SubstrateResponseManager { +impl QueryResponseManager for SubstrateResponseManager { fn get_query_response_record(_query_id: QueryId) -> bool { Default::default() } fn create_query_record( - _responder: &MultiLocation, + _responder: Location, _call_back: Option, _timeout: u64, ) -> u64 { @@ -279,7 +233,7 @@ impl bifrost_slp::Config for Runtime { type WeightInfo = (); type VtokenMinting = VtokenMinting; type BifrostSlpx = SlpxInterface; - type AccountConverter = SubAccountIndexMultiLocationConvertor; + type AccountConverter = (); type ParachainId = ParachainId; type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; @@ -296,13 +250,13 @@ impl bifrost_slp::Config for Runtime { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: Location = Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } @@ -312,7 +266,7 @@ impl orml_xtokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = (); - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -320,8 +274,10 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } parameter_types! { @@ -445,7 +401,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -479,7 +435,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { diff --git a/pallets/system-staking/src/mock.rs b/pallets/system-staking/src/mock.rs index 26fc8a7b7..f97152b5e 100644 --- a/pallets/system-staking/src/mock.rs +++ b/pallets/system-staking/src/mock.rs @@ -33,10 +33,9 @@ use frame_support::{ use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; -use parity_scale_codec::{Decode, Encode}; -use sp_core::{blake2_256, ConstU32}; +use sp_core::ConstU32; use sp_runtime::{ - traits::{AccountIdConversion, Convert, ConvertInto, IdentityLookup, TrailingZeroInput}, + traits::{ConvertInto, IdentityLookup}, AccountId32, BuildStorage, }; use sp_std::vec; @@ -117,7 +116,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -141,13 +139,13 @@ impl orml_tokens::Config for Runtime { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: Location = Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } @@ -157,7 +155,7 @@ impl orml_xtokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = (); - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -165,8 +163,10 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } parameter_types! { @@ -219,48 +219,6 @@ impl bifrost_asset_registry::Config for Runtime { type WeightInfo = (); } -pub struct SubAccountIndexMultiLocationConvertor; -impl Convert<(u16, CurrencyId), MultiLocation> for SubAccountIndexMultiLocationConvertor { - fn convert((sub_account_index, currency_id): (u16, CurrencyId)) -> MultiLocation { - match currency_id { - CurrencyId::Token(TokenSymbol::MOVR) => MultiLocation::new( - 1, - X2( - Parachain(2023), - AccountKey20 { - network: None, - key: Slp::derivative_account_id_20( - hex!["7369626cd1070000000000000000000000000000"].into(), - sub_account_index, - ) - .into(), - }, - ), - ), - _ => MultiLocation::new( - 1, - X1(Junction::AccountId32 { - network: None, - id: Self::derivative_account_id( - ParaId::from(2001u32).into_account_truncating(), - sub_account_index, - ) - .into(), - }), - ), - } - } -} - -// Mock Utility::derivative_account_id function. -impl SubAccountIndexMultiLocationConvertor { - pub fn derivative_account_id(who: AccountId, index: u16) -> AccountId { - let entropy = (b"modlpy/utilisuba", who, index).using_encoded(blake2_256); - Decode::decode(&mut TrailingZeroInput::new(entropy.as_ref())) - .expect("infinite length input; no invalid inputs for type; qed") - } -} - pub struct ParachainId; impl Get for ParachainId { fn get() -> ParaId { @@ -275,12 +233,12 @@ parameter_types! { } pub struct SubstrateResponseManager; -impl QueryResponseManager for SubstrateResponseManager { +impl QueryResponseManager for SubstrateResponseManager { fn get_query_response_record(_query_id: QueryId) -> bool { Default::default() } fn create_query_record( - _responder: &MultiLocation, + _responder: Location, _call_back: Option, _timeout: u64, ) -> u64 { @@ -307,7 +265,7 @@ impl bifrost_slp::Config for Runtime { type WeightInfo = (); type VtokenMinting = VtokenMinting; type BifrostSlpx = SlpxInterface; - type AccountConverter = SubAccountIndexMultiLocationConvertor; + type AccountConverter = (); type ParachainId = ParachainId; type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; @@ -377,7 +335,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -411,7 +369,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { diff --git a/pallets/token-issuer/src/mock.rs b/pallets/token-issuer/src/mock.rs index 89bc83c28..b110b7b22 100644 --- a/pallets/token-issuer/src/mock.rs +++ b/pallets/token-issuer/src/mock.rs @@ -100,7 +100,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/pallets/ve-minting/rpc/src/lib.rs b/pallets/ve-minting/rpc/src/lib.rs index 4d0f99c1a..d55fe6b5d 100644 --- a/pallets/ve-minting/rpc/src/lib.rs +++ b/pallets/ve-minting/rpc/src/lib.rs @@ -23,7 +23,7 @@ pub use bifrost_ve_minting_rpc_runtime_api::{self as runtime_api, VeMintingRunti use jsonrpsee::{ core::{async_trait, RpcResult}, proc_macros::rpc, - types::error::{CallError, ErrorCode, ErrorObject}, + types::error::{ErrorCode, ErrorObject}, }; use parity_scale_codec::Codec; use sp_api::ProvideRuntimeApi; @@ -90,24 +90,23 @@ where None => None, }) .map_err(|e| { - jsonrpsee::core::Error::Call(CallError::Custom(ErrorObject::owned( + ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get balance_of.", Some(format!("{:?}", e)), - ))) + ) })?; let rs: Result = lm_rpc_api.balance_of(at, who, block_number); match rs { Ok(balane) => Ok(NumberOrHex::Hex(balane.into())), - Err(e) => Err(CallError::Custom(ErrorObject::owned( + Err(e) => Err(ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get balance_of.", Some(format!("{:?}", e)), - ))), + )), } - .map_err(|e| jsonrpsee::core::Error::Call(e)) } fn total_supply(&self, at: Option<::Hash>) -> RpcResult { @@ -121,24 +120,23 @@ where None => None, }) .map_err(|e| { - jsonrpsee::core::Error::Call(CallError::Custom(ErrorObject::owned( + ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get total_supply.", Some(format!("{:?}", e)), - ))) + ) })?; let rs: Result = lm_rpc_api.total_supply(at, block_number.expect("no block found")); match rs { Ok(supply) => Ok(NumberOrHex::Hex(supply.into())), - Err(e) => Err(CallError::Custom(ErrorObject::owned( + Err(e) => Err(ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get total_supply.", Some(format!("{:?}", e)), - ))), + )), } - .map_err(|e| jsonrpsee::core::Error::Call(e)) } fn find_block_epoch( @@ -156,23 +154,22 @@ where None => None, }) .map_err(|e| { - jsonrpsee::core::Error::Call(CallError::Custom(ErrorObject::owned( + ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get find_block_epoch.", Some(format!("{:?}", e)), - ))) + ) })?; let rs: Result = lm_rpc_api.find_block_epoch(at, block_number.expect("no block found"), max_epoch); match rs { Ok(epoch) => Ok(NumberOrHex::Hex(epoch.into())), - Err(e) => Err(CallError::Custom(ErrorObject::owned( + Err(e) => Err(ErrorObject::owned( ErrorCode::InternalError.code(), "Failed to get find_block_epoch.", Some(format!("{:?}", e)), - ))), + )), } - .map_err(|e| jsonrpsee::core::Error::Call(e)) } } diff --git a/pallets/ve-minting/src/mock.rs b/pallets/ve-minting/src/mock.rs index aaa995d5b..2ceee398f 100644 --- a/pallets/ve-minting/src/mock.rs +++ b/pallets/ve-minting/src/mock.rs @@ -39,10 +39,9 @@ use frame_support::{ use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; -use parity_scale_codec::{Decode, Encode}; -use sp_core::{blake2_256, ConstU32}; +use sp_core::ConstU32; use sp_runtime::{ - traits::{AccountIdConversion, Convert, ConvertInto, IdentityLookup, TrailingZeroInput}, + traits::{ConvertInto, IdentityLookup}, AccountId32, BuildStorage, }; use xcm::{prelude::*, v3::Weight}; @@ -125,7 +124,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -160,13 +158,13 @@ impl orml_tokens::Config for Runtime { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: Location = Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } @@ -176,7 +174,7 @@ impl orml_xtokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = (); - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -184,8 +182,10 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } parameter_types! { @@ -271,48 +271,6 @@ impl bifrost_ve_minting::Config for Runtime { type MarkupRefreshLimit = MarkupRefreshLimit; } -pub struct SubAccountIndexMultiLocationConvertor; -impl Convert<(u16, CurrencyId), MultiLocation> for SubAccountIndexMultiLocationConvertor { - fn convert((sub_account_index, currency_id): (u16, CurrencyId)) -> MultiLocation { - match currency_id { - CurrencyId::Token(TokenSymbol::MOVR) => MultiLocation::new( - 1, - X2( - Parachain(2023), - AccountKey20 { - network: None, - key: Slp::derivative_account_id_20( - hex_literal::hex!["7369626cd1070000000000000000000000000000"].into(), - sub_account_index, - ) - .into(), - }, - ), - ), - _ => MultiLocation::new( - 1, - X1(Junction::AccountId32 { - network: None, - id: Self::derivative_account_id( - ParaId::from(2001u32).into_account_truncating(), - sub_account_index, - ) - .into(), - }), - ), - } - } -} - -// Mock Utility::derivative_account_id function. -impl SubAccountIndexMultiLocationConvertor { - pub fn derivative_account_id(who: AccountId, index: u16) -> AccountId { - let entropy = (b"modlpy/utilisuba", who, index).using_encoded(blake2_256); - Decode::decode(&mut TrailingZeroInput::new(entropy.as_ref())) - .expect("infinite length input; no invalid inputs for type; qed") - } -} - pub struct ParachainId; impl Get for ParachainId { fn get() -> ParaId { @@ -327,12 +285,12 @@ parameter_types! { } pub struct SubstrateResponseManager; -impl QueryResponseManager for SubstrateResponseManager { +impl QueryResponseManager for SubstrateResponseManager { fn get_query_response_record(_query_id: QueryId) -> bool { Default::default() } fn create_query_record( - _responder: &MultiLocation, + _responder: Location, _call_back: Option, _timeout: u64, ) -> u64 { @@ -364,7 +322,7 @@ impl bifrost_slp::Config for Runtime { type WeightInfo = (); type VtokenMinting = VtokenMinting; type BifrostSlpx = SlpxInterface; - type AccountConverter = SubAccountIndexMultiLocationConvertor; + type AccountConverter = (); type ParachainId = ParachainId; type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; @@ -384,7 +342,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -418,7 +376,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { diff --git a/pallets/vesting/src/mock.rs b/pallets/vesting/src/mock.rs index b717801af..8ed458342 100644 --- a/pallets/vesting/src/mock.rs +++ b/pallets/vesting/src/mock.rs @@ -64,7 +64,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = (); } parameter_types! { pub const MinVestedTransfer: u64 = 256 * 2; diff --git a/pallets/vstoken-conversion/src/mock.rs b/pallets/vstoken-conversion/src/mock.rs index ad49b14eb..0e9fa07d8 100644 --- a/pallets/vstoken-conversion/src/mock.rs +++ b/pallets/vstoken-conversion/src/mock.rs @@ -96,7 +96,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/pallets/vtoken-minting/src/lib.rs b/pallets/vtoken-minting/src/lib.rs index 1865d42ba..ab9147878 100644 --- a/pallets/vtoken-minting/src/lib.rs +++ b/pallets/vtoken-minting/src/lib.rs @@ -58,6 +58,7 @@ pub use pallet::*; use sp_core::U256; use sp_std::{vec, vec::Vec}; pub use traits::*; +use xcm::v3::MultiLocation; pub type AccountIdOf = ::AccountId; @@ -78,7 +79,7 @@ pub mod pallet { use bifrost_primitives::{currency::BNC, FIL}; use frame_support::pallet_prelude::DispatchResultWithPostInfo; use orml_traits::XcmTransfer; - use xcm::{prelude::*, v3::MultiLocation}; + use xcm::{prelude::*, v4::Location}; #[pallet::pallet] pub struct Pallet(_); @@ -1268,16 +1269,16 @@ pub mod pallet { match redeem_type { RedeemType::Native => {}, RedeemType::Astar(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::AstarParachainId::get()), AccountId32 { network: None, id: receiver.encode().try_into().unwrap(), }, - ), - }; + ], + ); T::XcmTransfer::transfer( account.clone(), token_id, @@ -1288,16 +1289,16 @@ pub mod pallet { redeem_to = RedeemTo::Astar(receiver); }, RedeemType::Hydradx(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::HydradxParachainId::get()), AccountId32 { network: None, id: receiver.encode().try_into().unwrap(), }, - ), - }; + ], + ); T::XcmTransfer::transfer( account.clone(), token_id, @@ -1308,16 +1309,16 @@ pub mod pallet { redeem_to = RedeemTo::Hydradx(receiver); }, RedeemType::Interlay(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::InterlayParachainId::get()), AccountId32 { network: None, id: receiver.encode().try_into().unwrap(), }, - ), - }; + ], + ); T::XcmTransfer::transfer( account.clone(), token_id, @@ -1328,16 +1329,16 @@ pub mod pallet { redeem_to = RedeemTo::Interlay(receiver); }, RedeemType::Manta(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::MantaParachainId::get()), AccountId32 { network: None, id: receiver.encode().try_into().unwrap(), }, - ), - }; + ], + ); T::XcmTransfer::transfer( account.clone(), token_id, @@ -1348,13 +1349,13 @@ pub mod pallet { redeem_to = RedeemTo::Manta(receiver); }, RedeemType::Moonbeam(receiver) => { - let dest = MultiLocation { - parents: 1, - interior: X2( + let dest = Location::new( + 1, + [ Parachain(T::MoonbeamParachainId::get()), AccountKey20 { network: None, key: receiver.to_fixed_bytes() }, - ), - }; + ], + ); if token_id == FIL { let assets = vec![ (token_id, unlock_amount), diff --git a/pallets/vtoken-minting/src/mock.rs b/pallets/vtoken-minting/src/mock.rs index 0abb93c7f..e1362b799 100644 --- a/pallets/vtoken-minting/src/mock.rs +++ b/pallets/vtoken-minting/src/mock.rs @@ -40,10 +40,8 @@ use frame_support::{ use frame_system::{EnsureRoot, EnsureSignedBy}; use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; -use parity_scale_codec::{Decode, Encode}; -use sp_core::blake2_256; use sp_runtime::{ - traits::{AccountIdConversion, ConstU32, Convert, IdentityLookup, TrailingZeroInput}, + traits::{ConstU32, IdentityLookup}, AccountId32, BuildStorage, DispatchError, DispatchResult, }; use xcm::{prelude::*, v3::Weight}; @@ -126,7 +124,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -166,13 +163,13 @@ impl orml_tokens::Config for Runtime { } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } parameter_types! { - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfRelativeLocation: Location = Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } @@ -182,7 +179,7 @@ impl orml_xtokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = (); - type AccountIdToMultiLocation = (); + type AccountIdToLocation = (); type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -190,8 +187,10 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } parameter_types! { @@ -248,49 +247,6 @@ impl bifrost_asset_registry::Config for Runtime { type RegisterOrigin = EnsureSignedBy; type WeightInfo = (); } - -pub struct SubAccountIndexMultiLocationConvertor; -impl Convert<(u16, CurrencyId), MultiLocation> for SubAccountIndexMultiLocationConvertor { - fn convert((sub_account_index, currency_id): (u16, CurrencyId)) -> MultiLocation { - match currency_id { - CurrencyId::Token(TokenSymbol::MOVR) => MultiLocation::new( - 1, - X2( - Parachain(2023), - AccountKey20 { - network: None, - key: Slp::derivative_account_id_20( - hex!["7369626cd1070000000000000000000000000000"].into(), - sub_account_index, - ) - .into(), - }, - ), - ), - _ => MultiLocation::new( - 1, - X1(Junction::AccountId32 { - network: None, - id: Self::derivative_account_id( - ParaId::from(2001u32).into_account_truncating(), - sub_account_index, - ) - .into(), - }), - ), - } - } -} - -// Mock Utility::derivative_account_id function. -impl SubAccountIndexMultiLocationConvertor { - pub fn derivative_account_id(who: AccountId, index: u16) -> AccountId { - let entropy = (b"modlpy/utilisuba", who, index).using_encoded(blake2_256); - Decode::decode(&mut TrailingZeroInput::new(entropy.as_ref())) - .expect("infinite length input; no invalid inputs for type; qed") - } -} - pub struct ParachainId; impl Get for ParachainId { fn get() -> ParaId { @@ -305,12 +261,12 @@ parameter_types! { } pub struct SubstrateResponseManager; -impl QueryResponseManager for SubstrateResponseManager { +impl QueryResponseManager for SubstrateResponseManager { fn get_query_response_record(_query_id: QueryId) -> bool { Default::default() } fn create_query_record( - _responder: &MultiLocation, + _responder: Location, _call_back: Option, _timeout: u64, ) -> u64 { @@ -342,7 +298,7 @@ impl bifrost_slp::Config for Runtime { type WeightInfo = (); type VtokenMinting = VtokenMinting; type BifrostSlpx = SlpxInterface; - type AccountConverter = SubAccountIndexMultiLocationConvertor; + type AccountConverter = (); type ParachainId = ParachainId; type SubstrateResponseManager = SubstrateResponseManager; type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; @@ -362,7 +318,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -396,7 +352,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { diff --git a/pallets/vtoken-voting/src/benchmarking.rs b/pallets/vtoken-voting/src/benchmarking.rs index 54e0392b8..72159e0e5 100644 --- a/pallets/vtoken-voting/src/benchmarking.rs +++ b/pallets/vtoken-voting/src/benchmarking.rs @@ -52,8 +52,8 @@ fn init_vote(vtoken: CurrencyIdOf) -> Result<(), BenchmarkError> { Some((Weight::from_parts(4000000000, 100000), 4000000000u32.into())), )?; T::DerivativeAccount::init_minimums_and_maximums(token); - T::DerivativeAccount::add_delegator(token, derivative_index, Parent.into()); - T::DerivativeAccount::new_delegator_ledger(token, Parent.into()); + T::DerivativeAccount::add_delegator(token, derivative_index, xcm::v3::Parent.into()); + T::DerivativeAccount::new_delegator_ledger(token, xcm::v3::Parent.into()); Pallet::::set_undeciding_timeout(RawOrigin::Root.into(), vtoken, Zero::zero())?; Pallet::::add_delegator(RawOrigin::Root.into(), vtoken, derivative_index)?; Pallet::::set_vote_cap_ratio(RawOrigin::Root.into(), vtoken, Perbill::from_percent(10))?; @@ -250,7 +250,7 @@ mod benchmarks { T::DerivativeAccount::add_delegator( CurrencyId::to_token(&vtoken).unwrap(), derivative_index, - Parent.into(), + xcm::v3::Parent.into(), ); #[extrinsic_call] diff --git a/pallets/vtoken-voting/src/lib.rs b/pallets/vtoken-voting/src/lib.rs index 711295d41..3cd4ea416 100644 --- a/pallets/vtoken-voting/src/lib.rs +++ b/pallets/vtoken-voting/src/lib.rs @@ -30,7 +30,7 @@ mod tests; mod call; mod vote; -pub mod migration; +// pub mod migration; pub mod weights; use crate::vote::{Casting, Tally, Voting}; @@ -61,7 +61,7 @@ use sp_runtime::{ }; use sp_std::prelude::*; pub use weights::WeightInfo; -use xcm::v3::{prelude::*, Weight as XcmWeight}; +use xcm::v4::{prelude::*, Weight as XcmWeight}; const CONVICTION_VOTING_ID: LockIdentifier = *b"vtvoting"; @@ -109,7 +109,7 @@ pub mod pallet { type ResponseOrigin: EnsureOrigin< ::RuntimeOrigin, - Success = MultiLocation, + Success = xcm::v4::Location, >; type XcmDestWeightAndFee: XcmDestWeightAndFeeHandler, BalanceOf>; @@ -194,7 +194,7 @@ pub mod pallet { success: bool, }, ResponseReceived { - responder: MultiLocation, + responder: xcm::v4::Location, query_id: QueryId, response: Response, }, @@ -1010,7 +1010,7 @@ pub mod pallet { extra_fee: BalanceOf, f: impl FnOnce(QueryId) -> (), ) -> DispatchResult { - let responder = MultiLocation::parent(); + let responder = xcm::v4::Location::parent(); let now = frame_system::Pallet::::block_number(); let timeout = now.saturating_add(T::QueryTimeout::get()); let notify_runtime_call = ::RuntimeCall::from(notify_call); @@ -1019,7 +1019,7 @@ pub mod pallet { responder, notify_runtime_call, timeout, - Here, + xcm::v4::Junctions::Here, ); f(query_id); @@ -1032,8 +1032,8 @@ pub mod pallet { query_id, )?; - send_xcm::(Parent.into(), xcm_message) - .map_err(|_| Error::::XcmFailure)?; + xcm::v4::send_xcm::(Parent.into(), xcm_message) + .map_err(|_e| Error::::XcmFailure)?; Ok(()) } @@ -1046,11 +1046,11 @@ pub mod pallet { query_id: QueryId, ) -> Result, Error> { let para_id = T::ParachainId::get().into(); - let asset = MultiAsset { - id: Concrete(MultiLocation::here()), + let asset = Asset { + id: AssetId(Location::here()), fun: Fungible(UniqueSaturatedInto::::unique_saturated_into(extra_fee)), }; - let xcm_message = vec![ + let xcm_message = sp_std::vec![ WithdrawAsset(asset.clone().into()), BuyExecution { fees: asset, weight_limit: Unlimited }, Transact { @@ -1059,14 +1059,14 @@ pub mod pallet { call: call.into(), }, ReportTransactStatus(QueryResponseInfo { - destination: MultiLocation::from(X1(Parachain(para_id))), + destination: Location::from(Parachain(para_id)), query_id, max_weight: notify_call_weight, }), RefundSurplus, DepositAsset { assets: All.into(), - beneficiary: MultiLocation { parents: 0, interior: X1(Parachain(para_id)) }, + beneficiary: Location::new(0, [Parachain(para_id)]), }, ]; @@ -1154,9 +1154,10 @@ pub mod pallet { fn ensure_xcm_response_or_governance( origin: OriginFor, - ) -> Result { - let responder = T::ResponseOrigin::ensure_origin(origin.clone()) - .or_else(|_| T::ControlOrigin::ensure_origin(origin).map(|_| Here.into()))?; + ) -> Result { + let responder = T::ResponseOrigin::ensure_origin(origin.clone()).or_else(|_| { + T::ControlOrigin::ensure_origin(origin).map(|_| xcm::v4::Junctions::Here.into()) + })?; Ok(responder) } diff --git a/pallets/vtoken-voting/src/mock.rs b/pallets/vtoken-voting/src/mock.rs index a936341df..f7d01b235 100644 --- a/pallets/vtoken-voting/src/mock.rs +++ b/pallets/vtoken-voting/src/mock.rs @@ -39,7 +39,7 @@ use sp_runtime::{ traits::{BlockNumberProvider, ConstU32, IdentityLookup}, BuildStorage, Perbill, }; -use xcm::prelude::*; +use xcm::{prelude::*, v3::MultiLocation}; use xcm_builder::{FixedWeightBounds, FrameTransactionalProcessor}; use xcm_executor::XcmExecutor; @@ -110,7 +110,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } @@ -142,7 +141,7 @@ parameter_types! { // One XCM operation is 200_000_000 XcmWeight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(2001)); + pub UniversalLocation: InteriorLocation = Parachain(2001).into(); } pub struct XcmConfig; @@ -176,7 +175,7 @@ impl xcm_executor::Config for XcmConfig { #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { @@ -248,7 +247,7 @@ impl DerivativeAccountHandler for DerivativeAccount { _token: CurrencyId, _derivative_index: DerivativeIndex, ) -> Option { - Some(Parent.into()) + Some(xcm::v3::Parent.into()) } fn get_stake_info( diff --git a/pallets/xcm-interface/src/calls.rs b/pallets/xcm-interface/src/calls.rs index ffb540298..6165bb820 100644 --- a/pallets/xcm-interface/src/calls.rs +++ b/pallets/xcm-interface/src/calls.rs @@ -20,6 +20,7 @@ use frame_support::sp_runtime::MultiSignature; use parity_scale_codec::{Decode, Encode}; use sp_runtime::RuntimeDebug; use sp_std::vec::Vec; +use xcm::{VersionedAssets, VersionedLocation}; use crate::ChainId; @@ -37,6 +38,23 @@ pub enum StakingCall { WithdrawUnbonded(u32), } +#[derive(Encode, Decode, RuntimeDebug, Clone)] +pub enum PolkadotXcm { + #[codec(index = 2)] + ReserveTransferAssets( + Box, + Box, + Box, + u32, + ), +} + +#[derive(Encode, Decode, RuntimeDebug, Clone)] +pub enum SystemCall { + #[codec(index = 7)] + RemarkWithEvent(Vec), +} + pub mod rococo { pub use crate::calls::*; diff --git a/pallets/xcm-interface/src/lib.rs b/pallets/xcm-interface/src/lib.rs index 2965f267e..e7ea013fc 100644 --- a/pallets/xcm-interface/src/lib.rs +++ b/pallets/xcm-interface/src/lib.rs @@ -63,7 +63,7 @@ pub mod pallet { use sp_runtime::{traits::Convert, DispatchError}; use sp_std::{convert::From, prelude::*, vec, vec::Vec}; use xcm::{ - v3::{prelude::*, ExecuteXcm, Parent}, + v4::{prelude::*, Asset, ExecuteXcm, Location}, DoubleEncoded, VersionedXcm, }; @@ -92,8 +92,8 @@ pub mod pallet { /// XCM executor. type XcmExecutor: ExecuteXcm<::RuntimeCall>; - /// Convert `T::AccountId` to `MultiLocation`. - type AccountIdToMultiLocation: Convert, MultiLocation>; + /// Convert `T::AccountId` to `Location`. + type AccountIdToLocation: Convert, Location>; /// Salp call encode type SalpHelper: SalpHelper< @@ -102,10 +102,10 @@ pub mod pallet { BalanceOf, >; - /// Convert MultiLocation to `T::CurrencyId`. + /// Convert Location to `T::CurrencyId`. type CurrencyIdConvert: CurrencyIdMapping< CurrencyIdOf, - MultiLocation, + xcm::v3::MultiLocation, AssetMetadata>, >; @@ -126,6 +126,8 @@ pub mod pallet { XcmSendFailed, OperationWeightAndFeeNotExist, FailToConvert, + UnweighableMessage, + LocalExecutionIncomplete, } #[pallet::event] @@ -219,13 +221,13 @@ pub mod pallet { TryInto::::try_into(amount).map_err(|_| Error::::FeeConvertFailed)?; // get currency_id from asset_id - let asset_location = MultiLocation::new( + let asset_location = Location::new( 1, - X3( + [ Parachain(parachains::Statemine::ID), PalletInstance(parachains::Statemine::PALLET_ID), GeneralIndex(asset_id.into()), - ), + ], ); let currency_id = T::CurrencyIdConvert::get_currency_id(asset_location) .ok_or(Error::::FailToConvert)?; @@ -233,7 +235,7 @@ pub mod pallet { // first, we need to withdraw the statemine asset from the user's account T::MultiCurrency::withdraw(currency_id, &who, amount)?; - let dst_location = T::AccountIdToMultiLocation::convert(dest.clone()); + let dst_location = T::AccountIdToLocation::convert(dest.clone()); let (dest_weight, xcm_fee) = Self::xcm_dest_weight_and_fee( T::RelaychainCurrencyId::get(), @@ -244,35 +246,30 @@ pub mod pallet { let xcm_fee_u128 = TryInto::::try_into(xcm_fee).map_err(|_| Error::::FeeConvertFailed)?; - let mut assets = MultiAssets::new(); - let statemine_asset = MultiAsset { - id: Concrete(MultiLocation::new( + let mut assets = Assets::new(); + let statemine_asset = Asset { + id: AssetId(Location::new( 0, - X2( + [ PalletInstance(parachains::Statemine::PALLET_ID), GeneralIndex(asset_id.into()), - ), + ], )), fun: Fungible(amount_u128), }; - let fee_asset = MultiAsset { - id: Concrete(MultiLocation::new(1, Junctions::Here)), - fun: Fungible(xcm_fee_u128), - }; + let fee_asset = + Asset { id: AssetId(Location::new(1, Here)), fun: Fungible(xcm_fee_u128) }; assets.push(statemine_asset.clone()); assets.push(fee_asset.clone()); let msg = Xcm(vec![ WithdrawAsset(assets), - BuyExecution { - fees: fee_asset, - weight_limit: cumulus_primitives_core::Limited(dest_weight), - }, + BuyExecution { fees: fee_asset, weight_limit: Limited(dest_weight) }, DepositAsset { assets: AllCounted(2).into(), beneficiary: dst_location }, ]); pallet_xcm::Pallet::::send_xcm( Here, - MultiLocation::new(1, X1(Parachain(parachains::Statemine::ID))), + Location::new(1, Parachain(parachains::Statemine::ID)), msg, ) .map_err(|_| Error::::XcmExecutionFailed)?; @@ -301,10 +298,10 @@ pub mod pallet { let confirm_contribute_call = T::SalpHelper::confirm_contribute_call(); // Generate query_id let query_id = pallet_xcm::Pallet::::new_notify_query( - MultiLocation::parent(), + Location::parent(), confirm_contribute_call, T::CallBackTimeOut::get(), - Here, + xcm::v4::Junctions::Here, ); // Bind query_id and contribution @@ -313,7 +310,11 @@ pub mod pallet { let (msg_id, msg) = Self::build_ump_transact(query_id, contribute_call, dest_weight, xcm_fee)?; - let result = pallet_xcm::Pallet::::send_xcm(Here, Parent, msg); + let result = pallet_xcm::Pallet::::send_xcm( + xcm::v4::Junctions::Here, + xcm::v4::Parent, + xcm::v4::Xcm::try_from(msg).unwrap(), + ); ensure!(result.is_ok(), Error::::XcmSendFailed); Ok(msg_id) } @@ -354,14 +355,11 @@ pub mod pallet { fee: BalanceOf, ) -> Result<(MessageId, Xcm<()>), Error> { let sovereign_account: AccountIdOf = T::ParachainSovereignAccount::get(); - let sovereign_location: MultiLocation = - T::AccountIdToMultiLocation::convert(sovereign_account); + let sovereign_location: Location = T::AccountIdToLocation::convert(sovereign_account); let fee_amount = TryInto::::try_into(fee).map_err(|_| Error::::FeeConvertFailed)?; - let asset: MultiAsset = MultiAsset { - id: Concrete(MultiLocation::here()), - fun: Fungibility::from(fee_amount), - }; + let asset: Asset = + Asset { id: AssetId(Location::here()), fun: Fungibility::from(fee_amount) }; let message = Xcm(vec![ WithdrawAsset(asset.clone().into()), BuyExecution { fees: asset, weight_limit: Unlimited }, @@ -371,9 +369,7 @@ pub mod pallet { call, }, ReportTransactStatus(QueryResponseInfo { - destination: MultiLocation::from(X1(Parachain(u32::from( - T::ParachainId::get(), - )))), + destination: Location::from([Parachain(u32::from(T::ParachainId::get()))]), query_id, max_weight: weight, }), diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 7f65ca480..9e675a505 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -28,7 +28,7 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentifyAccount, Verify}, FixedU128, MultiSignature, OpaqueExtrinsic, Permill, }; -use xcm::v3::prelude::*; +use xcm::v4::{prelude::*, Asset, Location}; use xcm_executor::traits::{AssetTransferError, TransferType, XcmAssetTransfers}; pub mod currency; @@ -254,8 +254,8 @@ impl Default for RedeemType { pub struct DoNothingRouter; impl SendXcm for DoNothingRouter { type Ticket = (); - fn validate(_dest: &mut Option, _msg: &mut Option>) -> SendResult<()> { - Ok(((), MultiAssets::new())) + fn validate(_dest: &mut Option, _msg: &mut Option>) -> SendResult<()> { + Ok(((), Assets::new())) } fn deliver(_: ()) -> Result { Ok([0; 32]) @@ -278,34 +278,15 @@ impl ExecuteXcm for DoNothingExecuteXcm { } fn execute( - _origin: impl Into, + _origin: impl Into, _pre: Self::Prepared, _hash: &mut XcmHash, _weight_credit: Weight, ) -> Outcome { - Outcome::Complete(Weight::default()) + Outcome::Complete { used: Weight::default() } } - fn execute_xcm( - _origin: impl Into, - _message: Xcm, - _hash: XcmHash, - _weight_limit: Weight, - ) -> Outcome { - Outcome::Complete(Weight::default()) - } - - fn execute_xcm_in_credit( - _origin: impl Into, - _message: Xcm, - _hash: XcmHash, - _weight_limit: Weight, - _weight_credit: Weight, - ) -> Outcome { - Outcome::Complete(Weight::default()) - } - - fn charge_fees(_location: impl Into, _fees: MultiAssets) -> XcmResult { + fn charge_fees(_location: impl Into, _fees: Assets) -> XcmResult { Ok(()) } } @@ -315,10 +296,7 @@ impl XcmAssetTransfers for DoNothingExecuteXcm { type IsTeleporter = (); type AssetTransactor = (); - fn determine_for( - _asset: &MultiAsset, - _dest: &MultiLocation, - ) -> Result { + fn determine_for(_asset: &Asset, _dest: &Location) -> Result { Ok(TransferType::DestinationReserve) } } diff --git a/primitives/src/traits.rs b/primitives/src/traits.rs index 25e9598b1..6279a91e9 100644 --- a/primitives/src/traits.rs +++ b/primitives/src/traits.rs @@ -168,12 +168,12 @@ pub trait CurrencyIdMapping { fn get_asset_metadata(asset_ids: AssetIds) -> Option; /// Returns the AssetMetadata associated with a given `CurrencyId`. fn get_currency_metadata(currency_id: CurrencyId) -> Option; + /// Returns the Location associated with a given CurrencyId. + fn get_location(currency_id: CurrencyId) -> Option; + /// Returns the CurrencyId associated with a given Location. + fn get_currency_id(multi_location: xcm::v4::Location) -> Option; /// Returns all currencies in currencyMetadata. fn get_all_currency() -> Vec; - /// Returns the MultiLocation associated with a given CurrencyId. - fn get_multi_location(currency_id: CurrencyId) -> Option; - /// Returns the CurrencyId associated with a given MultiLocation. - fn get_currency_id(multi_location: MultiLocation) -> Option; } pub trait CurrencyIdConversion { diff --git a/runtime/bifrost-kusama/src/governance/fellowship.rs b/runtime/bifrost-kusama/src/governance/fellowship.rs index 4e44b954b..bd9844ff7 100644 --- a/runtime/bifrost-kusama/src/governance/fellowship.rs +++ b/runtime/bifrost-kusama/src/governance/fellowship.rs @@ -355,4 +355,8 @@ impl pallet_ranked_collective::Config for Runtime type Polls = FellowshipReferenda; type MinRankOfClass = sp_runtime::traits::Identity; type VoteWeight = pallet_ranked_collective::Geometric; + type ExchangeOrigin = EitherOfDiverse; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkSetup = (); + type MemberSwappedHandler = (); } diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index 38cc90877..dbd25ac53 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -98,9 +98,7 @@ use frame_support::{ OnUnbalanced, }, }; -use frame_system::{ - pallet_prelude::BlockNumberFor, EnsureRoot, EnsureRootWithSuccess, EnsureSigned, -}; +use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned}; use hex_literal::hex; use orml_oracle::{DataFeeder, DataProvider, DataProviderExtended}; use pallet_identity::legacy::IdentityInfo; @@ -125,7 +123,7 @@ use governance::{ pub mod xcm_config; use pallet_xcm::{EnsureResponse, QueryStatus}; use sp_runtime::traits::{IdentityLookup, Verify}; -use xcm::v3::prelude::*; +use xcm::{v3::MultiLocation, v4::prelude::*}; pub use xcm_config::{ parachains, AccountId32Aliases, BifrostCurrencyIdConvert, BifrostTreasuryAccount, ExistentialDeposits, MultiCurrency, SelfParaChainId, Sibling, SiblingParachainConvertsVia, @@ -662,7 +660,6 @@ impl pallet_balances::Config for Runtime { type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<0>; type WeightInfo = pallet_balances::weights::SubstrateWeight; type RuntimeHoldReason = RuntimeHoldReason; @@ -1160,14 +1157,14 @@ parameter_types! { pub BifrostParachainAccountId20: [u8; 20] = cumulus_primitives_core::ParaId::from(ParachainInfo::get()).into_account_truncating(); } -pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLocation { +pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> xcm::v3::Location { match currency_id { // AccountKey20 format of Bifrost sibling para account - CurrencyId::Token(TokenSymbol::MOVR) => MultiLocation::new( + CurrencyId::Token(TokenSymbol::MOVR) => xcm::v3::Location::new( 1, - X2( - Parachain(parachains::moonriver::ID.into()), - AccountKey20 { + xcm::v3::Junctions::X2( + xcm::v3::Junction::Parachain(parachains::moonriver::ID.into()), + xcm::v3::Junction::AccountKey20 { network: None, key: Slp::derivative_account_id_20( polkadot_parachain_primitives::primitives::Sibling::from( @@ -1181,9 +1178,9 @@ pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLoca ), ), // Only relay chain use the Bifrost para account with "para" - CurrencyId::Token(TokenSymbol::KSM) => MultiLocation::new( + CurrencyId::Token(TokenSymbol::KSM) => xcm::v3::Location::new( 1, - X1(AccountId32 { + xcm::v3::Junctions::X1(xcm::v3::Junction::AccountId32 { network: None, id: Utility::derivative_account_id( ParachainInfo::get().into_account_truncating(), @@ -1193,9 +1190,9 @@ pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLoca }), ), // Bifrost Kusama Native token - CurrencyId::Native(TokenSymbol::BNC) => MultiLocation::new( + CurrencyId::Native(TokenSymbol::BNC) => xcm::v3::Location::new( 0, - X1(AccountId32 { + xcm::v3::Junctions::X1(xcm::v3::Junction::AccountId32 { network: None, id: Utility::derivative_account_id( polkadot_parachain_primitives::primitives::Sibling::from(ParachainInfo::get()) @@ -1212,11 +1209,11 @@ pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLoca BifrostCurrencyIdConvert::::convert(currency_id) { if let Some(Parachain(para_id)) = location.interior().first() { - MultiLocation::new( + xcm::v3::Location::new( 1, - X2( - Parachain(*para_id), - AccountId32 { + xcm::v3::Junctions::X2( + xcm::v3::Junction::Parachain(*para_id), + xcm::v3::Junction::AccountId32 { network: None, id: Utility::derivative_account_id( polkadot_parachain_primitives::primitives::Sibling::from( @@ -1230,10 +1227,10 @@ pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLoca ), ) } else { - MultiLocation::default() + xcm::v3::Location::default() } } else { - MultiLocation::default() + xcm::v3::Location::default() } }, } @@ -1334,7 +1331,7 @@ parameter_types! { } pub struct SubstrateResponseManager; -impl QueryResponseManager +impl QueryResponseManager for SubstrateResponseManager { fn get_query_response_record(query_id: QueryId) -> bool { @@ -1346,16 +1343,16 @@ impl QueryResponseManager } fn create_query_record( - responder: &MultiLocation, + responder: Location, call_back: Option, timeout: BlockNumber, ) -> u64 { // for xcm v3 version see the following // PolkadotXcm::new_query(responder, timeout, Here) if let Some(call_back) = call_back { - PolkadotXcm::new_notify_query(*responder, call_back, timeout, Here) + PolkadotXcm::new_notify_query(responder.clone(), call_back, timeout, Here) } else { - PolkadotXcm::new_query(*responder, timeout, Here) + PolkadotXcm::new_query(responder, timeout, Here) } } @@ -2048,46 +2045,13 @@ pub type SignedPayload = generic::SignedPayload; /// upgrades in case governance decides to do so. THE ORDER IS IMPORTANT. pub type Migrations = migrations::Unreleased; -parameter_types! { - pub const TipsPalletName: &'static str = "Tips"; - pub const BountiesPalletName: &'static str = "Bounties"; -} - /// The runtime migrations per release. pub mod migrations { #![allow(unused_imports)] use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = ( - // Unlock & unreserve funds - pallet_tips::migrations::unreserve_deposits::UnreserveDeposits, - cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, - migration::slpx_migrates_whitelist::UpdateWhitelist, - frame_support::migrations::RemovePallet< - TipsPalletName, - ::DbWeight, - >, - frame_support::migrations::RemovePallet< - BountiesPalletName, - ::DbWeight, - >, - pallet_identity::migration::versioned::V0ToV1, - ); -} - -// Special Config for tips pallets, allowing us to run migrations for them without -// implementing their configs on [`Runtime`]. -pub struct UnlockConfigForTips; -impl pallet_tips::migrations::unreserve_deposits::UnlockConfig<()> for UnlockConfigForTips { - type Currency = Balances; - type Hash = Hash; - type DataDepositPerByte = DataDepositPerByte; - type TipReportDepositBase = TipReportDepositBase; - type AccountId = AccountId; - type BlockNumber = BlockNumberFor; - type DbWeight = ::DbWeight; - type PalletName = TipsPalletName; + pub type Unreleased = (); } /// Executive: handles dispatch to the various modules. diff --git a/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs b/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs index 178916670..927135cec 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs @@ -138,7 +138,7 @@ impl bifrost_asset_registry::WeightInfo for BifrostWeig // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) // Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) // Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) - fn register_multilocation() -> Weight { + fn register_location() -> Weight { // Proof Size summary in bytes: // Measured: `683` // Estimated: `4148` @@ -155,7 +155,7 @@ impl bifrost_asset_registry::WeightInfo for BifrostWeig // Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) // Storage: AssetRegistry CurrencyIdToLocations (r:0 w:1) // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) - fn force_set_multilocation() -> Weight { + fn force_set_location() -> Weight { // Proof Size summary in bytes: // Measured: `683` // Estimated: `4148` diff --git a/runtime/bifrost-kusama/src/weights/pallet_xcm.rs b/runtime/bifrost-kusama/src/weights/pallet_xcm.rs index 3f413862f..5fe4c382a 100644 --- a/runtime/bifrost-kusama/src/weights/pallet_xcm.rs +++ b/runtime/bifrost-kusama/src/weights/pallet_xcm.rs @@ -64,35 +64,67 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 24_079_000 picoseconds. - Weight::from_parts(24_695_000, 0) - .saturating_add(Weight::from_parts(0, 3540)) + // Measured: `145` + // Estimated: `3610` + // Minimum execution time: 21_170_000 picoseconds. + Weight::from_parts(21_757_000, 0) + .saturating_add(Weight::from_parts(0, 3610)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) + /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1489` - // Minimum execution time: 18_654_000 picoseconds. - Weight::from_parts(19_331_000, 0) - .saturating_add(Weight::from_parts(0, 1489)) - .saturating_add(T::DbWeight::get().reads(1)) + // Measured: `197` + // Estimated: `3662` + // Minimum execution time: 94_487_000 picoseconds. + Weight::from_parts(96_276_000, 0) + .saturating_add(Weight::from_parts(0, 3662)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`) fn reserve_transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1489` - // Minimum execution time: 13_972_000 picoseconds. - Weight::from_parts(14_410_000, 0) - .saturating_add(Weight::from_parts(0, 1489)) - .saturating_add(T::DbWeight::get().reads(1)) + // Measured: `419` + // Estimated: `6196` + // Minimum execution time: 119_502_000 picoseconds. + Weight::from_parts(121_486_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -116,10 +148,10 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `496` + // Measured: `600` // Estimated: `6208` - // Minimum execution time: 146_932_000 picoseconds. - Weight::from_parts(153_200_000, 0) + // Minimum execution time: 143_889_000 picoseconds. + Weight::from_parts(147_227_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(7)) @@ -140,8 +172,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_624_000 picoseconds. - Weight::from_parts(7_005_000, 0) + // Minimum execution time: 6_141_000 picoseconds. + Weight::from_parts(6_320_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -151,8 +183,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_213_000 picoseconds. - Weight::from_parts(2_374_000, 0) + // Minimum execution time: 2_013_000 picoseconds. + Weight::from_parts(2_144_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -176,11 +208,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 28_117_000 picoseconds. - Weight::from_parts(29_002_000, 0) - .saturating_add(Weight::from_parts(0, 3540)) + // Measured: `145` + // Estimated: `3610` + // Minimum execution time: 26_192_000 picoseconds. + Weight::from_parts(26_891_000, 0) + .saturating_add(Weight::from_parts(0, 3610)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -202,11 +234,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `292` - // Estimated: `3757` - // Minimum execution time: 30_111_000 picoseconds. - Weight::from_parts(30_890_000, 0) - .saturating_add(Weight::from_parts(0, 3757)) + // Measured: `363` + // Estimated: `3828` + // Minimum execution time: 28_794_000 picoseconds. + Weight::from_parts(29_672_000, 0) + .saturating_add(Weight::from_parts(0, 3828)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -216,45 +248,45 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_126_000 picoseconds. - Weight::from_parts(2_293_000, 0) + // Minimum execution time: 1_890_000 picoseconds. + Weight::from_parts(2_068_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `PolkadotXcm::SupportedVersion` (r:4 w:2) + /// Storage: `PolkadotXcm::SupportedVersion` (r:5 w:2) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) fn migrate_supported_version() -> Weight { // Proof Size summary in bytes: - // Measured: `129` - // Estimated: `11019` - // Minimum execution time: 17_037_000 picoseconds. - Weight::from_parts(17_778_000, 0) - .saturating_add(Weight::from_parts(0, 11019)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `159` + // Estimated: `13524` + // Minimum execution time: 18_690_000 picoseconds. + Weight::from_parts(19_397_000, 0) + .saturating_add(Weight::from_parts(0, 13524)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `PolkadotXcm::VersionNotifiers` (r:4 w:2) + /// Storage: `PolkadotXcm::VersionNotifiers` (r:5 w:2) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) fn migrate_version_notifiers() -> Weight { // Proof Size summary in bytes: - // Measured: `133` - // Estimated: `11023` - // Minimum execution time: 16_863_000 picoseconds. - Weight::from_parts(17_392_000, 0) - .saturating_add(Weight::from_parts(0, 11023)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `163` + // Estimated: `13528` + // Minimum execution time: 18_719_000 picoseconds. + Weight::from_parts(19_241_000, 0) + .saturating_add(Weight::from_parts(0, 13528)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:0) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `140` - // Estimated: `13505` - // Minimum execution time: 18_745_000 picoseconds. - Weight::from_parts(19_010_000, 0) - .saturating_add(Weight::from_parts(0, 13505)) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `173` + // Estimated: `16013` + // Minimum execution time: 20_555_000 picoseconds. + Weight::from_parts(21_068_000, 0) + .saturating_add(Weight::from_parts(0, 16013)) + .saturating_add(T::DbWeight::get().reads(6)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -272,38 +304,38 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `6082` - // Minimum execution time: 26_717_000 picoseconds. - Weight::from_parts(27_144_000, 0) - .saturating_add(Weight::from_parts(0, 6082)) + // Measured: `212` + // Estimated: `6152` + // Minimum execution time: 26_014_000 picoseconds. + Weight::from_parts(26_786_000, 0) + .saturating_add(Weight::from_parts(0, 6152)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:3 w:0) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:0) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn notify_target_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `172` - // Estimated: `8587` - // Minimum execution time: 9_128_000 picoseconds. - Weight::from_parts(9_445_000, 0) - .saturating_add(Weight::from_parts(0, 8587)) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `206` + // Estimated: `11096` + // Minimum execution time: 11_678_000 picoseconds. + Weight::from_parts(12_132_000, 0) + .saturating_add(Weight::from_parts(0, 11096)) + .saturating_add(T::DbWeight::get().reads(4)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:2) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:2) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn migrate_version_notify_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `140` - // Estimated: `11030` - // Minimum execution time: 17_316_000 picoseconds. - Weight::from_parts(17_802_000, 0) - .saturating_add(Weight::from_parts(0, 11030)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `170` + // Estimated: `13535` + // Minimum execution time: 19_050_000 picoseconds. + Weight::from_parts(19_546_000, 0) + .saturating_add(Weight::from_parts(0, 13535)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:2) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:2) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -319,37 +351,49 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `146` - // Estimated: `11036` - // Minimum execution time: 33_426_000 picoseconds. - Weight::from_parts(33_986_000, 0) - .saturating_add(Weight::from_parts(0, 11036)) - .saturating_add(T::DbWeight::get().reads(10)) + // Measured: `212` + // Estimated: `13577` + // Minimum execution time: 34_690_000 picoseconds. + Weight::from_parts(35_397_000, 0) + .saturating_add(Weight::from_parts(0, 13577)) + .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: `XcmPallet::QueryCounter` (r:1 w:1) - /// Proof: `XcmPallet::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmPallet::Queries` (r:0 w:1) - /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn new_query() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1485` - // Minimum execution time: 2_947_000 picoseconds. - Weight::from_parts(3_117_000, 0) - .saturating_add(Weight::from_parts(0, 1485)) + // Measured: `103` + // Estimated: `1588` + // Minimum execution time: 4_663_000 picoseconds. + Weight::from_parts(4_812_000, 0) + .saturating_add(Weight::from_parts(0, 1588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `XcmPallet::Queries` (r:1 w:1) - /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:1 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn take_response() -> Weight { // Proof Size summary in bytes: - // Measured: `7576` - // Estimated: `11041` - // Minimum execution time: 24_595_000 picoseconds. - Weight::from_parts(24_907_000, 0) - .saturating_add(Weight::from_parts(0, 11041)) + // Measured: `7740` + // Estimated: `11205` + // Minimum execution time: 25_044_000 picoseconds. + Weight::from_parts(25_416_000, 0) + .saturating_add(Weight::from_parts(0, 11205)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) + /// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn claim_assets() -> Weight { + // Proof Size summary in bytes: + // Measured: `160` + // Estimated: `3625` + // Minimum execution time: 37_380_000 picoseconds. + Weight::from_parts(37_761_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/bifrost-kusama/src/xcm_config.rs b/runtime/bifrost-kusama/src/xcm_config.rs index 357512339..bdc1dcc6f 100644 --- a/runtime/bifrost-kusama/src/xcm_config.rs +++ b/runtime/bifrost-kusama/src/xcm_config.rs @@ -55,7 +55,7 @@ use pallet_xcm::XcmPassthrough; use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery; use sp_core::bounded::BoundedVec; -use xcm::v3::prelude::*; +use xcm::v4::{prelude::*, Location}; use xcm_builder::{FrameTransactionalProcessor, TrailingSetTopicAsId}; use xcm_executor::traits::Properties; @@ -67,12 +67,12 @@ pub struct BifrostAssetMatcher( impl MatchesFungible for BifrostAssetMatcher where - CurrencyIdConvert: Convert>, + CurrencyIdConvert: Convert>, Amount: TryFrom, { - fn matches_fungible(a: &MultiAsset) -> Option { - if let (Fungible(ref amount), Concrete(ref location)) = (&a.fun, &a.id) { - if CurrencyIdConvert::convert(*location).is_some() { + fn matches_fungible(a: &Asset) -> Option { + if let (Fungible(ref amount), AssetId(ref location)) = (&a.fun, &a.id) { + if CurrencyIdConvert::convert(location.clone()).is_some() { return CheckedConversion::checked_from(*amount); } } @@ -83,11 +83,11 @@ where /// A `FilterAssetLocation` implementation. Filters multi native assets whose /// reserve is same with `origin`. pub struct MultiNativeAsset(PhantomData); -impl ContainsPair for MultiNativeAsset +impl ContainsPair for MultiNativeAsset where ReserveProvider: Reserve, { - fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { + fn contains(asset: &Asset, origin: &Location) -> bool { if let Some(ref reserve) = ReserveProvider::reserve(asset) { if reserve == origin { return true; @@ -97,13 +97,13 @@ where } } -fn native_currency_location(id: CurrencyId) -> MultiLocation { - MultiLocation::new(0, X1(Junction::from(BoundedVec::try_from(id.encode()).unwrap()))) +fn native_currency_location(id: CurrencyId) -> Location { + Location::new(0, [Junction::from(BoundedVec::try_from(id.encode()).unwrap())]) } -impl> Convert> for BifrostCurrencyIdConvert { - fn convert(asset: MultiAsset) -> Option { - if let MultiAsset { id: Concrete(id), fun: Fungible(_) } = asset { +impl> Convert> for BifrostCurrencyIdConvert { + fn convert(asset: Asset) -> Option { + if let Asset { id: AssetId(id), fun: xcm::v4::Fungibility::Fungible(_) } = asset { Self::convert(id) } else { None @@ -111,131 +111,125 @@ impl> Convert> for BifrostCurrency } } -pub struct BifrostAccountIdToMultiLocation; -impl Convert for BifrostAccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { - X1(AccountId32 { network: None, id: account.into() }).into() +pub struct BifrostAccountIdToLocation; +impl Convert for BifrostAccountIdToLocation { + fn convert(account: AccountId) -> Location { + [AccountId32 { network: None, id: account.into() }].into() } } pub struct BifrostCurrencyIdConvert(sp_std::marker::PhantomData); -impl> Convert> for BifrostCurrencyIdConvert { - fn convert(id: CurrencyId) -> Option { +impl> Convert> for BifrostCurrencyIdConvert { + fn convert(id: CurrencyId) -> Option { use CurrencyId::*; use TokenSymbol::*; - if let Some(id) = AssetIdMaps::::get_multi_location(id) { + if let Some(id) = AssetIdMaps::::get_location(id) { return Some(id); } match id { - Token(KSM) => Some(MultiLocation::parent()), + Token(KSM) => Some(Location::parent()), Native(ASG) | Native(BNC) | VSToken(KSM) | Token(ZLK) => Some(native_currency_location(id)), // Karura currencyId types - Token(KAR) => Some(MultiLocation::new( + Token(KAR) => Some(Location::new( 1, - X2( + [ Parachain(parachains::karura::ID), Junction::from( BoundedVec::try_from(parachains::karura::KAR_KEY.to_vec()).unwrap(), ), - ), + ], )), - Stable(KUSD) => Some(MultiLocation::new( + Stable(KUSD) => Some(Location::new( 1, - X2( + [ Parachain(parachains::karura::ID), Junction::from( BoundedVec::try_from(parachains::karura::KUSD_KEY.to_vec()).unwrap(), ), - ), + ], )), - Token(RMRK) => Some(MultiLocation::new( + Token(RMRK) => Some(Location::new( 1, - X3( + [ Parachain(parachains::Statemine::ID), PalletInstance(parachains::Statemine::PALLET_ID), GeneralIndex(parachains::Statemine::RMRK_ID as u128), - ), + ], )), // Phala Native token - Token(PHA) => Some(MultiLocation::new(1, X1(Parachain(parachains::phala::ID)))), + Token(PHA) => Some(Location::new(1, [Parachain(parachains::phala::ID)])), // Moonriver Native token - Token(MOVR) => Some(MultiLocation::new( + Token(MOVR) => Some(Location::new( 1, - X2( + [ Parachain(parachains::moonriver::ID), PalletInstance(parachains::moonriver::PALLET_ID.into()), - ), + ], )), _ => None, } } } -impl> Convert> for BifrostCurrencyIdConvert { - fn convert(location: MultiLocation) -> Option { +impl> Convert> for BifrostCurrencyIdConvert { + fn convert(location: Location) -> Option { use CurrencyId::*; use TokenSymbol::*; - if location == MultiLocation::parent() { + if location == Location::parent() { return Some(Token(KSM)); } - if let Some(currency_id) = AssetIdMaps::::get_currency_id(location) { + if let Some(currency_id) = AssetIdMaps::::get_currency_id(location.clone()) { return Some(currency_id); } - match location { - MultiLocation { parents: 1, interior } => match interior { - X2(Parachain(id), GeneralKey { data, length }) if id == parachains::karura::ID => - if data[..length as usize] == parachains::karura::KAR_KEY.to_vec() { - Some(Token(KAR)) - } else if data[..length as usize] == parachains::karura::KUSD_KEY.to_vec() { - Some(Stable(KUSD)) - } else { - None - }, - X2(Parachain(id), GeneralIndex(key)) if id == parachains::Statemine::ID => { - if key == parachains::Statemine::RMRK_ID as u128 { - Some(Token(RMRK)) - } else { - None - } - }, - 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 - } + match location.unpack() { + (1, [Parachain(id), GeneralKey { data, length }]) if *id == parachains::karura::ID => + if data[..*length as usize] == parachains::karura::KAR_KEY.to_vec() { + Some(Token(KAR)) + } else if data[..*length as usize] == parachains::karura::KUSD_KEY.to_vec() { + Some(Stable(KUSD)) + } else { + None }, - X1(Parachain(id)) if id == parachains::phala::ID => Some(Token(PHA)), - X2(Parachain(id), PalletInstance(index)) - if ((id == parachains::moonriver::ID) && - (index == parachains::moonriver::PALLET_ID)) => - Some(Token(MOVR)), - _ => None, + (1, [Parachain(id), GeneralIndex(key)]) if *id == parachains::Statemine::ID => { + if *key == parachains::Statemine::RMRK_ID as u128 { + Some(Token(RMRK)) + } else { + None + } + }, + (1, [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 + } }, - MultiLocation { parents: 0, interior } => match interior { - X1(GeneralKey { data, length }) => { - // decode the general key - let key = &data[..length as usize]; - if let Ok(currency_id) = CurrencyId::decode(&mut &key[..]) { - match currency_id { - Native(ASG) | Native(BNC) | VToken(KSM) | VSToken(KSM) | Token(ZLK) => - Some(currency_id), - _ => None, - } - } else { - None + (1, [Parachain(id)]) if *id == parachains::phala::ID => Some(Token(PHA)), + (1, [Parachain(id), PalletInstance(index)]) + if (*id == parachains::moonriver::ID) && + (*index == parachains::moonriver::PALLET_ID) => + Some(Token(MOVR)), + (0, [GeneralKey { data, length }]) => { + // decode the general key + let key = &data[..*length as usize]; + if let Ok(currency_id) = CurrencyId::decode(&mut &key[..]) { + match currency_id { + Native(ASG) | Native(BNC) | VToken(KSM) | VSToken(KSM) | Token(ZLK) => + Some(currency_id), + _ => None, } - }, - _ => None, + } else { + None + } }, _ => None, } @@ -243,14 +237,14 @@ impl> Convert> for BifrostCurre } parameter_types! { - pub const KsmLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Kusama; + pub const KsmLocation: Location = Location::parent(); + pub const RelayNetwork: NetworkId = Kusama; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub SelfParaChainId: CumulusParaId = ParachainInfo::parachain_id(); - pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); + pub UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())].into(); } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch RuntimeOrigin. pub type LocationToAccountId = ( @@ -294,20 +288,13 @@ parameter_types! { pub const MaxInstructions: u32 = 100; } -match_types! { - pub type ParentOrParentsExecutivePlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; -} - /// Barrier allowing a top level paid message with DescendOrigin instruction pub const DEFAULT_PROOF_SIZE: u64 = 64 * 1024; pub const DEFAULT_REF_TIMR: u64 = 10_000_000_000; pub struct AllowTopLevelPaidExecutionDescendOriginFirst(PhantomData); -impl> ShouldExecute for AllowTopLevelPaidExecutionDescendOriginFirst { +impl> ShouldExecute for AllowTopLevelPaidExecutionDescendOriginFirst { fn should_execute( - origin: &MultiLocation, + origin: &Location, message: &mut [Instruction], max_weight: Weight, _weight_credit: &mut Properties, @@ -383,45 +370,44 @@ pub type BifrostAssetTransactor = MultiCurrencyAdapter< >; parameter_types! { - pub KsmPerSecond: (AssetId, u128, u128) = (MultiLocation::parent().into(), ksm_per_second::(),0); + pub KsmPerSecond: (AssetId, u128, u128) = (Location::parent().into(), ksm_per_second::(),0); pub VksmPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 0, - X1(Junction::from(BoundedVec::try_from(CurrencyId::VToken(TokenSymbol::KSM).encode()).unwrap())), + [Junction::from(BoundedVec::try_from(CurrencyId::VToken(TokenSymbol::KSM).encode()).unwrap())], ).into(), ksm_per_second::(), 0 ); pub VsksmPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 1, - X2(Parachain(SelfParaId::get()), Junction::from(BoundedVec::try_from(CurrencyId::VSToken(TokenSymbol::KSM).encode()).unwrap())) - + [Parachain(SelfParaId::get()), Junction::from(BoundedVec::try_from(CurrencyId::VSToken(TokenSymbol::KSM).encode()).unwrap())] ).into(), ksm_per_second::(), 0 ); pub VsksmNewPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 0, - X1(Junction::from(BoundedVec::try_from(CurrencyId::VSToken(TokenSymbol::KSM).encode()).unwrap())) + [Junction::from(BoundedVec::try_from(CurrencyId::VSToken(TokenSymbol::KSM).encode()).unwrap())] ).into(), ksm_per_second::(), 0 ); pub BncPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 1, - X2(Parachain(SelfParaId::get()), Junction::from(BoundedVec::try_from(NativeCurrencyId::get().encode()).unwrap())) + [Parachain(SelfParaId::get()), Junction::from(BoundedVec::try_from(NativeCurrencyId::get().encode()).unwrap())] ).into(), // BNC:KSM = 80:1 ksm_per_second::() * 80, 0 ); pub BncNewPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 0, - X1(Junction::from(BoundedVec::try_from(NativeCurrencyId::get().encode()).unwrap())) + [Junction::from(BoundedVec::try_from(NativeCurrencyId::get().encode()).unwrap())] ).into(), // BNC:KSM = 80:1 ksm_per_second::() * 80, @@ -429,9 +415,9 @@ parameter_types! { ); pub ZlkPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 1, - X2(Parachain(SelfParaId::get()), Junction::from(BoundedVec::try_from(CurrencyId::Token(TokenSymbol::ZLK).encode()).unwrap())) + [Parachain(SelfParaId::get()), Junction::from(BoundedVec::try_from(CurrencyId::Token(TokenSymbol::ZLK).encode()).unwrap())] ).into(), // ZLK:KSM = 150:1 //ZLK has a decimal of 18, while KSM is 12. @@ -439,9 +425,9 @@ parameter_types! { 0 ); pub ZlkNewPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 0, - X1(Junction::from(BoundedVec::try_from(CurrencyId::Token(TokenSymbol::ZLK).encode()).unwrap())) + [Junction::from(BoundedVec::try_from(CurrencyId::Token(TokenSymbol::ZLK).encode()).unwrap())] ).into(), // ZLK:KSM = 150:1 //ZLK has a decimal of 18, while KSM is 12. @@ -449,54 +435,54 @@ parameter_types! { 0 ); pub KarPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 1, - X2(Parachain(parachains::karura::ID), Junction::from(BoundedVec::try_from(parachains::karura::KAR_KEY.to_vec()).unwrap())) + [Parachain(parachains::karura::ID), Junction::from(BoundedVec::try_from(parachains::karura::KAR_KEY.to_vec()).unwrap())] ).into(), // KAR:KSM = 100:1 ksm_per_second::() * 100, 0 ); pub KusdPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 1, - X2(Parachain(parachains::karura::ID), Junction::from(BoundedVec::try_from(parachains::karura::KUSD_KEY.to_vec()).unwrap())) + [Parachain(parachains::karura::ID), Junction::from(BoundedVec::try_from(parachains::karura::KUSD_KEY.to_vec()).unwrap())] ).into(), // kUSD:KSM = 400:1 ksm_per_second::() * 400, 0 ); pub PhaPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 1, - X1(Parachain(parachains::phala::ID)), + [Parachain(parachains::phala::ID)], ).into(), // PHA:KSM = 400:1 ksm_per_second::() * 400, 0 ); pub RmrkPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 1, - X2(Parachain(parachains::Statemine::ID), GeneralIndex(parachains::Statemine::RMRK_ID.into())) + [Parachain(parachains::Statemine::ID), GeneralIndex(parachains::Statemine::RMRK_ID.into())] ).into(), // rmrk:KSM = 10:1 ksm_per_second::() * 10 / 100, //rmrk currency decimal as 10 0 ); pub RmrkNewPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 1, - X3(Parachain(parachains::Statemine::ID), PalletInstance(parachains::Statemine::PALLET_ID),GeneralIndex(parachains::Statemine::RMRK_ID.into())) + [Parachain(parachains::Statemine::ID), PalletInstance(parachains::Statemine::PALLET_ID),GeneralIndex(parachains::Statemine::RMRK_ID.into())] ).into(), // rmrk:KSM = 10:1 ksm_per_second::() * 10 / 100, //rmrk currency decimal as 10 0 ); pub MovrPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 1, - X2(Parachain(parachains::moonriver::ID), PalletInstance(parachains::moonriver::PALLET_ID.into())) + [Parachain(parachains::moonriver::ID), PalletInstance(parachains::moonriver::PALLET_ID.into())] ).into(), // MOVR:KSM = 2.67:1 ksm_per_second::() * 267 * 10_000, //movr currency decimal as 18 @@ -507,8 +493,10 @@ parameter_types! { pub struct ToTreasury; impl TakeRevenue for ToTreasury { - fn take_revenue(revenue: MultiAsset) { - if let MultiAsset { id: Concrete(location), fun: Fungible(amount) } = revenue { + fn take_revenue(revenue: Asset) { + if let Asset { id: AssetId(location), fun: xcm::v4::Fungibility::Fungible(amount) } = + revenue + { if let Some(currency_id) = BifrostCurrencyIdConvert::::convert(location) { @@ -641,28 +629,6 @@ impl Contains for SafeCallFilter { } } -/// Matches foreign assets from a given origin. -/// Foreign assets are assets bridged from other consensus systems. i.e parents > 1. -pub struct IsForeignNativeAssetFrom(PhantomData); -impl ContainsPair for IsForeignNativeAssetFrom -where - Origin: Get, -{ - fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { - let loc = Origin::get(); - &loc == origin && - matches!( - asset, - MultiAsset { id: Concrete(MultiLocation { parents: 2, .. }), fun: Fungible(_) }, - ) - } -} - -parameter_types! { - /// Location of Asset Hub - pub AssetHubLocation: MultiLocation = (Parent, Parachain(1000)).into(); -} - pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type AssetClaims = PolkadotXcm; @@ -670,8 +636,7 @@ impl xcm_executor::Config for XcmConfig { type AssetTrap = BifrostDropAssets; type Barrier = Barrier; type RuntimeCall = RuntimeCall; - type IsReserve = - (IsForeignNativeAssetFrom, MultiNativeAsset); + type IsReserve = MultiNativeAsset; type IsTeleporter = (); type UniversalLocation = UniversalLocation; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -707,7 +672,7 @@ pub type XcmRouter = ( #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { @@ -908,14 +873,14 @@ impl orml_tokens::Config for Runtime { } parameter_types! { - pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfLocation: Location = Location::new(1, [Parachain(ParachainInfo::get().into())]); + pub SelfRelativeLocation: Location = Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } @@ -925,7 +890,7 @@ impl orml_xtokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = BifrostCurrencyIdConvert; - type AccountIdToMultiLocation = BifrostAccountIdToMultiLocation; + type AccountIdToLocation = BifrostAccountIdToLocation; type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; #[cfg(feature = "runtime-benchmarks")] @@ -936,8 +901,10 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } impl orml_unknown_tokens::Config for Runtime { @@ -965,7 +932,7 @@ impl bifrost_xcm_interface::Config for Runtime { type XcmExecutor = bifrost_primitives::DoNothingExecuteXcm; #[cfg(not(feature = "runtime-benchmarks"))] type XcmExecutor = XcmExecutor; - type AccountIdToMultiLocation = BifrostAccountIdToMultiLocation; + type AccountIdToLocation = BifrostAccountIdToLocation; type SalpHelper = Salp; type ParachainId = SelfParaChainId; type CallBackTimeOut = ConstU32<10>; diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index 2bd5d98be..c30f52443 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -301,75 +301,75 @@ runtime-benchmarks = [ ] try-runtime = [ - "frame-try-runtime", + "bifrost-asset-registry/try-runtime", + "bifrost-buy-back/try-runtime", + "bifrost-call-switchgear/try-runtime", + "bifrost-channel-commission/try-runtime", + "bifrost-clouds-convert/try-runtime", + "bifrost-cross-in-out/try-runtime", + "bifrost-currencies/try-runtime", + "bifrost-farming/try-runtime", + "bifrost-fee-share/try-runtime", + "bifrost-flexible-fee/try-runtime", + "bifrost-salp/try-runtime", + "bifrost-slp/try-runtime", + "bifrost-slpx/try-runtime", + "bifrost-stable-asset/try-runtime", + "bifrost-stable-pool/try-runtime", + "bifrost-system-maker/try-runtime", + "bifrost-system-staking/try-runtime", + "bifrost-ve-minting/try-runtime", + "bifrost-vesting/try-runtime", + "bifrost-vstoken-conversion/try-runtime", + "bifrost-vtoken-minting/try-runtime", + "bifrost-vtoken-voting/try-runtime", + "bifrost-xcm-interface/try-runtime", + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "frame-executive/try-runtime", "frame-support/try-runtime", "frame-system/try-runtime", - "frame-executive/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-indices/try-runtime", - "cumulus-pallet-parachain-system/try-runtime", - "parachain-info/try-runtime", - "pallet-balances/try-runtime", - "pallet-transaction-payment/try-runtime", + "frame-try-runtime", + "frame-try-runtime/try-runtime", + "lend-market/try-runtime", + "leverage-staking/try-runtime", + "merkle-distributor/try-runtime", + "orml-oracle/try-runtime", + "orml-tokens/try-runtime", + "orml-unknown-tokens/try-runtime", + "orml-xcm/try-runtime", + "orml-xtokens/try-runtime", + "pallet-aura/try-runtime", "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-bounties/try-runtime", "pallet-collator-selection/try-runtime", - "pallet-session/try-runtime", - "pallet-aura/try-runtime", - "cumulus-pallet-aura-ext/try-runtime", - "pallet-democracy/try-runtime", "pallet-collective/try-runtime", "pallet-conviction-voting/try-runtime", + "pallet-democracy/try-runtime", "pallet-elections-phragmen/try-runtime", + "pallet-identity/try-runtime", + "pallet-indices/try-runtime", "pallet-membership/try-runtime", - "cumulus-pallet-xcmp-queue/try-runtime", - "pallet-xcm/try-runtime", - "cumulus-pallet-xcm/try-runtime", - "cumulus-pallet-dmp-queue/try-runtime", - "pallet-utility/try-runtime", - "pallet-scheduler/try-runtime", - "pallet-proxy/try-runtime", "pallet-multisig/try-runtime", - "pallet-identity/try-runtime", + "pallet-preimage/try-runtime", + "pallet-prices/try-runtime", + "pallet-proxy/try-runtime", "pallet-ranked-collective/try-runtime", "pallet-referenda/try-runtime", - "bifrost-vesting/try-runtime", - "pallet-treasury/try-runtime", - "pallet-bounties/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-session/try-runtime", + "pallet-timestamp/try-runtime", "pallet-tips/try-runtime", - "pallet-preimage/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "pallet-utility/try-runtime", "pallet-whitelist/try-runtime", - "orml-xtokens/try-runtime", - "orml-tokens/try-runtime", - "bifrost-currencies/try-runtime", - "orml-unknown-tokens/try-runtime", - "orml-xcm/try-runtime", - "orml-oracle/try-runtime", + "parachain-info/try-runtime", "zenlink-protocol/try-runtime", - "merkle-distributor/try-runtime", - "bifrost-flexible-fee/try-runtime", - "bifrost-salp/try-runtime", - "bifrost-call-switchgear/try-runtime", - "bifrost-asset-registry/try-runtime", - "bifrost-vtoken-minting/try-runtime", - "bifrost-slp/try-runtime", - "bifrost-xcm-interface/try-runtime", - "bifrost-vstoken-conversion/try-runtime", - "bifrost-farming/try-runtime", - "bifrost-system-staking/try-runtime", - "bifrost-system-maker/try-runtime", - "bifrost-fee-share/try-runtime", - "bifrost-ve-minting/try-runtime", - "bifrost-cross-in-out/try-runtime", - "bifrost-slpx/try-runtime", - "bifrost-stable-asset/try-runtime", - "bifrost-stable-pool/try-runtime", - "bifrost-vtoken-voting/try-runtime", - "lend-market/try-runtime", - "pallet-prices/try-runtime", - "leverage-staking/try-runtime", - "bifrost-channel-commission/try-runtime", - "bifrost-clouds-convert/try-runtime", - "bifrost-buy-back/try-runtime", ] # When enabled, the runtime API will not be build. diff --git a/runtime/bifrost-polkadot/src/governance/fellowship.rs b/runtime/bifrost-polkadot/src/governance/fellowship.rs index 4e44b954b..4d520a042 100644 --- a/runtime/bifrost-polkadot/src/governance/fellowship.rs +++ b/runtime/bifrost-polkadot/src/governance/fellowship.rs @@ -355,4 +355,8 @@ impl pallet_ranked_collective::Config for Runtime type Polls = FellowshipReferenda; type MinRankOfClass = sp_runtime::traits::Identity; type VoteWeight = pallet_ranked_collective::Geometric; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkSetup = (); + type MemberSwappedHandler = (); + type ExchangeOrigin = EitherOfDiverse; } diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 7dca0db36..7cab2a8ac 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -97,9 +97,7 @@ use frame_support::{ Currency, EitherOf, EitherOfDiverse, Get, LinearStoragePrice, }, }; -use frame_system::{ - pallet_prelude::BlockNumberFor, EnsureRoot, EnsureRootWithSuccess, EnsureSigned, -}; +use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned}; use hex_literal::hex; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; // zenlink imports @@ -115,7 +113,7 @@ use pallet_xcm::{EnsureResponse, QueryStatus}; use polkadot_runtime_common::prod_or_fast; use sp_runtime::traits::{IdentityLookup, Verify}; use static_assertions::const_assert; -use xcm::v3::prelude::*; +use xcm::{v3::MultiLocation, v4::prelude::*}; use xcm_config::{ parachains, BifrostCurrencyIdConvert, BifrostTreasuryAccount, MultiCurrency, SelfParaChainId, }; @@ -634,7 +632,6 @@ impl pallet_balances::Config for Runtime { type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<0>; type WeightInfo = pallet_balances::weights::SubstrateWeight; type RuntimeHoldReason = RuntimeHoldReason; @@ -1018,9 +1015,9 @@ pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLoca match currency_id { CurrencyId::Token2(GLMR_TOKEN_ID) => MultiLocation::new( 1, - X2( - Parachain(parachains::moonbeam::ID.into()), - AccountKey20 { + xcm::v3::Junctions::X2( + xcm::v3::Junction::Parachain(parachains::moonbeam::ID.into()), + xcm::v3::Junction::AccountKey20 { network: None, key: Slp::derivative_account_id_20( polkadot_parachain_primitives::primitives::Sibling::from( @@ -1034,9 +1031,9 @@ pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLoca ), ), // Only relay chain use the Bifrost para account with "para" - CurrencyId::Token2(DOT_TOKEN_ID) => MultiLocation::new( + CurrencyId::Token2(DOT_TOKEN_ID) => xcm::v3::Location::new( 1, - X1(AccountId32 { + xcm::v3::Junctions::X1(xcm::v3::Junction::AccountId32 { network: None, id: Utility::derivative_account_id( ParachainInfo::get().into_account_truncating(), @@ -1046,9 +1043,9 @@ pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLoca }), ), // Bifrost Polkadot Native token - CurrencyId::Native(TokenSymbol::BNC) => MultiLocation::new( + CurrencyId::Native(TokenSymbol::BNC) => xcm::v3::Location::new( 0, - X1(AccountId32 { + xcm::v3::Junctions::X1(xcm::v3::Junction::AccountId32 { network: None, id: Utility::derivative_account_id( polkadot_parachain_primitives::primitives::Sibling::from(ParachainInfo::get()) @@ -1065,11 +1062,11 @@ pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLoca BifrostCurrencyIdConvert::::convert(currency_id) { if let Some(Parachain(para_id)) = location.interior().first() { - MultiLocation::new( + xcm::v3::Location::new( 1, - X2( - Parachain(*para_id), - AccountId32 { + xcm::v3::Junctions::X2( + xcm::v3::Junction::Parachain(*para_id), + xcm::v3::Junction::AccountId32 { network: None, id: Utility::derivative_account_id( polkadot_parachain_primitives::primitives::Sibling::from( @@ -1083,10 +1080,10 @@ pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLoca ), ) } else { - MultiLocation::default() + xcm::v3::Location::default() } } else { - MultiLocation::default() + xcm::v3::Location::default() } }, } @@ -1162,7 +1159,7 @@ parameter_types! { } pub struct SubstrateResponseManager; -impl QueryResponseManager +impl QueryResponseManager for SubstrateResponseManager { fn get_query_response_record(query_id: QueryId) -> bool { @@ -1174,14 +1171,14 @@ impl QueryResponseManager } fn create_query_record( - responder: &MultiLocation, + responder: Location, call_back: Option, timeout: BlockNumber, ) -> u64 { if let Some(call_back) = call_back { - PolkadotXcm::new_notify_query(*responder, call_back, timeout, Here) + PolkadotXcm::new_notify_query(responder.clone(), call_back, timeout, Here) } else { - PolkadotXcm::new_query(*responder, timeout, Here) + PolkadotXcm::new_query(responder, timeout, Here) } } @@ -1882,47 +1879,13 @@ pub type SignedPayload = generic::SignedPayload; /// upgrades in case governance decides to do so. THE ORDER IS IMPORTANT. pub type Migrations = migrations::Unreleased; -parameter_types! { - pub const TipsPalletName: &'static str = "Tips"; - pub const BountiesPalletName: &'static str = "Bounties"; -} - /// The runtime migrations per release. pub mod migrations { #[allow(unused_imports)] use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = ( - // Unlock & unreserve funds - pallet_tips::migrations::unreserve_deposits::UnreserveDeposits, - cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, - migration::slpx_migrates_whitelist::UpdateWhitelist, - frame_support::migrations::RemovePallet< - TipsPalletName, - ::DbWeight, - >, - frame_support::migrations::RemovePallet< - BountiesPalletName, - ::DbWeight, - >, - pallet_identity::migration::versioned::V0ToV1, - pallet_collator_selection::migration::v2::MigrationToV2, - ); -} - -// Special Config for tips pallets, allowing us to run migrations for them without -// implementing their configs on [`Runtime`]. -pub struct UnlockConfigForTips; -impl pallet_tips::migrations::unreserve_deposits::UnlockConfig<()> for UnlockConfigForTips { - type Currency = Balances; - type Hash = Hash; - type DataDepositPerByte = DataDepositPerByte; - type TipReportDepositBase = TipReportDepositBase; - type AccountId = AccountId; - type BlockNumber = BlockNumberFor; - type DbWeight = ::DbWeight; - type PalletName = TipsPalletName; + pub type Unreleased = (); } /// Executive: handles dispatch to the various modules. diff --git a/runtime/bifrost-polkadot/src/migration.rs b/runtime/bifrost-polkadot/src/migration.rs index adb8af6de..fb6a68e23 100644 --- a/runtime/bifrost-polkadot/src/migration.rs +++ b/runtime/bifrost-polkadot/src/migration.rs @@ -239,6 +239,7 @@ pub mod slpx_migrates_whitelist { pub struct UpdateWhitelist; impl OnRuntimeUpgrade for UpdateWhitelist { fn on_runtime_upgrade() -> Weight { + pallet_xcm::migrations::migrate_to_v1::>(); let new_whitelist: BoundedVec> = vec![ AccountId::from_ss58check("gWEvf2EDMzxR7JHyrEHXf3nqxKLGvHaFbk7HUkJnNPUxDts") .unwrap(), diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs b/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs index 178916670..927135cec 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_asset_registry.rs @@ -138,7 +138,7 @@ impl bifrost_asset_registry::WeightInfo for BifrostWeig // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) // Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) // Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) - fn register_multilocation() -> Weight { + fn register_location() -> Weight { // Proof Size summary in bytes: // Measured: `683` // Estimated: `4148` @@ -155,7 +155,7 @@ impl bifrost_asset_registry::WeightInfo for BifrostWeig // Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) // Storage: AssetRegistry CurrencyIdToLocations (r:0 w:1) // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) - fn force_set_multilocation() -> Weight { + fn force_set_location() -> Weight { // Proof Size summary in bytes: // Measured: `683` // Estimated: `4148` diff --git a/runtime/bifrost-polkadot/src/weights/pallet_xcm.rs b/runtime/bifrost-polkadot/src/weights/pallet_xcm.rs index 3f413862f..5fe4c382a 100644 --- a/runtime/bifrost-polkadot/src/weights/pallet_xcm.rs +++ b/runtime/bifrost-polkadot/src/weights/pallet_xcm.rs @@ -64,35 +64,67 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 24_079_000 picoseconds. - Weight::from_parts(24_695_000, 0) - .saturating_add(Weight::from_parts(0, 3540)) + // Measured: `145` + // Estimated: `3610` + // Minimum execution time: 21_170_000 picoseconds. + Weight::from_parts(21_757_000, 0) + .saturating_add(Weight::from_parts(0, 3610)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) + /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1489` - // Minimum execution time: 18_654_000 picoseconds. - Weight::from_parts(19_331_000, 0) - .saturating_add(Weight::from_parts(0, 1489)) - .saturating_add(T::DbWeight::get().reads(1)) + // Measured: `197` + // Estimated: `3662` + // Minimum execution time: 94_487_000 picoseconds. + Weight::from_parts(96_276_000, 0) + .saturating_add(Weight::from_parts(0, 3662)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`) fn reserve_transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1489` - // Minimum execution time: 13_972_000 picoseconds. - Weight::from_parts(14_410_000, 0) - .saturating_add(Weight::from_parts(0, 1489)) - .saturating_add(T::DbWeight::get().reads(1)) + // Measured: `419` + // Estimated: `6196` + // Minimum execution time: 119_502_000 picoseconds. + Weight::from_parts(121_486_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -116,10 +148,10 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn transfer_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `496` + // Measured: `600` // Estimated: `6208` - // Minimum execution time: 146_932_000 picoseconds. - Weight::from_parts(153_200_000, 0) + // Minimum execution time: 143_889_000 picoseconds. + Weight::from_parts(147_227_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(7)) @@ -140,8 +172,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_624_000 picoseconds. - Weight::from_parts(7_005_000, 0) + // Minimum execution time: 6_141_000 picoseconds. + Weight::from_parts(6_320_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -151,8 +183,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_213_000 picoseconds. - Weight::from_parts(2_374_000, 0) + // Minimum execution time: 2_013_000 picoseconds. + Weight::from_parts(2_144_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -176,11 +208,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 28_117_000 picoseconds. - Weight::from_parts(29_002_000, 0) - .saturating_add(Weight::from_parts(0, 3540)) + // Measured: `145` + // Estimated: `3610` + // Minimum execution time: 26_192_000 picoseconds. + Weight::from_parts(26_891_000, 0) + .saturating_add(Weight::from_parts(0, 3610)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -202,11 +234,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `292` - // Estimated: `3757` - // Minimum execution time: 30_111_000 picoseconds. - Weight::from_parts(30_890_000, 0) - .saturating_add(Weight::from_parts(0, 3757)) + // Measured: `363` + // Estimated: `3828` + // Minimum execution time: 28_794_000 picoseconds. + Weight::from_parts(29_672_000, 0) + .saturating_add(Weight::from_parts(0, 3828)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -216,45 +248,45 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_126_000 picoseconds. - Weight::from_parts(2_293_000, 0) + // Minimum execution time: 1_890_000 picoseconds. + Weight::from_parts(2_068_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `PolkadotXcm::SupportedVersion` (r:4 w:2) + /// Storage: `PolkadotXcm::SupportedVersion` (r:5 w:2) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) fn migrate_supported_version() -> Weight { // Proof Size summary in bytes: - // Measured: `129` - // Estimated: `11019` - // Minimum execution time: 17_037_000 picoseconds. - Weight::from_parts(17_778_000, 0) - .saturating_add(Weight::from_parts(0, 11019)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `159` + // Estimated: `13524` + // Minimum execution time: 18_690_000 picoseconds. + Weight::from_parts(19_397_000, 0) + .saturating_add(Weight::from_parts(0, 13524)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `PolkadotXcm::VersionNotifiers` (r:4 w:2) + /// Storage: `PolkadotXcm::VersionNotifiers` (r:5 w:2) /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) fn migrate_version_notifiers() -> Weight { // Proof Size summary in bytes: - // Measured: `133` - // Estimated: `11023` - // Minimum execution time: 16_863_000 picoseconds. - Weight::from_parts(17_392_000, 0) - .saturating_add(Weight::from_parts(0, 11023)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `163` + // Estimated: `13528` + // Minimum execution time: 18_719_000 picoseconds. + Weight::from_parts(19_241_000, 0) + .saturating_add(Weight::from_parts(0, 13528)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:0) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `140` - // Estimated: `13505` - // Minimum execution time: 18_745_000 picoseconds. - Weight::from_parts(19_010_000, 0) - .saturating_add(Weight::from_parts(0, 13505)) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `173` + // Estimated: `16013` + // Minimum execution time: 20_555_000 picoseconds. + Weight::from_parts(21_068_000, 0) + .saturating_add(Weight::from_parts(0, 16013)) + .saturating_add(T::DbWeight::get().reads(6)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -272,38 +304,38 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `6082` - // Minimum execution time: 26_717_000 picoseconds. - Weight::from_parts(27_144_000, 0) - .saturating_add(Weight::from_parts(0, 6082)) + // Measured: `212` + // Estimated: `6152` + // Minimum execution time: 26_014_000 picoseconds. + Weight::from_parts(26_786_000, 0) + .saturating_add(Weight::from_parts(0, 6152)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:3 w:0) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:0) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn notify_target_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `172` - // Estimated: `8587` - // Minimum execution time: 9_128_000 picoseconds. - Weight::from_parts(9_445_000, 0) - .saturating_add(Weight::from_parts(0, 8587)) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `206` + // Estimated: `11096` + // Minimum execution time: 11_678_000 picoseconds. + Weight::from_parts(12_132_000, 0) + .saturating_add(Weight::from_parts(0, 11096)) + .saturating_add(T::DbWeight::get().reads(4)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:2) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:2) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn migrate_version_notify_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `140` - // Estimated: `11030` - // Minimum execution time: 17_316_000 picoseconds. - Weight::from_parts(17_802_000, 0) - .saturating_add(Weight::from_parts(0, 11030)) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `170` + // Estimated: `13535` + // Minimum execution time: 19_050_000 picoseconds. + Weight::from_parts(19_546_000, 0) + .saturating_add(Weight::from_parts(0, 13535)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:2) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:2) /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -319,37 +351,49 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `146` - // Estimated: `11036` - // Minimum execution time: 33_426_000 picoseconds. - Weight::from_parts(33_986_000, 0) - .saturating_add(Weight::from_parts(0, 11036)) - .saturating_add(T::DbWeight::get().reads(10)) + // Measured: `212` + // Estimated: `13577` + // Minimum execution time: 34_690_000 picoseconds. + Weight::from_parts(35_397_000, 0) + .saturating_add(Weight::from_parts(0, 13577)) + .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: `XcmPallet::QueryCounter` (r:1 w:1) - /// Proof: `XcmPallet::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmPallet::Queries` (r:0 w:1) - /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn new_query() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1485` - // Minimum execution time: 2_947_000 picoseconds. - Weight::from_parts(3_117_000, 0) - .saturating_add(Weight::from_parts(0, 1485)) + // Measured: `103` + // Estimated: `1588` + // Minimum execution time: 4_663_000 picoseconds. + Weight::from_parts(4_812_000, 0) + .saturating_add(Weight::from_parts(0, 1588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `XcmPallet::Queries` (r:1 w:1) - /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:1 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn take_response() -> Weight { // Proof Size summary in bytes: - // Measured: `7576` - // Estimated: `11041` - // Minimum execution time: 24_595_000 picoseconds. - Weight::from_parts(24_907_000, 0) - .saturating_add(Weight::from_parts(0, 11041)) + // Measured: `7740` + // Estimated: `11205` + // Minimum execution time: 25_044_000 picoseconds. + Weight::from_parts(25_416_000, 0) + .saturating_add(Weight::from_parts(0, 11205)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) + /// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn claim_assets() -> Weight { + // Proof Size summary in bytes: + // Measured: `160` + // Estimated: `3625` + // Minimum execution time: 37_380_000 picoseconds. + Weight::from_parts(37_761_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/bifrost-polkadot/src/xcm_config.rs b/runtime/bifrost-polkadot/src/xcm_config.rs index aa14e96e2..ce5e7eefa 100644 --- a/runtime/bifrost-polkadot/src/xcm_config.rs +++ b/runtime/bifrost-polkadot/src/xcm_config.rs @@ -56,6 +56,7 @@ use bifrost_runtime_common::currency_adapter::{ BifrostDropAssets, DepositToAlternative, MultiCurrencyAdapter, }; use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; +use xcm::v4::{prelude::*, Asset, AssetId, InteriorLocation, Location}; /// Bifrost Asset Matcher pub struct BifrostAssetMatcher( @@ -65,12 +66,12 @@ pub struct BifrostAssetMatcher( impl MatchesFungible for BifrostAssetMatcher where - CurrencyIdConvert: Convert>, + CurrencyIdConvert: Convert>, Amount: TryFrom, { - fn matches_fungible(a: &MultiAsset) -> Option { - if let (Fungible(ref amount), Concrete(ref location)) = (&a.fun, &a.id) { - if CurrencyIdConvert::convert(*location).is_some() { + fn matches_fungible(a: &Asset) -> Option { + if let (Fungible(ref amount), AssetId(ref location)) = (&a.fun, &a.id) { + if CurrencyIdConvert::convert(location.clone()).is_some() { return CheckedConversion::checked_from(*amount); } } @@ -81,11 +82,11 @@ where /// A `FilterAssetLocation` implementation. Filters multi native assets whose /// reserve is same with `origin`. pub struct MultiNativeAsset(PhantomData); -impl ContainsPair for MultiNativeAsset +impl ContainsPair for MultiNativeAsset where ReserveProvider: Reserve, { - fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { + fn contains(asset: &Asset, origin: &Location) -> bool { if let Some(ref reserve) = ReserveProvider::reserve(asset) { if reserve == origin { return true; @@ -95,13 +96,13 @@ where } } -fn native_currency_location(id: CurrencyId) -> MultiLocation { - MultiLocation::new(0, X1(Junction::from(BoundedVec::try_from(id.encode()).unwrap()))) +fn native_currency_location(id: CurrencyId) -> Location { + Location::new(0, [Junction::from(BoundedVec::try_from(id.encode()).unwrap())]) } -impl> Convert> for BifrostCurrencyIdConvert { - fn convert(asset: MultiAsset) -> Option { - if let MultiAsset { id: Concrete(id), fun: Fungible(_) } = asset { +impl> Convert> for BifrostCurrencyIdConvert { + fn convert(asset: Asset) -> Option { + if let Asset { id: AssetId(id), fun: xcm::v4::Fungibility::Fungible(_) } = asset { Self::convert(id) } else { None @@ -109,87 +110,81 @@ impl> Convert> for BifrostCurrency } } -pub struct BifrostAccountIdToMultiLocation; -impl Convert for BifrostAccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { - X1(AccountId32 { network: None, id: account.into() }).into() +pub struct BifrostAccountIdToLocation; +impl Convert for BifrostAccountIdToLocation { + fn convert(account: AccountId) -> Location { + [AccountId32 { network: None, id: account.into() }].into() } } -pub struct BifrostCurrencyIdConvert(sp_std::marker::PhantomData); -impl> Convert> for BifrostCurrencyIdConvert { - fn convert(id: CurrencyId) -> Option { +pub struct BifrostCurrencyIdConvert(PhantomData); +impl> Convert> for BifrostCurrencyIdConvert { + fn convert(id: CurrencyId) -> Option { use CurrencyId::*; use TokenSymbol::*; - if let Some(id) = AssetIdMaps::::get_multi_location(id) { + if let Some(id) = AssetIdMaps::::get_location(id) { return Some(id); } match id { - Token2(DOT_TOKEN_ID) => Some(MultiLocation::parent()), + Token2(DOT_TOKEN_ID) => Some(Location::parent()), Native(BNC) => Some(native_currency_location(id)), // Moonbeam Native token - Token2(GLMR_TOKEN_ID) => Some(MultiLocation::new( + Token2(GLMR_TOKEN_ID) => Some(Location::new( 1, - X2( + [ Parachain(parachains::moonbeam::ID), PalletInstance(parachains::moonbeam::PALLET_ID.into()), - ), + ], )), _ => None, } } } -impl> Convert> for BifrostCurrencyIdConvert { - fn convert(location: MultiLocation) -> Option { +impl> Convert> for BifrostCurrencyIdConvert { + fn convert(location: Location) -> Option { use CurrencyId::*; use TokenSymbol::*; - if location == MultiLocation::parent() { + if location == Location::parent() { return Some(Token2(DOT_TOKEN_ID)); } - if let Some(currency_id) = AssetIdMaps::::get_currency_id(location) { + if let Some(currency_id) = AssetIdMaps::::get_currency_id(location.clone()) { return Some(currency_id); } - match location { - MultiLocation { parents: 1, interior } => match interior { - X2(Parachain(id), PalletInstance(index)) - if ((id == parachains::moonbeam::ID) && - (index == parachains::moonbeam::PALLET_ID)) => - Some(Token2(GLMR_TOKEN_ID)), - X2(Parachain(id), GeneralKey { data, length }) - if (id == u32::from(ParachainInfo::parachain_id())) => - { - let key = &data[..length as usize]; - if let Ok(currency_id) = CurrencyId::decode(&mut &key[..]) { - match currency_id { - Native(BNC) => Some(currency_id), - _ => None, - } - } else { - None + match &location.unpack() { + (0, [Parachain(id), PalletInstance(index)]) + if (*id == parachains::moonbeam::ID) && + (*index == parachains::moonbeam::PALLET_ID) => + Some(Token2(GLMR_TOKEN_ID)), + (0, [Parachain(id), GeneralKey { data, length }]) + if *id == u32::from(ParachainInfo::parachain_id()) => + { + let key = &data[..*length as usize]; + if let Ok(currency_id) = CurrencyId::decode(&mut &key[..]) { + match currency_id { + Native(BNC) => Some(currency_id), + _ => None, } - }, - _ => None, + } else { + None + } }, - MultiLocation { parents: 0, interior } => match interior { - X1(GeneralKey { data, length }) => { - // decode the general key - let key = &data[..length as usize]; - if let Ok(currency_id) = CurrencyId::decode(&mut &key[..]) { - match currency_id { - Native(BNC) => Some(currency_id), - _ => None, - } - } else { - None + (0, [GeneralKey { data, length }]) => { + // decode the general key + let key = &data[..*length as usize]; + if let Ok(currency_id) = CurrencyId::decode(&mut &key[..]) { + match currency_id { + Native(BNC) => Some(currency_id), + _ => None, } - }, - _ => None, + } else { + None + } }, _ => None, } @@ -197,14 +192,14 @@ impl> Convert> for BifrostCurre } parameter_types! { - pub const DotLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; + pub const DotLocation: Location = Location::parent(); + pub const RelayNetwork: NetworkId = Polkadot; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub SelfParaChainId: CumulusParaId = ParachainInfo::parachain_id(); - pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); + pub UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())].into(); } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch RuntimeOrigin. pub type LocationToAccountId = ( @@ -248,20 +243,13 @@ parameter_types! { pub const MaxInstructions: u32 = 100; } -match_types! { - pub type ParentOrParentsExecutivePlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; -} - /// Barrier allowing a top level paid message with DescendOrigin instruction pub const DEFAULT_PROOF_SIZE: u64 = 64 * 1024; pub const DEFAULT_REF_TIMR: u64 = 10_000_000_000; pub struct AllowTopLevelPaidExecutionDescendOriginFirst(PhantomData); -impl> ShouldExecute for AllowTopLevelPaidExecutionDescendOriginFirst { +impl> ShouldExecute for AllowTopLevelPaidExecutionDescendOriginFirst { fn should_execute( - origin: &MultiLocation, + origin: &Location, message: &mut [Instruction], max_weight: Weight, _weight_credit: &mut Properties, @@ -337,38 +325,38 @@ pub type BifrostAssetTransactor = MultiCurrencyAdapter< >; parameter_types! { - pub DotPerSecond: (AssetId,u128, u128) = (MultiLocation::parent().into(), dot_per_second::(),0); + pub DotPerSecond: (AssetId,u128, u128) = (Location::parent().into(), dot_per_second::(),0); pub BncPerSecond: (AssetId,u128, u128) = ( - MultiLocation::new( + Location::new( 1, - X2(Parachain(SelfParaId::get()), Junction::from(BoundedVec::try_from(NativeCurrencyId::get().encode()).unwrap())), + [xcm::v4::Junction::Parachain(SelfParaId::get()), xcm::v4::Junction::from(BoundedVec::try_from(NativeCurrencyId::get().encode()).unwrap())], ).into(), // BNC:DOT = 80:1 dot_per_second::() * 80, 0 ); pub BncNewPerSecond: (AssetId,u128, u128) = ( - MultiLocation::new( + Location::new( 0, - X1(Junction::from(BoundedVec::try_from(NativeCurrencyId::get().encode()).unwrap())) + [xcm::v4::Junction::from(BoundedVec::try_from(NativeCurrencyId::get().encode()).unwrap())] ).into(), // BNC:DOT = 80:1 dot_per_second::() * 80, 0 ); pub ZlkPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 1, - X2(Parachain(SelfParaId::get()), Junction::from(BoundedVec::try_from(CurrencyId::Token(TokenSymbol::ZLK).encode()).unwrap())) + [xcm::v4::Junction::Parachain(SelfParaId::get()), xcm::v4::Junction::from(BoundedVec::try_from(CurrencyId::Token(TokenSymbol::ZLK).encode()).unwrap())] ).into(), // ZLK:KSM = 150:1 dot_per_second::() * 150 * 1_000_000, 0 ); pub ZlkNewPerSecond: (AssetId, u128,u128) = ( - MultiLocation::new( + Location::new( 0, - X1(Junction::from(BoundedVec::try_from(CurrencyId::Token(TokenSymbol::ZLK).encode()).unwrap())) + [xcm::v4::Junction::from(BoundedVec::try_from(CurrencyId::Token(TokenSymbol::ZLK).encode()).unwrap())] ).into(), // ZLK:KSM = 150:1 dot_per_second::() * 150 * 1_000_000, @@ -379,8 +367,10 @@ parameter_types! { pub struct ToTreasury; impl TakeRevenue for ToTreasury { - fn take_revenue(revenue: MultiAsset) { - if let MultiAsset { id: Concrete(location), fun: Fungible(amount) } = revenue { + fn take_revenue(revenue: Asset) { + if let Asset { id: AssetId(location), fun: xcm::v4::Fungibility::Fungible(amount) } = + revenue + { if let Some(currency_id) = BifrostCurrencyIdConvert::::convert(location) { @@ -493,28 +483,6 @@ impl Contains for SafeCallFilter { } } -/// Matches foreign assets from a given origin. -/// Foreign assets are assets bridged from other consensus systems. i.e parents > 1. -pub struct IsForeignNativeAssetFrom(PhantomData); -impl ContainsPair for IsForeignNativeAssetFrom -where - Origin: Get, -{ - fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { - let loc = Origin::get(); - &loc == origin && - matches!( - asset, - MultiAsset { id: Concrete(MultiLocation { parents: 2, .. }), fun: Fungible(_) }, - ) - } -} - -parameter_types! { - /// Location of Asset Hub - pub AssetHubLocation: MultiLocation = (Parent, Parachain(1000)).into(); -} - pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type AssetClaims = PolkadotXcm; @@ -522,8 +490,7 @@ impl xcm_executor::Config for XcmConfig { type AssetTrap = BifrostDropAssets; type Barrier = Barrier; type RuntimeCall = RuntimeCall; - type IsReserve = - (IsForeignNativeAssetFrom, MultiNativeAsset); + type IsReserve = MultiNativeAsset; type IsTeleporter = (); type UniversalLocation = UniversalLocation; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -559,7 +526,7 @@ pub type XcmRouter = ( #[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub ReachableDest: Option = Some(Parent.into()); } impl pallet_xcm::Config for Runtime { @@ -728,14 +695,14 @@ impl orml_tokens::Config for Runtime { } parameter_types! { - pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); - pub SelfRelativeLocation: MultiLocation = MultiLocation::here(); + pub SelfLocation: Location = Location::new(1, [Parachain(ParachainInfo::get().into())]); + pub SelfRelativeLocation: Location = Location::here(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); pub const MaxAssetsForTransfer: usize = 2; } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } @@ -745,7 +712,7 @@ impl orml_xtokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = BifrostCurrencyIdConvert; - type AccountIdToMultiLocation = BifrostAccountIdToMultiLocation; + type AccountIdToLocation = BifrostAccountIdToLocation; type UniversalLocation = UniversalLocation; type SelfLocation = SelfRelativeLocation; type XcmExecutor = XcmExecutor; @@ -753,8 +720,10 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); } impl orml_unknown_tokens::Config for Runtime { @@ -778,129 +747,9 @@ impl bifrost_xcm_interface::Config for Runtime { type RelaychainCurrencyId = RelayCurrencyId; type ParachainSovereignAccount = ParachainAccount; type XcmExecutor = XcmExecutor; - type AccountIdToMultiLocation = BifrostAccountIdToMultiLocation; + type AccountIdToLocation = BifrostAccountIdToLocation; type SalpHelper = Salp; type ParachainId = SelfParaChainId; type CallBackTimeOut = ConstU32<10>; type CurrencyIdConvert = AssetIdMaps; } - -#[cfg(test)] -mod tests { - use hex_literal::hex; - use sp_core::crypto::Ss58Codec; - use xcm::{ - prelude::{AccountId32, AccountKey20, Parachain, X2}, - v3::{MultiLocation, NetworkId}, - }; - use xcm_builder::{DescribeAllTerminal, DescribeFamily}; - use xcm_executor::traits::ConvertLocation; - - use crate::AccountId; - - #[test] - fn test_location_to_account() { - let moonbeam_slpx_origin_location = MultiLocation::new( - 1, - X2( - Parachain(2004), - AccountKey20 { - network: None, - key: hex!["F1d4797E51a4640a76769A50b57abE7479ADd3d8"].into(), - }, - ), - ); - let moonbeam_slpx_derived = xcm_builder::HashedDescription::< - AccountId, - DescribeFamily, - >::convert_location(&moonbeam_slpx_origin_location) - .unwrap(); - - let moonbeam_receiver_origin_location = MultiLocation::new( - 1, - X2( - Parachain(2004), - AccountKey20 { - network: None, - key: hex!["64DC1E8b5E9515dE37b58b4d8629Bf89BcD1F576"].into(), - }, - ), - ); - let moonbeam_receiver_derived = xcm_builder::HashedDescription::< - AccountId, - DescribeFamily, - >::convert_location(&moonbeam_receiver_origin_location) - .unwrap(); - - let moonriver_slpx_origin_location = MultiLocation::new( - 1, - X2( - Parachain(2023), - AccountKey20 { - network: None, - key: hex!["6b0A44c64190279f7034b77c13a566E914FE5Ec4"].into(), - }, - ), - ); - let moonriver_slpx_derived = xcm_builder::HashedDescription::< - AccountId, - DescribeFamily, - >::convert_location(&moonriver_slpx_origin_location) - .unwrap(); - - let astar_slpx_origin_location = MultiLocation::new( - 1, - X2( - Parachain(2006), - AccountId32 { - network: Some(NetworkId::Polkadot), - id: hex!["b3d19dad606c8f323460d7bb64a147af60923b85d3c853596954c71d2cfe20e3"] - .into(), - }, - ), - ); - let astar_slpx_derived = xcm_builder::HashedDescription::< - AccountId, - DescribeFamily, - >::convert_location(&astar_slpx_origin_location) - .unwrap(); - - let astar_receiver_origin_location = MultiLocation::new( - 1, - X2( - Parachain(2006), - AccountId32 { - network: Some(NetworkId::Polkadot), - id: hex!["576dee92eedbd7ffe0695569ac7a8db30edd204f2c42f53f14e0e863702c597e"] - .into(), - }, - ), - ); - let astar_receiver_derived = xcm_builder::HashedDescription::< - AccountId, - DescribeFamily, - >::convert_location(&astar_receiver_origin_location) - .unwrap(); - - assert_eq!( - moonbeam_slpx_derived, - AccountId::from_ss58check("gWEvf2EDMzxR7JHyrEHXf3nqxKLGvHaFbk7HUkJnNPUxDts").unwrap() - ); - assert_eq!( - moonbeam_receiver_derived, - AccountId::from_ss58check("bpRBE4rWcBJqqN2ESts5LefuvLonBeZ4r2YBpfuuxvMxoea").unwrap() - ); - assert_eq!( - moonriver_slpx_derived, - AccountId::from_ss58check("gtXJWw9ME9w7cXfmR6n9MFkKCSu2MrtA3dcFV2BhHpEZFjZ").unwrap() - ); - assert_eq!( - astar_slpx_derived, - AccountId::from_ss58check("g96o4GVpsAop1MJiArnmUYtXUjEisfkbfcpsuqmXrS28MEr").unwrap() - ); - assert_eq!( - astar_receiver_derived, - AccountId::from_ss58check("dZWAvaUWbPN1oKbWMkeDWHBceX8RqP4CMwmi1trq9uf5pBn").unwrap() - ); - } -} diff --git a/runtime/common/src/currency_adapter.rs b/runtime/common/src/currency_adapter.rs index 34275ee91..a928942cd 100644 --- a/runtime/common/src/currency_adapter.rs +++ b/runtime/common/src/currency_adapter.rs @@ -12,18 +12,21 @@ use sp_std::{ prelude::*, result, }; -use xcm::v3::{prelude::*, Error as XcmError, MultiAsset, MultiLocation, Result, Weight}; +use xcm::{ + v3::{Error as XcmError, Result, Weight}, + v4::Asset, +}; use xcm_builder::TakeRevenue; use xcm_executor::{ traits::{ConvertLocation, DropAssets, MatchesFungible, TransactAsset}, - Assets, + AssetsInHolding, }; /// Asset transaction errors. enum Error { /// Failed to match fungible. FailedToMatchFungible, - /// `MultiLocation` to `AccountId` Conversion failed. + /// `Location` to `AccountId` Conversion failed. AccountIdConversionFailed, /// `CurrencyId` conversion failed. CurrencyIdConversionFailed, @@ -56,13 +59,13 @@ pub trait OnDepositFail { /// Called on unknown asset deposit errors. fn on_deposit_unknown_asset_fail( err: DispatchError, - _asset: &MultiAsset, - _location: &MultiLocation, + _asset: &Asset, + _location: &xcm::v4::Location, ) -> Result { Err(XcmError::FailedToTransactAsset(err.into())) } - /// Called on `MultiLocation` to `AccountId` conversion errors. + /// Called on `Location` to `AccountId` conversion errors. fn on_account_id_convert_fail(currency_id: CurrencyId, amount: Balance) -> Result; } @@ -96,7 +99,7 @@ impl< } } -/// The `TransactAsset` implementation, to handle `MultiAsset` deposit/withdraw. +/// The `TransactAsset` implementation, to handle `Asset` deposit/withdraw. /// Note that teleport related functions are unimplemented. /// /// Methods of `DepositFailureHandler` would be called on multi-currency deposit @@ -134,7 +137,7 @@ impl< AccountId: sp_std::fmt::Debug + Clone, AccountIdConvert: ConvertLocation, CurrencyId: FullCodec + Eq + PartialEq + Copy + MaybeSerializeDeserialize + Debug, - CurrencyIdConvert: Convert>, + CurrencyIdConvert: Convert>, DepositFailureHandler: OnDepositFail, > TransactAsset for MultiCurrencyAdapter< @@ -149,9 +152,9 @@ impl< > { fn deposit_asset( - asset: &MultiAsset, - location: &MultiLocation, - _context: Option<&XcmContext>, + asset: &Asset, + location: &xcm::v4::Location, + _context: Option<&xcm::v4::XcmContext>, ) -> Result { match ( AccountIdConvert::convert_location(location), @@ -174,10 +177,10 @@ impl< } fn withdraw_asset( - asset: &MultiAsset, - location: &MultiLocation, - _maybe_context: Option<&XcmContext>, - ) -> result::Result { + asset: &Asset, + location: &xcm::v4::Location, + _maybe_context: Option<&xcm::v4::XcmContext>, + ) -> result::Result { UnknownAsset::withdraw(asset, location).or_else(|_| { let who = AccountIdConvert::convert_location(location) .ok_or(XcmError::from(Error::AccountIdConversionFailed))?; @@ -194,11 +197,11 @@ impl< } fn transfer_asset( - asset: &MultiAsset, - from: &MultiLocation, - to: &MultiLocation, - _context: &XcmContext, - ) -> result::Result { + asset: &Asset, + from: &xcm::v4::Location, + to: &xcm::v4::Location, + _context: &xcm::v4::XcmContext, + ) -> result::Result { let from_account = AccountIdConvert::convert_location(from) .ok_or(XcmError::from(Error::AccountIdConversionFailed))?; let to_account = AccountIdConvert::convert_location(to) @@ -220,8 +223,12 @@ impl DropAssets for BifrostDropAssets where T: TakeRevenue, { - fn drop_assets(_origin: &MultiLocation, assets: Assets, _context: &XcmContext) -> Weight { - let multi_assets: Vec = assets.into(); + fn drop_assets( + _origin: &xcm::v4::Location, + assets: AssetsInHolding, + _context: &xcm::v4::XcmContext, + ) -> Weight { + let multi_assets: Vec = assets.into(); for asset in multi_assets { T::take_revenue(asset); }