swamr/network/simulation: simplify noopService2 in tests

This commit is contained in:
Janos Guljas 2018-11-23 09:55:48 +01:00
parent ae922ffb62
commit f4958c0e06

View file

@ -210,29 +210,11 @@ func (t *noopService) Stop() error {
// of a different type then noopService to test // of a different type then noopService to test
// multiple services on one node. // multiple services on one node.
func noopService2Func(ctx *adapters.ServiceContext, b *sync.Map) (node.Service, func(), error) { func noopService2Func(ctx *adapters.ServiceContext, b *sync.Map) (node.Service, func(), error) {
return newNoopService2(), nil, nil return new(noopService2), nil, nil
} }
// noopService2 is the service that does not do anything // noopService2 is the service that does not do anything
// but implements node.Service interface. // but implements node.Service interface.
type noopService2 struct{} type noopService2 struct {
noopService
func newNoopService2() node.Service {
return &noopService2{}
}
func (t *noopService2) Protocols() []p2p.Protocol {
return []p2p.Protocol{}
}
func (t *noopService2) APIs() []rpc.API {
return []rpc.API{}
}
func (t *noopService2) Start(server *p2p.Server) error {
return nil
}
func (t *noopService2) Stop() error {
return nil
} }