The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hyperlane-monorepo/solidity/contracts/mock/MockHyperlaneEnvironment.sol

49 lines
1.6 KiB

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;
2 years ago
import "./MockMailbox.sol";
import "../test/TestInterchainGasPaymaster.sol";
import "../test/TestIsm.sol";
import {TypeCasts} from "../libs/TypeCasts.sol";
contract MockHyperlaneEnvironment {
uint32 public originDomain;
uint32 public destinationDomain;
2 years ago
mapping(uint32 => MockMailbox) public mailboxes;
mapping(uint32 => TestInterchainGasPaymaster) public igps;
mapping(uint32 => IInterchainSecurityModule) public isms;
constructor(uint32 _originDomain, uint32 _destinationDomain) {
originDomain = _originDomain;
destinationDomain = _destinationDomain;
2 years ago
MockMailbox originMailbox = new MockMailbox(_originDomain);
MockMailbox destinationMailbox = new MockMailbox(_destinationDomain);
originMailbox.addRemoteMailbox(_destinationDomain, destinationMailbox);
destinationMailbox.addRemoteMailbox(_originDomain, originMailbox);
isms[originDomain] = new TestIsm();
isms[destinationDomain] = new TestIsm();
originMailbox.setDefaultIsm(address(isms[originDomain]));
destinationMailbox.setDefaultIsm(address(isms[destinationDomain]));
originMailbox.transferOwnership(msg.sender);
destinationMailbox.transferOwnership(msg.sender);
mailboxes[_originDomain] = originMailbox;
mailboxes[_destinationDomain] = destinationMailbox;
}
function processNextPendingMessage() public {
2 years ago
mailboxes[destinationDomain].processNextInboundMessage();
}
function processNextPendingMessageFromDestination() public {
2 years ago
mailboxes[originDomain].processNextInboundMessage();
}
}