diff --git a/packages/contracts-core/test/suite/hubs/ExecutionHub.t.sol b/packages/contracts-core/test/suite/hubs/ExecutionHub.t.sol index 23586654c5..69291d79ad 100644 --- a/packages/contracts-core/test/suite/hubs/ExecutionHub.t.sol +++ b/packages/contracts-core/test/suite/hubs/ExecutionHub.t.sol @@ -7,6 +7,7 @@ import { GasLimitTooLow, GasSuppliedTooLow, IncorrectDestinationDomain, + IncorrectOriginDomain, IncorrectMagicValue, IncorrectSnapshotRoot, MessageOptimisticPeriod, @@ -326,6 +327,21 @@ abstract contract ExecutionHubTest is AgentSecuredTest { verify_messageStatusNone(msgLeaf); } + function test_execute_base_revert_originSameDomain() public { + RawBaseMessage memory rbm; + rbm.sender = rbm.recipient = addressToBytes32(recipient); + RawMessage memory rm; + rm.header.flag = uint8(MessageFlag.Base); + rm.header.origin = localDomain(); + rm.header.destination = localDomain(); + rm.header.nonce = 1; + rm.header.optimisticPeriod = 1 seconds; + rm.body = rbm.formatBaseMessage(); + msgPayload = rm.formatMessage(); + vm.expectRevert(IncorrectOriginDomain.selector); + testedEH().execute(msgPayload, new bytes32[](0), new bytes32[](0), 0, 0); + } + function test_execute_base_revert_reentrancy(Random memory random) public { recipient = address(new ReentrantApp()); // Create some simple data