From 7f1b5c5f9b36a50be6e4529787342f12c17c11d1 Mon Sep 17 00:00:00 2001 From: philip-morlier Date: Fri, 24 Mar 2023 16:05:39 -0700 Subject: [PATCH] Progress made on 3/24/23 --- cmd/geth/plugin_hooks.go | 19 +++++++++++++++++++ eth/ethconfig/plugin_hooks.go | 14 -------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/cmd/geth/plugin_hooks.go b/cmd/geth/plugin_hooks.go index 80187a028..854975809 100644 --- a/cmd/geth/plugin_hooks.go +++ b/cmd/geth/plugin_hooks.go @@ -102,3 +102,22 @@ func pluginsOnShutdown() { } OnShutdown(plugins.DefaultPluginLoader) } + +func HookTester(pl *plugins.PluginLoader) { + fnList := pl.Lookup("HookTester", func(item interface{}) bool { + _, ok := item.(func()) + return ok + }) + for _, fni := range fnList { + fni.(func())() + } +} + +func pluginHookTester() { + if plugins.DefaultPluginLoader == nil { + log.Warn("Attempting HookTester, but default PluginLoader has not been initialized") + return + } + HookTester(plugins.DefaultPluginLoader) +} + diff --git a/eth/ethconfig/plugin_hooks.go b/eth/ethconfig/plugin_hooks.go index 75b28c986..8f09f6069 100644 --- a/eth/ethconfig/plugin_hooks.go +++ b/eth/ethconfig/plugin_hooks.go @@ -2,32 +2,18 @@ package ethconfig import ( "github.com/ethereum/go-ethereum/log" - // "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/plugins" "github.com/ethereum/go-ethereum/plugins/wrappers" wengine "github.com/ethereum/go-ethereum/plugins/wrappers/engine" "github.com/ethereum/go-ethereum/plugins/wrappers/backendwrapper" - // "github.com/ethereum/go-ethereum/rpc" "github.com/openrelayxyz/plugeth-utils/core" "github.com/openrelayxyz/plugeth-utils/restricted" - // "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" - // "github.com/ethereum/go-ethereum/consensus/beacon" - // "github.com/ethereum/go-ethereum/consensus/clique" - // "github.com/ethereum/go-ethereum/consensus/ethash" - // "github.com/ethereum/go-ethereum/core" - // "github.com/ethereum/go-ethereum/core/txpool" - // "github.com/ethereum/go-ethereum/eth/downloader" - // "github.com/ethereum/go-ethereum/eth/gasprice" "github.com/ethereum/go-ethereum/ethdb" - // "github.com/ethereum/go-ethereum/log" - // "github.com/ethereum/go-ethereum/miner" "github.com/ethereum/go-ethereum/node" - // "github.com/ethereum/go-ethereum/params" pconsensus "github.com/openrelayxyz/plugeth-utils/restricted/consensus" - // pparams "github.com/openrelayxyz/plugeth-utils/restricted/params" )