From 9b35fcbe2171d0021df6c058bc2b55953dc680cb Mon Sep 17 00:00:00 2001 From: skosito Date: Fri, 9 Aug 2024 20:26:18 +0200 Subject: [PATCH] fix tests --- v2/src/zevm/GatewayZEVM.sol | 2 +- v2/test/GatewayZEVM.t.sol | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/v2/src/zevm/GatewayZEVM.sol b/v2/src/zevm/GatewayZEVM.sol index 432288d3..40a4162f 100644 --- a/v2/src/zevm/GatewayZEVM.sol +++ b/v2/src/zevm/GatewayZEVM.sol @@ -216,7 +216,7 @@ contract GatewayZEVM is emit Withdrawal( msg.sender, chainId, - abi.encodePacked(FUNGIBLE_MODULE_ADDRESS), + receiver, address(zetaToken), amount, 0, diff --git a/v2/test/GatewayZEVM.t.sol b/v2/test/GatewayZEVM.t.sol index 5f8c20fa..f81c6e69 100644 --- a/v2/test/GatewayZEVM.t.sol +++ b/v2/test/GatewayZEVM.t.sol @@ -212,9 +212,9 @@ contract GatewayZEVMInboundTest is Test, IGatewayZEVMEvents, IGatewayZEVMErrors vm.expectEmit(true, true, true, true, address(gateway)); emit Withdrawal( - owner, chainId, abi.encodePacked(fungibleModule), address(zetaToken), amount, 0, 0, "", revertOptions + owner, chainId, abi.encodePacked(addr1), address(zetaToken), amount, 0, 0, "", revertOptions ); - gateway.withdraw(amount, chainId, revertOptions); + gateway.withdraw(abi.encodePacked(addr1), amount, chainId, revertOptions); uint256 ownerBalanceAfter = zetaToken.balanceOf(owner); assertEq(ownerBalanceBefore - 1, ownerBalanceAfter); @@ -238,7 +238,7 @@ contract GatewayZEVMInboundTest is Test, IGatewayZEVMEvents, IGatewayZEVMErrors zetaToken.approve(address(gateway), 0); vm.expectRevert(); - gateway.withdraw(abi.encodePacked(addr1), amount, chainId); + gateway.withdraw(abi.encodePacked(addr1), amount, chainId, revertOptions); // Verify balances not changed uint256 ownerBalanceAfter = zetaToken.balanceOf(owner); @@ -257,7 +257,7 @@ contract GatewayZEVMInboundTest is Test, IGatewayZEVMEvents, IGatewayZEVMErrors uint256 chainId = 1; vm.expectRevert(); - gateway.withdraw(abi.encodePacked(addr1), amount, chainId); + gateway.withdraw(abi.encodePacked(addr1), amount, chainId, revertOptions); } function testWithdrawZETAWithMessage() public { @@ -269,8 +269,8 @@ contract GatewayZEVMInboundTest is Test, IGatewayZEVMEvents, IGatewayZEVMErrors uint256 chainId = 1; vm.expectEmit(true, true, true, true, address(gateway)); - emit Withdrawal(owner, chainId, abi.encodePacked(addr1), address(zetaToken), amount, 0, 0, message); - gateway.withdrawAndCall(abi.encodePacked(addr1), amount, chainId, message); + emit Withdrawal(owner, chainId, abi.encodePacked(addr1), address(zetaToken), amount, 0, 0, message, revertOptions); + gateway.withdrawAndCall(abi.encodePacked(addr1), amount, chainId, message, revertOptions); uint256 ownerBalanceAfter = zetaToken.balanceOf(owner); assertEq(ownerBalanceBefore - 1, ownerBalanceAfter); @@ -295,7 +295,7 @@ contract GatewayZEVMInboundTest is Test, IGatewayZEVMEvents, IGatewayZEVMErrors zetaToken.approve(address(gateway), 0); vm.expectRevert(); - gateway.withdrawAndCall(abi.encodePacked(addr1), amount, chainId, message); + gateway.withdrawAndCall(abi.encodePacked(addr1), amount, chainId, message, revertOptions); // Verify balances not changed uint256 ownerBalanceAfter = zetaToken.balanceOf(owner); @@ -310,7 +310,7 @@ contract GatewayZEVMInboundTest is Test, IGatewayZEVMEvents, IGatewayZEVMErrors function testCallFailsIfReceiverIsZeroAddress() public { bytes memory message = abi.encodeWithSignature("hello(address)", addr1); vm.expectRevert(ZeroAddress.selector); - gateway.call(abi.encodePacked(""), 1, message); + gateway.call(abi.encodePacked(""), 1, message, revertOptions); } function testCall() public {