Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
a bit of cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
acatangiu committed May 15, 2023
1 parent f22fc87 commit 8eb9ac2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 47 deletions.
40 changes: 1 addition & 39 deletions parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ mod bridge_hub_rococo_tests {
}

#[test]
pub fn kata_test() {
pub fn complex_relay_extrinsic_works() {
use asset_test_utils::{mock_open_hrmp_channel, ExtBuilder};

test(
Expand Down Expand Up @@ -439,44 +439,6 @@ mod bridge_hub_rococo_tests {
}
}

#[test]
fn dummy_test() {
use frame_support::traits::Currency;

let relayer_id_on_target = Alice.pair();
let kata = frame_benchmarking::account::<<Runtime as frame_system::Config>::AccountId>(
"kata", 0, 0,
);

let mut t = frame_system::GenesisConfig::default().build_storage::<Runtime>().unwrap();
pallet_balances::GenesisConfig::<Runtime> {
balances: vec![(AccountId32::from(relayer_id_on_target.public()), 211000000)],
}
.assimilate_storage(&mut t)
.unwrap();
let mut t = sp_io::TestExternalities::new(t);
t.execute_with(|| {
let genesis_hash = frame_system::Pallet::<Runtime>::block_hash(0);
let header =
Header::new(1, H256::default(), H256::default(), genesis_hash, Default::default());
// let block_hash = header.hash();
Executive::initialize_block(&header);

let xt = construct_extrinsic(
relayer_id_on_target,
RuntimeCall::Balances(pallet_balances::Call::<Runtime>::transfer_allow_death {
dest: kata.clone().into(),
value: 69000000u128,
}),
);

let r = Executive::apply_extrinsic(xt);
let dispatch_res = r.unwrap();
frame_support::assert_ok!(dispatch_res);
assert_eq!(<pallet_balances::Pallet<Runtime>>::total_balance(&kata), 69000000);
});
}

#[test]
fn relayed_batch_works() {
let batch_call = Box::new(
Expand Down
8 changes: 0 additions & 8 deletions parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,6 @@ pub fn relayed_incoming_message_works<Runtime, XcmConfig, HrmpChannelOpener, GPI
relayer_at_target.public().into(),
);

// TODO: do we need to endow for slash/reward?
// endow_account(&relayer_id_on_target);

// generate bridged relay chain finality, parachain heads and message proofs,
// to be submitted by relayer to this chain.
let (
Expand Down Expand Up @@ -673,9 +670,6 @@ pub fn relayed_batch_works<Runtime, XcmConfig, HrmpChannelOpener, GPI, PPI, MPI,
let relayer_id_on_target =
account::<<Runtime as frame_system::Config>::AccountId>("relayer", 0, 0);

// TODO: do we need to endow for slash/reward?
// endow_account(&relayer_id_on_target);

// generate bridged relay chain finality, parachain heads and message proofs,
// to be submitted by relayer to this chain.
let (
Expand Down Expand Up @@ -841,8 +835,6 @@ pub fn receive_single_message_proof<Runtime, XcmConfig, HrmpChannelOpener, GPI,
pallet_bridge_messages::test_utils::default_bridged_relayer_id::<Runtime, MPI>();
let relayer_id_on_target =
account::<<Runtime as frame_system::Config>::AccountId>("relayer", 0, 0);
// TODO: do we need to endow for slash/reward?
// T::endow_account(&relayer_id_on_target);

use cumulus_primitives_core::XcmpMessageSource;
assert!(cumulus_pallet_xcmp_queue::Pallet::<Runtime>::take_outbound_messages(
Expand Down

0 comments on commit 8eb9ac2

Please sign in to comment.