diff --git a/ledger/mary.go b/ledger/mary.go index db250408..3c676625 100644 --- a/ledger/mary.go +++ b/ledger/mary.go @@ -39,7 +39,7 @@ type MaryBlock struct { cbor.DecodeStoreCbor Header *MaryBlockHeader TransactionBodies []MaryTransactionBody - TransactionWitnessSets []ShelleyTransactionWitnessSet + TransactionWitnessSets []MaryTransactionWitnessSet TransactionMetadataSet map[uint]*cbor.Value } @@ -115,6 +115,11 @@ func (h *MaryBlockHeader) Era() Era { type MaryTransactionBody struct { AllegraTransactionBody + Update struct { + cbor.StructAsArray + ProtocolParamUpdates map[Blake2b224]MaryProtocolParameterUpdate + Epoch uint64 + } `cbor:"6,keyasint,omitempty"` TxOutputs []MaryTransactionOutput `cbor:"1,keyasint,omitempty"` Mint MultiAsset[MultiAssetTypeMint] `cbor:"9,keyasint,omitempty"` } @@ -136,10 +141,16 @@ type MaryTransaction struct { cbor.StructAsArray cbor.DecodeStoreCbor Body MaryTransactionBody - WitnessSet ShelleyTransactionWitnessSet + WitnessSet MaryTransactionWitnessSet TxMetadata *cbor.Value } +type MaryTransactionWitnessSet struct { + ShelleyTransactionWitnessSet + Script []interface{} `cbor:"4,keyasint,omitempty"` + PlutusScripts []interface{} `cbor:"5,keyasint,omitempty"` +} + func (t MaryTransaction) Hash() string { return t.Body.Hash() } @@ -275,6 +286,14 @@ func (v *MaryTransactionOutputValue) MarshalCBOR() ([]byte, error) { } } +type MaryProtocolParameters struct { + AllegraProtocolParameters +} + +type MaryProtocolParameterUpdate struct { + AllegraProtocolParameterUpdate +} + func NewMaryBlockFromCbor(data []byte) (*MaryBlock, error) { var maryBlock MaryBlock if _, err := cbor.Decode(data, &maryBlock); err != nil { diff --git a/protocol/localstatequery/client.go b/protocol/localstatequery/client.go index 8c35293b..f858d7c2 100644 --- a/protocol/localstatequery/client.go +++ b/protocol/localstatequery/client.go @@ -354,6 +354,12 @@ func (c *Client) GetCurrentProtocolParams() (CurrentProtocolParamsResult, error) return nil, err } return result[0], nil + case ledger.EraIdMary: + result := []ledger.MaryProtocolParameters{} + if err := c.runQuery(query, &result); err != nil { + return nil, err + } + return result[0], nil case ledger.EraIdAllegra: result := []ledger.AllegraProtocolParameters{} if err := c.runQuery(query, &result); err != nil {