Skip to content

Commit

Permalink
Fix tests on upgradeable contracts after transpilation
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Apr 1, 2022
1 parent 049701e commit 0762479
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions contracts/mocks/crosschain/bridges.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ contract BridgeAMBMock is BaseRelayMock {
* Arbitrum
*/
contract BridgeArbitrumL1Mock is BaseRelayMock {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address public immutable inbox = address(new BridgeArbitrumL1Inbox());
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address public immutable outbox = address(new BridgeArbitrumL1Outbox());

function activeOutbox() public view returns (address) {
Expand All @@ -54,10 +56,12 @@ contract BridgeArbitrumL1Mock is BaseRelayMock {
}

contract BridgeArbitrumL1Inbox {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address public immutable bridge = msg.sender;
}

contract BridgeArbitrumL1Outbox {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address public immutable bridge = msg.sender;

function l2ToL1Sender() public view returns (address) {
Expand Down
8 changes: 6 additions & 2 deletions contracts/mocks/crosschain/receivers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ import "../../crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol";
import "../../crosschain/optimism/CrossChainEnabledOptimism.sol";
import "../../crosschain/polygon/CrossChainEnabledPolygonChild.sol";

abstract contract Receiver is Ownable, CrossChainEnabled {
abstract contract Receiver is CrossChainEnabled {
// we don't use Ownable because it messes up testing for the upgradeable contracts
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address public immutable owner = msg.sender;

function crossChainRestricted() external onlyCrossChain {}

function crossChainOwnerRestricted() external onlyCrossChainSender(owner()) {}
function crossChainOwnerRestricted() external onlyCrossChainSender(owner) {}
}

/**
Expand Down

0 comments on commit 0762479

Please sign in to comment.