-
Notifications
You must be signed in to change notification settings - Fork 6
/
IMultiSession.sol
57 lines (45 loc) · 1.68 KB
/
IMultiSession.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
pragma solidity ^0.5.0;
interface IMultiSession {
enum SessionStatus {IDLE, SETTLE, ACTION, FINALIZED}
event IntendSettle(bytes32 indexed session, uint seq);
/**
* @notice Submit off-chain state and start to dispute
*/
function intendSettle(bytes calldata _stateProof) external;
/**
* @notice Get app session state settle finalized time
* @param _session App session ID
*/
function getSettleFinalizedTime(bytes32 _session) external view returns (uint);
/**
* @notice Apply an action to the on-chain state
*/
function applyAction(bytes32 _session, bytes calldata _action) external;
/**
* @notice Finalize the session in case of on-chain action timeout
*/
function finalizeOnActionTimeout(bytes32 _session) external;
/**
* @notice Get app session action deadline
*/
function getActionDeadline(bytes32 _session) external view returns (uint);
/**
* @notice Get app session status
*/
function getStatus(bytes32 _session) external view returns (SessionStatus);
/**
* @notice Get app session sequence number
*/
function getSeqNum(bytes32 _session) external view returns (uint);
/**
* @notice Get app session state associated with the given key
*/
function getState(bytes32 _session, uint _key) external view returns (bytes memory);
/**
* @notice Compute session ID
* @param _nonce app session nonce
* @param _signers signers required for the offchain state to be valid
* @return Session ID that encodes nonce and singers
*/
function getSessionID(uint _nonce, address[] calldata _signers) external pure returns (bytes32);
}