Skip to content

Commit 7d4fc0b

Browse files
authored
fix: save original CBOR after decoding in BabbageTransactionOutput (#987)
Signed-off-by: Aurora Gaffney <[email protected]>
1 parent 62b227b commit 7d4fc0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ledger/babbage/babbage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,6 @@ type BabbageTransactionOutput struct {
425425
}
426426

427427
func (o *BabbageTransactionOutput) UnmarshalCBOR(cborData []byte) error {
428-
// Save original CBOR
429-
o.SetCbor(cborData)
430428
// Try to parse as legacy output first
431429
var tmpOutput alonzo.AlonzoTransactionOutput
432430
if _, err := cbor.Decode(cborData, &tmpOutput); err == nil {
@@ -442,6 +440,8 @@ func (o *BabbageTransactionOutput) UnmarshalCBOR(cborData []byte) error {
442440
}
443441
*o = BabbageTransactionOutput(tmp)
444442
}
443+
// Save original CBOR
444+
o.SetCbor(cborData)
445445
return nil
446446
}
447447

0 commit comments

Comments
 (0)