diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2018-11-08 03:39:08 +0800 |
---|---|---|
committer | Viktor TrĂ³n <viktor.tron@gmail.com> | 2018-11-08 03:39:08 +0800 |
commit | cf3b187bdef59078ba6570a2f5ee046ab87bcefd (patch) | |
tree | fbc16d9216df0d32e745f88cb3ac22e6dab256bf /swarm/pss | |
parent | 81533deae5ee4a7ec08842e2b6647f3affde5a71 (diff) | |
download | go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.gz go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.bz2 go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.lz go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.xz go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.zst go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.zip |
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
Diffstat (limited to 'swarm/pss')
-rw-r--r-- | swarm/pss/client/client_test.go | 6 | ||||
-rw-r--r-- | swarm/pss/notify/notify_test.go | 6 | ||||
-rw-r--r-- | swarm/pss/protocol_test.go | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/swarm/pss/client/client_test.go b/swarm/pss/client/client_test.go index cfef3c794..8f2f0e805 100644 --- a/swarm/pss/client/client_test.go +++ b/swarm/pss/client/client_test.go @@ -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) diff --git a/swarm/pss/notify/notify_test.go b/swarm/pss/notify/notify_test.go index 675b41ada..d4d383a6b 100644 --- a/swarm/pss/notify/notify_test.go +++ b/swarm/pss/notify/notify_test.go @@ -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 diff --git a/swarm/pss/protocol_test.go b/swarm/pss/protocol_test.go index f4209fea5..4ef3e90a0 100644 --- a/swarm/pss/protocol_test.go +++ b/swarm/pss/protocol_test.go @@ -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 |