From 7157066ddf9f772c06a48edc3c15303b730d60db Mon Sep 17 00:00:00 2001 From: 0xDiscotech <131301107+0xDiscotech@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:23:31 -0300 Subject: [PATCH] chore: set xdomain sender on failing test --- .../test/invariants/symbolic/MockL2ToL2Messenger.sol | 2 +- .../test/invariants/symbolic/OptimismSuperchainERC20.t.sol | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/contracts-bedrock/test/invariants/symbolic/MockL2ToL2Messenger.sol b/packages/contracts-bedrock/test/invariants/symbolic/MockL2ToL2Messenger.sol index c2cf5d826470..a0a72523a62f 100644 --- a/packages/contracts-bedrock/test/invariants/symbolic/MockL2ToL2Messenger.sol +++ b/packages/contracts-bedrock/test/invariants/symbolic/MockL2ToL2Messenger.sol @@ -55,7 +55,7 @@ contract MockL2ToL2Messenger is ITestL2ToL2CrossDomainMessenger { } // TODO - function sendMessage(uint256 _destination, address _target, bytes calldata _message) external payable { + function sendMessage(uint256 _destination, address _target, bytes calldata) external payable { console.log(11); if (_destination == block.chainid) revert MessageDestinationSameChain(); console.log(22); diff --git a/packages/contracts-bedrock/test/invariants/symbolic/OptimismSuperchainERC20.t.sol b/packages/contracts-bedrock/test/invariants/symbolic/OptimismSuperchainERC20.t.sol index 6e62b3305d49..a632e2afc05f 100644 --- a/packages/contracts-bedrock/test/invariants/symbolic/OptimismSuperchainERC20.t.sol +++ b/packages/contracts-bedrock/test/invariants/symbolic/OptimismSuperchainERC20.t.sol @@ -107,6 +107,7 @@ contract OptimismSuperchainERC20_SymTest is HalmosTest { public { vm.assume(_to != address(0)); + MESSENGER.forTest_setCurrentXDomSender(address(optimismSuperchainERC20)); vm.prank(_sender); try optimismSuperchainERC20.relayERC20(_from, _to, _amount) { @@ -124,10 +125,10 @@ contract OptimismSuperchainERC20_SymTest is HalmosTest { /// @custom:property `sendERC20` with a value of zero does not modify accounting function check_sendERC20ZeroCall(address _to, uint256 _chainId) public { /* Precondition */ - // The current chain id is 1 vm.assume(_to != address(0)); vm.assume(_chainId != CURRENT_CHAIN_ID); vm.assume(_to != address(Predeploys.CROSS_L2_INBOX) && _to != address(MESSENGER)); + MESSENGER.forTest_setCurrentXDomSender(address(optimismSuperchainERC20)); uint256 _totalSupplyBef = optimismSuperchainERC20.totalSupply();