File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -456,6 +456,12 @@ func (o *BabbageTransactionOutput) UnmarshalCBOR(cborData []byte) error {
456456 // Copy from temp legacy object to Babbage format
457457 o .OutputAddress = tmpOutput .OutputAddress
458458 o .OutputAmount = tmpOutput .OutputAmount
459+ // Copy datum hash if present in legacy Alonzo output
460+ if tmpOutput .OutputDatumHash != nil {
461+ o .DatumOption = & BabbageTransactionOutputDatumOption {
462+ hash : tmpOutput .OutputDatumHash ,
463+ }
464+ }
459465 o .legacyOutput = true
460466 } else {
461467 type tBabbageTransactionOutput BabbageTransactionOutput
@@ -476,6 +482,10 @@ func (o *BabbageTransactionOutput) MarshalCBOR() ([]byte, error) {
476482 OutputAddress : o .OutputAddress ,
477483 OutputAmount : o .OutputAmount ,
478484 }
485+ // Copy datum hash if present
486+ if o .DatumOption != nil && o .DatumOption .hash != nil {
487+ tmpOutput .OutputDatumHash = o .DatumOption .hash
488+ }
479489 return cbor .Encode (& tmpOutput )
480490 }
481491 return cbor .EncodeGeneric (o )
You can’t perform that action at this time.
0 commit comments