add integration tests to xcm-builder (#3537)

* add integration tests to xcm-builder

* add an integration test for reserve_transfer_assets

* add query holding and teleport tests

* formatting

* add to barrier doc comments and fix doc tests warnings

* use more realistic barrier for integration tests

* improve imports

* adjust base xcm weight and existential deposit to be in line with Kusama

* remove AnyNetwork

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* add more comments and remove unnecessary code

* move mock into separate file

* reduce imports

* update cargo.lock

* remove reserve transfer test from xcm builder integration tests

* reword barrier doc comment

* elaborate on QueryHolding test scenario

* add an integration test for reserve based transfers from parachain to parachain

* add teleport tests

* fix failing teleport filter tests

* Update xcm/xcm-builder/src/integration_tests.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update xcm/xcm-builder/src/integration_tests.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update xcm/xcm-builder/src/integration_tests.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Move integration tests to tests/ directory

* Fix merge

* Replace All wildcard with a concrete seed amount

* Rename SEED_AMOUNT to REGISTER_AMOUNT

* Fix compilation error

* Check for teleport destination first before checking out assets

* Fix unit test

* Do not run tests in integration mock

* Add a permissive assets filter for teleportation

* Remove check for teleport location in InitiateTeleport XCM

* Remove defunct test

* Apply suggestions from code review

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Reword comment

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
Alexander Popiak
2021-08-17 23:39:47 +02:00
committed by GitHub
parent e014e53f4a
commit 7b054850fb
9 changed files with 551 additions and 9 deletions
+3 -3
View File
@@ -223,7 +223,7 @@ fn transfer_should_work() {
// we'll let them have message execution for free.
AllowUnpaidFrom::set(vec![X1(Parachain(1)).into()]);
// Child parachain #1 owns 1000 tokens held by us in reserve.
add_asset(1001, (Here, 1000).into());
add_asset(1001, (Here, 1000));
// They want to transfer 100 of them to their sibling parachain #2
let r = XcmExecutor::<TestConfig>::execute_xcm(
Parachain(1).into(),
@@ -243,7 +243,7 @@ fn transfer_should_work() {
fn reserve_transfer_should_work() {
AllowUnpaidFrom::set(vec![X1(Parachain(1)).into()]);
// Child parachain #1 owns 1000 tokens held by us in reserve.
add_asset(1001, (Here, 1000).into());
add_asset(1001, (Here, 1000));
// The remote account owned by gav.
let three: MultiLocation = X1(AccountIndex64 { index: 3, network: Any }).into();
@@ -330,7 +330,7 @@ fn transacting_should_refund_weight() {
fn paid_transacting_should_refund_payment_for_unused_weight() {
let one: MultiLocation = X1(AccountIndex64 { index: 1, network: Any }).into();
AllowPaidFrom::set(vec![one.clone()]);
add_asset(1, (Parent, 100).into());
add_asset(1, (Parent, 100));
WeightPrice::set((Parent.into(), 1_000_000_000_000));
let origin = one.clone();