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

protocol: parse empty block data as null #89

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

fracek
Copy link
Contributor

@fracek fracek commented Jul 1, 2024

The DNA protocol sends an empty block to signal to the client that it scanned a
block but didn't find any data.
This happens when the client sends multiple filters in one request.

This PR changes the stream definitions to:

  • Require that the schema returns a nullable type.
  • Propagate changes to all the types across packages.

We also extend StreamConfig to include a mergeFilter function that can be
used to merge multiple filters into one.

@fracek fracek requested a review from jaipaljadeja July 1, 2024 16:31
@fracek fracek force-pushed the nullable-block-data branch 4 times, most recently from e0eb78e to 876440f Compare July 1, 2024 19:38
@@ -118,4 +118,11 @@ describe("Run Test", () => {
});
});

const messages = generateMockMessages();
const messages: MockStreamResponse[] = [...Array(10)].map((_, i) => ({
Copy link
Member

Choose a reason for hiding this comment

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

I think we can use generateMockMessages() helper method here right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True now we have it!

@fracek fracek force-pushed the nullable-block-data branch from 876440f to 06b7c38 Compare July 3, 2024 07:35
Copy link
Member

@jaipaljadeja jaipaljadeja left a comment

Choose a reason for hiding this comment

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

LGTM

@jaipaljadeja jaipaljadeja merged commit 253b046 into apibara:develop Jul 3, 2024
1 check passed
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