From 5dcb3a89252e9e8fa9b54ba9012e714f7cc96395 Mon Sep 17 00:00:00 2001 From: 0xDiscotech <131301107+0xDiscotech@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:27:54 -0300 Subject: [PATCH] chore: enhance mocks --- .../test/invariants/symbolic/MockL2ToL2Messenger.sol | 3 +-- .../test/invariants/symbolic/OptimismSuperchainERC20.t.sol | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/contracts-bedrock/test/invariants/symbolic/MockL2ToL2Messenger.sol b/packages/contracts-bedrock/test/invariants/symbolic/MockL2ToL2Messenger.sol index a0a72523a62f..c5ac204a55ee 100644 --- a/packages/contracts-bedrock/test/invariants/symbolic/MockL2ToL2Messenger.sol +++ b/packages/contracts-bedrock/test/invariants/symbolic/MockL2ToL2Messenger.sol @@ -88,13 +88,12 @@ contract MockL2ToL2Messenger is ITestL2ToL2CrossDomainMessenger { // TODO: Add more logic? Like replacing the `TSTORE` updates with `SSTORE` - or add the checks (bool succ, bytes memory ret) = _target.call{ value: msg.value }(_message); - if (!succ) revert(string(ret)); } // TODO function crossDomainMessageSource() external view returns (uint256 _source) { - _source = block.chainid; + _source = block.chainid + 1; } function crossDomainMessageSender() external view returns (address _sender) { diff --git a/packages/contracts-bedrock/test/invariants/symbolic/OptimismSuperchainERC20.t.sol b/packages/contracts-bedrock/test/invariants/symbolic/OptimismSuperchainERC20.t.sol index a632e2afc05f..3659e244eba0 100644 --- a/packages/contracts-bedrock/test/invariants/symbolic/OptimismSuperchainERC20.t.sol +++ b/packages/contracts-bedrock/test/invariants/symbolic/OptimismSuperchainERC20.t.sol @@ -109,7 +109,7 @@ contract OptimismSuperchainERC20_SymTest is HalmosTest { vm.assume(_to != address(0)); MESSENGER.forTest_setCurrentXDomSender(address(optimismSuperchainERC20)); - vm.prank(_sender); + vm.prank(address(MESSENGER)); try optimismSuperchainERC20.relayERC20(_from, _to, _amount) { console.log(7); assert(_sender == address(MESSENGER));