swarm/network/simulation: fix New function for-loop scope (#18161)

This commit is contained in:
Janoš Guljaš
2018-11-26 12:39:38 +01:00
committed by Anton Evangelatov
parent f0515800e6
commit 93854bbad4
4 changed files with 56 additions and 1 deletions

View File

@ -205,3 +205,16 @@ func (t *noopService) Start(server *p2p.Server) error {
func (t *noopService) Stop() error {
return nil
}
// a helper function for most basic noop service
// of a different type then noopService to test
// multiple services on one node.
func noopService2Func(ctx *adapters.ServiceContext, b *sync.Map) (node.Service, func(), error) {
return new(noopService2), nil, nil
}
// noopService2 is the service that does not do anything
// but implements node.Service interface.
type noopService2 struct {
noopService
}