diff --git a/types/peer_info.go b/types/peer_info.go index f923da333..547fc329c 100644 --- a/types/peer_info.go +++ b/types/peer_info.go @@ -22,5 +22,5 @@ type PeerInfo struct { Roles Text ProtocolVersion U32 BestHash Hash - BestNumber BlockNumber + BestNumber U32 } diff --git a/types/peer_info_test.go b/types/peer_info_test.go index 9e195e949..ac9e87f9e 100644 --- a/types/peer_info_test.go +++ b/types/peer_info_test.go @@ -34,17 +34,23 @@ func TestPeerInfo_EncodeDecode(t *testing.T) { assertRoundtrip(t, testPeerInfo) assertRoundTripFuzz[PeerInfo](t, 100) assertDecodeNilData[PeerInfo](t) - assertEncodeEmptyObj[PeerInfo](t, 39) + assertEncodeEmptyObj[PeerInfo](t, 42) } func TestPeerInfo_Encode(t *testing.T) { assertEncode(t, []encodingAssert{ - {testPeerInfo, MustHexDecodeString("0x20616263313233343528736f6d6520726f6c65737b000000abcd000000000000000000000000000000000000000000000000000000000000e514")}, //nolint:lll + { + testPeerInfo, + MustHexDecodeString("0x20616263313233343528736f6d6520726f6c65737b000000abcd00000000000000000000000000000000000000000000000000000000000039050000"), + }, }) } func TestPeerInfo_Decode(t *testing.T) { assertDecode(t, []decodingAssert{ - {MustHexDecodeString("0x20616263313233343528736f6d6520726f6c65737b000000abcd000000000000000000000000000000000000000000000000000000000000e514"), testPeerInfo}, //nolint:lll + { + MustHexDecodeString("0x20616263313233343528736f6d6520726f6c65737b000000abcd00000000000000000000000000000000000000000000000000000000000039050000"), + testPeerInfo, + }, }) }