Skip to content

Commit

Permalink
add expect event
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-reorg committed Nov 21, 2023
1 parent 0ad4bb4 commit 09e33bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contracts/test/L2StandardBridgeBot.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ contract L2StandardBridgeBotTest is Test {
uint withdrawFee = 10000;
address constant LEGACY_ERC20_ETH = 0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000;

event WithdrawTo(address indexed from, address l2Token, address to, uint256 amount, uint32 minGasLimit, bytes extraData);

function setUp() public {
opbnbMainnetFork = vm.createFork("https://opbnb-testnet-rpc.bnbchain.org");
vm.selectFork(opbnbMainnetFork);
Expand All @@ -35,6 +37,8 @@ contract L2StandardBridgeBotTest is Test {
function test_withdrawBNB() public {
vm.prank(user);
uint amount = 100;
vm.expectEmit(true, false, false, true);
emit WithdrawTo(user, LEGACY_ERC20_ETH, user, amount, 200000, "");
bot.withdrawTo{value: withdrawFee + amount}(LEGACY_ERC20_ETH, user, amount, 200000, "");
}

Expand All @@ -45,6 +49,8 @@ contract L2StandardBridgeBotTest is Test {
vm.prank(user);
IERC20(usdt).approve(address(bot), amount);
vm.prank(user);
vm.expectEmit(true, false, false, true);
emit WithdrawTo(user, usdt, user, amount, 200000, "");
bot.withdrawTo{value: withdrawFee}(usdt, user, amount, 200000, "");
}
}

0 comments on commit 09e33bf

Please sign in to comment.