-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
protocol: parse empty block data as null (#89)
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.
- Loading branch information
Showing
29 changed files
with
623 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { StreamConfig } from "@apibara/protocol"; | ||
import { BlockFromBytes } from "./block"; | ||
import { FilterFromBytes } from "./filter"; | ||
import { FilterFromBytes, mergeFilter } from "./filter"; | ||
|
||
export * as proto from "./proto"; | ||
|
||
export * from "./common"; | ||
export * from "./filter"; | ||
export * from "./block"; | ||
|
||
export const EvmStream = new StreamConfig(FilterFromBytes, BlockFromBytes); | ||
export const EvmStream = new StreamConfig( | ||
FilterFromBytes, | ||
BlockFromBytes, | ||
mergeFilter, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.