Skip to content

Commit 5de8935

Browse files
authored
orml-xtokens unit tests (#543)
* orml-xtokens unit tests * fmt * Solve feature pollution; remove pallet system.
1 parent 19597cc commit 5de8935

File tree

8 files changed

+807
-657
lines changed

8 files changed

+807
-657
lines changed

Cargo.dev.toml

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ sp-transaction-pool = { git = "https://github.com/paritytech//substrate", rev =
8181
sp-trie = { git = "https://github.com/paritytech//substrate", rev = "9c572625f6557dfdb19f47474369a0327d51dfbc" }
8282
sp-version = { git = "https://github.com/paritytech//substrate", rev = "9c572625f6557dfdb19f47474369a0327d51dfbc" }
8383
sp-wasm-interface = { git = "https://github.com/paritytech//substrate", rev = "9c572625f6557dfdb19f47474369a0327d51dfbc" }
84+
sp-utils = { git = "https://github.com/paritytech//substrate", rev = "9c572625f6557dfdb19f47474369a0327d51dfbc" }
8485

8586
[patch.'https://github.com/paritytech/cumulus']
8687
cumulus-primitives-core = { git = "https://github.com/paritytech//cumulus", rev = "c5c3abf7eb9d4fdfb588d6560efaa8dca66a8dbc" }

xtokens/Cargo.toml

+25-11
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,26 @@ orml-xcm-support = { path = "../xcm-support", default-features = false }
2626
orml-traits = { path = "../traits", default-features = false}
2727

2828
[dev-dependencies]
29-
# sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7" }
30-
# polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.7" }
31-
# polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.7" }
32-
# pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7" }
33-
# xcm-simulator = { git = "https://github.com/shaunxw/xcm-simulator", branch = "master" }
34-
# parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.7" }
35-
# xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.7" }
36-
# xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.7" }
37-
38-
# orml-tokens = { path = "../tokens" }
39-
# orml-traits = { path = "../traits" }
29+
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7" }
30+
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7" }
31+
32+
# cumulus
33+
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.7" }
34+
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.7" }
35+
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.7" }
36+
cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.7" }
37+
parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.7" }
38+
39+
# polkadot
40+
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.7" }
41+
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.7" }
42+
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.7" }
43+
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.7" }
44+
pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.7" }
45+
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.7" }
46+
47+
orml-tokens = { path = "../tokens" }
48+
xcm-simulator = { git = "https://github.com/shaunxw/xcm-simulator.git", branch = "polkadot-v0.9.7"}
4049

4150
[features]
4251
default = ["std"]
@@ -55,3 +64,8 @@ std = [
5564
"orml-traits/std",
5665
]
5766
try-runtime = ["frame-support/try-runtime"]
67+
# Needed because of cargo feature pollution.
68+
runtime-benchmarks = [
69+
"xcm-builder/runtime-benchmarks",
70+
"pallet-xcm/runtime-benchmarks",
71+
]

xtokens/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ use xcm_executor::traits::WeightBounds;
4141
pub use module::*;
4242
use orml_traits::location::{Parse, Reserve};
4343

44-
// mod mock;
45-
// mod tests;
44+
mod mock;
45+
mod tests;
4646

4747
enum TransferKind {
4848
/// Transfer self reserve asset.

0 commit comments

Comments
 (0)