From e2899578593a6bd32016837b1e40a10c70d95a9a Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Mon, 13 Sep 2021 13:05:57 +1200 Subject: [PATCH 01/12] Fix compiling errors. --- Cargo.dev.toml | 120 ++++++++++++++-------------- traits/src/location.rs | 65 ++++++++------- traits/src/xcm_transfer.rs | 2 +- xcm-support/src/currency_adapter.rs | 2 +- xcm-support/src/lib.rs | 6 +- xcm-support/src/tests.rs | 76 +++++++++--------- xcm/src/lib.rs | 18 ++--- xtokens/Cargo.toml | 2 +- xtokens/src/lib.rs | 74 +++++++++-------- xtokens/src/mock/mod.rs | 40 ++++------ xtokens/src/mock/para.rs | 46 +++++------ xtokens/src/mock/relay.rs | 10 +-- xtokens/src/tests.rs | 110 ++++++++++++------------- 13 files changed, 285 insertions(+), 286 deletions(-) diff --git a/Cargo.dev.toml b/Cargo.dev.toml index d10b60be5..9cf1a8f10 100644 --- a/Cargo.dev.toml +++ b/Cargo.dev.toml @@ -31,65 +31,69 @@ resolver = "2" split-debuginfo = "unpacked" [patch.'https://github.com/paritytech/substrate'] -frame-benchmarking = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -frame-support = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -frame-system = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-authorship = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-balances = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-elections-phragmen = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-offences = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-scheduler = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-session = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-staking = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-timestamp = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-treasury = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -pallet-vesting = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sc-client-api = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sc-client-db = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sc-executor = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sc-executor-common = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sc-executor-wasmi = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-api = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-application-crypto = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-arithmetic = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-authorship = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-blockchain = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-consensus = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-core = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-debug-derive = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-externalities = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-inherents = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-io = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-keystore = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-npos-elections = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-npos-elections-compact = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-panic-handler = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-runtime = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-runtime-interface = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-session = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-staking = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-state-machine = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-std = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-storage = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-tasks = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-timestamp = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-trie = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-version = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-wasm-interface = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } -sp-utils = { git = "https://github.com/paritytech//substrate", rev = "91061a7d925b5bc597804293da283477512ba4ff" } +frame-benchmarking = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +frame-support = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +frame-system = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-authorship = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-balances = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-elections-phragmen = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-offences = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-scheduler = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-session = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-staking = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-timestamp = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-treasury = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +pallet-vesting = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sc-client-api = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sc-client-db = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sc-executor = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sc-executor-common = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sc-executor-wasmi = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-api = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-application-crypto = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-arithmetic = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-authorship = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-blockchain = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-consensus = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-core = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-debug-derive = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-externalities = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-inherents = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-io = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-keystore = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-npos-elections = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } + +sp-panic-handler = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-runtime = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-runtime-interface = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-session = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-staking = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-state-machine = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-std = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-storage = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-tasks = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-timestamp = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-trie = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-version = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-wasm-interface = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +sp-utils = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } [patch.'https://github.com/paritytech/cumulus'] -cumulus-primitives-core = { git = "https://github.com/paritytech//cumulus", rev = "fd80849dde5c209c20a996cfcc5aaacd4666dcbe" } -parachain-info = { git = "https://github.com/paritytech//cumulus", rev = "fd80849dde5c209c20a996cfcc5aaacd4666dcbe" } +cumulus-primitives-core = { git = "https://github.com/paritytech//cumulus", rev = "f2f4f642ec113b42e766e85b11cc47a845b974ab" } +parachain-info = { git = "https://github.com/paritytech//cumulus", rev = "f2f4f642ec113b42e766e85b11cc47a845b974ab" } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "f2f4f642ec113b42e766e85b11cc47a845b974ab" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "f2f4f642ec113b42e766e85b11cc47a845b974ab" } +cumulus-pallet-xcm = { git = "https://github.com/paritytech//cumulus", rev = "f2f4f642ec113b42e766e85b11cc47a845b974ab" } [patch.'https://github.com/paritytech/polkadot'] -xcm = { git = "https://github.com/paritytech//polkadot", rev = "7a9f624777ad2d2adb3a1e6797a31f9d653c9587" } -xcm-executor = { git = "https://github.com/paritytech//polkadot", rev = "7a9f624777ad2d2adb3a1e6797a31f9d653c9587" } -xcm-builder = { git = "https://github.com/paritytech//polkadot", rev = "7a9f624777ad2d2adb3a1e6797a31f9d653c9587" } -pallet-xcm = { git = "https://github.com/paritytech//polkadot", rev = "7a9f624777ad2d2adb3a1e6797a31f9d653c9587" } -polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot", rev = "7a9f624777ad2d2adb3a1e6797a31f9d653c9587" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot", rev = "7a9f624777ad2d2adb3a1e6797a31f9d653c9587" } -polkadot-parachain = { git = "https://github.com/paritytech//polkadot", rev = "7a9f624777ad2d2adb3a1e6797a31f9d653c9587" } -polkadot-primitives = { git = "https://github.com/paritytech//polkadot", rev = "7a9f624777ad2d2adb3a1e6797a31f9d653c9587" } +xcm = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } +xcm-executor = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } +xcm-builder = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } +pallet-xcm = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } +polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } +polkadot-parachain = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } +polkadot-primitives = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } +xcm-simulator = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } diff --git a/traits/src/location.rs b/traits/src/location.rs index 95620b0ce..6d863e616 100644 --- a/traits/src/location.rs +++ b/traits/src/location.rs @@ -1,7 +1,4 @@ -use xcm::v0::{ - Junction::{self, *}, - MultiAsset, MultiLocation, -}; +use xcm::latest::prelude::*; pub trait Parse { /// Returns the "chain" location part. It could be parent, sibling @@ -12,27 +9,30 @@ pub trait Parse { } fn is_chain_junction(junction: Option<&Junction>) -> bool { - matches!(junction, Some(Parent) | Some(Parachain(_))) + matches!(junction, Some(Parachain(_))) } impl Parse for MultiLocation { fn chain_part(&self) -> Option { - match (self.first(), self.at(1)) { - (Some(Parent), Some(Parachain(id))) => Some((Parent, Parachain(*id)).into()), - (Some(Parent), _) => Some(Parent.into()), - (Some(Parachain(id)), _) => Some(Parachain(*id).into()), + match (self.parents, self.first_interior()) { + // sibling parachain + (1, Some(Parachain(id))) => Some(MultiLocation::new(1, X1(Parachain(*id)))), + // parent + (1, _) => Some(MultiLocation::parent()), + // children parachain + (0, Some(Parachain(id))) => Some(MultiLocation::new(0, X1(Parachain(*id)))), _ => None, } } fn non_chain_part(&self) -> Option { - let mut location = self.clone(); - while is_chain_junction(location.first()) { - let _ = location.take_first(); + let mut junctions = self.interior().clone(); + while is_chain_junction(junctions.first()) { + let _ = junctions.take_first(); } - if location != MultiLocation::Null { - Some(location) + if junctions != Here { + Some(MultiLocation::new(0, junctions)) } else { None } @@ -46,8 +46,8 @@ pub trait Reserve { impl Reserve for MultiAsset { fn reserve(&self) -> Option { - if let MultiAsset::ConcreteFungible { id, .. } = self { - id.chain_part() + if let Concrete(location) = &self.id { + location.chain_part() } else { None } @@ -59,32 +59,35 @@ mod tests { use super::*; const PARACHAIN: Junction = Parachain(1); - const GENERAL_INDEX: Junction = GeneralIndex { id: 1 }; + const GENERAL_INDEX: Junction = GeneralIndex(1); fn concrete_fungible(id: MultiLocation) -> MultiAsset { - MultiAsset::ConcreteFungible { id, amount: 1 } + MultiAsset { + fun: Fungible(1), + id: Concrete(id), + } } #[test] fn parent_as_reserve_chain() { assert_eq!( - concrete_fungible(MultiLocation::X2(Parent, GENERAL_INDEX)).reserve(), - Some(Parent.into()) + concrete_fungible(MultiLocation::new(1, X1(GENERAL_INDEX))).reserve(), + Some(MultiLocation::parent()) ); } #[test] fn sibling_parachain_as_reserve_chain() { assert_eq!( - concrete_fungible(MultiLocation::X3(Parent, PARACHAIN, GENERAL_INDEX)).reserve(), - Some((Parent, PARACHAIN).into()) + concrete_fungible(MultiLocation::new(1, X2(PARACHAIN, GENERAL_INDEX))).reserve(), + Some(MultiLocation::new(1, X1(PARACHAIN))) ); } #[test] fn child_parachain_as_reserve_chain() { assert_eq!( - concrete_fungible(MultiLocation::X2(PARACHAIN, GENERAL_INDEX)).reserve(), + concrete_fungible(MultiLocation::new(0, X2(PARACHAIN, GENERAL_INDEX))).reserve(), Some(PARACHAIN.into()) ); } @@ -92,31 +95,31 @@ mod tests { #[test] fn no_reserve_chain() { assert_eq!( - concrete_fungible(MultiLocation::X1(GeneralKey("DOT".into()))).reserve(), + concrete_fungible(MultiLocation::new(0, X1(GeneralKey("DOT".into())))).reserve(), None ); } #[test] fn non_chain_part_works() { - assert_eq!(MultiLocation::X1(Parent).non_chain_part(), None); - assert_eq!(MultiLocation::X2(Parent, PARACHAIN).non_chain_part(), None); - assert_eq!(MultiLocation::X1(PARACHAIN).non_chain_part(), None); + assert_eq!(MultiLocation::parent().non_chain_part(), None); + assert_eq!(MultiLocation::new(1, X1(PARACHAIN)).non_chain_part(), None); + assert_eq!(MultiLocation::new(0, X1(PARACHAIN)).non_chain_part(), None); assert_eq!( - MultiLocation::X2(Parent, GENERAL_INDEX).non_chain_part(), + MultiLocation::new(1, X1(GENERAL_INDEX)).non_chain_part(), Some(GENERAL_INDEX.into()) ); assert_eq!( - MultiLocation::X3(Parent, GENERAL_INDEX, GENERAL_INDEX).non_chain_part(), + MultiLocation::new(1, X2(GENERAL_INDEX, GENERAL_INDEX)).non_chain_part(), Some((GENERAL_INDEX, GENERAL_INDEX).into()) ); assert_eq!( - MultiLocation::X3(Parent, PARACHAIN, GENERAL_INDEX).non_chain_part(), + MultiLocation::new(1, X2(PARACHAIN, GENERAL_INDEX)).non_chain_part(), Some(GENERAL_INDEX.into()) ); assert_eq!( - MultiLocation::X2(PARACHAIN, GENERAL_INDEX).non_chain_part(), + MultiLocation::new(0, X2(PARACHAIN, GENERAL_INDEX)).non_chain_part(), Some(GENERAL_INDEX.into()) ); } diff --git a/traits/src/xcm_transfer.rs b/traits/src/xcm_transfer.rs index ae08ef1cf..ae7caf6cc 100644 --- a/traits/src/xcm_transfer.rs +++ b/traits/src/xcm_transfer.rs @@ -1,6 +1,6 @@ use frame_support::dispatch::DispatchResult; use frame_support::weights::Weight; -use xcm::opaque::v0::{MultiAsset, MultiLocation}; +use xcm::opaque::latest::{MultiAsset, MultiLocation}; /// Abstraction over cross-chain token transfers. pub trait XcmTransfer { diff --git a/xcm-support/src/currency_adapter.rs b/xcm-support/src/currency_adapter.rs index 202f170e8..0db047811 100644 --- a/xcm-support/src/currency_adapter.rs +++ b/xcm-support/src/currency_adapter.rs @@ -8,7 +8,7 @@ use sp_std::{ result, }; -use xcm::v0::{Error as XcmError, MultiAsset, MultiLocation, Result}; +use xcm::latest::{Error as XcmError, MultiAsset, MultiLocation, Result}; use xcm_executor::{ traits::{Convert as MoreConvert, MatchesFungible, TransactAsset}, Assets, diff --git a/xcm-support/src/lib.rs b/xcm-support/src/lib.rs index 4ad1c3eb6..2a68197e5 100644 --- a/xcm-support/src/lib.rs +++ b/xcm-support/src/lib.rs @@ -13,7 +13,7 @@ use frame_support::dispatch::{DispatchError, DispatchResult}; use sp_runtime::traits::{CheckedConversion, Convert}; use sp_std::{convert::TryFrom, marker::PhantomData, prelude::*}; -use xcm::v0::{MultiAsset, MultiLocation}; +use xcm::latest::prelude::*; use xcm_executor::traits::{FilterAssetLocation, MatchesFungible}; use orml_traits::location::Reserve; @@ -33,8 +33,8 @@ where Amount: TryFrom, { fn matches_fungible(a: &MultiAsset) -> Option { - if let MultiAsset::ConcreteFungible { id, amount } = a { - if CurrencyIdConvert::convert(id.clone()).is_some() { + if let (Fungible(ref amount), Concrete(ref location)) = (&a.fun, &a.id) { + if CurrencyIdConvert::convert(location.clone()).is_some() { return CheckedConversion::checked_from(*amount); } } diff --git a/xcm-support/src/tests.rs b/xcm-support/src/tests.rs index a05082603..54c074a38 100644 --- a/xcm-support/src/tests.rs +++ b/xcm-support/src/tests.rs @@ -4,8 +4,6 @@ use super::*; -use xcm::v0::{Junction::*, MultiAsset::ConcreteFungible, MultiLocation::*}; - #[derive(Debug, PartialEq, Eq)] pub enum TestCurrencyId { TokenA, @@ -19,12 +17,17 @@ impl Convert> for CurrencyIdConvert { use TestCurrencyId::*; let token_a: Vec = "TokenA".into(); let token_b: Vec = "TokenB".into(); - match l { - X1(Parent) => Some(RelayChainToken), - X3(Parent, Parachain(1), GeneralKey(k)) if k == token_a => Some(TokenA), - X3(Parent, Parachain(2), GeneralKey(k)) if k == token_b => Some(TokenB), - _ => None, + + if l == MultiLocation::parent() { + return Some(RelayChainToken); + } + if l == MultiLocation::new(1, X2(Parachain(1), GeneralKey(token_a))) { + return Some(TokenA); } + if l == MultiLocation::new(1, X2(Parachain(2), GeneralKey(token_b))) { + return Some(TokenB); + } + None } } @@ -33,23 +36,24 @@ type MatchesCurrencyId = IsNativeConcrete; #[test] fn is_native_concrete_matches_native_currencies() { assert_eq!( - MatchesCurrencyId::matches_fungible(&ConcreteFungible { - id: X1(Parent), - amount: 100 + MatchesCurrencyId::matches_fungible(&MultiAsset { + fun: Fungible(100), + id: Concrete(MultiLocation::parent()), }), Some(100), ); + assert_eq!( - MatchesCurrencyId::matches_fungible(&ConcreteFungible { - id: X3(Parent, Parachain(1), GeneralKey("TokenA".into())), - amount: 100 + MatchesCurrencyId::matches_fungible(&MultiAsset { + fun: Fungible(100), + id: Concrete(MultiLocation::new(1, X2(Parachain(1), GeneralKey("TokenA".into())))), }), Some(100), ); assert_eq!( - MatchesCurrencyId::matches_fungible(&ConcreteFungible { - id: X3(Parent, Parachain(2), GeneralKey("TokenB".into())), - amount: 100 + MatchesCurrencyId::matches_fungible(&MultiAsset { + fun: Fungible(100), + id: Concrete(MultiLocation::new(1, X2(Parachain(2), GeneralKey("TokenB".into())))), }), Some(100), ); @@ -58,23 +62,23 @@ fn is_native_concrete_matches_native_currencies() { #[test] fn is_native_concrete_does_not_matches_non_native_currencies() { assert!( - >::matches_fungible(&ConcreteFungible { - id: X3(Parent, Parachain(2), GeneralKey("TokenC".into())), - amount: 100 + >::matches_fungible(&MultiAsset { + fun: Fungible(100), + id: Concrete(MultiLocation::new(1, X2(Parachain(2), GeneralKey("TokenC".into())))), }) .is_none() ); assert!( - >::matches_fungible(&ConcreteFungible { - id: X3(Parent, Parachain(1), GeneralKey("TokenB".into())), - amount: 100 + >::matches_fungible(&MultiAsset { + fun: Fungible(100), + id: Concrete(MultiLocation::new(1, X2(Parachain(1), GeneralKey("TokenB".into())))), }) .is_none() ); assert!( - >::matches_fungible(&ConcreteFungible { - id: X1(GeneralKey("TokenB".into())), - amount: 100 + >::matches_fungible(&MultiAsset { + fun: Fungible(100), + id: Concrete(MultiLocation::new(1, X1(GeneralKey("TokenB".into())))), }) .is_none() ); @@ -83,24 +87,24 @@ fn is_native_concrete_does_not_matches_non_native_currencies() { #[test] fn multi_native_asset() { assert!(MultiNativeAsset::filter_asset_location( - &ConcreteFungible { - id: Parent.into(), - amount: 10, + &MultiAsset { + fun: Fungible(10), + id: Concrete(MultiLocation::parent()) }, &Parent.into() )); assert!(MultiNativeAsset::filter_asset_location( - &ConcreteFungible { - id: X3(Parent, Parachain(1), GeneralKey("TokenA".into())), - amount: 10, + &MultiAsset { + fun: Fungible(100), + id: Concrete(MultiLocation::new(1, X2(Parachain(1), GeneralKey("TokenA".into())))), }, - &X2(Parent, Parachain(1)), + &MultiLocation::new(1, X1(Parachain(1))), )); assert!(!MultiNativeAsset::filter_asset_location( - &ConcreteFungible { - id: X3(Parent, Parachain(1), GeneralKey("TokenA".into())), - amount: 10, + &MultiAsset { + fun: Fungible(100), + id: Concrete(MultiLocation::new(1, X2(Parachain(1), GeneralKey("TokenA".into())))), }, - &X1(Parent), + &MultiLocation::parent(), )); } diff --git a/xcm/src/lib.rs b/xcm/src/lib.rs index 72f80bd15..11c5dd69c 100644 --- a/xcm/src/lib.rs +++ b/xcm/src/lib.rs @@ -7,7 +7,7 @@ use frame_support::{pallet_prelude::*, traits::EnsureOrigin}; use frame_system::pallet_prelude::*; use sp_std::boxed::Box; -use xcm::v0::prelude::*; +use xcm::latest::prelude::*; pub use module::*; @@ -31,8 +31,8 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// XCM message sent. \[from, to, message\] - Sent(MultiLocation, MultiLocation, Xcm<()>), + /// XCM message sent. \[to, message\] + Sent(MultiLocation, Xcm<()>), } #[pallet::error] @@ -55,13 +55,11 @@ pub mod module { message: Box>, ) -> DispatchResult { let _ = T::SovereignOrigin::ensure_origin(origin)?; - pallet_xcm::Pallet::::send_xcm(MultiLocation::Null, *dest.clone(), *message.clone()).map_err( - |e| match e { - XcmError::CannotReachDestination(..) => Error::::Unreachable, - _ => Error::::SendFailure, - }, - )?; - Self::deposit_event(Event::Sent(MultiLocation::Null, *dest, *message)); + pallet_xcm::Pallet::::send_xcm(Here, *dest.clone(), *message.clone()).map_err(|e| match e { + XcmError::CannotReachDestination(..) => Error::::Unreachable, + _ => Error::::SendFailure, + })?; + Self::deposit_event(Event::Sent(*dest, *message)); Ok(()) } } diff --git a/xtokens/Cargo.toml b/xtokens/Cargo.toml index 23f9dac58..6b4f6b9ff 100644 --- a/xtokens/Cargo.toml +++ b/xtokens/Cargo.toml @@ -43,10 +43,10 @@ xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "relea xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" } pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" } polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" } +xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9"} orml-tokens = { path = "../tokens" } orml-xcm = { path = "../xcm" } -xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9"} [features] default = ["std"] diff --git a/xtokens/src/lib.rs b/xtokens/src/lib.rs index 983fa31df..54db2d5a1 100644 --- a/xtokens/src/lib.rs +++ b/xtokens/src/lib.rs @@ -30,7 +30,7 @@ use sp_runtime::{ }; use sp_std::prelude::*; -use xcm::v0::prelude::*; +use xcm::latest::prelude::*; use xcm_executor::traits::WeightBounds; pub use module::*; @@ -188,12 +188,12 @@ pub mod module { dest: MultiLocation, dest_weight: Weight, ) -> DispatchResult { - let id: MultiLocation = T::CurrencyIdConvert::convert(currency_id.clone()) + let location: MultiLocation = T::CurrencyIdConvert::convert(currency_id.clone()) .ok_or(Error::::NotCrossChainTransferableCurrency)?; - let asset = MultiAsset::ConcreteFungible { - id, - amount: amount.into(), + let asset = MultiAsset { + fun: Fungible(amount.into()), + id: Concrete(location), }; Self::do_transfer_multiasset(who.clone(), asset, dest.clone(), dest_weight, false)?; @@ -213,13 +213,15 @@ pub mod module { } let (transfer_kind, dest, reserve, recipient) = Self::transfer_kind(&asset, &dest)?; + // let all: MultiAssets = All.into(); let buy_order = BuyExecution { - fees: All, + // TODO: fix this + fees: asset.clone(), // Zero weight for additional XCM (since there are none to execute) weight: 0, debt: dest_weight, halt_on_error: false, - xcm: vec![], + instructions: vec![], }; let mut msg = match transfer_kind { SelfReserveAsset => { @@ -251,11 +253,12 @@ pub mod module { buy_order: Order<()>, ) -> Xcm { WithdrawAsset { - assets: vec![asset], + assets: asset.into(), effects: vec![DepositReserveAsset { - assets: vec![MultiAsset::All], + assets: All.into(), dest, effects: vec![buy_order, Self::deposit_asset(recipient)], + max_assets: u32::max_value(), }], } } @@ -267,9 +270,9 @@ pub mod module { buy_order: Order<()>, ) -> Xcm { WithdrawAsset { - assets: vec![asset], + assets: asset.into(), effects: vec![InitiateReserveWithdraw { - assets: vec![MultiAsset::All], + assets: All.into(), reserve, effects: vec![buy_order, Self::deposit_asset(recipient)], }], @@ -284,23 +287,30 @@ pub mod module { buy_order: Order<()>, ) -> Xcm { let mut reanchored_dest = dest.clone(); - if reserve == Parent.into() { - if let MultiLocation::X2(Parent, Parachain(id)) = dest { - reanchored_dest = Parachain(id).into(); + if reserve == MultiLocation::parent() { + match dest { + MultiLocation { + parents, + interior: X1(Parachain(id)), + } if parents == 1 => { + reanchored_dest = Parachain(id).into(); + } + _ => {} } } WithdrawAsset { - assets: vec![asset], + assets: asset.into(), effects: vec![InitiateReserveWithdraw { - assets: vec![MultiAsset::All], + assets: All.into(), reserve, effects: vec![ buy_order.clone(), DepositReserveAsset { - assets: vec![MultiAsset::All], + assets: All.into(), dest: reanchored_dest, effects: vec![buy_order, Self::deposit_asset(recipient)], + max_assets: u32::max_value(), }, ], }], @@ -309,19 +319,14 @@ pub mod module { fn deposit_asset(recipient: MultiLocation) -> Order<()> { DepositAsset { - assets: vec![MultiAsset::All], - dest: recipient, + assets: All.into(), + max_assets: u32::max_value(), + beneficiary: recipient, } } fn is_zero_amount(asset: &MultiAsset) -> bool { - if let MultiAsset::ConcreteFungible { id: _, amount } = asset { - if amount.is_zero() { - return true; - } - } - - if let MultiAsset::AbstractFungible { id: _, amount } = asset { + if let Fungible(amount) = &asset.fun { if amount.is_zero() { return true; } @@ -377,18 +382,19 @@ pub mod module { if let Ok((transfer_kind, dest, _, reserve)) = Self::transfer_kind(asset, dest) { let mut msg = match transfer_kind { SelfReserveAsset => WithdrawAsset { - assets: vec![asset.clone()], + assets: MultiAssets::from(asset.clone()), effects: vec![DepositReserveAsset { - assets: vec![All], + assets: All.into(), dest, effects: vec![], + max_assets: u32::max_value(), }], }, ToReserve | ToNonReserve => { WithdrawAsset { - assets: vec![asset.clone()], + assets: MultiAssets::from(asset.clone()), effects: vec![InitiateReserveWithdraw { - assets: vec![All], + assets: All.into(), // `dest` is always (equal to) `reserve` in both cases reserve, effects: vec![], @@ -404,10 +410,10 @@ pub mod module { /// Returns weight of `transfer` call. fn weight_of_transfer(currency_id: T::CurrencyId, amount: T::Balance, dest: &MultiLocation) -> Weight { - if let Some(id) = T::CurrencyIdConvert::convert(currency_id) { - let asset = MultiAsset::ConcreteFungible { - id, - amount: amount.into(), + if let Some(location) = T::CurrencyIdConvert::convert(currency_id) { + let asset = MultiAsset { + fun: Fungible(amount.into()), + id: Concrete(location), }; Self::weight_of_transfer_multiasset(&asset, dest) } else { diff --git a/xtokens/src/mock/mod.rs b/xtokens/src/mock/mod.rs index 11ab0810d..a73847cb1 100644 --- a/xtokens/src/mock/mod.rs +++ b/xtokens/src/mock/mod.rs @@ -7,7 +7,6 @@ use serde::{Deserialize, Serialize}; use sp_io::TestExternalities; use sp_runtime::AccountId32; -use xcm::v0::{Junction, MultiLocation}; use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; pub mod para; @@ -31,23 +30,9 @@ pub struct CurrencyIdConvert; impl Convert> for CurrencyIdConvert { fn convert(id: CurrencyId) -> Option { match id { - CurrencyId::R => Some(Junction::Parent.into()), - CurrencyId::A => Some( - ( - Junction::Parent, - Junction::Parachain(1), - Junction::GeneralKey("A".into()), - ) - .into(), - ), - CurrencyId::B => Some( - ( - Junction::Parent, - Junction::Parachain(2), - Junction::GeneralKey("B".into()), - ) - .into(), - ), + CurrencyId::R => Some(Parent.into()), + CurrencyId::A => Some((Parent, Parachain(1), GeneralKey("A".into())).into()), + CurrencyId::B => Some((Parent, Parachain(2), GeneralKey("B".into())).into()), } } } @@ -55,17 +40,26 @@ impl Convert> for CurrencyIdConvert { fn convert(l: MultiLocation) -> Option { let a: Vec = "A".into(); let b: Vec = "B".into(); + if l == MultiLocation::parent() { + return Some(CurrencyId::R); + } match l { - X1(Parent) => Some(CurrencyId::R), - X3(Junction::Parent, Junction::Parachain(1), Junction::GeneralKey(k)) if k == a => Some(CurrencyId::A), - X3(Junction::Parent, Junction::Parachain(2), Junction::GeneralKey(k)) if k == b => Some(CurrencyId::B), - _ => Option::None, + MultiLocation { parents, interior } if parents == 1 => match interior { + X2(Parachain(1), GeneralKey(k)) if k == a => Some(CurrencyId::A), + X2(Parachain(2), GeneralKey(k)) if k == b => Some(CurrencyId::B), + _ => None, + }, + _ => None, } } } impl Convert> for CurrencyIdConvert { fn convert(a: MultiAsset) -> Option { - if let MultiAsset::ConcreteFungible { id, amount: _ } = a { + if let MultiAsset { + fun: Fungible(amount), + id: Concrete(id), + } = a + { Self::convert(id) } else { Option::None diff --git a/xtokens/src/mock/para.rs b/xtokens/src/mock/para.rs index 4d059a2fb..31bd8dcc7 100644 --- a/xtokens/src/mock/para.rs +++ b/xtokens/src/mock/para.rs @@ -3,7 +3,7 @@ use crate as orml_xtokens; use frame_support::{ construct_runtime, parameter_types, - traits::{Everything, Get}, + traits::{Everything, Get, Nothing}, weights::{constants::WEIGHT_PER_SECOND, Weight}, }; use frame_system::EnsureRoot; @@ -17,13 +17,7 @@ use sp_runtime::{ use cumulus_primitives_core::{ChannelStatus, GetChannelInfo, ParaId}; use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; -use xcm::v0::{ - Error as XcmError, - Junction::{self, Parachain, Parent}, - MultiAsset, - MultiLocation::{self, X1, X2}, - NetworkId, -}; +use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, @@ -60,7 +54,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); @@ -99,7 +93,7 @@ impl orml_tokens::Config for Runtime { type ExistentialDeposits = ExistentialDeposits; type OnDust = (); type MaxLocks = MaxLocks; - type DustRemovalWhitelist = (); + type DustRemovalWhitelist = Everything; } parameter_types! { @@ -110,7 +104,7 @@ parameter_types! { impl parachain_info::Config for Runtime {} parameter_types! { - pub const RelayLocation: MultiLocation = MultiLocation::X1(Parent); + pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Kusama; pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); @@ -154,7 +148,7 @@ pub type Barrier = (TakeWeightCredit, AllowTopLevelPaidExecutionFrom pub struct AllTokensAreCreatedEqualToWeight(MultiLocation); impl WeightTrader for AllTokensAreCreatedEqualToWeight { fn new() -> Self { - Self(MultiLocation::Null) + Self(MultiLocation::parent()) } fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { @@ -164,21 +158,25 @@ impl WeightTrader for AllTokensAreCreatedEqualToWeight { .next() .expect("Payment must be something; qed") .0; - let required = asset_id.clone().into_fungible_multiasset(weight as u128); - - if let MultiAsset::ConcreteFungible { ref id, amount: _ } = required { + let required = MultiAsset { + id: asset_id.clone(), + fun: Fungible(weight as u128), + }; + + if let MultiAsset { + fun, + id: Concrete(ref id), + } = &required + { self.0 = id.clone(); } - let (unused, _) = payment.less(required).map_err(|_| XcmError::TooExpensive)?; + let unused = payment.checked_sub(required).map_err(|_| XcmError::TooExpensive)?; Ok(unused) } - fn refund_weight(&mut self, weight: Weight) -> MultiAsset { - MultiAsset::ConcreteFungible { - id: self.0.clone(), - amount: weight as u128, - } + fn refund_weight(&mut self, weight: Weight) -> Option { + Some((self.0.clone(), weight as u128).into()) } } @@ -211,6 +209,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type Event = Event; type XcmExecutor = XcmExecutor; type ChannelInfo = ChannelInfo; + type VersionWrapper = (); } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -233,7 +232,7 @@ impl pallet_xcm::Config for Runtime { type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = (); + type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; @@ -246,11 +245,12 @@ impl Convert for AccountIdToMultiLocation { network: NetworkId::Any, id: account.into(), }) + .into() } } parameter_types! { - pub SelfLocation: MultiLocation = X2(Parent, Parachain(ParachainInfo::get().into())); + pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); pub const BaseXcmWeight: Weight = 100_000_000; } diff --git a/xtokens/src/mock/relay.rs b/xtokens/src/mock/relay.rs index daec3ca9c..9b3205035 100644 --- a/xtokens/src/mock/relay.rs +++ b/xtokens/src/mock/relay.rs @@ -8,7 +8,7 @@ use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; use cumulus_primitives_core::ParaId; use polkadot_runtime_parachains::{configuration, origin, shared, ump}; -use xcm::v0::{MultiLocation, NetworkId}; +use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsConcrete, LocationInverter, SignedAccountId32AsNative, @@ -43,7 +43,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); @@ -72,9 +72,9 @@ impl shared::Config for Runtime {} impl configuration::Config for Runtime {} parameter_types! { - pub const KsmLocation: MultiLocation = MultiLocation::Null; + pub const KsmLocation: MultiLocation = Here.into(); pub const KusamaNetwork: NetworkId = NetworkId::Kusama; - pub Ancestry: MultiLocation = MultiLocation::Null; + pub Ancestry: MultiLocation = Here.into(); pub UnitWeightCost: Weight = 1; } @@ -122,7 +122,7 @@ impl pallet_xcm::Config for Runtime { type XcmRouter = XcmRouter; // Anyone can execute XCM messages locally... type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; - type XcmExecuteFilter = (); + type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; diff --git a/xtokens/src/tests.rs b/xtokens/src/tests.rs index 693d35b09..8367226fb 100644 --- a/xtokens/src/tests.rs +++ b/xtokens/src/tests.rs @@ -8,7 +8,7 @@ use mock::*; use orml_traits::MultiCurrency; use polkadot_parachain::primitives::{AccountIdConversion, Sibling}; use sp_runtime::AccountId32; -use xcm::v0::{Junction, NetworkId, Order}; +use xcm::latest::{Junction, NetworkId, Order}; use xcm_simulator::TestExt; fn para_a_account() -> AccountId32 { @@ -34,6 +34,13 @@ fn sibling_c_account() -> AccountId32 { Sibling::from(3).into_account() } +fn print_events(name: &'static str) { + println!("------ {:?} -------", name); + frame_system::Pallet::::events() + .iter() + .for_each(|r| println!("> {:?}", r.event)); +} + #[test] fn send_relay_chain_asset_to_relay_chain() { TestNet::reset(); @@ -47,22 +54,21 @@ fn send_relay_chain_asset_to_relay_chain() { Some(ALICE).into(), CurrencyId::R, 500, - Box::new( - ( - Parent, - Junction::AccountId32 { - network: NetworkId::Kusama, - id: BOB.into(), - }, - ) - .into() - ), + Box::new(MultiLocation::new( + 1, + X1(Junction::AccountId32 { + network: NetworkId::Any, + id: BOB.into(), + }) + )), 30, )); assert_eq!(ParaTokens::free_balance(CurrencyId::R, &ALICE), 500); + print_events::("ParaA") }); Relay::execute_with(|| { + print_events::("Relay"); assert_eq!(RelayBalances::free_balance(¶_a_account()), 500); assert_eq!(RelayBalances::free_balance(&BOB), 470); }); @@ -195,17 +201,16 @@ fn send_sibling_asset_to_non_reserve_sibling() { Some(ALICE).into(), CurrencyId::B, 500, - Box::new( - ( - Parent, + Box::new(MultiLocation::new( + 1, + X2( Parachain(3), Junction::AccountId32 { network: NetworkId::Any, id: BOB.into(), - }, + } ) - .into() - ), + ),), 30 )); assert_eq!(ParaTokens::free_balance(CurrencyId::B, &ALICE), 500); @@ -233,17 +238,16 @@ fn send_self_parachain_asset_to_sibling() { Some(ALICE).into(), CurrencyId::A, 500, - Box::new( - ( - Parent, + Box::new(MultiLocation::new( + 1, + X2( Parachain(2), Junction::AccountId32 { network: NetworkId::Any, id: BOB.into(), - }, + } ) - .into() - ), + )), 30, )); @@ -264,10 +268,7 @@ fn transfer_no_reserve_assets_fails() { assert_noop!( ParaXTokens::transfer_multiasset( Some(ALICE).into(), - Box::new(MultiAsset::ConcreteFungible { - id: GeneralKey("B".into()).into(), - amount: 100 - }), + Box::new((X1(GeneralKey("B".into())).into(), 100).into()), Box::new( ( Parent, @@ -294,21 +295,17 @@ fn transfer_to_self_chain_fails() { assert_noop!( ParaXTokens::transfer_multiasset( Some(ALICE).into(), - Box::new(MultiAsset::ConcreteFungible { - id: (Parent, Parachain(1), GeneralKey("A".into())).into(), - amount: 100 - }), - Box::new( - ( - Parent, + Box::new((MultiLocation::new(1, X2(Parachain(1), GeneralKey("A".into()))), 100).into()), + Box::new(MultiLocation::new( + 1, + X2( Parachain(1), Junction::AccountId32 { network: NetworkId::Any, id: BOB.into() } ) - .into() - ), + )), 50, ), Error::::NotCrossChainTransfer @@ -324,17 +321,14 @@ fn transfer_to_invalid_dest_fails() { assert_noop!( ParaXTokens::transfer_multiasset( Some(ALICE).into(), - Box::new(MultiAsset::ConcreteFungible { - id: (Parent, Parachain(1), GeneralKey("A".into())).into(), - amount: 100, - }), - Box::new( - (Junction::AccountId32 { + Box::new((MultiLocation::new(1, X2(Parachain(1), GeneralKey("A".into()))), 100).into()), + Box::new(MultiLocation::new( + 0, + X1(Junction::AccountId32 { network: NetworkId::Any, id: BOB.into() }) - .into() - ), + )), 50, ), Error::::InvalidDest @@ -351,23 +345,21 @@ fn send_as_sovereign() { }); ParaA::execute_with(|| { - use xcm::v0::OriginKind::SovereignAccount; + use xcm::latest::OriginKind::SovereignAccount; let call = relay::Call::System(frame_system::Call::::remark_with_event(vec![1, 1, 1])); + let assets: MultiAsset = (Here, 1_000_000_000_000).into(); assert_ok!(para::OrmlXcm::send_as_sovereign( para::Origin::root(), - Box::new(Junction::Parent.into()), + Box::new(MultiLocation::parent()), Box::new(WithdrawAsset { - assets: vec![MultiAsset::ConcreteFungible { - id: MultiLocation::Null, - amount: 1_000_000_000_000 - }], + assets: assets.clone().into(), effects: vec![Order::BuyExecution { - fees: MultiAsset::All, + fees: assets, weight: 10_000_000, debt: 10_000_000, halt_on_error: true, - xcm: vec![Transact { + instructions: vec![Transact { origin_type: SovereignAccount, require_weight_at_most: 1_000_000_000, call: call.encode().into(), @@ -396,24 +388,22 @@ fn send_as_sovereign_fails_if_bad_origin() { }); ParaA::execute_with(|| { - use xcm::v0::OriginKind::SovereignAccount; + use xcm::latest::OriginKind::SovereignAccount; let call = relay::Call::System(frame_system::Call::::remark_with_event(vec![1, 1, 1])); + let assets: MultiAsset = (Here, 1_000_000_000_000).into(); assert_err!( para::OrmlXcm::send_as_sovereign( para::Origin::signed(ALICE), - Box::new(Junction::Parent.into()), + Box::new(MultiLocation::parent()), Box::new(WithdrawAsset { - assets: vec![MultiAsset::ConcreteFungible { - id: MultiLocation::Null, - amount: 1_000_000_000_000 - }], + assets: assets.clone().into(), effects: vec![Order::BuyExecution { - fees: MultiAsset::All, + fees: assets, weight: 10_000_000, debt: 10_000_000, halt_on_error: true, - xcm: vec![Transact { + instructions: vec![Transact { origin_type: SovereignAccount, require_weight_at_most: 1_000_000_000, call: call.encode().into(), From bb9a81ab5fea066c171a6c0b7e1f76273da52445 Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Mon, 13 Sep 2021 16:32:14 +1200 Subject: [PATCH 02/12] Build fees for reserve as middle location. --- xtokens/src/lib.rs | 172 ++++++++++++++++++++++++++++----------- xtokens/src/mock/mod.rs | 2 +- xtokens/src/mock/para.rs | 3 +- xtokens/src/tests.rs | 18 ++-- 4 files changed, 141 insertions(+), 54 deletions(-) diff --git a/xtokens/src/lib.rs b/xtokens/src/lib.rs index 54db2d5a1..11be066a1 100644 --- a/xtokens/src/lib.rs +++ b/xtokens/src/lib.rs @@ -28,10 +28,10 @@ use sp_runtime::{ traits::{AtLeast32BitUnsigned, Convert, MaybeSerializeDeserialize, Member, Zero}, DispatchError, }; -use sp_std::prelude::*; +use sp_std::{prelude::*, result::Result}; use xcm::latest::prelude::*; -use xcm_executor::traits::WeightBounds; +use xcm_executor::traits::{InvertLocation, WeightBounds}; pub use module::*; use orml_traits::{ @@ -94,6 +94,9 @@ pub mod module { /// T::Weigher::weight(&msg)`. #[pallet::constant] type BaseXcmWeight: Get; + + /// Means of inverting a location. + type LocationInverter: InvertLocation; } #[pallet::event] @@ -120,6 +123,13 @@ pub mod module { UnweighableMessage, /// XCM execution failed. XcmExecutionFailed, + /// Could not re-anchor the assets to declare the fees for the + /// destination chain. + CannotReanchor, + /// Could not get ancestry of asset reserve location. + InvalidAncestry, + /// Not fungible asset. + NotFungible, } #[pallet::hooks] @@ -208,28 +218,22 @@ pub mod module { dest_weight: Weight, deposit_event: bool, ) -> DispatchResult { - if Self::is_zero_amount(&asset) { + if !asset.is_fungible(None) { + return Err(Error::::NotFungible.into()); + } + + if fungible_amount(&asset).is_zero() { return Ok(()); } let (transfer_kind, dest, reserve, recipient) = Self::transfer_kind(&asset, &dest)?; - // let all: MultiAssets = All.into(); - let buy_order = BuyExecution { - // TODO: fix this - fees: asset.clone(), - // Zero weight for additional XCM (since there are none to execute) - weight: 0, - debt: dest_weight, - halt_on_error: false, - instructions: vec![], - }; let mut msg = match transfer_kind { SelfReserveAsset => { - Self::transfer_self_reserve_asset(asset.clone(), dest.clone(), recipient, buy_order) + Self::transfer_self_reserve_asset(asset.clone(), dest.clone(), recipient, dest_weight)? } - ToReserve => Self::transfer_to_reserve(asset.clone(), dest.clone(), recipient, buy_order), + ToReserve => Self::transfer_to_reserve(asset.clone(), dest.clone(), recipient, dest_weight)?, ToNonReserve => { - Self::transfer_to_non_reserve(asset.clone(), reserve, dest.clone(), recipient, buy_order) + Self::transfer_to_non_reserve(asset.clone(), reserve, dest.clone(), recipient, dest_weight)? } }; @@ -250,33 +254,37 @@ pub mod module { asset: MultiAsset, dest: MultiLocation, recipient: MultiLocation, - buy_order: Order<()>, - ) -> Xcm { - WithdrawAsset { + dest_weight: u64, + ) -> Result, DispatchError> { + let buy_execution = Self::buy_execution(asset.clone(), &dest, dest_weight)?; + Ok(WithdrawAsset { assets: asset.into(), effects: vec![DepositReserveAsset { assets: All.into(), dest, - effects: vec![buy_order, Self::deposit_asset(recipient)], + effects: vec![buy_execution, Self::deposit_asset(recipient)], max_assets: u32::max_value(), }], - } + }) } fn transfer_to_reserve( asset: MultiAsset, reserve: MultiLocation, recipient: MultiLocation, - buy_order: Order<()>, - ) -> Xcm { - WithdrawAsset { - assets: asset.into(), + dest_weight: u64, + ) -> Result, DispatchError> { + Ok(WithdrawAsset { + assets: asset.clone().into(), effects: vec![InitiateReserveWithdraw { assets: All.into(), - reserve, - effects: vec![buy_order, Self::deposit_asset(recipient)], + reserve: reserve.clone(), + effects: vec![ + Self::buy_execution(asset, &reserve, dest_weight)?, + Self::deposit_asset(recipient), + ], }], - } + }) } fn transfer_to_non_reserve( @@ -284,8 +292,8 @@ pub mod module { reserve: MultiLocation, dest: MultiLocation, recipient: MultiLocation, - buy_order: Order<()>, - ) -> Xcm { + dest_weight: u64, + ) -> Result, DispatchError> { let mut reanchored_dest = dest.clone(); if reserve == MultiLocation::parent() { match dest { @@ -299,22 +307,25 @@ pub mod module { } } - WithdrawAsset { - assets: asset.into(), + let reserve_buy_execution = Self::buy_execution(asset.clone(), &reserve, dest_weight)?; + let dest_buy_execution = + Self::buy_execution_with_middle_reserve(asset.clone(), &reserve, &reanchored_dest, dest_weight)?; + Ok(WithdrawAsset { + assets: asset.clone().into(), effects: vec![InitiateReserveWithdraw { assets: All.into(), reserve, effects: vec![ - buy_order.clone(), + reserve_buy_execution, DepositReserveAsset { assets: All.into(), dest: reanchored_dest, - effects: vec![buy_order, Self::deposit_asset(recipient)], + effects: vec![dest_buy_execution, Self::deposit_asset(recipient)], max_assets: u32::max_value(), }, ], }], - } + }) } fn deposit_asset(recipient: MultiLocation) -> Order<()> { @@ -325,20 +336,53 @@ pub mod module { } } - fn is_zero_amount(asset: &MultiAsset) -> bool { - if let Fungible(amount) = &asset.fun { - if amount.is_zero() { - return true; - } - } + fn buy_execution( + asset: MultiAsset, + dest: &MultiLocation, + dest_weight: u64, + ) -> Result, DispatchError> { + let inv_dest = T::LocationInverter::invert_location(dest); + let fees = asset.reanchored(&inv_dest).map_err(|_| Error::::CannotReanchor)?; + Ok(BuyExecution { + fees, + weight: 0, + debt: dest_weight, + halt_on_error: false, + instructions: vec![], + }) + } - false + fn buy_execution_with_middle_reserve( + asset: MultiAsset, + reserve: &MultiLocation, + dest: &MultiLocation, + dest_weight: u64, + ) -> Result, DispatchError> { + let inv_reserve = T::LocationInverter::invert_location(reserve); + let half_asset = MultiAsset { + fun: Fungible(fungible_amount(&asset) / 2), + id: asset.id, + }; + let reserve_reanchored = half_asset + .reanchored(&inv_reserve) + .map_err(|_| Error::::CannotReanchor)?; + + let reserve_ancestry = relative_ancestry(reserve).ok_or(Error::::InvalidAncestry)?; + let inv_dest = invert_location(reserve_ancestry, dest); + let fees = reserve_reanchored + .reanchored(&inv_dest) + .map_err(|_| Error::::CannotReanchor)?; + Ok(BuyExecution { + fees, + weight: 0, + debt: dest_weight, + halt_on_error: false, + instructions: vec![], + }) } /// Ensure has the `dest` has chain part and recipient part. - fn ensure_valid_dest( - dest: &MultiLocation, - ) -> sp_std::result::Result<(MultiLocation, MultiLocation), DispatchError> { + fn ensure_valid_dest(dest: &MultiLocation) -> Result<(MultiLocation, MultiLocation), DispatchError> { if let (Some(dest), Some(recipient)) = (dest.chain_part(), dest.non_chain_part()) { Ok((dest, recipient)) } else { @@ -357,7 +401,7 @@ pub mod module { fn transfer_kind( asset: &MultiAsset, dest: &MultiLocation, - ) -> sp_std::result::Result<(TransferKind, MultiLocation, MultiLocation, MultiLocation), DispatchError> { + ) -> Result<(TransferKind, MultiLocation, MultiLocation, MultiLocation), DispatchError> { let (dest, recipient) = Self::ensure_valid_dest(dest)?; let self_location = T::SelfLocation::get(); @@ -445,3 +489,39 @@ pub mod module { } } } + +fn relative_ancestry(location: &MultiLocation) -> Option { + if location == &MultiLocation::parent() { + return Some(Here.into()); + } + + match location { + MultiLocation { + parents, + interior: X1(Parachain(id)), + } if *parents == 1 => Some(MultiLocation::new(0, X1(Parachain(*id)))), + _ => None, + } +} + +// from https://github.com/paritytech/polkadot/blob/48122d0220555bfd59d46e2971522cc4e7c9edf9/xcm/xcm-builder/src/location_conversion.rs#L183 +fn invert_location(ancestry: MultiLocation, location: &MultiLocation) -> MultiLocation { + let mut ancestry = ancestry; + let mut junctions = Here; + for _ in 0..location.parent_count() { + junctions = junctions + .pushed_with(ancestry.take_first_interior().unwrap_or(OnlyChild)) + .expect("ancestry is well-formed and has less than 8 non-parent junctions; qed"); + } + let parents = location.interior().len() as u8; + MultiLocation::new(parents, junctions) +} + +/// Returns amount if `asset` is fungible, or zero. +fn fungible_amount(asset: &MultiAsset) -> u128 { + if let Fungible(amount) = &asset.fun { + *amount + } else { + Zero::zero() + } +} diff --git a/xtokens/src/mock/mod.rs b/xtokens/src/mock/mod.rs index a73847cb1..cc0545888 100644 --- a/xtokens/src/mock/mod.rs +++ b/xtokens/src/mock/mod.rs @@ -56,7 +56,7 @@ impl Convert> for CurrencyIdConvert { impl Convert> for CurrencyIdConvert { fn convert(a: MultiAsset) -> Option { if let MultiAsset { - fun: Fungible(amount), + fun: Fungible(_), id: Concrete(id), } = a { diff --git a/xtokens/src/mock/para.rs b/xtokens/src/mock/para.rs index 31bd8dcc7..95d2d30e0 100644 --- a/xtokens/src/mock/para.rs +++ b/xtokens/src/mock/para.rs @@ -164,7 +164,7 @@ impl WeightTrader for AllTokensAreCreatedEqualToWeight { }; if let MultiAsset { - fun, + fun: _, id: Concrete(ref id), } = &required { @@ -264,6 +264,7 @@ impl orml_xtokens::Config for Runtime { type XcmExecutor = XcmExecutor; type Weigher = FixedWeightBounds; type BaseXcmWeight = BaseXcmWeight; + type LocationInverter = LocationInverter; } impl orml_xcm::Config for Runtime { diff --git a/xtokens/src/tests.rs b/xtokens/src/tests.rs index 8367226fb..0a7d5c39b 100644 --- a/xtokens/src/tests.rs +++ b/xtokens/src/tests.rs @@ -118,28 +118,32 @@ fn send_relay_chain_asset_to_sibling() { Some(ALICE).into(), CurrencyId::R, 500, - Box::new( - ( - Parent, + Box::new(MultiLocation::new( + 1, + X2( Parachain(2), Junction::AccountId32 { network: NetworkId::Any, id: BOB.into(), - }, + } ) - .into() - ), + )), 30, )); assert_eq!(ParaTokens::free_balance(CurrencyId::R, &ALICE), 500); + + print_events::("ParaA"); }); Relay::execute_with(|| { + print_events::("Relay"); + assert_eq!(RelayBalances::free_balance(¶_a_account()), 500); assert_eq!(RelayBalances::free_balance(¶_b_account()), 470); }); ParaB::execute_with(|| { + print_events::("ParaB"); assert_eq!(ParaTokens::free_balance(CurrencyId::R, &BOB), 440); }); } @@ -251,11 +255,13 @@ fn send_self_parachain_asset_to_sibling() { 30, )); + print_events::("ParaA"); assert_eq!(ParaTokens::free_balance(CurrencyId::A, &ALICE), 500); assert_eq!(ParaTokens::free_balance(CurrencyId::A, &sibling_b_account()), 500); }); ParaB::execute_with(|| { + print_events::("ParaB"); assert_eq!(ParaTokens::free_balance(CurrencyId::A, &BOB), 470); }); } From 665b207c4fd91058988f8c6b0f1b745d96019140 Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Tue, 14 Sep 2021 14:14:55 +1200 Subject: [PATCH 03/12] Fix sending to silbing unit tests. --- xtokens/src/lib.rs | 22 +++++++++++++--------- xtokens/src/mock/para.rs | 11 +++++++++-- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/xtokens/src/lib.rs b/xtokens/src/lib.rs index 11be066a1..bbfdae0f4 100644 --- a/xtokens/src/lib.rs +++ b/xtokens/src/lib.rs @@ -307,9 +307,9 @@ pub mod module { } } - let reserve_buy_execution = Self::buy_execution(asset.clone(), &reserve, dest_weight)?; + let reserve_buy_execution = Self::buy_execution(half(&asset), &reserve, dest_weight)?; let dest_buy_execution = - Self::buy_execution_with_middle_reserve(asset.clone(), &reserve, &reanchored_dest, dest_weight)?; + Self::buy_execution_with_middle_reserve(half(&asset), &reserve, &reanchored_dest, dest_weight)?; Ok(WithdrawAsset { assets: asset.clone().into(), effects: vec![InitiateReserveWithdraw { @@ -359,13 +359,7 @@ pub mod module { dest_weight: u64, ) -> Result, DispatchError> { let inv_reserve = T::LocationInverter::invert_location(reserve); - let half_asset = MultiAsset { - fun: Fungible(fungible_amount(&asset) / 2), - id: asset.id, - }; - let reserve_reanchored = half_asset - .reanchored(&inv_reserve) - .map_err(|_| Error::::CannotReanchor)?; + let reserve_reanchored = asset.reanchored(&inv_reserve).map_err(|_| Error::::CannotReanchor)?; let reserve_ancestry = relative_ancestry(reserve).ok_or(Error::::InvalidAncestry)?; let inv_dest = invert_location(reserve_ancestry, dest); @@ -525,3 +519,13 @@ fn fungible_amount(asset: &MultiAsset) -> u128 { Zero::zero() } } + +fn half(asset: &MultiAsset) -> MultiAsset { + let half_amount = fungible_amount(asset) + .checked_div(2) + .expect("div 2 can't overflow; qed"); + MultiAsset { + fun: Fungible(half_amount), + id: asset.id.clone(), + } +} diff --git a/xtokens/src/mock/para.rs b/xtokens/src/mock/para.rs index 95d2d30e0..efd2c48c3 100644 --- a/xtokens/src/mock/para.rs +++ b/xtokens/src/mock/para.rs @@ -10,7 +10,7 @@ use frame_system::EnsureRoot; use sp_core::H256; use sp_runtime::{ testing::Header, - traits::{Convert, IdentityLookup}, + traits::{Convert, IdentityLookup, Zero}, AccountId32, }; @@ -176,7 +176,14 @@ impl WeightTrader for AllTokensAreCreatedEqualToWeight { } fn refund_weight(&mut self, weight: Weight) -> Option { - Some((self.0.clone(), weight as u128).into()) + if weight.is_zero() { + None + } else { + Some(MultiAsset { + fun: Fungible(weight as u128), + id: Concrete(self.0.clone()), + }) + } } } From 88213a3dc02dd1be726d763a0374ed54bfd21171 Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Tue, 14 Sep 2021 15:25:33 +1200 Subject: [PATCH 04/12] Clean up buy execution. --- xtokens/src/lib.rs | 65 ++++---------------------------------------- xtokens/src/tests.rs | 14 +++------- 2 files changed, 9 insertions(+), 70 deletions(-) diff --git a/xtokens/src/lib.rs b/xtokens/src/lib.rs index bbfdae0f4..385c02d95 100644 --- a/xtokens/src/lib.rs +++ b/xtokens/src/lib.rs @@ -308,8 +308,7 @@ pub mod module { } let reserve_buy_execution = Self::buy_execution(half(&asset), &reserve, dest_weight)?; - let dest_buy_execution = - Self::buy_execution_with_middle_reserve(half(&asset), &reserve, &reanchored_dest, dest_weight)?; + let dest_buy_execution = Self::buy_execution(half(&asset), &dest, dest_weight)?; Ok(WithdrawAsset { assets: asset.clone().into(), effects: vec![InitiateReserveWithdraw { @@ -336,40 +335,13 @@ pub mod module { } } - fn buy_execution( - asset: MultiAsset, - dest: &MultiLocation, - dest_weight: u64, - ) -> Result, DispatchError> { - let inv_dest = T::LocationInverter::invert_location(dest); - let fees = asset.reanchored(&inv_dest).map_err(|_| Error::::CannotReanchor)?; - Ok(BuyExecution { - fees, - weight: 0, - debt: dest_weight, - halt_on_error: false, - instructions: vec![], - }) - } - - fn buy_execution_with_middle_reserve( - asset: MultiAsset, - reserve: &MultiLocation, - dest: &MultiLocation, - dest_weight: u64, - ) -> Result, DispatchError> { - let inv_reserve = T::LocationInverter::invert_location(reserve); - let reserve_reanchored = asset.reanchored(&inv_reserve).map_err(|_| Error::::CannotReanchor)?; - - let reserve_ancestry = relative_ancestry(reserve).ok_or(Error::::InvalidAncestry)?; - let inv_dest = invert_location(reserve_ancestry, dest); - let fees = reserve_reanchored - .reanchored(&inv_dest) - .map_err(|_| Error::::CannotReanchor)?; + fn buy_execution(asset: MultiAsset, at: &MultiLocation, weight: u64) -> Result, DispatchError> { + let inv_at = T::LocationInverter::invert_location(at); + let fees = asset.reanchored(&inv_at).map_err(|_| Error::::CannotReanchor)?; Ok(BuyExecution { fees, weight: 0, - debt: dest_weight, + debt: weight, halt_on_error: false, instructions: vec![], }) @@ -484,33 +456,6 @@ pub mod module { } } -fn relative_ancestry(location: &MultiLocation) -> Option { - if location == &MultiLocation::parent() { - return Some(Here.into()); - } - - match location { - MultiLocation { - parents, - interior: X1(Parachain(id)), - } if *parents == 1 => Some(MultiLocation::new(0, X1(Parachain(*id)))), - _ => None, - } -} - -// from https://github.com/paritytech/polkadot/blob/48122d0220555bfd59d46e2971522cc4e7c9edf9/xcm/xcm-builder/src/location_conversion.rs#L183 -fn invert_location(ancestry: MultiLocation, location: &MultiLocation) -> MultiLocation { - let mut ancestry = ancestry; - let mut junctions = Here; - for _ in 0..location.parent_count() { - junctions = junctions - .pushed_with(ancestry.take_first_interior().unwrap_or(OnlyChild)) - .expect("ancestry is well-formed and has less than 8 non-parent junctions; qed"); - } - let parents = location.interior().len() as u8; - MultiLocation::new(parents, junctions) -} - /// Returns amount if `asset` is fungible, or zero. fn fungible_amount(asset: &MultiAsset) -> u128 { if let Fungible(amount) = &asset.fun { diff --git a/xtokens/src/tests.rs b/xtokens/src/tests.rs index 0a7d5c39b..ce6846afe 100644 --- a/xtokens/src/tests.rs +++ b/xtokens/src/tests.rs @@ -34,8 +34,11 @@ fn sibling_c_account() -> AccountId32 { Sibling::from(3).into_account() } +// Not used in any unit tests, but it's super helpful for debugging. Let's +// keep it here. +#[allow(dead_code)] fn print_events(name: &'static str) { - println!("------ {:?} -------", name); + println!("------ {:?} events -------", name); frame_system::Pallet::::events() .iter() .for_each(|r| println!("> {:?}", r.event)); @@ -64,11 +67,9 @@ fn send_relay_chain_asset_to_relay_chain() { 30, )); assert_eq!(ParaTokens::free_balance(CurrencyId::R, &ALICE), 500); - print_events::("ParaA") }); Relay::execute_with(|| { - print_events::("Relay"); assert_eq!(RelayBalances::free_balance(¶_a_account()), 500); assert_eq!(RelayBalances::free_balance(&BOB), 470); }); @@ -131,19 +132,14 @@ fn send_relay_chain_asset_to_sibling() { 30, )); assert_eq!(ParaTokens::free_balance(CurrencyId::R, &ALICE), 500); - - print_events::("ParaA"); }); Relay::execute_with(|| { - print_events::("Relay"); - assert_eq!(RelayBalances::free_balance(¶_a_account()), 500); assert_eq!(RelayBalances::free_balance(¶_b_account()), 470); }); ParaB::execute_with(|| { - print_events::("ParaB"); assert_eq!(ParaTokens::free_balance(CurrencyId::R, &BOB), 440); }); } @@ -255,13 +251,11 @@ fn send_self_parachain_asset_to_sibling() { 30, )); - print_events::("ParaA"); assert_eq!(ParaTokens::free_balance(CurrencyId::A, &ALICE), 500); assert_eq!(ParaTokens::free_balance(CurrencyId::A, &sibling_b_account()), 500); }); ParaB::execute_with(|| { - print_events::("ParaB"); assert_eq!(ParaTokens::free_balance(CurrencyId::A, &BOB), 470); }); } From 1dbe4067efccb87cd1aac70acdf740483546255d Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Wed, 15 Sep 2021 13:43:09 +1200 Subject: [PATCH 05/12] Update orml-unknown-tokens. --- unknown-tokens/src/lib.rs | 54 ++++++++++++++++++++----------------- unknown-tokens/src/mock.rs | 4 +-- unknown-tokens/src/tests.rs | 31 ++++++++++++--------- 3 files changed, 49 insertions(+), 40 deletions(-) diff --git a/unknown-tokens/src/lib.rs b/unknown-tokens/src/lib.rs index e048ba370..da0a04d32 100644 --- a/unknown-tokens/src/lib.rs +++ b/unknown-tokens/src/lib.rs @@ -3,7 +3,7 @@ use frame_support::pallet_prelude::*; use sp_std::vec::Vec; -use xcm::v0::{MultiAsset, MultiLocation}; +use xcm::latest::prelude::*; use orml_xcm_support::UnknownAsset; @@ -71,18 +71,20 @@ pub mod module { impl UnknownAsset for Pallet { fn deposit(asset: &MultiAsset, to: &MultiLocation) -> DispatchResult { match asset { - MultiAsset::ConcreteFungible { id, amount } => { - ConcreteFungibleBalances::::try_mutate(to, id, |b| -> DispatchResult { - *b = b.checked_add(*amount).ok_or(Error::::BalanceOverflow)?; - Ok(()) - }) - } - MultiAsset::AbstractFungible { id, amount } => { - AbstractFungibleBalances::::try_mutate(to, id, |b| -> DispatchResult { - *b = b.checked_add(*amount).ok_or(Error::::BalanceOverflow)?; - Ok(()) - }) - } + MultiAsset { + fun: Fungible(amount), + id: Concrete(location), + } => ConcreteFungibleBalances::::try_mutate(to, location, |b| -> DispatchResult { + *b = b.checked_add(*amount).ok_or(Error::::BalanceOverflow)?; + Ok(()) + }), + MultiAsset { + fun: Fungible(amount), + id: Abstract(key), + } => AbstractFungibleBalances::::try_mutate(to, key, |b| -> DispatchResult { + *b = b.checked_add(*amount).ok_or(Error::::BalanceOverflow)?; + Ok(()) + }), _ => Err(Error::::UnhandledAsset.into()), }?; @@ -93,18 +95,20 @@ impl UnknownAsset for Pallet { fn withdraw(asset: &MultiAsset, from: &MultiLocation) -> DispatchResult { match asset { - MultiAsset::ConcreteFungible { id, amount } => { - ConcreteFungibleBalances::::try_mutate(from, id, |b| -> DispatchResult { - *b = b.checked_sub(*amount).ok_or(Error::::BalanceTooLow)?; - Ok(()) - }) - } - MultiAsset::AbstractFungible { id, amount } => { - AbstractFungibleBalances::::try_mutate(from, id, |b| -> DispatchResult { - *b = b.checked_sub(*amount).ok_or(Error::::BalanceTooLow)?; - Ok(()) - }) - } + MultiAsset { + fun: Fungible(amount), + id: Concrete(location), + } => ConcreteFungibleBalances::::try_mutate(from, location, |b| -> DispatchResult { + *b = b.checked_sub(*amount).ok_or(Error::::BalanceTooLow)?; + Ok(()) + }), + MultiAsset { + fun: Fungible(amount), + id: Abstract(key), + } => AbstractFungibleBalances::::try_mutate(from, key, |b| -> DispatchResult { + *b = b.checked_sub(*amount).ok_or(Error::::BalanceTooLow)?; + Ok(()) + }), _ => Err(Error::::UnhandledAsset.into()), }?; diff --git a/unknown-tokens/src/mock.rs b/unknown-tokens/src/mock.rs index b8e297a15..efcd52dfe 100644 --- a/unknown-tokens/src/mock.rs +++ b/unknown-tokens/src/mock.rs @@ -5,7 +5,7 @@ use super::*; use crate as unknown_tokens; -use frame_support::{construct_runtime, parameter_types}; +use frame_support::{construct_runtime, parameter_types, traits::Everything}; use sp_core::H256; use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; @@ -35,7 +35,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); diff --git a/unknown-tokens/src/tests.rs b/unknown-tokens/src/tests.rs index d17abf55d..a5d3704db 100644 --- a/unknown-tokens/src/tests.rs +++ b/unknown-tokens/src/tests.rs @@ -6,27 +6,20 @@ use super::*; use mock::{Event, *}; use frame_support::{assert_err, assert_ok}; -use xcm::v0::Junction; -const MOCK_RECIPIENT: MultiLocation = MultiLocation::X1(Junction::Parent); -const MOCK_CONCRETE_FUNGIBLE_ID: MultiLocation = MultiLocation::X1(Junction::Parent); +const MOCK_RECIPIENT: MultiLocation = MultiLocation::parent(); +const MOCK_CONCRETE_FUNGIBLE_ID: MultiLocation = MultiLocation::parent(); fn mock_abstract_fungible_id() -> Vec { vec![1] } fn concrete_fungible(amount: u128) -> MultiAsset { - MultiAsset::ConcreteFungible { - id: MOCK_CONCRETE_FUNGIBLE_ID, - amount, - } + (MOCK_CONCRETE_FUNGIBLE_ID, amount).into() } fn abstract_fungible(amount: u128) -> MultiAsset { - MultiAsset::AbstractFungible { - id: mock_abstract_fungible_id(), - amount, - } + (mock_abstract_fungible_id(), amount).into() } #[test] @@ -77,7 +70,13 @@ fn deposit_abstract_fungible_asset() { fn deposit_unhandled_asset_should_fail() { ExtBuilder.build().execute_with(|| { assert_err!( - UnknownTokens::deposit(&MultiAsset::All, &MOCK_RECIPIENT), + UnknownTokens::deposit( + &MultiAsset { + fun: NonFungible(Undefined), + id: Concrete(MultiLocation::parent()) + }, + &MOCK_RECIPIENT + ), Error::::UnhandledAsset ); }); @@ -135,7 +134,13 @@ fn withdraw_abstract_fungible_asset_works() { fn withdraw_unhandled_asset_should_fail() { ExtBuilder.build().execute_with(|| { assert_err!( - UnknownTokens::withdraw(&MultiAsset::All, &MOCK_RECIPIENT), + UnknownTokens::withdraw( + &MultiAsset { + fun: NonFungible(Undefined), + id: Concrete(MultiLocation::parent()) + }, + &MOCK_RECIPIENT + ), Error::::UnhandledAsset ); }); From b7844df1c71f87a2329706c6c896a07308a2654e Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Wed, 15 Sep 2021 14:27:03 +1200 Subject: [PATCH 06/12] Fix mocks. --- Cargo.dev.toml | 3 +-- auction/src/mock.rs | 4 ++-- currencies/src/mock.rs | 10 +++++++--- gradually-update/src/mock.rs | 4 ++-- nft/src/mock.rs | 4 ++-- oracle/src/mock.rs | 7 +++++-- rewards/src/mock.rs | 4 ++-- tokens/src/mock.rs | 4 ++-- vesting/src/mock.rs | 7 +++++-- weight-meter/src/mock.rs | 3 ++- 10 files changed, 30 insertions(+), 20 deletions(-) diff --git a/Cargo.dev.toml b/Cargo.dev.toml index 9cf1a8f10..827bd6c7e 100644 --- a/Cargo.dev.toml +++ b/Cargo.dev.toml @@ -5,7 +5,7 @@ members = [ "auction", "authority", "bencher", - "benchmarking", + # "benchmarking", "currencies", "gradually-update", "oracle", @@ -64,7 +64,6 @@ sp-inherents = { git = "https://github.com/paritytech//substrate", rev = "7e4462 sp-io = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } sp-keystore = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } sp-npos-elections = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } - sp-panic-handler = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } sp-runtime = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } sp-runtime-interface = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } diff --git a/auction/src/mock.rs b/auction/src/mock.rs index 718c25164..8790e16f8 100644 --- a/auction/src/mock.rs +++ b/auction/src/mock.rs @@ -3,7 +3,7 @@ #![cfg(test)] use super::*; -use frame_support::{construct_runtime, parameter_types}; +use frame_support::{construct_runtime, parameter_types, traits::Everything}; use orml_traits::OnNewBidResult; use sp_core::H256; use sp_runtime::{testing::Header, traits::IdentityLookup}; @@ -39,7 +39,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); diff --git a/currencies/src/mock.rs b/currencies/src/mock.rs index 8ce006786..c19c56ca2 100644 --- a/currencies/src/mock.rs +++ b/currencies/src/mock.rs @@ -3,7 +3,11 @@ #![cfg(test)] use super::*; -use frame_support::{construct_runtime, parameter_types, PalletId}; +use frame_support::{ + construct_runtime, parameter_types, + traits::{Everything, Nothing}, + PalletId, +}; use orml_traits::parameter_type_with_key; use sp_core::H256; use sp_runtime::{ @@ -39,7 +43,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); @@ -84,7 +88,7 @@ impl orml_tokens::Config for Runtime { type ExistentialDeposits = ExistentialDeposits; type OnDust = orml_tokens::TransferDust; type MaxLocks = MaxLocks; - type DustRemovalWhitelist = (); + type DustRemovalWhitelist = Nothing; } pub const NATIVE_CURRENCY_ID: CurrencyId = 1; diff --git a/gradually-update/src/mock.rs b/gradually-update/src/mock.rs index 22242550c..ada202485 100644 --- a/gradually-update/src/mock.rs +++ b/gradually-update/src/mock.rs @@ -3,7 +3,7 @@ #![cfg(test)] use super::*; -use frame_support::{construct_runtime, parameter_types}; +use frame_support::{construct_runtime, parameter_types, traits::Everything}; use sp_core::H256; use sp_runtime::{testing::Header, traits::IdentityLookup}; @@ -36,7 +36,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); diff --git a/nft/src/mock.rs b/nft/src/mock.rs index e1f708a25..d2906617e 100644 --- a/nft/src/mock.rs +++ b/nft/src/mock.rs @@ -2,7 +2,7 @@ #![cfg(test)] -use frame_support::{construct_runtime, parameter_types}; +use frame_support::{construct_runtime, parameter_types, traits::Everything}; use sp_core::H256; use sp_runtime::{testing::Header, traits::IdentityLookup}; @@ -37,7 +37,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); diff --git a/oracle/src/mock.rs b/oracle/src/mock.rs index e804166a1..4eeadfe4f 100644 --- a/oracle/src/mock.rs +++ b/oracle/src/mock.rs @@ -2,7 +2,10 @@ use super::*; -use frame_support::{construct_runtime, parameter_types, traits::SortedMembers}; +use frame_support::{ + construct_runtime, parameter_types, + traits::{Everything, SortedMembers}, +}; use sp_core::H256; use sp_runtime::{ testing::Header, @@ -42,7 +45,7 @@ impl frame_system::Config for Test { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); diff --git a/rewards/src/mock.rs b/rewards/src/mock.rs index 2a34337b3..3d92bde0b 100644 --- a/rewards/src/mock.rs +++ b/rewards/src/mock.rs @@ -3,7 +3,7 @@ #![cfg(test)] use super::*; -use frame_support::{construct_runtime, parameter_types}; +use frame_support::{construct_runtime, parameter_types, traits::Everything}; use sp_core::H256; use sp_runtime::{testing::Header, traits::IdentityLookup}; use sp_std::cell::RefCell; @@ -46,7 +46,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); diff --git a/tokens/src/mock.rs b/tokens/src/mock.rs index 36ed286fe..eeb752497 100644 --- a/tokens/src/mock.rs +++ b/tokens/src/mock.rs @@ -5,7 +5,7 @@ use super::*; use frame_support::{ construct_runtime, parameter_types, - traits::{ChangeMembers, ContainsLengthBound, GenesisBuild, SaturatingCurrencyToVote, SortedMembers}, + traits::{ChangeMembers, ContainsLengthBound, Everything, GenesisBuild, SaturatingCurrencyToVote, SortedMembers}, PalletId, }; use orml_traits::parameter_type_with_key; @@ -59,7 +59,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); diff --git a/vesting/src/mock.rs b/vesting/src/mock.rs index e35ee5abf..3999ba915 100644 --- a/vesting/src/mock.rs +++ b/vesting/src/mock.rs @@ -3,7 +3,10 @@ #![cfg(test)] use super::*; -use frame_support::{construct_runtime, parameter_types, traits::EnsureOrigin}; +use frame_support::{ + construct_runtime, parameter_types, + traits::{EnsureOrigin, Everything}, +}; use frame_system::RawOrigin; use sp_core::H256; use sp_runtime::{testing::Header, traits::IdentityLookup}; @@ -35,7 +38,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); diff --git a/weight-meter/src/mock.rs b/weight-meter/src/mock.rs index 654913ef5..96642adf4 100644 --- a/weight-meter/src/mock.rs +++ b/weight-meter/src/mock.rs @@ -130,6 +130,7 @@ pub mod test_module { } use frame_support::sp_runtime::traits::IdentityLookup; +use frame_support::traits::Everything; use sp_runtime::testing::{Header, H256}; pub type BlockNumber = u64; @@ -162,7 +163,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = (); - type BaseCallFilter = (); + type BaseCallFilter = Everything; type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); From a34bd599da790848efd7cad0a480bfb3b54e83f5 Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Thu, 16 Sep 2021 14:00:09 +1200 Subject: [PATCH 07/12] Use v0.9.10 branch; fix everything (again). --- Cargo.dev.toml | 124 +++++++++++++++--------------- auction/Cargo.toml | 12 +-- authority/Cargo.toml | 16 ++-- bencher/Cargo.toml | 20 ++--- benchmarking/Cargo.toml | 18 ++--- currencies/Cargo.toml | 14 ++-- gradually-update/Cargo.toml | 12 +-- nft/Cargo.toml | 12 +-- oracle/Cargo.toml | 14 ++-- oracle/rpc/Cargo.toml | 6 +- oracle/rpc/runtime-api/Cargo.toml | 4 +- rewards/Cargo.toml | 12 +-- tokens/Cargo.toml | 14 ++-- traits/Cargo.toml | 10 +-- unknown-tokens/Cargo.toml | 14 ++-- utilities/Cargo.toml | 10 +-- vesting/Cargo.toml | 14 ++-- weight-meter/Cargo.toml | 14 ++-- xcm-support/Cargo.toml | 10 +-- xcm/Cargo.toml | 10 +-- xtokens/Cargo.toml | 44 +++++------ xtokens/src/mock/para.rs | 1 + xtokens/src/mock/relay.rs | 3 + 23 files changed, 206 insertions(+), 202 deletions(-) diff --git a/Cargo.dev.toml b/Cargo.dev.toml index 827bd6c7e..0a9f13905 100644 --- a/Cargo.dev.toml +++ b/Cargo.dev.toml @@ -5,7 +5,7 @@ members = [ "auction", "authority", "bencher", - # "benchmarking", + "benchmarking", "currencies", "gradually-update", "oracle", @@ -31,68 +31,68 @@ resolver = "2" split-debuginfo = "unpacked" [patch.'https://github.com/paritytech/substrate'] -frame-benchmarking = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -frame-support = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -frame-system = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-authorship = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-balances = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-elections-phragmen = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-offences = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-scheduler = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-session = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-staking = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-timestamp = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-treasury = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -pallet-vesting = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sc-client-api = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sc-client-db = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sc-executor = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sc-executor-common = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sc-executor-wasmi = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-api = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-application-crypto = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-arithmetic = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-authorship = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-blockchain = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-consensus = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-core = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-debug-derive = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-externalities = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-inherents = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-io = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-keystore = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-npos-elections = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-panic-handler = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-runtime = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-runtime-interface = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-session = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-staking = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-state-machine = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-std = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-storage = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-tasks = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-timestamp = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-trie = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-version = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-wasm-interface = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } -sp-utils = { git = "https://github.com/paritytech//substrate", rev = "7e44628a345137872ac7be5f88a383f5c45329ea" } +frame-benchmarking = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +frame-support = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +frame-system = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-authorship = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-balances = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-elections-phragmen = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-offences = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-scheduler = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-session = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-staking = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-timestamp = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-treasury = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +pallet-vesting = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sc-client-api = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sc-client-db = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sc-executor = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sc-executor-common = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sc-executor-wasmi = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-api = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-application-crypto = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-arithmetic = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-authorship = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-blockchain = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-consensus = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-core = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-debug-derive = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-externalities = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-inherents = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-io = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-keystore = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-npos-elections = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-panic-handler = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-runtime = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-runtime-interface = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-session = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-staking = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-state-machine = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-std = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-storage = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-tasks = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-timestamp = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-trie = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-version = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-wasm-interface = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +sp-utils = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } [patch.'https://github.com/paritytech/cumulus'] -cumulus-primitives-core = { git = "https://github.com/paritytech//cumulus", rev = "f2f4f642ec113b42e766e85b11cc47a845b974ab" } -parachain-info = { git = "https://github.com/paritytech//cumulus", rev = "f2f4f642ec113b42e766e85b11cc47a845b974ab" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "f2f4f642ec113b42e766e85b11cc47a845b974ab" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "f2f4f642ec113b42e766e85b11cc47a845b974ab" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech//cumulus", rev = "f2f4f642ec113b42e766e85b11cc47a845b974ab" } +cumulus-primitives-core = { git = "https://github.com/paritytech//cumulus", rev = "fa116cfbfb470a8114fc02f9d2e3c0a5ab6c7193" } +parachain-info = { git = "https://github.com/paritytech//cumulus", rev = "fa116cfbfb470a8114fc02f9d2e3c0a5ab6c7193" } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "fa116cfbfb470a8114fc02f9d2e3c0a5ab6c7193" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "fa116cfbfb470a8114fc02f9d2e3c0a5ab6c7193" } +cumulus-pallet-xcm = { git = "https://github.com/paritytech//cumulus", rev = "fa116cfbfb470a8114fc02f9d2e3c0a5ab6c7193" } [patch.'https://github.com/paritytech/polkadot'] -xcm = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } -xcm-executor = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } -xcm-builder = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } -pallet-xcm = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } -polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } -polkadot-parachain = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } -polkadot-primitives = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } -xcm-simulator = { git = "https://github.com/paritytech//polkadot", rev = "2b0d32a7b8cd3e61dc0555e5a2570a8f47cc171a" } +xcm = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } +xcm-executor = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } +xcm-builder = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } +pallet-xcm = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } +polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } +polkadot-parachain = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } +polkadot-primitives = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } +xcm-simulator = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } diff --git a/auction/Cargo.toml b/auction/Cargo.toml index ad4f33d93..0be05b950 100644 --- a/auction/Cargo.toml +++ b/auction/Cargo.toml @@ -10,16 +10,16 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } orml-traits = { path = "../traits", version = "0.4.1-dev", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } [features] default = ["std"] diff --git a/authority/Cargo.toml b/authority/Cargo.toml index e76370f6b..34043ee45 100644 --- a/authority/Cargo.toml +++ b/authority/Cargo.toml @@ -10,17 +10,17 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } [features] default = ["std"] diff --git a/bencher/Cargo.toml b/bencher/Cargo.toml index 5099400a6..515773d97 100644 --- a/bencher/Cargo.toml +++ b/bencher/Cargo.toml @@ -21,16 +21,16 @@ linregress = { version = "0.4.0", optional = true } serde = { version = "1.0.119", optional = true, features = ['derive'] } serde_json = {version = "1.0.64", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", features = ["derive"], default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false, optional = true } -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false, features = ["wasmtime"], optional = true } -sc-executor-common = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", optional = true } -sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false, features = ["with-kvdb-rocksdb"], optional = true } -sp-maybe-compressed-blob = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false, optional = true } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false, optional = true } +sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false, features = ["wasmtime"], optional = true } +sc-executor-common = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", optional = true } +sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false, features = ["with-kvdb-rocksdb"], optional = true } +sp-maybe-compressed-blob = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false, optional = true } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } [features] default = ["std"] diff --git a/benchmarking/Cargo.toml b/benchmarking/Cargo.toml index a2ab8bb09..241197766 100644 --- a/benchmarking/Cargo.toml +++ b/benchmarking/Cargo.toml @@ -11,17 +11,17 @@ edition = "2018" serde = { version = "1.0.124", optional = true } paste = "1.0" codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } [dev-dependencies] -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } hex-literal = "0.2.1" [features] diff --git a/currencies/Cargo.toml b/currencies/Cargo.toml index 01f09327f..ad4545d17 100644 --- a/currencies/Cargo.toml +++ b/currencies/Cargo.toml @@ -10,19 +10,19 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } orml-traits = { path = "../traits", version = "0.4.1-dev", default-features = false } orml-utilities = { path = "../utilities", version = "0.4.1-dev", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } orml_tokens = { package = "orml-tokens", path = "../tokens", version = "0.4.1-dev" } [features] diff --git a/gradually-update/Cargo.toml b/gradually-update/Cargo.toml index f81d39bc5..0d000edea 100644 --- a/gradually-update/Cargo.toml +++ b/gradually-update/Cargo.toml @@ -10,12 +10,12 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["max-encoded-len"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } [features] default = ["std"] diff --git a/nft/Cargo.toml b/nft/Cargo.toml index 0aedd85ac..84f593f99 100644 --- a/nft/Cargo.toml +++ b/nft/Cargo.toml @@ -10,15 +10,15 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["max-encoded-len"] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } [features] default = ["std"] diff --git a/oracle/Cargo.toml b/oracle/Cargo.toml index 2bfceb55b..c410b13c0 100644 --- a/oracle/Cargo.toml +++ b/oracle/Cargo.toml @@ -10,19 +10,19 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } orml-traits = { path = "../traits", version = "0.4.1-dev", default-features = false } orml-utilities = { path = "../utilities", version = "0.4.1-dev", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } [features] default = ["std"] diff --git a/oracle/rpc/Cargo.toml b/oracle/rpc/Cargo.toml index c7e156a62..7df7d62c8 100644 --- a/oracle/rpc/Cargo.toml +++ b/oracle/rpc/Cargo.toml @@ -11,8 +11,8 @@ codec = { package = "parity-scale-codec", version = "2.2.0" } jsonrpc-core = "15.0.0" jsonrpc-core-client = "15.0.0" jsonrpc-derive = "15.0.0" -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } orml-oracle-rpc-runtime-api = { path = "runtime-api", version = "0.4.1-dev" } diff --git a/oracle/rpc/runtime-api/Cargo.toml b/oracle/rpc/runtime-api/Cargo.toml index e7f392df8..fec554595 100644 --- a/oracle/rpc/runtime-api/Cargo.toml +++ b/oracle/rpc/runtime-api/Cargo.toml @@ -8,8 +8,8 @@ description = "Runtime API module for orml-oracle-rpc." [dependencies] codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["derive"] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } [features] default = ["std"] diff --git a/rewards/Cargo.toml b/rewards/Cargo.toml index b01028aab..757453c2c 100644 --- a/rewards/Cargo.toml +++ b/rewards/Cargo.toml @@ -10,15 +10,15 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["max-encoded-len"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } orml-traits = { path = "../traits", version = "0.4.1-dev", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } [features] default = ["std"] diff --git a/tokens/Cargo.toml b/tokens/Cargo.toml index 0ba744101..25a08c0c0 100644 --- a/tokens/Cargo.toml +++ b/tokens/Cargo.toml @@ -10,16 +10,16 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["max-encoded-len"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } orml-traits = { path = "../traits", version = "0.4.1-dev", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } # Patch doesn't work as `pallet-elections-phragmen` is now 4.0.0 version. Revert `rev` to `statemint` branch after # other `statemint` dependencies upgraded. pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", rev = "1d04678e20555e623c974ee1127bc8a45abcf3d6" } diff --git a/traits/Cargo.toml b/traits/Cargo.toml index 0a76ce04f..de064ca9c 100644 --- a/traits/Cargo.toml +++ b/traits/Cargo.toml @@ -10,14 +10,14 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } num-traits = { version = "0.2.14", default-features = false } impl-trait-for-tuples = "0.2.1" -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } orml-utilities = { path = "../utilities", version = "0.4.1-dev", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10", default-features = false } [features] default = ["std"] diff --git a/unknown-tokens/Cargo.toml b/unknown-tokens/Cargo.toml index 35186b40f..faa88a1e0 100644 --- a/unknown-tokens/Cargo.toml +++ b/unknown-tokens/Cargo.toml @@ -10,18 +10,18 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10", default-features = false } orml-xcm-support = { path = "../xcm-support", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } [features] default = ["std"] diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index 42c47ae7f..074f89d8e 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -10,14 +10,14 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } [dev-dependencies] serde_json = "1.0.64" -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } [features] default = ["std"] diff --git a/vesting/Cargo.toml b/vesting/Cargo.toml index 4f816d43d..266518955 100644 --- a/vesting/Cargo.toml +++ b/vesting/Cargo.toml @@ -10,16 +10,16 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["max-encoded-len"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } [features] default = ["std"] diff --git a/weight-meter/Cargo.toml b/weight-meter/Cargo.toml index 7b1d45e5d..9aeefee16 100644 --- a/weight-meter/Cargo.toml +++ b/weight-meter/Cargo.toml @@ -10,20 +10,20 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] spin = "0.7.1" -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } weight-meter-procedural = { path = "weight-meter-procedural", default-features = false } orml-bencher = { path = "../bencher", default-features = false, optional = true } [dev-dependencies] serde = { version = "1.0.124" } codec = { package = "parity-scale-codec", version = "2.2.0" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9"} -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10"} +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } [features] default = ["std"] diff --git a/xcm-support/Cargo.toml b/xcm-support/Cargo.toml index 2077accb1..7aef7d1f2 100644 --- a/xcm-support/Cargo.toml +++ b/xcm-support/Cargo.toml @@ -10,13 +10,13 @@ edition = "2018" [dependencies] codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10", default-features = false } orml-traits = { path = "../traits", version = "0.4.1-dev", default-features = false } diff --git a/xcm/Cargo.toml b/xcm/Cargo.toml index 55b728c10..be4029670 100644 --- a/xcm/Cargo.toml +++ b/xcm/Cargo.toml @@ -9,13 +9,13 @@ edition = "2018" [dependencies] codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9", default-features = false } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10", default-features = false } [features] default = ["std"] diff --git a/xtokens/Cargo.toml b/xtokens/Cargo.toml index 6b4f6b9ff..16c1df537 100644 --- a/xtokens/Cargo.toml +++ b/xtokens/Cargo.toml @@ -10,40 +10,40 @@ edition = "2018" [dependencies] serde = { version = "1.0.124", optional = true } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.9", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.10", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10", default-features = false } orml-xcm-support = { path = "../xcm-support", default-features = false } orml-traits = { path = "../traits", default-features = false} [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } # cumulus -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.9" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.9" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.9" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.9" } -parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.9" } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.10" } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.10" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.10" } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.10" } +parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.10" } # polkadot -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" } -xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9"} +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10" } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10" } +xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10"} orml-tokens = { path = "../tokens" } orml-xcm = { path = "../xcm" } diff --git a/xtokens/src/mock/para.rs b/xtokens/src/mock/para.rs index efd2c48c3..f6642685f 100644 --- a/xtokens/src/mock/para.rs +++ b/xtokens/src/mock/para.rs @@ -200,6 +200,7 @@ impl Config for XcmConfig { type Weigher = FixedWeightBounds; type Trader = AllTokensAreCreatedEqualToWeight; type ResponseHandler = (); + type SubscriptionService = PolkadotXcm; } pub struct ChannelInfo; diff --git a/xtokens/src/mock/relay.rs b/xtokens/src/mock/relay.rs index 9b3205035..e239f46f3 100644 --- a/xtokens/src/mock/relay.rs +++ b/xtokens/src/mock/relay.rs @@ -3,6 +3,7 @@ use frame_support::{ traits::Everything, weights::{IdentityFee, Weight}, }; +use frame_system::EnsureRoot; use sp_core::H256; use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; @@ -112,6 +113,7 @@ impl Config for XcmConfig { type Weigher = FixedWeightBounds; type Trader = UsingComponents, KsmLocation, AccountId, Balances, ()>; type ResponseHandler = (); + type SubscriptionService = XcmPallet; } pub type LocalOriginToLocation = SignedToAccountId32; @@ -138,6 +140,7 @@ impl ump::Config for Runtime { type Event = Event; type UmpSink = ump::XcmSink, Runtime>; type FirstMessageFactorPercent = FirstMessageFactorPercent; + type ExecuteOverweightOrigin = EnsureRoot; } impl origin::Config for Runtime {} From a84453cbaac23b77d8288c9a8be7340a7bb60423 Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Thu, 16 Sep 2021 14:27:25 +1200 Subject: [PATCH 08/12] Make clippy happy. --- xtokens/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xtokens/src/lib.rs b/xtokens/src/lib.rs index 385c02d95..6eea4ccc1 100644 --- a/xtokens/src/lib.rs +++ b/xtokens/src/lib.rs @@ -310,7 +310,7 @@ pub mod module { let reserve_buy_execution = Self::buy_execution(half(&asset), &reserve, dest_weight)?; let dest_buy_execution = Self::buy_execution(half(&asset), &dest, dest_weight)?; Ok(WithdrawAsset { - assets: asset.clone().into(), + assets: asset.into(), effects: vec![InitiateReserveWithdraw { assets: All.into(), reserve, From 0d4d5526000865c09bb93b1bf7abca7d2b039997 Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Thu, 16 Sep 2021 15:03:02 +1200 Subject: [PATCH 09/12] Use xcm prelude. --- traits/src/xcm_transfer.rs | 2 +- xtokens/src/tests.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/traits/src/xcm_transfer.rs b/traits/src/xcm_transfer.rs index ae7caf6cc..18913cb00 100644 --- a/traits/src/xcm_transfer.rs +++ b/traits/src/xcm_transfer.rs @@ -1,6 +1,6 @@ use frame_support::dispatch::DispatchResult; use frame_support::weights::Weight; -use xcm::opaque::latest::{MultiAsset, MultiLocation}; +use xcm::latest::prelude::*; /// Abstraction over cross-chain token transfers. pub trait XcmTransfer { diff --git a/xtokens/src/tests.rs b/xtokens/src/tests.rs index ce6846afe..1480af7b7 100644 --- a/xtokens/src/tests.rs +++ b/xtokens/src/tests.rs @@ -8,7 +8,6 @@ use mock::*; use orml_traits::MultiCurrency; use polkadot_parachain::primitives::{AccountIdConversion, Sibling}; use sp_runtime::AccountId32; -use xcm::latest::{Junction, NetworkId, Order}; use xcm_simulator::TestExt; fn para_a_account() -> AccountId32 { From f3338cadb918c5c542594a56c970ce87507458d2 Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Wed, 22 Sep 2021 14:00:48 +1200 Subject: [PATCH 10/12] relative locations and multi asset --- traits/src/lib.rs | 2 ++ traits/src/location.rs | 16 ++++++++++---- traits/src/multi_asset.rs | 23 ++++++++++++++++++++ xcm-support/src/tests.rs | 46 +++++++++++++++------------------------ xtokens/src/lib.rs | 10 ++------- xtokens/src/mock/para.rs | 5 +---- xtokens/src/tests.rs | 6 ++--- 7 files changed, 61 insertions(+), 47 deletions(-) create mode 100644 traits/src/multi_asset.rs diff --git a/traits/src/lib.rs b/traits/src/lib.rs index ac610bdbb..9eb83c5fc 100644 --- a/traits/src/lib.rs +++ b/traits/src/lib.rs @@ -18,6 +18,7 @@ pub use currency::{ }; pub use data_provider::{DataFeeder, DataProvider, DataProviderExtended}; pub use get_by_key::GetByKey; +pub use multi_asset::ConcreteFungibleAsset; pub use nft::NFT; pub use price::{DefaultPriceProvider, PriceProvider}; pub use rewards::RewardHandler; @@ -29,6 +30,7 @@ pub mod currency; pub mod data_provider; pub mod get_by_key; pub mod location; +pub mod multi_asset; pub mod nft; pub mod price; pub mod rewards; diff --git a/traits/src/location.rs b/traits/src/location.rs index 6d863e616..b9a1e0072 100644 --- a/traits/src/location.rs +++ b/traits/src/location.rs @@ -1,3 +1,4 @@ +use sp_std::prelude::*; use xcm::latest::prelude::*; pub trait Parse { @@ -54,6 +55,16 @@ impl Reserve for MultiAsset { } } +pub trait RelativeLocations { + fn sibling_parachain_general_key(para_id: u32, general_key: Vec) -> MultiLocation; +} + +impl RelativeLocations for MultiLocation { + fn sibling_parachain_general_key(para_id: u32, general_key: Vec) -> MultiLocation { + MultiLocation::new(1, X2(Parachain(para_id), GeneralKey(general_key))) + } +} + #[cfg(test)] mod tests { use super::*; @@ -62,10 +73,7 @@ mod tests { const GENERAL_INDEX: Junction = GeneralIndex(1); fn concrete_fungible(id: MultiLocation) -> MultiAsset { - MultiAsset { - fun: Fungible(1), - id: Concrete(id), - } + (id, 1).into() } #[test] diff --git a/traits/src/multi_asset.rs b/traits/src/multi_asset.rs new file mode 100644 index 000000000..a4a10d636 --- /dev/null +++ b/traits/src/multi_asset.rs @@ -0,0 +1,23 @@ +use sp_std::prelude::*; +use xcm::latest::prelude::*; + +use crate::location::RelativeLocations; + +pub trait ConcreteFungibleAsset { + fn sibling_parachain_asset(para_id: u32, general_key: Vec, amount: u128) -> MultiAsset; + fn parent_asset(amount: u128) -> MultiAsset; +} + +impl ConcreteFungibleAsset for MultiAsset { + fn sibling_parachain_asset(para_id: u32, general_key: Vec, amount: u128) -> MultiAsset { + ( + MultiLocation::sibling_parachain_general_key(para_id, general_key), + amount, + ) + .into() + } + + fn parent_asset(amount: u128) -> MultiAsset { + (MultiLocation::parent(), amount).into() + } +} diff --git a/xcm-support/src/tests.rs b/xcm-support/src/tests.rs index 54c074a38..356a6e272 100644 --- a/xcm-support/src/tests.rs +++ b/xcm-support/src/tests.rs @@ -4,6 +4,8 @@ use super::*; +use orml_traits::ConcreteFungibleAsset; + #[derive(Debug, PartialEq, Eq)] pub enum TestCurrencyId { TokenA, @@ -36,25 +38,17 @@ type MatchesCurrencyId = IsNativeConcrete; #[test] fn is_native_concrete_matches_native_currencies() { assert_eq!( - MatchesCurrencyId::matches_fungible(&MultiAsset { - fun: Fungible(100), - id: Concrete(MultiLocation::parent()), - }), + MatchesCurrencyId::matches_fungible(&MultiAsset::parent_asset(100)), Some(100), ); assert_eq!( - MatchesCurrencyId::matches_fungible(&MultiAsset { - fun: Fungible(100), - id: Concrete(MultiLocation::new(1, X2(Parachain(1), GeneralKey("TokenA".into())))), - }), + MatchesCurrencyId::matches_fungible(&MultiAsset::sibling_parachain_asset(1, "TokenA".into(), 100)), Some(100), ); + assert_eq!( - MatchesCurrencyId::matches_fungible(&MultiAsset { - fun: Fungible(100), - id: Concrete(MultiLocation::new(1, X2(Parachain(2), GeneralKey("TokenB".into())))), - }), + MatchesCurrencyId::matches_fungible(&MultiAsset::sibling_parachain_asset(2, "TokenB".into(), 100)), Some(100), ); } @@ -62,17 +56,19 @@ fn is_native_concrete_matches_native_currencies() { #[test] fn is_native_concrete_does_not_matches_non_native_currencies() { assert!( - >::matches_fungible(&MultiAsset { - fun: Fungible(100), - id: Concrete(MultiLocation::new(1, X2(Parachain(2), GeneralKey("TokenC".into())))), - }) + >::matches_fungible(&MultiAsset::sibling_parachain_asset( + 2, + "TokenC".into(), + 100 + )) .is_none() ); assert!( - >::matches_fungible(&MultiAsset { - fun: Fungible(100), - id: Concrete(MultiLocation::new(1, X2(Parachain(1), GeneralKey("TokenB".into())))), - }) + >::matches_fungible(&MultiAsset::sibling_parachain_asset( + 1, + "TokenB".into(), + 100 + )) .is_none() ); assert!( @@ -94,17 +90,11 @@ fn multi_native_asset() { &Parent.into() )); assert!(MultiNativeAsset::filter_asset_location( - &MultiAsset { - fun: Fungible(100), - id: Concrete(MultiLocation::new(1, X2(Parachain(1), GeneralKey("TokenA".into())))), - }, + &MultiAsset::sibling_parachain_asset(1, "TokenA".into(), 100), &MultiLocation::new(1, X1(Parachain(1))), )); assert!(!MultiNativeAsset::filter_asset_location( - &MultiAsset { - fun: Fungible(100), - id: Concrete(MultiLocation::new(1, X2(Parachain(1), GeneralKey("TokenA".into())))), - }, + &MultiAsset::sibling_parachain_asset(1, "TokenA".into(), 100), &MultiLocation::parent(), )); } diff --git a/xtokens/src/lib.rs b/xtokens/src/lib.rs index 6eea4ccc1..595b73081 100644 --- a/xtokens/src/lib.rs +++ b/xtokens/src/lib.rs @@ -201,10 +201,7 @@ pub mod module { let location: MultiLocation = T::CurrencyIdConvert::convert(currency_id.clone()) .ok_or(Error::::NotCrossChainTransferableCurrency)?; - let asset = MultiAsset { - fun: Fungible(amount.into()), - id: Concrete(location), - }; + let asset = (location, amount.into()).into(); Self::do_transfer_multiasset(who.clone(), asset, dest.clone(), dest_weight, false)?; Self::deposit_event(Event::::Transferred(who, currency_id, amount, dest)); @@ -421,10 +418,7 @@ pub mod module { /// Returns weight of `transfer` call. fn weight_of_transfer(currency_id: T::CurrencyId, amount: T::Balance, dest: &MultiLocation) -> Weight { if let Some(location) = T::CurrencyIdConvert::convert(currency_id) { - let asset = MultiAsset { - fun: Fungible(amount.into()), - id: Concrete(location), - }; + let asset = (location, amount.into()).into(); Self::weight_of_transfer_multiasset(&asset, dest) } else { 0 diff --git a/xtokens/src/mock/para.rs b/xtokens/src/mock/para.rs index 6f0462641..aa11f79d4 100644 --- a/xtokens/src/mock/para.rs +++ b/xtokens/src/mock/para.rs @@ -184,10 +184,7 @@ impl WeightTrader for AllTokensAreCreatedEqualToWeight { if weight.is_zero() { None } else { - Some(MultiAsset { - fun: Fungible(weight as u128), - id: Concrete(self.0.clone()), - }) + Some((self.0.clone(), weight as u128).into()) } } } diff --git a/xtokens/src/tests.rs b/xtokens/src/tests.rs index 1480af7b7..a6f577e13 100644 --- a/xtokens/src/tests.rs +++ b/xtokens/src/tests.rs @@ -5,7 +5,7 @@ use codec::Encode; use cumulus_primitives_core::ParaId; use frame_support::{assert_err, assert_noop, assert_ok, traits::Currency}; use mock::*; -use orml_traits::MultiCurrency; +use orml_traits::{ConcreteFungibleAsset, MultiCurrency}; use polkadot_parachain::primitives::{AccountIdConversion, Sibling}; use sp_runtime::AccountId32; use xcm_simulator::TestExt; @@ -294,7 +294,7 @@ fn transfer_to_self_chain_fails() { assert_noop!( ParaXTokens::transfer_multiasset( Some(ALICE).into(), - Box::new((MultiLocation::new(1, X2(Parachain(1), GeneralKey("A".into()))), 100).into()), + Box::new(MultiAsset::sibling_parachain_asset(1, "A".into(), 100)), Box::new(MultiLocation::new( 1, X2( @@ -320,7 +320,7 @@ fn transfer_to_invalid_dest_fails() { assert_noop!( ParaXTokens::transfer_multiasset( Some(ALICE).into(), - Box::new((MultiLocation::new(1, X2(Parachain(1), GeneralKey("A".into()))), 100).into()), + Box::new(MultiAsset::sibling_parachain_asset(1, "A".into(), 100)), Box::new(MultiLocation::new( 0, X1(Junction::AccountId32 { From a4fdb39e2ee716ec3373e4a22937f248e358a066 Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Wed, 29 Sep 2021 16:22:51 +1300 Subject: [PATCH 11/12] improvements --- xcm-support/src/tests.rs | 6 +++--- xtokens/src/lib.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xcm-support/src/tests.rs b/xcm-support/src/tests.rs index 356a6e272..c47469c41 100644 --- a/xcm-support/src/tests.rs +++ b/xcm-support/src/tests.rs @@ -4,7 +4,7 @@ use super::*; -use orml_traits::ConcreteFungibleAsset; +use orml_traits::{location::RelativeLocations, ConcreteFungibleAsset}; #[derive(Debug, PartialEq, Eq)] pub enum TestCurrencyId { @@ -23,10 +23,10 @@ impl Convert> for CurrencyIdConvert { if l == MultiLocation::parent() { return Some(RelayChainToken); } - if l == MultiLocation::new(1, X2(Parachain(1), GeneralKey(token_a))) { + if l == MultiLocation::sibling_parachain_general_key(1, token_a) { return Some(TokenA); } - if l == MultiLocation::new(1, X2(Parachain(2), GeneralKey(token_b))) { + if l == MultiLocation::sibling_parachain_general_key(2, token_b) { return Some(TokenB); } None diff --git a/xtokens/src/lib.rs b/xtokens/src/lib.rs index 595b73081..98ae48920 100644 --- a/xtokens/src/lib.rs +++ b/xtokens/src/lib.rs @@ -251,7 +251,7 @@ pub mod module { asset: MultiAsset, dest: MultiLocation, recipient: MultiLocation, - dest_weight: u64, + dest_weight: Weight, ) -> Result, DispatchError> { let buy_execution = Self::buy_execution(asset.clone(), &dest, dest_weight)?; Ok(WithdrawAsset { @@ -269,7 +269,7 @@ pub mod module { asset: MultiAsset, reserve: MultiLocation, recipient: MultiLocation, - dest_weight: u64, + dest_weight: Weight, ) -> Result, DispatchError> { Ok(WithdrawAsset { assets: asset.clone().into(), @@ -289,7 +289,7 @@ pub mod module { reserve: MultiLocation, dest: MultiLocation, recipient: MultiLocation, - dest_weight: u64, + dest_weight: Weight, ) -> Result, DispatchError> { let mut reanchored_dest = dest.clone(); if reserve == MultiLocation::parent() { @@ -332,7 +332,7 @@ pub mod module { } } - fn buy_execution(asset: MultiAsset, at: &MultiLocation, weight: u64) -> Result, DispatchError> { + fn buy_execution(asset: MultiAsset, at: &MultiLocation, weight: Weight) -> Result, DispatchError> { let inv_at = T::LocationInverter::invert_location(at); let fees = asset.reanchored(&inv_at).map_err(|_| Error::::CannotReanchor)?; Ok(BuyExecution { From ca260957b93e58e84c95a8db6e34d9b676d0c8fc Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Wed, 29 Sep 2021 22:07:51 +1300 Subject: [PATCH 12/12] bump version --- Cargo.dev.toml | 122 ++++++++++++++++++++++++------------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/Cargo.dev.toml b/Cargo.dev.toml index 0a9f13905..5bb7be7f6 100644 --- a/Cargo.dev.toml +++ b/Cargo.dev.toml @@ -31,68 +31,68 @@ resolver = "2" split-debuginfo = "unpacked" [patch.'https://github.com/paritytech/substrate'] -frame-benchmarking = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -frame-support = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -frame-system = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-authorship = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-balances = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-elections-phragmen = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-offences = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-scheduler = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-session = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-staking = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-timestamp = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-treasury = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -pallet-vesting = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sc-client-api = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sc-client-db = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sc-executor = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sc-executor-common = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sc-executor-wasmi = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-api = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-application-crypto = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-arithmetic = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-authorship = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-blockchain = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-consensus = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-core = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-debug-derive = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-externalities = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-inherents = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-io = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-keystore = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-npos-elections = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-panic-handler = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-runtime = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-runtime-interface = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-session = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-staking = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-state-machine = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-std = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-storage = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-tasks = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-timestamp = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-trie = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-version = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-wasm-interface = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } -sp-utils = { git = "https://github.com/paritytech//substrate", rev = "58f0223a75933e3226f330b8458bcb78e12164cf" } +frame-benchmarking = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +frame-support = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +frame-system = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-authorship = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-balances = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-elections-phragmen = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-offences = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-scheduler = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-session = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-staking = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-timestamp = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-treasury = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +pallet-vesting = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sc-client-api = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sc-client-db = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sc-executor = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sc-executor-common = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sc-executor-wasmi = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-api = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-application-crypto = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-arithmetic = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-authorship = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-blockchain = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-consensus = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-core = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-debug-derive = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-externalities = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-inherents = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-io = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-keystore = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-npos-elections = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-panic-handler = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-runtime = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-runtime-interface = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-session = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-staking = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-state-machine = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-std = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-storage = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-tasks = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-timestamp = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-trie = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-version = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-wasm-interface = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } +sp-utils = { git = "https://github.com/paritytech//substrate", rev = "420db18eaa1a1f5ce9ba40dd6ccb69f7b3dd9bb7" } [patch.'https://github.com/paritytech/cumulus'] -cumulus-primitives-core = { git = "https://github.com/paritytech//cumulus", rev = "fa116cfbfb470a8114fc02f9d2e3c0a5ab6c7193" } -parachain-info = { git = "https://github.com/paritytech//cumulus", rev = "fa116cfbfb470a8114fc02f9d2e3c0a5ab6c7193" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "fa116cfbfb470a8114fc02f9d2e3c0a5ab6c7193" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "fa116cfbfb470a8114fc02f9d2e3c0a5ab6c7193" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech//cumulus", rev = "fa116cfbfb470a8114fc02f9d2e3c0a5ab6c7193" } +cumulus-primitives-core = { git = "https://github.com/paritytech//cumulus", rev = "870b214693856e768ba482fe2d3b9a83b24e4540" } +parachain-info = { git = "https://github.com/paritytech//cumulus", rev = "870b214693856e768ba482fe2d3b9a83b24e4540" } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "870b214693856e768ba482fe2d3b9a83b24e4540" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "870b214693856e768ba482fe2d3b9a83b24e4540" } +cumulus-pallet-xcm = { git = "https://github.com/paritytech//cumulus", rev = "870b214693856e768ba482fe2d3b9a83b24e4540" } [patch.'https://github.com/paritytech/polkadot'] -xcm = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } -xcm-executor = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } -xcm-builder = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } -pallet-xcm = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } -polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } -polkadot-parachain = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } -polkadot-primitives = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } -xcm-simulator = { git = "https://github.com/paritytech//polkadot", rev = "d348ba982f823adeb700b54db98169520f323595" } +xcm = { git = "https://github.com/paritytech//polkadot", rev = "aeea9b7bd81919e014f7621f6c4b2eb9709d918f" } +xcm-executor = { git = "https://github.com/paritytech//polkadot", rev = "aeea9b7bd81919e014f7621f6c4b2eb9709d918f" } +xcm-builder = { git = "https://github.com/paritytech//polkadot", rev = "aeea9b7bd81919e014f7621f6c4b2eb9709d918f" } +pallet-xcm = { git = "https://github.com/paritytech//polkadot", rev = "aeea9b7bd81919e014f7621f6c4b2eb9709d918f" } +polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot", rev = "aeea9b7bd81919e014f7621f6c4b2eb9709d918f" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot", rev = "aeea9b7bd81919e014f7621f6c4b2eb9709d918f" } +polkadot-parachain = { git = "https://github.com/paritytech//polkadot", rev = "aeea9b7bd81919e014f7621f6c4b2eb9709d918f" } +polkadot-primitives = { git = "https://github.com/paritytech//polkadot", rev = "aeea9b7bd81919e014f7621f6c4b2eb9709d918f" } +xcm-simulator = { git = "https://github.com/paritytech//polkadot", rev = "aeea9b7bd81919e014f7621f6c4b2eb9709d918f" }