@@ -5,28 +5,26 @@ import (
5
5
"context"
6
6
"flag"
7
7
"fmt"
8
- crypto2 "github.com/ethersphere/swarm/pss/crypto"
9
8
"os"
10
9
"testing"
11
10
"time"
12
11
13
12
"github.com/ethereum/go-ethereum/common/hexutil"
14
-
15
13
"github.com/ethereum/go-ethereum/log"
16
14
"github.com/ethereum/go-ethereum/node"
17
15
"github.com/ethereum/go-ethereum/p2p/enode"
18
16
"github.com/ethereum/go-ethereum/p2p/simulations"
19
17
"github.com/ethereum/go-ethereum/p2p/simulations/adapters"
20
18
"github.com/ethersphere/swarm/network"
21
19
"github.com/ethersphere/swarm/pss"
20
+ "github.com/ethersphere/swarm/pss/crypto"
22
21
"github.com/ethersphere/swarm/state"
23
22
)
24
23
25
24
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
30
28
)
31
29
32
30
func init () {
@@ -36,8 +34,7 @@ func init() {
36
34
h := log .CallerFileHandler (hf )
37
35
log .Root ().SetHandler (h )
38
36
39
- cryptoUtils = crypto2 .NewCryptoUtils ()
40
- crypto = pss .NewCryptoBackend ()
37
+ cryptoB = crypto .New ()
41
38
psses = make (map [string ]* pss.Pss )
42
39
}
43
40
@@ -138,7 +135,7 @@ func TestStart(t *testing.T) {
138
135
if err != nil {
139
136
t .Fatal (err )
140
137
}
141
- pubkey , err := crypto .UnmarshalPubkey (pubkeybytes )
138
+ pubkey , err := cryptoB .UnmarshalPubkey (pubkeybytes )
142
139
if err != nil {
143
140
t .Fatal (err )
144
141
}
@@ -230,11 +227,11 @@ func newServices(allowRaw bool) adapters.Services {
230
227
"pss" : func (ctx * adapters.ServiceContext ) (node.Service , error ) {
231
228
ctxlocal , cancel := context .WithTimeout (context .Background (), time .Second )
232
229
defer cancel ()
233
- keys , err := cryptoUtils .NewKeyPair (ctxlocal )
230
+ keys , err := cryptoB .NewKeyPair (ctxlocal )
234
231
if err != nil {
235
232
return nil , err
236
233
}
237
- privkey , err := cryptoUtils .GetPrivateKey (keys )
234
+ privkey , err := cryptoB .GetPrivateKey (keys )
238
235
if err != nil {
239
236
return nil , err
240
237
}
@@ -246,7 +243,7 @@ func newServices(allowRaw bool) adapters.Services {
246
243
if err != nil {
247
244
return nil , err
248
245
}
249
- psses [hexutil .Encode (crypto .FromECDSAPub (& privkey .PublicKey ))] = ps
246
+ psses [hexutil .Encode (cryptoB .FromECDSAPub (& privkey .PublicKey ))] = ps
250
247
return ps , nil
251
248
},
252
249
"bzz" : func (ctx * adapters.ServiceContext ) (node.Service , error ) {
0 commit comments