mazzaroth_xdr/
xdr_generated.rs

1#![allow(non_snake_case)]
2#![allow(non_camel_case_types)]
3#[macro_use]
4extern crate xdr_rs_serialize_derive;
5#[allow(unused_imports)]
6use std::io::Write;
7#[allow(unused_imports)]
8use xdr_rs_serialize::de::{
9    read_fixed_array, read_fixed_array_json, read_fixed_opaque, read_fixed_opaque_json,
10    read_var_array, read_var_array_json, read_var_opaque, read_var_opaque_json, read_var_string,
11    read_var_string_json, XDRIn,
12};
13use xdr_rs_serialize::error::Error;
14#[allow(unused_imports)]
15use xdr_rs_serialize::ser::{
16    write_fixed_array, write_fixed_array_json, write_fixed_opaque, write_fixed_opaque_json,
17    write_var_array, write_var_array_json, write_var_opaque, write_var_opaque_json,
18    write_var_string, write_var_string_json, XDROut,
19};
20
21extern crate json;
22
23// Namespace start mazzaroth
24
25// Start typedef section
26
27// End typedef section
28
29// Start struct section
30
31#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
32pub struct Abi {
33    pub version: String,
34    #[array(var = 2147483647)]
35    pub functions: Vec<FunctionSignature>,
36}
37
38#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
39pub struct FunctionSignature {
40    pub functionType: FunctionType,
41    #[array(var = 2147483647)]
42    pub functionName: String,
43    #[array(var = 2147483647)]
44    pub parameters: Vec<Parameter>,
45    #[array(var = 2147483647)]
46    pub returns: Vec<Parameter>,
47}
48
49#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
50pub struct Parameter {
51    #[array(var = 2147483647)]
52    pub parameterName: String,
53    #[array(var = 2147483647)]
54    pub parameterType: String,
55}
56// End struct section
57
58#[derive(PartialEq, Clone, Debug, XDROut, XDRIn)]
59pub enum FunctionType {
60    UNKNOWN = 0,
61    READ = 1,
62    WRITE = 2,
63}
64
65impl Default for FunctionType {
66    fn default() -> Self {
67        FunctionType::UNKNOWN
68    }
69}
70// Start union section
71
72// End union section
73
74// Namespace end mazzaroth
75// Namespace start mazzaroth
76
77// Start typedef section
78
79// End typedef section
80
81// Start struct section
82// End struct section
83
84#[derive(PartialEq, Clone, Debug, XDROut, XDRIn)]
85pub enum RequestType {
86    UNKNOWN = 0,
87    TRANSACTION = 1,
88}
89
90impl Default for RequestType {
91    fn default() -> Self {
92        RequestType::UNKNOWN
93    }
94}
95#[derive(PartialEq, Clone, Debug, XDROut, XDRIn)]
96pub enum ResponseType {
97    UNKNOWN = 0,
98    TRANSACTIONID = 1,
99    TRANSACTION = 2,
100    RECEIPT = 3,
101    BLOCK = 4,
102    BLOCKLIST = 5,
103    BLOCKHEADER = 6,
104    BLOCKHEADERLIST = 7,
105    CONTRACT = 8,
106    HEIGHT = 9,
107    ABI = 10,
108}
109
110impl Default for ResponseType {
111    fn default() -> Self {
112        ResponseType::UNKNOWN
113    }
114}
115// Start union section
116
117#[derive(PartialEq, Clone, Debug, XDROut, XDRIn)]
118pub enum Request {
119    UNKNOWN(()),
120    TRANSACTION(Transaction),
121}
122
123impl Default for Request {
124    fn default() -> Self {
125        Request::UNKNOWN(())
126    }
127}
128#[derive(PartialEq, Clone, Debug, XDROut, XDRIn)]
129pub enum Response {
130    UNKNOWN(()),
131    TRANSACTIONID(ID),
132
133    TRANSACTION(Transaction),
134
135    RECEIPT(Receipt),
136
137    BLOCK(Block),
138
139    #[array(var = 2147483647)]
140    BLOCKLIST(Vec<Block>),
141
142    BLOCKHEADER(BlockHeader),
143
144    #[array(var = 2147483647)]
145    BLOCKHEADERLIST(Vec<BlockHeader>),
146
147    CONTRACT(Contract),
148
149    HEIGHT(BlockHeight),
150
151    ABI(Abi),
152}
153
154impl Default for Response {
155    fn default() -> Self {
156        Response::UNKNOWN(())
157    }
158}
159// End union section
160
161// Namespace end mazzaroth
162// Namespace start mazzaroth
163
164// Start typedef section
165
166// End typedef section
167
168// Start struct section
169
170#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
171pub struct Block {
172    pub header: BlockHeader,
173    #[array(var = 2147483647)]
174    pub transactions: Vec<Transaction>,
175}
176
177#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
178pub struct BlockHeader {
179    pub blockHeight: u64,
180    pub transactionHeight: u64,
181    pub consensusSequenceNumber: u64,
182    pub transactionsMerkleRoot: Hash,
183    pub transactionsReceiptRoot: Hash,
184    pub stateRoot: Hash,
185    pub previousHeader: Hash,
186    pub status: Status,
187}
188
189#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
190pub struct BlockHeight {
191    pub height: u64,
192}
193// End struct section
194
195// Start union section
196
197// End union section
198
199// Namespace end mazzaroth
200// Namespace start mazzaroth
201
202// Start typedef section
203
204#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
205pub struct Signature {
206    #[array(fixed = 64)]
207    pub t: Vec<u8>,
208}
209#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
210pub struct ID {
211    #[array(fixed = 32)]
212    pub t: Vec<u8>,
213}
214#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
215pub struct Hash {
216    #[array(fixed = 32)]
217    pub t: Vec<u8>,
218}
219#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
220pub struct Argument {
221    #[array(var = 2147483647)]
222    pub t: String,
223}
224#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
225pub struct StatusInfo {
226    #[array(var = 256)]
227    pub t: String,
228}
229// End typedef section
230
231// Start struct section
232// End struct section
233
234#[derive(PartialEq, Clone, Debug, XDROut, XDRIn)]
235pub enum Status {
236    UNKNOWN = 0,
237    SUCCESS = 1,
238    FAILURE = 2,
239    PENDING = 3,
240    FINALIZED = 4,
241}
242
243impl Default for Status {
244    fn default() -> Self {
245        Status::UNKNOWN
246    }
247}
248// Start union section
249
250// End union section
251
252// Namespace end mazzaroth
253// Namespace start mazzaroth
254
255// Start typedef section
256
257// End typedef section
258
259// Start struct section
260
261#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
262pub struct Receipt {
263    pub transactionID: ID,
264    pub status: Status,
265    pub stateRoot: Hash,
266    #[array(var = 2147483647)]
267    pub result: String,
268    pub statusInfo: StatusInfo,
269}
270// End struct section
271
272// Start union section
273
274// End union section
275
276// Namespace end mazzaroth
277// Namespace start mazzaroth
278
279// Start typedef section
280
281// End typedef section
282
283// Start struct section
284
285#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
286pub struct Call {
287    #[array(var = 256)]
288    pub function: String,
289    #[array(var = 2147483647)]
290    pub arguments: Vec<Argument>,
291}
292
293#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
294pub struct Contract {
295    #[array(var = 100)]
296    pub version: String,
297    pub owner: ID,
298    pub abi: Abi,
299    pub contractHash: Hash,
300    #[array(var = 2147483647)]
301    pub contractBytes: Vec<u8>,
302}
303
304#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
305pub struct Data {
306    pub channelID: ID,
307    pub nonce: u64,
308    pub blockExpirationNumber: u64,
309    pub category: Category,
310}
311
312#[derive(PartialEq, Clone, Default, Debug, XDROut, XDRIn)]
313pub struct Transaction {
314    pub sender: ID,
315    pub signature: Signature,
316    pub data: Data,
317}
318// End struct section
319
320#[derive(PartialEq, Clone, Debug, XDROut, XDRIn)]
321pub enum CategoryType {
322    UNKNOWN = 0,
323    CALL = 1,
324    DEPLOY = 2,
325    PAUSE = 3,
326    DELETE = 4,
327}
328
329impl Default for CategoryType {
330    fn default() -> Self {
331        CategoryType::UNKNOWN
332    }
333}
334// Start union section
335
336#[derive(PartialEq, Clone, Debug, XDROut, XDRIn)]
337pub enum Category {
338    UNKNOWN(()),
339    CALL(Call),
340
341    DEPLOY(Contract),
342
343    PAUSE(bool),
344
345    DELETE(()),
346}
347
348impl Default for Category {
349    fn default() -> Self {
350        Category::UNKNOWN(())
351    }
352}
353// End union section
354
355// Namespace end mazzaroth