-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIHandler.sol
62 lines (54 loc) · 2.38 KB
/
IHandler.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.17;
import {IIsmpHost} from "./IIsmpHost.sol";
import {PostRequestMessage, PostResponseMessage, GetResponseMessage, PostRequestTimeoutMessage, PostResponseTimeoutMessage, GetTimeoutMessage} from "./Message.sol";
/*
* @title The Ismp Handler
* @author Polytope Labs ([email protected])
*
* @notice The IHandler interface serves as the entry point for ISMP datagrams, i.e consensus, requests & response messages.
*/
interface IHandler {
/**
* @dev Handle an incoming consensus message. This uses the IConsensusClient contract registered on the host to perform the consensus message verification.
* @param host - Ismp host
* @param proof - consensus proof
*/
function handleConsensus(IIsmpHost host, bytes memory proof) external;
/**
* @dev Handles incoming POST requests, check request proofs, message delay and timeouts, then dispatch POST requests to the apropriate contracts.
* @param host - Ismp host
* @param request - batch post requests
*/
function handlePostRequests(IIsmpHost host, PostRequestMessage memory request) external;
/**
* @dev Handles incoming POST responses, check response proofs, message delay and timeouts, then dispatch POST responses to the apropriate contracts.
* @param host - Ismp host
* @param response - batch post responses
*/
function handlePostResponses(IIsmpHost host, PostResponseMessage memory response) external;
/**
* @dev check response proofs, message delay and timeouts, then dispatch get responses to modules
* @param host - Ismp host
* @param message - batch get responses
*/
function handleGetResponses(IIsmpHost host, GetResponseMessage memory message) external;
/**
* @dev check timeout proofs then dispatch to modules
* @param host - Ismp host
* @param message - batch post request timeouts
*/
function handlePostRequestTimeouts(IIsmpHost host, PostRequestTimeoutMessage memory message) external;
/**
* @dev check timeout proofs then dispatch to modules
* @param host - Ismp host
* @param message - batch post response timeouts
*/
function handlePostResponseTimeouts(IIsmpHost host, PostResponseTimeoutMessage memory message) external;
/**
* @dev dispatch to modules
* @param host - Ismp host
* @param message - batch get request timeouts
*/
function handleGetRequestTimeouts(IIsmpHost host, GetTimeoutMessage memory message) external;
}