Skip to content

Commit

Permalink
fix CCIPHome split
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsuryansh committed Nov 10, 2024
1 parent e131829 commit df539f8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
8 changes: 4 additions & 4 deletions contracts/gas-snapshots/ccip.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_InnerCallRever
CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_InvalidSelector_reverts() (gas: 11015)
CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_reverts() (gas: 37072)
CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_success() (gas: 1455716)
CCIPHome_constructor:test_constructor_CapabilitiesRegistryAddressZero_reverts() (gas: 63789)
CCIPHome_constructor:test_constructor_success() (gas: 3455842)
CCIPHome_constructor:test_getCapabilityConfiguration_success() (gas: 9150)
CCIPHome_constructor:test_supportsInterface_success() (gas: 9907)
CCIPHome_constructor:test_constructor_CapabilitiesRegistryAddressZero_reverts() (gas: 63767)
CCIPHome_constructor:test_constructor_success() (gas: 3455841)
CCIPHome_getAllConfigs:test_getAllConfigs_success() (gas: 2773000)
CCIPHome_getCapabilityConfiguration:test_getCapabilityConfiguration_success() (gas: 9138)
CCIPHome_getConfigDigests:test_getConfigDigests_success() (gas: 2547397)
CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_CanOnlySelfCall_reverts() (gas: 9087)
CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_ConfigDigestMismatch_reverts() (gas: 23005)
Expand All @@ -66,6 +65,7 @@ CCIPHome_revokeCandidate:test_revokeCandidate_success() (gas: 30674)
CCIPHome_setCandidate:test_setCandidate_CanOnlySelfCall_reverts() (gas: 29383)
CCIPHome_setCandidate:test_setCandidate_ConfigDigestMismatch_reverts() (gas: 1395154)
CCIPHome_setCandidate:test_setCandidate_success() (gas: 1365439)
CCIPHome_supportsInterface:test_supportsInterface_success() (gas: 9885)
DefensiveExampleTest:test_HappyPath_Success() (gas: 200473)
DefensiveExampleTest:test_Recovery() (gas: 424876)
E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1519829)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.24;

import {ICapabilityConfiguration} from "../../../../keystone/interfaces/ICapabilityConfiguration.sol";

import {IERC165} from "../../../../vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC165.sol";
import {CCIPHome} from "../../../capability/CCIPHome.sol";
import {CCIPHomeTestSetup} from "./CCIPHomeTestSetup.t.sol";

Expand All @@ -14,16 +11,6 @@ contract CCIPHome_constructor is CCIPHomeTestSetup {
assertEq(address(ccipHome.getCapabilityRegistry()), CAPABILITIES_REGISTRY);
}

function test_supportsInterface_success() public view {
assertTrue(s_ccipHome.supportsInterface(type(IERC165).interfaceId));
assertTrue(s_ccipHome.supportsInterface(type(ICapabilityConfiguration).interfaceId));
}

function test_getCapabilityConfiguration_success() public view {
bytes memory config = s_ccipHome.getCapabilityConfiguration(DEFAULT_DON_ID);
assertEq(config.length, 0);
}

function test_constructor_CapabilitiesRegistryAddressZero_reverts() public {
vm.expectRevert(CCIPHome.ZeroAddressNotAllowed.selector);
new CCIPHome(address(0));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.24;

import {CCIPHomeTestSetup} from "./CCIPHomeTestSetup.t.sol";

contract CCIPHome_getCapabilityConfiguration is CCIPHomeTestSetup {
function test_getCapabilityConfiguration_success() public view {
bytes memory config = s_ccipHome.getCapabilityConfiguration(DEFAULT_DON_ID);
assertEq(config.length, 0);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.24;

import {ICapabilityConfiguration} from "../../../../keystone/interfaces/ICapabilityConfiguration.sol";

import {IERC165} from "../../../../vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC165.sol";
import {CCIPHomeTestSetup} from "./CCIPHomeTestSetup.t.sol";

contract CCIPHome_supportsInterface is CCIPHomeTestSetup {
function test_supportsInterface_success() public view {
assertTrue(s_ccipHome.supportsInterface(type(IERC165).interfaceId));
assertTrue(s_ccipHome.supportsInterface(type(ICapabilityConfiguration).interfaceId));
}
}

0 comments on commit df539f8

Please sign in to comment.