Skip to content

Commit b9a3d41

Browse files
authored
fix: add missing UnmarshalCBOR function for protocol param updates (#750)
1 parent a13f579 commit b9a3d41

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

ledger/allegra/pparams.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ func (p *AllegraProtocolParameters) Update(paramUpdate *AllegraProtocolParameter
2929
type AllegraProtocolParameterUpdate struct {
3030
shelley.ShelleyProtocolParameterUpdate
3131
}
32+
33+
func (u *AllegraProtocolParameterUpdate) UnmarshalCBOR(data []byte) error {
34+
return u.UnmarshalCbor(data, u)
35+
}

ledger/alonzo/alonzo.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@ type AlonzoProtocolParameterUpdate struct {
513513
MaxCollateralInputs uint `cbor:"24,keyasint"`
514514
}
515515

516+
func (u *AlonzoProtocolParameterUpdate) UnmarshalCBOR(data []byte) error {
517+
return u.UnmarshalCbor(data, u)
518+
}
519+
516520
func NewAlonzoBlockFromCbor(data []byte) (*AlonzoBlock, error) {
517521
var alonzoBlock AlonzoBlock
518522
if _, err := cbor.Decode(data, &alonzoBlock); err != nil {

ledger/conway/conway.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ type ConwayProtocolParameterUpdate struct {
279279
MinFeeRefScriptCostPerByte *cbor.Rat `cbor:"33,keyasint"`
280280
}
281281

282+
func (u *ConwayProtocolParameterUpdate) UnmarshalCBOR(data []byte) error {
283+
return u.UnmarshalCbor(data, u)
284+
}
285+
282286
type PoolVotingThresholds struct {
283287
cbor.StructAsArray
284288
MotionNoConfidence cbor.Rat

ledger/mary/pparams.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ func (p *MaryProtocolParameters) Update(paramUpdate *MaryProtocolParameterUpdate
2929
type MaryProtocolParameterUpdate struct {
3030
allegra.AllegraProtocolParameterUpdate
3131
}
32+
33+
func (u *MaryProtocolParameterUpdate) UnmarshalCBOR(data []byte) error {
34+
return u.UnmarshalCbor(data, u)
35+
}

0 commit comments

Comments
 (0)