Updates to support blockupdates plugin
This makes several updates to support the blockupdates plugin. I had to update several hooks that were using the wrong types, and provide a way to get event.Feed objects into plugins without importing event.Feed (which I did by having the plugin loader make them available).
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/event"
|
||||
"gopkg.in/urfave/cli.v1"
|
||||
)
|
||||
|
||||
@@ -156,3 +157,20 @@ func ParseFlags(args []string) bool {
|
||||
}
|
||||
return DefaultPluginLoader.ParseFlags(args)
|
||||
}
|
||||
|
||||
|
||||
type feedWrapper struct {
|
||||
feed *event.Feed
|
||||
}
|
||||
|
||||
func (f *feedWrapper) Send(item interface{}) int {
|
||||
return f.feed.Send(item)
|
||||
}
|
||||
|
||||
func (f *feedWrapper) Subscribe(ch interface{}) core.Subscription {
|
||||
return f.feed.Subscribe(ch)
|
||||
}
|
||||
|
||||
func (pl *PluginLoader) GetFeed() core.Feed {
|
||||
return &feedWrapper{&event.Feed{}}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user