mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
Merge pull request #296 from ethersphere/swarm-network-rewrite-swarmgo3
Fix bzz initialization in tests
This commit is contained in:
commit
9316ada27b
6 changed files with 15 additions and 6 deletions
|
|
@ -154,7 +154,7 @@ func (b *Bzz) NodeInfo() interface{} {
|
|||
// * handshake/hive
|
||||
// * discovery
|
||||
func (b *Bzz) Protocols() []p2p.Protocol {
|
||||
return []p2p.Protocol{
|
||||
protocol := []p2p.Protocol{
|
||||
{
|
||||
Name: BzzSpec.Name,
|
||||
Version: BzzSpec.Version,
|
||||
|
|
@ -177,6 +177,15 @@ func (b *Bzz) Protocols() []p2p.Protocol {
|
|||
Run: b.RunProtocol(b.streamerSpec, b.streamerRun),
|
||||
},
|
||||
}
|
||||
if b.streamerSpec != nil && b.streamerRun != nil {
|
||||
protocol = append(protocol, p2p.Protocol{
|
||||
Name: b.streamerSpec.Name,
|
||||
Version: b.streamerSpec.Version,
|
||||
Length: b.streamerSpec.Length(),
|
||||
Run: b.RunProtocol(b.streamerSpec, b.streamerRun),
|
||||
})
|
||||
}
|
||||
return protocol
|
||||
}
|
||||
|
||||
// APIs returns the APIs offered by bzz
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ func newBzzHandshakeTester(t *testing.T, n int, addr *BzzAddr) *bzzTester {
|
|||
HiveParams: NewHiveParams(),
|
||||
}
|
||||
kad := NewKademlia(addr.OAddr, NewKadParams())
|
||||
bzz := NewBzz(config, kad, nil)
|
||||
bzz := NewBzz(config, kad, nil, nil, nil)
|
||||
|
||||
s := p2ptest.NewProtocolTester(t, NewNodeIDFromAddr(addr), 1, bzz.runBzz)
|
||||
|
||||
|
|
|
|||
|
|
@ -331,5 +331,5 @@ func newService(ctx *adapters.ServiceContext) (node.Service, error) {
|
|||
HiveParams: hp,
|
||||
}
|
||||
|
||||
return network.NewBzz(config, kad, nil), nil
|
||||
return network.NewBzz(config, kad, nil, nil, nil), nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ func (s *Simulation) NewService(ctx *adapters.ServiceContext) (node.Service, err
|
|||
HiveParams: hp,
|
||||
}
|
||||
|
||||
return network.NewBzz(config, kad, store), nil
|
||||
return network.NewBzz(config, kad, store, nil, nil), nil
|
||||
}
|
||||
|
||||
func createMockers() map[string]*simulations.MockerConfig {
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ func newServices() adapters.Services {
|
|||
UnderlayAddr: addr.Under(),
|
||||
HiveParams: hp,
|
||||
}
|
||||
return network.NewBzz(config, kademlia(ctx.Config.ID), stateStore), nil
|
||||
return network.NewBzz(config, kademlia(ctx.Config.ID), stateStore, nil, nil), nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1192,7 +1192,7 @@ func newServices() adapters.Services {
|
|||
UnderlayAddr: addr.Under(),
|
||||
HiveParams: hp,
|
||||
}
|
||||
return network.NewBzz(config, kademlia(ctx.Config.ID), stateStore), nil
|
||||
return network.NewBzz(config, kademlia(ctx.Config.ID), stateStore, nil, nil), nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue