-
Notifications
You must be signed in to change notification settings - Fork 1
/
operation-create-change-role-request.x
86 lines (76 loc) · 2.79 KB
/
operation-create-change-role-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
%#include "xdr/types.h"
namespace stellar
{
//: `CreateChangeRoleRequestOp` is used to create reviewable requests
//: that, with admin's approval, will change the role of `destinationAccount`
//: from current role to `accountRoleToSet`
struct CreateChangeRoleRequestOp
{
//: Set zero to create new request, set non zero to update existing request
uint64 requestID;
//: AccountID of an account whose role will be changed
AccountID destinationAccount;
//: ID of account role that will be attached to `destinationAccount`
uint64 accountRoleToSet;
//: Arbitrary stringified json object that can be used to attach data to be reviewed by an admin
longstring creatorDetails;
//: Bit mask that will be used instead of the value from key-value entry by
//: `change_role_tasks:<currentRoleID>:<accountRoleToSet>` key
uint32* allTasks;
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
};
/******* CreateUpdateKYCRequest Result ********/
//: Result codes of CreateChangeRoleRequestOp
enum CreateChangeRoleRequestResultCode
{
//: Change role request has either been successfully created
//: or auto approved
SUCCESS = 0,
// codes considered as "failure" for the operation
//: There is no destination account with such accountID
ACC_TO_UPDATE_DOES_NOT_EXIST = -1,
//: There is another change role request for such destination account
REQUEST_ALREADY_EXISTS = -2,
//: There is no request with such `requestID`
REQUEST_DOES_NOT_EXIST = -4,
//: Only `destinationAccount` can update change role request
//: `destinationAccount` must be equal source Account
NOT_ALLOWED_TO_UPDATE_REQUEST = -6,
//: It is not allowed to change `destinationAccount`, `accountRoleToSet`
//: or set `allTasks` on update change role request
INVALID_CHANGE_ROLE_REQUEST_DATA = -7,
//: `creatorDetails` must be in a valid JSON format
INVALID_CREATOR_DETAILS = -8,
//: There is no key-value entry by `change_role_tasks` key in the system;
//: configuration does not allow changing the role from current to `accountRoleToSet`
CHANGE_ROLE_TASKS_NOT_FOUND = -9,
//: There is no account role with provided id
ACCOUNT_ROLE_TO_SET_DOES_NOT_EXIST = -10
};
//: Result of operation application
union CreateChangeRoleRequestResult switch (CreateChangeRoleRequestResultCode code)
{
case SUCCESS:
struct {
//: ID of a created or updated request
uint64 requestID;
//: True if request was auto approved (pending tasks == 0),
//: `destinationAccount` must have new account role
bool fulfilled;
// Reserved for future use
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
} success;
default:
void;
};
}