From d0de074b1a4fb81dd03f572f182a4bd3ffda172e Mon Sep 17 00:00:00 2001 From: lemunozm Date: Thu, 20 Jun 2024 13:13:51 +0200 Subject: [PATCH 1/3] panic if event is not found in the expected blocks --- runtime/integration-tests/src/generic/env.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime/integration-tests/src/generic/env.rs b/runtime/integration-tests/src/generic/env.rs index c6e58ed7f2..ea28267154 100644 --- a/runtime/integration-tests/src/generic/env.rs +++ b/runtime/integration-tests/src/generic/env.rs @@ -111,15 +111,23 @@ pub trait Env: Default { ) }); + let mut found_event = false; for i in blocks.range_for(current, slot) { self.__priv_build_block(i); if let Blocks::UntilEvent { event, .. } = blocks.clone() { if self.check_event(event).is_some() { + found_event = true; break; } } } + + if let Blocks::UntilEvent { event, limit } = blocks.clone() { + if !found_event { + panic!("Event {event:?} was not found producing {limit} blocks"); + } + } } /// Allows to mutate the relay storage state through the closure. From fe3525197ab7954ccc50a2681c2bfc877f32d38c Mon Sep 17 00:00:00 2001 From: lemunozm Date: Tue, 25 Jun 2024 19:22:56 +0200 Subject: [PATCH 2/3] adapt test --- runtime/integration-tests/src/generic/cases/routers.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/runtime/integration-tests/src/generic/cases/routers.rs b/runtime/integration-tests/src/generic/cases/routers.rs index 5900f1a9e2..db0ec58733 100644 --- a/runtime/integration-tests/src/generic/cases/routers.rs +++ b/runtime/integration-tests/src/generic/cases/routers.rs @@ -140,12 +140,9 @@ fn check_submission(mut env: impl Env, domain_router: DomainRoute }); env.pass(Blocks::UntilEvent { - event: expected_event.clone().into(), + event: expected_event.into(), limit: 3, }); - - env.check_event(expected_event) - .expect("expected OutboundMessageExecutionSuccess event"); } #[test_runtimes(all)] From 19f4db59df04b9a991e447856b59e66dd5173ca2 Mon Sep 17 00:00:00 2001 From: lemunozm Date: Tue, 25 Jun 2024 19:43:39 +0200 Subject: [PATCH 3/3] minor test change --- runtime/integration-tests/src/generic/cases/routers.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/runtime/integration-tests/src/generic/cases/routers.rs b/runtime/integration-tests/src/generic/cases/routers.rs index db0ec58733..7abb3bf99a 100644 --- a/runtime/integration-tests/src/generic/cases/routers.rs +++ b/runtime/integration-tests/src/generic/cases/routers.rs @@ -76,14 +76,8 @@ fn environment_for_evm() -> FudgeEnv { env.parachain_state_mut(|| { pallet_evm::AccountCodes::::insert(AXELAR_CONTRACT_ADDRESS, AXELAR_CONTRACT_CODE); - utils::evm::mint_balance_into_derived_account::( - AXELAR_CONTRACT_ADDRESS, - cfg(1_000_000_000), - ); - utils::evm::mint_balance_into_derived_account::( - get_gateway_h160_account::(), - cfg(1_000_000), - ); + utils::evm::mint_balance_into_derived_account::(AXELAR_CONTRACT_ADDRESS, cfg(1)); + utils::evm::mint_balance_into_derived_account::(get_gateway_h160_account::(), cfg(1)); }); env