Skip to content

Commit 592fe59

Browse files
committed
pr review changes
1 parent 86a3cd7 commit 592fe59

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

pss/client/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"context"
2222
"flag"
2323
"fmt"
24-
"github.com/ethersphere/swarm/pss/crypto"
2524
"math/rand"
2625
"os"
2726
"testing"
@@ -37,6 +36,7 @@ import (
3736
"github.com/ethereum/go-ethereum/rpc"
3837
"github.com/ethersphere/swarm/network"
3938
"github.com/ethersphere/swarm/pss"
39+
"github.com/ethersphere/swarm/pss/crypto"
4040
"github.com/ethersphere/swarm/state"
4141
)
4242

pss/notify/notify_test.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,26 @@ import (
55
"context"
66
"flag"
77
"fmt"
8-
crypto2 "github.com/ethersphere/swarm/pss/crypto"
98
"os"
109
"testing"
1110
"time"
1211

1312
"github.com/ethereum/go-ethereum/common/hexutil"
14-
1513
"github.com/ethereum/go-ethereum/log"
1614
"github.com/ethereum/go-ethereum/node"
1715
"github.com/ethereum/go-ethereum/p2p/enode"
1816
"github.com/ethereum/go-ethereum/p2p/simulations"
1917
"github.com/ethereum/go-ethereum/p2p/simulations/adapters"
2018
"github.com/ethersphere/swarm/network"
2119
"github.com/ethersphere/swarm/pss"
20+
"github.com/ethersphere/swarm/pss/crypto"
2221
"github.com/ethersphere/swarm/state"
2322
)
2423

2524
var (
26-
loglevel = flag.Int("loglevel", 3, "logging verbosity")
27-
psses map[string]*pss.Pss
28-
cryptoUtils crypto2.CryptoUtils
29-
crypto crypto2.CryptoBackend
25+
loglevel = flag.Int("loglevel", 3, "logging verbosity")
26+
psses map[string]*pss.Pss
27+
cryptoB crypto.Crypto
3028
)
3129

3230
func init() {
@@ -36,8 +34,7 @@ func init() {
3634
h := log.CallerFileHandler(hf)
3735
log.Root().SetHandler(h)
3836

39-
cryptoUtils = crypto2.NewCryptoUtils()
40-
crypto = pss.NewCryptoBackend()
37+
cryptoB = crypto.New()
4138
psses = make(map[string]*pss.Pss)
4239
}
4340

@@ -138,7 +135,7 @@ func TestStart(t *testing.T) {
138135
if err != nil {
139136
t.Fatal(err)
140137
}
141-
pubkey, err := crypto.UnmarshalPubkey(pubkeybytes)
138+
pubkey, err := cryptoB.UnmarshalPubkey(pubkeybytes)
142139
if err != nil {
143140
t.Fatal(err)
144141
}
@@ -230,11 +227,11 @@ func newServices(allowRaw bool) adapters.Services {
230227
"pss": func(ctx *adapters.ServiceContext) (node.Service, error) {
231228
ctxlocal, cancel := context.WithTimeout(context.Background(), time.Second)
232229
defer cancel()
233-
keys, err := cryptoUtils.NewKeyPair(ctxlocal)
230+
keys, err := cryptoB.NewKeyPair(ctxlocal)
234231
if err != nil {
235232
return nil, err
236233
}
237-
privkey, err := cryptoUtils.GetPrivateKey(keys)
234+
privkey, err := cryptoB.GetPrivateKey(keys)
238235
if err != nil {
239236
return nil, err
240237
}
@@ -246,7 +243,7 @@ func newServices(allowRaw bool) adapters.Services {
246243
if err != nil {
247244
return nil, err
248245
}
249-
psses[hexutil.Encode(crypto.FromECDSAPub(&privkey.PublicKey))] = ps
246+
psses[hexutil.Encode(cryptoB.FromECDSAPub(&privkey.PublicKey))] = ps
250247
return ps, nil
251248
},
252249
"bzz": func(ctx *adapters.ServiceContext) (node.Service, error) {

pss/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func BytesToTopic(b []byte) Topic {
228228
return toTopic(topicHashFunc.Sum(nil))
229229
}
230230

231-
// BytesToTopic converts from the byte array representation of a topic
231+
// toTopic converts from the byte array representation of a topic
232232
// into the TopicType type.
233233
func toTopic(b []byte) (t Topic) {
234234
sz := TopicLength

0 commit comments

Comments
 (0)