-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathledger-entries-key-value.x
47 lines (37 loc) · 1.08 KB
/
ledger-entries-key-value.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
%#include "xdr/types.h"
namespace stellar
{
//: `KeyValueEntryType` defines the type of value in the key-value entry
enum KeyValueEntryType
{
UINT32 = 1,
STRING = 2,
UINT64 = 3
};
//: `KeyValueEntryValue` represents the value based on given `KeyValueEntryType`
union KeyValueEntryValue switch (KeyValueEntryType type)
{
case UINT32:
uint32 ui32Value;
case STRING:
string stringValue<>;
case UINT64:
uint64 ui64Value;
};
//: `KeyValueEntry` is an entry used to store key mapped values
struct KeyValueEntry
{
//: String value that must be unique among other keys for kev-value pairs
longstring key;
//: Value that corresponds to particular key (depending on `KeyValueEntryType`,
//: the value can be either uint32, or uint64, or string)
KeyValueEntryValue value;
//: reserved for future use
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
};
}