Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ledger/alonzo/alonzo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
12 changes: 11 additions & 1 deletion ledger/babbage/babbage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 4 additions & 0 deletions ledger/byron/byron.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions ledger/common/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type TransactionOutput interface {
DatumHash() *Blake2b256
Cbor() []byte
Utxorpc() (*utxorpc.TxOutput, error)
ScriptRef() *cbor.LazyValue
}

type TransactionWitnessSet interface {
Expand Down
4 changes: 4 additions & 0 deletions ledger/mary/mary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 4 additions & 0 deletions ledger/shelley/shelley.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading