Skip to content
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

Merged
merged 3 commits into from
Aug 3, 2021
Merged

Expose event logging downstream #2405

merged 3 commits into from
Aug 3, 2021

Conversation

nc6
Copy link
Contributor

@nc6 nc6 commented Aug 2, 2021

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.

Copy link
Contributor

@goolord goolord left a 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
Copy link
Contributor

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

Copy link
Contributor Author

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.

nc6 added 3 commits August 2, 2021 17:11
- 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.
Copy link
Contributor

@JaredCorduan JaredCorduan left a 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?

@nc6
Copy link
Contributor Author

nc6 commented Aug 3, 2021

Yep, that's the idea!

@nc6 nc6 merged commit 3091783 into master Aug 3, 2021
@iohk-bors iohk-bors bot deleted the nc/events branch August 3, 2021 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants