From 4c393ca12e1ff6dddfd5df40ff93c7ed00f09fb9 Mon Sep 17 00:00:00 2001 From: Aurora Gaffney Date: Mon, 6 Jan 2025 16:13:12 -0600 Subject: [PATCH] fix: CBOR marshaling for Byron addresses Fixes #821 --- ledger/common/address.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ledger/common/address.go b/ledger/common/address.go index 8a67d641..a013c944 100644 --- a/ledger/common/address.go +++ b/ledger/common/address.go @@ -179,7 +179,11 @@ func (a *Address) UnmarshalCBOR(data []byte) error { } func (a *Address) MarshalCBOR() ([]byte, error) { - return cbor.Encode(a.Bytes()) + addrBytes := a.Bytes() + if a.addressType == AddressTypeByron { + return addrBytes, nil + } + return cbor.Encode(addrBytes) } // PaymentAddress returns a new Address with only the payment address portion. This will return nil for anything other than payment and script addresses