@@ -55,6 +55,8 @@ contract MatchingEngineTest is Test {
55
55
uint32 constant ARB_DOMAIN = 3 ;
56
56
uint32 constant ETH_DOMAIN = 0 ;
57
57
uint32 constant AVAX_DOMAIN = 1 ;
58
+ uint256 constant WORMHOLE_MESSAGE_FEE = 1 ;
59
+ uint256 constant WORMHOLE_MESSAGE_FEE_STORAGE_SLOT = 7 ;
58
60
59
61
// Environment variables.
60
62
uint256 immutable TESTING_SIGNER = uint256 (vm.envBytes32 ("TESTING_DEVNET_GUARDIAN " ));
@@ -128,6 +130,9 @@ contract MatchingEngineTest is Test {
128
130
}
129
131
130
132
function setUp () public {
133
+ // Set core bridge messageFee > 0
134
+ vm.store (address (wormhole), bytes32 (uint256 (WORMHOLE_MESSAGE_FEE_STORAGE_SLOT)), bytes32 (uint256 (WORMHOLE_MESSAGE_FEE)));
135
+ uint256 messageFee = wormhole.messageFee ();
131
136
vm.startPrank (makeAddr ("owner " ));
132
137
engine = deployProxy (USDC_ADDRESS, address (wormhole), CIRCLE_BRIDGE.fromUniversalAddress ());
133
138
@@ -1794,9 +1799,10 @@ contract MatchingEngineTest is Test {
1794
1799
// Record logs for placeMarketOrder.
1795
1800
vm.recordLogs ();
1796
1801
1802
+ vm.deal (caller, WORMHOLE_MESSAGE_FEE);
1797
1803
// Place the order.
1798
1804
vm.prank (caller);
1799
- engine.executeFastOrder (fastMessage);
1805
+ engine.executeFastOrder {value: WORMHOLE_MESSAGE_FEE} (fastMessage);
1800
1806
1801
1807
// Fetch the logs for Wormhole message. There should be two messages.
1802
1808
Vm.Log[] memory logs = vm.getRecordedLogs ();
@@ -1816,9 +1822,10 @@ contract MatchingEngineTest is Test {
1816
1822
// Record logs for placeMarketOrder.
1817
1823
vm.recordLogs ();
1818
1824
1825
+ vm.deal (caller, WORMHOLE_MESSAGE_FEE);
1819
1826
// Place the order.
1820
1827
vm.prank (caller);
1821
- engine.executeFastOrder (fastMessage);
1828
+ engine.executeFastOrder {value: WORMHOLE_MESSAGE_FEE} (fastMessage);
1822
1829
1823
1830
// Fetch the logs for Wormhole message. There should be two messages.
1824
1831
Vm.Log[] memory logs = vm.getRecordedLogs ();
@@ -1837,8 +1844,10 @@ contract MatchingEngineTest is Test {
1837
1844
// Record logs for placeMarketOrder.
1838
1845
vm.recordLogs ();
1839
1846
1847
+ vm.deal (caller, WORMHOLE_MESSAGE_FEE);
1848
+
1840
1849
vm.prank (caller);
1841
- engine.executeSlowOrderAndRedeem (fastTransferVaa, params);
1850
+ engine.executeSlowOrderAndRedeem {value: WORMHOLE_MESSAGE_FEE} (fastTransferVaa, params);
1842
1851
1843
1852
// Fetch the logs for Wormhole message. There should be two messages.
1844
1853
Vm.Log[] memory logs = vm.getRecordedLogs ();
0 commit comments