-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage.proto
More file actions
161 lines (145 loc) · 3.11 KB
/
message.proto
File metadata and controls
161 lines (145 loc) · 3.11 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
syntax = "proto3";
option java_multiple_files = true;
option java_package = "io.grpc.conflux";
option java_outer_classname = "MessageProto";
import "primitive.proto";
message Account {
U256 balance = 1;
U256 nonce = 2;
H256 code_hash = 3;
RpcAddress admin = 4;
}
message EpochNumber {
enum Kind {
Num = 0;
LatestState = 1;
Earliest = 2;
LatestCheckpoint = 3;
LatestCandidate = 4;
}
Kind kind = 1;
uint64 number = 2;
}
message Block {
H256 hash = 1;
H256 parent_hash = 2;
U256 height = 3;
RpcAddress miner = 4;
H256 deferred_state_root = 5;
H256 deferred_receipts_root = 6;
H256 deferred_logs_bloom_hash = 7;
H256 transactions_root = 8;
U256 epoch_number = 9;
U256 gas_limit = 10;
U256 timestamp = 11;
repeated H256 referee_hashes = 12;
U256 nonce = 13;
BlockTransactions transactions = 14;
U256 size = 15;
}
message Status {
H256 best_hash = 1;
H256 best_candidate_hash = 2;
U64 epoch_number = 3;
U64 block_number = 4;
U64 pending_tx_number = 5;
}
// `oneof` cannot contain `repeated` variants.
message BlockTransactions {
enum Kind {
Hashes = 0;
Full = 1;
}
Kind kind = 1;
repeated H256 hashes = 2;
repeated Transaction transactions = 3;
}
message BlockHashOrEpochNumber {
oneof kind {
H256 block_hash = 1;
EpochNumber epoch_number = 2;
}
}
message CallRequest {
RpcAddress from = 1;
RpcAddress to = 2;
U256 gas_price = 3;
U256 gas = 4;
U256 value = 5;
Bytes data = 6;
U256 nonce = 7;
}
message Filter {
// Repeated fields cannot be optional, so we use wrappers.
message BlockHashes {
repeated H256 block_hashes = 1;
}
message Address {
repeated RpcAddress address = 1;
}
message TopicOr {
repeated H256 topics = 1;
}
message Topic {
// Each topic can have a optional OR-logic filter.
TopicOr or_filter = 1;
}
EpochNumber from_epoch = 1;
EpochNumber to_epoch = 2;
BlockHashes block_hashes = 3;
Address address = 4;
// Up to 4 topics. Filter in AND-logic.
repeated Topic topics = 5;
U64 limit = 6;
}
message Log {
RpcAddress address = 1;
repeated H256 topics = 2;
Bytes data = 3;
H256 block_hash = 4;
U256 epoch_number = 5;
H256 transaction_hash = 6;
U256 transaction_index = 7;
U256 log_index = 8;
U256 transaction_log_index = 9;
}
message Transaction {
H256 hash = 1;
U256 nonce = 2;
H256 block_hash = 3;
U256 transaction_index = 4;
RpcAddress from = 5;
RpcAddress to = 6;
U256 value = 7;
U256 gas_price = 8;
U256 gas = 9;
RpcAddress contract_created = 10;
Bytes data = 11;
U256 epoch_height = 12;
U256 chain_id = 13;
U256 status = 14;
U256 v = 15;
U256 r = 16;
U256 s = 17;
}
message EstimateGasResponse {
U256 gas_used = 1;
}
message Receipt {
message EpochNumber {
uint64 epoch_number = 1;
}
H256 transaction_hash = 1;
uint64 index = 2;
H256 block_hash = 3;
// uint64 cannot be optional.
EpochNumber epoch_number = 4;
RpcAddress from = 5;
RpcAddress to = 6;
U256 gas_used = 7;
RpcAddress contract_created = 8;
repeated Log logs = 9;
bytes logs_bloom = 10;
H256 state_root = 11;
uint32 outcome_status = 12;
}