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:
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user