From 30d1543431a07f203c4dd69dea32eff54d4a38b4 Mon Sep 17 00:00:00 2001 From: Aurora Gaffney Date: Tue, 15 Apr 2025 07:22:01 -0400 Subject: [PATCH] fix: save original CBOR after decoding in BabbageTransactionOutput Signed-off-by: Aurora Gaffney --- ledger/babbage/babbage.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ledger/babbage/babbage.go b/ledger/babbage/babbage.go index f42ac70f..e0b171c3 100644 --- a/ledger/babbage/babbage.go +++ b/ledger/babbage/babbage.go @@ -425,8 +425,6 @@ type BabbageTransactionOutput struct { } func (o *BabbageTransactionOutput) UnmarshalCBOR(cborData []byte) error { - // Save original CBOR - o.SetCbor(cborData) // Try to parse as legacy output first var tmpOutput alonzo.AlonzoTransactionOutput if _, err := cbor.Decode(cborData, &tmpOutput); err == nil { @@ -442,6 +440,8 @@ func (o *BabbageTransactionOutput) UnmarshalCBOR(cborData []byte) error { } *o = BabbageTransactionOutput(tmp) } + // Save original CBOR + o.SetCbor(cborData) return nil }