Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup changes #18

Merged
merged 13 commits into from
May 1, 2024
14 changes: 7 additions & 7 deletions tests/BaseCrossChainController.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {Errors} from '../src/contracts/libs/Errors.sol';
import {IBaseAdapter} from '../src/contracts/adapters/IBaseAdapter.sol';

abstract contract BaseCrossChainControllerTest is Test {
address public constant OWNER = address(123);
address public constant GUARDIAN = address(1234);
address public constant BRIDGE_ADAPTER = address(123456);
address public constant OWNER = address(65536 + 123);
address public constant GUARDIAN = address(65536 + 1234);
address public constant BRIDGE_ADAPTER = address(65536 + 123456);

uint8 public constant CONFIRMATIONS = 1;

Expand Down Expand Up @@ -76,21 +76,21 @@ abstract contract BaseCrossChainControllerTest is Test {

// forwarder configs
address[] memory sendersToApprove = new address[](1);
sendersToApprove[0] = address(102);
sendersToApprove[0] = address(65536 + 102);
ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[]
memory forwarderBridgeAdaptersToEnable = new ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[](
1
);
forwarderBridgeAdaptersToEnable[0] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
currentChainBridgeAdapter: address(103),
destinationBridgeAdapter: address(110),
currentChainBridgeAdapter: address(65536 + 103),
destinationBridgeAdapter: address(65536 + 110),
destinationChainId: ChainIds.POLYGON
});

crossChainControllerImpl = _deployControllerImplementation();

vm.mockCall(
address(103),
address(65536 + 103),
abi.encodeWithSelector(IBaseAdapter.setupPayments.selector),
abi.encode()
);
Expand Down
48 changes: 24 additions & 24 deletions tests/CrossChainController.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ pragma solidity ^0.8.0;
import './BaseCrossChainController.t.sol';
import {CrossChainController, ICrossChainController} from '../src/contracts/CrossChainController.sol';

// contract CrossChainControllerTest is BaseCrossChainControllerTest {
// function _deployControllerImplementation() internal override returns (address) {
// return address(new CrossChainController());
// }
contract CrossChainControllerTest is BaseCrossChainControllerTest {
function _deployControllerImplementation() internal override returns (address) {
return address(new CrossChainController());
}

// function _getEncodedInitializer(
// address owner,
// address guardian,
// ICrossChainReceiver.ConfirmationInput[] memory initialRequiredConfirmations,
// ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory receiverBridgeAdaptersToAllow,
// ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] memory forwarderBridgeAdaptersToEnable,
// address[] memory sendersToApprove
// ) internal pure override returns (bytes memory) {
// return
// abi.encodeWithSelector(
// ICrossChainController.initialize.selector,
// owner,
// guardian,
// initialRequiredConfirmations,
// receiverBridgeAdaptersToAllow,
// forwarderBridgeAdaptersToEnable,
// sendersToApprove
// );
// }
// }
function _getEncodedInitializer(
address owner,
address guardian,
ICrossChainReceiver.ConfirmationInput[] memory initialRequiredConfirmations,
ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory receiverBridgeAdaptersToAllow,
ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] memory forwarderBridgeAdaptersToEnable,
address[] memory sendersToApprove
) internal pure override returns (bytes memory) {
return
abi.encodeWithSelector(
ICrossChainController.initialize.selector,
owner,
guardian,
initialRequiredConfirmations,
receiverBridgeAdaptersToAllow,
forwarderBridgeAdaptersToEnable,
sendersToApprove
);
}
}
Loading