Skip to content

Commit

Permalink
prefund sibling sovreign accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
asiniscalchi committed Oct 9, 2024
1 parent 1bae7b0 commit c5ff9f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 37 deletions.
8 changes: 7 additions & 1 deletion xcm-simulator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ pub fn para_ext(para_id: u32) -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();

pallet_balances::GenesisConfig::<Runtime> {
balances: vec![(ALICE, INITIAL_BALANCE), (parent_account_id(), INITIAL_BALANCE)],
balances: vec![
(ALICE, INITIAL_BALANCE),
(parent_account_id(), INITIAL_BALANCE),
(sibling_account_id(PARA_A_ID), INITIAL_BALANCE),
(sibling_account_id(PARA_B_ID), INITIAL_BALANCE),
(sibling_account_id(PARA_LAOSISH_ID), INITIAL_BALANCE),
],
}
.assimilate_storage(&mut t)
.unwrap();
Expand Down
36 changes: 0 additions & 36 deletions xcm-simulator/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,18 +605,6 @@ fn xcmp_transfer_native_tokens() {
},
);

ParaB::execute_with(|| {
assert_ok!(parachain::Balances::force_set_balance(
parachain::RuntimeOrigin::root(),
sibling_account_id(PARA_A_ID),
INITIAL_BALANCE
));
assert_eq!(
parachain::Balances::free_balance(sibling_account_id(PARA_A_ID)),
INITIAL_BALANCE
);
});

ParaA::execute_with(|| {
assert_ok!(ParachainPalletXcm::send_xcm(
Here,
Expand All @@ -642,18 +630,6 @@ fn xcmp_transfer_native_tokens() {
fn xcmp_create_asset_in_para_b() {
MockNet::reset();

ParaB::execute_with(|| {
assert_ok!(parachain::Balances::force_set_balance(
parachain::RuntimeOrigin::root(),
sibling_account_id(PARA_A_ID),
INITIAL_BALANCE
));
assert_eq!(
parachain::Balances::free_balance(sibling_account_id(PARA_A_ID)),
INITIAL_BALANCE
);
});

let asset_id = 2;

let create_asset = parachain::RuntimeCall::Assets(TrustBackedAssetsCall::create {
Expand Down Expand Up @@ -691,18 +667,6 @@ fn xcmp_create_asset_in_para_b() {
fn xcmp_create_foreign_asset() {
MockNet::reset();

ParaB::execute_with(|| {
assert_ok!(parachain::Balances::force_set_balance(
parachain::RuntimeOrigin::root(),
sibling_account_id(PARA_A_ID),
INITIAL_BALANCE
));
assert_eq!(
parachain::Balances::free_balance(sibling_account_id(PARA_A_ID)),
INITIAL_BALANCE
);
});

let para_a_native_asset_location =
xcm::v3::Location::new(1, [xcm::v3::Junction::Parachain(PARA_A_ID)]);

Expand Down

0 comments on commit c5ff9f3

Please sign in to comment.