Skip to content

Commit dee2d63

Browse files
authored
peerInfo: Use U32 instead of BlockNumber (#288)
1 parent 77783c7 commit dee2d63

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

types/peer_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ type PeerInfo struct {
2222
Roles Text
2323
ProtocolVersion U32
2424
BestHash Hash
25-
BestNumber BlockNumber
25+
BestNumber U32
2626
}

types/peer_info_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,23 @@ func TestPeerInfo_EncodeDecode(t *testing.T) {
3434
assertRoundtrip(t, testPeerInfo)
3535
assertRoundTripFuzz[PeerInfo](t, 100)
3636
assertDecodeNilData[PeerInfo](t)
37-
assertEncodeEmptyObj[PeerInfo](t, 39)
37+
assertEncodeEmptyObj[PeerInfo](t, 42)
3838
}
3939

4040
func TestPeerInfo_Encode(t *testing.T) {
4141
assertEncode(t, []encodingAssert{
42-
{testPeerInfo, MustHexDecodeString("0x20616263313233343528736f6d6520726f6c65737b000000abcd000000000000000000000000000000000000000000000000000000000000e514")}, //nolint:lll
42+
{
43+
testPeerInfo,
44+
MustHexDecodeString("0x20616263313233343528736f6d6520726f6c65737b000000abcd00000000000000000000000000000000000000000000000000000000000039050000"),
45+
},
4346
})
4447
}
4548

4649
func TestPeerInfo_Decode(t *testing.T) {
4750
assertDecode(t, []decodingAssert{
48-
{MustHexDecodeString("0x20616263313233343528736f6d6520726f6c65737b000000abcd000000000000000000000000000000000000000000000000000000000000e514"), testPeerInfo}, //nolint:lll
51+
{
52+
MustHexDecodeString("0x20616263313233343528736f6d6520726f6c65737b000000abcd00000000000000000000000000000000000000000000000000000000000039050000"),
53+
testPeerInfo,
54+
},
4955
})
5056
}

0 commit comments

Comments
 (0)