mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swamr/network/simulation: simplify noopService2 in tests
This commit is contained in:
parent
ae922ffb62
commit
f4958c0e06
1 changed files with 3 additions and 21 deletions
|
|
@ -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
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue