Skip to content

Commit

Permalink
add 165 test
Browse files Browse the repository at this point in the history
  • Loading branch information
RensR committed Sep 20, 2024
1 parent 40a891f commit a69addc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions contracts/gas-snapshots/ccip.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ CCIPHome_chainConfig:test_getCapabilityConfiguration_Success() (gas: 9594)
CCIPHome_chainConfig:test_getPaginatedCCIPHomes_Success() (gas: 370990)
CCIPHome_constructor:test_constructor_Success() (gas: 2988852)
CCIPHome_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 61020)
CCIPHome_supportsInterface:test_getCapabilityConfiguration_Success() (gas: 9485)
CCIPHome_supportsInterface:test_supportsInterface_Success() (gas: 8964)
CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 19611)
CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 19418)
CCIPHome_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9631)
Expand Down
2 changes: 2 additions & 0 deletions contracts/src/v0.8/ccip/capability/CCIPHome.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator,
}

/// @inheritdoc IERC165
/// @dev The CapabilitiesRegistry contract will call this function with the `ICapabilityConfiguration` interface ID.
/// If that call doesn't succeed, no config can be set.
function supportsInterface(bytes4 interfaceId) external pure override returns (bool) {
return interfaceId == type(ICapabilityConfiguration).interfaceId || interfaceId == type(IERC165).interfaceId;
}
Expand Down
12 changes: 11 additions & 1 deletion contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

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

import {CCIPHome} from "../../capability/CCIPHome.sol";
import {Internal} from "../../libraries/Internal.sol";
import {CCIPHomeHelper} from "../helpers/CCIPHomeHelper.sol";
import {Test} from "forge-std/Test.sol";
Expand Down Expand Up @@ -1210,6 +1212,14 @@ contract CCIPHome_updatePluginConfig is CCIPHomeSetup {
}
}

contract CCIPHome_supportsInterface is CCIPHomeSetup {
function test_supportsInterface_Success() public {
assertTrue(
s_ccipCC.supportsInterface(type(ICapabilityConfiguration).interfaceId), "supportsInterface must return true"
);
}
}

contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeSetup {
function test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() public {
changePrank(CAPABILITIES_REGISTRY);
Expand Down

0 comments on commit a69addc

Please sign in to comment.