-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plugin notification topic "block_added" #5581
Add plugin notification topic "block_added" #5581
Conversation
582d310
to
29f035d
Compare
Changelog-Added: Plugins: Added notification topic "block_processed".
29f035d
to
c8819a0
Compare
I think the failing tests are unrelated to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK c8819a0
Yes the test are failing regarding some timeout
I don't like this name, though, maybe |
As a notification, also |
|
+1 for |
what about |
ACK 357404b |
blocks_catched = [] | ||
|
||
|
||
@plugin.subscribe("block_added") | ||
def notify_block_added(plugin, block, **kwargs): | ||
global blocks_catched | ||
blocks_catched.append(block["height"]) | ||
|
||
|
||
@plugin.method("blockscatched") | ||
def return_moves(plugin): | ||
return blocks_catched |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I first read that as “cached”, but should that perhaps be “caught”?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't speak English. I will submit a PR renaming that.
This would be useful for two completely unrelated plugins I'm working on recently, and it's a simple change that prevents the plugins from having to reimplement the block polling logic all by themselves every time.