-
Notifications
You must be signed in to change notification settings - Fork 1
/
operation-manage-contract-request.x
105 lines (87 loc) · 1.92 KB
/
operation-manage-contract-request.x
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
%#include "xdr/ledger-entries.h"
namespace stellar
{
/* Creates or deletes an contract
Threshold: med
Result: ManageContractRequestResult
*/
enum ManageContractRequestAction
{
CREATE = 0,
REMOVE = 1
};
struct CreateContractRequest
{
ContractRequest contractRequest;
uint32* allTasks;
// reserved for future use
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
};
struct ManageContractRequestOp
{
union switch (ManageContractRequestAction action){
case CREATE:
CreateContractRequest createContractRequest;
case REMOVE:
uint64 requestID;
} details;
// reserved for future use
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
};
/******* ManageContractRequest Result ********/
enum ManageContractRequestResultCode
{
// codes considered as "success" for the operation
SUCCESS = 0,
// codes considered as "failure" for the operation
MALFORMED = -1,
NOT_FOUND = -2, // not found contract request, when try to remove
TOO_MANY_CONTRACTS = -3,
NOT_ALLOWED_TO_REMOVE = -4, // only contract creator can remove contract
DETAILS_TOO_LONG = -5,
CONTRACT_CREATE_TASKS_NOT_FOUND = -6 // key-value not set
};
struct CreateContractRequestResponse
{
uint64 requestID;
bool fulfilled;
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
};
union ManageContractRequestResult switch (ManageContractRequestResultCode code)
{
case SUCCESS:
struct
{
union switch (ManageContractRequestAction action)
{
case CREATE:
CreateContractRequestResponse response;
case REMOVE:
void;
} details;
// reserved for future use
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
} ext;
} success;
default:
void;
};
}