diff options
author | Janos Guljas <janos@resenje.org> | 2018-09-25 22:57:31 +0800 |
---|---|---|
committer | Janos Guljas <janos@resenje.org> | 2018-09-25 22:57:31 +0800 |
commit | 24349144b6c0642755569268bab56b9033743212 (patch) | |
tree | 9d9d2b6659fd8a56512dfc807aafe4b733165ae1 /swarm/network/stream/intervals_test.go | |
parent | 7d56602391e155e2ce9ba7c261300a1804ab9972 (diff) | |
parent | d3441ebb563439bac0837d70591f92e2c6080303 (diff) | |
download | dexon-24349144b6c0642755569268bab56b9033743212.tar dexon-24349144b6c0642755569268bab56b9033743212.tar.gz dexon-24349144b6c0642755569268bab56b9033743212.tar.bz2 dexon-24349144b6c0642755569268bab56b9033743212.tar.lz dexon-24349144b6c0642755569268bab56b9033743212.tar.xz dexon-24349144b6c0642755569268bab56b9033743212.tar.zst dexon-24349144b6c0642755569268bab56b9033743212.zip |
Merge branch 'master' into max-stream-peer-servers
Diffstat (limited to 'swarm/network/stream/intervals_test.go')
-rw-r--r-- | swarm/network/stream/intervals_test.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/swarm/network/stream/intervals_test.go b/swarm/network/stream/intervals_test.go index 452aaca76..269259423 100644 --- a/swarm/network/stream/intervals_test.go +++ b/swarm/network/stream/intervals_test.go @@ -30,7 +30,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/swarm/network" "github.com/ethereum/go-ethereum/swarm/network/simulation" @@ -62,10 +62,9 @@ func testIntervals(t *testing.T, live bool, history *Range, skipCheck bool) { sim := simulation.New(map[string]simulation.ServiceFunc{ "intervalsStreamer": func(ctx *adapters.ServiceContext, bucket *sync.Map) (s node.Service, cleanup func(), err error) { - - id := ctx.Config.ID - addr := network.NewAddrFromNodeID(id) - store, datadir, err := createTestLocalStorageForID(id, addr) + n := ctx.Config.Node() + addr := network.NewAddr(n) + store, datadir, err := createTestLocalStorageForID(n.ID(), addr) if err != nil { return nil, nil, err } @@ -83,7 +82,7 @@ func testIntervals(t *testing.T, live bool, history *Range, skipCheck bool) { delivery := NewDelivery(kad, netStore) netStore.NewNetFetcherFunc = network.NewFetcherFactory(delivery.RequestFromPeers, true).New - r := NewRegistry(addr, delivery, netStore, state.NewInmemoryStore(), &RegistryOptions{ + r := NewRegistry(addr.ID(), delivery, netStore, state.NewInmemoryStore(), &RegistryOptions{ SkipCheck: skipCheck, }) bucket.Store(bucketKeyRegistry, r) @@ -281,7 +280,7 @@ func testIntervals(t *testing.T, live bool, history *Range, skipCheck bool) { } } -func getHashes(ctx context.Context, r *Registry, peerID discover.NodeID, s Stream) (chan []byte, error) { +func getHashes(ctx context.Context, r *Registry, peerID enode.ID, s Stream) (chan []byte, error) { peer := r.getPeer(peerID) client, err := peer.getClient(ctx, s) @@ -294,7 +293,7 @@ func getHashes(ctx context.Context, r *Registry, peerID discover.NodeID, s Strea return c.hashes, nil } -func enableNotifications(r *Registry, peerID discover.NodeID, s Stream) error { +func enableNotifications(r *Registry, peerID enode.ID, s Stream) error { peer := r.getPeer(peerID) ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |