Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wcgcyx committed Dec 11, 2023
1 parent bcbb845 commit f4ad658
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/unit/child/ChildERC20Bridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ contract ChildERC20BridgeUnitTest is Test, IChildERC20BridgeEvents, IChildERC20B
changePrank(attacker);

// Execute withdraw
vm.expectRevert("ReentrancyGuard: reentrant call");
vm.expectRevert(BurnFailed.selector);
childBridge.withdraw{value: 1 ether}(ChildERC20(address(attackToken)), 100);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ contract ChildERC20BridgeWithdrawETHUnitTest is Test, IChildERC20BridgeEvents, I
uint256 withdrawAmount = 101 ether;
uint256 withdrawFee = 300;

vm.expectRevert(bytes("ERC20: burn amount exceeds balance"));
vm.expectRevert(BurnFailed.selector);
childBridge.withdrawETH{value: withdrawFee}(withdrawAmount);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ contract ChildERC20BridgeWithdrawETHToUnitTest is Test, IChildERC20BridgeEvents,
uint256 withdrawAmount = 101 ether;
uint256 withdrawFee = 300;

vm.expectRevert(bytes("ERC20: burn amount exceeds balance"));
vm.expectRevert(BurnFailed.selector);
childBridge.withdrawETHTo{value: withdrawFee}(address(this), withdrawAmount);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ contract ChildERC20BridgeWithdrawWIMXUnitTest is Test, IChildERC20BridgeEvents,
uint256 withdrawFee = 300;

wIMXToken.approve(address(childBridge), withdrawAmount);
vm.expectRevert(bytes("Wrapped IMX: Insufficient balance"));
vm.expectRevert(TransferWIMXFailed.selector);
childBridge.withdrawWIMX{value: withdrawFee}(withdrawAmount);
}

Expand All @@ -83,7 +83,7 @@ contract ChildERC20BridgeWithdrawWIMXUnitTest is Test, IChildERC20BridgeEvents,
uint256 withdrawFee = 300;

wIMXToken.approve(address(childBridge), withdrawAmount - 1);
vm.expectRevert(bytes("Wrapped IMX: Insufficient allowance"));
vm.expectRevert(TransferWIMXFailed.selector);
childBridge.withdrawWIMX{value: withdrawFee}(withdrawAmount);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ contract ChildERC20BridgeWithdrawWIMXToUnitTest is Test, IChildERC20BridgeEvents
uint256 withdrawFee = 300;

wIMXToken.approve(address(childBridge), withdrawAmount);
vm.expectRevert(bytes("Wrapped IMX: Insufficient balance"));
vm.expectRevert(TransferWIMXFailed.selector);
childBridge.withdrawWIMXTo{value: withdrawFee}(address(this), withdrawAmount);
}

Expand All @@ -92,7 +92,7 @@ contract ChildERC20BridgeWithdrawWIMXToUnitTest is Test, IChildERC20BridgeEvents
uint256 withdrawFee = 300;

wIMXToken.approve(address(childBridge), withdrawAmount - 1);
vm.expectRevert(bytes("Wrapped IMX: Insufficient allowance"));
vm.expectRevert(TransferWIMXFailed.selector);
childBridge.withdrawWIMXTo{value: withdrawFee}(address(this), withdrawAmount);
}

Expand Down

0 comments on commit f4ad658

Please sign in to comment.