Skip to content

Commit

Permalink
Don't use fuzzer for bytes4 argument
Browse files Browse the repository at this point in the history
It's seems to be broken in latest nightly Foundry version
  • Loading branch information
gvladika committed Oct 26, 2023
1 parent 9e36d66 commit c500417
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
22 changes: 12 additions & 10 deletions test-foundry/L1ArbitrumExtendedGateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,18 @@ abstract contract L1ArbitrumExtendedGatewayTest is Test {
);
}

function test_supportsInterface(bytes4 iface) public {
bool expected = false;
if (
iface == type(IERC165).interfaceId ||
iface == IL1ArbitrumGateway.outboundTransferCustomRefund.selector
) {
expected = true;
}

assertEq(l1Gateway.supportsInterface(iface), expected, "Interface shouldn't be supported");
function test_supportsInterface() public {
bytes4 iface = type(IERC165).interfaceId;
assertEq(l1Gateway.supportsInterface(iface), true, "Interface should be supported");

iface = IL1ArbitrumGateway.outboundTransferCustomRefund.selector;
assertEq(l1Gateway.supportsInterface(iface), true, "Interface should be supported");

iface = bytes4(0);
assertEq(l1Gateway.supportsInterface(iface), false, "Interface shouldn't be supported");

iface = IL1ArbitrumGateway.inbox.selector;
assertEq(l1Gateway.supportsInterface(iface), false, "Interface shouldn't be supported");
}

function test_transferExitAndCall_EmptyData_NotRedirected(
Expand Down
20 changes: 11 additions & 9 deletions test-foundry/L1GatewayRouter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -664,16 +664,18 @@ contract L1GatewayRouterTest is GatewayRouterTest {
l1Router.setOwner(address(300));
}

function test_supportsInterface(bytes4 iface) public {
bool expected = false;
if (
iface == type(IERC165).interfaceId ||
iface == L1GatewayRouter.outboundTransferCustomRefund.selector
) {
expected = true;
}
function test_supportsInterface() public {
bytes4 iface = type(IERC165).interfaceId;
assertEq(l1Router.supportsInterface(iface), true, "Interface should be supported");

iface = L1GatewayRouter.outboundTransferCustomRefund.selector;
assertEq(l1Router.supportsInterface(iface), true, "Interface should be supported");

iface = bytes4(0);
assertEq(l1Router.supportsInterface(iface), false, "Interface shouldn't be supported");

assertEq(l1Router.supportsInterface(iface), expected, "Interface shouldn't be supported");
iface = L1GatewayRouter.setGateways.selector;
assertEq(l1Router.supportsInterface(iface), false, "Interface shouldn't be supported");
}

function test_outboundTransfer() public virtual {
Expand Down

0 comments on commit c500417

Please sign in to comment.