diff --git a/ledger/alonzo/alonzo.go b/ledger/alonzo/alonzo.go index 6a483234..c83c7104 100644 --- a/ledger/alonzo/alonzo.go +++ b/ledger/alonzo/alonzo.go @@ -324,6 +324,10 @@ func (o AlonzoTransactionOutput) Address() common.Address { return o.OutputAddress } +func (o AlonzoTransactionOutput) ScriptRef() *cbor.LazyValue { + return nil +} + func (o AlonzoTransactionOutput) Amount() uint64 { return o.OutputAmount.Amount } diff --git a/ledger/babbage/babbage.go b/ledger/babbage/babbage.go index e0e758b7..0af3d3a1 100644 --- a/ledger/babbage/babbage.go +++ b/ledger/babbage/babbage.go @@ -423,7 +423,7 @@ type BabbageTransactionOutput struct { OutputAddress common.Address `cbor:"0,keyasint,omitempty"` OutputAmount mary.MaryTransactionOutputValue `cbor:"1,keyasint,omitempty"` DatumOption *BabbageTransactionOutputDatumOption `cbor:"2,keyasint,omitempty"` - ScriptRef *cbor.Tag `cbor:"3,keyasint,omitempty"` + TxScriptRef *cbor.Tag `cbor:"3,keyasint,omitempty"` legacyOutput bool } @@ -486,6 +486,16 @@ func (o BabbageTransactionOutput) Address() common.Address { return o.OutputAddress } +func (o BabbageTransactionOutput) ScriptRef() *cbor.LazyValue { + if o.TxScriptRef == nil { + return nil + } + if lazyVal, ok := o.TxScriptRef.Content.(*cbor.LazyValue); ok { + return lazyVal + } + return nil +} + func (o BabbageTransactionOutput) Amount() uint64 { return o.OutputAmount.Amount } diff --git a/ledger/byron/byron.go b/ledger/byron/byron.go index 8f2dc04f..65756231 100644 --- a/ledger/byron/byron.go +++ b/ledger/byron/byron.go @@ -414,6 +414,10 @@ func (o ByronTransactionOutput) Address() common.Address { return o.OutputAddress } +func (o ByronTransactionOutput) ScriptRef() *cbor.LazyValue { + return nil +} + func (o ByronTransactionOutput) Amount() uint64 { return o.OutputAmount } diff --git a/ledger/common/tx.go b/ledger/common/tx.go index 78aa48df..388317dd 100644 --- a/ledger/common/tx.go +++ b/ledger/common/tx.go @@ -71,6 +71,7 @@ type TransactionOutput interface { DatumHash() *Blake2b256 Cbor() []byte Utxorpc() (*utxorpc.TxOutput, error) + ScriptRef() *cbor.LazyValue } type TransactionWitnessSet interface { diff --git a/ledger/mary/mary.go b/ledger/mary/mary.go index 729ef33b..99b6c389 100644 --- a/ledger/mary/mary.go +++ b/ledger/mary/mary.go @@ -446,6 +446,10 @@ func (o MaryTransactionOutput) Address() common.Address { return o.OutputAddress } +func (txo MaryTransactionOutput) ScriptRef() *cbor.LazyValue { + return nil +} + func (o MaryTransactionOutput) Amount() uint64 { return o.OutputAmount.Amount } diff --git a/ledger/shelley/shelley.go b/ledger/shelley/shelley.go index 1df99bd5..858f5e11 100644 --- a/ledger/shelley/shelley.go +++ b/ledger/shelley/shelley.go @@ -388,6 +388,10 @@ func (o ShelleyTransactionOutput) Address() common.Address { return o.OutputAddress } +func (o ShelleyTransactionOutput) ScriptRef() *cbor.LazyValue { + return nil +} + func (o ShelleyTransactionOutput) Amount() uint64 { return o.OutputAmount }