Skip to content

Commit 2ac6204

Browse files
committed
type ccip
1 parent 5ea467a commit 2ac6204

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/ExampleIsm.sol

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,9 @@ pragma solidity >=0.8.0;
44
import { IInterchainSecurityModule } from "@hyperlane-xyz/contracts/interfaces/IInterchainSecurityModule.sol";
55

66
contract ExampleIsm is IInterchainSecurityModule {
7-
// @dev The first 128 enum values are reserved for core Hyperlane types
8-
uint8 public constant COMMUNITY_MASK = 0x80;
9-
10-
// TODO: Replace with actual community types you want to use
11-
enum CommunityTypes {
12-
EXAMPLE_ISM
13-
}
14-
157
// @inheritdoc IInterchainSecurityModule
16-
uint8 public moduleType = uint8(CommunityTypes.EXAMPLE_ISM) | COMMUNITY_MASK;
8+
// @dev CCIP_READ is the type for CCIP read messages
9+
uint8 public moduleType = uint8(IInterchainSecurityModule.Types.CCIP_READ);
1710

1811
// @inheritdoc IInterchainSecurityModule
1912
function verify(bytes calldata, bytes calldata) public view returns (bool) {

test/ExampleIsm.t.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
pragma solidity ^0.8.13;
33

44
import { Test } from "forge-std/Test.sol";
5+
import { IInterchainSecurityModule } from "@hyperlane-xyz/contracts/interfaces/IInterchainSecurityModule.sol";
6+
57
import { ExampleIsm } from "../src/ExampleIsm.sol";
68

79
contract ExampleIsmTest is Test {
810
ExampleIsm public exampleIsm;
9-
uint8 public constant EXAMPLE_ISM_TYPE = 128;
1011

1112
function setUp() public {
1213
exampleIsm = new ExampleIsm();
1314
}
1415

1516
function test_moduleType() public view {
16-
assertEq(exampleIsm.moduleType(), EXAMPLE_ISM_TYPE);
17+
assertEq(exampleIsm.moduleType(), uint8(IInterchainSecurityModule.Types.CCIP_READ));
1718
}
1819

1920
// TODO: Implement the test for the verify function

0 commit comments

Comments
 (0)