-
Notifications
You must be signed in to change notification settings - Fork 4
/
operations.go
706 lines (642 loc) · 22.1 KB
/
operations.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
package node
import (
"bytes"
stdJSON "encoding/json"
"github.com/pkg/errors"
)
// OperationGroup -
type OperationGroup struct {
Protocol string `json:"protocol"`
ChainID string `json:"chain_id"`
Hash string `json:"hash"`
Branch string `json:"branch"`
Signature string `json:"signature"`
Contents []Operation `json:"contents"`
}
// Operation -
type Operation struct {
Kind string `json:"kind"`
Body interface{} `json:"-"`
}
// UnmarshalJSON -
func (op *Operation) UnmarshalJSON(data []byte) error {
type buf Operation
if err := json.Unmarshal(data, (*buf)(op)); err != nil {
return err
}
switch op.Kind {
case KindActivation:
var activation AccountActivation
if err := json.Unmarshal(data, &activation); err != nil {
return err
}
op.Body = activation
case KindBallot:
var ballot Ballot
if err := json.Unmarshal(data, &ballot); err != nil {
return err
}
op.Body = ballot
case KindDelegation:
var delegation Delegation
if err := json.Unmarshal(data, &delegation); err != nil {
return err
}
op.Body = delegation
case KindDoubleBaking:
var evidence DoubleBakingEvidence
if err := json.Unmarshal(data, &evidence); err != nil {
return err
}
op.Body = evidence
case KindDoubleEndorsing:
var evidence DoubleEndorsementEvidence
if err := json.Unmarshal(data, &evidence); err != nil {
return err
}
op.Body = evidence
case KindEndorsement:
var endorsement Endorsement
if err := json.Unmarshal(data, &endorsement); err != nil {
return err
}
op.Body = endorsement
case KindEndorsementWithSlot:
var endorsement EndorsementWithSlot
if err := json.Unmarshal(data, &endorsement); err != nil {
return err
}
op.Body = endorsement
case KindOrigination:
var origination Origination
if err := json.Unmarshal(data, &origination); err != nil {
return err
}
op.Body = origination
case KindProposal:
var proposal Proposal
if err := json.Unmarshal(data, &proposal); err != nil {
return err
}
op.Body = proposal
case KindReveal:
var reveal Reveal
if err := json.Unmarshal(data, &reveal); err != nil {
return err
}
op.Body = reveal
case KindNonceRevelation:
var seed SeedNonceRevelation
if err := json.Unmarshal(data, &seed); err != nil {
return err
}
op.Body = seed
case KindTransaction:
var transaction Transaction
if err := json.Unmarshal(data, &transaction); err != nil {
return err
}
op.Body = transaction
case KindRegisterGlobalConstant:
var register RegisterGlobalConstant
if err := json.Unmarshal(data, ®ister); err != nil {
return err
}
op.Body = register
case KindDoublePreendorsement:
var doublePreendorsement DoublePreendorsementEvidence
if err := json.Unmarshal(data, &doublePreendorsement); err != nil {
return err
}
op.Body = doublePreendorsement
case KindSetDepositsLimit:
var setDepositsLimit SetDepositsLimit
if err := json.Unmarshal(data, &setDepositsLimit); err != nil {
return err
}
op.Body = setDepositsLimit
case KindPreendorsement:
var preendorsement Preendorsement
if err := json.Unmarshal(data, &preendorsement); err != nil {
return err
}
op.Body = preendorsement
}
return nil
}
// AccountActivation -
func (op Operation) AccountActivation() (AccountActivation, error) {
if op.Kind != KindActivation {
return AccountActivation{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return AccountActivation{}, errors.New("nil operation body")
}
activation, ok := op.Body.(AccountActivation)
if !ok {
return AccountActivation{}, errors.Errorf("invalid body type: %T", op.Body)
}
return activation, nil
}
// Ballot -
func (op Operation) Ballot() (Ballot, error) {
if op.Kind != KindBallot {
return Ballot{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return Ballot{}, errors.New("nil operation body")
}
ballot, ok := op.Body.(Ballot)
if !ok {
return Ballot{}, errors.Errorf("invalid body type: %T", op.Body)
}
return ballot, nil
}
// Endorsement -
func (op Operation) Endorsement() (Endorsement, error) {
if op.Kind != KindEndorsement {
return Endorsement{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return Endorsement{}, errors.New("nil operation body")
}
endorsement, ok := op.Body.(Endorsement)
if !ok {
return Endorsement{}, errors.Errorf("invalid body type: %T", op.Body)
}
return endorsement, nil
}
// Preendorsement -
func (op Operation) Preendorsement() (Preendorsement, error) {
if op.Kind != KindPreendorsement {
return Preendorsement{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return Preendorsement{}, errors.New("nil operation body")
}
preendorsement, ok := op.Body.(Preendorsement)
if !ok {
return Preendorsement{}, errors.Errorf("invalid body type: %T", op.Body)
}
return preendorsement, nil
}
// EndorsementWithSlot -
func (op Operation) EndorsementWithSlot() (EndorsementWithSlot, error) {
if op.Kind != KindEndorsementWithSlot {
return EndorsementWithSlot{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return EndorsementWithSlot{}, errors.New("nil operation body")
}
endorsement, ok := op.Body.(EndorsementWithSlot)
if !ok {
return EndorsementWithSlot{}, errors.Errorf("invalid body type: %T", op.Body)
}
return endorsement, nil
}
// Delegation -
func (op Operation) Delegation() (Delegation, error) {
if op.Kind != KindDelegation {
return Delegation{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return Delegation{}, errors.New("nil operation body")
}
delegation, ok := op.Body.(Delegation)
if !ok {
return Delegation{}, errors.Errorf("invalid body type: %T", op.Body)
}
return delegation, nil
}
// DoubleBakingEvidence -
func (op Operation) DoubleBakingEvidence() (DoubleBakingEvidence, error) {
if op.Kind != KindDelegation {
return DoubleBakingEvidence{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return DoubleBakingEvidence{}, errors.New("nil operation body")
}
evidence, ok := op.Body.(DoubleBakingEvidence)
if !ok {
return DoubleBakingEvidence{}, errors.Errorf("invalid body type: %T", op.Body)
}
return evidence, nil
}
// DoubleEndorsementEvidence -
func (op Operation) DoubleEndorsementEvidence() (DoubleEndorsementEvidence, error) {
if op.Kind != KindDelegation {
return DoubleEndorsementEvidence{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return DoubleEndorsementEvidence{}, errors.New("nil operation body")
}
evidence, ok := op.Body.(DoubleEndorsementEvidence)
if !ok {
return DoubleEndorsementEvidence{}, errors.Errorf("invalid body type: %T", op.Body)
}
return evidence, nil
}
// Origination -
func (op Operation) Origination() (Origination, error) {
if op.Kind != KindOrigination {
return Origination{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return Origination{}, errors.New("nil operation body")
}
origination, ok := op.Body.(Origination)
if !ok {
return Origination{}, errors.Errorf("invalid body type: %T", op.Body)
}
return origination, nil
}
// Proposal -
func (op Operation) Proposal() (Proposal, error) {
if op.Kind != KindProposal {
return Proposal{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return Proposal{}, errors.New("nil operation body")
}
proposal, ok := op.Body.(Proposal)
if !ok {
return Proposal{}, errors.Errorf("invalid body type: %T", op.Body)
}
return proposal, nil
}
// Reveal -
func (op Operation) Reveal() (Reveal, error) {
if op.Kind != KindReveal {
return Reveal{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return Reveal{}, errors.New("nil operation body")
}
reveal, ok := op.Body.(Reveal)
if !ok {
return Reveal{}, errors.Errorf("invalid body type: %T", op.Body)
}
return reveal, nil
}
// Reveal -
func (op Operation) RegisterGlobalConstant() (RegisterGlobalConstant, error) {
if op.Kind != KindRegisterGlobalConstant {
return RegisterGlobalConstant{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return RegisterGlobalConstant{}, errors.New("nil operation body")
}
register, ok := op.Body.(RegisterGlobalConstant)
if !ok {
return RegisterGlobalConstant{}, errors.Errorf("invalid body type: %T", op.Body)
}
return register, nil
}
// SeedNonceRevelation -
func (op Operation) SeedNonceRevelation() (SeedNonceRevelation, error) {
if op.Kind != KindNonceRevelation {
return SeedNonceRevelation{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return SeedNonceRevelation{}, errors.New("nil operation body")
}
seed, ok := op.Body.(SeedNonceRevelation)
if !ok {
return SeedNonceRevelation{}, errors.Errorf("invalid body type: %T", op.Body)
}
return seed, nil
}
// SetDepositsLimit -
func (op Operation) SetDepositsLimit() (SetDepositsLimit, error) {
if op.Kind != KindSetDepositsLimit {
return SetDepositsLimit{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return SetDepositsLimit{}, errors.New("nil operation body")
}
tx, ok := op.Body.(SetDepositsLimit)
if !ok {
return SetDepositsLimit{}, errors.Errorf("invalid body type: %T", op.Body)
}
return tx, nil
}
// Transaction -
func (op Operation) Transaction() (Transaction, error) {
if op.Kind != KindTransaction {
return Transaction{}, errors.Errorf("invalid kind of operation: %s", op.Kind)
}
if op.Body == nil {
return Transaction{}, errors.New("nil operation body")
}
tx, ok := op.Body.(Transaction)
if !ok {
return Transaction{}, errors.Errorf("invalid body type: %T", op.Body)
}
return tx, nil
}
// AccountActivation -
type AccountActivation struct {
Pkh string `json:"pkh"`
Secret string `json:"secret"`
Metadata *OnlyBalanceUpdatesMetadata `json:"metadata,omitempty"`
}
// Ballot -
type Ballot struct {
Source string `json:"source"`
Period uint64 `json:"period"`
Proposal string `json:"proposal"`
Ballot string `json:"ballot"`
}
// Endorsement -
type Endorsement struct {
Level uint64 `json:"level"`
Metadata *EndorsementMetadata `json:"metadata,omitempty"`
}
// EndorsementWithSlot -
type EndorsementWithSlot struct {
Endorsement EndorsementWithSlotEntity `json:"endorsement"`
Slot uint64 `json:"slot"`
Metadata *EndorsementMetadata `json:"metadata,omitempty"`
}
// Preendorsement -
type Preendorsement struct {
Slot uint64 `json:"slot"`
Level uint64 `json:"level"`
Round int64 `json:"round"`
BlockPayloadHash string `json:"block_payload_hash"`
Metadata struct {
BalanceUpdates []interface{} `json:"balance_updates"`
Delegate string `json:"delegate"`
PreendorsementPower int `json:"preendorsement_power"`
} `json:"metadata"`
}
// Delegation -
type Delegation struct {
Source string `json:"source"`
Fee string `json:"fee"`
Counter string `json:"counter"`
GasLimit string `json:"gas_limit"`
StorageLimit string `json:"storage_limit"`
Delegate string `json:"delegate,omitempty"`
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
}
// DoubleBakingEvidence -
type DoubleBakingEvidence struct {
Bh1 *Header `json:"bh1,omitempty"`
Bh2 *Header `json:"bh2,omitempty"`
Metadata *OnlyBalanceUpdatesMetadata `json:"metadata,omitempty"`
}
// DoubleEndorsementEvidence -
type DoubleEndorsementEvidence struct {
Op1 *InlinedEndorsement `json:"op1"`
Op2 *InlinedEndorsement `json:"op2"`
Metadata *OnlyBalanceUpdatesMetadata `json:"metadata,omitempty"`
}
// DoublePreendorsementEvidence -
type DoublePreendorsementEvidence struct {
Op1 *InlinedEndorsement `json:"op1"`
Op2 *InlinedEndorsement `json:"op2"`
Metadata *OnlyBalanceUpdatesMetadata `json:"metadata,omitempty"`
}
// Origination -
type Origination struct {
Source string `json:"source"`
Fee string `json:"fee"`
Counter string `json:"counter"`
GasLimit string `json:"gas_limit"`
StorageLimit string `json:"storage_limit"`
Balance string `json:"balance"`
Delegate string `json:"delegate,omitempty"`
Script stdJSON.RawMessage `json:"script"`
ManagerPubkey string `json:"managerPubkey,omitempty"`
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
}
// Proposal -
type Proposal struct {
Source string `json:"source"`
Period uint64 `json:"period"`
Proposals []string `json:"proposals"`
}
// Reveal -
type Reveal struct {
Source string `json:"source"`
Fee string `json:"fee"`
Counter string `json:"counter"`
GasLimit string `json:"gas_limit"`
StorageLimit string `json:"storage_limit"`
PublicKey string `json:"public_key"`
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
}
// RegisterGlobalConstant -
type RegisterGlobalConstant struct {
Source string `json:"source"`
Fee string `json:"fee"`
Counter string `json:"counter"`
GasLimit string `json:"gas_limit"`
StorageLimit string `json:"storage_limit"`
Value stdJSON.RawMessage `json:"value"`
}
// SeedNonceRevelation -
type SeedNonceRevelation struct {
Level uint64 `json:"level"`
Nonce string `json:"nonce"`
Metadata *OnlyBalanceUpdatesMetadata `json:"metadata,omitempty"`
}
// SetDepositsLimit -
type SetDepositsLimit struct {
Kind string `json:"kind"`
Source string `json:"source"`
Fee string `json:"fee"`
Counter string `json:"counter"`
GasLimit string `json:"gas_limit"`
StorageLimit string `json:"storage_limit"`
Limit *string `json:"limit,omitempty"`
Metadata *ManagerOperationMetadata `json:"metadata"`
}
// Transaction -
type Transaction struct {
Source string `json:"source"`
Fee string `json:"fee"`
Counter string `json:"counter"`
GasLimit string `json:"gas_limit"`
StorageLimit string `json:"storage_limit"`
Amount string `json:"amount"`
Destination string `json:"destination"`
Parameters *Parameters `json:"parameters,omitempty"`
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
}
// Parameters -
type Parameters struct {
Entrypoint string `json:"entrypoint"`
Value *stdJSON.RawMessage `json:"value"`
}
// ManagerOperationMetadata -
type ManagerOperationMetadata struct {
BalanceUpdates []BalanceUpdate `json:"balance_updates"`
OperationResult OperationResult `json:"operation_result"`
InternalOperationResults []InternalOperationResults `json:"internal_operation_results,omitempty"`
}
// OnlyBalanceUpdatesMetadata -
type OnlyBalanceUpdatesMetadata struct {
BalanceUpdates []BalanceUpdate `json:"balance_updates"`
}
// EndorsementMetadata -
type EndorsementMetadata struct {
BalanceUpdates []BalanceUpdate `json:"balance_updates"`
Delegate string `json:"delegate"`
Slots []int `json:"slots"`
}
// OperationResult -
type OperationResult struct {
Status string `json:"status"`
Storage *stdJSON.RawMessage `json:"storage,omitempty"`
BigMapDiff []BigMapDiff `json:"big_map_diff,omitempty"`
LazyStorageDiff []LazyStorageDiff `json:"lazy_storage_diff,omitempty"`
BalanceUpdates []BalanceUpdate `json:"balance_updates,omitempty"`
OriginatedContracts []string `json:"originated_contracts,omitempty"`
ConsumedGas string `json:"consumed_gas,omitempty"`
StorageSize string `json:"storage_size,omitempty"`
PaidStorageSizeDiff string `json:"paid_storage_size_diff,omitempty"`
AllocatedDestinationContract bool `json:"allocated_destination_contract,omitempty"`
Errors []ResultError `json:"errors,omitempty"`
}
// InternalOperationResults -
type InternalOperationResults struct {
Kind string `json:"kind"`
Source string `json:"source"`
Nonce uint64 `json:"nonce"`
Amount string `json:"amount,omitempty"`
PublicKey string `json:"public_key,omitempty"`
Destination string `json:"destination,omitempty"`
Balance string `json:"balance,omitempty"`
Delegate string `json:"delegate,omitempty"`
Script *stdJSON.RawMessage `json:"script,omitempty"`
Parameters *Parameters `json:"paramaters,omitempty"`
Result OperationResult `json:"result"`
}
// ResultError -
type ResultError struct {
Kind string `json:"kind"`
ID string `json:"id,omitempty"`
With *stdJSON.RawMessage `json:"with,omitempty"`
Msg string `json:"msg,omitempty"`
Location int64 `json:"location,omitempty"`
ContractHandle string `json:"contract_handle,omitempty"`
ContractCode *stdJSON.RawMessage `json:"contract_code,omitempty"`
}
// BigMapDiff is an element of BigMapDiffs
type BigMapDiff struct {
Action string `json:"action,omitempty"`
BigMap string `json:"big_map,omitempty"`
KeyHash string `json:"key_hash,omitempty"`
Key *stdJSON.RawMessage `json:"key,omitempty"`
Value *stdJSON.RawMessage `json:"value,omitempty"`
SourceBigMap string `json:"source_big_map,omitempty"`
DestinationBigMap string `json:"destination_big_map,omitempty"`
KeyType *stdJSON.RawMessage `json:"key_type,omitempty"`
ValueType *stdJSON.RawMessage `json:"value_type,omitempty"`
}
// LazyStorageDiff -
type LazyStorageDiff struct {
Kind string `json:"kind"`
ID string `json:"id"`
Diff LazyStorageDiffBigMapEntity `json:"diff"`
}
// LazyStorageDiffBigMapEntity -
type LazyStorageDiffBigMapEntity struct {
Action string `json:"action"`
Updates []LazyStorageDiffUpdate `json:"updates,omitempty"`
Source string `json:"source,omitempty"`
KeyType *stdJSON.RawMessage `json:"key_type,omitempty"`
ValueType *stdJSON.RawMessage `json:"value_type,omitempty"`
}
// LazyStorageDiffUpdate -
type LazyStorageDiffUpdate struct {
Action string `json:"action,omitempty"`
Key *stdJSON.RawMessage `json:"key,omitempty"`
Value *stdJSON.RawMessage `json:"value,omitempty"`
}
// LazyStorageDiffSaplingEntity -
type LazyStorageDiffSaplingEntity struct {
Action string `json:"action"`
Updates []LazyStorageDiffUpdate `json:"updates,omitempty"`
Source string `json:"source,omitempty"`
MemoSize uint64 `json:"memo_size,omitempty"`
}
// LazyStorageDiffUpdatesSaplingState -
type LazyStorageDiffUpdatesSaplingState struct {
CommitmentsAndCiphertexts CommitmentsAndCiphertexts `json:"commitments_and_ciphertexts,omitempty"`
Nullifiers []string `json:"nullifiers,omitempty"`
}
// CommitmentsAndCiphertexts-
type CommitmentsAndCiphertexts struct {
Commitments string
Ciphertexts SaplingTransactionCiphertext
}
// UnmarshalJSON -
func (cc *CommitmentsAndCiphertexts) UnmarshalJSON(data []byte) error {
raw := []interface{}{
cc.Commitments, cc.Ciphertexts,
}
return json.Unmarshal(data, &raw)
}
// MarshalJSON -
func (cc CommitmentsAndCiphertexts) MarshalJSON() ([]byte, error) {
buf := new(bytes.Buffer)
buf.WriteByte('[')
buf.WriteByte('"')
buf.WriteString(cc.Commitments)
buf.WriteByte('"')
buf.WriteByte(',')
ciphertexts, err := json.Marshal(cc.Ciphertexts)
if err != nil {
return nil, err
}
buf.Write(ciphertexts)
buf.WriteByte(']')
return buf.Bytes(), nil
}
// SaplingTransactionCiphertext -
type SaplingTransactionCiphertext struct {
CV string `json:"cv"`
EPK string `json:"epk"`
PayloadEnc string `json:"payload_enc"`
NonceEnc string `json:"nonce_enc"`
PayloadOut string `json:"payload_out"`
NonceOut string `json:"nonce_out"`
}
// InlinedEndorsement -
type InlinedEndorsement struct {
Branch string `json:"branch"`
Operations *InlinedEndorsementOperations `json:"operations,omitempty"`
Signature string `json:"signature"`
}
// InlinedEndorsementOperations -
type InlinedEndorsementOperations struct {
Kind string `json:"kind"`
Level int `json:"level"`
}
// InlinedPreendorsement -
type InlinedPreendorsement struct {
Branch string `json:"branch"`
Operations *InlinedPreendorsementOperations `json:"operations,omitempty"`
Signature string `json:"signature"`
}
// InlinedPreendorsementOperations -
type InlinedPreendorsementOperations struct {
Kind string `json:"kind"`
Slot uint64 `json:"slot"`
Level uint64 `json:"level"`
Round int64 `json:"round"`
BlockPayloadHash string `json:"block_payload_hash"`
}
// EndorsementWithSlotEntity -
type EndorsementWithSlotEntity struct {
Branch string `json:"branch"`
Operation EndorsementOperation `json:"operations"`
Signature string `json:"signature"`
}
// EndorsementOperation -
type EndorsementOperation struct {
Level uint64 `json:"level"`
}