From a9c2d243c5af8b020ecfd2e5209f6c3bf37bbba0 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Fri, 9 Jun 2023 18:08:56 +0800 Subject: [PATCH 1/2] clean up/copyedit --- plugins/plugin_loader.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/plugin_loader.go b/plugins/plugin_loader.go index be310ecb2..652988d9c 100644 --- a/plugins/plugin_loader.go +++ b/plugins/plugin_loader.go @@ -18,7 +18,7 @@ import ( type Subcommand func(core.Context, []string) error type pluginDetails struct { - p *plugin.Plugin + p *plugin.Plugin name string } @@ -72,12 +72,12 @@ func NewPluginLoader(target string) (*PluginLoader, error) { for _, file := range files { fpath := path.Join(target, file.Name()) if !strings.HasSuffix(file.Name(), ".so") { - log.Debug("File inplugin directory is not '.so' file. Skipping.", "file", fpath) + log.Debug("File in plugin directory is not '.so' file. Skipping.", "file", fpath) continue } plug, err := plugin.Open(fpath) if err != nil { - log.Warn("File in plugin directory could not be loaded: %v", "file", fpath, "error", err.Error()) + log.Warn("File in plugin directory could not be loaded", "file", fpath, "error", err) continue } // Any type of plugin can potentially specify flags From f7ff01fd5431604f0aac8013c9c2a01cb06dc4a6 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Sat, 10 Jun 2023 01:51:11 +0800 Subject: [PATCH 2/2] fix plugin subscription method registration --- rpc/service.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rpc/service.go b/rpc/service.go index cfdfba023..c71586a6f 100644 --- a/rpc/service.go +++ b/rpc/service.go @@ -63,6 +63,9 @@ func (r *serviceRegistry) registerName(name string, rcvr interface{}) error { return fmt.Errorf("no service name for type %s", rcvrVal.Type().String()) } callbacks := suitableCallbacks(rcvrVal) + // begin PluGeth code injection + pluginExtendedCallbacks(callbacks, rcvrVal) + // end PluGeth code injection if len(callbacks) == 0 { return fmt.Errorf("service %T doesn't have any suitable methods/subscriptions to expose", rcvr) }