@@ -1689,7 +1689,7 @@ mod on_chain_swapping {
16891689 input_asset: INPUT_ASSET ,
16901690 input_amount: INPUT_AMOUNT ,
16911691 output_asset: OUTPUT_ASSET ,
1692- origin: SwapOrigin :: Internal ,
1692+ origin: SwapOrigin :: OnChainAccount ( LP_ACCOUNT ) ,
16931693 request_type: SwapRequestTypeEncoded :: Regular {
16941694 output_action: SwapOutputActionEncoded :: CreditOnChain {
16951695 account_id: LP_ACCOUNT
@@ -1704,9 +1704,21 @@ mod on_chain_swapping {
17041704 } )
17051705 . then_process_blocks_until_block ( SWAP_BLOCK )
17061706 . then_execute_with ( |_| {
1707- assert_has_matching_event ! (
1707+ assert_event_sequence ! (
17081708 Test ,
1709- RuntimeEvent :: Swapping ( Event :: SwapExecuted { .. } ) ,
1709+ RuntimeEvent :: Swapping ( Event :: SwapExecuted {
1710+ swap_request_id: SWAP_REQUEST_ID ,
1711+ ..
1712+ } ) ,
1713+ RuntimeEvent :: Swapping ( Event :: CreditedOnChain {
1714+ swap_request_id: SWAP_REQUEST_ID ,
1715+ account_id: LP_ACCOUNT ,
1716+ asset: OUTPUT_ASSET ,
1717+ amount: EXPECTED_OUTPUT_AMOUNT ,
1718+ } ) ,
1719+ RuntimeEvent :: Swapping ( Event :: SwapRequestCompleted {
1720+ swap_request_id: SWAP_REQUEST_ID
1721+ } ) ,
17101722 ) ;
17111723
17121724 assert_eq ! ( MockBalance :: get_balance( & LP_ACCOUNT , INPUT_ASSET ) , 0 ) ;
@@ -1746,7 +1758,7 @@ mod on_chain_swapping {
17461758 input_asset: INPUT_ASSET ,
17471759 input_amount: INPUT_AMOUNT ,
17481760 output_asset: OUTPUT_ASSET ,
1749- origin: SwapOrigin :: Internal ,
1761+ origin: SwapOrigin :: OnChainAccount ( LP_ACCOUNT ) ,
17501762 request_type: SwapRequestTypeEncoded :: Regular {
17511763 output_action: SwapOutputActionEncoded :: CreditOnChain {
17521764 account_id: LP_ACCOUNT
@@ -1771,12 +1783,29 @@ mod on_chain_swapping {
17711783 } )
17721784 . then_process_blocks_until_block ( CHUNK_2_BLOCK )
17731785 . then_execute_with ( |_| {
1774- // There is no "SwapRefunded" event...
1775-
17761786 // Only one chunk is expected to be swapped:
17771787 const EXPECTED_OUTPUT_AMOUNT : AssetAmount =
17781788 CHUNK_AMOUNT * DEFAULT_SWAP_RATE * DEFAULT_SWAP_RATE ;
17791789
1790+ assert_event_sequence ! (
1791+ Test ,
1792+ RuntimeEvent :: Swapping ( Event :: RefundedOnChain {
1793+ swap_request_id: SWAP_REQUEST_ID ,
1794+ account_id: LP_ACCOUNT ,
1795+ asset: INPUT_ASSET ,
1796+ amount: CHUNK_AMOUNT ,
1797+ } ) ,
1798+ RuntimeEvent :: Swapping ( Event :: CreditedOnChain {
1799+ swap_request_id: SWAP_REQUEST_ID ,
1800+ account_id: LP_ACCOUNT ,
1801+ asset: OUTPUT_ASSET ,
1802+ amount: EXPECTED_OUTPUT_AMOUNT
1803+ } ) ,
1804+ RuntimeEvent :: Swapping ( Event :: SwapRequestCompleted {
1805+ swap_request_id: SWAP_REQUEST_ID
1806+ } ) ,
1807+ ) ;
1808+
17801809 assert_eq ! ( MockBalance :: get_balance( & LP_ACCOUNT , INPUT_ASSET ) , CHUNK_AMOUNT ) ;
17811810 assert_eq ! (
17821811 MockBalance :: get_balance( & LP_ACCOUNT , OUTPUT_ASSET ) ,
0 commit comments