Skip to content

Commit 1bb07dc

Browse files
modifying signatures for all default branch, and active plugins
1 parent 020b4ad commit 1bb07dc

File tree

7 files changed

+24
-23
lines changed

7 files changed

+24
-23
lines changed

loader.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ import (
1414

1515
)
1616

17-
var (
18-
configPath string
19-
ChainConfig any
20-
)
17+
var configPath string
2118

2219
type pluginLoader struct {
2320
initialized bool
@@ -300,8 +297,4 @@ func GetPatchsets() [][]Patchset {
300297
res = append(res, patchsets)
301298
}
302299
return res
303-
}
304-
305-
func GetChainConfig(cfg any) {
306-
ChainConfig = cfg
307-
}
300+
}

plugins/blockupdates/main.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,23 @@ func (b *blockUpdatesAPI) BlockUpdates(ctx context.Context) (<-chan map[string]i
413413
}
414414

415415
// GetAPIs exposes the BlockUpdates service under the cardinal namespace.
416-
func (*blockUpdatesModule) GetAPIs(stack *node.Node, backend types.Backend) []rpc.API {
416+
func (*blockUpdatesModule) GetAPIs(stack *node.Node, backend types.Backend, chainConfig any) []rpc.API {
417417
return []rpc.API{
418-
{
419-
Namespace: "plugeth",
420-
Version: "1.0",
421-
Service: &blockUpdatesAPI{backend},
422-
Public: true,
423-
},
424-
}
418+
{
419+
Namespace: "plugeth",
420+
Version: "1.0",
421+
Service: &blockUpdatesAPI{backend},
422+
Public: true,
423+
},
424+
}
425+
}
426+
427+
func (b *blockUpdatesAPI) BlockUpdatesAPITest(context.Context) string {
428+
var notNill bool
429+
if b.backend != nil {
430+
notNill = true
431+
}
432+
return fmt.Sprintf("Reprting from blockUpdates, the stack object is not nil: %v", notNill)
425433
}
426434

427435
var (

plugins/example/example.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type ExampleConfig struct {
4141
var cfg *ExampleConfig
4242

4343

44-
func (*exampleModule) InitializeNode(*node.Node, types.Backend) {
44+
func (*exampleModule) InitializeNode(*node.Node, types.Backend, any) {
4545
log.Info("Example module initialized")
4646

4747
if *exampleBoolFlag {
@@ -66,7 +66,7 @@ func (*exampleModule) Shutdown() {
6666
log.Info("Byeee!")
6767
}
6868

69-
func (*exampleModule) GetAPIs(*node.Node, types.Backend) []rpc.API {
69+
func (*exampleModule) GetAPIs(*node.Node, types.Backend, any) []rpc.API {
7070
log.Info("Registering plugin APIs")
7171
return []rpc.API{
7272
{

plugins/healthcheck/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func init() {
3535
xplugeth.RegisterModule[healthCheckModule]("healthcheck")
3636
}
3737

38-
func (h *healthCheckModule) InitializeNode(s *node.Node, b types.Backend) {
38+
func (h *healthCheckModule) InitializeNode(s *node.Node, b types.Backend, c any) {
3939
h.client = s.Attach()
4040

4141
h.tolerance = *hcTolerance

plugins/peereval/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func init() {
5757
xplugeth.RegisterFlags(flags)
5858
}
5959

60-
func (p *peerEvalModule) InitializeNode(s *node.Node, b types.Backend) {
60+
func (p *peerEvalModule) InitializeNode(s *node.Node, b types.Backend, c any) {
6161
client = s.Attach()
6262

6363
p.peerMetricsMap = make(map[string]*PeerMetrics)

plugins/peermanager/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func init() {
4747
xplugeth.RegisterModule[peerManagerModule]("peerManagerModule")
4848
}
4949

50-
func (p *peerManagerModule) InitializeNode(s *node.Node, b types.Backend) {
50+
func (p *peerManagerModule) InitializeNode(s *node.Node, b types.Backend, c any) {
5151

5252
sessionPeerService = &PeerManager{
5353
client: s.Attach(),

plugins/producer/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ func (api *cardinalAPI) ReproduceBlocks(start rpc.BlockNumber, end *rpc.BlockNum
561561
return true, nil
562562
}
563563

564-
func (c *cardinalProducerModule) GetAPIs(stack *node.Node, backend types.Backend) []rpc.API {
564+
func (c *cardinalProducerModule) GetAPIs(stack *node.Node, backend types.Backend, chainConfig any) []rpc.API {
565565
var v func(int64) (*gtypes.Block, *big.Int, gtypes.Receipts, map[common.Hash]struct{}, map[common.Hash][]byte, map[common.Hash]map[common.Hash][]byte, map[common.Hash][]byte, error)
566566
for _, extern := range xplugeth.GetModules[blockupdates.InternalBlockUpdates]() {
567567
v = extern.BlockUpdatesByNumber

0 commit comments

Comments
 (0)