Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: various fixes #316

Merged
merged 11 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion v2/pkg/gatewayevmzevm.t.sol/gatewayevmzevmtest.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion v2/pkg/gatewayzevm.sol/gatewayzevm.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion v2/pkg/gatewayzevm.t.sol/gatewayzevminboundtest.go

Large diffs are not rendered by default.

46 changes: 2 additions & 44 deletions v2/pkg/gatewayzevm.t.sol/gatewayzevmoutboundtest.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion v2/pkg/zrc20.t.sol/zrc20test.go

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions v2/src/zevm/GatewayZEVM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ contract GatewayZEVM is
whenNotPaused
{
if (zrc20 == address(0) || target == address(0)) revert ZeroAddress();
if (amount == 0) revert InsufficientZRC20Amount();

UniversalContract(target).onCrossChainCall(context, zrc20, amount, message);
}
Expand Down Expand Up @@ -352,7 +351,6 @@ contract GatewayZEVM is
whenNotPaused
{
if (zrc20 == address(0) || target == address(0)) revert ZeroAddress();
if (amount == 0) revert InsufficientZRC20Amount();

UniversalContract(target).onRevert(revertContext);
}
Expand Down
20 changes: 0 additions & 20 deletions v2/test/GatewayZEVM.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -496,16 +496,6 @@ contract GatewayZEVMOutboundTest is Test, IGatewayZEVMEvents, IGatewayZEVMErrors
gateway.execute(context, address(zrc20), 1, address(0), message);
}

function testExecuteFailsIfAmountIsZero() public {
bytes memory message = abi.encode("hello");
zContext memory context =
zContext({ origin: abi.encodePacked(address(gateway)), sender: fungibleModule, chainID: 1 });

vm.prank(fungibleModule);
vm.expectRevert(InsufficientZRC20Amount.selector);
gateway.execute(context, address(zrc20), 0, address(testUniversalContract), message);
}

function testExecuteUniversalContractFailsIfZeroAddress() public {
bytes memory message = abi.encode("hello");
zContext memory context =
Expand Down Expand Up @@ -557,16 +547,6 @@ contract GatewayZEVMOutboundTest is Test, IGatewayZEVMEvents, IGatewayZEVMErrors
gateway.executeRevert(context, address(zrc20), 1, address(0), message, revertContext);
}

function testExecuteRevertUniversalContractFailsIfAmountIsZero() public {
bytes memory message = abi.encode("hello");
zContext memory context =
zContext({ origin: abi.encodePacked(address(gateway)), sender: fungibleModule, chainID: 1 });

vm.prank(fungibleModule);
vm.expectRevert(InsufficientZRC20Amount.selector);
gateway.executeRevert(context, address(zrc20), 0, address(testUniversalContract), message, revertContext);
}

function testExecuteRevertUniversalContractFailsIfZeroAddress() public {
bytes memory message = abi.encode("hello");
zContext memory context =
Expand Down
Loading
Loading