summaryrefslogtreecommitdiff
path: root/plugins/rpc
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-13 16:29:08 +0300
committerValery Piashchynski <[email protected]>2020-11-13 16:29:08 +0300
commit6eefd067f4c08ed51834926abd1a4c60ec55b56d (patch)
tree5c4e3d3d930243f0c19083eff8bd5719ec266500 /plugins/rpc
parent002eb4bb1981558fa5e614aed22d322f0f45d7ea (diff)
Update tests
Diffstat (limited to 'plugins/rpc')
-rwxr-xr-xplugins/rpc/plugin.go11
-rw-r--r--plugins/rpc/tests/plugin1.go4
2 files changed, 4 insertions, 11 deletions
diff --git a/plugins/rpc/plugin.go b/plugins/rpc/plugin.go
index d7f91742..82b30563 100755
--- a/plugins/rpc/plugin.go
+++ b/plugins/rpc/plugin.go
@@ -67,13 +67,7 @@ func (s *Plugin) Serve() chan error {
// Attach all services
for i := 0; i < len(s.services); i++ {
- svc, err := s.services[i].service.RPC()
- if err != nil {
- errCh <- errors.E(op, err)
- return errCh
- }
-
- err = s.Register(s.services[i].name, svc)
+ err := s.Register(s.services[i].name, s.services[i].service.RPC())
if err != nil {
errCh <- errors.E(op, err)
return errCh
@@ -137,12 +131,11 @@ func (s *Plugin) Collects() []interface{} {
}
// RegisterPlugin registers RPC service plugin.
-func (s *Plugin) RegisterPlugin(name endure.Named, p rpc_.RPCer) error {
+func (s *Plugin) RegisterPlugin(name endure.Named, p rpc_.RPCer) {
s.services = append(s.services, pluggable{
service: p,
name: name.Name(),
})
- return nil
}
// Register publishes in the server the set of methods of the
diff --git a/plugins/rpc/tests/plugin1.go b/plugins/rpc/tests/plugin1.go
index 98373a12..a8d5c216 100644
--- a/plugins/rpc/tests/plugin1.go
+++ b/plugins/rpc/tests/plugin1.go
@@ -28,8 +28,8 @@ func (p1 *Plugin1) Name() string {
return "rpc_test.plugin1"
}
-func (p1 *Plugin1) RPC() (interface{}, error) {
- return &PluginRpc{srv: p1}, nil
+func (p1 *Plugin1) RPC() interface{} {
+ return &PluginRpc{srv: p1}
}
type PluginRpc struct {