diff --git a/test/Setup.t.sol b/test/integration-tests/Setup.t.sol similarity index 98% rename from test/Setup.t.sol rename to test/integration-tests/Setup.t.sol index 59256fa..17aa7a2 100644 --- a/test/Setup.t.sol +++ b/test/integration-tests/Setup.t.sol @@ -16,11 +16,11 @@ import {WormholeReceiverAdapter} from "src/adapters/Wormhole/WormholeReceiverAda import {AxelarSenderAdapter} from "src/adapters/axelar/AxelarSenderAdapter.sol"; import {AxelarReceiverAdapter} from "src/adapters/axelar/AxelarReceiverAdapter.sol"; -import {GAC} from "../src/controllers/GAC.sol"; -import {GovernanceTimelock} from "../src/controllers/GovernanceTimelock.sol"; +import {GAC} from "src/controllers/GAC.sol"; +import {GovernanceTimelock} from "src/controllers/GovernanceTimelock.sol"; -import {MultiMessageSender} from "../src/MultiMessageSender.sol"; -import {MultiMessageReceiver} from "../src/MultiMessageReceiver.sol"; +import {MultiMessageSender} from "src/MultiMessageSender.sol"; +import {MultiMessageReceiver} from "src/MultiMessageReceiver.sol"; /// @dev can inherit the setup in tests abstract contract Setup is Test { diff --git a/test/failing-tests/SimpleMMA.GracePeriodExpiry.t.sol b/test/integration-tests/failing-tests/GovernanceTimelock.GracePeriodExpiry.t.sol similarity index 97% rename from test/failing-tests/SimpleMMA.GracePeriodExpiry.t.sol rename to test/integration-tests/failing-tests/GovernanceTimelock.GracePeriodExpiry.t.sol index d4dd023..eedfdfc 100644 --- a/test/failing-tests/SimpleMMA.GracePeriodExpiry.t.sol +++ b/test/integration-tests/failing-tests/GovernanceTimelock.GracePeriodExpiry.t.sol @@ -6,7 +6,7 @@ import {Vm} from "forge-std/Test.sol"; /// local imports import "../Setup.t.sol"; -import "../contracts-mock/MockUniswapReceiver.sol"; +import "../../contracts-mock/MockUniswapReceiver.sol"; import {MultiMessageSender} from "src/MultiMessageSender.sol"; import {MultiMessageReceiver} from "src/MultiMessageReceiver.sol"; diff --git a/test/failing-tests/SimpleMMA.TimelockCheck.t.sol b/test/integration-tests/failing-tests/GovernanceTimelock.TimelockCheck.t.sol similarity index 97% rename from test/failing-tests/SimpleMMA.TimelockCheck.t.sol rename to test/integration-tests/failing-tests/GovernanceTimelock.TimelockCheck.t.sol index 58fec46..5ad95aa 100644 --- a/test/failing-tests/SimpleMMA.TimelockCheck.t.sol +++ b/test/integration-tests/failing-tests/GovernanceTimelock.TimelockCheck.t.sol @@ -6,7 +6,7 @@ import {Vm} from "forge-std/Test.sol"; /// local imports import "../Setup.t.sol"; -import "../contracts-mock/MockUniswapReceiver.sol"; +import "../../contracts-mock/MockUniswapReceiver.sol"; import {MultiMessageSender} from "src/MultiMessageSender.sol"; import {MultiMessageReceiver} from "src/MultiMessageReceiver.sol"; diff --git a/test/integration-tests/failing-tests/MultiMessageSender.ZeroChainId.t.sol b/test/integration-tests/failing-tests/MultiMessageSender.ZeroChainId.t.sol new file mode 100644 index 0000000..b056b28 --- /dev/null +++ b/test/integration-tests/failing-tests/MultiMessageSender.ZeroChainId.t.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >=0.8.9; + +/// library imports +import {Vm} from "forge-std/Test.sol"; + +/// local imports +import "../Setup.t.sol"; +import "../../contracts-mock/MockUniswapReceiver.sol"; + +import {MultiMessageSender} from "src/MultiMessageSender.sol"; +import {MultiMessageReceiver} from "src/MultiMessageReceiver.sol"; +import {Error} from "src/libraries/Error.sol"; +import {GovernanceTimelock} from "src/controllers/GovernanceTimelock.sol"; + +contract ZeroChainId is Setup { + MockUniswapReceiver target; + + /// @dev intializes the setup + function setUp() public override { + super.setUp(); + + vm.selectFork(fork[137]); + target = new MockUniswapReceiver(); + } + + /// @dev just sends a message + function test_zeroChainId() public { + vm.selectFork(fork[1]); + vm.startPrank(caller); + + /// send cross-chain message using MMA infra + vm.expectRevert(Error.ZERO_CHAIN_ID.selector); + MultiMessageSender(contractAddress[1][bytes("MMA_SENDER")]).remoteCall{value: 2 ether}( + 0, address(target), abi.encode(MockUniswapReceiver.setValue.selector, ""), 0 + ); + } +} diff --git a/test/success-tests/SimpleMMA.t.sol b/test/integration-tests/success-tests/SimpleMMA.t.sol similarity index 97% rename from test/success-tests/SimpleMMA.t.sol rename to test/integration-tests/success-tests/SimpleMMA.t.sol index f5c8799..98129fe 100644 --- a/test/success-tests/SimpleMMA.t.sol +++ b/test/integration-tests/success-tests/SimpleMMA.t.sol @@ -6,7 +6,7 @@ import {Vm} from "forge-std/Test.sol"; /// local imports import "../Setup.t.sol"; -import "../contracts-mock/MockUniswapReceiver.sol"; +import "../../contracts-mock/MockUniswapReceiver.sol"; import {MultiMessageSender} from "src/MultiMessageSender.sol"; import {MultiMessageReceiver} from "src/MultiMessageReceiver.sol"; diff --git a/test/unit-tests/MultiMessageReceiver.t.sol b/test/unit-tests/MultiMessageReceiver.t.sol index ac2dda0..a976ba6 100644 --- a/test/unit-tests/MultiMessageReceiver.t.sol +++ b/test/unit-tests/MultiMessageReceiver.t.sol @@ -5,7 +5,7 @@ pragma solidity >=0.8.9; import {Vm} from "forge-std/Test.sol"; /// local imports -import "../Setup.t.sol"; +import "../integration-tests/Setup.t.sol"; import "../contracts-mock/MockUniswapReceiver.sol"; import "src/adapters/Wormhole/WormholeReceiverAdapter.sol"; import "src/libraries/Error.sol";