From 192f949726e022376bf2ddff46ee8bb1d6e61895 Mon Sep 17 00:00:00 2001 From: Aurora Gaffney Date: Thu, 9 Jan 2025 17:11:18 -0600 Subject: [PATCH] fix: use correct type for Byron address network ID --- ledger/common/address.go | 4 ++-- ledger/common/address_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ledger/common/address.go b/ledger/common/address.go index cad37c59..3921ad7e 100644 --- a/ledger/common/address.go +++ b/ledger/common/address.go @@ -425,7 +425,7 @@ type byronAddressPayload struct { type ByronAddressAttributes struct { Payload []byte - Network *uint8 + Network *uint64 } func (a *ByronAddressAttributes) UnmarshalCBOR(data []byte) error { @@ -438,7 +438,7 @@ func (a *ByronAddressAttributes) UnmarshalCBOR(data []byte) error { } a.Payload = tmpData.Payload if len(tmpData.NetworkRaw) > 0 { - var tmpNetwork uint8 + var tmpNetwork uint64 if _, err := cbor.Decode(tmpData.NetworkRaw, &tmpNetwork); err != nil { return err } diff --git a/ledger/common/address_test.go b/ledger/common/address_test.go index 7fc3200f..dfa9717a 100644 --- a/ledger/common/address_test.go +++ b/ledger/common/address_test.go @@ -181,8 +181,8 @@ func TestByronAddressFromParts(t *testing.T) { "5d5e698eba3dd9452add99a1af9461beb0ba61b8bece26e7399878dd", ), addressAttr: ByronAddressAttributes{ - // We have to jump through this hoop to get an inline pointer to a uint8 - Network: func() *uint8 { ret := uint8(2); return &ret }(), + // We have to jump through this hoop to get an inline pointer to a uint64 + Network: func() *uint64 { ret := uint64(2); return &ret }(), }, expectedAddress: "FHnt4NL7yPXvDWHa8bVs73UEUdJd64VxWXSFNqetECtYfTd9TtJguJ14Lu3feth", },