Skip to content

Commit

Permalink
integration-tests: Re-structure connectors tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cdamian committed Aug 8, 2023
1 parent 548f7a1 commit 1312f1a
Show file tree
Hide file tree
Showing 32 changed files with 25 additions and 316 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
// GNU General Public License for more details.

mod gateway;
mod routers;
mod pallet;
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@

pub use altair_runtime::{AccountId, CurrencyId, Runtime, RuntimeOrigin, System};
use cfg_primitives::{currency_decimals, parachains, Balance};
use cfg_types::tokens::CustomMetadata;
use cfg_types::{domain_address::Domain, tokens::CustomMetadata};
use frame_support::traits::GenesisBuild;
use orml_traits::asset_registry::AssetMetadata;

/// Accounts
pub const ALICE: [u8; 32] = [4u8; 32];
pub const BOB: [u8; 32] = [5u8; 32];
pub const CHARLIE: [u8; 32] = [6u8; 32];

pub const TEST_DOMAIN: Domain = Domain::EVM(1284);

/// A PARA ID used for a sibling parachain emulating Moonbeam.
/// It must be one that doesn't collide with any other in use.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ use utils::investments::{
use xcm_emulator::TestExt;

use crate::{
utils::{AUSD_CURRENCY_ID, GLIMMER_CURRENCY_ID, MOONBEAM_EVM_CHAIN_ID},
xcm::development::{
connectors::pallet::development::{
setup::{cfg, dollar, ALICE, BOB, PARA_ID_MOONBEAM},
test_net::{Development, Moonbeam, RelayChain, TestNet},
tests::connectors::utils::{
get_default_moonbeam_native_token_location, DEFAULT_MOONBEAM_LOCATION,
},
},
utils::{AUSD_CURRENCY_ID, GLIMMER_CURRENCY_ID, MOONBEAM_EVM_CHAIN_ID},
*,
};

Expand Down Expand Up @@ -1644,8 +1644,8 @@ mod utils {

use super::*;
use crate::{
connectors::pallet::development::tests::register_ausd,
utils::{AUSD_CURRENCY_ID, GLIMMER_CURRENCY_ID, MOONBEAM_EVM_CHAIN_ID},
xcm::development::tests::register_ausd,
};

pub const DEFAULT_BALANCE_GLMR: Balance = 10_000_000_000_000_000_000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use xcm::{
use crate::utils::AUSD_CURRENCY_ID;

mod connectors;
mod routers;

/// Register AUSD in the asset registry.
/// It should be executed within an externalities environment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use crate::{
chain::centrifuge::{
Balance, ConnectorsGateway, OrmlAssetRegistry, OrmlTokens, Runtime, RuntimeOrigin,
},
connectors_gateway::routers::ethereum_xcm::{
connectors::pallet::development::{
setup::{dollar, ALICE, BOB, CHARLIE, PARA_ID_MOONBEAM, TEST_DOMAIN},
test_net::{Development, Moonbeam, RelayChain, TestNet},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use xcm::{
};
use xcm_emulator::TestExt;

use crate::xcm::kusama::{
use crate::connectors::pallet::kusama::{
setup::{air, foreign, sibling_account, ALICE, BOB, PARA_ID_SIBLING},
test_net::{Altair, KusamaNet, Sibling, TestNet},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use xcm::{
};
use xcm_emulator::TestExt;

use crate::xcm::kusama::{
use crate::connectors::pallet::kusama::{
setup::{
air, altair_account, ausd, foreign, karura_account, ksm, sibling_account, ALICE, BOB,
PARA_ID_SIBLING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ use xcm_emulator::TestExt;
use xcm_executor::traits::Convert as C1;

use crate::{
utils::AUSD_CURRENCY_ID,
xcm::kusama::{
connectors::pallet::kusama::{
setup::{
air, altair_account, ausd, foreign, karura_account, ksm, sibling_account, ALICE, BOB,
KSM_ASSET_ID, PARA_ID_SIBLING,
},
test_net::{Altair, Karura, KusamaNet, Sibling, TestNet},
tests::{register_air, register_ausd, register_ksm},
},
utils::AUSD_CURRENCY_ID,
};

#[test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use xcm::{
VersionedMultiLocation,
};

use crate::{utils::AUSD_CURRENCY_ID, xcm::kusama::setup::KSM_ASSET_ID};
use crate::{connectors::pallet::kusama::setup::KSM_ASSET_ID, utils::AUSD_CURRENCY_ID};

mod asset_registry;
mod currency_id_convert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ use xcm::{
use xcm_emulator::TestExt;

use crate::{
utils::AUSD_CURRENCY_ID,
xcm::{
connectors::pallet::{
kusama::{
setup::{
air, altair_account, ausd, foreign, karura_account, ksm, sibling_account, ALICE,
Expand All @@ -54,6 +53,7 @@ use crate::{
},
xcm_metadata,
},
utils::AUSD_CURRENCY_ID,
};

/*
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use xcm::{
};
use xcm_emulator::TestExt;

use crate::xcm::polkadot::{
use crate::connectors::pallet::polkadot::{
setup::{
acala_account, ausd, centrifuge_account, cfg, dot, foreign, sibling_account, ALICE, BOB,
DOT_ASSET_ID, PARA_ID_SIBLING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ use xcm_executor::traits::Convert as C1;

use super::register_dot;
use crate::{
utils::AUSD_CURRENCY_ID,
xcm::polkadot::{
connectors::pallet::polkadot::{
setup::{
acala_account, ausd, centrifuge_account, cfg, dot, foreign, sibling_account, ALICE,
BOB, DOT_ASSET_ID, NO_XCM_ASSET_ID, PARA_ID_SIBLING,
},
test_net::{Acala, Centrifuge, PolkadotNet, Sibling, TestNet},
tests::{register_ausd, register_cfg, register_cfg_v2, register_no_xcm_token},
},
utils::AUSD_CURRENCY_ID,
};

#[test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use xcm::{
};

use crate::{
connectors::pallet::polkadot::setup::{DOT_ASSET_ID, NO_XCM_ASSET_ID},
utils::AUSD_CURRENCY_ID,
xcm::polkadot::setup::{DOT_ASSET_ID, NO_XCM_ASSET_ID},
};

mod asset_registry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use xcm::{
};
use xcm_emulator::TestExt;

use crate::xcm::polkadot::{
use crate::connectors::pallet::polkadot::{
setup::{
acala_account, ausd, centrifuge_account, cfg, dot, foreign, sibling_account, ALICE, BOB,
DOT_ASSET_ID, PARA_ID_SIBLING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ use xcm_emulator::TestExt;

use super::register_dot;
use crate::{
utils::AUSD_CURRENCY_ID,
xcm::{
connectors::pallet::{
polkadot::{
setup::{
acala_account, ausd, centrifuge_account, cfg, dot, foreign, sibling_account, ALICE,
Expand All @@ -55,6 +54,7 @@ use crate::{
},
xcm_metadata,
},
utils::AUSD_CURRENCY_ID,
};

/*
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1312f1a

Please sign in to comment.