@@ -109,6 +109,24 @@ func (op *Operation) UnmarshalJSON(data []byte) error {
109109 return err
110110 }
111111 op .Body = register
112+ case KindDoublePreendorsement :
113+ var doublePreendorsement DoublePreendorsementEvidence
114+ if err := json .Unmarshal (data , & doublePreendorsement ); err != nil {
115+ return err
116+ }
117+ op .Body = doublePreendorsement
118+ case KindSetDepositsLimit :
119+ var setDepositsLimit SetDepositsLimit
120+ if err := json .Unmarshal (data , & setDepositsLimit ); err != nil {
121+ return err
122+ }
123+ op .Body = setDepositsLimit
124+ case KindPreendorsement :
125+ var preendorsement Preendorsement
126+ if err := json .Unmarshal (data , & preendorsement ); err != nil {
127+ return err
128+ }
129+ op .Body = preendorsement
112130 }
113131 return nil
114132}
@@ -158,6 +176,21 @@ func (op Operation) Endorsement() (Endorsement, error) {
158176 return endorsement , nil
159177}
160178
179+ // Preendorsement -
180+ func (op Operation ) Preendorsement () (Preendorsement , error ) {
181+ if op .Kind != KindPreendorsement {
182+ return Preendorsement {}, errors .Errorf ("invalid kind of operation: %s" , op .Kind )
183+ }
184+ if op .Body == nil {
185+ return Preendorsement {}, errors .New ("nil operation body" )
186+ }
187+ preendorsement , ok := op .Body .(Preendorsement )
188+ if ! ok {
189+ return Preendorsement {}, errors .Errorf ("invalid body type: %T" , op .Body )
190+ }
191+ return preendorsement , nil
192+ }
193+
161194// EndorsementWithSlot -
162195func (op Operation ) EndorsementWithSlot () (EndorsementWithSlot , error ) {
163196 if op .Kind != KindEndorsementWithSlot {
@@ -293,6 +326,21 @@ func (op Operation) SeedNonceRevelation() (SeedNonceRevelation, error) {
293326 return seed , nil
294327}
295328
329+ // SetDepositsLimit -
330+ func (op Operation ) SetDepositsLimit () (SetDepositsLimit , error ) {
331+ if op .Kind != KindSetDepositsLimit {
332+ return SetDepositsLimit {}, errors .Errorf ("invalid kind of operation: %s" , op .Kind )
333+ }
334+ if op .Body == nil {
335+ return SetDepositsLimit {}, errors .New ("nil operation body" )
336+ }
337+ tx , ok := op .Body .(SetDepositsLimit )
338+ if ! ok {
339+ return SetDepositsLimit {}, errors .Errorf ("invalid body type: %T" , op .Body )
340+ }
341+ return tx , nil
342+ }
343+
296344// Transaction -
297345func (op Operation ) Transaction () (Transaction , error ) {
298346 if op .Kind != KindTransaction {
@@ -336,6 +384,19 @@ type EndorsementWithSlot struct {
336384 Metadata * EndorsementMetadata `json:"metadata,omitempty"`
337385}
338386
387+ // Preendorsement -
388+ type Preendorsement struct {
389+ Slot uint64 `json:"slot"`
390+ Level uint64 `json:"level"`
391+ Round int64 `json:"round"`
392+ BlockPayloadHash string `json:"block_payload_hash"`
393+ Metadata struct {
394+ BalanceUpdates []interface {} `json:"balance_updates"`
395+ Delegate string `json:"delegate"`
396+ PreendorsementPower int `json:"preendorsement_power"`
397+ } `json:"metadata"`
398+ }
399+
339400// Delegation -
340401type Delegation struct {
341402 Source string `json:"source"`
@@ -356,8 +417,15 @@ type DoubleBakingEvidence struct {
356417
357418// DoubleEndorsementEvidence -
358419type DoubleEndorsementEvidence struct {
359- Op1 * InlinedEndorsement `json:"Op1"`
360- Op2 * InlinedEndorsement `json:"Op2"`
420+ Op1 * InlinedEndorsement `json:"op1"`
421+ Op2 * InlinedEndorsement `json:"op2"`
422+ Metadata * OnlyBalanceUpdatesMetadata `json:"metadata,omitempty"`
423+ }
424+
425+ // DoublePreendorsementEvidence -
426+ type DoublePreendorsementEvidence struct {
427+ Op1 * InlinedEndorsement `json:"op1"`
428+ Op2 * InlinedEndorsement `json:"op2"`
361429 Metadata * OnlyBalanceUpdatesMetadata `json:"metadata,omitempty"`
362430}
363431
@@ -410,6 +478,18 @@ type SeedNonceRevelation struct {
410478 Metadata * OnlyBalanceUpdatesMetadata `json:"metadata,omitempty"`
411479}
412480
481+ // SetDepositsLimit -
482+ type SetDepositsLimit struct {
483+ Kind string `json:"kind"`
484+ Source string `json:"source"`
485+ Fee string `json:"fee"`
486+ Counter string `json:"counter"`
487+ GasLimit string `json:"gas_limit"`
488+ StorageLimit string `json:"storage_limit"`
489+ Limit * string `json:"limit,omitempty"`
490+ Metadata * ManagerOperationMetadata `json:"metadata"`
491+ }
492+
413493// Transaction -
414494type Transaction struct {
415495 Source string `json:"source"`
@@ -597,6 +677,22 @@ type InlinedEndorsementOperations struct {
597677 Level int `json:"level"`
598678}
599679
680+ // InlinedPreendorsement -
681+ type InlinedPreendorsement struct {
682+ Branch string `json:"branch"`
683+ Operations * InlinedPreendorsementOperations `json:"operations,omitempty"`
684+ Signature string `json:"signature"`
685+ }
686+
687+ // InlinedPreendorsementOperations -
688+ type InlinedPreendorsementOperations struct {
689+ Kind string `json:"kind"`
690+ Slot uint64 `json:"slot"`
691+ Level uint64 `json:"level"`
692+ Round int64 `json:"round"`
693+ BlockPayloadHash string `json:"block_payload_hash"`
694+ }
695+
600696// EndorsementWithSlotEntity -
601697type EndorsementWithSlotEntity struct {
602698 Branch string `json:"branch"`
0 commit comments