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:
committed by
Viktor Trón
parent
81533deae5
commit
cf3b187bde
@@ -70,6 +70,9 @@ func TestHiveStatePersistance(t *testing.T) {
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
store, err := state.NewDBStore(dir) //start the hive with an empty dbstore
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
params := NewHiveParams()
|
||||
s, pp := newHiveTester(t, params, 5, store)
|
||||
@@ -90,6 +93,9 @@ func TestHiveStatePersistance(t *testing.T) {
|
||||
store.Close()
|
||||
|
||||
persistedStore, err := state.NewDBStore(dir) //start the hive with an empty dbstore
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
s1, pp := newHiveTester(t, params, 1, persistedStore)
|
||||
|
||||
|
@@ -153,17 +153,7 @@ func newBzzHandshakeTester(t *testing.T, n int, addr *BzzAddr, lightNode bool) *
|
||||
|
||||
// should test handshakes in one exchange? parallelisation
|
||||
func (s *bzzTester) testHandshake(lhs, rhs *HandshakeMsg, disconnects ...*p2ptest.Disconnect) error {
|
||||
var peers []enode.ID
|
||||
id := rhs.Addr.ID()
|
||||
if len(disconnects) > 0 {
|
||||
for _, d := range disconnects {
|
||||
peers = append(peers, d.Peer)
|
||||
}
|
||||
} else {
|
||||
peers = []enode.ID{id}
|
||||
}
|
||||
|
||||
if err := s.TestExchanges(HandshakeMsgExchange(lhs, rhs, id)...); err != nil {
|
||||
if err := s.TestExchanges(HandshakeMsgExchange(lhs, rhs, rhs.Addr.ID())...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@@ -94,7 +94,7 @@ func TestServiceBucket(t *testing.T) {
|
||||
t.Fatalf("expected %q, got %q", customValue, s)
|
||||
}
|
||||
|
||||
v, ok = sim.NodeItem(id2, customKey)
|
||||
_, ok = sim.NodeItem(id2, customKey)
|
||||
if ok {
|
||||
t.Fatal("bucket item should not be found")
|
||||
}
|
||||
@@ -119,7 +119,7 @@ func TestServiceBucket(t *testing.T) {
|
||||
t.Fatalf("expected %q, got %q", testValue+id1.String(), s)
|
||||
}
|
||||
|
||||
v, ok = items[id2]
|
||||
_, ok = items[id2]
|
||||
if ok {
|
||||
t.Errorf("node 2 item should not be found")
|
||||
}
|
||||
|
@@ -62,6 +62,9 @@ func createMockStore(globalStore *mockdb.GlobalStore, id enode.ID, addr *network
|
||||
params.Init(datadir)
|
||||
params.BaseKey = addr.Over()
|
||||
lstore, err = storage.NewLocalStore(params, mockStore)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
return lstore, datadir, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user