-
Notifications
You must be signed in to change notification settings - Fork 21
/
signedblock.h
68 lines (57 loc) · 1.37 KB
/
signedblock.h
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
enum DigestItemKey {
Other, // 0
AuthoritiesChange, // 1
ChangesTrieRoot, // 2
SealV0, // 3
Consensus, // 4
Seal, // 5
PreRuntime // 6
};
struct MortalEra {
unsigned long period;
unsigned long phase;
};
// struct BlockExtrinsicEra{
// char immortalEra[STRING_SIZE];
// MortalEra mortalEra;
// };
// struct BlockExtrinsicSignature{
// unsigned short int version;
// char signer[STRING_SIZE]; // Address
// char signature[STRING_SIZE];
// int nonce;
// BlockExtrinsicEra era;
// };
// struct BlockExtrinsicMethod{
// unsigned short int callIndex;
// unsigned short int args[STRING_SIZE];
// };
// struct BlockExtrinsic{
// BlockExtrinsicMethod method;
// BlockExtrinsicSignature signature;
// };
struct DigestItem {
DigestItemKey key;
char value[STRING_SIZE];
};
struct BlockHeader {
char parentHash[STRING_SIZE];
unsigned long long number;
char stateRoot[STRING_SIZE];
char extrinsicsRoot[STRING_SIZE];
DigestItem digest[COLLECTION_SIZE];
};
struct Block {
BlockHeader header;
char extrinsic[COLLECTION_SIZE][STRING_SIZE];
};
struct SignedBlock {
Block block;
char justification[STRING_SIZE];
};
struct GetBlockParams {
char blockHash[STRING_SIZE];
};
struct FinalHead {
char blockHash[STRING_SIZE];
};