Skip to content

Commit

Permalink
Fix the breaking test
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong authored and claravanstaden committed Jan 26, 2024
1 parent d0fd1aa commit dee62c7
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions parachain/runtime/test-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use frame_support::{
traits::{fungible::Mutate, OnFinalize, OnInitialize},
};
use frame_system::pallet_prelude::BlockNumberFor;
use parachains_common::AccountId;
pub use parachains_runtimes_test_utils::test_cases::change_storage_constant_by_governance_works;
use parachains_runtimes_test_utils::{
AccountIdOf, BalanceOf, CollatorSessionKeys, ExtBuilder, ValidatorIdOf, XcmReceivedFrom,
Expand Down Expand Up @@ -131,7 +130,7 @@ pub fn send_transfer_token_message_success<Runtime, XcmConfig, AllPalletsWithout
AllPalletsWithoutSystem:
OnInitialize<BlockNumberFor<Runtime>> + OnFinalize<BlockNumberFor<Runtime>>,
ValidatorIdOf<Runtime>: From<AccountIdOf<Runtime>>,
<Runtime as frame_system::Config>::AccountId: From<sp_runtime::AccountId32>,
<Runtime as frame_system::Config>::AccountId: From<sp_runtime::AccountId32> + AsRef<[u8]>,
{
ExtBuilder::<Runtime>::default()
.with_collators(collator_session_key.collators())
Expand Down Expand Up @@ -171,26 +170,29 @@ pub fn send_transfer_token_message_success<Runtime, XcmConfig, AllPalletsWithout

// finish current block
<pallet_message_queue::Pallet<Runtime>>::on_finalize(block_number.as_u32().into());
<snowbridge_pallet_outbound_queue::Pallet<Runtime>>::on_finalize(block_number.as_u32().into());
<snowbridge_pallet_outbound_queue::Pallet<Runtime>>::on_finalize(
block_number.as_u32().into(),
);
<frame_system::Pallet<Runtime>>::on_finalize(block_number.as_u32().into());

let next_block_number = block_number.saturating_add(U256::from(1));

// start next block
<frame_system::Pallet<Runtime>>::set_block_number(next_block_number.as_u32().into());
<frame_system::Pallet<Runtime>>::on_initialize(next_block_number.as_u32().into());
<snowbridge_pallet_outbound_queue::Pallet<Runtime>>::on_initialize(next_block_number.as_u32().into());
<pallet_message_queue::Pallet<Runtime>>::on_initialize(next_block_number.as_u32().into());
<snowbridge_pallet_outbound_queue::Pallet<Runtime>>::on_initialize(
next_block_number.as_u32().into(),
);
<pallet_message_queue::Pallet<Runtime>>::on_initialize(
next_block_number.as_u32().into(),
);

// finish next block
<pallet_message_queue::Pallet<Runtime>>::on_finalize(next_block_number.as_u32().into());
<snowbridge_pallet_outbound_queue::Pallet<Runtime>>::on_finalize(next_block_number.as_u32().into());
<frame_system::Pallet<Runtime>>::on_finalize(next_block_number.as_u32().into());

let included_head = RuntimeHelper::<Runtime, AllPalletsWithoutSystem>::run_to_block(
next_block_number.as_u32(),
AccountId::from(Alice).into(),
<snowbridge_pallet_outbound_queue::Pallet<Runtime>>::on_finalize(
next_block_number.as_u32().into(),
);
let included_head = <frame_system::Pallet<Runtime>>::finalize();

let origin: ParaId = (assethub_parachain_id as u32).into();
let channel_id: ChannelId = origin.into();
Expand Down

0 comments on commit dee62c7

Please sign in to comment.