Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct type for Byron address network ID #827

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 *uint32
}

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 uint32
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 uint32
Network: func() *uint32 { ret := uint32(2); return &ret }(),
},
expectedAddress: "FHnt4NL7yPXvDWHa8bVs73UEUdJd64VxWXSFNqetECtYfTd9TtJguJ14Lu3feth",
},
Expand Down
Loading