@@ -175,7 +175,7 @@ type ShelleyTransactionBody struct {
175175 Withdrawals cbor.Value `cbor:"5,keyasint,omitempty"`
176176 Update struct {
177177 cbor.StructAsArray
178- ProtocolParamUpdates cbor. Value
178+ ProtocolParamUpdates map [ Blake2b224 ] ShelleyProtocolParameterUpdate
179179 Epoch uint64
180180 } `cbor:"6,keyasint,omitempty"`
181181 MetadataHash Blake2b256 `cbor:"7,keyasint,omitempty"`
@@ -397,6 +397,50 @@ func (t *ShelleyTransaction) Cbor() []byte {
397397 return cborData
398398}
399399
400+ type ShelleyProtocolParameters struct {
401+ cbor.StructAsArray
402+ MinFeeA uint
403+ MinFeeB uint
404+ MaxBlockBodySize uint
405+ MaxTxSize uint
406+ MaxBlockHeaderSize uint
407+ KeyDeposit uint
408+ PoolDeposit uint
409+ MaxEpoch uint
410+ NOpt uint
411+ A0 * cbor.Rat
412+ Rho * cbor.Rat
413+ Tau * cbor.Rat
414+ Decentralization * cbor.Rat
415+ Nonce * cbor.Rat
416+ ProtocolMajor uint
417+ ProtocolMinor uint
418+ MinUtxoValue uint
419+ }
420+
421+ type ShelleyProtocolParameterUpdate struct {
422+ MinFeeA uint `cbor:"0,keyasint"`
423+ MinFeeB uint `cbor:"1,keyasint"`
424+ MaxBlockBodySize uint `cbor:"2,keyasint"`
425+ MaxTxSize uint `cbor:"3,keyasint"`
426+ MaxBlockHeaderSize uint `cbor:"4,keyasint"`
427+ KeyDeposit uint `cbor:"5,keyasint"`
428+ PoolDeposit uint `cbor:"6,keyasint"`
429+ MaxEpoch uint `cbor:"7,keyasint"`
430+ NOpt uint `cbor:"8,keyasint"`
431+ A0 * cbor.Rat `cbor:"9,keyasint"`
432+ Rho * cbor.Rat `cbor:"10,keyasint"`
433+ Tau * cbor.Rat `cbor:"11,keyasint"`
434+ Decentralization * cbor.Rat `cbor:"12,keyasint"`
435+ Nonce * cbor.Rat `cbor:"13,keyasint"`
436+ ProtocolVersion struct {
437+ cbor.StructAsArray
438+ Major uint
439+ Minor uint
440+ } `cbor:"14,keyasint"`
441+ MinUtxoValue uint `cbor:"15,keyasint"`
442+ }
443+
400444func NewShelleyBlockFromCbor (data []byte ) (* ShelleyBlock , error ) {
401445 var shelleyBlock ShelleyBlock
402446 if _ , err := cbor .Decode (data , & shelleyBlock ); err != nil {
0 commit comments