1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 14:34:24 +08:00

routing: record validation into record/

This commit moves the record validation/verification
from dht/ into the new record/ packaage. Validator object
-- which is merely a map of ValidatorFuncs -- with a
VerifyRecord

cc @whyrusleeping
This commit is contained in:
Juan Batiz-Benet
2015-01-17 03:52:40 -08:00
committed by Jeromy
parent c01452e5ea
commit 56ae2fd0a8
6 changed files with 89 additions and 74 deletions

View File

@ -38,7 +38,7 @@ func setupDHT(ctx context.Context, t *testing.T) *IpfsDHT {
dss := dssync.MutexWrap(ds.NewMapDatastore())
d := NewDHT(ctx, h, dss)
d.Validators["v"] = func(u.Key, []byte) error {
d.Validator["v"] = func(u.Key, []byte) error {
return nil
}
return d
@ -142,8 +142,8 @@ func TestValueGetSet(t *testing.T) {
vf := func(u.Key, []byte) error {
return nil
}
dhtA.Validators["v"] = vf
dhtB.Validators["v"] = vf
dhtA.Validator["v"] = vf
dhtB.Validator["v"] = vf
connect(t, ctx, dhtA, dhtB)