Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lufaque committed Nov 11, 2024
1 parent 37d66c9 commit a01114c
Show file tree
Hide file tree
Showing 11 changed files with 3,180 additions and 276 deletions.
12 changes: 6 additions & 6 deletions packages/foundry/test/Bridge/StartBridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

pragma solidity 0.8.20;

import {BaseTest, console, Vm} from "../BaseTest.t.sol";
import {BaseTest, console, Vm} from "../utils/BaseTest.t.sol";
import {ConceroBridge} from "contracts/ConceroBridge.sol";
import {IInfraStorage} from "contracts/Interfaces/IInfraStorage.sol";
import {TransparentUpgradeableProxy, ITransparentUpgradeableProxy} from "contracts/transparentProxy/TransparentUpgradeableProxy.sol";
import {TransparentUpgradeableProxy, ITransparentUpgradeableProxy} from "contracts/Proxy/TransparentUpgradeableProxy.sol";
import {IDexSwap} from "contracts/Interfaces/IDexSwap.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Client} from "@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Client.sol";
import {Internal} from "@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Internal.sol";
import {OrchestratorWrapper} from "./wrappers/OrchestratorWrapper.sol";
import {InfraOrchestratorWrapper} from "./wrappers/InfraOrchestratorWrapper.sol";

contract StartBridgeTest is BaseTest {
/*//////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -48,7 +48,7 @@ contract StartBridgeTest is BaseTest {
deployPoolsInfra();

vm.prank(deployer);
baseOrchestratorImplementation = new OrchestratorWrapper(
baseOrchestratorImplementation = new InfraOrchestratorWrapper(
vm.envAddress("CLF_ROUTER_BASE"),
vm.envAddress("CONCERO_DEX_SWAP_BASE"),
address(baseBridgeImplementation),
Expand All @@ -68,7 +68,7 @@ contract StartBridgeTest is BaseTest {
_setDstSelectorAndPool(avalancheChainSelector, avalancheChildProxy);
_setDstSelectorAndBridge(avalancheChainSelector, avalancheOrchestratorProxy);

deal(link, address(baseOrchestratorProxy), CCIP_FEES);
deal(link, address(baseOrchestratorProxy), LINK_INIT_BALANCE);

users.push(user1);
users.push(user2);
Expand Down Expand Up @@ -162,7 +162,7 @@ contract StartBridgeTest is BaseTest {
address(baseBridgeImplementation)
)
);
baseBridgeImplementation.startBridge(bridgeData, dstSwapData);
baseBridgeImplementation.bridge(bridgeData, dstSwapData);
}

function _startBridge(address _caller, uint256 _amount, uint64 _dstChainSelector) internal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

pragma solidity 0.8.20;

import {Orchestrator} from "contracts/Orchestrator.sol";
import {InfraOrchestrator} from "contracts/InfraOrchestrator.sol";

contract OrchestratorWrapper is Orchestrator {
contract InfraOrchestratorWrapper is InfraOrchestrator {
/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
Expand All @@ -16,7 +16,17 @@ contract OrchestratorWrapper is Orchestrator {
address _proxy,
uint8 _chainIndex,
address[3] memory _messengers
) Orchestrator(_functionsRouter, _dexSwap, _concero, _pool, _proxy, _chainIndex, _messengers) {}
)
InfraOrchestrator(
_functionsRouter,
_dexSwap,
_concero,
_pool,
_proxy,
_chainIndex,
_messengers
)
{}

/*//////////////////////////////////////////////////////////////
SETTER
Expand Down Expand Up @@ -53,7 +63,7 @@ contract OrchestratorWrapper is Orchestrator {
function getFunctionsFeeInUsdcDelegateCall(
uint64 _dstChainSelector
) external returns (uint256) {
(bool success, bytes memory returnData) = i_concero.delegatecall(
(bool success, bytes memory returnData) = i_conceroBridge.delegatecall(
abi.encodeWithSelector(
bytes4(keccak256("getFunctionsFeeInUsdc(uint64)")),
_dstChainSelector
Expand All @@ -65,7 +75,7 @@ contract OrchestratorWrapper is Orchestrator {
}

function getCcipFeeInUsdcDelegateCall(uint64 _dstChainSelector) external returns (uint256) {
(bool success, bytes memory returnData) = i_concero.delegatecall(
(bool success, bytes memory returnData) = i_conceroBridge.delegatecall(
abi.encodeWithSignature("getCCIPFeeInUsdc(uint64)", _dstChainSelector)
);
require(success, "getCCIPFeeInUsdc delegate call failed");
Expand All @@ -77,7 +87,7 @@ contract OrchestratorWrapper is Orchestrator {
uint64 _dstChainSelector,
uint256 _amount
) external returns (uint256) {
(bool success, bytes memory returnData) = i_concero.delegatecall(
(bool success, bytes memory returnData) = i_conceroBridge.delegatecall(
abi.encodeWithSelector(
bytes4(keccak256("getSrcTotalFeeInUSDC(uint64,uint256)")),
_dstChainSelector,
Expand Down
Loading

0 comments on commit a01114c

Please sign in to comment.