Skip to content

Commit

Permalink
type ccip
Browse files Browse the repository at this point in the history
  • Loading branch information
aroralanuk committed Nov 19, 2024
1 parent 5ea467a commit 2ac6204
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 2 additions & 9 deletions src/ExampleIsm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@ pragma solidity >=0.8.0;
import { IInterchainSecurityModule } from "@hyperlane-xyz/contracts/interfaces/IInterchainSecurityModule.sol";

contract ExampleIsm is IInterchainSecurityModule {
// @dev The first 128 enum values are reserved for core Hyperlane types
uint8 public constant COMMUNITY_MASK = 0x80;

// TODO: Replace with actual community types you want to use
enum CommunityTypes {
EXAMPLE_ISM
}

// @inheritdoc IInterchainSecurityModule
uint8 public moduleType = uint8(CommunityTypes.EXAMPLE_ISM) | COMMUNITY_MASK;
// @dev CCIP_READ is the type for CCIP read messages
uint8 public moduleType = uint8(IInterchainSecurityModule.Types.CCIP_READ);

// @inheritdoc IInterchainSecurityModule
function verify(bytes calldata, bytes calldata) public view returns (bool) {
Expand Down
5 changes: 3 additions & 2 deletions test/ExampleIsm.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
pragma solidity ^0.8.13;

import { Test } from "forge-std/Test.sol";
import { IInterchainSecurityModule } from "@hyperlane-xyz/contracts/interfaces/IInterchainSecurityModule.sol";

import { ExampleIsm } from "../src/ExampleIsm.sol";

contract ExampleIsmTest is Test {
ExampleIsm public exampleIsm;
uint8 public constant EXAMPLE_ISM_TYPE = 128;

function setUp() public {
exampleIsm = new ExampleIsm();
}

function test_moduleType() public view {
assertEq(exampleIsm.moduleType(), EXAMPLE_ISM_TYPE);
assertEq(exampleIsm.moduleType(), uint8(IInterchainSecurityModule.Types.CCIP_READ));
}

// TODO: Implement the test for the verify function
Expand Down

0 comments on commit 2ac6204

Please sign in to comment.