Skip to content

Commit 4f0812b

Browse files
authored
fix: CBOR marshaling for Byron addresses (#822)
Fixes #821
1 parent aec8e08 commit 4f0812b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ledger/common/address.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ func (a *Address) UnmarshalCBOR(data []byte) error {
179179
}
180180

181181
func (a *Address) MarshalCBOR() ([]byte, error) {
182-
return cbor.Encode(a.Bytes())
182+
addrBytes := a.Bytes()
183+
if a.addressType == AddressTypeByron {
184+
return addrBytes, nil
185+
}
186+
return cbor.Encode(addrBytes)
183187
}
184188

185189
// PaymentAddress returns a new Address with only the payment address portion. This will return nil for anything other than payment and script addresses

0 commit comments

Comments
 (0)