@@ -8,8 +8,8 @@ import {IBridge} from "../src/interfaces/IBridge.sol";
8
8
import {Bridge} from "../src/abstract/Bridge.sol " ;
9
9
import {IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol " ;
10
10
import {WrappedToken} from "../src/WrappedToken.sol " ;
11
- import {MerkleTree} from "pod-sdk/verifier/MerkleTree.sol " ;
12
11
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol " ;
12
+ import {EthGetLogsPrecompileHelperTypes} from "pod-sdk/types/EthGetLogsPrecompileHelperTypes.sol " ;
13
13
14
14
contract BridgeMintBurnTest is BridgeBehaviorTest {
15
15
BridgeMintBurn private _bridge;
@@ -50,7 +50,7 @@ contract BridgeMintBurnTest is BridgeBehaviorTest {
50
50
}
51
51
52
52
function test_Claim_SingleLog_MintsToRecipient () public {
53
- BridgeMintBurn .RpcLog[] memory logs = new BridgeMintBurn .RpcLog [](1 );
53
+ EthGetLogsPrecompileHelperTypes .RpcLog[] memory logs = new EthGetLogsPrecompileHelperTypes .RpcLog [](1 );
54
54
logs[0 ] = _makeLog (0 , _mirror, DEPOSIT_AMOUNT, recipient);
55
55
_mockEthGetLogs (0 , bytes ("0x1 " ), _mirror, logs);
56
56
assertEq (_token.balanceOf (recipient), 0 );
@@ -69,15 +69,15 @@ contract BridgeMintBurnTest is BridgeBehaviorTest {
69
69
}
70
70
71
71
function test_Claim_RevertIfDailyLimitExhausted () public {
72
- BridgeMintBurn .RpcLog[] memory logs = new BridgeMintBurn .RpcLog [](1 );
72
+ EthGetLogsPrecompileHelperTypes .RpcLog[] memory logs = new EthGetLogsPrecompileHelperTypes .RpcLog [](1 );
73
73
logs[0 ] = _makeLog (0 , _mirror, tokenLimits.claim + 1 , recipient);
74
74
_mockEthGetLogs (0 , bytes ("0x1 " ), _mirror, logs);
75
75
vm.expectRevert (abi.encodeWithSelector (IBridge.DailyLimitExhausted.selector ));
76
76
_bridge.claim (0 , _mirror, bytes ("0x1 " ));
77
77
}
78
78
79
79
function test_Claim_RevertIfDailyLimitExhausted_ButSucceedAfterOneDay () public {
80
- BridgeMintBurn .RpcLog[] memory logs = new BridgeMintBurn .RpcLog [](1 );
80
+ EthGetLogsPrecompileHelperTypes .RpcLog[] memory logs = new EthGetLogsPrecompileHelperTypes .RpcLog [](1 );
81
81
logs[0 ] = _makeLog (0 , _mirror, DEPOSIT_AMOUNT, recipient);
82
82
_mockEthGetLogs (0 , bytes ("0x1 " ), _mirror, logs);
83
83
_bridge.claim (0 , _mirror, bytes ("0x1 " ));
@@ -91,14 +91,14 @@ contract BridgeMintBurnTest is BridgeBehaviorTest {
91
91
}
92
92
93
93
function test_Claim_RevertIfNoDepositsFound () public {
94
- BridgeMintBurn .RpcLog[] memory logs = new BridgeMintBurn .RpcLog [](0 );
94
+ EthGetLogsPrecompileHelperTypes .RpcLog[] memory logs = new EthGetLogsPrecompileHelperTypes .RpcLog [](0 );
95
95
_mockEthGetLogs (0 , bytes ("0x1 " ), _mirror, logs);
96
96
vm.expectRevert (abi.encodeWithSelector (IBridgeMintBurn.NoDepositsFound.selector ));
97
97
_bridge.claim (0 , _mirror, bytes ("0x1 " ));
98
98
}
99
99
100
100
function test_Claim_RevertIfMultipleDepositsFound () public {
101
- BridgeMintBurn .RpcLog[] memory logs = new BridgeMintBurn .RpcLog [](2 );
101
+ EthGetLogsPrecompileHelperTypes .RpcLog[] memory logs = new EthGetLogsPrecompileHelperTypes .RpcLog [](2 );
102
102
logs[0 ] = _makeLog (0 , _mirror, DEPOSIT_AMOUNT, recipient);
103
103
logs[1 ] = _makeLog (0 , _mirror, DEPOSIT_AMOUNT, recipient);
104
104
_mockEthGetLogs (0 , bytes ("0x1 " ), _mirror, logs);
@@ -109,7 +109,7 @@ contract BridgeMintBurnTest is BridgeBehaviorTest {
109
109
function test_Claim_RevertIfMirrorTokenNotFound () public {
110
110
// Use a token not mapped in mirrorTokens
111
111
address unknownMirror = address (0xBEEF );
112
- BridgeMintBurn .RpcLog[] memory logs = new BridgeMintBurn .RpcLog [](1 );
112
+ EthGetLogsPrecompileHelperTypes .RpcLog[] memory logs = new EthGetLogsPrecompileHelperTypes .RpcLog [](1 );
113
113
logs[0 ] = _makeLog (0 , unknownMirror, DEPOSIT_AMOUNT, recipient);
114
114
_mockEthGetLogs (0 , bytes ("0x1 " ), unknownMirror, logs);
115
115
@@ -118,7 +118,7 @@ contract BridgeMintBurnTest is BridgeBehaviorTest {
118
118
}
119
119
120
120
function test_Claim_RevertIfAlreadyProcessed () public {
121
- BridgeMintBurn .RpcLog[] memory logs = new BridgeMintBurn .RpcLog [](1 );
121
+ EthGetLogsPrecompileHelperTypes .RpcLog[] memory logs = new EthGetLogsPrecompileHelperTypes .RpcLog [](1 );
122
122
logs[0 ] = _makeLog (0 , _mirror, DEPOSIT_AMOUNT, recipient);
123
123
_mockEthGetLogs (0 , bytes ("0x1 " ), _mirror, logs);
124
124
_bridge.claim (0 , _mirror, bytes ("0x1 " ));
@@ -137,7 +137,7 @@ contract BridgeMintBurnTest is BridgeBehaviorTest {
137
137
}
138
138
139
139
function test_Claim_RevertIfPrecompileCallFails () public {
140
- BridgeMintBurn.ExternalEthGetLogsArgs memory args = _buildArgs (0 , bytes ("0x1 " ), _mirror);
140
+ EthGetLogsPrecompileHelperTypes.PrecompileArgs memory args = _buildArgs (0 , bytes ("0x1 " ), _mirror);
141
141
podMockEthGetLogsRevert (abi.encode (args));
142
142
143
143
vm.expectRevert (abi.encodeWithSelector (IBridgeMintBurn.PrecompileCallFailed.selector ));
@@ -172,22 +172,25 @@ contract BridgeMintBurnTest is BridgeBehaviorTest {
172
172
function _buildArgs (uint256 id , bytes memory fromBlock , address tokenAddr )
173
173
internal
174
174
pure
175
- returns (BridgeMintBurn.ExternalEthGetLogsArgs memory )
175
+ returns (EthGetLogsPrecompileHelperTypes.PrecompileArgs memory )
176
176
{
177
- BridgeMintBurn.EthGetLogsArgs memory inner = BridgeMintBurn. EthGetLogsArgs ({
177
+ EthGetLogsPrecompileHelperTypes.RpcArgs memory inner = EthGetLogsPrecompileHelperTypes. RpcArgs ({
178
178
fromBlock: fromBlock,
179
179
toBlock: hex "66696e616c697a6564 " ,
180
180
addr: tokenAddr,
181
181
blockHash: bytes32 (0 ),
182
182
topics: _buildTopics (id, tokenAddr)
183
183
});
184
- return BridgeMintBurn. ExternalEthGetLogsArgs ({chainId: 1 , ethGetLogsArgs: inner});
184
+ return EthGetLogsPrecompileHelperTypes. PrecompileArgs ({chainId: 1 , ethGetLogsArgs: inner});
185
185
}
186
186
187
- function _mockEthGetLogs (uint256 id , bytes memory fromBlock , address tokenAddr , BridgeMintBurn.RpcLog[] memory logs )
188
- internal
189
- {
190
- BridgeMintBurn.ExternalEthGetLogsArgs memory args = _buildArgs (id, fromBlock, tokenAddr);
187
+ function _mockEthGetLogs (
188
+ uint256 id ,
189
+ bytes memory fromBlock ,
190
+ address tokenAddr ,
191
+ EthGetLogsPrecompileHelperTypes.RpcLog[] memory logs
192
+ ) internal {
193
+ EthGetLogsPrecompileHelperTypes.PrecompileArgs memory args = _buildArgs (id, fromBlock, tokenAddr);
191
194
podMockEthGetLogs (abi.encode (args), abi.encode (logs));
192
195
}
193
196
@@ -201,9 +204,9 @@ contract BridgeMintBurnTest is BridgeBehaviorTest {
201
204
function _makeLog (uint256 id , address tokenAddr , uint256 amount , address to )
202
205
internal
203
206
pure
204
- returns (BridgeMintBurn .RpcLog memory )
207
+ returns (EthGetLogsPrecompileHelperTypes .RpcLog memory )
205
208
{
206
- return BridgeMintBurn .RpcLog ({
209
+ return EthGetLogsPrecompileHelperTypes .RpcLog ({
207
210
addr: tokenAddr,
208
211
topics: _buildTopics (id, tokenAddr),
209
212
data: abi.encode (amount, to),
0 commit comments