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

Implemented private log filter JSON-RPC methods #735

Merged
merged 5 commits into from
Apr 20, 2020

Conversation

lucassaldanha
Copy link
Member

@lucassaldanha lucassaldanha commented Apr 17, 2020

Fixes #627

Implemented the following JSON-RPC methods:
• priv_installFilter
• priv_uninstallFilter
• priv_getFilterLogs
• priv_getFilterChanges

ATs will be implemented in a separate PR.

@lucassaldanha lucassaldanha added the privacy private transactions label Apr 17, 2020
@lucassaldanha lucassaldanha changed the title [#627] Implemented private log filter JSON-RPC methods Implemented private log filter JSON-RPC methods Apr 17, 2020
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>

private void addMatchingLogs(final LogFilter filter) {
final long headBlockNumber = blockchainQueries.headBlockNumber();
private void addNewMatchingLogs(final LogFilter filter) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed this method to clarify that we will only be looking for new logs here. The fromBlockNumber is set to the head of the chain.

return findLogsWithinRange(filter, fromBlockNumber, toBlockNumber);
}

private List<LogWithMetadata> findLogsWithinRange(
Copy link
Member Author

@lucassaldanha lucassaldanha Apr 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method was introduced to avoid duplication. It is used by two methods in this class.

Copy link
Contributor

@pinges pinges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments, please have a look!

Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
@lucassaldanha lucassaldanha merged commit b638d9d into hyperledger:master Apr 20, 2020
@lucassaldanha lucassaldanha deleted the priv_filter_methods branch April 20, 2020 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
privacy private transactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement priv_filter methods
2 participants