-
Notifications
You must be signed in to change notification settings - Fork 158
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
Expose event logging downstream #2405
Conversation
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.
lgtm
@@ -253,6 +256,15 @@ type family EventReturnType ep sts a :: Type where | |||
EventReturnType 'EventPolicyReturn sts a = (a, [Event sts]) | |||
EventReturnType _ _ a = a | |||
|
|||
class EventReturnTypeRep ert where |
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.
maybe EventReturnTypeRep
-> ReifyEventPolicy
or something
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 went for consistency with RuleTypeRep
, in the same file.
- Generalise `applySTSOptsEither` to all return types. - Add an ability to map over arbitrary return types.
We do not introduce 'reapplyBlockOpts' since this already is a customised version of 'applyBlockOpts'. We also do not currently expose a mempool interface that allows event logging.
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.
Thank you @nc6 , this looks great!
If I understand correctly, @DavidEichmann can now use applyBlockOpts
with the right EventReturnTypeRep
to make a version of foldBlocks
that can be used to make a client that receives all the blocks, txs, together with the events. yea?
Yep, that's the idea! |
This PR exposes the event logging mechanism for use downstream, as well as making some slight changes to its interface.
No changes should be visible to clients using the existing interfaces.