Skip to content

Commit

Permalink
fix: use correct type for Byron address network ID
Browse files Browse the repository at this point in the history
  • Loading branch information
agaffney committed Jan 9, 2025
1 parent 474274b commit 192f949
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ledger/common/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ type byronAddressPayload struct {

type ByronAddressAttributes struct {
Payload []byte
Network *uint8
Network *uint64
}

func (a *ByronAddressAttributes) UnmarshalCBOR(data []byte) error {
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions ledger/common/address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down

0 comments on commit 192f949

Please sign in to comment.