Skip to content

Commit

Permalink
large refactor to split out domains and bridges and move into library…
Browse files Browse the repository at this point in the history
… structure
  • Loading branch information
hexonaut committed May 24, 2024
1 parent 2ece5a4 commit 1d966d5
Show file tree
Hide file tree
Showing 16 changed files with 303 additions and 619 deletions.
4 changes: 2 additions & 2 deletions src/testing/bridges/BridgeData.sol → src/testing/Bridge.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity >=0.8.0;

import { Domain } from "src/testing/Domain.sol";
import { Domain } from "./Domain.sol";

struct BridgeData {
struct Bridge {
Domain source;
Domain destination;
address sourceCrossChainMessenger;
Expand Down
16 changes: 0 additions & 16 deletions src/testing/BridgedDomain.sol

This file was deleted.

106 changes: 0 additions & 106 deletions src/testing/CircleCCTPDomain.sol

This file was deleted.

8 changes: 4 additions & 4 deletions src/testing/Domain.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ library DomainHelpers {
function createFork(StdChains.Chain memory chain, uint256 blockNumber) internal returns (Domain memory domain) {
domain = Domain({
chain: chain,
forkId: vm.createFork(chain.rpcUrl, blockNum)
forkId: vm.createFork(chain.rpcUrl, blockNumber)
});
}

Expand All @@ -30,7 +30,7 @@ library DomainHelpers {
function createSelectFork(StdChains.Chain memory chain, uint256 blockNumber) internal returns (Domain memory domain) {
domain = Domain({
chain: chain,
forkId: vm.createSelectFork(chain.rpcUrl, blockNum)
forkId: vm.createSelectFork(chain.rpcUrl, blockNumber)
});
_assertExpectedRpc(chain);
}
Expand All @@ -45,14 +45,14 @@ library DomainHelpers {

function selectFork(Domain memory domain) internal {
vm.selectFork(domain.forkId);
_assertExpectedRpc(domain);
_assertExpectedRpc(domain.chain);
}

function rollFork(Domain memory domain, uint256 blockNumber) internal {
vm.rollFork(domain.forkId, blockNumber);
}

function _assertExpectedRpc(StdChains.Chain memory chain) private {
function _assertExpectedRpc(StdChains.Chain memory chain) private view {
require(block.chainid == chain.chainId, string(abi.encodePacked(chain.chainAlias, " is pointing to the wrong RPC endpoint '", chain.rpcUrl, "'")));
}

Expand Down
118 changes: 0 additions & 118 deletions src/testing/GnosisDomain.sol

This file was deleted.

Loading

0 comments on commit 1d966d5

Please sign in to comment.