/
messagesBlockchain.go
717 lines (601 loc) · 23.6 KB
/
messagesBlockchain.go
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
package common
import (
"github.com/ElrondNetwork/elrond-go/core/vmcommon"
"github.com/ElrondNetwork/elrond-go/data/esdt"
)
// MessageBlockchainNewAddressRequest represents a request message
type MessageBlockchainNewAddressRequest struct {
Message
CreatorAddress []byte
CreatorNonce uint64
VMType []byte
}
// NewMessageBlockchainNewAddressRequest creates a request message
func NewMessageBlockchainNewAddressRequest(creatorAddress []byte, creatorNonce uint64, vmType []byte) *MessageBlockchainNewAddressRequest {
message := &MessageBlockchainNewAddressRequest{}
message.Kind = BlockchainNewAddressRequest
message.CreatorAddress = creatorAddress
message.CreatorNonce = creatorNonce
message.VMType = vmType
return message
}
// MessageBlockchainNewAddressResponse represents a response message
type MessageBlockchainNewAddressResponse struct {
Message
Result []byte
}
// NewMessageBlockchainNewAddressResponse creates a response message
func NewMessageBlockchainNewAddressResponse(result []byte, err error) *MessageBlockchainNewAddressResponse {
message := &MessageBlockchainNewAddressResponse{}
message.Kind = BlockchainNewAddressResponse
message.Result = result
message.SetError(err)
return message
}
// MessageBlockchainGetStorageDataRequest represents a request message
type MessageBlockchainGetStorageDataRequest struct {
Message
Address []byte
Index []byte
}
// NewMessageBlockchainGetStorageDataRequest creates a request message
func NewMessageBlockchainGetStorageDataRequest(address []byte, index []byte) *MessageBlockchainGetStorageDataRequest {
message := &MessageBlockchainGetStorageDataRequest{}
message.Kind = BlockchainGetStorageDataRequest
message.Address = address
message.Index = index
return message
}
// MessageBlockchainGetStorageDataResponse represents a response message
type MessageBlockchainGetStorageDataResponse struct {
Message
Data []byte
}
// NewMessageBlockchainGetStorageDataResponse creates a response message
func NewMessageBlockchainGetStorageDataResponse(data []byte, err error) *MessageBlockchainGetStorageDataResponse {
message := &MessageBlockchainGetStorageDataResponse{}
message.Kind = BlockchainGetStorageDataResponse
message.Data = data
message.SetError(err)
return message
}
// MessageBlockchainGetBlockhashRequest represents a request message
type MessageBlockchainGetBlockhashRequest struct {
Message
Nonce uint64
}
// NewMessageBlockchainGetBlockhashRequest creates a request message
func NewMessageBlockchainGetBlockhashRequest(nonce uint64) *MessageBlockchainGetBlockhashRequest {
message := &MessageBlockchainGetBlockhashRequest{}
message.Kind = BlockchainGetBlockhashRequest
message.Nonce = nonce
return message
}
// MessageBlockchainGetBlockhashResponse represents a response message
type MessageBlockchainGetBlockhashResponse struct {
Message
Result []byte
}
// NewMessageBlockchainGetBlockhashResponse creates a response message
func NewMessageBlockchainGetBlockhashResponse(result []byte, err error) *MessageBlockchainGetBlockhashResponse {
message := &MessageBlockchainGetBlockhashResponse{}
message.Kind = BlockchainGetBlockhashResponse
message.Result = result
message.SetError(err)
return message
}
// MessageBlockchainLastNonceRequest represents a request message
type MessageBlockchainLastNonceRequest struct {
Message
}
// NewMessageBlockchainLastNonceRequest creates a request message
func NewMessageBlockchainLastNonceRequest() *MessageBlockchainLastNonceRequest {
message := &MessageBlockchainLastNonceRequest{}
message.Kind = BlockchainLastNonceRequest
return message
}
// MessageBlockchainLastNonceResponse represents a response message
type MessageBlockchainLastNonceResponse struct {
Message
Result uint64
}
// NewMessageBlockchainLastNonceResponse creates a response message
func NewMessageBlockchainLastNonceResponse(result uint64) *MessageBlockchainLastNonceResponse {
message := &MessageBlockchainLastNonceResponse{}
message.Kind = BlockchainLastNonceResponse
message.Result = result
return message
}
// MessageBlockchainLastRoundRequest represents a request message
type MessageBlockchainLastRoundRequest struct {
Message
}
// NewMessageBlockchainLastRoundRequest creates a request message
func NewMessageBlockchainLastRoundRequest() *MessageBlockchainLastRoundRequest {
message := &MessageBlockchainLastRoundRequest{}
message.Kind = BlockchainLastRoundRequest
return message
}
// MessageBlockchainLastRoundResponse represents a response message
type MessageBlockchainLastRoundResponse struct {
Message
Result uint64
}
// NewMessageBlockchainLastRoundResponse creates a response message
func NewMessageBlockchainLastRoundResponse(result uint64) *MessageBlockchainLastRoundResponse {
message := &MessageBlockchainLastRoundResponse{}
message.Kind = BlockchainLastRoundResponse
message.Result = result
return message
}
// MessageBlockchainLastTimeStampRequest represents a request message
type MessageBlockchainLastTimeStampRequest struct {
Message
}
// NewMessageBlockchainLastTimeStampRequest creates a request message
func NewMessageBlockchainLastTimeStampRequest() *MessageBlockchainLastTimeStampRequest {
message := &MessageBlockchainLastTimeStampRequest{}
message.Kind = BlockchainLastTimeStampRequest
return message
}
// MessageBlockchainLastTimeStampResponse represents a response message
type MessageBlockchainLastTimeStampResponse struct {
Message
Result uint64
}
// NewMessageBlockchainLastTimeStampResponse creates a response message
func NewMessageBlockchainLastTimeStampResponse(result uint64) *MessageBlockchainLastTimeStampResponse {
message := &MessageBlockchainLastTimeStampResponse{}
message.Kind = BlockchainLastTimeStampResponse
message.Result = result
return message
}
// MessageBlockchainLastRandomSeedRequest represents a request message
type MessageBlockchainLastRandomSeedRequest struct {
Message
}
// NewMessageBlockchainLastRandomSeedRequest creates a request message
func NewMessageBlockchainLastRandomSeedRequest() *MessageBlockchainLastRandomSeedRequest {
message := &MessageBlockchainLastRandomSeedRequest{}
message.Kind = BlockchainLastRandomSeedRequest
return message
}
// MessageBlockchainLastRandomSeedResponse represents a response message
type MessageBlockchainLastRandomSeedResponse struct {
Message
Result []byte
}
// NewMessageBlockchainLastRandomSeedResponse creates a response message
func NewMessageBlockchainLastRandomSeedResponse(result []byte) *MessageBlockchainLastRandomSeedResponse {
message := &MessageBlockchainLastRandomSeedResponse{}
message.Kind = BlockchainLastRandomSeedResponse
message.Result = result
return message
}
// MessageBlockchainLastEpochRequest represents a request message
type MessageBlockchainLastEpochRequest struct {
Message
}
// NewMessageBlockchainLastEpochRequest creates a request message
func NewMessageBlockchainLastEpochRequest() *MessageBlockchainLastEpochRequest {
message := &MessageBlockchainLastEpochRequest{}
message.Kind = BlockchainLastEpochRequest
return message
}
// MessageBlockchainLastEpochResponse represents a response message
type MessageBlockchainLastEpochResponse struct {
Message
Result uint32
}
// NewMessageBlockchainLastEpochResponse creates a response message
func NewMessageBlockchainLastEpochResponse(result uint32) *MessageBlockchainLastEpochResponse {
message := &MessageBlockchainLastEpochResponse{}
message.Kind = BlockchainLastEpochResponse
message.Result = result
return message
}
// MessageBlockchainGetStateRootHashRequest represents a request message
type MessageBlockchainGetStateRootHashRequest struct {
Message
}
// NewMessageBlockchainGetStateRootHashRequest creates a request message
func NewMessageBlockchainGetStateRootHashRequest() *MessageBlockchainGetStateRootHashRequest {
message := &MessageBlockchainGetStateRootHashRequest{}
message.Kind = BlockchainGetStateRootHashRequest
return message
}
// MessageBlockchainGetStateRootHashResponse represents a response message
type MessageBlockchainGetStateRootHashResponse struct {
Message
Result []byte
}
// NewMessageBlockchainGetStateRootHashResponse creates a response message
func NewMessageBlockchainGetStateRootHashResponse(result []byte) *MessageBlockchainGetStateRootHashResponse {
message := &MessageBlockchainGetStateRootHashResponse{}
message.Kind = BlockchainGetStateRootHashResponse
message.Result = result
return message
}
// MessageBlockchainCurrentNonceRequest represents a request message
type MessageBlockchainCurrentNonceRequest struct {
Message
}
// NewMessageBlockchainCurrentNonceRequest creates a request message
func NewMessageBlockchainCurrentNonceRequest() *MessageBlockchainCurrentNonceRequest {
message := &MessageBlockchainCurrentNonceRequest{}
message.Kind = BlockchainCurrentNonceRequest
return message
}
// MessageBlockchainCurrentNonceResponse represents a response message
type MessageBlockchainCurrentNonceResponse struct {
Message
Result uint64
}
// NewMessageBlockchainCurrentNonceResponse creates a response message
func NewMessageBlockchainCurrentNonceResponse(result uint64) *MessageBlockchainCurrentNonceResponse {
message := &MessageBlockchainCurrentNonceResponse{}
message.Kind = BlockchainCurrentNonceResponse
message.Result = result
return message
}
// MessageBlockchainCurrentRoundRequest represents a request message
type MessageBlockchainCurrentRoundRequest struct {
Message
}
// NewMessageBlockchainCurrentRoundRequest creates a request message
func NewMessageBlockchainCurrentRoundRequest() *MessageBlockchainCurrentRoundRequest {
message := &MessageBlockchainCurrentRoundRequest{}
message.Kind = BlockchainCurrentRoundRequest
return message
}
// MessageBlockchainCurrentRoundResponse represents a response message
type MessageBlockchainCurrentRoundResponse struct {
Message
Result uint64
}
// NewMessageBlockchainCurrentRoundResponse creates a response message
func NewMessageBlockchainCurrentRoundResponse(result uint64) *MessageBlockchainCurrentRoundResponse {
message := &MessageBlockchainCurrentRoundResponse{}
message.Kind = BlockchainCurrentRoundResponse
message.Result = result
return message
}
// MessageBlockchainCurrentTimeStampRequest represents a request message
type MessageBlockchainCurrentTimeStampRequest struct {
Message
}
// NewMessageBlockchainCurrentTimeStampRequest creates a request message
func NewMessageBlockchainCurrentTimeStampRequest() *MessageBlockchainCurrentTimeStampRequest {
message := &MessageBlockchainCurrentTimeStampRequest{}
message.Kind = BlockchainCurrentTimeStampRequest
return message
}
// MessageBlockchainCurrentTimeStampResponse represents a response message
type MessageBlockchainCurrentTimeStampResponse struct {
Message
Result uint64
}
// NewMessageBlockchainCurrentTimeStampResponse creates a response message
func NewMessageBlockchainCurrentTimeStampResponse(result uint64) *MessageBlockchainCurrentTimeStampResponse {
message := &MessageBlockchainCurrentTimeStampResponse{}
message.Kind = BlockchainCurrentTimeStampResponse
message.Result = result
return message
}
// MessageBlockchainCurrentRandomSeedRequest represents a request message
type MessageBlockchainCurrentRandomSeedRequest struct {
Message
}
// NewMessageBlockchainCurrentRandomSeedRequest creates a request message
func NewMessageBlockchainCurrentRandomSeedRequest() *MessageBlockchainCurrentRandomSeedRequest {
message := &MessageBlockchainCurrentRandomSeedRequest{}
message.Kind = BlockchainCurrentRandomSeedRequest
return message
}
// MessageBlockchainCurrentRandomSeedResponse represents a response message
type MessageBlockchainCurrentRandomSeedResponse struct {
Message
Result []byte
}
// NewMessageBlockchainCurrentRandomSeedResponse creates a response message
func NewMessageBlockchainCurrentRandomSeedResponse(result []byte) *MessageBlockchainCurrentRandomSeedResponse {
message := &MessageBlockchainCurrentRandomSeedResponse{}
message.Kind = BlockchainCurrentRandomSeedResponse
message.Result = result
return message
}
// MessageBlockchainCurrentEpochRequest represents a request message
type MessageBlockchainCurrentEpochRequest struct {
Message
}
// NewMessageBlockchainCurrentEpochRequest creates a request message
func NewMessageBlockchainCurrentEpochRequest() *MessageBlockchainCurrentEpochRequest {
message := &MessageBlockchainCurrentEpochRequest{}
message.Kind = BlockchainCurrentEpochRequest
return message
}
// MessageBlockchainCurrentEpochResponse represents a response message
type MessageBlockchainCurrentEpochResponse struct {
Message
Result uint32
}
// NewMessageBlockchainCurrentEpochResponse creates a response message
func NewMessageBlockchainCurrentEpochResponse(result uint32) *MessageBlockchainCurrentEpochResponse {
message := &MessageBlockchainCurrentEpochResponse{}
message.Kind = BlockchainCurrentEpochResponse
message.Result = result
return message
}
// MessageBlockchainProcessBuiltinFunctionRequest represents a request message
type MessageBlockchainProcessBuiltinFunctionRequest struct {
Message
CallInput vmcommon.ContractCallInput
}
// NewMessageBlockchainProcessBuiltinFunctionRequest creates a request message
func NewMessageBlockchainProcessBuiltinFunctionRequest(callInput vmcommon.ContractCallInput) *MessageBlockchainProcessBuiltinFunctionRequest {
message := &MessageBlockchainProcessBuiltinFunctionRequest{}
message.Kind = BlockchainProcessBuiltinFunctionRequest
message.CallInput = callInput
return message
}
// MessageBlockchainProcessBuiltinFunctionResponse represents a response message
type MessageBlockchainProcessBuiltinFunctionResponse struct {
Message
SerializableVMOutput *SerializableVMOutput
}
// NewMessageBlockchainProcessBuiltinFunctionResponse creates a response message
func NewMessageBlockchainProcessBuiltinFunctionResponse(vmOutput *vmcommon.VMOutput, err error) *MessageBlockchainProcessBuiltinFunctionResponse {
message := &MessageBlockchainProcessBuiltinFunctionResponse{}
message.Kind = BlockchainProcessBuiltinFunctionResponse
message.SerializableVMOutput = NewSerializableVMOutput(vmOutput)
message.SetError(err)
return message
}
// MessageBlockchainGetESDTTokenRequest represents a request message
type MessageBlockchainGetESDTTokenRequest struct {
Message
Address []byte
TokenID []byte
Nonce uint64
}
// NewMessageBlockchainGetESDTTokenRequest creates a request message
func NewMessageBlockchainGetESDTTokenRequest(address []byte, tokenID []byte, nonce uint64) *MessageBlockchainGetESDTTokenRequest {
message := &MessageBlockchainGetESDTTokenRequest{}
message.Kind = BlockchainGetESDTTokenRequest
message.Address = address
message.TokenID = tokenID
message.Nonce = nonce
return message
}
// MessageBlockchainGetESDTTokenResponse represents a response message
type MessageBlockchainGetESDTTokenResponse struct {
Message
ESDTData *esdt.ESDigitalToken
}
// NewMessageBlockchainGetESDTTokenResponse creates a response message
func NewMessageBlockchainGetESDTTokenResponse(esdtData *esdt.ESDigitalToken, err error) *MessageBlockchainGetESDTTokenResponse {
message := &MessageBlockchainGetESDTTokenResponse{}
message.Kind = BlockchainGetESDTTokenResponse
message.ESDTData = esdtData
message.SetError(err)
return message
}
// MessageBlockchainGetBuiltinFunctionNamesRequest represents a request message
type MessageBlockchainGetBuiltinFunctionNamesRequest struct {
Message
}
// NewMessageBlockchainGetBuiltinFunctionNamesRequest creates a request message
func NewMessageBlockchainGetBuiltinFunctionNamesRequest() *MessageBlockchainGetBuiltinFunctionNamesRequest {
message := &MessageBlockchainGetBuiltinFunctionNamesRequest{}
message.Kind = BlockchainGetBuiltinFunctionNamesRequest
return message
}
// MessageBlockchainGetBuiltinFunctionNamesResponse represents a response message
type MessageBlockchainGetBuiltinFunctionNamesResponse struct {
Message
FunctionNames vmcommon.FunctionNames
}
// NewMessageBlockchainGetBuiltinFunctionNamesResponse creates a response message
func NewMessageBlockchainGetBuiltinFunctionNamesResponse(functionNames vmcommon.FunctionNames) *MessageBlockchainGetBuiltinFunctionNamesResponse {
message := &MessageBlockchainGetBuiltinFunctionNamesResponse{}
message.Kind = BlockchainGetBuiltinFunctionNamesResponse
message.FunctionNames = functionNames
return message
}
// MessageBlockchainGetAllStateRequest represents a request message
type MessageBlockchainGetAllStateRequest struct {
Message
Address []byte
}
// NewMessageBlockchainGetAllStateRequest creates a request message
func NewMessageBlockchainGetAllStateRequest(address []byte) *MessageBlockchainGetAllStateRequest {
message := &MessageBlockchainGetAllStateRequest{}
message.Kind = BlockchainGetAllStateRequest
message.Address = address
return message
}
// MessageBlockchainGetAllStateResponse represents a response message
type MessageBlockchainGetAllStateResponse struct {
Message
SerializableAllState *SerializableMapStringBytes
}
// NewMessageBlockchainGetAllStateResponse creates a response message
func NewMessageBlockchainGetAllStateResponse(state map[string][]byte, err error) *MessageBlockchainGetAllStateResponse {
message := &MessageBlockchainGetAllStateResponse{}
message.Kind = BlockchainGetAllStateResponse
message.SerializableAllState = NewSerializableMapStringBytes(state)
message.SetError(err)
return message
}
// MessageBlockchainGetUserAccountRequest represents a request message
type MessageBlockchainGetUserAccountRequest struct {
Message
Address []byte
}
// NewMessageBlockchainGetUserAccountRequest creates a request message
func NewMessageBlockchainGetUserAccountRequest(address []byte) *MessageBlockchainGetUserAccountRequest {
message := &MessageBlockchainGetUserAccountRequest{}
message.Kind = BlockchainGetUserAccountRequest
message.Address = address
return message
}
// MessageBlockchainGetUserAccountResponse represents a response message
type MessageBlockchainGetUserAccountResponse struct {
Message
Account *Account
}
// NewMessageBlockchainGetUserAccountResponse creates a response message
func NewMessageBlockchainGetUserAccountResponse(account *Account, err error) *MessageBlockchainGetUserAccountResponse {
message := &MessageBlockchainGetUserAccountResponse{}
message.Kind = BlockchainGetUserAccountResponse
message.Account = account
message.SetError(err)
return message
}
// NewMessageBlockchainGetCodeRequest represents a request message
type MessageBlockchainGetCodeRequest struct {
Message
Account *Account
}
// NewMessageBlockchainGetCodeRequest creates a request message
func NewMessageBlockchainGetCodeRequest(account *Account) *MessageBlockchainGetCodeRequest {
message := &MessageBlockchainGetCodeRequest{}
message.Kind = BlockchainGetCodeRequest
message.Account = account
return message
}
// MessageBlockchainGetCodeResponse represents a response message
type MessageBlockchainGetCodeResponse struct {
Message
Code []byte
}
// NewMessageBlockchainGetCodeResponse creates a response message
func NewMessageBlockchainGetCodeResponse(code []byte) *MessageBlockchainGetCodeResponse {
message := &MessageBlockchainGetCodeResponse{}
message.Kind = BlockchainGetCodeResponse
message.Code = code
return message
}
// MessageBlockchainGetShardOfAddressRequest represents a request message
type MessageBlockchainGetShardOfAddressRequest struct {
Message
Address []byte
}
// NewMessageBlockchainGetShardOfAddressRequest creates a request message
func NewMessageBlockchainGetShardOfAddressRequest(address []byte) *MessageBlockchainGetShardOfAddressRequest {
message := &MessageBlockchainGetShardOfAddressRequest{}
message.Kind = BlockchainGetShardOfAddressRequest
message.Address = address
return message
}
// MessageBlockchainGetShardOfAddressResponse represents a response message
type MessageBlockchainGetShardOfAddressResponse struct {
Message
Shard uint32
}
// NewMessageBlockchainGetShardOfAddressResponse creates a response message
func NewMessageBlockchainGetShardOfAddressResponse(shard uint32) *MessageBlockchainGetShardOfAddressResponse {
message := &MessageBlockchainGetShardOfAddressResponse{}
message.Kind = BlockchainGetShardOfAddressResponse
message.Shard = shard
return message
}
// MessageBlockchainIsSmartContractRequest represents a request message
type MessageBlockchainIsSmartContractRequest struct {
Message
Address []byte
}
// NewMessageBlockchainIsSmartContractRequest creates a request message
func NewMessageBlockchainIsSmartContractRequest(address []byte) *MessageBlockchainIsSmartContractRequest {
message := &MessageBlockchainIsSmartContractRequest{}
message.Kind = BlockchainIsSmartContractRequest
message.Address = address
return message
}
// MessageBlockchainIsSmartContractResponse represents a response message
type MessageBlockchainIsSmartContractResponse struct {
Message
Result bool
}
// NewMessageBlockchainIsSmartContractResponse creates a response message
func NewMessageBlockchainIsSmartContractResponse(result bool) *MessageBlockchainIsSmartContractResponse {
message := &MessageBlockchainIsSmartContractResponse{}
message.Kind = BlockchainIsSmartContractResponse
message.Result = result
return message
}
// MessageBlockchainIsPayableRequest represents a request message
type MessageBlockchainIsPayableRequest struct {
Message
Address []byte
}
// NewMessageBlockchainIsPayableRequest creates a request message
func NewMessageBlockchainIsPayableRequest(address []byte) *MessageBlockchainIsPayableRequest {
message := &MessageBlockchainIsPayableRequest{}
message.Kind = BlockchainIsPayableRequest
message.Address = address
return message
}
// MessageBlockchainIsPayableResponse represents a response message
type MessageBlockchainIsPayableResponse struct {
Message
Result bool
}
// NewMessageBlockchainIsPayableResponse creates a response message
func NewMessageBlockchainIsPayableResponse(result bool, err error) *MessageBlockchainIsPayableResponse {
message := &MessageBlockchainIsPayableResponse{}
message.Kind = BlockchainIsPayableResponse
message.Result = result
message.SetError(err)
return message
}
// MessageBlockchainSaveCompiledCodeRequest represents a request message
type MessageBlockchainSaveCompiledCodeRequest struct {
Message
CodeHash []byte
Code []byte
}
// NewMessageBlockchainSaveCompiledCodeRequest creates a request message
func NewMessageBlockchainSaveCompiledCodeRequest(codeHash []byte, code []byte) *MessageBlockchainSaveCompiledCodeRequest {
message := &MessageBlockchainSaveCompiledCodeRequest{}
message.Kind = BlockchainSaveCompiledCodeRequest
message.CodeHash = codeHash
message.Code = code
return message
}
// MessageBlockchainSaveCompiledCodeResponse represents a response message
type MessageBlockchainSaveCompiledCodeResponse struct {
Message
}
// NewMessageBlockchainSaveCompiledCodeResponse creates a response message
func NewMessageBlockchainSaveCompiledCodeResponse() *MessageBlockchainSaveCompiledCodeResponse {
message := &MessageBlockchainSaveCompiledCodeResponse{}
message.Kind = BlockchainSaveCompiledCodeResponse
return message
}
// MessageBlockchainGetCompiledCodeRequest represents a request message
type MessageBlockchainGetCompiledCodeRequest struct {
Message
CodeHash []byte
}
// NewMessageBlockchainGetCompiledCodeRequest creates a request message
func NewMessageBlockchainGetCompiledCodeRequest(codeHash []byte) *MessageBlockchainGetCompiledCodeRequest {
message := &MessageBlockchainGetCompiledCodeRequest{}
message.Kind = BlockchainGetCompiledCodeRequest
message.CodeHash = codeHash
return message
}
// MessageBlockchainGetCompiledCodeResponse represents a response message
type MessageBlockchainGetCompiledCodeResponse struct {
Message
Found bool
Code []byte
}
// NewMessageBlockchainGetCompiledCodeResponse creates a response message
func NewMessageBlockchainGetCompiledCodeResponse(result bool, code []byte) *MessageBlockchainGetCompiledCodeResponse {
message := &MessageBlockchainGetCompiledCodeResponse{}
message.Kind = BlockchainGetCompiledCodeResponse
message.Found = result
message.Code = code
return message
}