Skip to content

Commit

Permalink
p2p/enode: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed May 30, 2024
1 parent b63b67d commit df945f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion p2p/enode/nodedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ func TestDBNodeKey(t *testing.T) {

func TestDBNodeItemKey(t *testing.T) {
wantIP := netip.MustParseAddr("127.0.0.3")
wantIP4in6 := netip.AddrFrom16(wantIP.As16())
wantField := "foobar"

enc := nodeItemKey(keytestID, wantIP, wantField)
want := []byte{
'n', ':',
Expand All @@ -70,7 +72,7 @@ func TestDBNodeItemKey(t *testing.T) {
if id != keytestID {
t.Errorf("splitNodeItemKey returned wrong ID: %v", id)
}
if ip != wantIP {
if ip != wantIP4in6 {
t.Errorf("splitNodeItemKey returned wrong IP: %v", ip)
}
if field != wantField {
Expand Down

0 comments on commit df945f7

Please sign in to comment.