@@ -1689,7 +1689,7 @@ mod on_chain_swapping {
1689
1689
input_asset: INPUT_ASSET ,
1690
1690
input_amount: INPUT_AMOUNT ,
1691
1691
output_asset: OUTPUT_ASSET ,
1692
- origin: SwapOrigin :: Internal ,
1692
+ origin: SwapOrigin :: OnChainAccount ( LP_ACCOUNT ) ,
1693
1693
request_type: SwapRequestTypeEncoded :: Regular {
1694
1694
output_action: SwapOutputActionEncoded :: CreditOnChain {
1695
1695
account_id: LP_ACCOUNT
@@ -1704,9 +1704,21 @@ mod on_chain_swapping {
1704
1704
} )
1705
1705
. then_process_blocks_until_block ( SWAP_BLOCK )
1706
1706
. then_execute_with ( |_| {
1707
- assert_has_matching_event ! (
1707
+ assert_event_sequence ! (
1708
1708
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
+ } ) ,
1710
1722
) ;
1711
1723
1712
1724
assert_eq ! ( MockBalance :: get_balance( & LP_ACCOUNT , INPUT_ASSET ) , 0 ) ;
@@ -1746,7 +1758,7 @@ mod on_chain_swapping {
1746
1758
input_asset: INPUT_ASSET ,
1747
1759
input_amount: INPUT_AMOUNT ,
1748
1760
output_asset: OUTPUT_ASSET ,
1749
- origin: SwapOrigin :: Internal ,
1761
+ origin: SwapOrigin :: OnChainAccount ( LP_ACCOUNT ) ,
1750
1762
request_type: SwapRequestTypeEncoded :: Regular {
1751
1763
output_action: SwapOutputActionEncoded :: CreditOnChain {
1752
1764
account_id: LP_ACCOUNT
@@ -1771,12 +1783,29 @@ mod on_chain_swapping {
1771
1783
} )
1772
1784
. then_process_blocks_until_block ( CHUNK_2_BLOCK )
1773
1785
. then_execute_with ( |_| {
1774
- // There is no "SwapRefunded" event...
1775
-
1776
1786
// Only one chunk is expected to be swapped:
1777
1787
const EXPECTED_OUTPUT_AMOUNT : AssetAmount =
1778
1788
CHUNK_AMOUNT * DEFAULT_SWAP_RATE * DEFAULT_SWAP_RATE ;
1779
1789
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
+
1780
1809
assert_eq ! ( MockBalance :: get_balance( & LP_ACCOUNT , INPUT_ASSET ) , CHUNK_AMOUNT ) ;
1781
1810
assert_eq ! (
1782
1811
MockBalance :: get_balance( & LP_ACCOUNT , OUTPUT_ASSET ) ,
0 commit comments