Wildcard indexing support with RPC data source#415
Merged
Conversation
DZakh
commented
Jan 13, 2025
Member
- Also fix Wildcard events being skipped with Viem decoder enabled for HyperSync data source
bbb209c to
f1db388
Compare
JonoPrest
approved these changes
Jan 15, 2025
JonoPrest
left a comment
Collaborator
There was a problem hiding this comment.
Looks great thanks Dmitry! And thanks for catching the wildcard bug.
Comment on lines
+33
to
+52
| let parseLogOrThrow = ( | ||
| contractNameAbiMapping: dict<EvmTypes.Abi.t>, | ||
| ~contractName, | ||
| ~topics, | ||
| ~data, | ||
| ) => { | ||
| switch contractNameAbiMapping->Utils.Dict.dangerouslyGetNonOption(contractName) { | ||
| | None => raise(UnknownContractName({contractName: contractName})) | ||
| | Some(abi) => | ||
| let viemLog: eventLog = { | ||
| abi, | ||
| data, | ||
| topics, | ||
| } | ||
|
|
||
| try viemLog->decodeEventLogOrThrow catch { | ||
| | exn => raise(ParseError(exn)) | ||
| } | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
My only question is whether there is any use in actually passing the mapping with key here rather than the abi
Not a big issue though.
Member
Author
There was a problem hiding this comment.
There's no big reason for this. I just kept how it similar to how it was before. Ideally decoding for HyperSync and RPC should be done in a single place, so the code is reused and we also apply HyperSync decoder for the RPC data-source.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.