Commit ce278c10 authored by Dirk McCormick's avatar Dirk McCormick Committed by Steven Allen

Just pass the record object to validation functions

parent 68064b25
...@@ -20,6 +20,7 @@ import ( ...@@ -20,6 +20,7 @@ import (
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-peer"
pstore "github.com/libp2p/go-libp2p-peerstore" pstore "github.com/libp2p/go-libp2p-peerstore"
record "github.com/libp2p/go-libp2p-record" record "github.com/libp2p/go-libp2p-record"
recpb "github.com/libp2p/go-libp2p-record/pb"
bhost "github.com/libp2p/go-libp2p/p2p/host/basic" bhost "github.com/libp2p/go-libp2p/p2p/host/basic"
ci "github.com/libp2p/go-testutil/ci" ci "github.com/libp2p/go-testutil/ci"
travisci "github.com/libp2p/go-testutil/ci/travis" travisci "github.com/libp2p/go-testutil/ci/travis"
...@@ -50,7 +51,7 @@ func setupDHT(ctx context.Context, t *testing.T, client bool) *IpfsDHT { ...@@ -50,7 +51,7 @@ func setupDHT(ctx context.Context, t *testing.T, client bool) *IpfsDHT {
} }
d.Validator["v"] = &record.ValidChecker{ d.Validator["v"] = &record.ValidChecker{
Func: func(string, []byte) error { Func: func(*recpb.Record) error {
return nil return nil
}, },
Sign: false, Sign: false,
...@@ -150,7 +151,7 @@ func TestValueGetSet(t *testing.T) { ...@@ -150,7 +151,7 @@ func TestValueGetSet(t *testing.T) {
defer dhtB.host.Close() defer dhtB.host.Close()
vf := &record.ValidChecker{ vf := &record.ValidChecker{
Func: func(string, []byte) error { return nil }, Func: func(*recpb.Record) error { return nil },
Sign: false, Sign: false,
} }
nulsel := func(_ string, bs [][]byte) (int, error) { return 0, nil } nulsel := func(_ string, bs [][]byte) (int, error) { return 0, nil }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment