Skip to content

Commit 861cf60

Browse files
authored
fix: use correct type for Byron address network ID (#827)
1 parent 474274b commit 861cf60

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ledger/common/address.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ type byronAddressPayload struct {
425425

426426
type ByronAddressAttributes struct {
427427
Payload []byte
428-
Network *uint8
428+
Network *uint32
429429
}
430430

431431
func (a *ByronAddressAttributes) UnmarshalCBOR(data []byte) error {
@@ -438,7 +438,7 @@ func (a *ByronAddressAttributes) UnmarshalCBOR(data []byte) error {
438438
}
439439
a.Payload = tmpData.Payload
440440
if len(tmpData.NetworkRaw) > 0 {
441-
var tmpNetwork uint8
441+
var tmpNetwork uint32
442442
if _, err := cbor.Decode(tmpData.NetworkRaw, &tmpNetwork); err != nil {
443443
return err
444444
}

ledger/common/address_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ func TestByronAddressFromParts(t *testing.T) {
181181
"5d5e698eba3dd9452add99a1af9461beb0ba61b8bece26e7399878dd",
182182
),
183183
addressAttr: ByronAddressAttributes{
184-
// We have to jump through this hoop to get an inline pointer to a uint8
185-
Network: func() *uint8 { ret := uint8(2); return &ret }(),
184+
// We have to jump through this hoop to get an inline pointer to a uint32
185+
Network: func() *uint32 { ret := uint32(2); return &ret }(),
186186
},
187187
expectedAddress: "FHnt4NL7yPXvDWHa8bVs73UEUdJd64VxWXSFNqetECtYfTd9TtJguJ14Lu3feth",
188188
},

0 commit comments

Comments
 (0)