From c55a133282c7a832a1512db670cd70233339f02f Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 20 Feb 2022 21:53:30 +0100 Subject: [PATCH 01/17] NFT support and a test --- Cargo.lock | 340 +++++++++--------- xcm/src/v3/multiasset.rs | 124 +++++++ xcm/xcm-builder/src/fungibles_adapter.rs | 101 +----- xcm/xcm-builder/src/lib.rs | 17 +- xcm/xcm-builder/src/matches_fungible.rs | 88 ----- .../src/traits/matches_fungible.rs | 32 -- .../src/traits/matches_fungibles.rs | 58 --- xcm/xcm-executor/src/traits/mod.rs | 6 +- xcm/xcm-executor/src/traits/transact_asset.rs | 2 +- xcm/xcm-simulator/example/Cargo.toml | 1 + xcm/xcm-simulator/example/src/lib.rs | 37 +- xcm/xcm-simulator/example/src/parachain.rs | 37 +- xcm/xcm-simulator/example/src/relay_chain.rs | 38 +- 13 files changed, 427 insertions(+), 454 deletions(-) delete mode 100644 xcm/xcm-builder/src/matches_fungible.rs delete mode 100644 xcm/xcm-executor/src/traits/matches_fungible.rs delete mode 100644 xcm/xcm-executor/src/traits/matches_fungibles.rs diff --git a/Cargo.lock b/Cargo.lock index 7c464bfaa6bb..a77a87cf97f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -439,7 +439,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "beefy-primitives", "fnv", @@ -468,7 +468,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -491,12 +491,12 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -1889,7 +1889,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", ] @@ -1907,7 +1907,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -1929,7 +1929,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "Inflector", "chrono", @@ -1956,7 +1956,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -1970,7 +1970,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -1998,7 +1998,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "bitflags", "frame-metadata", @@ -2027,7 +2027,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.1.2", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro2", "quote", @@ -2061,7 +2061,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2084,7 +2084,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -2095,7 +2095,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "log", @@ -2112,7 +2112,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -2127,7 +2127,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "sp-api", @@ -2136,7 +2136,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "sp-api", @@ -2332,7 +2332,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "chrono", "frame-election-provider-support", @@ -4752,7 +4752,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4766,7 +4766,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -4782,7 +4782,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -4797,7 +4797,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4821,7 +4821,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4841,7 +4841,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4861,7 +4861,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4876,7 +4876,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "beefy-primitives", "frame-support", @@ -4892,7 +4892,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -4917,7 +4917,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5001,7 +5001,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5018,7 +5018,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5034,7 +5034,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5057,7 +5057,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5075,7 +5075,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5090,7 +5090,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5113,7 +5113,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5129,7 +5129,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5149,7 +5149,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5166,7 +5166,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5183,7 +5183,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5201,7 +5201,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5217,7 +5217,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5234,7 +5234,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5249,7 +5249,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5263,7 +5263,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5280,7 +5280,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5303,7 +5303,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5319,7 +5319,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5334,7 +5334,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5348,7 +5348,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5364,7 +5364,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5385,7 +5385,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5401,7 +5401,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5415,7 +5415,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5438,7 +5438,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro-crate 1.1.2", "proc-macro2", @@ -5449,7 +5449,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "sp-arithmetic", @@ -5458,7 +5458,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5472,7 +5472,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5490,7 +5490,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5509,7 +5509,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5526,7 +5526,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5543,7 +5543,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5554,7 +5554,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5568,10 +5568,25 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-uniques" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5587,7 +5602,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7991,7 +8006,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "env_logger 0.9.0", "jsonrpsee 0.8.0", @@ -8338,7 +8353,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "sp-core", @@ -8349,7 +8364,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -8376,7 +8391,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "futures-timer", @@ -8399,7 +8414,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8415,7 +8430,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8432,7 +8447,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro-crate 1.1.2", "proc-macro2", @@ -8443,7 +8458,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "chrono", "clap", @@ -8481,7 +8496,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "fnv", "futures 0.3.21", @@ -8509,7 +8524,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "hash-db", "kvdb", @@ -8534,7 +8549,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -8558,7 +8573,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "fork-tree", @@ -8601,7 +8616,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -8625,7 +8640,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8638,7 +8653,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -8663,7 +8678,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "sc-client-api", "sp-authorship", @@ -8674,7 +8689,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "lazy_static", "libsecp256k1", @@ -8702,7 +8717,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "environmental", "parity-scale-codec", @@ -8719,7 +8734,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "parity-scale-codec", @@ -8735,7 +8750,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8753,7 +8768,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ahash", "async-trait", @@ -8792,7 +8807,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "finality-grandpa", "futures 0.3.21", @@ -8816,7 +8831,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ansi_term", "futures 0.3.21", @@ -8833,7 +8848,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "hex", @@ -8848,7 +8863,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-std", "async-trait", @@ -8898,7 +8913,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ahash", "futures 0.3.21", @@ -8915,7 +8930,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "bytes 1.1.0", "fnv", @@ -8943,7 +8958,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "libp2p", @@ -8956,7 +8971,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8965,7 +8980,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "hash-db", @@ -8996,7 +9011,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9021,7 +9036,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9038,7 +9053,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "directories", @@ -9102,7 +9117,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "parity-scale-codec", @@ -9116,7 +9131,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -9137,7 +9152,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "chrono", "futures 0.3.21", @@ -9155,7 +9170,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ansi_term", "atty", @@ -9186,7 +9201,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro-crate 1.1.2", "proc-macro2", @@ -9197,7 +9212,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9224,7 +9239,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "log", @@ -9237,7 +9252,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9686,7 +9701,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "hash-db", "log", @@ -9703,7 +9718,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "blake2 0.10.2", "proc-macro-crate 1.1.2", @@ -9715,7 +9730,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -9728,7 +9743,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "integer-sqrt", "num-traits", @@ -9743,7 +9758,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -9756,7 +9771,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "parity-scale-codec", @@ -9768,7 +9783,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "sp-api", @@ -9780,7 +9795,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "log", @@ -9798,7 +9813,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -9817,7 +9832,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "merlin", @@ -9840,7 +9855,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -9852,7 +9867,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9864,7 +9879,7 @@ dependencies = [ [[package]] name = "sp-core" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "base58", "bitflags", @@ -9909,7 +9924,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "blake2 0.10.2", "byteorder", @@ -9923,7 +9938,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro2", "quote", @@ -9934,7 +9949,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "kvdb", "parking_lot 0.11.2", @@ -9943,7 +9958,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro2", "quote", @@ -9953,7 +9968,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "environmental", "parity-scale-codec", @@ -9964,7 +9979,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "finality-grandpa", "log", @@ -9982,7 +9997,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9996,7 +10011,7 @@ dependencies = [ [[package]] name = "sp-io" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "hash-db", @@ -10020,7 +10035,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "lazy_static", "sp-core", @@ -10031,7 +10046,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -10048,7 +10063,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "thiserror", "zstd", @@ -10057,7 +10072,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -10072,7 +10087,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro-crate 1.1.2", "proc-macro2", @@ -10083,7 +10098,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "sp-api", "sp-core", @@ -10093,7 +10108,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "backtrace", "lazy_static", @@ -10103,7 +10118,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "rustc-hash", "serde", @@ -10113,7 +10128,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "either", "hash256-std-hasher", @@ -10135,7 +10150,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10152,7 +10167,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "Inflector", "proc-macro-crate 1.1.2", @@ -10164,7 +10179,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "serde", "serde_json", @@ -10173,7 +10188,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -10187,7 +10202,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -10198,7 +10213,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "hash-db", "log", @@ -10221,12 +10236,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" [[package]] name = "sp-storage" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10239,7 +10254,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "sp-core", @@ -10252,7 +10267,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures-timer", @@ -10268,7 +10283,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "sp-std", @@ -10280,7 +10295,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "sp-api", "sp-runtime", @@ -10289,7 +10304,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "log", @@ -10305,7 +10320,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "hash-db", "memory-db", @@ -10320,7 +10335,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10337,7 +10352,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10348,7 +10363,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "impl-trait-for-tuples", "log", @@ -10516,7 +10531,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "platforms", ] @@ -10524,7 +10539,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.21", @@ -10546,7 +10561,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-std", "futures-util", @@ -10560,7 +10575,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -10586,7 +10601,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "substrate-test-utils-derive", @@ -10596,7 +10611,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro-crate 1.1.2", "proc-macro2", @@ -10607,7 +10622,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ansi_term", "build-helper", @@ -11202,7 +11217,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f72fe056844a375f16449555d6e20e57dcd16aa6" +source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "clap", "jsonrpsee 0.4.1", @@ -12190,6 +12205,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-balances", + "pallet-uniques", "pallet-xcm", "parity-scale-codec", "polkadot-core-primitives", diff --git a/xcm/src/v3/multiasset.rs b/xcm/src/v3/multiasset.rs index 9762fd97c02a..9a5f1c3cecc7 100644 --- a/xcm/src/v3/multiasset.rs +++ b/xcm/src/v3/multiasset.rs @@ -107,6 +107,130 @@ impl From<[u8; 32]> for AssetInstance { } } +impl From for AssetInstance { + fn from(x: u8) -> Self { + Self::Index(x as u128) + } +} + +impl From for AssetInstance { + fn from(x: u16) -> Self { + Self::Index(x as u128) + } +} + +impl From for AssetInstance { + fn from(x: u32) -> Self { + Self::Index(x as u128) + } +} + +impl From for AssetInstance { + fn from(x: u64) -> Self { + Self::Index(x as u128) + } +} + +impl TryFrom for () { + type Error = (); + fn try_from(x: AssetInstance) -> Result { + match x { + AssetInstance::Undefined => Ok(()), + _ => Err(()), + } + } +} + +impl TryFrom for [u8; 4] { + type Error = (); + fn try_from(x: AssetInstance) -> Result { + match x { + AssetInstance::Array4(x) => Ok(x), + _ => Err(()), + } + } +} + +impl TryFrom for [u8; 8] { + type Error = (); + fn try_from(x: AssetInstance) -> Result { + match x { + AssetInstance::Array8(x) => Ok(x), + _ => Err(()), + } + } +} + +impl TryFrom for [u8; 16] { + type Error = (); + fn try_from(x: AssetInstance) -> Result { + match x { + AssetInstance::Array16(x) => Ok(x), + _ => Err(()), + } + } +} + +impl TryFrom for [u8; 32] { + type Error = (); + fn try_from(x: AssetInstance) -> Result { + match x { + AssetInstance::Array32(x) => Ok(x), + _ => Err(()), + } + } +} + +impl TryFrom for u8 { + type Error = (); + fn try_from(x: AssetInstance) -> Result { + match x { + AssetInstance::Index(x) => x.try_into().map_err(|_| ()), + _ => Err(()), + } + } +} + +impl TryFrom for u16 { + type Error = (); + fn try_from(x: AssetInstance) -> Result { + match x { + AssetInstance::Index(x) => x.try_into().map_err(|_| ()), + _ => Err(()), + } + } +} + +impl TryFrom for u32 { + type Error = (); + fn try_from(x: AssetInstance) -> Result { + match x { + AssetInstance::Index(x) => x.try_into().map_err(|_| ()), + _ => Err(()), + } + } +} + +impl TryFrom for u64 { + type Error = (); + fn try_from(x: AssetInstance) -> Result { + match x { + AssetInstance::Index(x) => x.try_into().map_err(|_| ()), + _ => Err(()), + } + } +} + +impl TryFrom for u128 { + type Error = (); + fn try_from(x: AssetInstance) -> Result { + match x { + AssetInstance::Index(x) => Ok(x), + _ => Err(()), + } + } +} + /// Classification of whether an asset is fungible or not, along with a mandatory amount or instance. #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)] pub enum Fungibility { diff --git a/xcm/xcm-builder/src/fungibles_adapter.rs b/xcm/xcm-builder/src/fungibles_adapter.rs index cb7abd048d0d..7a6b0a014162 100644 --- a/xcm/xcm-builder/src/fungibles_adapter.rs +++ b/xcm/xcm-builder/src/fungibles_adapter.rs @@ -17,96 +17,11 @@ //! Adapters to work with `frame_support::traits::tokens::fungibles` through XCM. use frame_support::traits::{tokens::fungibles, Contains, Get}; -use sp_std::{borrow::Borrow, marker::PhantomData, prelude::*, result}; -use xcm::latest::{ - AssetId::{Abstract, Concrete}, - Error as XcmError, - Fungibility::Fungible, - Junction, MultiAsset, MultiLocation, Result, +use sp_std::{marker::PhantomData, prelude::*, result}; +use xcm::latest::prelude::*; +use xcm_executor::traits::{ + Convert, Error as MatchError, MatchesFungibles, TransactAsset, }; -use xcm_executor::traits::{Convert, Error as MatchError, MatchesFungibles, TransactAsset}; - -/// Converter struct implementing `AssetIdConversion` converting a numeric asset ID (must be `TryFrom/TryInto`) into -/// a `GeneralIndex` junction, prefixed by some `MultiLocation` value. The `MultiLocation` value will typically be a -/// `PalletInstance` junction. -pub struct AsPrefixedGeneralIndex( - PhantomData<(Prefix, AssetId, ConvertAssetId)>, -); -impl, AssetId: Clone, ConvertAssetId: Convert> - Convert for AsPrefixedGeneralIndex -{ - fn convert_ref(id: impl Borrow) -> result::Result { - let prefix = Prefix::get(); - let id = id.borrow(); - if prefix.parent_count() != id.parent_count() || - prefix - .interior() - .iter() - .enumerate() - .any(|(index, junction)| id.interior().at(index) != Some(junction)) - { - return Err(()) - } - match id.interior().at(prefix.interior().len()) { - Some(Junction::GeneralIndex(id)) => ConvertAssetId::convert_ref(id), - _ => Err(()), - } - } - fn reverse_ref(what: impl Borrow) -> result::Result { - let mut location = Prefix::get(); - let id = ConvertAssetId::reverse_ref(what)?; - location.push_interior(Junction::GeneralIndex(id)).map_err(|_| ())?; - Ok(location) - } -} - -pub struct ConvertedConcreteAssetId( - PhantomData<(AssetId, Balance, ConvertAssetId, ConvertBalance)>, -); -impl< - AssetId: Clone, - Balance: Clone, - ConvertAssetId: Convert, - ConvertBalance: Convert, - > MatchesFungibles - for ConvertedConcreteAssetId -{ - fn matches_fungibles(a: &MultiAsset) -> result::Result<(AssetId, Balance), MatchError> { - let (amount, id) = match (&a.fun, &a.id) { - (Fungible(ref amount), Concrete(ref id)) => (amount, id), - _ => return Err(MatchError::AssetNotFound), - }; - let what = - ConvertAssetId::convert_ref(id).map_err(|_| MatchError::AssetIdConversionFailed)?; - let amount = ConvertBalance::convert_ref(amount) - .map_err(|_| MatchError::AmountToBalanceConversionFailed)?; - Ok((what, amount)) - } -} - -pub struct ConvertedAbstractAssetId( - PhantomData<(AssetId, Balance, ConvertAssetId, ConvertBalance)>, -); -impl< - AssetId: Clone, - Balance: Clone, - ConvertAssetId: Convert<[u8; 32], AssetId>, - ConvertBalance: Convert, - > MatchesFungibles - for ConvertedAbstractAssetId -{ - fn matches_fungibles(a: &MultiAsset) -> result::Result<(AssetId, Balance), MatchError> { - let (amount, id) = match (&a.fun, &a.id) { - (Fungible(ref amount), Abstract(ref id)) => (amount, id), - _ => return Err(MatchError::AssetNotFound), - }; - let what = - ConvertAssetId::convert_ref(id).map_err(|_| MatchError::AssetIdConversionFailed)?; - let amount = ConvertBalance::convert_ref(amount) - .map_err(|_| MatchError::AmountToBalanceConversionFailed)?; - Ok((what, amount)) - } -} pub struct FungiblesTransferAdapter( PhantomData<(Assets, Matcher, AccountIdConverter, AccountId)>, @@ -165,7 +80,7 @@ impl< CheckingAccount, > { - fn can_check_in(_origin: &MultiLocation, what: &MultiAsset) -> Result { + fn can_check_in(_origin: &MultiLocation, what: &MultiAsset) -> XcmResult { log::trace!( target: "xcm::fungibles_adapter", "can_check_in origin: {:?}, what: {:?}", @@ -216,7 +131,7 @@ impl< } } - fn deposit_asset(what: &MultiAsset, who: &MultiLocation) -> Result { + fn deposit_asset(what: &MultiAsset, who: &MultiLocation) -> XcmResult { log::trace!( target: "xcm::fungibles_adapter", "deposit_asset what: {:?}, who: {:?}", @@ -267,7 +182,7 @@ impl< > TransactAsset for FungiblesAdapter { - fn can_check_in(origin: &MultiLocation, what: &MultiAsset) -> Result { + fn can_check_in(origin: &MultiLocation, what: &MultiAsset) -> XcmResult { FungiblesMutateAdapter::< Assets, Matcher, @@ -300,7 +215,7 @@ impl< >::check_out(dest, what) } - fn deposit_asset(what: &MultiAsset, who: &MultiLocation) -> Result { + fn deposit_asset(what: &MultiAsset, who: &MultiLocation) -> XcmResult { FungiblesMutateAdapter::< Assets, Matcher, diff --git a/xcm/xcm-builder/src/lib.rs b/xcm/xcm-builder/src/lib.rs index 1cde398c7713..1f445939c149 100644 --- a/xcm/xcm-builder/src/lib.rs +++ b/xcm/xcm-builder/src/lib.rs @@ -40,6 +40,11 @@ pub use origin_conversion::{ SignedToAccountId32, SovereignSignedViaLocation, }; +mod asset_conversion; +pub use asset_conversion::{ + AsPrefixedGeneralIndex, ConvertedAbstractAssetId, ConvertedConcreteAssetId, +}; + mod barriers; pub use barriers::{ AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, @@ -50,9 +55,11 @@ mod currency_adapter; pub use currency_adapter::CurrencyAdapter; mod fungibles_adapter; -pub use fungibles_adapter::{ - AsPrefixedGeneralIndex, ConvertedAbstractAssetId, ConvertedConcreteAssetId, FungiblesAdapter, - FungiblesMutateAdapter, FungiblesTransferAdapter, +pub use fungibles_adapter::{FungiblesAdapter, FungiblesMutateAdapter, FungiblesTransferAdapter}; + +mod nonfungibles_adapter; +pub use nonfungibles_adapter::{ + NonFungiblesAdapter, NonFungiblesMutateAdapter, NonFungiblesTransferAdapter, }; mod weight; @@ -60,8 +67,8 @@ pub use weight::{ FixedRateOfFungible, FixedWeightBounds, TakeRevenue, UsingComponents, WeightInfoBounds, }; -mod matches_fungible; -pub use matches_fungible::{IsAbstract, IsConcrete}; +mod matches_token; +pub use matches_token::{IsAbstract, IsConcrete}; mod filter_asset_location; pub use filter_asset_location::{Case, NativeAsset}; diff --git a/xcm/xcm-builder/src/matches_fungible.rs b/xcm/xcm-builder/src/matches_fungible.rs deleted file mode 100644 index d1ba33f6146e..000000000000 --- a/xcm/xcm-builder/src/matches_fungible.rs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2020 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. - -// Polkadot is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Polkadot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Polkadot. If not, see . - -//! Various implementations for the `MatchesFungible` trait. - -use frame_support::traits::Get; -use sp_runtime::traits::CheckedConversion; -use sp_std::{convert::TryFrom, marker::PhantomData}; -use xcm::latest::{ - AssetId::{Abstract, Concrete}, - Fungibility::Fungible, - MultiAsset, MultiLocation, -}; -use xcm_executor::traits::MatchesFungible; - -/// Converts a `MultiAsset` into balance `B` if it is a concrete fungible with an id equal to that -/// given by `T`'s `Get`. -/// -/// # Example -/// -/// ``` -/// use xcm::latest::{MultiLocation, Parent}; -/// use xcm_builder::IsConcrete; -/// use xcm_executor::traits::MatchesFungible; -/// -/// frame_support::parameter_types! { -/// pub TargetLocation: MultiLocation = Parent.into(); -/// } -/// -/// # fn main() { -/// let asset = (Parent, 999).into(); -/// // match `asset` if it is a concrete asset in `TargetLocation`. -/// assert_eq!( as MatchesFungible>::matches_fungible(&asset), Some(999)); -/// # } -/// ``` -pub struct IsConcrete(PhantomData); -impl, B: TryFrom> MatchesFungible for IsConcrete { - fn matches_fungible(a: &MultiAsset) -> Option { - match (&a.id, &a.fun) { - (Concrete(ref id), Fungible(ref amount)) if id == &T::get() => - CheckedConversion::checked_from(*amount), - _ => None, - } - } -} - -/// Same as [`IsConcrete`] but for a fungible with abstract location. -/// -/// # Example -/// -/// ``` -/// use xcm::latest::prelude::*; -/// use xcm_builder::IsAbstract; -/// use xcm_executor::traits::MatchesFungible; -/// -/// frame_support::parameter_types! { -/// pub TargetLocation: [u8; 32] = [7u8; 32]; -/// } -/// -/// # fn main() { -/// let asset = ([7u8; 32], 999).into(); -/// // match `asset` if it is a concrete asset in `TargetLocation`. -/// assert_eq!( as MatchesFungible>::matches_fungible(&asset), Some(999)); -/// # } -/// ``` -pub struct IsAbstract(PhantomData); -impl, B: TryFrom> MatchesFungible for IsAbstract { - fn matches_fungible(a: &MultiAsset) -> Option { - match (&a.id, &a.fun) { - (Abstract(ref id), Fungible(ref amount)) if id == &T::get() => - CheckedConversion::checked_from(*amount), - _ => None, - } - } -} diff --git a/xcm/xcm-executor/src/traits/matches_fungible.rs b/xcm/xcm-executor/src/traits/matches_fungible.rs deleted file mode 100644 index 4989f263a63d..000000000000 --- a/xcm/xcm-executor/src/traits/matches_fungible.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. - -// Polkadot is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Polkadot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Polkadot. If not, see . - -use xcm::latest::MultiAsset; - -pub trait MatchesFungible { - fn matches_fungible(a: &MultiAsset) -> Option; -} - -#[impl_trait_for_tuples::impl_for_tuples(30)] -impl MatchesFungible for Tuple { - fn matches_fungible(a: &MultiAsset) -> Option { - for_tuples!( #( - match Tuple::matches_fungible(a) { o @ Some(_) => return o, _ => () } - )* ); - log::trace!(target: "xcm::matches_fungible", "did not match fungible asset: {:?}", &a); - None - } -} diff --git a/xcm/xcm-executor/src/traits/matches_fungibles.rs b/xcm/xcm-executor/src/traits/matches_fungibles.rs deleted file mode 100644 index f5baafdcd97a..000000000000 --- a/xcm/xcm-executor/src/traits/matches_fungibles.rs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2020 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. - -// Polkadot is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Polkadot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Polkadot. If not, see . - -use sp_std::result; -use xcm::latest::{Error as XcmError, MultiAsset}; - -/// Errors associated with [`MatchesFungibles`] operation. -pub enum Error { - /// Asset not found. - AssetNotFound, - /// `MultiLocation` to `AccountId` conversion failed. - AccountIdConversionFailed, - /// `u128` amount to currency `Balance` conversion failed. - AmountToBalanceConversionFailed, - /// `MultiLocation` to `AssetId` conversion failed. - AssetIdConversionFailed, -} - -impl From for XcmError { - fn from(e: Error) -> Self { - use XcmError::FailedToTransactAsset; - match e { - Error::AssetNotFound => XcmError::AssetNotFound, - Error::AccountIdConversionFailed => FailedToTransactAsset("AccountIdConversionFailed"), - Error::AmountToBalanceConversionFailed => - FailedToTransactAsset("AmountToBalanceConversionFailed"), - Error::AssetIdConversionFailed => FailedToTransactAsset("AssetIdConversionFailed"), - } - } -} - -pub trait MatchesFungibles { - fn matches_fungibles(a: &MultiAsset) -> result::Result<(AssetId, Balance), Error>; -} - -#[impl_trait_for_tuples::impl_for_tuples(30)] -impl MatchesFungibles for Tuple { - fn matches_fungibles(a: &MultiAsset) -> result::Result<(AssetId, Balance), Error> { - for_tuples!( #( - match Tuple::matches_fungibles(a) { o @ Ok(_) => return o, _ => () } - )* ); - log::trace!(target: "xcm::matches_fungibles", "did not match fungibles asset: {:?}", &a); - Err(Error::AssetNotFound) - } -} diff --git a/xcm/xcm-executor/src/traits/mod.rs b/xcm/xcm-executor/src/traits/mod.rs index 293077d52201..c32d0068ee5c 100644 --- a/xcm/xcm-executor/src/traits/mod.rs +++ b/xcm/xcm-executor/src/traits/mod.rs @@ -32,10 +32,8 @@ mod fee_manager; pub use fee_manager::{FeeManager, FeeReason}; mod filter_asset_location; pub use filter_asset_location::FilterAssetLocation; -mod matches_fungible; -pub use matches_fungible::MatchesFungible; -mod matches_fungibles; -pub use matches_fungibles::{Error, MatchesFungibles}; +mod token_matching; +pub use token_matching::{Error, MatchesFungibles, MatchesFungible, MatchesNonFungibles, MatchesNonFungible}; mod on_response; pub use on_response::{OnResponse, VersionChangeNotifier}; mod should_execute; diff --git a/xcm/xcm-executor/src/traits/transact_asset.rs b/xcm/xcm-executor/src/traits/transact_asset.rs index 78e2180ed7a4..bdfd4a49fbd4 100644 --- a/xcm/xcm-executor/src/traits/transact_asset.rs +++ b/xcm/xcm-executor/src/traits/transact_asset.rs @@ -95,7 +95,7 @@ pub trait TransactAsset { to: &MultiLocation, ) -> Result { match Self::transfer_asset(asset, from, to) { - Err(XcmError::Unimplemented) => { + Err(XcmError::AssetNotFound | XcmError::Unimplemented) => { let assets = Self::withdraw_asset(asset, from)?; // Not a very forgiving attitude; once we implement roll-backs then it'll be nicer. Self::deposit_asset(asset, to)?; diff --git a/xcm/xcm-simulator/example/Cargo.toml b/xcm/xcm-simulator/example/Cargo.toml index e4348c838df4..ddd83db38182 100644 --- a/xcm/xcm-simulator/example/Cargo.toml +++ b/xcm/xcm-simulator/example/Cargo.toml @@ -12,6 +12,7 @@ scale-info = { version = "1.0", features = ["derive"] } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-std = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/xcm/xcm-simulator/example/src/lib.rs b/xcm/xcm-simulator/example/src/lib.rs index da359f7c7958..b1b78631fee4 100644 --- a/xcm/xcm-simulator/example/src/lib.rs +++ b/xcm/xcm-simulator/example/src/lib.rs @@ -82,7 +82,7 @@ pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { } pub fn relay_ext() -> sp_io::TestExternalities { - use relay_chain::{Runtime, System}; + use relay_chain::{Runtime, System, Uniques, Origin}; let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); @@ -93,7 +93,11 @@ pub fn relay_ext() -> sp_io::TestExternalities { .unwrap(); let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| System::set_block_number(1)); + ext.execute_with(|| { + System::set_block_number(1); + assert_eq!(Uniques::force_create(Origin::root(), 1, ALICE, true), Ok(())); + assert_eq!(Uniques::mint(Origin::signed(ALICE), 1, 42, para_account_id(1)), Ok(())); + }); ext } @@ -226,6 +230,35 @@ mod tests { }); } + /// Scenario: + /// A parachain transfers an NFT resident on the relay chain to another parachain account. + /// + /// Asserts that the parachain accounts are updated as expected. + #[test] + fn withdraw_and_deposit_nft() { + MockNet::reset(); + + + Relay::execute_with(|| { + assert_eq!(relay_chain::Uniques::owner(1, 42), Some(para_account_id(1))); + }); + + let nft = Wild(AllOfCounted { id: GeneralIndex(1).into(), fun: WildNonFungible, count: 1 }); + + ParaA::execute_with(|| { + let message = Xcm(vec![ + WithdrawAsset((GeneralIndex(1), 42u32).into()), + DepositAsset { assets: nft, beneficiary: Parachain(2).into() }, + ]); + // Send withdraw and deposit + assert_ok!(ParachainPalletXcm::send_xcm(Here, Parent, message.clone())); + }); + + Relay::execute_with(|| { + assert_eq!(relay_chain::Uniques::owner(1, 42), Some(para_account_id(2))); + }); + } + /// Scenario: /// A parachain transfers funds on the relay chain to another parachain account. /// diff --git a/xcm/xcm-simulator/example/src/parachain.rs b/xcm/xcm-simulator/example/src/parachain.rs index f7f8588fe382..552ed740862a 100644 --- a/xcm/xcm-simulator/example/src/parachain.rs +++ b/xcm/xcm-simulator/example/src/parachain.rs @@ -40,9 +40,11 @@ use xcm_builder::{ AccountId32Aliases, AllowUnpaidExecutionFrom, CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, ParentIsPreset, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, + SignedToAccountId32, SovereignSignedViaLocation, NonFungiblesAdapter, ConvertedConcreteAssetId, AsPrefixedGeneralIndex, }; -use xcm_executor::{Config, XcmExecutor}; +use xcm_executor::{Config, XcmExecutor, traits::JustTry}; + +use crate::relay_chain::SovereignAccountOf; pub type AccountId = AccountId32; pub type Balance = u128; @@ -96,6 +98,23 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; } +impl pallet_uniques::Config for Runtime { + type Event = Event; + type ClassId = u32; + type InstanceId = u32; + type Currency = Balances; + type ForceOrigin = frame_system::EnsureRoot; + type ClassDeposit = frame_support::traits::ConstU128<1_000>; + type InstanceDeposit = frame_support::traits::ConstU128<1_000>; + type MetadataDepositBase = frame_support::traits::ConstU128<1_000>; + type AttributeDepositBase = frame_support::traits::ConstU128<1_000>; + type DepositPerByte = frame_support::traits::ConstU128<1>; + type StringLimit = frame_support::traits::ConstU32<64>; + type KeyLimit = frame_support::traits::ConstU32<64>; + type ValueLimit = frame_support::traits::ConstU32<128>; + type WeightInfo = (); +} + parameter_types! { pub const ReservedXcmpWeight: Weight = WEIGHT_PER_SECOND / 4; pub const ReservedDmpWeight: Weight = WEIGHT_PER_SECOND / 4; @@ -126,8 +145,17 @@ parameter_types! { pub const MaxAssetsIntoHolding: u32 = 64; } -pub type LocalAssetTransactor = - XcmCurrencyAdapter, LocationToAccountId, AccountId, ()>; +pub type LocalAssetTransactor = ( + XcmCurrencyAdapter, LocationToAccountId, AccountId, ()>, + NonFungiblesAdapter< + Uniques, + ConvertedConcreteAssetId, JustTry>, + SovereignAccountOf, + AccountId, + Nothing, + (), + >, +); pub type XcmRouter = super::ParachainXcmRouter; pub type Barrier = AllowUnpaidExecutionFrom; @@ -338,5 +366,6 @@ construct_runtime!( Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, MsgQueue: mock_msg_queue::{Pallet, Storage, Event}, PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin}, + Uniques: pallet_uniques::{Pallet, Call, Storage, Event}, } ); diff --git a/xcm/xcm-simulator/example/src/relay_chain.rs b/xcm/xcm-simulator/example/src/relay_chain.rs index 455d588bbb7d..26da830d822e 100644 --- a/xcm/xcm-simulator/example/src/relay_chain.rs +++ b/xcm/xcm-simulator/example/src/relay_chain.rs @@ -32,8 +32,9 @@ use xcm_builder::{ ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, FixedWeightBounds, IsConcrete, LocationInverter, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, + NonFungiblesAdapter, AsPrefixedGeneralIndex, ConvertedConcreteAssetId, }; -use xcm_executor::{Config, XcmExecutor}; +use xcm_executor::{Config, XcmExecutor, traits::JustTry}; pub type AccountId = AccountId32; pub type Balance = u128; @@ -87,6 +88,23 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; } +impl pallet_uniques::Config for Runtime { + type Event = Event; + type ClassId = u32; + type InstanceId = u32; + type Currency = Balances; + type ForceOrigin = frame_system::EnsureRoot; + type ClassDeposit = frame_support::traits::ConstU128<1_000>; + type InstanceDeposit = frame_support::traits::ConstU128<1_000>; + type MetadataDepositBase = frame_support::traits::ConstU128<1_000>; + type AttributeDepositBase = frame_support::traits::ConstU128<1_000>; + type DepositPerByte = frame_support::traits::ConstU128<1>; + type StringLimit = frame_support::traits::ConstU32<64>; + type KeyLimit = frame_support::traits::ConstU32<64>; + type ValueLimit = frame_support::traits::ConstU32<128>; + type WeightInfo = (); +} + impl shared::Config for Runtime {} impl configuration::Config for Runtime { @@ -104,8 +122,17 @@ parameter_types! { pub type SovereignAccountOf = (ChildParachainConvertsVia, AccountId32Aliases); -pub type LocalAssetTransactor = - XcmCurrencyAdapter, SovereignAccountOf, AccountId, ()>; +pub type LocalAssetTransactor = ( + XcmCurrencyAdapter, SovereignAccountOf, AccountId, ()>, + NonFungiblesAdapter< + Uniques, + ConvertedConcreteAssetId, JustTry>, + SovereignAccountOf, + AccountId, + Nothing, + (), + >, +); type LocalOriginConverter = ( SovereignSignedViaLocation, @@ -116,7 +143,7 @@ type LocalOriginConverter = ( parameter_types! { pub const BaseXcmWeight: Weight = 1_000; - pub KsmPerSecond: (AssetId, u128) = (Concrete(TokenLocation::get()), 1); + pub TokensPerSecond: (AssetId, u128) = (Concrete(TokenLocation::get()), 1_000_000_000_000); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; } @@ -135,7 +162,7 @@ impl Config for XcmConfig { type LocationInverter = LocationInverter; type Barrier = Barrier; type Weigher = FixedWeightBounds; - type Trader = FixedRateOfFungible; + type Trader = FixedRateOfFungible; type ResponseHandler = (); type AssetTrap = (); type AssetLocker = (); @@ -201,5 +228,6 @@ construct_runtime!( ParasOrigin: origin::{Pallet, Origin}, ParasUmp: ump::{Pallet, Call, Storage, Event}, XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, + Uniques: pallet_uniques::{Pallet, Call, Storage, Event}, } ); From b108c4cc0ed108371a158b22676cdfbbd91081c7 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 21 Feb 2022 10:27:26 +0100 Subject: [PATCH 02/17] New files. --- xcm/xcm-builder/src/asset_conversion.rs | 146 +++++++++++ xcm/xcm-builder/src/matches_token.rs | 111 ++++++++ xcm/xcm-builder/src/nonfungibles_adapter.rs | 248 ++++++++++++++++++ xcm/xcm-executor/src/traits/token_matching.rs | 106 ++++++++ 4 files changed, 611 insertions(+) create mode 100644 xcm/xcm-builder/src/asset_conversion.rs create mode 100644 xcm/xcm-builder/src/matches_token.rs create mode 100644 xcm/xcm-builder/src/nonfungibles_adapter.rs create mode 100644 xcm/xcm-executor/src/traits/token_matching.rs diff --git a/xcm/xcm-builder/src/asset_conversion.rs b/xcm/xcm-builder/src/asset_conversion.rs new file mode 100644 index 000000000000..3fb878f493e2 --- /dev/null +++ b/xcm/xcm-builder/src/asset_conversion.rs @@ -0,0 +1,146 @@ +// Copyright 2020 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Adapters to work with `frame_support::traits::tokens::fungibles` through XCM. + +use frame_support::traits::Get; +use sp_std::{borrow::Borrow, marker::PhantomData, prelude::*, result}; +use xcm::latest::prelude::*; +use xcm_executor::traits::{ + Convert, Error as MatchError, MatchesFungibles, MatchesNonFungibles, +}; + +/// Converter struct implementing `AssetIdConversion` converting a numeric asset ID (must be `TryFrom/TryInto`) into +/// a `GeneralIndex` junction, prefixed by some `MultiLocation` value. The `MultiLocation` value will typically be a +/// `PalletInstance` junction. +pub struct AsPrefixedGeneralIndex( + PhantomData<(Prefix, AssetId, ConvertAssetId)>, +); +impl, AssetId: Clone, ConvertAssetId: Convert> + Convert for AsPrefixedGeneralIndex +{ + fn convert_ref(id: impl Borrow) -> result::Result { + let prefix = Prefix::get(); + let id = id.borrow(); + if prefix.parent_count() != id.parent_count() || + prefix + .interior() + .iter() + .enumerate() + .any(|(index, junction)| id.interior().at(index) != Some(junction)) + { + return Err(()) + } + match id.interior().at(prefix.interior().len()) { + Some(Junction::GeneralIndex(id)) => ConvertAssetId::convert_ref(id), + _ => Err(()), + } + } + fn reverse_ref(what: impl Borrow) -> result::Result { + let mut location = Prefix::get(); + let id = ConvertAssetId::reverse_ref(what)?; + location.push_interior(Junction::GeneralIndex(id)).map_err(|_| ())?; + Ok(location) + } +} + +pub struct ConvertedConcreteAssetId( + PhantomData<(AssetId, Balance, ConvertAssetId, ConvertOther)>, +); +impl< + AssetId: Clone, + Balance: Clone, + ConvertAssetId: Convert, + ConvertBalance: Convert, + > MatchesFungibles + for ConvertedConcreteAssetId +{ + fn matches_fungibles(a: &MultiAsset) -> result::Result<(AssetId, Balance), MatchError> { + let (amount, id) = match (&a.fun, &a.id) { + (Fungible(ref amount), Concrete(ref id)) => (amount, id), + _ => return Err(MatchError::AssetNotFound), + }; + let what = + ConvertAssetId::convert_ref(id).map_err(|_| MatchError::AssetIdConversionFailed)?; + let amount = ConvertBalance::convert_ref(amount) + .map_err(|_| MatchError::AmountToBalanceConversionFailed)?; + Ok((what, amount)) + } +} +impl< + ClassId: Clone, + InstanceId: Clone, + ConvertClassId: Convert, + ConvertInstanceId: Convert, + > MatchesNonFungibles + for ConvertedConcreteAssetId +{ + fn matches_nonfungibles(a: &MultiAsset) -> result::Result<(ClassId, InstanceId), MatchError> { + let (instance, class) = match (&a.fun, &a.id) { + (NonFungible(ref instance), Concrete(ref class)) => (instance, class), + _ => return Err(MatchError::AssetNotFound), + }; + let what = + ConvertClassId::convert_ref(class).map_err(|_| MatchError::AssetIdConversionFailed)?; + let instance = ConvertInstanceId::convert_ref(instance) + .map_err(|_| MatchError::InstanceConversionFailed)?; + Ok((what, instance)) + } +} + +pub struct ConvertedAbstractAssetId( + PhantomData<(AssetId, Balance, ConvertAssetId, ConvertOther)>, +); +impl< + AssetId: Clone, + Balance: Clone, + ConvertAssetId: Convert<[u8; 32], AssetId>, + ConvertBalance: Convert, + > MatchesFungibles + for ConvertedAbstractAssetId +{ + fn matches_fungibles(a: &MultiAsset) -> result::Result<(AssetId, Balance), MatchError> { + let (amount, id) = match (&a.fun, &a.id) { + (Fungible(ref amount), Abstract(ref id)) => (amount, id), + _ => return Err(MatchError::AssetNotFound), + }; + let what = + ConvertAssetId::convert_ref(id).map_err(|_| MatchError::AssetIdConversionFailed)?; + let amount = ConvertBalance::convert_ref(amount) + .map_err(|_| MatchError::AmountToBalanceConversionFailed)?; + Ok((what, amount)) + } +} +impl< + ClassId: Clone, + InstanceId: Clone, + ConvertClassId: Convert<[u8; 32], ClassId>, + ConvertInstanceId: Convert, + > MatchesNonFungibles + for ConvertedAbstractAssetId +{ + fn matches_nonfungibles(a: &MultiAsset) -> result::Result<(ClassId, InstanceId), MatchError> { + let (instance, class) = match (&a.fun, &a.id) { + (NonFungible(ref instance), Abstract(ref class)) => (instance, class), + _ => return Err(MatchError::AssetNotFound), + }; + let what = + ConvertClassId::convert_ref(class).map_err(|_| MatchError::AssetIdConversionFailed)?; + let instance = ConvertInstanceId::convert_ref(instance) + .map_err(|_| MatchError::InstanceConversionFailed)?; + Ok((what, instance)) + } +} diff --git a/xcm/xcm-builder/src/matches_token.rs b/xcm/xcm-builder/src/matches_token.rs new file mode 100644 index 000000000000..a92db842b088 --- /dev/null +++ b/xcm/xcm-builder/src/matches_token.rs @@ -0,0 +1,111 @@ +// Copyright 2020 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Various implementations for the `MatchesFungible` trait. + +use frame_support::traits::Get; +use sp_std::{convert::{TryFrom, TryInto}, marker::PhantomData}; +use xcm::latest::{ + AssetId::{Abstract, Concrete}, + Fungibility::Fungible, + Fungibility::NonFungible, + AssetInstance, MultiAsset, MultiLocation, +}; +use xcm_executor::traits::{MatchesFungible, MatchesNonFungible}; + +/// Converts a `MultiAsset` into balance `B` if it is a concrete fungible with an id equal to that +/// given by `T`'s `Get`. +/// +/// # Example +/// +/// ``` +/// use xcm::latest::{MultiLocation, Parent}; +/// use xcm_builder::IsConcrete; +/// use xcm_executor::traits::MatchesFungible; +/// +/// frame_support::parameter_types! { +/// pub TargetLocation: MultiLocation = Parent.into(); +/// } +/// +/// # fn main() { +/// let asset = (Parent, 999).into(); +/// // match `asset` if it is a concrete asset in `TargetLocation`. +/// assert_eq!( as MatchesFungible>::matches_fungible(&asset), Some(999)); +/// # } +/// ``` +pub struct IsConcrete(PhantomData); +impl, B: TryFrom> MatchesFungible for IsConcrete { + fn matches_fungible(a: &MultiAsset) -> Option { + match (&a.id, &a.fun) { + (Concrete(ref id), Fungible(ref amount)) if id == &T::get() => + (*amount).try_into().ok(), + _ => None, + } + } +} +impl, I: TryFrom> MatchesNonFungible for IsConcrete { + fn matches_nonfungible(a: &MultiAsset) -> Option { + match (&a.id, &a.fun) { + (Concrete(ref id), NonFungible(ref instance)) if id == &T::get() => + instance.clone().try_into().ok(), + _ => None, + } + } +} + +/// Same as [`IsConcrete`] but for a fungible with abstract location. +/// +/// # Example +/// +/// ``` +/// use xcm::latest::prelude::*; +/// use xcm_builder::IsAbstract; +/// use xcm_executor::traits::MatchesFungible; +/// +/// frame_support::parameter_types! { +/// pub TargetLocation: [u8; 32] = [7u8; 32]; +/// } +/// +/// # fn main() { +/// let asset = ([7u8; 32], 999).into(); +/// // match `asset` if it is an abstract asset in `TargetLocation`. +/// assert_eq!( as MatchesFungible>::matches_fungible(&asset), Some(999)); +/// let nft = ([7u8; 32], [42u8; 4]).into(); +/// assert_eq!( +/// as MatchesFungible<[u8; 4]>>::matches_fungible(&asset), +/// Some([42u8; 4]) +/// ); +/// # } +/// ``` +pub struct IsAbstract(PhantomData); +impl, B: TryFrom> MatchesFungible for IsAbstract { + fn matches_fungible(a: &MultiAsset) -> Option { + match (&a.id, &a.fun) { + (Abstract(ref id), Fungible(ref amount)) if id == &T::get() => + (*amount).try_into().ok(), + _ => None, + } + } +} +impl, B: TryFrom> MatchesNonFungible for IsAbstract { + fn matches_nonfungible(a: &MultiAsset) -> Option { + match (&a.id, &a.fun) { + (Abstract(ref id), NonFungible(ref instance)) if id == &T::get() => + instance.clone().try_into().ok(), + _ => None, + } + } +} diff --git a/xcm/xcm-builder/src/nonfungibles_adapter.rs b/xcm/xcm-builder/src/nonfungibles_adapter.rs new file mode 100644 index 000000000000..712bd6ab75ea --- /dev/null +++ b/xcm/xcm-builder/src/nonfungibles_adapter.rs @@ -0,0 +1,248 @@ +// Copyright 2020 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Adapters to work with `frame_support::traits::tokens::fungibles` through XCM. + +use frame_support::traits::{tokens::nonfungibles, Contains, Get}; +use sp_std::{marker::PhantomData, prelude::*, result}; +use xcm::latest::prelude::*; +use xcm_executor::traits::{Convert, Error as MatchError, MatchesNonFungibles, TransactAsset}; +use frame_support::ensure; + +pub struct NonFungiblesTransferAdapter( + PhantomData<(Assets, Matcher, AccountIdConverter, AccountId)>, +); +impl< + Assets: nonfungibles::Transfer, + Matcher: MatchesNonFungibles, + AccountIdConverter: Convert, + AccountId: Clone, // can't get away without it since Currency is generic over it. + > TransactAsset for NonFungiblesTransferAdapter +{ + fn transfer_asset( + what: &MultiAsset, + from: &MultiLocation, + to: &MultiLocation, + ) -> result::Result { + log::trace!( + target: "xcm::non_fungibles_adapter", + "transfer_asset what: {:?}, from: {:?}, to: {:?}", + what, from, to + ); + // Check we handle this asset. + let (class, instance) = Matcher::matches_nonfungibles(what)?; + let destination = AccountIdConverter::convert_ref(to) + .map_err(|()| MatchError::AccountIdConversionFailed)?; + Assets::transfer(&class, &instance, &destination) + .map_err(|e| XcmError::FailedToTransactAsset(e.into()))?; + Ok(what.clone().into()) + } +} + +pub struct NonFungiblesMutateAdapter< + Assets, + Matcher, + AccountIdConverter, + AccountId, + CheckAsset, + CheckingAccount, +>(PhantomData<(Assets, Matcher, AccountIdConverter, AccountId, CheckAsset, CheckingAccount)>); +impl< + Assets: nonfungibles::Mutate, + Matcher: MatchesNonFungibles, + AccountIdConverter: Convert, + AccountId: Clone + Eq, // can't get away without it since Currency is generic over it. + CheckAsset: Contains, + CheckingAccount: Get>, + > TransactAsset + for NonFungiblesMutateAdapter< + Assets, + Matcher, + AccountIdConverter, + AccountId, + CheckAsset, + CheckingAccount, + > +{ + fn can_check_in(_origin: &MultiLocation, what: &MultiAsset) -> XcmResult { + log::trace!( + target: "xcm::fungibles_adapter", + "can_check_in origin: {:?}, what: {:?}", + _origin, what + ); + // Check we handle this asset. + let (class, instance) = Matcher::matches_nonfungibles(what)?; + if CheckAsset::contains(&class) { + if let Some(checking_account) = CheckingAccount::get() { + // This is an asset whose teleports we track. + let owner = Assets::owner(&class, &instance); + ensure!(owner == Some(checking_account), XcmError::NotWithdrawable); + ensure!(Assets::can_transfer(&class, &instance), XcmError::NotWithdrawable); + } + } + Ok(()) + } + + fn check_in(_origin: &MultiLocation, what: &MultiAsset) { + log::trace!( + target: "xcm::fungibles_adapter", + "check_in origin: {:?}, what: {:?}", + _origin, what + ); + if let Ok((class, instance)) = Matcher::matches_nonfungibles(what) { + if CheckAsset::contains(&class) { + let ok = Assets::burn_from(&class, &instance).is_ok(); + debug_assert!( + ok, + "`can_check_in` must have returned `true` immediately prior; qed" + ); + } + } + } + + fn check_out(_dest: &MultiLocation, what: &MultiAsset) { + log::trace!( + target: "xcm::fungibles_adapter", + "check_out dest: {:?}, what: {:?}", + _dest, what + ); + if let Ok((class, instance)) = Matcher::matches_nonfungibles(what) { + if CheckAsset::contains(&class) { + if let Some(checking_account) = CheckingAccount::get() { + let ok = Assets::mint_into(&class, &instance, &checking_account).is_ok(); + debug_assert!(ok, "`mint_into` cannot generally fail; qed"); + } + } + } + } + + fn deposit_asset(what: &MultiAsset, who: &MultiLocation) -> XcmResult { + log::trace!( + target: "xcm::fungibles_adapter", + "deposit_asset what: {:?}, who: {:?}", + what, who, + ); + // Check we handle this asset. + let (class, instance) = Matcher::matches_nonfungibles(what)?; + let who = AccountIdConverter::convert_ref(who) + .map_err(|()| MatchError::AccountIdConversionFailed)?; + Assets::mint_into(&class, &instance, &who) + .map_err(|e| XcmError::FailedToTransactAsset(e.into())) + } + + fn withdraw_asset( + what: &MultiAsset, + who: &MultiLocation, + ) -> result::Result { + log::trace!( + target: "xcm::fungibles_adapter", + "withdraw_asset what: {:?}, who: {:?}", + what, who, + ); + // Check we handle this asset. + let (class, instance) = Matcher::matches_nonfungibles(what)?; + Assets::burn_from(&class, &instance) + .map_err(|e| XcmError::FailedToTransactAsset(e.into()))?; + Ok(what.clone().into()) + } +} + +pub struct NonFungiblesAdapter< + Assets, + Matcher, + AccountIdConverter, + AccountId, + CheckAsset, + CheckingAccount, +>(PhantomData<(Assets, Matcher, AccountIdConverter, AccountId, CheckAsset, CheckingAccount)>); +impl< + Assets: nonfungibles::Mutate + nonfungibles::Transfer, + Matcher: MatchesNonFungibles, + AccountIdConverter: Convert, + AccountId: Clone + Eq, // can't get away without it since Currency is generic over it. + CheckAsset: Contains, + CheckingAccount: Get>, + > TransactAsset + for NonFungiblesAdapter +{ + fn can_check_in(origin: &MultiLocation, what: &MultiAsset) -> XcmResult { + NonFungiblesMutateAdapter::< + Assets, + Matcher, + AccountIdConverter, + AccountId, + CheckAsset, + CheckingAccount, + >::can_check_in(origin, what) + } + + fn check_in(origin: &MultiLocation, what: &MultiAsset) { + NonFungiblesMutateAdapter::< + Assets, + Matcher, + AccountIdConverter, + AccountId, + CheckAsset, + CheckingAccount, + >::check_in(origin, what) + } + + fn check_out(dest: &MultiLocation, what: &MultiAsset) { + NonFungiblesMutateAdapter::< + Assets, + Matcher, + AccountIdConverter, + AccountId, + CheckAsset, + CheckingAccount, + >::check_out(dest, what) + } + + fn deposit_asset(what: &MultiAsset, who: &MultiLocation) -> XcmResult { + NonFungiblesMutateAdapter::< + Assets, + Matcher, + AccountIdConverter, + AccountId, + CheckAsset, + CheckingAccount, + >::deposit_asset(what, who) + } + + fn withdraw_asset( + what: &MultiAsset, + who: &MultiLocation, + ) -> result::Result { + NonFungiblesMutateAdapter::< + Assets, + Matcher, + AccountIdConverter, + AccountId, + CheckAsset, + CheckingAccount, + >::withdraw_asset(what, who) + } + + fn transfer_asset( + what: &MultiAsset, + from: &MultiLocation, + to: &MultiLocation, + ) -> result::Result { + NonFungiblesTransferAdapter::::transfer_asset( + what, from, to, + ) + } +} diff --git a/xcm/xcm-executor/src/traits/token_matching.rs b/xcm/xcm-executor/src/traits/token_matching.rs new file mode 100644 index 000000000000..befff6b1b726 --- /dev/null +++ b/xcm/xcm-executor/src/traits/token_matching.rs @@ -0,0 +1,106 @@ +// Copyright 2020 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use sp_std::result; +use xcm::latest::prelude::*; + +pub trait MatchesFungible { + fn matches_fungible(a: &MultiAsset) -> Option; +} + +#[impl_trait_for_tuples::impl_for_tuples(30)] +impl MatchesFungible for Tuple { + fn matches_fungible(a: &MultiAsset) -> Option { + for_tuples!( #( + match Tuple::matches_fungible(a) { o @ Some(_) => return o, _ => () } + )* ); + log::trace!(target: "xcm::matches_fungible", "did not match fungible asset: {:?}", &a); + None + } +} + +pub trait MatchesNonFungible { + fn matches_nonfungible(a: &MultiAsset) -> Option; +} + +#[impl_trait_for_tuples::impl_for_tuples(30)] +impl MatchesNonFungible for Tuple { + fn matches_nonfungible(a: &MultiAsset) -> Option { + for_tuples!( #( + match Tuple::matches_nonfungible(a) { o @ Some(_) => return o, _ => () } + )* ); + log::trace!(target: "xcm::matches_non_fungible", "did not match non-fungible asset: {:?}", &a); + None + } +} + +/// Errors associated with [`MatchesFungibles`] operation. +pub enum Error { + /// Asset not found. + AssetNotFound, + /// `MultiLocation` to `AccountId` conversion failed. + AccountIdConversionFailed, + /// `u128` amount to currency `Balance` conversion failed. + AmountToBalanceConversionFailed, + /// `MultiLocation` to `AssetId`/`ClassId` conversion failed. + AssetIdConversionFailed, + /// `AssetInstance` to non-fungibles instance ID conversion failed. + InstanceConversionFailed, +} + +impl From for XcmError { + fn from(e: Error) -> Self { + use XcmError::FailedToTransactAsset; + match e { + Error::AssetNotFound => XcmError::AssetNotFound, + Error::AccountIdConversionFailed => FailedToTransactAsset("AccountIdConversionFailed"), + Error::AmountToBalanceConversionFailed => + FailedToTransactAsset("AmountToBalanceConversionFailed"), + Error::AssetIdConversionFailed => FailedToTransactAsset("AssetIdConversionFailed"), + Error::InstanceConversionFailed => FailedToTransactAsset("InstanceConversionFailed"), + } + } +} + +pub trait MatchesFungibles { + fn matches_fungibles(a: &MultiAsset) -> result::Result<(AssetId, Balance), Error>; +} + +#[impl_trait_for_tuples::impl_for_tuples(30)] +impl MatchesFungibles for Tuple { + fn matches_fungibles(a: &MultiAsset) -> result::Result<(AssetId, Balance), Error> { + for_tuples!( #( + match Tuple::matches_fungibles(a) { o @ Ok(_) => return o, _ => () } + )* ); + log::trace!(target: "xcm::matches_fungibles", "did not match fungibles asset: {:?}", &a); + Err(Error::AssetNotFound) + } +} + +pub trait MatchesNonFungibles { + fn matches_nonfungibles(a: &MultiAsset) -> result::Result<(AssetId, Instance), Error>; +} + +#[impl_trait_for_tuples::impl_for_tuples(30)] +impl MatchesNonFungibles for Tuple { + fn matches_nonfungibles(a: &MultiAsset) -> result::Result<(AssetId, Instance), Error> { + for_tuples!( #( + match Tuple::matches_nonfungibles(a) { o @ Ok(_) => return o, _ => () } + )* ); + log::trace!(target: "xcm::matches_non_fungibles", "did not match fungibles asset: {:?}", &a); + Err(Error::AssetNotFound) + } +} From cecd812fad7deebd1830ec8a83ed0e3f30e0ad42 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 23 Feb 2022 14:03:03 +0000 Subject: [PATCH 03/17] Integration tests for sending NFTs --- Cargo.lock | 397 +++++++++++------- xcm/pallet-xcm-benchmarks/src/mock.rs | 2 +- xcm/pallet-xcm/src/lib.rs | 46 +- xcm/src/lib.rs | 2 +- xcm/src/v2/mod.rs | 16 +- xcm/src/v3/junction.rs | 6 +- xcm/src/v3/junctions.rs | 6 +- xcm/src/v3/mod.rs | 12 +- xcm/src/v3/multiasset.rs | 6 +- xcm/src/v3/multilocation.rs | 6 +- xcm/xcm-builder/src/asset_conversion.rs | 17 +- xcm/xcm-builder/src/filter_asset_location.rs | 15 +- xcm/xcm-builder/src/lib.rs | 5 +- xcm/xcm-builder/src/nonfungibles_adapter.rs | 6 +- xcm/xcm-builder/src/test_utils.rs | 2 +- xcm/xcm-builder/src/tests/basic.rs | 6 +- xcm/xcm-builder/src/tests/mock.rs | 4 +- xcm/xcm-builder/src/tests/weight.rs | 4 +- xcm/xcm-executor/src/config.rs | 14 +- xcm/xcm-executor/src/lib.rs | 18 +- .../src/traits/filter_asset_location.rs | 23 +- xcm/xcm-executor/src/traits/mod.rs | 1 + xcm/xcm-executor/src/traits/transact_asset.rs | 8 +- xcm/xcm-simulator/example/Cargo.toml | 11 + xcm/xcm-simulator/example/src/lib.rs | 256 ++++++++++- xcm/xcm-simulator/example/src/parachain.rs | 71 +++- xcm/xcm-simulator/example/src/relay_chain.rs | 24 +- 27 files changed, 656 insertions(+), 328 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a77a87cf97f9..c932533bf94f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -439,7 +439,6 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "beefy-primitives", "fnv", @@ -468,7 +467,6 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -491,12 +489,10 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -1889,7 +1885,6 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", ] @@ -1907,7 +1902,6 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -1929,7 +1923,6 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "Inflector", "chrono", @@ -1956,7 +1949,6 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -1970,7 +1962,6 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -1998,7 +1989,6 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "bitflags", "frame-metadata", @@ -2027,7 +2017,6 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2039,7 +2028,6 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.1.2", @@ -2051,7 +2039,6 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro2", "quote", @@ -2061,7 +2048,6 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2084,7 +2070,6 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -2095,7 +2080,6 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "log", @@ -2112,7 +2096,6 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -2127,7 +2110,6 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "sp-api", @@ -2136,7 +2118,6 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "sp-api", @@ -2332,7 +2313,6 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "chrono", "frame-election-provider-support", @@ -4752,7 +4732,6 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4766,7 +4745,6 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -4782,7 +4760,6 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -4797,7 +4774,6 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4821,7 +4797,6 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4841,7 +4816,6 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4861,7 +4835,6 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4876,7 +4849,6 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "beefy-primitives", "frame-support", @@ -4892,7 +4864,6 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -4917,7 +4888,6 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5001,7 +4971,6 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5018,7 +4987,6 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5034,7 +5002,6 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5057,7 +5024,6 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5075,7 +5041,6 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5090,7 +5055,6 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5113,7 +5077,6 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5129,7 +5092,6 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5149,7 +5111,6 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5166,7 +5127,6 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5183,7 +5143,6 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5201,7 +5160,6 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5217,7 +5175,6 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5234,7 +5191,6 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5249,7 +5205,6 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5263,7 +5218,6 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5280,7 +5234,6 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5303,7 +5256,6 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5319,7 +5271,6 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5334,7 +5285,6 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5348,7 +5298,6 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5364,7 +5313,6 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5385,7 +5333,6 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5401,7 +5348,6 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5415,7 +5361,6 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5438,7 +5383,6 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro-crate 1.1.2", "proc-macro2", @@ -5449,7 +5393,6 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "sp-arithmetic", @@ -5458,7 +5401,6 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5472,7 +5414,6 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5490,7 +5431,6 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5509,7 +5449,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-support", "frame-system", @@ -5526,7 +5465,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5543,7 +5481,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5554,7 +5491,6 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5571,7 +5507,6 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5586,7 +5521,6 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5602,7 +5536,6 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8006,7 +7939,6 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "env_logger 0.9.0", "jsonrpsee 0.8.0", @@ -8353,7 +8285,6 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "sp-core", @@ -8364,7 +8295,6 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -8391,7 +8321,6 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "futures-timer", @@ -8414,7 +8343,6 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8430,7 +8358,6 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8447,7 +8374,6 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro-crate 1.1.2", "proc-macro2", @@ -8458,7 +8384,6 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "chrono", "clap", @@ -8496,7 +8421,6 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "fnv", "futures 0.3.21", @@ -8524,7 +8448,6 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "hash-db", "kvdb", @@ -8549,7 +8472,6 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -8573,7 +8495,6 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "fork-tree", @@ -8616,7 +8537,6 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -8640,7 +8560,6 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8653,7 +8572,6 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -8678,7 +8596,6 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "sc-client-api", "sp-authorship", @@ -8689,7 +8606,6 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "lazy_static", "libsecp256k1", @@ -8717,7 +8633,6 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "environmental", "parity-scale-codec", @@ -8734,7 +8649,6 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "parity-scale-codec", @@ -8750,7 +8664,6 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8768,7 +8681,6 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ahash", "async-trait", @@ -8807,7 +8719,6 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "finality-grandpa", "futures 0.3.21", @@ -8831,7 +8742,6 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ansi_term", "futures 0.3.21", @@ -8848,7 +8758,6 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "hex", @@ -8863,7 +8772,6 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-std", "async-trait", @@ -8913,7 +8821,6 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ahash", "futures 0.3.21", @@ -8930,7 +8837,6 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "bytes 1.1.0", "fnv", @@ -8958,7 +8864,6 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "libp2p", @@ -8971,7 +8876,6 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8980,7 +8884,6 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "hash-db", @@ -9011,7 +8914,6 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9036,7 +8938,6 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9053,7 +8954,6 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "directories", @@ -9117,7 +9017,6 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "parity-scale-codec", @@ -9131,7 +9030,6 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -9152,7 +9050,6 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "chrono", "futures 0.3.21", @@ -9170,7 +9067,6 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ansi_term", "atty", @@ -9201,7 +9097,6 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro-crate 1.1.2", "proc-macro2", @@ -9212,7 +9107,6 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9239,7 +9133,6 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "log", @@ -9252,7 +9145,6 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9701,7 +9593,6 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "hash-db", "log", @@ -9718,7 +9609,6 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "blake2 0.10.2", "proc-macro-crate 1.1.2", @@ -9730,7 +9620,6 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -9743,7 +9632,6 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "integer-sqrt", "num-traits", @@ -9758,7 +9646,6 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -9771,7 +9658,6 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "parity-scale-codec", @@ -9783,7 +9669,6 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "sp-api", @@ -9795,7 +9680,6 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "log", @@ -9813,7 +9697,6 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -9832,7 +9715,6 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "merlin", @@ -9855,7 +9737,6 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -9867,7 +9748,6 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9879,7 +9759,6 @@ dependencies = [ [[package]] name = "sp-core" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "base58", "bitflags", @@ -9924,7 +9803,6 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "blake2 0.10.2", "byteorder", @@ -9938,7 +9816,6 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro2", "quote", @@ -9949,7 +9826,6 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "kvdb", "parking_lot 0.11.2", @@ -9958,7 +9834,6 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro2", "quote", @@ -9968,7 +9843,6 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "environmental", "parity-scale-codec", @@ -9979,7 +9853,6 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "finality-grandpa", "log", @@ -9997,7 +9870,6 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10011,7 +9883,6 @@ dependencies = [ [[package]] name = "sp-io" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "hash-db", @@ -10035,7 +9906,6 @@ dependencies = [ [[package]] name = "sp-keyring" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "lazy_static", "sp-core", @@ -10046,7 +9916,6 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -10063,7 +9932,6 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "thiserror", "zstd", @@ -10072,7 +9940,6 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -10087,7 +9954,6 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro-crate 1.1.2", "proc-macro2", @@ -10098,7 +9964,6 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "sp-api", "sp-core", @@ -10108,7 +9973,6 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "backtrace", "lazy_static", @@ -10118,7 +9982,6 @@ dependencies = [ [[package]] name = "sp-rpc" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "rustc-hash", "serde", @@ -10128,7 +9991,6 @@ dependencies = [ [[package]] name = "sp-runtime" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "either", "hash256-std-hasher", @@ -10150,7 +10012,6 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10167,7 +10028,6 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "Inflector", "proc-macro-crate 1.1.2", @@ -10179,7 +10039,6 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "serde", "serde_json", @@ -10188,7 +10047,6 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -10202,7 +10060,6 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "scale-info", @@ -10213,7 +10070,6 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "hash-db", "log", @@ -10236,12 +10092,10 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" [[package]] name = "sp-storage" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10254,7 +10108,6 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "log", "sp-core", @@ -10267,7 +10120,6 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures-timer", @@ -10283,7 +10135,6 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "sp-std", @@ -10295,7 +10146,6 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "sp-api", "sp-runtime", @@ -10304,7 +10154,6 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "log", @@ -10320,7 +10169,6 @@ dependencies = [ [[package]] name = "sp-trie" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "hash-db", "memory-db", @@ -10335,7 +10183,6 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10352,7 +10199,6 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10363,7 +10209,6 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "impl-trait-for-tuples", "log", @@ -10531,7 +10376,6 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "platforms", ] @@ -10539,7 +10383,6 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.21", @@ -10561,7 +10404,6 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-std", "futures-util", @@ -10575,7 +10417,6 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "async-trait", "futures 0.3.21", @@ -10601,7 +10442,6 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "futures 0.3.21", "substrate-test-utils-derive", @@ -10611,7 +10451,6 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "proc-macro-crate 1.1.2", "proc-macro2", @@ -10622,7 +10461,6 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "ansi_term", "build-helper", @@ -11217,7 +11055,6 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e01c36244a91aea715bd45c05e3361fe24fd071d" dependencies = [ "clap", "jsonrpsee 0.4.1", @@ -12204,6 +12041,7 @@ version = "0.9.17" dependencies = [ "frame-support", "frame-system", + "log", "pallet-balances", "pallet-uniques", "pallet-xcm", @@ -12216,6 +12054,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "sp-tracing", "xcm", "xcm-builder", "xcm-executor", @@ -12326,3 +12165,235 @@ dependencies = [ "cc", "libc", ] + +[[patch.unused]] +name = "chain-spec-builder" +version = "2.0.0" + +[[patch.unused]] +name = "frame-support-test-compile-pass" +version = "4.0.0-dev" + +[[patch.unused]] +name = "node-bench" +version = "0.9.0-dev" + +[[patch.unused]] +name = "node-cli" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-executor" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-inspect" +version = "0.9.0-dev" + +[[patch.unused]] +name = "node-primitives" +version = "2.0.0" + +[[patch.unused]] +name = "node-rpc" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-runtime" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-runtime-generate-bags" +version = "3.0.0" + +[[patch.unused]] +name = "node-template" +version = "4.0.0-dev" + +[[patch.unused]] +name = "node-template-runtime" +version = "4.0.0-dev" + +[[patch.unused]] +name = "node-testing" +version = "3.0.0-dev" + +[[patch.unused]] +name = "pallet-asset-tx-payment" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-atomic-swap" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-aura" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-bags-list-fuzzer" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-child-bounties" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-contracts" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-contracts-primitives" +version = "5.0.0" + +[[patch.unused]] +name = "pallet-contracts-proc-macro" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-contracts-rpc" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-contracts-rpc-runtime-api" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-conviction-voting" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-example-basic" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-example-offchain-worker" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-example-parallel" +version = "3.0.0-dev" + +[[patch.unused]] +name = "pallet-lottery" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-node-authorization" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-randomness-collective-flip" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-referenda" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-scored-pool" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-template" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-transaction-storage" +version = "4.0.0-dev" + +[[patch.unused]] +name = "sc-consensus-aura" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sc-consensus-manual-seal" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sc-consensus-pow" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sc-network-test" +version = "0.8.0" + +[[patch.unused]] +name = "sc-runtime-test" +version = "2.0.0" + +[[patch.unused]] +name = "sc-service-test" +version = "2.0.0" + +[[patch.unused]] +name = "sp-api-test" +version = "2.0.1" + +[[patch.unused]] +name = "sp-application-crypto-test" +version = "2.0.0" + +[[patch.unused]] +name = "sp-arithmetic-fuzzer" +version = "2.0.0" + +[[patch.unused]] +name = "sp-consensus-aura" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sp-consensus-pow" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sp-npos-elections-fuzzer" +version = "2.0.0-alpha.5" + +[[patch.unused]] +name = "sp-runtime-interface-test" +version = "2.0.0" + +[[patch.unused]] +name = "sp-runtime-interface-test-wasm" +version = "2.0.0" + +[[patch.unused]] +name = "sp-runtime-interface-test-wasm-deprecated" +version = "2.0.0" + +[[patch.unused]] +name = "sp-sandbox" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sp-test-primitives" +version = "2.0.0" + +[[patch.unused]] +name = "subkey" +version = "2.0.1" + +[[patch.unused]] +name = "substrate-frame-cli" +version = "4.0.0-dev" + +[[patch.unused]] +name = "substrate-frame-rpc-support" +version = "3.0.0" + +[[patch.unused]] +name = "substrate-test-runtime" +version = "2.0.0" + +[[patch.unused]] +name = "substrate-test-runtime-client" +version = "2.0.0" + +[[patch.unused]] +name = "substrate-test-runtime-transaction-pool" +version = "2.0.0" + +[[patch.unused]] +name = "substrate-test-utils-test-crate" +version = "0.1.0" diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 85bbea99d775..e295cdbd3026 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -68,7 +68,7 @@ parameter_types! { pub struct AllAssetLocationsPass; impl FilterAssetLocation for AllAssetLocationsPass { - fn filter_asset_location(_: &MultiAsset, _: &MultiLocation) -> bool { + fn contains(_: &MultiAsset, _: &MultiLocation) -> bool { true } } diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index e7f8c82630a7..0fc8cc344fc5 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -25,7 +25,7 @@ mod tests; use codec::{Decode, Encode, EncodeLike}; use frame_support::traits::{ - Contains, Currency, Defensive, EnsureOrigin, Get, LockableCurrency, OriginTrait, + Contains, Currency, Defensive, EnsureOrigin, Get, LockableCurrency, OriginTrait, ContainsPair, }; use scale_info::TypeInfo; use sp_runtime::{ @@ -82,48 +82,6 @@ pub mod pallet { #[pallet::without_storage_info] pub struct Pallet(_); - /// A trait for querying whether a type can be said to "contain" a single pair-value. - pub trait ContainsPair { - /// Return `true` if this "contains" the pair-value `a, b`. - fn contains(a: &A, b: &B) -> bool; - } - - impl ContainsPair for frame_support::traits::Everything { - fn contains(_: &A, _: &B) -> bool { - true - } - } - - impl ContainsPair for frame_support::traits::Nothing { - fn contains(_: &A, _: &B) -> bool { - false - } - } - - #[impl_trait_for_tuples::impl_for_tuples(0, 30)] - impl ContainsPair for Tuple { - fn contains(a: &A, b: &B) -> bool { - for_tuples!( #( - if Tuple::contains(a, b) { return true } - )* ); - false - } - } - - /// Create a type which implements the `Contains` trait for a particular type with syntax similar - /// to `matches!`. - #[macro_export] - macro_rules! match_type { - ( pub type $n:ident: impl ContainsPair<$a:ty, $b:ty> = { $phead:pat_param $( | $ptail:pat )* } ; ) => { - pub struct $n; - impl $crate::traits::ContainsPair<$a, $b> for $n { - fn contains(a: &$a, b: &$b) -> bool { - matches!((a, b), $phead $( | $ptail )* ) - } - } - } - } - pub type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; @@ -1315,7 +1273,7 @@ impl Pallet { } else { None }; - log::trace!(target: "xcm::send_xcm", "dest: {:?}, message: {:?}", &dest, &message); + log::debug!(target: "xcm::send_xcm", "dest: {:?}, message: {:?}", &dest, &message); let (ticket, price) = validate_send::(dest, message)?; if let Some(fee_payer) = maybe_fee_payer { Self::charge_fees(fee_payer, price).map_err(|_| SendError::Fees)?; diff --git a/xcm/src/lib.rs b/xcm/src/lib.rs index e883f959b5b9..bef1fa7e29fe 100644 --- a/xcm/src/lib.rs +++ b/xcm/src/lib.rs @@ -561,5 +561,5 @@ pub trait GetWeight { #[test] fn conversion_works() { use latest::prelude::*; - let _: VersionedMultiAssets = (Here, 1).into(); + let _: VersionedMultiAssets = (Here, 1u128).into(); } diff --git a/xcm/src/v2/mod.rs b/xcm/src/v2/mod.rs index 4a787877fa95..f34610fb8d56 100644 --- a/xcm/src/v2/mod.rs +++ b/xcm/src/v2/mod.rs @@ -1027,9 +1027,9 @@ mod tests { #[test] fn basic_roundtrip_works() { let xcm = - Xcm::<()>(vec![TransferAsset { assets: (Here, 1).into(), beneficiary: Here.into() }]); + Xcm::<()>(vec![TransferAsset { assets: (Here, 1u128).into(), beneficiary: Here.into() }]); let old_xcm = - OldXcm::<()>::TransferAsset { assets: (Here, 1).into(), beneficiary: Here.into() }; + OldXcm::<()>::TransferAsset { assets: (Here, 1u128).into(), beneficiary: Here.into() }; assert_eq!(old_xcm, OldXcm::<()>::try_from(xcm.clone()).unwrap()); let new_xcm: Xcm<()> = old_xcm.try_into().unwrap(); assert_eq!(new_xcm, xcm); @@ -1038,12 +1038,12 @@ mod tests { #[test] fn teleport_roundtrip_works() { let xcm = Xcm::<()>(vec![ - ReceiveTeleportedAsset((Here, 1).into()), + ReceiveTeleportedAsset((Here, 1u128).into()), ClearOrigin, DepositAsset { assets: Wild(All), max_assets: 1, beneficiary: Here.into() }, ]); let old_xcm: OldXcm<()> = OldXcm::<()>::ReceiveTeleportedAsset { - assets: (Here, 1).into(), + assets: (Here, 1u128).into(), effects: vec![OldOrder::DepositAsset { assets: Wild(All), max_assets: 1, @@ -1058,16 +1058,16 @@ mod tests { #[test] fn reserve_deposit_roundtrip_works() { let xcm = Xcm::<()>(vec![ - ReserveAssetDeposited((Here, 1).into()), + ReserveAssetDeposited((Here, 1u128).into()), ClearOrigin, - BuyExecution { fees: (Here, 1).into(), weight_limit: Some(1).into() }, + BuyExecution { fees: (Here, 1u128).into(), weight_limit: Some(1).into() }, DepositAsset { assets: Wild(All), max_assets: 1, beneficiary: Here.into() }, ]); let old_xcm: OldXcm<()> = OldXcm::<()>::ReserveAssetDeposited { - assets: (Here, 1).into(), + assets: (Here, 1u128).into(), effects: vec![ OldOrder::BuyExecution { - fees: (Here, 1).into(), + fees: (Here, 1u128).into(), debt: 1, weight: 0, instructions: vec![], diff --git a/xcm/src/v3/junction.rs b/xcm/src/v3/junction.rs index 60fbff43f229..7a94330feb6f 100644 --- a/xcm/src/v3/junction.rs +++ b/xcm/src/v3/junction.rs @@ -71,7 +71,7 @@ impl From for Option { } /// An identifier of a pluralistic body. -#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub enum BodyId { /// The only body in its context. Unit, @@ -115,7 +115,7 @@ impl TryFrom for BodyId { } /// A part of a pluralistic body. -#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub enum BodyPart { /// The body's declaration, under whatever means it decides. Voice, @@ -176,7 +176,7 @@ impl TryFrom for BodyPart { /// A single item in a path to describe the relative location of a consensus system. /// /// Each item assumes a pre-existing location as its context and is defined in terms of it. -#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub enum Junction { /// An indexed parachain belonging to and operated by the context. /// diff --git a/xcm/src/v3/junctions.rs b/xcm/src/v3/junctions.rs index 88df3a0d3061..aefd53a37e07 100644 --- a/xcm/src/v3/junctions.rs +++ b/xcm/src/v3/junctions.rs @@ -29,7 +29,7 @@ pub(crate) const MAX_JUNCTIONS: usize = 8; /// /// Parent junctions cannot be constructed with this type. Refer to `MultiLocation` for /// instructions on constructing parent junctions. -#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub enum Junctions { /// The interpreting consensus system. Here, @@ -527,6 +527,10 @@ impl Junctions { } return self.at(prefix.len()) } + + pub fn starts_with(&self, prefix: &Junctions) -> bool { + prefix.len() <= self.len() && prefix.iter().zip(self.iter()).all(|(x, y)| x == y) + } } impl TryFrom for Junctions { diff --git a/xcm/src/v3/mod.rs b/xcm/src/v3/mod.rs index 5e522e32baba..e713b13ce214 100644 --- a/xcm/src/v3/mod.rs +++ b/xcm/src/v3/mod.rs @@ -1221,7 +1221,7 @@ mod tests { #[test] fn basic_roundtrip_works() { let xcm = - Xcm::<()>(vec![TransferAsset { assets: (Here, 1).into(), beneficiary: Here.into() }]); + Xcm::<()>(vec![TransferAsset { assets: (Here, 1u128).into(), beneficiary: Here.into() }]); let old_xcm = OldXcm::<()>(vec![OldInstruction::TransferAsset { assets: (OldHere, 1).into(), beneficiary: OldHere.into(), @@ -1234,7 +1234,7 @@ mod tests { #[test] fn teleport_roundtrip_works() { let xcm = Xcm::<()>(vec![ - ReceiveTeleportedAsset((Here, 1).into()), + ReceiveTeleportedAsset((Here, 1u128).into()), ClearOrigin, DepositAsset { assets: Wild(AllCounted(1)), beneficiary: Here.into() }, ]); @@ -1255,9 +1255,9 @@ mod tests { #[test] fn reserve_deposit_roundtrip_works() { let xcm = Xcm::<()>(vec![ - ReserveAssetDeposited((Here, 1).into()), + ReserveAssetDeposited((Here, 1u128).into()), ClearOrigin, - BuyExecution { fees: (Here, 1).into(), weight_limit: Some(1).into() }, + BuyExecution { fees: (Here, 1u128).into(), weight_limit: Some(1).into() }, DepositAsset { assets: Wild(AllCounted(1)), beneficiary: Here.into() }, ]); let old_xcm = OldXcm::<()>(vec![ @@ -1281,7 +1281,7 @@ mod tests { #[test] fn deposit_asset_roundtrip_works() { let xcm = Xcm::<()>(vec![ - WithdrawAsset((Here, 1).into()), + WithdrawAsset((Here, 1u128).into()), DepositAsset { assets: Wild(AllCounted(1)), beneficiary: Here.into() }, ]); let old_xcm = OldXcm::<()>(vec![ @@ -1300,7 +1300,7 @@ mod tests { #[test] fn deposit_reserve_asset_roundtrip_works() { let xcm = Xcm::<()>(vec![ - WithdrawAsset((Here, 1).into()), + WithdrawAsset((Here, 1u128).into()), DepositReserveAsset { assets: Wild(AllCounted(1)), dest: Here.into(), diff --git a/xcm/src/v3/multiasset.rs b/xcm/src/v3/multiasset.rs index 9a5f1c3cecc7..a6e5ac943d32 100644 --- a/xcm/src/v3/multiasset.rs +++ b/xcm/src/v3/multiasset.rs @@ -39,7 +39,7 @@ use parity_scale_codec::{self as codec, Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; /// A general identifier for an instance of a non-fungible asset class. -#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub enum AssetInstance { /// Undefined - used if the non-fungible asset class has only one instance. Undefined, @@ -291,7 +291,7 @@ impl TryFrom for WildFungibility { } /// Classification of an asset being concrete or abstract. -#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)] +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)] pub enum AssetId { Concrete(MultiLocation), Abstract([u8; 32]), @@ -827,5 +827,5 @@ impl TryFrom<(OldMultiAssetFilter, u32)> for MultiAssetFilter { fn conversion_works() { use super::prelude::*; - let _: MultiAssets = (Here, 1).into(); + let _: MultiAssets = (Here, 1u128).into(); } diff --git a/xcm/src/v3/multilocation.rs b/xcm/src/v3/multilocation.rs index 6cd684afa147..cfa8cdeb07a6 100644 --- a/xcm/src/v3/multilocation.rs +++ b/xcm/src/v3/multilocation.rs @@ -51,7 +51,7 @@ use scale_info::TypeInfo; /// that a value is strictly an interior location, in those cases, `Junctions` may be used. /// /// The `MultiLocation` value of `Null` simply refers to the interpreting consensus system. -#[derive(Clone, Decode, Encode, Eq, PartialEq, Ord, PartialOrd, Debug, TypeInfo, MaxEncodedLen)] +#[derive(Copy, Clone, Decode, Encode, Eq, PartialEq, Ord, PartialOrd, Debug, TypeInfo, MaxEncodedLen)] pub struct MultiLocation { /// The number of parent junctions at the beginning of this `MultiLocation`. pub parents: u8, @@ -268,6 +268,10 @@ impl MultiLocation { self.interior.match_and_split(&prefix.interior) } + pub fn starts_with(&self, prefix: &MultiLocation) -> bool { + self.parents == prefix.parents && self.interior.starts_with(&prefix.interior) + } + /// Mutate `self` so that it is suffixed with `suffix`. /// /// Does not modify `self` and returns `Err` with `suffix` in case of overflow. diff --git a/xcm/xcm-builder/src/asset_conversion.rs b/xcm/xcm-builder/src/asset_conversion.rs index 3fb878f493e2..bc1145dc0d1a 100644 --- a/xcm/xcm-builder/src/asset_conversion.rs +++ b/xcm/xcm-builder/src/asset_conversion.rs @@ -57,7 +57,7 @@ impl, AssetId: Clone, ConvertAssetId: Convert( +pub struct ConvertedConcreteId( PhantomData<(AssetId, Balance, ConvertAssetId, ConvertOther)>, ); impl< @@ -66,7 +66,7 @@ impl< ConvertAssetId: Convert, ConvertBalance: Convert, > MatchesFungibles - for ConvertedConcreteAssetId + for ConvertedConcreteId { fn matches_fungibles(a: &MultiAsset) -> result::Result<(AssetId, Balance), MatchError> { let (amount, id) = match (&a.fun, &a.id) { @@ -86,7 +86,7 @@ impl< ConvertClassId: Convert, ConvertInstanceId: Convert, > MatchesNonFungibles - for ConvertedConcreteAssetId + for ConvertedConcreteId { fn matches_nonfungibles(a: &MultiAsset) -> result::Result<(ClassId, InstanceId), MatchError> { let (instance, class) = match (&a.fun, &a.id) { @@ -101,7 +101,7 @@ impl< } } -pub struct ConvertedAbstractAssetId( +pub struct ConvertedAbstractId( PhantomData<(AssetId, Balance, ConvertAssetId, ConvertOther)>, ); impl< @@ -110,7 +110,7 @@ impl< ConvertAssetId: Convert<[u8; 32], AssetId>, ConvertBalance: Convert, > MatchesFungibles - for ConvertedAbstractAssetId + for ConvertedAbstractId { fn matches_fungibles(a: &MultiAsset) -> result::Result<(AssetId, Balance), MatchError> { let (amount, id) = match (&a.fun, &a.id) { @@ -130,7 +130,7 @@ impl< ConvertClassId: Convert<[u8; 32], ClassId>, ConvertInstanceId: Convert, > MatchesNonFungibles - for ConvertedAbstractAssetId + for ConvertedAbstractId { fn matches_nonfungibles(a: &MultiAsset) -> result::Result<(ClassId, InstanceId), MatchError> { let (instance, class) = match (&a.fun, &a.id) { @@ -144,3 +144,8 @@ impl< Ok((what, instance)) } } + +#[deprecated = "Use `ConvertedConcreteId` instead"] +pub type ConvertedConcreteAssetId = ConvertedConcreteId; +#[deprecated = "Use `ConvertedAbstractId` instead"] +pub type ConvertedAbstractAssetId = ConvertedAbstractId; diff --git a/xcm/xcm-builder/src/filter_asset_location.rs b/xcm/xcm-builder/src/filter_asset_location.rs index cb404a4dbce9..9aa26f6d5cfe 100644 --- a/xcm/xcm-builder/src/filter_asset_location.rs +++ b/xcm/xcm-builder/src/filter_asset_location.rs @@ -16,25 +16,24 @@ //! Various implementations of `FilterAssetLocation`. -use frame_support::traits::Get; +use frame_support::traits::{Get, ContainsPair}; use sp_std::marker::PhantomData; use xcm::latest::{AssetId::Concrete, MultiAsset, MultiAssetFilter, MultiLocation}; -use xcm_executor::traits::FilterAssetLocation; /// Accepts an asset iff it is a native asset. pub struct NativeAsset; -impl FilterAssetLocation for NativeAsset { - fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { - log::trace!(target: "xcm::filter_asset_location", "NativeAsset asset: {:?}, origin: {:?}", asset, origin); +impl ContainsPair for NativeAsset { + fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { + log::trace!(target: "xcm::contains", "NativeAsset asset: {:?}, origin: {:?}", asset, origin); matches!(asset.id, Concrete(ref id) if id == origin) } } /// Accepts an asset if it is contained in the given `T`'s `Get` implementation. pub struct Case(PhantomData); -impl> FilterAssetLocation for Case { - fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { - log::trace!(target: "xcm::filter_asset_location", "Case asset: {:?}, origin: {:?}", asset, origin); +impl> ContainsPair for Case { + fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { + log::trace!(target: "xcm::contains", "Case asset: {:?}, origin: {:?}", asset, origin); let (a, o) = T::get(); a.matches(asset) && &o == origin } diff --git a/xcm/xcm-builder/src/lib.rs b/xcm/xcm-builder/src/lib.rs index 1f445939c149..2b97464dff10 100644 --- a/xcm/xcm-builder/src/lib.rs +++ b/xcm/xcm-builder/src/lib.rs @@ -42,8 +42,11 @@ pub use origin_conversion::{ mod asset_conversion; pub use asset_conversion::{ - AsPrefixedGeneralIndex, ConvertedAbstractAssetId, ConvertedConcreteAssetId, + AsPrefixedGeneralIndex, ConvertedAbstractId, ConvertedConcreteId, }; +#[allow(deprecated)] +pub use asset_conversion::{ConvertedAbstractAssetId, ConvertedConcreteAssetId}; + mod barriers; pub use barriers::{ diff --git a/xcm/xcm-builder/src/nonfungibles_adapter.rs b/xcm/xcm-builder/src/nonfungibles_adapter.rs index 712bd6ab75ea..b489422b2557 100644 --- a/xcm/xcm-builder/src/nonfungibles_adapter.rs +++ b/xcm/xcm-builder/src/nonfungibles_adapter.rs @@ -104,7 +104,7 @@ impl< ); if let Ok((class, instance)) = Matcher::matches_nonfungibles(what) { if CheckAsset::contains(&class) { - let ok = Assets::burn_from(&class, &instance).is_ok(); + let ok = Assets::burn(&class, &instance, None).is_ok(); debug_assert!( ok, "`can_check_in` must have returned `true` immediately prior; qed" @@ -153,8 +153,10 @@ impl< what, who, ); // Check we handle this asset. + let who = AccountIdConverter::convert_ref(who) + .map_err(|()| MatchError::AccountIdConversionFailed)?; let (class, instance) = Matcher::matches_nonfungibles(what)?; - Assets::burn_from(&class, &instance) + Assets::burn(&class, &instance, Some(&who)) .map_err(|e| XcmError::FailedToTransactAsset(e.into()))?; Ok(what.clone().into()) } diff --git a/xcm/xcm-builder/src/test_utils.rs b/xcm/xcm-builder/src/test_utils.rs index bdca8f02ff99..ceb41aa409ac 100644 --- a/xcm/xcm-builder/src/test_utils.rs +++ b/xcm/xcm-builder/src/test_utils.rs @@ -25,7 +25,7 @@ use sp_std::vec::Vec; pub use xcm::latest::prelude::*; use xcm_executor::traits::{ClaimAssets, DropAssets, VersionChangeNotifier}; pub use xcm_executor::{ - traits::{ConvertOrigin, FilterAssetLocation, OnResponse, TransactAsset, UniversalLocation}, + traits::{ConvertOrigin, OnResponse, TransactAsset, UniversalLocation}, Assets, Config, }; diff --git a/xcm/xcm-builder/src/tests/basic.rs b/xcm/xcm-builder/src/tests/basic.rs index 1b611d5b6168..60a63e42dd69 100644 --- a/xcm/xcm-builder/src/tests/basic.rs +++ b/xcm/xcm-builder/src/tests/basic.rs @@ -19,7 +19,7 @@ use super::*; #[test] fn basic_setup_works() { add_reserve(Parent.into(), Wild((Parent, WildFungible).into())); - assert!(::IsReserve::filter_asset_location( + assert!(::IsReserve::contains( &(Parent, 100).into(), &Parent.into(), )); @@ -72,7 +72,7 @@ fn code_registers_should_work() { }])), // First xfer always works ok TransferAsset { - assets: (Here, 1).into(), + assets: (Here, 1u128).into(), beneficiary: X1(AccountIndex64 { index: 3, network: None }).into(), }, // Second xfer results in error on the second message - our error handler will fire. @@ -94,6 +94,6 @@ fn code_registers_should_work() { let r = XcmExecutor::::execute_xcm(Here, message, limit); assert_eq!(r, Outcome::Complete(70)); // We pay the full weight here. assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 20).into()]); - assert_eq!(asset_list(Here), vec![(Here, 1).into()]); + assert_eq!(asset_list(Here), vec![(Here, 1u128).into()]); assert_eq!(sent_xcm(), vec![]); } diff --git a/xcm/xcm-builder/src/tests/mock.rs b/xcm/xcm-builder/src/tests/mock.rs index bcaad110dd33..9e053ccbafd7 100644 --- a/xcm/xcm-builder/src/tests/mock.rs +++ b/xcm/xcm-builder/src/tests/mock.rs @@ -284,14 +284,14 @@ pub fn clear_universal_aliases() { pub struct TestIsReserve; impl FilterAssetLocation for TestIsReserve { - fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { + fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { IS_RESERVE .with(|r| r.borrow().get(origin).map_or(false, |v| v.iter().any(|a| a.matches(asset)))) } } pub struct TestIsTeleporter; impl FilterAssetLocation for TestIsTeleporter { - fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { + fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { IS_TELEPORTER .with(|r| r.borrow().get(origin).map_or(false, |v| v.iter().any(|a| a.matches(asset)))) } diff --git a/xcm/xcm-builder/src/tests/weight.rs b/xcm/xcm-builder/src/tests/weight.rs index 6c2a5cf112f8..2f81b126a298 100644 --- a/xcm/xcm-builder/src/tests/weight.rs +++ b/xcm/xcm-builder/src/tests/weight.rs @@ -25,7 +25,7 @@ fn errors_should_return_unused_weight() { let mut message = Xcm(vec![ // First xfer results in an error on the last message only TransferAsset { - assets: (Here, 1).into(), + assets: (Here, 1u128).into(), beneficiary: X1(AccountIndex64 { index: 3, network: None }).into(), }, // Second xfer results in error third message and after @@ -52,7 +52,7 @@ fn errors_should_return_unused_weight() { let r = XcmExecutor::::execute_xcm(Here, message.clone(), limit); assert_eq!(r, Outcome::Incomplete(30, XcmError::NotWithdrawable)); assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 10).into()]); - assert_eq!(asset_list(Here), vec![(Here, 1).into()]); + assert_eq!(asset_list(Here), vec![(Here, 1u128).into()]); assert_eq!(sent_xcm(), vec![]); let r = XcmExecutor::::execute_xcm(Here, message.clone(), limit); diff --git a/xcm/xcm-executor/src/config.rs b/xcm/xcm-executor/src/config.rs index 67b8ca3d72ab..bd2870a0e2d0 100644 --- a/xcm/xcm-executor/src/config.rs +++ b/xcm/xcm-executor/src/config.rs @@ -16,15 +16,15 @@ use crate::traits::{ AssetExchange, AssetLock, ClaimAssets, ConvertOrigin, DropAssets, ExportXcm, FeeManager, - FilterAssetLocation, OnResponse, ShouldExecute, TransactAsset, UniversalLocation, + OnResponse, ShouldExecute, TransactAsset, UniversalLocation, VersionChangeNotifier, WeightBounds, WeightTrader, }; use frame_support::{ dispatch::{Dispatchable, Parameter}, - traits::{Contains, Get, PalletsInfoAccess}, + traits::{Contains, ContainsPair, Get, PalletsInfoAccess}, weights::{GetDispatchInfo, PostDispatchInfo}, }; -use xcm::latest::{Junction, MultiLocation, SendXcm}; +use xcm::prelude::*; /// The trait to parameterize the `XcmExecutor`. pub trait Config { @@ -40,11 +40,11 @@ pub trait Config { /// How to get a call origin from a `OriginKind` value. type OriginConverter: ConvertOrigin<::Origin>; - /// Combinations of (Location, Asset) pairs which we trust as reserves. - type IsReserve: FilterAssetLocation; + /// Combinations of (Asset, Location) pairs which we trust as reserves. + type IsReserve: ContainsPair; - /// Combinations of (Location, Asset) pairs which we trust as teleporters. - type IsTeleporter: FilterAssetLocation; + /// Combinations of (Asset, Location) pairs which we trust as teleporters. + type IsTeleporter: ContainsPair; /// Means of inverting a location. type LocationInverter: UniversalLocation; diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index fcd7f85b18ea..cc54126819ef 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -19,7 +19,7 @@ use frame_support::{ dispatch::{Dispatchable, Weight}, ensure, - traits::{Contains, Get, PalletsInfoAccess}, + traits::{Contains, ContainsPair, Get, PalletsInfoAccess}, weights::GetDispatchInfo, }; use parity_scale_codec::{Decode, Encode}; @@ -31,7 +31,7 @@ use xcm::latest::prelude::*; pub mod traits; use traits::{ validate_export, AssetExchange, AssetLock, ClaimAssets, ConvertOrigin, DropAssets, Enact, - ExportXcm, FeeManager, FeeReason, FilterAssetLocation, OnResponse, ShouldExecute, + ExportXcm, FeeManager, FeeReason, OnResponse, ShouldExecute, TransactAsset, UniversalLocation, VersionChangeNotifier, WeightBounds, WeightTrader, }; @@ -192,7 +192,7 @@ impl ExecuteXcm for XcmExecutor { xcm_weight, &mut weight_credit, ) { - log::debug!( + log::trace!( target: "xcm::execute_xcm_in_credit", "Barrier blocked execution! Error: {:?}. (origin: {:?}, message: {:?}, weight_credit: {:?})", e, @@ -291,6 +291,7 @@ impl XcmExecutor { match &mut result { r @ Ok(()) => if let Err(e) = self.process_instruction(instr) { + log::trace!(target: "xcm::execute", "!!! ERROR: {:?}", e); *r = Err(ExecutorError { index: i as u32, xcm_error: e, weight: 0 }); }, Err(ref mut error) => @@ -323,7 +324,7 @@ impl XcmExecutor { // TODO: #2841 #REALWEIGHT We should deduct the cost of any instructions following // the error which didn't end up being executed. Some((_i, e)) => { - log::debug!(target: "xcm::execute_xcm_in_credit", "Execution errored at {:?}: {:?} (original_origin: {:?})", _i, e, self.original_origin); + log::trace!(target: "xcm::execute_xcm_in_credit", "Execution errored at {:?}: {:?} (original_origin: {:?})", _i, e, self.original_origin); Outcome::Incomplete(weight_used, e) }, } @@ -400,6 +401,11 @@ impl XcmExecutor { /// Process a single XCM instruction, mutating the state of the XCM virtual machine. fn process_instruction(&mut self, instr: Instruction) -> Result<(), XcmError> { + log::trace!( + target: "xcm::execute", + "=== {:?}", + instr + ); match instr { WithdrawAsset(assets) => { // Take `assets` from the origin account (on-chain) and place in holding. @@ -416,7 +422,7 @@ impl XcmExecutor { for asset in assets.into_inner().into_iter() { // Must ensure that we recognise the asset as being managed by the origin. ensure!( - Config::IsReserve::filter_asset_location(&asset, &origin), + Config::IsReserve::contains(&asset, &origin), XcmError::UntrustedReserveLocation ); self.subsume_asset(asset)?; @@ -451,7 +457,7 @@ impl XcmExecutor { // We only trust the origin to send us assets that they identify as their // sovereign assets. ensure!( - Config::IsTeleporter::filter_asset_location(asset, &origin), + Config::IsTeleporter::contains(asset, &origin), XcmError::UntrustedTeleportLocation ); // We should check that the asset can actually be teleported in (for this to be in error, there diff --git a/xcm/xcm-executor/src/traits/filter_asset_location.rs b/xcm/xcm-executor/src/traits/filter_asset_location.rs index 31b9c47a828c..1150786697ab 100644 --- a/xcm/xcm-executor/src/traits/filter_asset_location.rs +++ b/xcm/xcm-executor/src/traits/filter_asset_location.rs @@ -15,27 +15,20 @@ // along with Polkadot. If not, see . use xcm::latest::{MultiAsset, MultiLocation}; +use frame_support::traits::ContainsPair; /// Filters assets/location pairs. /// /// Can be amalgamated into tuples. If any item returns `true`, it short-circuits, else `false` is returned. +#[deprecated = "Use `frame_support::traits::ContainsPair` instead"] pub trait FilterAssetLocation { /// A filter to distinguish between asset/location pairs. - fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool; + fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool; } -#[impl_trait_for_tuples::impl_for_tuples(30)] -impl FilterAssetLocation for Tuple { - fn filter_asset_location(what: &MultiAsset, origin: &MultiLocation) -> bool { - for_tuples!( #( - if Tuple::filter_asset_location(what, origin) { return true } - )* ); - log::trace!( - target: "xcm::filter_asset_location", - "got filtered: what: {:?}, origin: {:?}", - what, - origin, - ); - false +#[allow(deprecated)] +impl> FilterAssetLocation for T { + fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { + T::contains(asset, origin) } -} +} \ No newline at end of file diff --git a/xcm/xcm-executor/src/traits/mod.rs b/xcm/xcm-executor/src/traits/mod.rs index c32d0068ee5c..880364871a1a 100644 --- a/xcm/xcm-executor/src/traits/mod.rs +++ b/xcm/xcm-executor/src/traits/mod.rs @@ -31,6 +31,7 @@ pub use export::{export_xcm, validate_export, ExportXcm}; mod fee_manager; pub use fee_manager::{FeeManager, FeeReason}; mod filter_asset_location; +#[allow(deprecated)] pub use filter_asset_location::FilterAssetLocation; mod token_matching; pub use token_matching::{Error, MatchesFungibles, MatchesFungible, MatchesNonFungibles, MatchesNonFungible}; diff --git a/xcm/xcm-executor/src/traits/transact_asset.rs b/xcm/xcm-executor/src/traits/transact_asset.rs index bdfd4a49fbd4..7a933275a45a 100644 --- a/xcm/xcm-executor/src/traits/transact_asset.rs +++ b/xcm/xcm-executor/src/traits/transact_asset.rs @@ -273,7 +273,7 @@ mod tests { (UnimplementedTransactor, NotFoundTransactor, UnimplementedTransactor); assert_eq!( - MultiTransactor::deposit_asset(&(Here, 1).into(), &Here.into()), + MultiTransactor::deposit_asset(&(Here, 1u128).into(), &Here.into()), Err(XcmError::AssetNotFound) ); } @@ -282,7 +282,7 @@ mod tests { fn unimplemented_and_not_found_continue_iteration() { type MultiTransactor = (UnimplementedTransactor, NotFoundTransactor, SuccessfulTransactor); - assert_eq!(MultiTransactor::deposit_asset(&(Here, 1).into(), &Here.into()), Ok(()),); + assert_eq!(MultiTransactor::deposit_asset(&(Here, 1u128).into(), &Here.into()), Ok(()),); } #[test] @@ -290,7 +290,7 @@ mod tests { type MultiTransactor = (OverflowTransactor, SuccessfulTransactor); assert_eq!( - MultiTransactor::deposit_asset(&(Here, 1).into(), &Here.into()), + MultiTransactor::deposit_asset(&(Here, 1u128).into(), &Here.into()), Err(XcmError::Overflow) ); } @@ -299,6 +299,6 @@ mod tests { fn success_stops_iteration() { type MultiTransactor = (SuccessfulTransactor, OverflowTransactor); - assert_eq!(MultiTransactor::deposit_asset(&(Here, 1).into(), &Here.into()), Ok(()),); + assert_eq!(MultiTransactor::deposit_asset(&(Here, 1u128).into(), &Here.into()), Ok(()),); } } diff --git a/xcm/xcm-simulator/example/Cargo.toml b/xcm/xcm-simulator/example/Cargo.toml index ddd83db38182..0cfe242e6255 100644 --- a/xcm/xcm-simulator/example/Cargo.toml +++ b/xcm/xcm-simulator/example/Cargo.toml @@ -8,6 +8,7 @@ edition = "2018" [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0" } scale-info = { version = "1.0", features = ["derive"] } +log = { version = "0.4.14", default-features = false } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -17,6 +18,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } xcm = { path = "../../" } xcm-simulator = { path = "../" } @@ -26,3 +28,12 @@ pallet-xcm = { path = "../../pallet-xcm" } polkadot-core-primitives = { path = "../../../core-primitives" } polkadot-runtime-parachains = { path = "../../../runtime/parachains" } polkadot-parachain = { path = "../../../parachain" } + +[features] +default = ["runtime-benchmarks"] +runtime-benchmarks = [ + "frame-support/runtime-benchmarks", + "pallet-uniques/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", +] diff --git a/xcm/xcm-simulator/example/src/lib.rs b/xcm/xcm-simulator/example/src/lib.rs index b1b78631fee4..1fe677037375 100644 --- a/xcm/xcm-simulator/example/src/lib.rs +++ b/xcm/xcm-simulator/example/src/lib.rs @@ -17,9 +17,10 @@ mod parachain; mod relay_chain; -use polkadot_parachain::primitives::Id as ParaId; -use sp_runtime::traits::AccountIdConversion; +use xcm_executor::traits::Convert; +use xcm::prelude::*; use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; +use frame_support::sp_tracing; pub const ALICE: sp_runtime::AccountId32 = sp_runtime::AccountId32::new([0u8; 32]); pub const INITIAL_BALANCE: u128 = 1_000_000_000; @@ -60,21 +61,46 @@ decl_test_network! { } } -pub fn para_account_id(id: u32) -> relay_chain::AccountId { - ParaId::from(id).into_account() +pub fn parent_account_id() -> parachain::AccountId { + let location = (Parent,); + parachain::LocationToAccountId::convert(location.into()).unwrap() } +pub fn child_account_id(para: u32) -> relay_chain::AccountId { + let location = (Parachain(para),); + relay_chain::LocationToAccountId::convert(location.into()).unwrap() +} + +pub fn child_account_account_id(para: u32, who: sp_runtime::AccountId32) -> relay_chain::AccountId { + let location = (Parachain(para), AccountId32 { network: None, id: who.into() }); + relay_chain::LocationToAccountId::convert(location.into()).unwrap() +} + +pub fn sibling_account_account_id(para: u32, who: sp_runtime::AccountId32) -> parachain::AccountId { + let location = (Parent, Parachain(para), AccountId32 { network: None, id: who.into() }); + parachain::LocationToAccountId::convert(location.into()).unwrap() +} + +pub fn parent_account_account_id(who: sp_runtime::AccountId32) -> parachain::AccountId { + let location = (Parent, AccountId32 { network: None, id: who.into() }); + parachain::LocationToAccountId::convert(location.into()).unwrap() +} + + pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { use parachain::{MsgQueue, Runtime, System}; let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - pallet_balances::GenesisConfig:: { balances: vec![(ALICE, INITIAL_BALANCE)] } + pallet_balances::GenesisConfig:: { + balances: vec![(ALICE, INITIAL_BALANCE), (parent_account_id(), INITIAL_BALANCE)], + } .assimilate_storage(&mut t) .unwrap(); let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| { + sp_tracing::try_init_simple(); System::set_block_number(1); MsgQueue::set_para_id(para_id.into()); }); @@ -87,7 +113,7 @@ pub fn relay_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); pallet_balances::GenesisConfig:: { - balances: vec![(ALICE, INITIAL_BALANCE), (para_account_id(1), INITIAL_BALANCE)], + balances: vec![(ALICE, INITIAL_BALANCE), (child_account_id(1), INITIAL_BALANCE)], } .assimilate_storage(&mut t) .unwrap(); @@ -96,7 +122,7 @@ pub fn relay_ext() -> sp_io::TestExternalities { ext.execute_with(|| { System::set_block_number(1); assert_eq!(Uniques::force_create(Origin::root(), 1, ALICE, true), Ok(())); - assert_eq!(Uniques::mint(Origin::signed(ALICE), 1, 42, para_account_id(1)), Ok(())); + assert_eq!(Uniques::mint(Origin::signed(ALICE), 1, 42, child_account_id(1)), Ok(())); }); ext } @@ -110,7 +136,7 @@ mod tests { use codec::Encode; use frame_support::assert_ok; - use xcm::latest::{prelude::*, QueryResponseInfo}; + use xcm::latest::QueryResponseInfo; use xcm_simulator::TestExt; // Helper function for forming buy execution message @@ -118,6 +144,13 @@ mod tests { BuyExecution { fees: fees.into(), weight_limit: Unlimited } } + #[test] + fn remote_account_ids_work() { + child_account_account_id(1, ALICE); + sibling_account_account_id(1, ALICE); + parent_account_account_id(ALICE); + } + #[test] fn dmp() { MockNet::reset(); @@ -216,7 +249,7 @@ mod tests { 0, )); assert_eq!( - parachain::Balances::free_balance(¶_account_id(1)), + parachain::Balances::free_balance(&child_account_id(1)), INITIAL_BALANCE + withdraw_amount ); }); @@ -238,24 +271,207 @@ mod tests { fn withdraw_and_deposit_nft() { MockNet::reset(); + Relay::execute_with(|| { + assert_eq!(relay_chain::Uniques::owner(1, 42), Some(child_account_id(1))); + }); + + ParaA::execute_with(|| { + let message = Xcm(vec![ + TransferAsset { + assets: (GeneralIndex(1), 42u32).into(), + beneficiary: Parachain(2).into(), + }, + ]); + // Send withdraw and deposit + assert_ok!(ParachainPalletXcm::send_xcm(Here, Parent, message)); + }); Relay::execute_with(|| { - assert_eq!(relay_chain::Uniques::owner(1, 42), Some(para_account_id(1))); + assert_eq!(relay_chain::Uniques::owner(1, 42), Some(child_account_id(2))); }); + } - let nft = Wild(AllOfCounted { id: GeneralIndex(1).into(), fun: WildNonFungible, count: 1 }); + /// Scenario: + /// The relay-chain teleports an NFT to a parachain. + /// + /// Asserts that the parachain accounts are updated as expected. + #[test] + fn teleport_nft() { + MockNet::reset(); + Relay::execute_with(|| { + // Mint the NFT (1, 69) and give it to our "parachain#1 alias". + assert_ok!(relay_chain::Uniques::mint( + relay_chain::Origin::signed(ALICE), + 1, + 69, + child_account_account_id(1, ALICE), + )); + // The parachain#1 alias of Alice is what must hold it on the Relay-chain for it to be + // withdrawable by Alice on the parachain. + assert_eq!(relay_chain::Uniques::owner(1, 69), Some(child_account_account_id(1, ALICE))); + }); ParaA::execute_with(|| { + assert_ok!(parachain::ForeignUniques::force_create( + parachain::Origin::root(), + (Parent, GeneralIndex(1)).into(), + ALICE, + false, + )); + assert_eq!( + parachain::ForeignUniques::owner((Parent, GeneralIndex(1)).into(), 69u32.into()), + None, + ); + assert_eq!(parachain::Balances::reserved_balance(&ALICE), 0); + + // IRL Alice would probably just execute this locally on the Relay-chain, but we can't + // easily do that here since we only send between chains. let message = Xcm(vec![ - WithdrawAsset((GeneralIndex(1), 42u32).into()), - DepositAsset { assets: nft, beneficiary: Parachain(2).into() }, + WithdrawAsset((GeneralIndex(1), 69u32).into()), + InitiateTeleport { + assets: AllCounted(1).into(), + dest: Parachain(1).into(), + xcm: Xcm(vec![ + DepositAsset { + assets: AllCounted(1).into(), + beneficiary: (AccountId32 { id: ALICE.into(), network: None },).into(), + } + ]), + }, ]); - // Send withdraw and deposit - assert_ok!(ParachainPalletXcm::send_xcm(Here, Parent, message.clone())); + // Send teleport + let alice = AccountId32 { id: ALICE.into(), network: None }; + assert_ok!(ParachainPalletXcm::send_xcm(alice, Parent, message)); + }); + ParaA::execute_with(|| { + assert_eq!( + parachain::ForeignUniques::owner((Parent, GeneralIndex(1)).into(), 69u32.into()), + Some(ALICE), + ); + assert_eq!(parachain::Balances::reserved_balance(&ALICE), 1000); + }); + Relay::execute_with(|| { + assert_eq!(relay_chain::Uniques::owner(1, 69), None); + }); + } + + /// Scenario: + /// The relay-chain transfers an NFT into a parachain's sovereign account, who then mints a + /// trustless-backed-derivated locally. + /// + /// Asserts that the parachain accounts are updated as expected. + #[test] + fn reserve_asset_transfer_nft() { + sp_tracing::init_for_tests(); + MockNet::reset(); + + Relay::execute_with(|| { + assert_ok!(relay_chain::Uniques::force_create(relay_chain::Origin::root(), 2, ALICE, false)); + assert_ok!(relay_chain::Uniques::mint( + relay_chain::Origin::signed(ALICE), + 2, + 69, + child_account_account_id(1, ALICE) + )); + assert_eq!(relay_chain::Uniques::owner(2, 69), Some(child_account_account_id(1, ALICE))); + }); + ParaA::execute_with(|| { + assert_ok!(parachain::ForeignUniques::force_create( + parachain::Origin::root(), + (Parent, GeneralIndex(2)).into(), + ALICE, + false, + )); + assert_eq!( + parachain::ForeignUniques::owner((Parent, GeneralIndex(2)).into(), 69u32.into()), + None, + ); + assert_eq!(parachain::Balances::reserved_balance(&ALICE), 0); + + let message = Xcm(vec![ + WithdrawAsset((GeneralIndex(2), 69u32).into()), + DepositReserveAsset { + assets: AllCounted(1).into(), + dest: Parachain(1).into(), + xcm: Xcm(vec![ + DepositAsset { + assets: AllCounted(1).into(), + beneficiary: (AccountId32 { id: ALICE.into(), network: None },).into(), + } + ]), + }, + ]); + // Send transfer + let alice = AccountId32 { id: ALICE.into(), network: None }; + assert_ok!(ParachainPalletXcm::send_xcm(alice, Parent, message)); + }); + ParaA::execute_with(|| { + log::debug!(target: "xcm-exceutor", "Hello"); + assert_eq!( + parachain::ForeignUniques::owner((Parent, GeneralIndex(2)).into(), 69u32.into()), + Some(ALICE), + ); + assert_eq!(parachain::Balances::reserved_balance(&ALICE), 1000); }); Relay::execute_with(|| { - assert_eq!(relay_chain::Uniques::owner(1, 42), Some(para_account_id(2))); + assert_eq!(relay_chain::Uniques::owner(2, 69), Some(child_account_id(1))); + }); + } + + /// Scenario: + /// The relay-chain creates an asset class on a parachain and then Alice transfers her NFT into + /// that parachain's sovereign account, who then mints a trustless-backed-derivative locally. + /// + /// Asserts that the parachain accounts are updated as expected. + #[test] + fn reserve_asset_class_create_and_reserve_transfer() { + MockNet::reset(); + + Relay::execute_with(|| { + assert_ok!(relay_chain::Uniques::force_create(relay_chain::Origin::root(), 2, ALICE, false)); + assert_ok!(relay_chain::Uniques::mint( + relay_chain::Origin::signed(ALICE), + 2, + 69, + child_account_account_id(1, ALICE) + )); + assert_eq!(relay_chain::Uniques::owner(2, 69), Some(child_account_account_id(1, ALICE))); + + let message = Xcm(vec![ + Transact { + origin_kind: OriginKind::Xcm, + require_weight_at_most: 1_000_000_000, + call: parachain::Call::from(pallet_uniques::Call::::create { + class: (Parent, 2u64).into(), + admin: parent_account_id(), + }).encode().into(), + }, + ]); + // Send creation. + assert_ok!(RelayChainPalletXcm::send_xcm(Here, Parachain(1), message)); + }); + ParaA::execute_with(|| { + // Then transfer + let message = Xcm(vec![ + WithdrawAsset((GeneralIndex(2), 69u32).into()), + DepositReserveAsset { + assets: AllCounted(1).into(), + dest: Parachain(1).into(), + xcm: Xcm(vec![ + DepositAsset { + assets: AllCounted(1).into(), + beneficiary: (AccountId32 { id: ALICE.into(), network: None },).into(), + } + ]), + }, + ]); + let alice = AccountId32 { id: ALICE.into(), network: None }; + assert_ok!(ParachainPalletXcm::send_xcm(alice, Parent, message)); + }); + ParaA::execute_with(|| { + assert_eq!(parachain::Balances::reserved_balance(&parent_account_id()), 1000); + assert_eq!(parachain::ForeignUniques::class_owner((Parent, 2u64).into()), Some(parent_account_id())); }); } @@ -281,10 +497,10 @@ mod tests { Relay::execute_with(|| { assert_eq!( - relay_chain::Balances::free_balance(para_account_id(1)), + relay_chain::Balances::free_balance(child_account_id(1)), INITIAL_BALANCE - send_amount ); - assert_eq!(relay_chain::Balances::free_balance(para_account_id(2)), send_amount); + assert_eq!(relay_chain::Balances::free_balance(child_account_id(2)), send_amount); }); } @@ -323,11 +539,11 @@ mod tests { Relay::execute_with(|| { // Withdraw executed assert_eq!( - relay_chain::Balances::free_balance(para_account_id(1)), + relay_chain::Balances::free_balance(child_account_id(1)), INITIAL_BALANCE - send_amount ); // Deposit executed - assert_eq!(relay_chain::Balances::free_balance(para_account_id(2)), send_amount); + assert_eq!(relay_chain::Balances::free_balance(child_account_id(2)), send_amount); }); // Check that QueryResponse message was received diff --git a/xcm/xcm-simulator/example/src/parachain.rs b/xcm/xcm-simulator/example/src/parachain.rs index 552ed740862a..4d646f10f456 100644 --- a/xcm/xcm-simulator/example/src/parachain.rs +++ b/xcm/xcm-simulator/example/src/parachain.rs @@ -19,7 +19,10 @@ use codec::{Decode, Encode}; use frame_support::{ construct_runtime, parameter_types, - traits::{Everything, Nothing}, + traits::{ + Everything, EverythingBut, Nothing, EnsureOriginWithArg, + EnsureOrigin, + }, weights::{constants::WEIGHT_PER_SECOND, Weight}, }; use sp_core::H256; @@ -40,11 +43,16 @@ use xcm_builder::{ AccountId32Aliases, AllowUnpaidExecutionFrom, CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, ParentIsPreset, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, NonFungiblesAdapter, ConvertedConcreteAssetId, AsPrefixedGeneralIndex, + SignedToAccountId32, SovereignSignedViaLocation, NonFungiblesAdapter, ConvertedConcreteId, + Account32Hash, }; -use xcm_executor::{Config, XcmExecutor, traits::JustTry}; +use xcm_executor::{Config, XcmExecutor, traits::{JustTry, Convert}}; -use crate::relay_chain::SovereignAccountOf; +pub type SovereignAccountOf = ( + SiblingParachainConvertsVia, + AccountId32Aliases, + ParentIsPreset, +); pub type AccountId = AccountId32; pub type Balance = u128; @@ -98,11 +106,20 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; } +#[cfg(feature = "runtime-benchmarks")] +pub struct UniquesHelper; +#[cfg(feature = "runtime-benchmarks")] +impl pallet_uniques::BenchmarkHelper for UniquesHelper { + fn class(i: u16) -> MultiLocation { GeneralIndex(i as u128).into() } + fn instance(i: u16) -> AssetInstance { AssetInstance::Index(i as u128) } +} + impl pallet_uniques::Config for Runtime { type Event = Event; - type ClassId = u32; - type InstanceId = u32; + type ClassId = MultiLocation; + type InstanceId = AssetInstance; type Currency = Balances; + type CreateOrigin = ForeignCreators; type ForceOrigin = frame_system::EnsureRoot; type ClassDeposit = frame_support::traits::ConstU128<1_000>; type InstanceDeposit = frame_support::traits::ConstU128<1_000>; @@ -113,8 +130,29 @@ impl pallet_uniques::Config for Runtime { type KeyLimit = frame_support::traits::ConstU32<64>; type ValueLimit = frame_support::traits::ConstU32<128>; type WeightInfo = (); + #[cfg(feature = "runtime-benchmarks")] + type Helper = UniquesHelper; } +// `EnsureOriginWithArg` impl for `CreateOrigin` which allows only XCM origins +// which are locations containing the class location. +pub struct ForeignCreators; +impl EnsureOriginWithArg for ForeignCreators { + type Success = AccountId; + + fn try_origin(o: Origin, a: &MultiLocation) -> sp_std::result::Result { + let origin_location = pallet_xcm::EnsureXcm::::try_origin(o.clone())?; + if !a.starts_with(&origin_location) { return Err(o) } + SovereignAccountOf::convert(origin_location).map_err(|_| o) + } + + #[cfg(feature = "runtime-benchmarks")] + fn successful_origin(a: &MultiLocation) -> Origin { + pallet_xcm::Origin::Xcm(a.clone()).into() + } +} + + parameter_types! { pub const ReservedXcmpWeight: Weight = WEIGHT_PER_SECOND / 4; pub const ReservedDmpWeight: Weight = WEIGHT_PER_SECOND / 4; @@ -130,6 +168,7 @@ pub type LocationToAccountId = ( ParentIsPreset, SiblingParachainConvertsVia, AccountId32Aliases, + Account32Hash<(), AccountId>, ); pub type XcmOriginToCallOrigin = ( @@ -143,13 +182,14 @@ parameter_types! { pub KsmPerSecond: (AssetId, u128) = (Concrete(Parent.into()), 1); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; + pub ForeignPrefix: MultiLocation = (Parent,).into(); } pub type LocalAssetTransactor = ( XcmCurrencyAdapter, LocationToAccountId, AccountId, ()>, NonFungiblesAdapter< - Uniques, - ConvertedConcreteAssetId, JustTry>, + ForeignUniques, + ConvertedConcreteId, SovereignAccountOf, AccountId, Nothing, @@ -160,14 +200,23 @@ pub type LocalAssetTransactor = ( pub type XcmRouter = super::ParachainXcmRouter; pub type Barrier = AllowUnpaidExecutionFrom; +parameter_types! { + pub NftCollectionOne: MultiAssetFilter + = Wild(AllOf { fun: WildNonFungible, id: Concrete((Parent, GeneralIndex(1)).into()) }); + pub NftCollectionOneForRelay: (MultiAssetFilter, MultiLocation) + = (NftCollectionOne::get(), (Parent,).into()); +} +pub type TrustedTeleporters = xcm_builder::Case; +pub type TrustedReserves = EverythingBut>; + pub struct XcmConfig; impl Config for XcmConfig { type Call = Call; type XcmSender = XcmRouter; type AssetTransactor = LocalAssetTransactor; type OriginConverter = XcmOriginToCallOrigin; - type IsReserve = NativeAsset; - type IsTeleporter = (); + type IsReserve = (NativeAsset, TrustedReserves); + type IsTeleporter = TrustedTeleporters; type LocationInverter = LocationInverter; type Barrier = Barrier; type Weigher = FixedWeightBounds; @@ -366,6 +415,6 @@ construct_runtime!( Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, MsgQueue: mock_msg_queue::{Pallet, Storage, Event}, PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin}, - Uniques: pallet_uniques::{Pallet, Call, Storage, Event}, + ForeignUniques: pallet_uniques::{Pallet, Call, Storage, Event}, } ); diff --git a/xcm/xcm-simulator/example/src/relay_chain.rs b/xcm/xcm-simulator/example/src/relay_chain.rs index 26da830d822e..a32786a3b199 100644 --- a/xcm/xcm-simulator/example/src/relay_chain.rs +++ b/xcm/xcm-simulator/example/src/relay_chain.rs @@ -18,7 +18,7 @@ use frame_support::{ construct_runtime, parameter_types, - traits::{Everything, Nothing}, + traits::{Everything, Nothing, AsEnsureOriginWithArg}, weights::Weight, }; use sp_core::H256; @@ -32,7 +32,7 @@ use xcm_builder::{ ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, FixedWeightBounds, IsConcrete, LocationInverter, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, - NonFungiblesAdapter, AsPrefixedGeneralIndex, ConvertedConcreteAssetId, + NonFungiblesAdapter, AsPrefixedGeneralIndex, ConvertedConcreteId, Account32Hash, }; use xcm_executor::{Config, XcmExecutor, traits::JustTry}; @@ -93,6 +93,7 @@ impl pallet_uniques::Config for Runtime { type ClassId = u32; type InstanceId = u32; type Currency = Balances; + type CreateOrigin = AsEnsureOriginWithArg>; type ForceOrigin = frame_system::EnsureRoot; type ClassDeposit = frame_support::traits::ConstU128<1_000>; type InstanceDeposit = frame_support::traits::ConstU128<1_000>; @@ -103,6 +104,8 @@ impl pallet_uniques::Config for Runtime { type KeyLimit = frame_support::traits::ConstU32<64>; type ValueLimit = frame_support::traits::ConstU32<128>; type WeightInfo = (); + #[cfg(feature = "runtime-benchmarks")] + type Helper = (); } impl shared::Config for Runtime {} @@ -119,15 +122,18 @@ parameter_types! { pub UnitWeightCost: Weight = 1_000; } -pub type SovereignAccountOf = - (ChildParachainConvertsVia, AccountId32Aliases); +pub type LocationToAccountId = ( + ChildParachainConvertsVia, + AccountId32Aliases, + Account32Hash<(), AccountId>, +); pub type LocalAssetTransactor = ( - XcmCurrencyAdapter, SovereignAccountOf, AccountId, ()>, + XcmCurrencyAdapter, LocationToAccountId, AccountId, ()>, NonFungiblesAdapter< Uniques, - ConvertedConcreteAssetId, JustTry>, - SovereignAccountOf, + ConvertedConcreteId, JustTry>, + LocationToAccountId, AccountId, Nothing, (), @@ -135,7 +141,7 @@ pub type LocalAssetTransactor = ( ); type LocalOriginConverter = ( - SovereignSignedViaLocation, + SovereignSignedViaLocation, ChildParachainAsNative, SignedAccountId32AsNative, ChildSystemParachainAsSuperuser, @@ -197,7 +203,7 @@ impl pallet_xcm::Config for Runtime { type Currency = Balances; type CurrencyMatcher = (); type TrustedLockers = (); - type SovereignAccountOf = SovereignAccountOf; + type SovereignAccountOf = LocationToAccountId; type MaxLockers = frame_support::traits::ConstU32<8>; } From dabab366ce198d446e20c61a00723a8fea87aa71 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 23 Feb 2022 14:40:55 +0000 Subject: [PATCH 04/17] Formatting --- xcm/pallet-xcm/src/lib.rs | 2 +- xcm/src/v2/mod.rs | 6 +- xcm/src/v3/junction.rs | 12 +- xcm/src/v3/junctions.rs | 4 +- xcm/src/v3/mod.rs | 6 +- xcm/src/v3/multiasset.rs | 8 +- xcm/src/v3/multilocation.rs | 4 +- xcm/xcm-builder/src/asset_conversion.rs | 4 +- xcm/xcm-builder/src/filter_asset_location.rs | 6 +- xcm/xcm-builder/src/fungibles_adapter.rs | 4 +- xcm/xcm-builder/src/lib.rs | 5 +- xcm/xcm-builder/src/matches_token.rs | 11 +- xcm/xcm-builder/src/nonfungibles_adapter.rs | 6 +- xcm/xcm-builder/src/tests/basic.rs | 5 +- xcm/xcm-executor/src/config.rs | 4 +- xcm/xcm-executor/src/lib.rs | 4 +- .../src/traits/filter_asset_location.rs | 4 +- xcm/xcm-executor/src/traits/mod.rs | 4 +- xcm/xcm-simulator/example/src/lib.rs | 105 ++++++++++-------- xcm/xcm-simulator/example/src/parachain.rs | 33 +++--- xcm/xcm-simulator/example/src/relay_chain.rs | 14 +-- 21 files changed, 143 insertions(+), 108 deletions(-) diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index 0fc8cc344fc5..c31bcc7c7c07 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -25,7 +25,7 @@ mod tests; use codec::{Decode, Encode, EncodeLike}; use frame_support::traits::{ - Contains, Currency, Defensive, EnsureOrigin, Get, LockableCurrency, OriginTrait, ContainsPair, + Contains, ContainsPair, Currency, Defensive, EnsureOrigin, Get, LockableCurrency, OriginTrait, }; use scale_info::TypeInfo; use sp_runtime::{ diff --git a/xcm/src/v2/mod.rs b/xcm/src/v2/mod.rs index f34610fb8d56..813d0e95d15a 100644 --- a/xcm/src/v2/mod.rs +++ b/xcm/src/v2/mod.rs @@ -1026,8 +1026,10 @@ mod tests { #[test] fn basic_roundtrip_works() { - let xcm = - Xcm::<()>(vec![TransferAsset { assets: (Here, 1u128).into(), beneficiary: Here.into() }]); + let xcm = Xcm::<()>(vec![TransferAsset { + assets: (Here, 1u128).into(), + beneficiary: Here.into(), + }]); let old_xcm = OldXcm::<()>::TransferAsset { assets: (Here, 1u128).into(), beneficiary: Here.into() }; assert_eq!(old_xcm, OldXcm::<()>::try_from(xcm.clone()).unwrap()); diff --git a/xcm/src/v3/junction.rs b/xcm/src/v3/junction.rs index 7a94330feb6f..e778df963591 100644 --- a/xcm/src/v3/junction.rs +++ b/xcm/src/v3/junction.rs @@ -71,7 +71,9 @@ impl From for Option { } /// An identifier of a pluralistic body. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive( + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen, +)] pub enum BodyId { /// The only body in its context. Unit, @@ -115,7 +117,9 @@ impl TryFrom for BodyId { } /// A part of a pluralistic body. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive( + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen, +)] pub enum BodyPart { /// The body's declaration, under whatever means it decides. Voice, @@ -176,7 +180,9 @@ impl TryFrom for BodyPart { /// A single item in a path to describe the relative location of a consensus system. /// /// Each item assumes a pre-existing location as its context and is defined in terms of it. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive( + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen, +)] pub enum Junction { /// An indexed parachain belonging to and operated by the context. /// diff --git a/xcm/src/v3/junctions.rs b/xcm/src/v3/junctions.rs index aefd53a37e07..d958478ac50d 100644 --- a/xcm/src/v3/junctions.rs +++ b/xcm/src/v3/junctions.rs @@ -29,7 +29,9 @@ pub(crate) const MAX_JUNCTIONS: usize = 8; /// /// Parent junctions cannot be constructed with this type. Refer to `MultiLocation` for /// instructions on constructing parent junctions. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive( + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen, +)] pub enum Junctions { /// The interpreting consensus system. Here, diff --git a/xcm/src/v3/mod.rs b/xcm/src/v3/mod.rs index e713b13ce214..1e92ea4d79a1 100644 --- a/xcm/src/v3/mod.rs +++ b/xcm/src/v3/mod.rs @@ -1220,8 +1220,10 @@ mod tests { #[test] fn basic_roundtrip_works() { - let xcm = - Xcm::<()>(vec![TransferAsset { assets: (Here, 1u128).into(), beneficiary: Here.into() }]); + let xcm = Xcm::<()>(vec![TransferAsset { + assets: (Here, 1u128).into(), + beneficiary: Here.into(), + }]); let old_xcm = OldXcm::<()>(vec![OldInstruction::TransferAsset { assets: (OldHere, 1).into(), beneficiary: OldHere.into(), diff --git a/xcm/src/v3/multiasset.rs b/xcm/src/v3/multiasset.rs index a6e5ac943d32..54397e04d196 100644 --- a/xcm/src/v3/multiasset.rs +++ b/xcm/src/v3/multiasset.rs @@ -39,7 +39,9 @@ use parity_scale_codec::{self as codec, Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; /// A general identifier for an instance of a non-fungible asset class. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive( + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo, MaxEncodedLen, +)] pub enum AssetInstance { /// Undefined - used if the non-fungible asset class has only one instance. Undefined, @@ -291,7 +293,9 @@ impl TryFrom for WildFungibility { } /// Classification of an asset being concrete or abstract. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)] +#[derive( + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Encode, Decode, TypeInfo, MaxEncodedLen, +)] pub enum AssetId { Concrete(MultiLocation), Abstract([u8; 32]), diff --git a/xcm/src/v3/multilocation.rs b/xcm/src/v3/multilocation.rs index cfa8cdeb07a6..f5d9256aacc3 100644 --- a/xcm/src/v3/multilocation.rs +++ b/xcm/src/v3/multilocation.rs @@ -51,7 +51,9 @@ use scale_info::TypeInfo; /// that a value is strictly an interior location, in those cases, `Junctions` may be used. /// /// The `MultiLocation` value of `Null` simply refers to the interpreting consensus system. -#[derive(Copy, Clone, Decode, Encode, Eq, PartialEq, Ord, PartialOrd, Debug, TypeInfo, MaxEncodedLen)] +#[derive( + Copy, Clone, Decode, Encode, Eq, PartialEq, Ord, PartialOrd, Debug, TypeInfo, MaxEncodedLen, +)] pub struct MultiLocation { /// The number of parent junctions at the beginning of this `MultiLocation`. pub parents: u8, diff --git a/xcm/xcm-builder/src/asset_conversion.rs b/xcm/xcm-builder/src/asset_conversion.rs index bc1145dc0d1a..dacc94cebb95 100644 --- a/xcm/xcm-builder/src/asset_conversion.rs +++ b/xcm/xcm-builder/src/asset_conversion.rs @@ -19,9 +19,7 @@ use frame_support::traits::Get; use sp_std::{borrow::Borrow, marker::PhantomData, prelude::*, result}; use xcm::latest::prelude::*; -use xcm_executor::traits::{ - Convert, Error as MatchError, MatchesFungibles, MatchesNonFungibles, -}; +use xcm_executor::traits::{Convert, Error as MatchError, MatchesFungibles, MatchesNonFungibles}; /// Converter struct implementing `AssetIdConversion` converting a numeric asset ID (must be `TryFrom/TryInto`) into /// a `GeneralIndex` junction, prefixed by some `MultiLocation` value. The `MultiLocation` value will typically be a diff --git a/xcm/xcm-builder/src/filter_asset_location.rs b/xcm/xcm-builder/src/filter_asset_location.rs index 9aa26f6d5cfe..921172a56bf2 100644 --- a/xcm/xcm-builder/src/filter_asset_location.rs +++ b/xcm/xcm-builder/src/filter_asset_location.rs @@ -16,7 +16,7 @@ //! Various implementations of `FilterAssetLocation`. -use frame_support::traits::{Get, ContainsPair}; +use frame_support::traits::{ContainsPair, Get}; use sp_std::marker::PhantomData; use xcm::latest::{AssetId::Concrete, MultiAsset, MultiAssetFilter, MultiLocation}; @@ -31,7 +31,9 @@ impl ContainsPair for NativeAsset { /// Accepts an asset if it is contained in the given `T`'s `Get` implementation. pub struct Case(PhantomData); -impl> ContainsPair for Case { +impl> ContainsPair + for Case +{ fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { log::trace!(target: "xcm::contains", "Case asset: {:?}, origin: {:?}", asset, origin); let (a, o) = T::get(); diff --git a/xcm/xcm-builder/src/fungibles_adapter.rs b/xcm/xcm-builder/src/fungibles_adapter.rs index 7a6b0a014162..c5e17bbdc2c2 100644 --- a/xcm/xcm-builder/src/fungibles_adapter.rs +++ b/xcm/xcm-builder/src/fungibles_adapter.rs @@ -19,9 +19,7 @@ use frame_support::traits::{tokens::fungibles, Contains, Get}; use sp_std::{marker::PhantomData, prelude::*, result}; use xcm::latest::prelude::*; -use xcm_executor::traits::{ - Convert, Error as MatchError, MatchesFungibles, TransactAsset, -}; +use xcm_executor::traits::{Convert, Error as MatchError, MatchesFungibles, TransactAsset}; pub struct FungiblesTransferAdapter( PhantomData<(Assets, Matcher, AccountIdConverter, AccountId)>, diff --git a/xcm/xcm-builder/src/lib.rs b/xcm/xcm-builder/src/lib.rs index 2b97464dff10..e69dfbfbc6af 100644 --- a/xcm/xcm-builder/src/lib.rs +++ b/xcm/xcm-builder/src/lib.rs @@ -41,13 +41,10 @@ pub use origin_conversion::{ }; mod asset_conversion; -pub use asset_conversion::{ - AsPrefixedGeneralIndex, ConvertedAbstractId, ConvertedConcreteId, -}; +pub use asset_conversion::{AsPrefixedGeneralIndex, ConvertedAbstractId, ConvertedConcreteId}; #[allow(deprecated)] pub use asset_conversion::{ConvertedAbstractAssetId, ConvertedConcreteAssetId}; - mod barriers; pub use barriers::{ AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, diff --git a/xcm/xcm-builder/src/matches_token.rs b/xcm/xcm-builder/src/matches_token.rs index a92db842b088..cce4f06b4416 100644 --- a/xcm/xcm-builder/src/matches_token.rs +++ b/xcm/xcm-builder/src/matches_token.rs @@ -17,12 +17,15 @@ //! Various implementations for the `MatchesFungible` trait. use frame_support::traits::Get; -use sp_std::{convert::{TryFrom, TryInto}, marker::PhantomData}; +use sp_std::{ + convert::{TryFrom, TryInto}, + marker::PhantomData, +}; use xcm::latest::{ AssetId::{Abstract, Concrete}, - Fungibility::Fungible, - Fungibility::NonFungible, - AssetInstance, MultiAsset, MultiLocation, + AssetInstance, + Fungibility::{Fungible, NonFungible}, + MultiAsset, MultiLocation, }; use xcm_executor::traits::{MatchesFungible, MatchesNonFungible}; diff --git a/xcm/xcm-builder/src/nonfungibles_adapter.rs b/xcm/xcm-builder/src/nonfungibles_adapter.rs index b489422b2557..61c4f6730ddc 100644 --- a/xcm/xcm-builder/src/nonfungibles_adapter.rs +++ b/xcm/xcm-builder/src/nonfungibles_adapter.rs @@ -16,11 +16,13 @@ //! Adapters to work with `frame_support::traits::tokens::fungibles` through XCM. -use frame_support::traits::{tokens::nonfungibles, Contains, Get}; +use frame_support::{ + ensure, + traits::{tokens::nonfungibles, Contains, Get}, +}; use sp_std::{marker::PhantomData, prelude::*, result}; use xcm::latest::prelude::*; use xcm_executor::traits::{Convert, Error as MatchError, MatchesNonFungibles, TransactAsset}; -use frame_support::ensure; pub struct NonFungiblesTransferAdapter( PhantomData<(Assets, Matcher, AccountIdConverter, AccountId)>, diff --git a/xcm/xcm-builder/src/tests/basic.rs b/xcm/xcm-builder/src/tests/basic.rs index 60a63e42dd69..91945e2fb9da 100644 --- a/xcm/xcm-builder/src/tests/basic.rs +++ b/xcm/xcm-builder/src/tests/basic.rs @@ -19,10 +19,7 @@ use super::*; #[test] fn basic_setup_works() { add_reserve(Parent.into(), Wild((Parent, WildFungible).into())); - assert!(::IsReserve::contains( - &(Parent, 100).into(), - &Parent.into(), - )); + assert!(::IsReserve::contains(&(Parent, 100).into(), &Parent.into(),)); assert_eq!(to_account(Parachain(1)), Ok(1001)); assert_eq!(to_account(Parachain(50)), Ok(1050)); diff --git a/xcm/xcm-executor/src/config.rs b/xcm/xcm-executor/src/config.rs index bd2870a0e2d0..23cc7e885764 100644 --- a/xcm/xcm-executor/src/config.rs +++ b/xcm/xcm-executor/src/config.rs @@ -16,8 +16,8 @@ use crate::traits::{ AssetExchange, AssetLock, ClaimAssets, ConvertOrigin, DropAssets, ExportXcm, FeeManager, - OnResponse, ShouldExecute, TransactAsset, UniversalLocation, - VersionChangeNotifier, WeightBounds, WeightTrader, + OnResponse, ShouldExecute, TransactAsset, UniversalLocation, VersionChangeNotifier, + WeightBounds, WeightTrader, }; use frame_support::{ dispatch::{Dispatchable, Parameter}, diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index cc54126819ef..0c39cc3e3315 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -31,8 +31,8 @@ use xcm::latest::prelude::*; pub mod traits; use traits::{ validate_export, AssetExchange, AssetLock, ClaimAssets, ConvertOrigin, DropAssets, Enact, - ExportXcm, FeeManager, FeeReason, OnResponse, ShouldExecute, - TransactAsset, UniversalLocation, VersionChangeNotifier, WeightBounds, WeightTrader, + ExportXcm, FeeManager, FeeReason, OnResponse, ShouldExecute, TransactAsset, UniversalLocation, + VersionChangeNotifier, WeightBounds, WeightTrader, }; mod assets; diff --git a/xcm/xcm-executor/src/traits/filter_asset_location.rs b/xcm/xcm-executor/src/traits/filter_asset_location.rs index 1150786697ab..ec9fecbab640 100644 --- a/xcm/xcm-executor/src/traits/filter_asset_location.rs +++ b/xcm/xcm-executor/src/traits/filter_asset_location.rs @@ -14,8 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use xcm::latest::{MultiAsset, MultiLocation}; use frame_support::traits::ContainsPair; +use xcm::latest::{MultiAsset, MultiLocation}; /// Filters assets/location pairs. /// @@ -31,4 +31,4 @@ impl> FilterAssetLocation for T { fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { T::contains(asset, origin) } -} \ No newline at end of file +} diff --git a/xcm/xcm-executor/src/traits/mod.rs b/xcm/xcm-executor/src/traits/mod.rs index 880364871a1a..9ac718bbd644 100644 --- a/xcm/xcm-executor/src/traits/mod.rs +++ b/xcm/xcm-executor/src/traits/mod.rs @@ -34,7 +34,9 @@ mod filter_asset_location; #[allow(deprecated)] pub use filter_asset_location::FilterAssetLocation; mod token_matching; -pub use token_matching::{Error, MatchesFungibles, MatchesFungible, MatchesNonFungibles, MatchesNonFungible}; +pub use token_matching::{ + Error, MatchesFungible, MatchesFungibles, MatchesNonFungible, MatchesNonFungibles, +}; mod on_response; pub use on_response::{OnResponse, VersionChangeNotifier}; mod should_execute; diff --git a/xcm/xcm-simulator/example/src/lib.rs b/xcm/xcm-simulator/example/src/lib.rs index 1fe677037375..9467ea76d756 100644 --- a/xcm/xcm-simulator/example/src/lib.rs +++ b/xcm/xcm-simulator/example/src/lib.rs @@ -17,10 +17,10 @@ mod parachain; mod relay_chain; -use xcm_executor::traits::Convert; +use frame_support::sp_tracing; use xcm::prelude::*; +use xcm_executor::traits::Convert; use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; -use frame_support::sp_tracing; pub const ALICE: sp_runtime::AccountId32 = sp_runtime::AccountId32::new([0u8; 32]); pub const INITIAL_BALANCE: u128 = 1_000_000_000; @@ -86,7 +86,6 @@ pub fn parent_account_account_id(who: sp_runtime::AccountId32) -> parachain::Acc parachain::LocationToAccountId::convert(location.into()).unwrap() } - pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { use parachain::{MsgQueue, Runtime, System}; @@ -95,8 +94,8 @@ pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { pallet_balances::GenesisConfig:: { balances: vec![(ALICE, INITIAL_BALANCE), (parent_account_id(), INITIAL_BALANCE)], } - .assimilate_storage(&mut t) - .unwrap(); + .assimilate_storage(&mut t) + .unwrap(); let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| { @@ -108,7 +107,7 @@ pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { } pub fn relay_ext() -> sp_io::TestExternalities { - use relay_chain::{Runtime, System, Uniques, Origin}; + use relay_chain::{Origin, Runtime, System, Uniques}; let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); @@ -276,12 +275,10 @@ mod tests { }); ParaA::execute_with(|| { - let message = Xcm(vec![ - TransferAsset { - assets: (GeneralIndex(1), 42u32).into(), - beneficiary: Parachain(2).into(), - }, - ]); + let message = Xcm(vec![TransferAsset { + assets: (GeneralIndex(1), 42u32).into(), + beneficiary: Parachain(2).into(), + }]); // Send withdraw and deposit assert_ok!(ParachainPalletXcm::send_xcm(Here, Parent, message)); }); @@ -309,7 +306,10 @@ mod tests { )); // The parachain#1 alias of Alice is what must hold it on the Relay-chain for it to be // withdrawable by Alice on the parachain. - assert_eq!(relay_chain::Uniques::owner(1, 69), Some(child_account_account_id(1, ALICE))); + assert_eq!( + relay_chain::Uniques::owner(1, 69), + Some(child_account_account_id(1, ALICE)) + ); }); ParaA::execute_with(|| { assert_ok!(parachain::ForeignUniques::force_create( @@ -331,12 +331,10 @@ mod tests { InitiateTeleport { assets: AllCounted(1).into(), dest: Parachain(1).into(), - xcm: Xcm(vec![ - DepositAsset { - assets: AllCounted(1).into(), - beneficiary: (AccountId32 { id: ALICE.into(), network: None },).into(), - } - ]), + xcm: Xcm(vec![DepositAsset { + assets: AllCounted(1).into(), + beneficiary: (AccountId32 { id: ALICE.into(), network: None },).into(), + }]), }, ]); // Send teleport @@ -366,14 +364,22 @@ mod tests { MockNet::reset(); Relay::execute_with(|| { - assert_ok!(relay_chain::Uniques::force_create(relay_chain::Origin::root(), 2, ALICE, false)); + assert_ok!(relay_chain::Uniques::force_create( + relay_chain::Origin::root(), + 2, + ALICE, + false + )); assert_ok!(relay_chain::Uniques::mint( relay_chain::Origin::signed(ALICE), 2, 69, child_account_account_id(1, ALICE) )); - assert_eq!(relay_chain::Uniques::owner(2, 69), Some(child_account_account_id(1, ALICE))); + assert_eq!( + relay_chain::Uniques::owner(2, 69), + Some(child_account_account_id(1, ALICE)) + ); }); ParaA::execute_with(|| { assert_ok!(parachain::ForeignUniques::force_create( @@ -393,12 +399,10 @@ mod tests { DepositReserveAsset { assets: AllCounted(1).into(), dest: Parachain(1).into(), - xcm: Xcm(vec![ - DepositAsset { - assets: AllCounted(1).into(), - beneficiary: (AccountId32 { id: ALICE.into(), network: None },).into(), - } - ]), + xcm: Xcm(vec![DepositAsset { + assets: AllCounted(1).into(), + beneficiary: (AccountId32 { id: ALICE.into(), network: None },).into(), + }]), }, ]); // Send transfer @@ -429,25 +433,33 @@ mod tests { MockNet::reset(); Relay::execute_with(|| { - assert_ok!(relay_chain::Uniques::force_create(relay_chain::Origin::root(), 2, ALICE, false)); + assert_ok!(relay_chain::Uniques::force_create( + relay_chain::Origin::root(), + 2, + ALICE, + false + )); assert_ok!(relay_chain::Uniques::mint( relay_chain::Origin::signed(ALICE), 2, 69, child_account_account_id(1, ALICE) )); - assert_eq!(relay_chain::Uniques::owner(2, 69), Some(child_account_account_id(1, ALICE))); + assert_eq!( + relay_chain::Uniques::owner(2, 69), + Some(child_account_account_id(1, ALICE)) + ); - let message = Xcm(vec![ - Transact { - origin_kind: OriginKind::Xcm, - require_weight_at_most: 1_000_000_000, - call: parachain::Call::from(pallet_uniques::Call::::create { - class: (Parent, 2u64).into(), - admin: parent_account_id(), - }).encode().into(), - }, - ]); + let message = Xcm(vec![Transact { + origin_kind: OriginKind::Xcm, + require_weight_at_most: 1_000_000_000, + call: parachain::Call::from(pallet_uniques::Call::::create { + class: (Parent, 2u64).into(), + admin: parent_account_id(), + }) + .encode() + .into(), + }]); // Send creation. assert_ok!(RelayChainPalletXcm::send_xcm(Here, Parachain(1), message)); }); @@ -458,12 +470,10 @@ mod tests { DepositReserveAsset { assets: AllCounted(1).into(), dest: Parachain(1).into(), - xcm: Xcm(vec![ - DepositAsset { - assets: AllCounted(1).into(), - beneficiary: (AccountId32 { id: ALICE.into(), network: None },).into(), - } - ]), + xcm: Xcm(vec![DepositAsset { + assets: AllCounted(1).into(), + beneficiary: (AccountId32 { id: ALICE.into(), network: None },).into(), + }]), }, ]); let alice = AccountId32 { id: ALICE.into(), network: None }; @@ -471,7 +481,10 @@ mod tests { }); ParaA::execute_with(|| { assert_eq!(parachain::Balances::reserved_balance(&parent_account_id()), 1000); - assert_eq!(parachain::ForeignUniques::class_owner((Parent, 2u64).into()), Some(parent_account_id())); + assert_eq!( + parachain::ForeignUniques::class_owner((Parent, 2u64).into()), + Some(parent_account_id()) + ); }); } diff --git a/xcm/xcm-simulator/example/src/parachain.rs b/xcm/xcm-simulator/example/src/parachain.rs index 4d646f10f456..ac322dddb499 100644 --- a/xcm/xcm-simulator/example/src/parachain.rs +++ b/xcm/xcm-simulator/example/src/parachain.rs @@ -19,10 +19,7 @@ use codec::{Decode, Encode}; use frame_support::{ construct_runtime, parameter_types, - traits::{ - Everything, EverythingBut, Nothing, EnsureOriginWithArg, - EnsureOrigin, - }, + traits::{EnsureOrigin, EnsureOriginWithArg, Everything, EverythingBut, Nothing}, weights::{constants::WEIGHT_PER_SECOND, Weight}, }; use sp_core::H256; @@ -40,13 +37,16 @@ use polkadot_parachain::primitives::{ }; use xcm::{latest::prelude::*, VersionedXcm}; use xcm_builder::{ - AccountId32Aliases, AllowUnpaidExecutionFrom, CurrencyAdapter as XcmCurrencyAdapter, - EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, IsConcrete, LocationInverter, - NativeAsset, ParentIsPreset, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, NonFungiblesAdapter, ConvertedConcreteId, - Account32Hash, + Account32Hash, AccountId32Aliases, AllowUnpaidExecutionFrom, ConvertedConcreteId, + CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, + IsConcrete, LocationInverter, NativeAsset, NonFungiblesAdapter, ParentIsPreset, + SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, + SovereignSignedViaLocation, +}; +use xcm_executor::{ + traits::{Convert, JustTry}, + Config, XcmExecutor, }; -use xcm_executor::{Config, XcmExecutor, traits::{JustTry, Convert}}; pub type SovereignAccountOf = ( SiblingParachainConvertsVia, @@ -110,8 +110,12 @@ impl pallet_balances::Config for Runtime { pub struct UniquesHelper; #[cfg(feature = "runtime-benchmarks")] impl pallet_uniques::BenchmarkHelper for UniquesHelper { - fn class(i: u16) -> MultiLocation { GeneralIndex(i as u128).into() } - fn instance(i: u16) -> AssetInstance { AssetInstance::Index(i as u128) } + fn class(i: u16) -> MultiLocation { + GeneralIndex(i as u128).into() + } + fn instance(i: u16) -> AssetInstance { + AssetInstance::Index(i as u128) + } } impl pallet_uniques::Config for Runtime { @@ -142,7 +146,9 @@ impl EnsureOriginWithArg for ForeignCreators { fn try_origin(o: Origin, a: &MultiLocation) -> sp_std::result::Result { let origin_location = pallet_xcm::EnsureXcm::::try_origin(o.clone())?; - if !a.starts_with(&origin_location) { return Err(o) } + if !a.starts_with(&origin_location) { + return Err(o) + } SovereignAccountOf::convert(origin_location).map_err(|_| o) } @@ -152,7 +158,6 @@ impl EnsureOriginWithArg for ForeignCreators { } } - parameter_types! { pub const ReservedXcmpWeight: Weight = WEIGHT_PER_SECOND / 4; pub const ReservedDmpWeight: Weight = WEIGHT_PER_SECOND / 4; diff --git a/xcm/xcm-simulator/example/src/relay_chain.rs b/xcm/xcm-simulator/example/src/relay_chain.rs index a32786a3b199..738bf1497118 100644 --- a/xcm/xcm-simulator/example/src/relay_chain.rs +++ b/xcm/xcm-simulator/example/src/relay_chain.rs @@ -18,7 +18,7 @@ use frame_support::{ construct_runtime, parameter_types, - traits::{Everything, Nothing, AsEnsureOriginWithArg}, + traits::{AsEnsureOriginWithArg, Everything, Nothing}, weights::Weight, }; use sp_core::H256; @@ -28,13 +28,13 @@ use polkadot_parachain::primitives::Id as ParaId; use polkadot_runtime_parachains::{configuration, origin, shared, ump}; use xcm::latest::prelude::*; use xcm_builder::{ - AccountId32Aliases, AllowUnpaidExecutionFrom, ChildParachainAsNative, - ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, - CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, FixedWeightBounds, IsConcrete, - LocationInverter, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, - NonFungiblesAdapter, AsPrefixedGeneralIndex, ConvertedConcreteId, Account32Hash, + Account32Hash, AccountId32Aliases, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex, + ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, + ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, + FixedWeightBounds, IsConcrete, LocationInverter, NonFungiblesAdapter, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, }; -use xcm_executor::{Config, XcmExecutor, traits::JustTry}; +use xcm_executor::{traits::JustTry, Config, XcmExecutor}; pub type AccountId = AccountId32; pub type Balance = u128; From 9b3343f043ea4c9bffd99c54fbe4835664575f46 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 23 Feb 2022 16:15:49 +0000 Subject: [PATCH 05/17] Broken Cargo features --- xcm/xcm-simulator/example/Cargo.toml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/xcm/xcm-simulator/example/Cargo.toml b/xcm/xcm-simulator/example/Cargo.toml index 0cfe242e6255..cb8de354ed0f 100644 --- a/xcm/xcm-simulator/example/Cargo.toml +++ b/xcm/xcm-simulator/example/Cargo.toml @@ -30,10 +30,16 @@ polkadot-runtime-parachains = { path = "../../../runtime/parachains" } polkadot-parachain = { path = "../../../parachain" } [features] -default = ["runtime-benchmarks"] +default = [] runtime-benchmarks = [ - "frame-support/runtime-benchmarks", - "pallet-uniques/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-uniques/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", + "xcm/runtime-benchmarks", + "polkadot-runtime-parachains/runtime-benchmarks", + "polkadot-parachain/runtime-benchmarks", ] From 88cbcc599eb7f91ee8828d6d5c38473cc801692b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Wed, 23 Feb 2022 21:09:01 +0100 Subject: [PATCH 06/17] Use 2021 edition --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 885dc830204b..5a4aaa9c35f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ description = "Implementation of a `https://polkadot.network` node in Rust based license = "GPL-3.0-only" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" rust-version = "1.57.0" # custom profiles readme = "README.md" From b2f53bbd8ef48549fce05274ad42221527b1c90b Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 25 Feb 2022 15:16:35 +0000 Subject: [PATCH 07/17] Fixes --- Cargo.lock | 164 +------------- runtime/kusama/src/xcm_config.rs | 4 +- runtime/polkadot/src/xcm_config.rs | 4 +- .../src/generic/benchmarking.rs | 2 +- xcm/pallet-xcm-benchmarks/src/mock.rs | 5 +- xcm/src/v3/multiasset.rs | 7 + xcm/xcm-builder/src/filter_asset_location.rs | 2 +- xcm/xcm-builder/src/tests/assets.rs | 208 +++++++++--------- xcm/xcm-builder/src/tests/basic.rs | 20 +- xcm/xcm-builder/src/tests/bridging/mod.rs | 2 +- .../tests/bridging/paid_remote_relay_relay.rs | 14 +- xcm/xcm-builder/src/tests/locking.rs | 58 ++--- xcm/xcm-builder/src/tests/mock.rs | 7 +- xcm/xcm-builder/src/tests/mod.rs | 4 +- xcm/xcm-builder/src/tests/origins.rs | 10 +- xcm/xcm-builder/src/tests/querying.rs | 2 +- xcm/xcm-builder/src/tests/transacting.rs | 8 +- xcm/xcm-builder/src/tests/weight.rs | 16 +- xcm/xcm-executor/src/traits/mod.rs | 10 + 19 files changed, 201 insertions(+), 346 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f60507534de5..0083dec6b58d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -450,7 +450,6 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "beefy-primitives", "fnv", @@ -479,7 +478,6 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -502,12 +500,10 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "scale-info", @@ -2024,7 +2020,6 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", ] @@ -2042,7 +2037,6 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -2064,7 +2058,6 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "Inflector", "chrono", @@ -2091,7 +2084,6 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -2105,7 +2097,6 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -2133,7 +2124,6 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "bitflags", "frame-metadata", @@ -2162,7 +2152,6 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2174,7 +2163,6 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.1.3", @@ -2186,7 +2174,6 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "proc-macro2", "quote", @@ -2196,7 +2183,6 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2219,7 +2205,6 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -2230,7 +2215,6 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "log", @@ -2247,7 +2231,6 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -2262,7 +2245,6 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "sp-api", @@ -2271,7 +2253,6 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "sp-api", @@ -2467,7 +2448,6 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "chrono", "frame-election-provider-support", @@ -4913,7 +4893,6 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -4927,7 +4906,6 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -4943,7 +4921,6 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -4958,7 +4935,6 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -4982,7 +4958,6 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5002,7 +4977,6 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-election-provider-support", "frame-support", @@ -5022,7 +4996,6 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5037,7 +5010,6 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "beefy-primitives", "frame-support", @@ -5053,7 +5025,6 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -5078,7 +5049,6 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5162,7 +5132,6 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5179,7 +5148,6 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5195,7 +5163,6 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5218,7 +5185,6 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5236,7 +5202,6 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5251,7 +5216,6 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5274,7 +5238,6 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5290,7 +5253,6 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5310,7 +5272,6 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5327,7 +5288,6 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5344,7 +5304,6 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5362,7 +5321,6 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -5378,7 +5336,6 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5395,7 +5352,6 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5410,7 +5366,6 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -5424,7 +5379,6 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -5441,7 +5395,6 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5464,7 +5417,6 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5480,7 +5432,6 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5495,7 +5446,6 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -5509,7 +5459,6 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5525,7 +5474,6 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -5546,7 +5494,6 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5562,7 +5509,6 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -5576,7 +5522,6 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5599,7 +5544,6 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -5610,7 +5554,6 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "log", "sp-arithmetic", @@ -5619,7 +5562,6 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -5633,7 +5575,6 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5651,7 +5592,6 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5670,7 +5610,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-support", "frame-system", @@ -5687,7 +5626,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5704,7 +5642,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5715,7 +5652,6 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5746,7 +5682,6 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -5762,7 +5697,6 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-benchmarking", "frame-support", @@ -8212,7 +8146,6 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "env_logger 0.9.0", "jsonrpsee 0.8.0", @@ -8559,7 +8492,6 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "log", "sp-core", @@ -8570,7 +8502,6 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "futures 0.3.21", @@ -8597,7 +8528,6 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "futures-timer", @@ -8620,7 +8550,6 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8636,7 +8565,6 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8653,7 +8581,6 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -8664,7 +8591,6 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "chrono", "clap", @@ -8702,7 +8628,6 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "fnv", "futures 0.3.21", @@ -8730,7 +8655,6 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "hash-db", "kvdb", @@ -8755,7 +8679,6 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "futures 0.3.21", @@ -8779,7 +8702,6 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "fork-tree", @@ -8822,7 +8744,6 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -8846,7 +8767,6 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8859,7 +8779,6 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "futures 0.3.21", @@ -8884,7 +8803,6 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "sc-client-api", "sp-authorship", @@ -8895,7 +8813,6 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "lazy_static", "libsecp256k1", @@ -8923,7 +8840,6 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "environmental", "parity-scale-codec", @@ -8940,7 +8856,6 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "log", "parity-scale-codec", @@ -8956,7 +8871,6 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8974,7 +8888,6 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "ahash", "async-trait", @@ -9013,7 +8926,6 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "finality-grandpa", "futures 0.3.21", @@ -9037,7 +8949,6 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "ansi_term", "futures 0.3.21", @@ -9054,7 +8965,6 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "hex", @@ -9069,7 +8979,6 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "asynchronous-codec 0.5.0", @@ -9118,7 +9027,6 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "ahash", "futures 0.3.21", @@ -9135,7 +9043,6 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "bytes 1.1.0", "fnv", @@ -9163,7 +9070,6 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "libp2p", @@ -9176,7 +9082,6 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9185,7 +9090,6 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "hash-db", @@ -9216,7 +9120,6 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9241,7 +9144,6 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9258,7 +9160,6 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "directories", @@ -9322,7 +9223,6 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "log", "parity-scale-codec", @@ -9336,7 +9236,6 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -9357,7 +9256,6 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "chrono", "futures 0.3.21", @@ -9375,7 +9273,6 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "ansi_term", "atty", @@ -9406,7 +9303,6 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -9417,7 +9313,6 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9444,7 +9339,6 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "log", @@ -9457,7 +9351,6 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9933,7 +9826,6 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "hash-db", "log", @@ -9950,7 +9842,6 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "blake2 0.10.2", "proc-macro-crate 1.1.3", @@ -9962,7 +9853,6 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "scale-info", @@ -9975,7 +9865,6 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "integer-sqrt", "num-traits", @@ -9990,7 +9879,6 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "scale-info", @@ -10003,7 +9891,6 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "parity-scale-codec", @@ -10015,7 +9902,6 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "sp-api", @@ -10027,7 +9913,6 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "log", @@ -10045,7 +9930,6 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "futures 0.3.21", @@ -10064,7 +9948,6 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "merlin", @@ -10087,7 +9970,6 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "scale-info", @@ -10101,7 +9983,6 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -10113,7 +9994,6 @@ dependencies = [ [[package]] name = "sp-core" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "base58", "bitflags", @@ -10158,7 +10038,6 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "blake2 0.10.2", "byteorder", @@ -10172,7 +10051,6 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "proc-macro2", "quote", @@ -10183,7 +10061,6 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "kvdb", "parking_lot 0.12.0", @@ -10192,7 +10069,6 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "proc-macro2", "quote", @@ -10202,7 +10078,6 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "environmental", "parity-scale-codec", @@ -10213,7 +10088,6 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "finality-grandpa", "log", @@ -10231,7 +10105,6 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10245,7 +10118,6 @@ dependencies = [ [[package]] name = "sp-io" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "hash-db", @@ -10269,7 +10141,6 @@ dependencies = [ [[package]] name = "sp-keyring" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "lazy_static", "sp-core", @@ -10280,7 +10151,6 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "futures 0.3.21", @@ -10297,7 +10167,6 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "thiserror", "zstd", @@ -10306,7 +10175,6 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "scale-info", @@ -10321,7 +10189,6 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -10332,7 +10199,6 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "sp-api", "sp-core", @@ -10342,7 +10208,6 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "backtrace", "lazy_static", @@ -10352,7 +10217,6 @@ dependencies = [ [[package]] name = "sp-rpc" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "rustc-hash", "serde", @@ -10362,7 +10226,6 @@ dependencies = [ [[package]] name = "sp-runtime" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "either", "hash256-std-hasher", @@ -10384,7 +10247,6 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10401,7 +10263,6 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "Inflector", "proc-macro-crate 1.1.3", @@ -10413,7 +10274,6 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "serde", "serde_json", @@ -10422,7 +10282,6 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "scale-info", @@ -10436,7 +10295,6 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "scale-info", @@ -10447,7 +10305,6 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "hash-db", "log", @@ -10470,12 +10327,10 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" [[package]] name = "sp-storage" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10488,7 +10343,6 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "log", "sp-core", @@ -10501,7 +10355,6 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "futures-timer", @@ -10517,7 +10370,6 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "sp-std", @@ -10529,7 +10381,6 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "sp-api", "sp-runtime", @@ -10538,7 +10389,6 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "log", @@ -10554,7 +10404,6 @@ dependencies = [ [[package]] name = "sp-trie" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "hash-db", "memory-db", @@ -10569,7 +10418,6 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10586,7 +10434,6 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10597,7 +10444,6 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "impl-trait-for-tuples", "log", @@ -10797,7 +10643,6 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "platforms", ] @@ -10805,7 +10650,6 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.21", @@ -10827,7 +10671,6 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures-util", "hyper", @@ -10840,7 +10683,6 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "async-trait", "futures 0.3.21", @@ -10866,7 +10708,6 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "futures 0.3.21", "substrate-test-utils-derive", @@ -10876,7 +10717,6 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -10887,7 +10727,6 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "ansi_term", "build-helper", @@ -11506,7 +11345,6 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#c22fce5a311beede13479c9a00cca85d823b6b00" dependencies = [ "clap", "jsonrpsee 0.4.1", @@ -11573,7 +11411,7 @@ version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.2", "rand 0.8.5", "static_assertions", diff --git a/runtime/kusama/src/xcm_config.rs b/runtime/kusama/src/xcm_config.rs index aab416f7f33d..8adb87b804a6 100644 --- a/runtime/kusama/src/xcm_config.rs +++ b/runtime/kusama/src/xcm_config.rs @@ -21,7 +21,7 @@ use super::{ Origin, ParaId, Runtime, WeightToFee, XcmPallet, }; use frame_support::{ - match_type, parameter_types, + match_types, parameter_types, traits::{Everything, Nothing}, weights::Weight, }; @@ -114,7 +114,7 @@ parameter_types! { pub type TrustedTeleporters = (xcm_builder::Case, xcm_builder::Case); -match_type! { +match_types! { pub type OnlyParachains: impl Contains = { MultiLocation { parents: 0, interior: X1(Parachain(_)) } }; diff --git a/runtime/polkadot/src/xcm_config.rs b/runtime/polkadot/src/xcm_config.rs index 7f67563bf319..d88596847983 100644 --- a/runtime/polkadot/src/xcm_config.rs +++ b/runtime/polkadot/src/xcm_config.rs @@ -21,7 +21,7 @@ use super::{ Origin, ParaId, Runtime, WeightToFee, XcmPallet, }; use frame_support::{ - match_type, parameter_types, + match_types, parameter_types, traits::{Everything, Nothing}, weights::Weight, }; @@ -108,7 +108,7 @@ parameter_types! { pub type TrustedTeleporters = (xcm_builder::Case,); -match_type! { +match_types! { pub type OnlyParachains: impl Contains = { MultiLocation { parents: 0, interior: X1(Parachain(_)) } }; diff --git a/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs index adc2d98a1bb0..2d3b4fe6ff91 100644 --- a/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs @@ -63,7 +63,7 @@ benchmarks! { let fee_asset = Concrete(Here.into()); let instruction = Instruction::>::BuyExecution { - fees: (fee_asset, 100_000_000).into(), // should be something inside of holding + fees: (fee_asset, 100_000_000u128).into(), // should be something inside of holding weight_limit: WeightLimit::Unlimited, }; diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index e295cdbd3026..2fd7d57aa9b4 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -15,8 +15,7 @@ // along with Polkadot. If not, see . use crate::*; -use frame_support::{parameter_types, weights::Weight}; -use xcm_executor::traits::FilterAssetLocation; +use frame_support::{parameter_types, weights::Weight, traits::ContainsPair}; // An xcm sender/receiver akin to > /dev/null pub struct DevNull; @@ -67,7 +66,7 @@ parameter_types! { } pub struct AllAssetLocationsPass; -impl FilterAssetLocation for AllAssetLocationsPass { +impl ContainsPair for AllAssetLocationsPass { fn contains(_: &MultiAsset, _: &MultiLocation) -> bool { true } diff --git a/xcm/src/v3/multiasset.rs b/xcm/src/v3/multiasset.rs index 54397e04d196..c93ac0902789 100644 --- a/xcm/src/v3/multiasset.rs +++ b/xcm/src/v3/multiasset.rs @@ -248,6 +248,13 @@ impl Fungibility { } } +impl From for Fungibility { + fn from(amount: i32) -> Fungibility { + debug_assert_ne!(amount, 0); + Fungibility::Fungible(amount as u128) + } +} + impl From for Fungibility { fn from(amount: u128) -> Fungibility { debug_assert_ne!(amount, 0); diff --git a/xcm/xcm-builder/src/filter_asset_location.rs b/xcm/xcm-builder/src/filter_asset_location.rs index 921172a56bf2..1701988d624b 100644 --- a/xcm/xcm-builder/src/filter_asset_location.rs +++ b/xcm/xcm-builder/src/filter_asset_location.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! Various implementations of `FilterAssetLocation`. +//! Various implementations of `ContainsPair`. use frame_support::traits::{ContainsPair, Get}; use sp_std::marker::PhantomData; diff --git a/xcm/xcm-builder/src/tests/assets.rs b/xcm/xcm-builder/src/tests/assets.rs index e3d4c9ab75fe..7de387aa3c55 100644 --- a/xcm/xcm-builder/src/tests/assets.rs +++ b/xcm/xcm-builder/src/tests/assets.rs @@ -19,79 +19,79 @@ use super::*; #[test] fn exchange_asset_should_work() { AllowUnpaidFrom::set(vec![Parent.into()]); - add_asset(Parent, (Parent, 1000)); - set_exchange_assets(vec![(Here, 100).into()]); + add_asset(Parent, (Parent, 1000u128)); + set_exchange_assets(vec![(Here, 100u128).into()]); let r = XcmExecutor::::execute_xcm( Parent, Xcm(vec![ - WithdrawAsset((Parent, 100).into()), + WithdrawAsset((Parent, 100u128).into()), SetAppendix( vec![DepositAsset { assets: AllCounted(2).into(), beneficiary: Parent.into() }] .into(), ), ExchangeAsset { - give: Definite((Parent, 50).into()), - want: (Here, 50).into(), + give: Definite((Parent, 50u128).into()), + want: (Here, 50u128).into(), maximal: true, }, ]), 50, ); assert_eq!(r, Outcome::Complete(40)); - assert_eq!(asset_list(Parent), vec![(Here, 100).into(), (Parent, 950).into()]); - assert_eq!(exchange_assets(), vec![(Parent, 50).into()].into()); + assert_eq!(asset_list(Parent), vec![(Here, 100u128).into(), (Parent, 950u128).into()]); + assert_eq!(exchange_assets(), vec![(Parent, 50u128).into()].into()); } #[test] fn exchange_asset_without_maximal_should_work() { AllowUnpaidFrom::set(vec![Parent.into()]); add_asset(Parent, (Parent, 1000)); - set_exchange_assets(vec![(Here, 100).into()]); + set_exchange_assets(vec![(Here, 100u128).into()]); let r = XcmExecutor::::execute_xcm( Parent, Xcm(vec![ - WithdrawAsset((Parent, 100).into()), + WithdrawAsset((Parent, 100u128).into()), SetAppendix( vec![DepositAsset { assets: AllCounted(2).into(), beneficiary: Parent.into() }] .into(), ), ExchangeAsset { - give: Definite((Parent, 50).into()), - want: (Here, 50).into(), + give: Definite((Parent, 50u128).into()), + want: (Here, 50u128).into(), maximal: false, }, ]), 50, ); assert_eq!(r, Outcome::Complete(40)); - assert_eq!(asset_list(Parent), vec![(Here, 50).into(), (Parent, 950).into()]); - assert_eq!(exchange_assets(), vec![(Here, 50).into(), (Parent, 50).into()].into()); + assert_eq!(asset_list(Parent), vec![(Here, 50u128).into(), (Parent, 950u128).into()]); + assert_eq!(exchange_assets(), vec![(Here, 50u128).into(), (Parent, 50u128).into()].into()); } #[test] fn exchange_asset_should_fail_when_no_deal_possible() { AllowUnpaidFrom::set(vec![Parent.into()]); add_asset(Parent, (Parent, 1000)); - set_exchange_assets(vec![(Here, 100).into()]); + set_exchange_assets(vec![(Here, 100u128).into()]); let r = XcmExecutor::::execute_xcm( Parent, Xcm(vec![ - WithdrawAsset((Parent, 150).into()), + WithdrawAsset((Parent, 150u128).into()), SetAppendix( vec![DepositAsset { assets: AllCounted(2).into(), beneficiary: Parent.into() }] .into(), ), ExchangeAsset { - give: Definite((Parent, 150).into()), - want: (Here, 150).into(), + give: Definite((Parent, 150u128).into()), + want: (Here, 150u128).into(), maximal: false, }, ]), 50, ); assert_eq!(r, Outcome::Incomplete(40, XcmError::NoDeal)); - assert_eq!(asset_list(Parent), vec![(Parent, 1000).into()]); - assert_eq!(exchange_assets(), vec![(Here, 100).into()].into()); + assert_eq!(asset_list(Parent), vec![(Parent, 1000u128).into()]); + assert_eq!(exchange_assets(), vec![(Here, 100u128).into()].into()); } #[test] @@ -100,16 +100,16 @@ fn paying_reserve_deposit_should_work() { add_reserve(Parent.into(), (Parent, WildFungible).into()); WeightPrice::set((Parent.into(), 1_000_000_000_000)); - let fees = (Parent, 30).into(); + let fees = (Parent, 30u128).into(); let message = Xcm(vec![ - ReserveAssetDeposited((Parent, 100).into()), + ReserveAssetDeposited((Parent, 100u128).into()), BuyExecution { fees, weight_limit: Limited(30) }, DepositAsset { assets: AllCounted(1).into(), beneficiary: Here.into() }, ]); let weight_limit = 50; let r = XcmExecutor::::execute_xcm(Parent, message, weight_limit); assert_eq!(r, Outcome::Complete(30)); - assert_eq!(asset_list(Here), vec![(Parent, 70).into()]); + assert_eq!(asset_list(Here), vec![(Parent, 70u128).into()]); } #[test] @@ -122,14 +122,14 @@ fn transfer_should_work() { let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![TransferAsset { - assets: (Here, 100).into(), + assets: (Here, 100u128).into(), beneficiary: X1(AccountIndex64 { index: 3, network: None }).into(), }]), 50, ); assert_eq!(r, Outcome::Complete(10)); - assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 100).into()]); - assert_eq!(asset_list(Parachain(1)), vec![(Here, 900).into()]); + assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 100u128).into()]); + assert_eq!(asset_list(Parachain(1)), vec![(Here, 900u128).into()]); assert_eq!(sent_xcm(), vec![]); } @@ -146,7 +146,7 @@ fn reserve_transfer_should_work() { let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![TransferReserveAsset { - assets: (Here, 100).into(), + assets: (Here, 100u128).into(), dest: Parachain(2).into(), xcm: Xcm::<()>(vec![DepositAsset { assets: AllCounted(1).into(), @@ -157,13 +157,13 @@ fn reserve_transfer_should_work() { ); assert_eq!(r, Outcome::Complete(10)); - assert_eq!(asset_list(Parachain(2)), vec![(Here, 100).into()]); + assert_eq!(asset_list(Parachain(2)), vec![(Here, 100u128).into()]); assert_eq!( sent_xcm(), vec![( Parachain(2).into(), Xcm::<()>(vec![ - ReserveAssetDeposited((Parent, 100).into()), + ReserveAssetDeposited((Parent, 100u128).into()), ClearOrigin, DepositAsset { assets: AllCounted(1).into(), beneficiary: three }, ]), @@ -181,22 +181,22 @@ fn burn_should_work() { let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - WithdrawAsset((Here, 1000).into()), - BurnAsset((Here, 100).into()), + WithdrawAsset((Here, 1000u128).into()), + BurnAsset((Here, 100u128).into()), DepositAsset { assets: Wild(AllCounted(1)), beneficiary: Parachain(1).into() }, ]), 50, ); assert_eq!(r, Outcome::Complete(30)); - assert_eq!(asset_list(Parachain(1)), vec![(Here, 900).into()]); + assert_eq!(asset_list(Parachain(1)), vec![(Here, 900u128).into()]); assert_eq!(sent_xcm(), vec![]); // Now they want to burn 1000 of them, which will actually only burn 900. let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - WithdrawAsset((Here, 900).into()), - BurnAsset((Here, 1000).into()), + WithdrawAsset((Here, 900u128).into()), + BurnAsset((Here, 1000u128).into()), DepositAsset { assets: Wild(AllCounted(1)), beneficiary: Parachain(1).into() }, ]), 50, @@ -217,7 +217,7 @@ fn basic_asset_trap_should_work() { let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - WithdrawAsset((Here, 100).into()), + WithdrawAsset((Here, 100u128).into()), DepositAsset { assets: Wild(AllCounted(0)), // <<< 0 is an error. beneficiary: AccountIndex64 { index: 3, network: None }.into(), @@ -226,7 +226,7 @@ fn basic_asset_trap_should_work() { 20, ); assert_eq!(r, Outcome::Complete(25)); - assert_eq!(asset_list(Parachain(1)), vec![(Here, 900).into()]); + assert_eq!(asset_list(Parachain(1)), vec![(Here, 900u128).into()]); assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![]); // Incorrect ticket doesn't work. @@ -234,7 +234,7 @@ fn basic_asset_trap_should_work() { let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - ClaimAsset { assets: (Here, 100).into(), ticket: GeneralIndex(1).into() }, + ClaimAsset { assets: (Here, 100u128).into(), ticket: GeneralIndex(1).into() }, DepositAsset { assets: Wild(AllCounted(1)), beneficiary: AccountIndex64 { index: 3, network: None }.into(), @@ -243,7 +243,7 @@ fn basic_asset_trap_should_work() { 20, ); assert_eq!(r, Outcome::Incomplete(10, XcmError::UnknownClaim)); - assert_eq!(asset_list(Parachain(1)), vec![(Here, 900).into()]); + assert_eq!(asset_list(Parachain(1)), vec![(Here, 900u128).into()]); assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![]); assert_eq!(old_trapped_assets, TrappedAssets::get()); @@ -252,7 +252,7 @@ fn basic_asset_trap_should_work() { let r = XcmExecutor::::execute_xcm( Parachain(2), Xcm(vec![ - ClaimAsset { assets: (Here, 100).into(), ticket: GeneralIndex(0).into() }, + ClaimAsset { assets: (Here, 100u128).into(), ticket: GeneralIndex(0u128).into() }, DepositAsset { assets: Wild(AllCounted(1)), beneficiary: AccountIndex64 { index: 3, network: None }.into(), @@ -261,7 +261,7 @@ fn basic_asset_trap_should_work() { 20, ); assert_eq!(r, Outcome::Incomplete(10, XcmError::UnknownClaim)); - assert_eq!(asset_list(Parachain(1)), vec![(Here, 900).into()]); + assert_eq!(asset_list(Parachain(1)), vec![(Here, 900u128).into()]); assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![]); assert_eq!(old_trapped_assets, TrappedAssets::get()); @@ -270,7 +270,7 @@ fn basic_asset_trap_should_work() { let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - ClaimAsset { assets: (Here, 101).into(), ticket: GeneralIndex(0).into() }, + ClaimAsset { assets: (Here, 101u128).into(), ticket: GeneralIndex(0u128).into() }, DepositAsset { assets: Wild(AllCounted(1)), beneficiary: AccountIndex64 { index: 3, network: None }.into(), @@ -279,14 +279,14 @@ fn basic_asset_trap_should_work() { 20, ); assert_eq!(r, Outcome::Incomplete(10, XcmError::UnknownClaim)); - assert_eq!(asset_list(Parachain(1)), vec![(Here, 900).into()]); + assert_eq!(asset_list(Parachain(1)), vec![(Here, 900u128).into()]); assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![]); assert_eq!(old_trapped_assets, TrappedAssets::get()); let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - ClaimAsset { assets: (Here, 100).into(), ticket: GeneralIndex(0).into() }, + ClaimAsset { assets: (Here, 100u128).into(), ticket: GeneralIndex(0u128).into() }, DepositAsset { assets: Wild(AllCounted(1)), beneficiary: AccountIndex64 { index: 3, network: None }.into(), @@ -295,14 +295,14 @@ fn basic_asset_trap_should_work() { 20, ); assert_eq!(r, Outcome::Complete(20)); - assert_eq!(asset_list(Parachain(1)), vec![(Here, 900).into()]); - assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 100).into()]); + assert_eq!(asset_list(Parachain(1)), vec![(Here, 900u128).into()]); + assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 100u128).into()]); // Same again doesn't work :-) let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - ClaimAsset { assets: (Here, 100).into(), ticket: GeneralIndex(0).into() }, + ClaimAsset { assets: (Here, 100u128).into(), ticket: GeneralIndex(0u128).into() }, DepositAsset { assets: Wild(AllCounted(1)), beneficiary: AccountIndex64 { index: 3, network: None }.into(), @@ -318,28 +318,28 @@ fn max_assets_limit_should_work() { // we'll let them have message execution for free. AllowUnpaidFrom::set(vec![X1(Parachain(1)).into()]); // Child parachain #1 owns 1000 tokens held by us in reserve. - add_asset(Parachain(1), ([1u8; 32], 1000)); - add_asset(Parachain(1), ([2u8; 32], 1000)); - add_asset(Parachain(1), ([3u8; 32], 1000)); - add_asset(Parachain(1), ([4u8; 32], 1000)); - add_asset(Parachain(1), ([5u8; 32], 1000)); - add_asset(Parachain(1), ([6u8; 32], 1000)); - add_asset(Parachain(1), ([7u8; 32], 1000)); - add_asset(Parachain(1), ([8u8; 32], 1000)); - add_asset(Parachain(1), ([9u8; 32], 1000)); + add_asset(Parachain(1), ([1u8; 32], 1000u128)); + add_asset(Parachain(1), ([2u8; 32], 1000u128)); + add_asset(Parachain(1), ([3u8; 32], 1000u128)); + add_asset(Parachain(1), ([4u8; 32], 1000u128)); + add_asset(Parachain(1), ([5u8; 32], 1000u128)); + add_asset(Parachain(1), ([6u8; 32], 1000u128)); + add_asset(Parachain(1), ([7u8; 32], 1000u128)); + add_asset(Parachain(1), ([8u8; 32], 1000u128)); + add_asset(Parachain(1), ([9u8; 32], 1000u128)); // Attempt to withdraw 8 (=2x4)different assets. This will succeed. let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - WithdrawAsset(([1u8; 32], 100).into()), - WithdrawAsset(([2u8; 32], 100).into()), - WithdrawAsset(([3u8; 32], 100).into()), - WithdrawAsset(([4u8; 32], 100).into()), - WithdrawAsset(([5u8; 32], 100).into()), - WithdrawAsset(([6u8; 32], 100).into()), - WithdrawAsset(([7u8; 32], 100).into()), - WithdrawAsset(([8u8; 32], 100).into()), + WithdrawAsset(([1u8; 32], 100u128).into()), + WithdrawAsset(([2u8; 32], 100u128).into()), + WithdrawAsset(([3u8; 32], 100u128).into()), + WithdrawAsset(([4u8; 32], 100u128).into()), + WithdrawAsset(([5u8; 32], 100u128).into()), + WithdrawAsset(([6u8; 32], 100u128).into()), + WithdrawAsset(([7u8; 32], 100u128).into()), + WithdrawAsset(([8u8; 32], 100u128).into()), ]), 100, ); @@ -349,15 +349,15 @@ fn max_assets_limit_should_work() { let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - WithdrawAsset(([1u8; 32], 100).into()), - WithdrawAsset(([2u8; 32], 100).into()), - WithdrawAsset(([3u8; 32], 100).into()), - WithdrawAsset(([4u8; 32], 100).into()), - WithdrawAsset(([5u8; 32], 100).into()), - WithdrawAsset(([6u8; 32], 100).into()), - WithdrawAsset(([7u8; 32], 100).into()), - WithdrawAsset(([8u8; 32], 100).into()), - WithdrawAsset(([9u8; 32], 100).into()), + WithdrawAsset(([1u8; 32], 100u128).into()), + WithdrawAsset(([2u8; 32], 100u128).into()), + WithdrawAsset(([3u8; 32], 100u128).into()), + WithdrawAsset(([4u8; 32], 100u128).into()), + WithdrawAsset(([5u8; 32], 100u128).into()), + WithdrawAsset(([6u8; 32], 100u128).into()), + WithdrawAsset(([7u8; 32], 100u128).into()), + WithdrawAsset(([8u8; 32], 100u128).into()), + WithdrawAsset(([9u8; 32], 100u128).into()), ]), 100, ); @@ -367,18 +367,18 @@ fn max_assets_limit_should_work() { let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - WithdrawAsset(([1u8; 32], 100).into()), - WithdrawAsset(([2u8; 32], 100).into()), - WithdrawAsset(([3u8; 32], 100).into()), - WithdrawAsset(([4u8; 32], 100).into()), - WithdrawAsset(([1u8; 32], 100).into()), - WithdrawAsset(([2u8; 32], 100).into()), - WithdrawAsset(([3u8; 32], 100).into()), - WithdrawAsset(([4u8; 32], 100).into()), - WithdrawAsset(([5u8; 32], 100).into()), - WithdrawAsset(([6u8; 32], 100).into()), - WithdrawAsset(([7u8; 32], 100).into()), - WithdrawAsset(([8u8; 32], 100).into()), + WithdrawAsset(([1u8; 32], 100u128).into()), + WithdrawAsset(([2u8; 32], 100u128).into()), + WithdrawAsset(([3u8; 32], 100u128).into()), + WithdrawAsset(([4u8; 32], 100u128).into()), + WithdrawAsset(([1u8; 32], 100u128).into()), + WithdrawAsset(([2u8; 32], 100u128).into()), + WithdrawAsset(([3u8; 32], 100u128).into()), + WithdrawAsset(([4u8; 32], 100u128).into()), + WithdrawAsset(([5u8; 32], 100u128).into()), + WithdrawAsset(([6u8; 32], 100u128).into()), + WithdrawAsset(([7u8; 32], 100u128).into()), + WithdrawAsset(([8u8; 32], 100u128).into()), ]), 200, ); @@ -388,18 +388,18 @@ fn max_assets_limit_should_work() { let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ - WithdrawAsset(([1u8; 32], 100).into()), - WithdrawAsset(([2u8; 32], 100).into()), - WithdrawAsset(([3u8; 32], 100).into()), - WithdrawAsset(([4u8; 32], 100).into()), - WithdrawAsset(([5u8; 32], 100).into()), - WithdrawAsset(([6u8; 32], 100).into()), - WithdrawAsset(([7u8; 32], 100).into()), - WithdrawAsset(([8u8; 32], 100).into()), - WithdrawAsset(([1u8; 32], 100).into()), - WithdrawAsset(([2u8; 32], 100).into()), - WithdrawAsset(([3u8; 32], 100).into()), - WithdrawAsset(([4u8; 32], 100).into()), + WithdrawAsset(([1u8; 32], 100u128).into()), + WithdrawAsset(([2u8; 32], 100u128).into()), + WithdrawAsset(([3u8; 32], 100u128).into()), + WithdrawAsset(([4u8; 32], 100u128).into()), + WithdrawAsset(([5u8; 32], 100u128).into()), + WithdrawAsset(([6u8; 32], 100u128).into()), + WithdrawAsset(([7u8; 32], 100u128).into()), + WithdrawAsset(([8u8; 32], 100u128).into()), + WithdrawAsset(([1u8; 32], 100u128).into()), + WithdrawAsset(([2u8; 32], 100u128).into()), + WithdrawAsset(([3u8; 32], 100u128).into()), + WithdrawAsset(([4u8; 32], 100u128).into()), ]), 200, ); @@ -410,16 +410,16 @@ fn max_assets_limit_should_work() { Parachain(1), Xcm(vec![ WithdrawAsset(MultiAssets::from(vec![ - ([1u8; 32], 100).into(), - ([2u8; 32], 100).into(), - ([3u8; 32], 100).into(), - ([4u8; 32], 100).into(), - ([5u8; 32], 100).into(), - ([6u8; 32], 100).into(), - ([7u8; 32], 100).into(), - ([8u8; 32], 100).into(), + ([1u8; 32], 100u128).into(), + ([2u8; 32], 100u128).into(), + ([3u8; 32], 100u128).into(), + ([4u8; 32], 100u128).into(), + ([5u8; 32], 100u128).into(), + ([6u8; 32], 100u128).into(), + ([7u8; 32], 100u128).into(), + ([8u8; 32], 100u128).into(), ])), - WithdrawAsset(([1u8; 32], 100).into()), + WithdrawAsset(([1u8; 32], 100u128).into()), ]), 200, ); diff --git a/xcm/xcm-builder/src/tests/basic.rs b/xcm/xcm-builder/src/tests/basic.rs index 91945e2fb9da..4438ddd11b60 100644 --- a/xcm/xcm-builder/src/tests/basic.rs +++ b/xcm/xcm-builder/src/tests/basic.rs @@ -19,7 +19,7 @@ use super::*; #[test] fn basic_setup_works() { add_reserve(Parent.into(), Wild((Parent, WildFungible).into())); - assert!(::IsReserve::contains(&(Parent, 100).into(), &Parent.into(),)); + assert!(::IsReserve::contains(&(Parent, 100u128).into(), &Parent.into(),)); assert_eq!(to_account(Parachain(1)), Ok(1001)); assert_eq!(to_account(Parachain(50)), Ok(1050)); @@ -39,8 +39,8 @@ fn basic_setup_works() { #[test] fn weigher_should_work() { let mut message = Xcm(vec![ - ReserveAssetDeposited((Parent, 100).into()), - BuyExecution { fees: (Parent, 1).into(), weight_limit: Limited(30) }, + ReserveAssetDeposited((Parent, 100u128).into()), + BuyExecution { fees: (Parent, 1u128).into(), weight_limit: Limited(30) }, DepositAsset { assets: AllCounted(1).into(), beneficiary: Here.into() }, ]); assert_eq!(::Weigher::weight(&mut message), Ok(30)); @@ -51,12 +51,12 @@ fn code_registers_should_work() { // we'll let them have message execution for free. AllowUnpaidFrom::set(vec![Here.into()]); // We own 1000 of our tokens. - add_asset(Here, (Here, 21)); + add_asset(Here, (Here, 21u128)); let mut message = Xcm(vec![ // Set our error handler - this will fire only on the second message, when there's an error SetErrorHandler(Xcm(vec![ TransferAsset { - assets: (Here, 2).into(), + assets: (Here, 2u128).into(), beneficiary: X1(AccountIndex64 { index: 3, network: None }).into(), }, // It was handled fine. @@ -64,7 +64,7 @@ fn code_registers_should_work() { ])), // Set the appendix - this will always fire. SetAppendix(Xcm(vec![TransferAsset { - assets: (Here, 4).into(), + assets: (Here, 4u128).into(), beneficiary: X1(AccountIndex64 { index: 3, network: None }).into(), }])), // First xfer always works ok @@ -74,7 +74,7 @@ fn code_registers_should_work() { }, // Second xfer results in error on the second message - our error handler will fire. TransferAsset { - assets: (Here, 8).into(), + assets: (Here, 8u128).into(), beneficiary: X1(AccountIndex64 { index: 3, network: None }).into(), }, ]); @@ -84,13 +84,13 @@ fn code_registers_should_work() { let r = XcmExecutor::::execute_xcm(Here, message.clone(), limit); assert_eq!(r, Outcome::Complete(50)); // We don't pay the 20 weight for the error handler. - assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 13).into()]); - assert_eq!(asset_list(Here), vec![(Here, 8).into()]); + assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 13u128).into()]); + assert_eq!(asset_list(Here), vec![(Here, 8u128).into()]); assert_eq!(sent_xcm(), vec![]); let r = XcmExecutor::::execute_xcm(Here, message, limit); assert_eq!(r, Outcome::Complete(70)); // We pay the full weight here. - assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 20).into()]); + assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 20u128).into()]); assert_eq!(asset_list(Here), vec![(Here, 1u128).into()]); assert_eq!(sent_xcm(), vec![]); } diff --git a/xcm/xcm-builder/src/tests/bridging/mod.rs b/xcm/xcm-builder/src/tests/bridging/mod.rs index 9bb5e13196c2..575cd7af7368 100644 --- a/xcm/xcm-builder/src/tests/bridging/mod.rs +++ b/xcm/xcm-builder/src/tests/bridging/mod.rs @@ -36,7 +36,7 @@ mod remote_relay_relay; parameter_types! { pub Local: NetworkId = ByGenesis([0; 32]); pub Remote: NetworkId = ByGenesis([1; 32]); - pub Price: MultiAssets = MultiAssets::from((Here, 100)); + pub Price: MultiAssets = MultiAssets::from((Here, 100u128)); } std::thread_local! { diff --git a/xcm/xcm-builder/src/tests/bridging/paid_remote_relay_relay.rs b/xcm/xcm-builder/src/tests/bridging/paid_remote_relay_relay.rs index 8336e03d1faa..f3b31582116c 100644 --- a/xcm/xcm-builder/src/tests/bridging/paid_remote_relay_relay.rs +++ b/xcm/xcm-builder/src/tests/bridging/paid_remote_relay_relay.rs @@ -28,7 +28,7 @@ parameter_types! { pub RelayUniversalLocation: Junctions = X1(GlobalConsensus(Local::get())); pub RemoteUniversalLocation: Junctions = X1(GlobalConsensus(Remote::get())); pub static BridgeTable: Vec<(NetworkId, MultiLocation, Option)> - = vec![(Remote::get(), MultiLocation::parent(), Some((Parent, 150).into()))]; + = vec![(Remote::get(), MultiLocation::parent(), Some((Parent, 150u128).into()))]; // ^^^ 100 to use the bridge (export) and 50 for the remote execution weight (5 instuctions // x 10 weight each). } @@ -63,10 +63,10 @@ fn sending_to_bridged_chain_works() { ); // Initialize the local relay so that our parachain has funds to pay for export. - add_asset(Parachain(100), (Here, 1000)); + add_asset(Parachain(100), (Here, 1000u128)); let msg = Xcm(vec![Trap(1)]); - assert_eq!(send_xcm::(dest, msg), Ok((Parent, 150).into())); + assert_eq!(send_xcm::(dest, msg), Ok((Parent, 150u128).into())); assert_eq!(TheBridge::service(), 1); assert_eq!( take_received_remote_messages(), @@ -81,7 +81,7 @@ fn sending_to_bridged_chain_works() { ); // The export cost 50 weight units (and thus 50 units of balance). - assert_eq!(asset_list(Parachain(100)), vec![(Here, 850).into()]); + assert_eq!(asset_list(Parachain(100)), vec![(Here, 850u128).into()]); } /// ```nocompile @@ -104,9 +104,9 @@ fn sending_to_parachain_of_bridged_chain_works() { ); // Initialize the local relay so that our parachain has funds to pay for export. - add_asset(Parachain(100), (Here, 1000)); + add_asset(Parachain(100), (Here, 1000u128)); - assert_eq!(send_xcm::(dest, Xcm(vec![Trap(1)])), Ok((Parent, 150).into())); + assert_eq!(send_xcm::(dest, Xcm(vec![Trap(1)])), Ok((Parent, 150u128).into())); assert_eq!(TheBridge::service(), 1); let expected = vec![( Parachain(100).into(), @@ -119,5 +119,5 @@ fn sending_to_parachain_of_bridged_chain_works() { assert_eq!(take_received_remote_messages(), expected); // The export cost 50 weight units (and thus 50 units of balance). - assert_eq!(asset_list(Parachain(100)), vec![(Here, 850).into()]); + assert_eq!(asset_list(Parachain(100)), vec![(Here, 850u128).into()]); } diff --git a/xcm/xcm-builder/src/tests/locking.rs b/xcm/xcm-builder/src/tests/locking.rs index 01cdb80f8ad5..1aa44d058248 100644 --- a/xcm/xcm-builder/src/tests/locking.rs +++ b/xcm/xcm-builder/src/tests/locking.rs @@ -22,37 +22,37 @@ fn lock_roundtrip_should_work() { // Account #3 and Parachain #1 can execute for free AllowUnpaidFrom::set(vec![(3u64,).into(), (Parent, Parachain(1)).into()]); // Account #3 owns 1000 native parent tokens. - add_asset((3u64,), (Parent, 1000)); + add_asset((3u64,), (Parent, 1000u128)); // Sending a message costs 10 parent-tokens. - set_send_price((Parent, 10)); + set_send_price((Parent, 10u128)); // They want to lock 100 of the native parent tokens to be unlocked only by Parachain #1. let r = XcmExecutor::::execute_xcm( (3u64,), Xcm(vec![ - WithdrawAsset((Parent, 100).into()), + WithdrawAsset((Parent, 100u128).into()), SetAppendix( vec![DepositAsset { assets: AllCounted(2).into(), beneficiary: (3u64,).into() }] .into(), ), - LockAsset { asset: (Parent, 100).into(), unlocker: (Parent, Parachain(1)).into() }, + LockAsset { asset: (Parent, 100u128).into(), unlocker: (Parent, Parachain(1)).into() }, ]), 50, ); assert_eq!(r, Outcome::Complete(40)); - assert_eq!(asset_list((3u64,)), vec![(Parent, 990).into()]); + assert_eq!(asset_list((3u64,)), vec![(Parent, 990u128).into()]); assert_eq!( sent_xcm(), vec![( (Parent, Parachain(1)).into(), - Xcm::<()>(vec![NoteUnlockable { owner: (3u64,).into(), asset: (Parent, 100).into() },]), + Xcm::<()>(vec![NoteUnlockable { owner: (3u64,).into(), asset: (Parent, 100u128).into() },]), )] ); assert_eq!( take_lock_trace(), vec![Lock { - asset: (Parent, 100).into(), + asset: (Parent, 100u128).into(), owner: (3u64,).into(), unlocker: (Parent, Parachain(1)).into(), }] @@ -61,7 +61,7 @@ fn lock_roundtrip_should_work() { // Now we'll unlock it. let r = XcmExecutor::::execute_xcm( (Parent, Parachain(1)), - Xcm(vec![UnlockAsset { asset: (Parent, 100).into(), target: (3u64,).into() }]), + Xcm(vec![UnlockAsset { asset: (Parent, 100u128).into(), target: (3u64,).into() }]), 50, ); assert_eq!(r, Outcome::Complete(10)); @@ -72,21 +72,21 @@ fn auto_fee_paying_should_work() { // Account #3 and Parachain #1 can execute for free AllowUnpaidFrom::set(vec![(3u64,).into()]); // Account #3 owns 1000 native parent tokens. - add_asset((3u64,), (Parent, 1000)); + add_asset((3u64,), (Parent, 1000u128)); // Sending a message costs 10 parent-tokens. - set_send_price((Parent, 10)); + set_send_price((Parent, 10u128)); // They want to lock 100 of the native parent tokens to be unlocked only by Parachain #1. let r = XcmExecutor::::execute_xcm( (3u64,), Xcm(vec![ SetFeesMode { jit_withdraw: true }, - LockAsset { asset: (Parent, 100).into(), unlocker: (Parent, Parachain(1)).into() }, + LockAsset { asset: (Parent, 100u128).into(), unlocker: (Parent, Parachain(1)).into() }, ]), 50, ); assert_eq!(r, Outcome::Complete(20)); - assert_eq!(asset_list((3u64,)), vec![(Parent, 990).into()]); + assert_eq!(asset_list((3u64,)), vec![(Parent, 990u128).into()]); } #[test] @@ -99,7 +99,7 @@ fn lock_should_fail_correctly() { let r = XcmExecutor::::execute_xcm( (3u64,), Xcm(vec![LockAsset { - asset: (Parent, 100).into(), + asset: (Parent, 100u128).into(), unlocker: (Parent, Parachain(1)).into(), }]), 50, @@ -109,16 +109,16 @@ fn lock_should_fail_correctly() { assert_eq!(take_lock_trace(), vec![]); // Account #3 owns 1000 native parent tokens. - add_asset((3u64,), (Parent, 1000)); + add_asset((3u64,), (Parent, 1000u128)); // But we require a price to be paid for the sending - set_send_price((Parent, 10)); + set_send_price((Parent, 10u128)); // #3 wants to lock 100 of the native parent tokens to be unlocked only by parachain ../#1, // but there's nothing to pay the fees for sending the notification message. let r = XcmExecutor::::execute_xcm( (3u64,), Xcm(vec![LockAsset { - asset: (Parent, 100).into(), + asset: (Parent, 100u128).into(), unlocker: (Parent, Parachain(1)).into(), }]), 50, @@ -133,21 +133,21 @@ fn remote_unlock_roundtrip_should_work() { // Account #3 can execute for free AllowUnpaidFrom::set(vec![(3u64,).into(), (Parent, Parachain(1)).into()]); // Account #3 owns 1000 native parent tokens. - add_asset((3u64,), (Parent, 1000)); + add_asset((3u64,), (Parent, 1000u128)); // Sending a message costs 10 parent-tokens. - set_send_price((Parent, 10)); + set_send_price((Parent, 10u128)); // We have been told by Parachain #1 that Account #3 has locked funds which we can unlock. let r = XcmExecutor::::execute_xcm( (Parent, Parachain(1)), - Xcm(vec![NoteUnlockable { asset: (Parent, 100).into(), owner: (3u64,).into() }]), + Xcm(vec![NoteUnlockable { asset: (Parent, 100u128).into(), owner: (3u64,).into() }]), 50, ); assert_eq!(r, Outcome::Complete(10)); assert_eq!( take_lock_trace(), vec![Note { - asset: (Parent, 100).into(), + asset: (Parent, 100u128).into(), owner: (3u64,).into(), locker: (Parent, Parachain(1)).into(), }] @@ -157,29 +157,29 @@ fn remote_unlock_roundtrip_should_work() { let r = XcmExecutor::::execute_xcm( (3u64,), Xcm(vec![ - WithdrawAsset((Parent, 100).into()), + WithdrawAsset((Parent, 100u128).into()), SetAppendix( vec![DepositAsset { assets: AllCounted(2).into(), beneficiary: (3u64,).into() }] .into(), ), - RequestUnlock { asset: (Parent, 100).into(), locker: (Parent, Parachain(1)).into() }, + RequestUnlock { asset: (Parent, 100u128).into(), locker: (Parent, Parachain(1)).into() }, ]), 50, ); assert_eq!(r, Outcome::Complete(40)); - assert_eq!(asset_list((3u64,)), vec![(Parent, 990).into()]); + assert_eq!(asset_list((3u64,)), vec![(Parent, 990u128).into()]); assert_eq!( sent_xcm(), vec![( (Parent, Parachain(1)).into(), - Xcm::<()>(vec![UnlockAsset { target: (3u64,).into(), asset: (Parent, 100).into() },]), + Xcm::<()>(vec![UnlockAsset { target: (3u64,).into(), asset: (Parent, 100u128).into() },]), )] ); assert_eq!( take_lock_trace(), vec![Reduce { - asset: (Parent, 100).into(), + asset: (Parent, 100u128).into(), owner: (3u64,).into(), locker: (Parent, Parachain(1)).into(), }] @@ -191,7 +191,7 @@ fn remote_unlock_should_fail_correctly() { // Account #3 can execute for free AllowUnpaidFrom::set(vec![(3u64,).into(), (Parent, Parachain(1)).into()]); // But we require a price to be paid for the sending - set_send_price((Parent, 10)); + set_send_price((Parent, 10u128)); // We want to unlock 100 of the native parent tokens which were locked for us on parachain. // This won't work as we don't have any record of them being locked for us. @@ -199,7 +199,7 @@ fn remote_unlock_should_fail_correctly() { let r = XcmExecutor::::execute_xcm( (3u64,), Xcm(vec![RequestUnlock { - asset: (Parent, 100).into(), + asset: (Parent, 100u128).into(), locker: (Parent, Parachain(1)).into(), }]), 50, @@ -211,7 +211,7 @@ fn remote_unlock_should_fail_correctly() { // We have been told by Parachain #1 that Account #3 has locked funds which we can unlock. let r = XcmExecutor::::execute_xcm( (Parent, Parachain(1)), - Xcm(vec![NoteUnlockable { asset: (Parent, 100).into(), owner: (3u64,).into() }]), + Xcm(vec![NoteUnlockable { asset: (Parent, 100u128).into(), owner: (3u64,).into() }]), 50, ); assert_eq!(r, Outcome::Complete(10)); @@ -223,7 +223,7 @@ fn remote_unlock_should_fail_correctly() { let r = XcmExecutor::::execute_xcm( (3u64,), Xcm(vec![RequestUnlock { - asset: (Parent, 100).into(), + asset: (Parent, 100u128).into(), locker: (Parent, Parachain(1)).into(), }]), 50, diff --git a/xcm/xcm-builder/src/tests/mock.rs b/xcm/xcm-builder/src/tests/mock.rs index 9e053ccbafd7..3972170ab15c 100644 --- a/xcm/xcm-builder/src/tests/mock.rs +++ b/xcm/xcm-builder/src/tests/mock.rs @@ -19,6 +19,7 @@ pub use crate::{ AllowKnownQueryResponses, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, FixedRateOfFungible, FixedWeightBounds, LocationInverter, TakeWeightCredit, }; +use frame_support::traits::ContainsPair; pub use frame_support::{ dispatch::{ DispatchError, DispatchInfo, DispatchResultWithPostInfo, Dispatchable, Parameter, Weight, @@ -39,7 +40,7 @@ pub use xcm::latest::prelude::*; pub use xcm_executor::{ traits::{ AssetExchange, AssetLock, ConvertOrigin, Enact, ExportXcm, FeeManager, FeeReason, - FilterAssetLocation, LockError, OnResponse, TransactAsset, UniversalLocation, + LockError, OnResponse, TransactAsset, UniversalLocation, }, Assets, Config, }; @@ -283,14 +284,14 @@ pub fn clear_universal_aliases() { } pub struct TestIsReserve; -impl FilterAssetLocation for TestIsReserve { +impl ContainsPair for TestIsReserve { fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { IS_RESERVE .with(|r| r.borrow().get(origin).map_or(false, |v| v.iter().any(|a| a.matches(asset)))) } } pub struct TestIsTeleporter; -impl FilterAssetLocation for TestIsTeleporter { +impl ContainsPair for TestIsTeleporter { fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { IS_TELEPORTER .with(|r| r.borrow().get(origin).map_or(false, |v| v.iter().any(|a| a.matches(asset)))) diff --git a/xcm/xcm-builder/src/tests/mod.rs b/xcm/xcm-builder/src/tests/mod.rs index da17f2d36e83..391111da0209 100644 --- a/xcm/xcm-builder/src/tests/mod.rs +++ b/xcm/xcm-builder/src/tests/mod.rs @@ -16,8 +16,8 @@ use super::{test_utils::*, *}; use core::convert::TryInto; -use frame_support::{assert_err, traits::ConstU32, weights::constants::WEIGHT_PER_SECOND}; -use xcm_executor::{traits::*, Config, XcmExecutor}; +use frame_support::{assert_err, traits::{ConstU32, ContainsPair}, weights::constants::WEIGHT_PER_SECOND}; +use xcm_executor::{traits::prelude::*, Config, XcmExecutor}; mod mock; use mock::*; diff --git a/xcm/xcm-builder/src/tests/origins.rs b/xcm/xcm-builder/src/tests/origins.rs index 5dee287a559b..528a4ff6da0d 100644 --- a/xcm/xcm-builder/src/tests/origins.rs +++ b/xcm/xcm-builder/src/tests/origins.rs @@ -29,7 +29,7 @@ fn universal_origin_should_work() { Parachain(2), Xcm(vec![ UniversalOrigin(GlobalConsensus(Kusama)), - TransferAsset { assets: (Parent, 100).into(), beneficiary: Here.into() }, + TransferAsset { assets: (Parent, 100u128).into(), beneficiary: Here.into() }, ]), 50, ); @@ -39,18 +39,18 @@ fn universal_origin_should_work() { Parachain(1), Xcm(vec![ UniversalOrigin(GlobalConsensus(Kusama)), - TransferAsset { assets: (Parent, 100).into(), beneficiary: Here.into() }, + TransferAsset { assets: (Parent, 100u128).into(), beneficiary: Here.into() }, ]), 50, ); assert_eq!(r, Outcome::Incomplete(20, XcmError::NotWithdrawable)); - add_asset((Ancestor(2), GlobalConsensus(Kusama)), (Parent, 100)); + add_asset((Ancestor(2), GlobalConsensus(Kusama)), (Parent, 100u128)); let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ UniversalOrigin(GlobalConsensus(Kusama)), - TransferAsset { assets: (Parent, 100).into(), beneficiary: Here.into() }, + TransferAsset { assets: (Parent, 100u128).into(), beneficiary: Here.into() }, ]), 50, ); @@ -65,7 +65,7 @@ fn export_message_should_work() { // Local parachain #1 issues a transfer asset on Polkadot Relay-chain, transfering 100 Planck to // Polkadot parachain #2. let message = - Xcm(vec![TransferAsset { assets: (Here, 100).into(), beneficiary: Parachain(2).into() }]); + Xcm(vec![TransferAsset { assets: (Here, 100u128).into(), beneficiary: Parachain(2).into() }]); let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ExportMessage { network: Polkadot, destination: Here, xcm: message.clone() }]), diff --git a/xcm/xcm-builder/src/tests/querying.rs b/xcm/xcm-builder/src/tests/querying.rs index 1b6e90e230d4..feb3259208ed 100644 --- a/xcm/xcm-builder/src/tests/querying.rs +++ b/xcm/xcm-builder/src/tests/querying.rs @@ -100,7 +100,7 @@ fn prepaid_result_of_query_should_get_free_execution() { // We put this in manually here, but normally this would be done at the point of crafting the message. expect_response(query_id, Parent.into()); - let the_response = Response::Assets((Parent, 100).into()); + let the_response = Response::Assets((Parent, 100u128).into()); let message = Xcm::(vec![QueryResponse { query_id, response: the_response.clone(), diff --git a/xcm/xcm-builder/src/tests/transacting.rs b/xcm/xcm-builder/src/tests/transacting.rs index 643a1054d8cb..3889d957dc9c 100644 --- a/xcm/xcm-builder/src/tests/transacting.rs +++ b/xcm/xcm-builder/src/tests/transacting.rs @@ -62,13 +62,13 @@ fn transacting_should_refund_weight() { fn paid_transacting_should_refund_payment_for_unused_weight() { let one: MultiLocation = AccountIndex64 { index: 1, network: None }.into(); AllowPaidFrom::set(vec![one.clone()]); - add_asset(AccountIndex64 { index: 1, network: None }, (Parent, 100)); + add_asset(AccountIndex64 { index: 1, network: None }, (Parent, 100u128)); WeightPrice::set((Parent.into(), 1_000_000_000_000)); let origin = one.clone(); - let fees = (Parent, 100).into(); + let fees = (Parent, 100u128).into(); let message = Xcm::(vec![ - WithdrawAsset((Parent, 100).into()), // enough for 100 units of weight. + WithdrawAsset((Parent, 100u128).into()), // enough for 100 units of weight. BuyExecution { fees, weight_limit: Limited(100) }, Transact { origin_kind: OriginKind::Native, @@ -82,7 +82,7 @@ fn paid_transacting_should_refund_payment_for_unused_weight() { let weight_limit = 100; let r = XcmExecutor::::execute_xcm(origin, message, weight_limit); assert_eq!(r, Outcome::Complete(60)); - assert_eq!(asset_list(AccountIndex64 { index: 1, network: None }), vec![(Parent, 40).into()]); + assert_eq!(asset_list(AccountIndex64 { index: 1, network: None }), vec![(Parent, 40u128).into()]); } #[test] diff --git a/xcm/xcm-builder/src/tests/weight.rs b/xcm/xcm-builder/src/tests/weight.rs index 2f81b126a298..f0a3aaf57a1b 100644 --- a/xcm/xcm-builder/src/tests/weight.rs +++ b/xcm/xcm-builder/src/tests/weight.rs @@ -21,7 +21,7 @@ fn errors_should_return_unused_weight() { // we'll let them have message execution for free. AllowUnpaidFrom::set(vec![Here.into()]); // We own 1000 of our tokens. - add_asset(Here, (Here, 11)); + add_asset(Here, (Here, 11u128)); let mut message = Xcm(vec![ // First xfer results in an error on the last message only TransferAsset { @@ -30,12 +30,12 @@ fn errors_should_return_unused_weight() { }, // Second xfer results in error third message and after TransferAsset { - assets: (Here, 2).into(), + assets: (Here, 2u128).into(), beneficiary: X1(AccountIndex64 { index: 3, network: None }).into(), }, // Third xfer results in error second message and after TransferAsset { - assets: (Here, 4).into(), + assets: (Here, 4u128).into(), beneficiary: X1(AccountIndex64 { index: 3, network: None }).into(), }, ]); @@ -45,25 +45,25 @@ fn errors_should_return_unused_weight() { let r = XcmExecutor::::execute_xcm(Here, message.clone(), limit); assert_eq!(r, Outcome::Complete(30)); - assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 7).into()]); - assert_eq!(asset_list(Here), vec![(Here, 4).into()]); + assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 7u128).into()]); + assert_eq!(asset_list(Here), vec![(Here, 4u128).into()]); assert_eq!(sent_xcm(), vec![]); let r = XcmExecutor::::execute_xcm(Here, message.clone(), limit); assert_eq!(r, Outcome::Incomplete(30, XcmError::NotWithdrawable)); - assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 10).into()]); + assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 10u128).into()]); assert_eq!(asset_list(Here), vec![(Here, 1u128).into()]); assert_eq!(sent_xcm(), vec![]); let r = XcmExecutor::::execute_xcm(Here, message.clone(), limit); assert_eq!(r, Outcome::Incomplete(20, XcmError::NotWithdrawable)); - assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 11).into()]); + assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 11u128).into()]); assert_eq!(asset_list(Here), vec![]); assert_eq!(sent_xcm(), vec![]); let r = XcmExecutor::::execute_xcm(Here, message, limit); assert_eq!(r, Outcome::Incomplete(10, XcmError::NotWithdrawable)); - assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 11).into()]); + assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 11u128).into()]); assert_eq!(asset_list(Here), vec![]); assert_eq!(sent_xcm(), vec![]); } diff --git a/xcm/xcm-executor/src/traits/mod.rs b/xcm/xcm-executor/src/traits/mod.rs index 9ac718bbd644..36a92dc8ea74 100644 --- a/xcm/xcm-executor/src/traits/mod.rs +++ b/xcm/xcm-executor/src/traits/mod.rs @@ -45,3 +45,13 @@ mod transact_asset; pub use transact_asset::TransactAsset; mod weight; pub use weight::{WeightBounds, WeightTrader}; + +pub mod prelude { + pub use super::{ + Convert, ConvertOrigin, Decoded, Encoded, Identity, JustTry, UniversalLocation, + ClaimAssets, DropAssets, AssetLock, Enact, LockError, + AssetExchange, export_xcm, validate_export, ExportXcm, FeeManager, FeeReason, + Error, MatchesFungible, MatchesFungibles, MatchesNonFungible, MatchesNonFungibles, + OnResponse, VersionChangeNotifier, ShouldExecute, TransactAsset, WeightBounds, WeightTrader, + }; +} \ No newline at end of file From bc73f50e1126c2bcd38fad0018ec5d72cd48575c Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 25 Feb 2022 15:17:01 +0000 Subject: [PATCH 08/17] Formatting --- Cargo.lock | 395 ++++++++++------------- xcm/pallet-xcm-benchmarks/src/mock.rs | 2 +- xcm/xcm-builder/src/tests/assets.rs | 10 +- xcm/xcm-builder/src/tests/basic.rs | 4 +- xcm/xcm-builder/src/tests/locking.rs | 15 +- xcm/xcm-builder/src/tests/mod.rs | 6 +- xcm/xcm-builder/src/tests/origins.rs | 6 +- xcm/xcm-builder/src/tests/transacting.rs | 5 +- xcm/xcm-executor/src/traits/mod.rs | 12 +- 9 files changed, 206 insertions(+), 249 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0083dec6b58d..707367d71b15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -450,6 +450,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "beefy-primitives", "fnv", @@ -478,6 +479,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -500,10 +502,12 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" [[package]] name = "beefy-primitives" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -2020,6 +2024,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", ] @@ -2037,6 +2042,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -2058,6 +2064,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "Inflector", "chrono", @@ -2084,6 +2091,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -2097,6 +2105,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -2124,6 +2133,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "bitflags", "frame-metadata", @@ -2152,6 +2162,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2163,6 +2174,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.1.3", @@ -2174,6 +2186,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro2", "quote", @@ -2183,6 +2196,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2205,6 +2219,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -2215,6 +2230,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "log", @@ -2231,6 +2247,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -2245,6 +2262,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "sp-api", @@ -2253,6 +2271,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "sp-api", @@ -2448,6 +2467,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "chrono", "frame-election-provider-support", @@ -4893,6 +4913,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -4906,6 +4927,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -4921,6 +4943,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -4935,6 +4958,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -4958,6 +4982,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4977,6 +5002,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4996,6 +5022,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5010,6 +5037,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "beefy-primitives", "frame-support", @@ -5025,6 +5053,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -5049,6 +5078,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5132,6 +5162,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5148,6 +5179,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5163,6 +5195,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5185,6 +5218,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5202,6 +5236,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5216,6 +5251,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5238,6 +5274,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5253,6 +5290,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5272,6 +5310,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5288,6 +5327,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5304,6 +5344,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5321,6 +5362,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5336,6 +5378,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5352,6 +5395,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5366,6 +5410,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5379,6 +5424,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5395,6 +5441,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5417,6 +5464,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5432,6 +5480,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5446,6 +5495,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5459,6 +5509,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5474,6 +5525,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5494,6 +5546,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5509,6 +5562,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5522,6 +5576,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5544,6 +5599,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -5554,6 +5610,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "sp-arithmetic", @@ -5562,6 +5619,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5575,6 +5633,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5592,6 +5651,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5610,6 +5670,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5626,6 +5687,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5642,6 +5704,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5652,6 +5715,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5668,6 +5732,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5682,6 +5747,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5697,6 +5763,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -8146,6 +8213,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "env_logger 0.9.0", "jsonrpsee 0.8.0", @@ -8492,6 +8560,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "sp-core", @@ -8502,6 +8571,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -8528,6 +8598,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "futures-timer", @@ -8550,6 +8621,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8565,6 +8637,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8581,6 +8654,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -8591,6 +8665,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "chrono", "clap", @@ -8628,6 +8703,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "fnv", "futures 0.3.21", @@ -8655,6 +8731,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "hash-db", "kvdb", @@ -8679,6 +8756,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -8702,6 +8780,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "fork-tree", @@ -8744,6 +8823,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -8767,6 +8847,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8779,6 +8860,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -8803,6 +8885,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "sc-client-api", "sp-authorship", @@ -8813,6 +8896,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "lazy_static", "libsecp256k1", @@ -8840,6 +8924,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "environmental", "parity-scale-codec", @@ -8856,6 +8941,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "parity-scale-codec", @@ -8871,6 +8957,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8888,6 +8975,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ahash", "async-trait", @@ -8926,6 +9014,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "finality-grandpa", "futures 0.3.21", @@ -8949,6 +9038,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ansi_term", "futures 0.3.21", @@ -8965,6 +9055,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "hex", @@ -8979,6 +9070,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "asynchronous-codec 0.5.0", @@ -9027,6 +9119,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ahash", "futures 0.3.21", @@ -9043,6 +9136,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "bytes 1.1.0", "fnv", @@ -9070,6 +9164,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "libp2p", @@ -9082,6 +9177,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9090,6 +9186,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "hash-db", @@ -9120,6 +9217,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9144,6 +9242,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9160,6 +9259,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "directories", @@ -9223,6 +9323,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "parity-scale-codec", @@ -9236,6 +9337,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -9256,6 +9358,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "chrono", "futures 0.3.21", @@ -9273,6 +9376,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ansi_term", "atty", @@ -9303,6 +9407,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -9313,6 +9418,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9339,6 +9445,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "log", @@ -9351,6 +9458,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9826,6 +9934,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "hash-db", "log", @@ -9842,6 +9951,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "blake2 0.10.2", "proc-macro-crate 1.1.3", @@ -9853,6 +9963,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -9865,6 +9976,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "integer-sqrt", "num-traits", @@ -9879,6 +9991,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -9891,6 +10004,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "parity-scale-codec", @@ -9902,6 +10016,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "sp-api", @@ -9913,6 +10028,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "log", @@ -9930,6 +10046,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -9948,6 +10065,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "merlin", @@ -9970,6 +10088,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -9983,6 +10102,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9994,6 +10114,7 @@ dependencies = [ [[package]] name = "sp-core" version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "base58", "bitflags", @@ -10038,6 +10159,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "blake2 0.10.2", "byteorder", @@ -10051,6 +10173,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro2", "quote", @@ -10061,6 +10184,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "kvdb", "parking_lot 0.12.0", @@ -10069,6 +10193,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro2", "quote", @@ -10078,6 +10203,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.11.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "environmental", "parity-scale-codec", @@ -10088,6 +10214,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "finality-grandpa", "log", @@ -10105,6 +10232,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10118,6 +10246,7 @@ dependencies = [ [[package]] name = "sp-io" version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "hash-db", @@ -10141,6 +10270,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "lazy_static", "sp-core", @@ -10151,6 +10281,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.11.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -10167,6 +10298,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "thiserror", "zstd", @@ -10175,6 +10307,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -10189,6 +10322,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -10199,6 +10333,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "sp-api", "sp-core", @@ -10208,6 +10343,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "backtrace", "lazy_static", @@ -10217,6 +10353,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "rustc-hash", "serde", @@ -10226,6 +10363,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "either", "hash256-std-hasher", @@ -10247,6 +10385,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10263,6 +10402,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "Inflector", "proc-macro-crate 1.1.3", @@ -10274,6 +10414,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "serde", "serde_json", @@ -10282,6 +10423,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -10295,6 +10437,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -10305,6 +10448,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.11.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "hash-db", "log", @@ -10327,10 +10471,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" [[package]] name = "sp-storage" version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10343,6 +10489,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "sp-core", @@ -10355,6 +10502,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures-timer", @@ -10370,6 +10518,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "sp-std", @@ -10381,6 +10530,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "sp-api", "sp-runtime", @@ -10389,6 +10539,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "log", @@ -10404,6 +10555,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "hash-db", "memory-db", @@ -10418,6 +10570,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10434,6 +10587,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10444,6 +10598,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "impl-trait-for-tuples", "log", @@ -10643,6 +10798,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "platforms", ] @@ -10650,6 +10806,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.21", @@ -10671,6 +10828,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures-util", "hyper", @@ -10683,6 +10841,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -10708,6 +10867,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "substrate-test-utils-derive", @@ -10717,6 +10877,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -10727,6 +10888,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ansi_term", "build-helper", @@ -11345,6 +11507,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "clap", "jsonrpsee 0.4.1", @@ -12464,235 +12627,3 @@ dependencies = [ "cc", "libc", ] - -[[patch.unused]] -name = "chain-spec-builder" -version = "2.0.0" - -[[patch.unused]] -name = "frame-support-test-compile-pass" -version = "4.0.0-dev" - -[[patch.unused]] -name = "node-bench" -version = "0.9.0-dev" - -[[patch.unused]] -name = "node-cli" -version = "3.0.0-dev" - -[[patch.unused]] -name = "node-executor" -version = "3.0.0-dev" - -[[patch.unused]] -name = "node-inspect" -version = "0.9.0-dev" - -[[patch.unused]] -name = "node-primitives" -version = "2.0.0" - -[[patch.unused]] -name = "node-rpc" -version = "3.0.0-dev" - -[[patch.unused]] -name = "node-runtime" -version = "3.0.0-dev" - -[[patch.unused]] -name = "node-runtime-generate-bags" -version = "3.0.0" - -[[patch.unused]] -name = "node-template" -version = "4.0.0-dev" - -[[patch.unused]] -name = "node-template-runtime" -version = "4.0.0-dev" - -[[patch.unused]] -name = "node-testing" -version = "3.0.0-dev" - -[[patch.unused]] -name = "pallet-asset-tx-payment" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-atomic-swap" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-aura" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-bags-list-fuzzer" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-child-bounties" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-contracts" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-contracts-primitives" -version = "5.0.0" - -[[patch.unused]] -name = "pallet-contracts-proc-macro" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-contracts-rpc" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-contracts-rpc-runtime-api" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-conviction-voting" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-example-basic" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-example-offchain-worker" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-example-parallel" -version = "3.0.0-dev" - -[[patch.unused]] -name = "pallet-lottery" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-node-authorization" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-randomness-collective-flip" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-referenda" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-scored-pool" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-template" -version = "4.0.0-dev" - -[[patch.unused]] -name = "pallet-transaction-storage" -version = "4.0.0-dev" - -[[patch.unused]] -name = "sc-consensus-aura" -version = "0.10.0-dev" - -[[patch.unused]] -name = "sc-consensus-manual-seal" -version = "0.10.0-dev" - -[[patch.unused]] -name = "sc-consensus-pow" -version = "0.10.0-dev" - -[[patch.unused]] -name = "sc-network-test" -version = "0.8.0" - -[[patch.unused]] -name = "sc-runtime-test" -version = "2.0.0" - -[[patch.unused]] -name = "sc-service-test" -version = "2.0.0" - -[[patch.unused]] -name = "sp-api-test" -version = "2.0.1" - -[[patch.unused]] -name = "sp-application-crypto-test" -version = "2.0.0" - -[[patch.unused]] -name = "sp-arithmetic-fuzzer" -version = "2.0.0" - -[[patch.unused]] -name = "sp-consensus-aura" -version = "0.10.0-dev" - -[[patch.unused]] -name = "sp-consensus-pow" -version = "0.10.0-dev" - -[[patch.unused]] -name = "sp-npos-elections-fuzzer" -version = "2.0.0-alpha.5" - -[[patch.unused]] -name = "sp-runtime-interface-test" -version = "2.0.0" - -[[patch.unused]] -name = "sp-runtime-interface-test-wasm" -version = "2.0.0" - -[[patch.unused]] -name = "sp-runtime-interface-test-wasm-deprecated" -version = "2.0.0" - -[[patch.unused]] -name = "sp-sandbox" -version = "0.10.0-dev" - -[[patch.unused]] -name = "sp-test-primitives" -version = "2.0.0" - -[[patch.unused]] -name = "subkey" -version = "2.0.1" - -[[patch.unused]] -name = "substrate-frame-cli" -version = "4.0.0-dev" - -[[patch.unused]] -name = "substrate-frame-rpc-support" -version = "3.0.0" - -[[patch.unused]] -name = "substrate-test-runtime" -version = "2.0.0" - -[[patch.unused]] -name = "substrate-test-runtime-client" -version = "2.0.0" - -[[patch.unused]] -name = "substrate-test-runtime-transaction-pool" -version = "2.0.0" - -[[patch.unused]] -name = "substrate-test-utils-test-crate" -version = "0.1.0" diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 2fd7d57aa9b4..e2940ff83c4e 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -15,7 +15,7 @@ // along with Polkadot. If not, see . use crate::*; -use frame_support::{parameter_types, weights::Weight, traits::ContainsPair}; +use frame_support::{parameter_types, traits::ContainsPair, weights::Weight}; // An xcm sender/receiver akin to > /dev/null pub struct DevNull; diff --git a/xcm/xcm-builder/src/tests/assets.rs b/xcm/xcm-builder/src/tests/assets.rs index 7de387aa3c55..afec771cb0a8 100644 --- a/xcm/xcm-builder/src/tests/assets.rs +++ b/xcm/xcm-builder/src/tests/assets.rs @@ -128,7 +128,10 @@ fn transfer_should_work() { 50, ); assert_eq!(r, Outcome::Complete(10)); - assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 100u128).into()]); + assert_eq!( + asset_list(AccountIndex64 { index: 3, network: None }), + vec![(Here, 100u128).into()] + ); assert_eq!(asset_list(Parachain(1)), vec![(Here, 900u128).into()]); assert_eq!(sent_xcm(), vec![]); } @@ -296,7 +299,10 @@ fn basic_asset_trap_should_work() { ); assert_eq!(r, Outcome::Complete(20)); assert_eq!(asset_list(Parachain(1)), vec![(Here, 900u128).into()]); - assert_eq!(asset_list(AccountIndex64 { index: 3, network: None }), vec![(Here, 100u128).into()]); + assert_eq!( + asset_list(AccountIndex64 { index: 3, network: None }), + vec![(Here, 100u128).into()] + ); // Same again doesn't work :-) let r = XcmExecutor::::execute_xcm( diff --git a/xcm/xcm-builder/src/tests/basic.rs b/xcm/xcm-builder/src/tests/basic.rs index 4438ddd11b60..383385a9baad 100644 --- a/xcm/xcm-builder/src/tests/basic.rs +++ b/xcm/xcm-builder/src/tests/basic.rs @@ -19,7 +19,9 @@ use super::*; #[test] fn basic_setup_works() { add_reserve(Parent.into(), Wild((Parent, WildFungible).into())); - assert!(::IsReserve::contains(&(Parent, 100u128).into(), &Parent.into(),)); + assert!( + ::IsReserve::contains(&(Parent, 100u128).into(), &Parent.into(),) + ); assert_eq!(to_account(Parachain(1)), Ok(1001)); assert_eq!(to_account(Parachain(50)), Ok(1050)); diff --git a/xcm/xcm-builder/src/tests/locking.rs b/xcm/xcm-builder/src/tests/locking.rs index 1aa44d058248..4e5c97c1b074 100644 --- a/xcm/xcm-builder/src/tests/locking.rs +++ b/xcm/xcm-builder/src/tests/locking.rs @@ -46,7 +46,10 @@ fn lock_roundtrip_should_work() { sent_xcm(), vec![( (Parent, Parachain(1)).into(), - Xcm::<()>(vec![NoteUnlockable { owner: (3u64,).into(), asset: (Parent, 100u128).into() },]), + Xcm::<()>(vec![NoteUnlockable { + owner: (3u64,).into(), + asset: (Parent, 100u128).into() + },]), )] ); assert_eq!( @@ -162,7 +165,10 @@ fn remote_unlock_roundtrip_should_work() { vec![DepositAsset { assets: AllCounted(2).into(), beneficiary: (3u64,).into() }] .into(), ), - RequestUnlock { asset: (Parent, 100u128).into(), locker: (Parent, Parachain(1)).into() }, + RequestUnlock { + asset: (Parent, 100u128).into(), + locker: (Parent, Parachain(1)).into(), + }, ]), 50, ); @@ -173,7 +179,10 @@ fn remote_unlock_roundtrip_should_work() { sent_xcm(), vec![( (Parent, Parachain(1)).into(), - Xcm::<()>(vec![UnlockAsset { target: (3u64,).into(), asset: (Parent, 100u128).into() },]), + Xcm::<()>(vec![UnlockAsset { + target: (3u64,).into(), + asset: (Parent, 100u128).into() + },]), )] ); assert_eq!( diff --git a/xcm/xcm-builder/src/tests/mod.rs b/xcm/xcm-builder/src/tests/mod.rs index 391111da0209..d49b207f73b1 100644 --- a/xcm/xcm-builder/src/tests/mod.rs +++ b/xcm/xcm-builder/src/tests/mod.rs @@ -16,7 +16,11 @@ use super::{test_utils::*, *}; use core::convert::TryInto; -use frame_support::{assert_err, traits::{ConstU32, ContainsPair}, weights::constants::WEIGHT_PER_SECOND}; +use frame_support::{ + assert_err, + traits::{ConstU32, ContainsPair}, + weights::constants::WEIGHT_PER_SECOND, +}; use xcm_executor::{traits::prelude::*, Config, XcmExecutor}; mod mock; diff --git a/xcm/xcm-builder/src/tests/origins.rs b/xcm/xcm-builder/src/tests/origins.rs index 528a4ff6da0d..93569d9d0fb1 100644 --- a/xcm/xcm-builder/src/tests/origins.rs +++ b/xcm/xcm-builder/src/tests/origins.rs @@ -64,8 +64,10 @@ fn export_message_should_work() { AllowUnpaidFrom::set(vec![X1(Parachain(1)).into()]); // Local parachain #1 issues a transfer asset on Polkadot Relay-chain, transfering 100 Planck to // Polkadot parachain #2. - let message = - Xcm(vec![TransferAsset { assets: (Here, 100u128).into(), beneficiary: Parachain(2).into() }]); + let message = Xcm(vec![TransferAsset { + assets: (Here, 100u128).into(), + beneficiary: Parachain(2).into(), + }]); let r = XcmExecutor::::execute_xcm( Parachain(1), Xcm(vec![ExportMessage { network: Polkadot, destination: Here, xcm: message.clone() }]), diff --git a/xcm/xcm-builder/src/tests/transacting.rs b/xcm/xcm-builder/src/tests/transacting.rs index 3889d957dc9c..009ba5ad96d1 100644 --- a/xcm/xcm-builder/src/tests/transacting.rs +++ b/xcm/xcm-builder/src/tests/transacting.rs @@ -82,7 +82,10 @@ fn paid_transacting_should_refund_payment_for_unused_weight() { let weight_limit = 100; let r = XcmExecutor::::execute_xcm(origin, message, weight_limit); assert_eq!(r, Outcome::Complete(60)); - assert_eq!(asset_list(AccountIndex64 { index: 1, network: None }), vec![(Parent, 40u128).into()]); + assert_eq!( + asset_list(AccountIndex64 { index: 1, network: None }), + vec![(Parent, 40u128).into()] + ); } #[test] diff --git a/xcm/xcm-executor/src/traits/mod.rs b/xcm/xcm-executor/src/traits/mod.rs index 36a92dc8ea74..4ad216effde6 100644 --- a/xcm/xcm-executor/src/traits/mod.rs +++ b/xcm/xcm-executor/src/traits/mod.rs @@ -48,10 +48,10 @@ pub use weight::{WeightBounds, WeightTrader}; pub mod prelude { pub use super::{ - Convert, ConvertOrigin, Decoded, Encoded, Identity, JustTry, UniversalLocation, - ClaimAssets, DropAssets, AssetLock, Enact, LockError, - AssetExchange, export_xcm, validate_export, ExportXcm, FeeManager, FeeReason, - Error, MatchesFungible, MatchesFungibles, MatchesNonFungible, MatchesNonFungibles, - OnResponse, VersionChangeNotifier, ShouldExecute, TransactAsset, WeightBounds, WeightTrader, + export_xcm, validate_export, AssetExchange, AssetLock, ClaimAssets, Convert, ConvertOrigin, + Decoded, DropAssets, Enact, Encoded, Error, ExportXcm, FeeManager, FeeReason, Identity, + JustTry, LockError, MatchesFungible, MatchesFungibles, MatchesNonFungible, + MatchesNonFungibles, OnResponse, ShouldExecute, TransactAsset, UniversalLocation, + VersionChangeNotifier, WeightBounds, WeightTrader, }; -} \ No newline at end of file +} From 494403855d33eabc6e25bb1d185b35416a4fdc2c Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 25 Feb 2022 15:27:45 +0000 Subject: [PATCH 09/17] Formatting --- Cargo.lock | 395 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 232 insertions(+), 163 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 707367d71b15..0083dec6b58d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -450,7 +450,6 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "beefy-primitives", "fnv", @@ -479,7 +478,6 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -502,12 +500,10 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -2024,7 +2020,6 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", ] @@ -2042,7 +2037,6 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -2064,7 +2058,6 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "Inflector", "chrono", @@ -2091,7 +2084,6 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -2105,7 +2097,6 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -2133,7 +2124,6 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "bitflags", "frame-metadata", @@ -2162,7 +2152,6 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2174,7 +2163,6 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.1.3", @@ -2186,7 +2174,6 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro2", "quote", @@ -2196,7 +2183,6 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2219,7 +2205,6 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -2230,7 +2215,6 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "log", @@ -2247,7 +2231,6 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -2262,7 +2245,6 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "sp-api", @@ -2271,7 +2253,6 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "sp-api", @@ -2467,7 +2448,6 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "chrono", "frame-election-provider-support", @@ -4913,7 +4893,6 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -4927,7 +4906,6 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -4943,7 +4921,6 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -4958,7 +4935,6 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -4982,7 +4958,6 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5002,7 +4977,6 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-election-provider-support", "frame-support", @@ -5022,7 +4996,6 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5037,7 +5010,6 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "beefy-primitives", "frame-support", @@ -5053,7 +5025,6 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -5078,7 +5049,6 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5162,7 +5132,6 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5179,7 +5148,6 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5195,7 +5163,6 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5218,7 +5185,6 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5236,7 +5202,6 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5251,7 +5216,6 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5274,7 +5238,6 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5290,7 +5253,6 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5310,7 +5272,6 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5327,7 +5288,6 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5344,7 +5304,6 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5362,7 +5321,6 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5378,7 +5336,6 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5395,7 +5352,6 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5410,7 +5366,6 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5424,7 +5379,6 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5441,7 +5395,6 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5464,7 +5417,6 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5480,7 +5432,6 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5495,7 +5446,6 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5509,7 +5459,6 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5525,7 +5474,6 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5546,7 +5494,6 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5562,7 +5509,6 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5576,7 +5522,6 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5599,7 +5544,6 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -5610,7 +5554,6 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "sp-arithmetic", @@ -5619,7 +5562,6 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5633,7 +5575,6 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5651,7 +5592,6 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5670,7 +5610,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-support", "frame-system", @@ -5687,7 +5626,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5704,7 +5642,6 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5715,7 +5652,6 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5732,7 +5668,6 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5747,7 +5682,6 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -5763,7 +5697,6 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-benchmarking", "frame-support", @@ -8213,7 +8146,6 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "env_logger 0.9.0", "jsonrpsee 0.8.0", @@ -8560,7 +8492,6 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "sp-core", @@ -8571,7 +8502,6 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -8598,7 +8528,6 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "futures-timer", @@ -8621,7 +8550,6 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8637,7 +8565,6 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8654,7 +8581,6 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -8665,7 +8591,6 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "chrono", "clap", @@ -8703,7 +8628,6 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "fnv", "futures 0.3.21", @@ -8731,7 +8655,6 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "hash-db", "kvdb", @@ -8756,7 +8679,6 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -8780,7 +8702,6 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "fork-tree", @@ -8823,7 +8744,6 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -8847,7 +8767,6 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8860,7 +8779,6 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -8885,7 +8803,6 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "sc-client-api", "sp-authorship", @@ -8896,7 +8813,6 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "lazy_static", "libsecp256k1", @@ -8924,7 +8840,6 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "environmental", "parity-scale-codec", @@ -8941,7 +8856,6 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "parity-scale-codec", @@ -8957,7 +8871,6 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8975,7 +8888,6 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ahash", "async-trait", @@ -9014,7 +8926,6 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "finality-grandpa", "futures 0.3.21", @@ -9038,7 +8949,6 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ansi_term", "futures 0.3.21", @@ -9055,7 +8965,6 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "hex", @@ -9070,7 +8979,6 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "asynchronous-codec 0.5.0", @@ -9119,7 +9027,6 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ahash", "futures 0.3.21", @@ -9136,7 +9043,6 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "bytes 1.1.0", "fnv", @@ -9164,7 +9070,6 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "libp2p", @@ -9177,7 +9082,6 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9186,7 +9090,6 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "hash-db", @@ -9217,7 +9120,6 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9242,7 +9144,6 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9259,7 +9160,6 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "directories", @@ -9323,7 +9223,6 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "parity-scale-codec", @@ -9337,7 +9236,6 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -9358,7 +9256,6 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "chrono", "futures 0.3.21", @@ -9376,7 +9273,6 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ansi_term", "atty", @@ -9407,7 +9303,6 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -9418,7 +9313,6 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9445,7 +9339,6 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "log", @@ -9458,7 +9351,6 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9934,7 +9826,6 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "hash-db", "log", @@ -9951,7 +9842,6 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "blake2 0.10.2", "proc-macro-crate 1.1.3", @@ -9963,7 +9853,6 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -9976,7 +9865,6 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "integer-sqrt", "num-traits", @@ -9991,7 +9879,6 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -10004,7 +9891,6 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "parity-scale-codec", @@ -10016,7 +9902,6 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "sp-api", @@ -10028,7 +9913,6 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "log", @@ -10046,7 +9930,6 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -10065,7 +9948,6 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "merlin", @@ -10088,7 +9970,6 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -10102,7 +9983,6 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -10114,7 +9994,6 @@ dependencies = [ [[package]] name = "sp-core" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "base58", "bitflags", @@ -10159,7 +10038,6 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "blake2 0.10.2", "byteorder", @@ -10173,7 +10051,6 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro2", "quote", @@ -10184,7 +10061,6 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "kvdb", "parking_lot 0.12.0", @@ -10193,7 +10069,6 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro2", "quote", @@ -10203,7 +10078,6 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "environmental", "parity-scale-codec", @@ -10214,7 +10088,6 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "finality-grandpa", "log", @@ -10232,7 +10105,6 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10246,7 +10118,6 @@ dependencies = [ [[package]] name = "sp-io" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "hash-db", @@ -10270,7 +10141,6 @@ dependencies = [ [[package]] name = "sp-keyring" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "lazy_static", "sp-core", @@ -10281,7 +10151,6 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -10298,7 +10167,6 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "thiserror", "zstd", @@ -10307,7 +10175,6 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -10322,7 +10189,6 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -10333,7 +10199,6 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "sp-api", "sp-core", @@ -10343,7 +10208,6 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "backtrace", "lazy_static", @@ -10353,7 +10217,6 @@ dependencies = [ [[package]] name = "sp-rpc" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "rustc-hash", "serde", @@ -10363,7 +10226,6 @@ dependencies = [ [[package]] name = "sp-runtime" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "either", "hash256-std-hasher", @@ -10385,7 +10247,6 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10402,7 +10263,6 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "Inflector", "proc-macro-crate 1.1.3", @@ -10414,7 +10274,6 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "serde", "serde_json", @@ -10423,7 +10282,6 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -10437,7 +10295,6 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "scale-info", @@ -10448,7 +10305,6 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "hash-db", "log", @@ -10471,12 +10327,10 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" [[package]] name = "sp-storage" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10489,7 +10343,6 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "log", "sp-core", @@ -10502,7 +10355,6 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures-timer", @@ -10518,7 +10370,6 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "sp-std", @@ -10530,7 +10381,6 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "sp-api", "sp-runtime", @@ -10539,7 +10389,6 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "log", @@ -10555,7 +10404,6 @@ dependencies = [ [[package]] name = "sp-trie" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "hash-db", "memory-db", @@ -10570,7 +10418,6 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10587,7 +10434,6 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10598,7 +10444,6 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "impl-trait-for-tuples", "log", @@ -10798,7 +10643,6 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "platforms", ] @@ -10806,7 +10650,6 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.21", @@ -10828,7 +10671,6 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures-util", "hyper", @@ -10841,7 +10683,6 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "async-trait", "futures 0.3.21", @@ -10867,7 +10708,6 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "futures 0.3.21", "substrate-test-utils-derive", @@ -10877,7 +10717,6 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -10888,7 +10727,6 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "ansi_term", "build-helper", @@ -11507,7 +11345,6 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b8c5b846617f837116e63ab1794a5310fb960246" dependencies = [ "clap", "jsonrpsee 0.4.1", @@ -12627,3 +12464,235 @@ dependencies = [ "cc", "libc", ] + +[[patch.unused]] +name = "chain-spec-builder" +version = "2.0.0" + +[[patch.unused]] +name = "frame-support-test-compile-pass" +version = "4.0.0-dev" + +[[patch.unused]] +name = "node-bench" +version = "0.9.0-dev" + +[[patch.unused]] +name = "node-cli" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-executor" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-inspect" +version = "0.9.0-dev" + +[[patch.unused]] +name = "node-primitives" +version = "2.0.0" + +[[patch.unused]] +name = "node-rpc" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-runtime" +version = "3.0.0-dev" + +[[patch.unused]] +name = "node-runtime-generate-bags" +version = "3.0.0" + +[[patch.unused]] +name = "node-template" +version = "4.0.0-dev" + +[[patch.unused]] +name = "node-template-runtime" +version = "4.0.0-dev" + +[[patch.unused]] +name = "node-testing" +version = "3.0.0-dev" + +[[patch.unused]] +name = "pallet-asset-tx-payment" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-atomic-swap" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-aura" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-bags-list-fuzzer" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-child-bounties" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-contracts" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-contracts-primitives" +version = "5.0.0" + +[[patch.unused]] +name = "pallet-contracts-proc-macro" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-contracts-rpc" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-contracts-rpc-runtime-api" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-conviction-voting" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-example-basic" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-example-offchain-worker" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-example-parallel" +version = "3.0.0-dev" + +[[patch.unused]] +name = "pallet-lottery" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-node-authorization" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-randomness-collective-flip" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-referenda" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-scored-pool" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-template" +version = "4.0.0-dev" + +[[patch.unused]] +name = "pallet-transaction-storage" +version = "4.0.0-dev" + +[[patch.unused]] +name = "sc-consensus-aura" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sc-consensus-manual-seal" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sc-consensus-pow" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sc-network-test" +version = "0.8.0" + +[[patch.unused]] +name = "sc-runtime-test" +version = "2.0.0" + +[[patch.unused]] +name = "sc-service-test" +version = "2.0.0" + +[[patch.unused]] +name = "sp-api-test" +version = "2.0.1" + +[[patch.unused]] +name = "sp-application-crypto-test" +version = "2.0.0" + +[[patch.unused]] +name = "sp-arithmetic-fuzzer" +version = "2.0.0" + +[[patch.unused]] +name = "sp-consensus-aura" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sp-consensus-pow" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sp-npos-elections-fuzzer" +version = "2.0.0-alpha.5" + +[[patch.unused]] +name = "sp-runtime-interface-test" +version = "2.0.0" + +[[patch.unused]] +name = "sp-runtime-interface-test-wasm" +version = "2.0.0" + +[[patch.unused]] +name = "sp-runtime-interface-test-wasm-deprecated" +version = "2.0.0" + +[[patch.unused]] +name = "sp-sandbox" +version = "0.10.0-dev" + +[[patch.unused]] +name = "sp-test-primitives" +version = "2.0.0" + +[[patch.unused]] +name = "subkey" +version = "2.0.1" + +[[patch.unused]] +name = "substrate-frame-cli" +version = "4.0.0-dev" + +[[patch.unused]] +name = "substrate-frame-rpc-support" +version = "3.0.0" + +[[patch.unused]] +name = "substrate-test-runtime" +version = "2.0.0" + +[[patch.unused]] +name = "substrate-test-runtime-client" +version = "2.0.0" + +[[patch.unused]] +name = "substrate-test-runtime-transaction-pool" +version = "2.0.0" + +[[patch.unused]] +name = "substrate-test-utils-test-crate" +version = "0.1.0" From 96fcf7b0a4115e512f3a66ae48cff6b6a91901ee Mon Sep 17 00:00:00 2001 From: Gavin Wood Date: Fri, 4 Mar 2022 15:50:55 +0100 Subject: [PATCH 10/17] Update xcm/xcm-builder/src/asset_conversion.rs Co-authored-by: Keith Yeung --- xcm/xcm-builder/src/asset_conversion.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcm/xcm-builder/src/asset_conversion.rs b/xcm/xcm-builder/src/asset_conversion.rs index dacc94cebb95..1a13f1ffb444 100644 --- a/xcm/xcm-builder/src/asset_conversion.rs +++ b/xcm/xcm-builder/src/asset_conversion.rs @@ -1,4 +1,4 @@ -// Copyright 2020 Parity Technologies (UK) Ltd. +// Copyright 2022 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify From b25fc3251997397c9dbdae7aa4843b403be9adf9 Mon Sep 17 00:00:00 2001 From: Gavin Wood Date: Fri, 4 Mar 2022 15:50:59 +0100 Subject: [PATCH 11/17] Update xcm/xcm-builder/src/nonfungibles_adapter.rs Co-authored-by: Keith Yeung --- xcm/xcm-builder/src/nonfungibles_adapter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcm/xcm-builder/src/nonfungibles_adapter.rs b/xcm/xcm-builder/src/nonfungibles_adapter.rs index 61c4f6730ddc..14a749022be0 100644 --- a/xcm/xcm-builder/src/nonfungibles_adapter.rs +++ b/xcm/xcm-builder/src/nonfungibles_adapter.rs @@ -1,4 +1,4 @@ -// Copyright 2020 Parity Technologies (UK) Ltd. +// Copyright 2022 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify From dd3f88122732bd9b86d5c01262691f83f38e7fe4 Mon Sep 17 00:00:00 2001 From: Gavin Wood Date: Fri, 4 Mar 2022 15:51:08 +0100 Subject: [PATCH 12/17] Update xcm/xcm-executor/src/lib.rs Co-authored-by: Keith Yeung --- xcm/xcm-executor/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index 0c39cc3e3315..d313f6fa2dda 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -402,7 +402,7 @@ impl XcmExecutor { /// Process a single XCM instruction, mutating the state of the XCM virtual machine. fn process_instruction(&mut self, instr: Instruction) -> Result<(), XcmError> { log::trace!( - target: "xcm::execute", + target: "xcm::process_instruction", "=== {:?}", instr ); From d125329ff12ba4a67e15224b20e02c5854ad747f Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 7 Mar 2022 09:52:10 +0100 Subject: [PATCH 13/17] Fixes --- xcm/xcm-simulator/example/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcm/xcm-simulator/example/src/lib.rs b/xcm/xcm-simulator/example/src/lib.rs index 159e67a60669..149cb7491e82 100644 --- a/xcm/xcm-simulator/example/src/lib.rs +++ b/xcm/xcm-simulator/example/src/lib.rs @@ -284,7 +284,7 @@ mod tests { Relay::execute_with(|| { use pallet_balances::{BalanceLock, Reasons}; assert_eq!( - relay_chain::Balances::locks(¶_account_id(2)), + relay_chain::Balances::locks(&child_account_id(2)), vec![BalanceLock { id: *b"py/xcmlk", amount: locked_amount, From 2f6cca4382732a6e135f2785f25e09bec9d84ee8 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 7 Mar 2022 10:45:33 +0100 Subject: [PATCH 14/17] Fixes --- runtime/parachains/src/ump/benchmarking.rs | 6 +++--- runtime/westend/src/weights/xcm/mod.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/parachains/src/ump/benchmarking.rs b/runtime/parachains/src/ump/benchmarking.rs index 2c132324d44a..0d38e77b7b71 100644 --- a/runtime/parachains/src/ump/benchmarking.rs +++ b/runtime/parachains/src/ump/benchmarking.rs @@ -42,7 +42,7 @@ fn queue_upward_msg( fn create_message_min_size(size: u32) -> Vec { // Create a message with an empty remark call to determine the encoding overhead let msg_size_empty_transact = VersionedXcm::::from(Xcm::(vec![Transact { - origin_type: OriginKind::SovereignAccount, + origin_kind: OriginKind::SovereignAccount, require_weight_at_most: Weight::MAX, call: frame_system::Call::::remark_with_event { remark: vec![] }.encode().into(), }])) @@ -54,7 +54,7 @@ fn create_message_min_size(size: u32) -> Vec { let mut remark = Vec::new(); remark.resize(size, 0u8); let msg = VersionedXcm::::from(Xcm::(vec![Transact { - origin_type: OriginKind::SovereignAccount, + origin_kind: OriginKind::SovereignAccount, require_weight_at_most: Weight::MAX, call: frame_system::Call::::remark_with_event { remark }.encode().into(), }])) @@ -69,7 +69,7 @@ fn create_message_overweight() -> Vec { // We use a `set_code` Call because it let call = frame_system::Call::::set_code { code: vec![] }; VersionedXcm::::from(Xcm::(vec![Transact { - origin_type: OriginKind::Superuser, + origin_kind: OriginKind::Superuser, require_weight_at_most: max_block_weight, call: call.encode().into(), }])) diff --git a/runtime/westend/src/weights/xcm/mod.rs b/runtime/westend/src/weights/xcm/mod.rs index 77fba4396aaa..226328992e0f 100644 --- a/runtime/westend/src/weights/xcm/mod.rs +++ b/runtime/westend/src/weights/xcm/mod.rs @@ -98,7 +98,7 @@ impl XcmWeightInfo for WestendXcmWeight { assets.weigh_multi_assets(XcmBalancesWeight::::transfer_reserve_asset()) } fn transact( - _origin_type: &OriginKind, + _origin_kind: &OriginKind, _require_weight_at_most: &u64, _call: &DoubleEncoded, ) -> Weight { From 0ace1ed77a0d8d90d990488ffc9f9bf5ccefd8f5 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 7 Mar 2022 11:50:24 +0100 Subject: [PATCH 15/17] Fixes --- xcm/xcm-executor/src/lib.rs | 14 +++++++++----- xcm/xcm-simulator/example/src/lib.rs | 4 +--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index d313f6fa2dda..ac7407aed78d 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -737,11 +737,13 @@ impl XcmExecutor { }, LockAsset { asset, unlocker } => { let origin = self.origin.as_ref().ok_or(XcmError::BadOrigin)?.clone(); - let remote_asset = Self::try_reanchor(asset.clone(), &unlocker)?; + let (remote_asset, context) = Self::try_reanchor(asset.clone(), &unlocker)?; let lock_ticket = Config::AssetLocker::prepare_lock(unlocker.clone(), asset, origin.clone())?; + let owner = origin.reanchored(&unlocker, &context) + .map_err(|_| XcmError::ReanchorFailed)?; let msg = - Xcm::<()>(vec![NoteUnlockable { asset: remote_asset, owner: origin.clone() }]); + Xcm::<()>(vec![NoteUnlockable { asset: remote_asset, owner }]); let (ticket, price) = validate_send::(unlocker, msg)?; self.take_fee(price, FeeReason::LockAsset)?; lock_ticket.enact()?; @@ -760,7 +762,7 @@ impl XcmExecutor { }, RequestUnlock { asset, locker } => { let origin = self.origin.as_ref().ok_or(XcmError::BadOrigin)?.clone(); - let remote_asset = Self::try_reanchor(asset.clone(), &locker)?; + let remote_asset = Self::try_reanchor(asset.clone(), &locker)?.0; let reduce_ticket = Config::AssetLocker::prepare_reduce_unlockable( locker.clone(), asset, @@ -856,9 +858,11 @@ impl XcmExecutor { fn try_reanchor( asset: MultiAsset, destination: &MultiLocation, - ) -> Result { + ) -> Result<(MultiAsset, MultiLocation), XcmError> { let context = Config::LocationInverter::universal_location().into(); - asset.reanchored(&destination, &context).map_err(|()| XcmError::ReanchorFailed) + let asset = asset.reanchored(&destination, &context) + .map_err(|()| XcmError::ReanchorFailed)?; + Ok((asset, context)) } /// NOTE: Any assets which were unable to be reanchored are introduced into `failed_bin`. diff --git a/xcm/xcm-simulator/example/src/lib.rs b/xcm/xcm-simulator/example/src/lib.rs index 149cb7491e82..57fdf2e6945c 100644 --- a/xcm/xcm-simulator/example/src/lib.rs +++ b/xcm/xcm-simulator/example/src/lib.rs @@ -274,9 +274,7 @@ mod tests { ParaB::execute_with(|| { let message = Xcm(vec![ - WithdrawAsset((Here, locked_amount).into()), - buy_execution((Here, locked_amount)), - LockAsset { asset: (Here, locked_amount).into(), unlocker: Parachain(1).into() }, + LockAsset { asset: (Here, locked_amount).into(), unlocker: (Parachain(1),).into() }, ]); assert_ok!(ParachainPalletXcm::send_xcm(Here, Parent, message.clone())); }); From 6ed4fd86fd43cbacaa76d1e19b331b2df2eeb4de Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 7 Mar 2022 12:07:06 +0100 Subject: [PATCH 16/17] Formatting --- xcm/xcm-executor/src/lib.rs | 10 +++++----- xcm/xcm-simulator/example/src/lib.rs | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index ac7407aed78d..ec7f583128e9 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -740,10 +740,9 @@ impl XcmExecutor { let (remote_asset, context) = Self::try_reanchor(asset.clone(), &unlocker)?; let lock_ticket = Config::AssetLocker::prepare_lock(unlocker.clone(), asset, origin.clone())?; - let owner = origin.reanchored(&unlocker, &context) - .map_err(|_| XcmError::ReanchorFailed)?; - let msg = - Xcm::<()>(vec![NoteUnlockable { asset: remote_asset, owner }]); + let owner = + origin.reanchored(&unlocker, &context).map_err(|_| XcmError::ReanchorFailed)?; + let msg = Xcm::<()>(vec![NoteUnlockable { asset: remote_asset, owner }]); let (ticket, price) = validate_send::(unlocker, msg)?; self.take_fee(price, FeeReason::LockAsset)?; lock_ticket.enact()?; @@ -860,7 +859,8 @@ impl XcmExecutor { destination: &MultiLocation, ) -> Result<(MultiAsset, MultiLocation), XcmError> { let context = Config::LocationInverter::universal_location().into(); - let asset = asset.reanchored(&destination, &context) + let asset = asset + .reanchored(&destination, &context) .map_err(|()| XcmError::ReanchorFailed)?; Ok((asset, context)) } diff --git a/xcm/xcm-simulator/example/src/lib.rs b/xcm/xcm-simulator/example/src/lib.rs index 57fdf2e6945c..d9c08a5f369f 100644 --- a/xcm/xcm-simulator/example/src/lib.rs +++ b/xcm/xcm-simulator/example/src/lib.rs @@ -273,9 +273,10 @@ mod tests { let locked_amount = 100; ParaB::execute_with(|| { - let message = Xcm(vec![ - LockAsset { asset: (Here, locked_amount).into(), unlocker: (Parachain(1),).into() }, - ]); + let message = Xcm(vec![LockAsset { + asset: (Here, locked_amount).into(), + unlocker: (Parachain(1),).into(), + }]); assert_ok!(ParachainPalletXcm::send_xcm(Here, Parent, message.clone())); }); From c106456118c3d47aa5c27df336c18daaaec34d29 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 7 Mar 2022 12:25:38 +0100 Subject: [PATCH 17/17] Fixes --- xcm/xcm-builder/src/matches_token.rs | 6 +++--- xcm/xcm-builder/src/tests/locking.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xcm/xcm-builder/src/matches_token.rs b/xcm/xcm-builder/src/matches_token.rs index cce4f06b4416..aa0454fea8f0 100644 --- a/xcm/xcm-builder/src/matches_token.rs +++ b/xcm/xcm-builder/src/matches_token.rs @@ -76,19 +76,19 @@ impl, I: TryFrom> MatchesNonFungible for /// ``` /// use xcm::latest::prelude::*; /// use xcm_builder::IsAbstract; -/// use xcm_executor::traits::MatchesFungible; +/// use xcm_executor::traits::{MatchesFungible, MatchesNonFungible}; /// /// frame_support::parameter_types! { /// pub TargetLocation: [u8; 32] = [7u8; 32]; /// } /// /// # fn main() { -/// let asset = ([7u8; 32], 999).into(); +/// let asset = ([7u8; 32], 999u128).into(); /// // match `asset` if it is an abstract asset in `TargetLocation`. /// assert_eq!( as MatchesFungible>::matches_fungible(&asset), Some(999)); /// let nft = ([7u8; 32], [42u8; 4]).into(); /// assert_eq!( -/// as MatchesFungible<[u8; 4]>>::matches_fungible(&asset), +/// as MatchesNonFungible<[u8; 4]>>::matches_nonfungible(&nft), /// Some([42u8; 4]) /// ); /// # } diff --git a/xcm/xcm-builder/src/tests/locking.rs b/xcm/xcm-builder/src/tests/locking.rs index 4e5c97c1b074..d6afe08e4970 100644 --- a/xcm/xcm-builder/src/tests/locking.rs +++ b/xcm/xcm-builder/src/tests/locking.rs @@ -47,7 +47,7 @@ fn lock_roundtrip_should_work() { vec![( (Parent, Parachain(1)).into(), Xcm::<()>(vec![NoteUnlockable { - owner: (3u64,).into(), + owner: (Parent, Parachain(42), 3u64).into(), asset: (Parent, 100u128).into() },]), )]