Skip to content

Commit

Permalink
fix: add missing UnmarshalCBOR function for protocol param updates (#750
Browse files Browse the repository at this point in the history
)
  • Loading branch information
agaffney authored Oct 8, 2024
1 parent a13f579 commit b9a3d41
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ledger/allegra/pparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ func (p *AllegraProtocolParameters) Update(paramUpdate *AllegraProtocolParameter
type AllegraProtocolParameterUpdate struct {
shelley.ShelleyProtocolParameterUpdate
}

func (u *AllegraProtocolParameterUpdate) UnmarshalCBOR(data []byte) error {
return u.UnmarshalCbor(data, u)
}
4 changes: 4 additions & 0 deletions ledger/alonzo/alonzo.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ type AlonzoProtocolParameterUpdate struct {
MaxCollateralInputs uint `cbor:"24,keyasint"`
}

func (u *AlonzoProtocolParameterUpdate) UnmarshalCBOR(data []byte) error {
return u.UnmarshalCbor(data, u)
}

func NewAlonzoBlockFromCbor(data []byte) (*AlonzoBlock, error) {
var alonzoBlock AlonzoBlock
if _, err := cbor.Decode(data, &alonzoBlock); err != nil {
Expand Down
4 changes: 4 additions & 0 deletions ledger/conway/conway.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ type ConwayProtocolParameterUpdate struct {
MinFeeRefScriptCostPerByte *cbor.Rat `cbor:"33,keyasint"`
}

func (u *ConwayProtocolParameterUpdate) UnmarshalCBOR(data []byte) error {
return u.UnmarshalCbor(data, u)
}

type PoolVotingThresholds struct {
cbor.StructAsArray
MotionNoConfidence cbor.Rat
Expand Down
4 changes: 4 additions & 0 deletions ledger/mary/pparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ func (p *MaryProtocolParameters) Update(paramUpdate *MaryProtocolParameterUpdate
type MaryProtocolParameterUpdate struct {
allegra.AllegraProtocolParameterUpdate
}

func (u *MaryProtocolParameterUpdate) UnmarshalCBOR(data []byte) error {
return u.UnmarshalCbor(data, u)
}

0 comments on commit b9a3d41

Please sign in to comment.