diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/snowbridge_v2.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/snowbridge_v2.rs index 79240fe1bde9..57ffc9230ba0 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/snowbridge_v2.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/snowbridge_v2.rs @@ -173,12 +173,13 @@ fn claim_rewards( ) { BridgeHubWestend::execute_with(|| { type RuntimeEvent = ::RuntimeEvent; + type RuntimeOrigin = ::RuntimeOrigin; let relayer = BridgeHubWestendSender::get(); let reward_address = AssetHubWestendReceiver::get(); type EthereumRewards = ::EthereumRewards; - assert_ok!(EthereumRewards::deposit(relayer.into(), 2 * ETH)); + assert_ok!(EthereumRewards::deposit(relayer.clone().into(), 2 * ETH)); // Check that the message was sent assert_expected_events!( @@ -188,8 +189,21 @@ fn claim_rewards( ] ); - type EthereumInboundQueue = - ::EthereumInboundQueue; let message_id = H256::random(); + let result = EthereumRewards::claim(RuntimeOrigin::signed(relayer.clone()), reward_address.clone(), ETH, message_id); + assert_ok!(result); + + let events = BridgeHubWestend::events(); + assert!( + events.iter().any(|event| matches!( + event, + RuntimeEvent::EthereumRewards(snowbridge_pallet_rewards::Event::RewardClaimed { account_id, deposit_address, value, message_id }) + if *account_id == relayer && *deposit_address == reward_address && *value == ETH, + )), + "RewardClaimed event with correct fields." + ); + + let claim_more_than_available_result = EthereumRewards::claim(RuntimeOrigin::signed(relayer.clone()), reward_address.clone(), 2 * ETH, message_id); + assert_ok!(result); }); }