swarm, cmd/swarm: address ineffectual assignments (#18048)

* swarm, cmd/swarm: address ineffectual assignments

* swarm/network: remove unused vars from testHandshake

* swarm/storage/feed: revert cursor changes
This commit is contained in:
Anton Evangelatov
2018-11-07 20:39:08 +01:00
committed by Viktor Trón
parent 81533deae5
commit cf3b187bde
20 changed files with 61 additions and 24 deletions

View File

@@ -252,7 +252,13 @@ func newServices() adapters.Services {
ctxlocal, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
keys, err := wapi.NewKeyPair(ctxlocal)
if err != nil {
return nil, err
}
privkey, err := w.GetPrivateKey(keys)
if err != nil {
return nil, err
}
psparams := pss.NewPssParams().WithPrivateKey(privkey)
pskad := kademlia(ctx.Config.ID)
ps, err := pss.NewPss(pskad, psparams)

View File

@@ -223,7 +223,13 @@ func newServices(allowRaw bool) adapters.Services {
ctxlocal, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
keys, err := wapi.NewKeyPair(ctxlocal)
if err != nil {
return nil, err
}
privkey, err := w.GetPrivateKey(keys)
if err != nil {
return nil, err
}
pssp := pss.NewPssParams().WithPrivateKey(privkey)
pssp.MsgTTL = time.Second * 30
pssp.AllowRaw = allowRaw

View File

@@ -93,11 +93,17 @@ func testProtocol(t *testing.T) {
lctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
lsub, err := clients[0].Subscribe(lctx, "pss", lmsgC, "receive", topic)
if err != nil {
t.Fatal(err)
}
defer lsub.Unsubscribe()
rmsgC := make(chan APIMsg)
rctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
rsub, err := clients[1].Subscribe(rctx, "pss", rmsgC, "receive", topic)
if err != nil {
t.Fatal(err)
}
defer rsub.Unsubscribe()
// set reciprocal public keys