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

Changes logs added/removed callbacks to receive an array of all logs in a particular block. #26

Merged
merged 1 commit into from
Nov 7, 2018

Conversation

MicahZoltu
Copy link
Collaborator

Also fires callback with empty array when block contains no logs matching filters.

Also includes blockHash with callback.

This change makes it easier for consumers to know when they are done receiving logs for a particular block. With this knowledge, they can now process block + logs as a single atomic operation if they desire by saving off the block and waiting for a matching set of logs to come through (or notification of block removal in case log fetching fails).

This change somewhat constrains the problem being solved by this library to just "getting ordering right", rather than trying to provide a nice interface into the stream. It isn't difficult for users of this library to split apart the logs into multiple callbacks with a very tiny callback wrapper, yet this change opens the doors to a number of new use cases.

source/log-reconciler.ts Outdated Show resolved Hide resolved
…in a particular block.

Also fires callback with empty array when block contains no logs matching filters.

Also includes blockHash with callback.

This change makes it easier for consumers to know when they are done receiving logs for a particular block.  With this knowledge, they can now process block + logs as a single atomic operation if they desire by saving off the block and waiting for a matching set of logs to come through (or notification of block removal in case log fetching fails).

This change somewhat constrains the problem being solved by this library to just "getting ordering right", rather than trying to provide a nice interface into the stream.  It isn't difficult for users of this library to split apart the logs into multiple callbacks with a _very_ tiny callback wrapper, yet this change opens the doors to a number of new use cases.
@epheph epheph merged commit 4466c9b into master Nov 7, 2018
@epheph epheph deleted the micah branch November 7, 2018 18:55
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.

2 participants