Skip to content

Commit

Permalink
Update GasOracleMock references
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Mar 4, 2024
1 parent 1784802 commit 0835a90
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 117 deletions.
103 changes: 0 additions & 103 deletions packages/contracts-communication/script/MessagingBase.s.sol

This file was deleted.

2 changes: 1 addition & 1 deletion packages/contracts-communication/script/testnet-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ yarn fsr script/deploy/DeploySynapseModule.s.sol "$chainName" "$walletName" "$@"
yarn fsr-str script/deploy/DeployWithMsgSender.s.sol "$chainName" "$walletName" "ExecutionFees" "$@"
yarn fsr-str script/deploy/DeployWithMsgSender.s.sol "$chainName" "$walletName" "ExecutionService" "$@"

yarn fsr-str script/deploy/DeployNoArgs.s.sol "$chainName" "$walletName" "GasOracleMock" "$@"
yarn fsr-str script/deploy/DeployNoArgs.s.sol "$chainName" "$walletName" "SynapseGasOracleMock" "$@"
6 changes: 3 additions & 3 deletions packages/contracts-communication/test/ExecutionService.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ pragma solidity 0.8.20;

import {ExecutionService, ExecutionServiceEvents, IExecutionService} from "../contracts/ExecutionService.sol";
import {Test} from "forge-std/Test.sol";
import {GasOracleMock} from "./mocks/GasOracleMock.sol";
import {SynapseGasOracleMock} from "./mocks/SynapseGasOracleMock.sol";

contract ExecutionServiceTest is ExecutionServiceEvents, Test {
ExecutionService public executionService;
GasOracleMock public gasOracle;
SynapseGasOracleMock public gasOracle;

address icClient = address(0x123);
address executorEOA = address(0x456);
address owner = makeAddr("Owner");

function setUp() public {
gasOracle = new GasOracleMock();
gasOracle = new SynapseGasOracleMock();
executionService = new ExecutionService(address(this));
executionService.setInterchainClient(icClient);
executionService.setExecutorEOA(executorEOA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {InterchainEntry} from "../../contracts/libs/InterchainEntry.sol";
import {ThresholdECDSALib} from "../../contracts/libs/ThresholdECDSA.sol";
import {SynapseModule} from "../../contracts/modules/SynapseModule.sol";

import {GasOracleMock} from "../mocks/GasOracleMock.sol";
import {SynapseGasOracleMock} from "../mocks/SynapseGasOracleMock.sol";
import {InterchainDBMock, IInterchainDB} from "../mocks/InterchainDBMock.sol";

import {Test} from "forge-std/Test.sol";
Expand All @@ -17,7 +17,7 @@ import {Test} from "forge-std/Test.sol";
// solhint-disable ordering
contract SynapseModuleDestinationTest is Test, InterchainModuleEvents, SynapseModuleEvents {
SynapseModule public module;
GasOracleMock public gasOracle;
SynapseGasOracleMock public gasOracle;
InterchainDBMock public interchainDB;

address public feeCollector = makeAddr("FeeCollector");
Expand Down Expand Up @@ -50,7 +50,7 @@ contract SynapseModuleDestinationTest is Test, InterchainModuleEvents, SynapseMo
vm.chainId(DST_CHAIN_ID);
interchainDB = new InterchainDBMock();
module = new SynapseModule(address(interchainDB), owner);
gasOracle = new GasOracleMock();
gasOracle = new SynapseGasOracleMock();
vm.startPrank(owner);
module.setGasOracle(address(gasOracle));
module.setFeeCollector(feeCollector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {SynapseModuleEvents} from "../../contracts/events/SynapseModuleEvents.so
import {SynapseModule, ISynapseModule} from "../../contracts/modules/SynapseModule.sol";
import {ThresholdECDSALib} from "../../contracts/libs/ThresholdECDSA.sol";

import {GasOracleMock} from "../mocks/GasOracleMock.sol";
import {SynapseGasOracleMock} from "../mocks/SynapseGasOracleMock.sol";

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

Expand All @@ -15,7 +15,7 @@ import {Test} from "forge-std/Test.sol";
// solhint-disable ordering
contract SynapseModuleManagementTest is Test, SynapseModuleEvents {
SynapseModule public module;
GasOracleMock public gasOracle;
SynapseGasOracleMock public gasOracle;

address public interchainDB = makeAddr("InterchainDB");
address public owner = makeAddr("Owner");
Expand All @@ -29,7 +29,7 @@ contract SynapseModuleManagementTest is Test, SynapseModuleEvents {

function setUp() public {
module = new SynapseModule(interchainDB, owner);
gasOracle = new GasOracleMock();
gasOracle = new SynapseGasOracleMock();
allVerifiers.push(VERIFIER_1);
allVerifiers.push(VERIFIER_2);
allVerifiers.push(VERIFIER_3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import {IInterchainModule} from "../../contracts/interfaces/IInterchainModule.so
import {InterchainEntry} from "../../contracts/libs/InterchainEntry.sol";
import {SynapseModule, ISynapseModule} from "../../contracts/modules/SynapseModule.sol";

import {GasOracleMock} from "../mocks/GasOracleMock.sol";
import {SynapseGasOracleMock} from "../mocks/SynapseGasOracleMock.sol";

import {Test} from "forge-std/Test.sol";

// solhint-disable func-name-mixedcase
// solhint-disable ordering
contract SynapseModuleSourceTest is Test, InterchainModuleEvents, SynapseModuleEvents {
SynapseModule public module;
GasOracleMock public gasOracle;
SynapseGasOracleMock public gasOracle;

address public interchainDB = makeAddr("InterchainDB");
address public feeCollector = makeAddr("FeeCollector");
Expand All @@ -40,7 +40,7 @@ contract SynapseModuleSourceTest is Test, InterchainModuleEvents, SynapseModuleE
function setUp() public {
vm.chainId(SRC_CHAIN_ID);
module = new SynapseModule(interchainDB, owner);
gasOracle = new GasOracleMock();
gasOracle = new SynapseGasOracleMock();
vm.startPrank(owner);
module.setGasOracle(address(gasOracle));
module.setFeeCollector(feeCollector);
Expand All @@ -51,7 +51,7 @@ contract SynapseModuleSourceTest is Test, InterchainModuleEvents, SynapseModuleE
// Mock: gasOracle.estimateTxCostInLocalUnits(DST_CHAIN_ID, *, *) to return FEE
vm.mockCall(
address(gasOracle),
abi.encodeWithSelector(GasOracleMock.estimateTxCostInLocalUnits.selector, DST_CHAIN_ID),
abi.encodeWithSelector(SynapseGasOracleMock.estimateTxCostInLocalUnits.selector, DST_CHAIN_ID),
abi.encode(FEE)
);
}
Expand Down

0 comments on commit 0835a90

Please sign in to comment.