This repository was archived by the owner on May 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 344
/
Copy pathpayload.proto
201 lines (170 loc) · 6.44 KB
/
payload.proto
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
syntax = 'proto3';
option go_package = "github.com/hyperledger/burrow/txs/payload";
import "gogoproto/gogo.proto";
import "permission.proto";
import "registry.proto";
import "spec.proto";
package payload;
option (gogoproto.stable_marshaler_all) = true;
// Enable custom Marshal method.
option (gogoproto.marshaler_all) = true;
// Enable custom Unmarshal method.
option (gogoproto.unmarshaler_all) = true;
// Enable custom Size method (Required by Marshal and Unmarshal).
option (gogoproto.sizer_all) = true;
// Enable registration with golang/protobuf for the grpc-gateway.
option (gogoproto.goproto_registration) = true;
// Enable generation of XXX_MessageName methods for grpc-go/status.
option (gogoproto.messagename_all) = true;
// Any encodes a sum type for which only one should be set
message Any {
option (gogoproto.onlyone) = true;
CallTx CallTx = 1;
SendTx SendTx = 2;
NameTx NameTx = 3;
PermsTx PermsTx = 4;
GovTx GovTx = 5;
BondTx BondTx = 6;
UnbondTx UnbondTx = 7;
BatchTx BatchTx = 8;
ProposalTx ProposalTx = 9;
IdentifyTx IdentifyTx = 10;
}
// An input to a transaction that may carry an Amount as a charge and whose sequence number must be one greater than
// that associated with the account at Address at the time of being received
message TxInput {
option (gogoproto.goproto_stringer) = false;
// The address from which this input flows
bytes Address = 1 [(gogoproto.customtype) = "github.com/hyperledger/burrow/crypto.Address", (gogoproto.nullable) = false];
// The amount of native token to transfer from the input address
uint64 Amount = 2;
// The sequence number that this transaction will induce (i.e. one greater than the input account's current sequence)
uint64 Sequence = 3;
}
// An output from a transaction that may carry an amount as a charge
message TxOutput {
option (gogoproto.goproto_stringer) = false;
// The address to which this output flows
bytes Address = 1 [(gogoproto.customtype) = "github.com/hyperledger/burrow/crypto.Address", (gogoproto.nullable) = false];
// The amount of native token to transfer to the output address
uint64 Amount = 2;
}
// A instruction to run smart contract code in the EVM
message CallTx {
option (gogoproto.goproto_stringer) = false;
// The caller's input
TxInput Input = 1;
// The contract address to call or nil if we are creating a contract
bytes Address = 2 [(gogoproto.customtype) = "github.com/hyperledger/burrow/crypto.Address"];
// The upper bound on the amount of gas (and therefore EVM execution steps) this CallTx may generate
uint64 GasLimit = 3;
// Fee to offer validators for processing transaction
uint64 Fee = 4;
// EVM bytecode
bytes Data = 5 [(gogoproto.customtype) = "github.com/hyperledger/burrow/binary.HexBytes", (gogoproto.nullable) = false];
// WASM bytecode
bytes WASM = 6 [(gogoproto.customtype) = "github.com/hyperledger/burrow/binary.HexBytes", (gogoproto.nullable) = false, (gogoproto.jsontag)="tags,omitempty"];
// Set of contracts this code will deploy
repeated ContractMeta ContractMeta = 7;
// The upper bound on the price per unit of gas
uint64 GasPrice = 8;
}
message ContractMeta {
bytes CodeHash = 1 [(gogoproto.customtype) = "github.com/hyperledger/burrow/binary.HexBytes", (gogoproto.nullable) = false];
string Meta = 2;
}
// A payment between two sets of parties
message SendTx {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
// The payers
repeated TxInput Inputs = 1;
// The payees
repeated TxOutput Outputs = 2;
}
// An update to the on-chain permissions
message PermsTx {
option (gogoproto.goproto_stringer) = false;
// The permission moderator
TxInput Input = 1;
// The modified permissions
permission.PermArgs PermArgs = 2 [(gogoproto.nullable) = false];
}
// A request to claim a globally unique name across the entire chain with some optional data storage leased for a fee
message NameTx {
option (gogoproto.goproto_stringer) = false;
// The name updater
TxInput Input = 1;
// The name to update or create
string Name = 2;
// The data to store against the name
string Data = 3;
// The fee to provide that will determine the length of the name lease
uint64 Fee = 4;
}
message BondTx {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
// Input must be the validator that desires to bond
TxInput Input = 1;
}
message UnbondTx {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
TxInput Input = 1;
// Account to unbond
TxOutput Output = 2;
}
message GovTx {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
repeated TxInput Inputs = 1;
repeated spec.TemplateAccount AccountUpdates = 2 [(gogoproto.nullable) = true];
}
message ProposalTx {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
TxInput Input = 1;
int64 VotingWeight = 2;
bytes ProposalHash = 3 [(gogoproto.customtype) = "github.com/hyperledger/burrow/binary.HexBytes"];
Proposal Proposal = 4;
}
message IdentifyTx {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
// Senders
repeated TxInput Inputs = 1;
// Node to register
registry.NodeIdentity Node = 2;
}
message BatchTx {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
repeated TxInput Inputs = 1;
repeated Any Txs = 2;
}
message Vote {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
bytes Address = 1 [(gogoproto.customtype) = "github.com/hyperledger/burrow/crypto.Address", (gogoproto.nullable) = false];
int64 VotingWeight = 2;
}
message Proposal {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
string Name = 1;
string Description = 2;
BatchTx BatchTx = 3;
}
message Ballot {
Proposal Proposal = 1;
bytes FinalizingTx = 2 [(gogoproto.customtype) = "github.com/hyperledger/burrow/binary.HexBytes"];
enum ProposalState {
// PROPOSED might be expired, if sequence number of any of the input accounts are out of date
PROPOSED = 0;
EXECUTED = 1;
FAILED = 2;
}
ProposalState proposalState = 4;
repeated Vote Votes = 5;
}