-
Notifications
You must be signed in to change notification settings - Fork 572
Implement support for the "blockHash" parameter #4387
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
Conversation
| if (filter.FromBlock == filter.ToBlock) | ||
| fromBlockResult = toBlockResult = _blockFinder.SearchForHeader(filter.ToBlock); | ||
| else | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor-style: One thing that is bothering me and makes it harder to read is the inconsistency of brackets in code blocks in same if-else. if is bracketless and then you have else that is longer block and has {}. Looks weird and inconsistent to me, makes it harder to follow the logic and boundaries at just a glance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please test it with CL clients on some merge network. eth_getLogs is used by CLs
| if (blockHash is null) | ||
| { | ||
| JObject jObject = serializer.Deserialize<JObject>(jsonValue.ToJsonTextReader()); | ||
| FromBlock = BlockParameterConverter.GetBlockParameter(jObject["fromBlock"]?.ToObject<string>()); | ||
| ToBlock = BlockParameterConverter.GetBlockParameter(jObject["toBlock"]?.ToObject<string>()); | ||
| Address = GetAddress(jObject["address"]); | ||
| Topics = GetTopics(jObject["topics"] as JArray); | ||
| FromBlock = BlockParameterConverter.GetBlockParameter(filter["fromBlock"]?.Value<string>()); | ||
| ToBlock = BlockParameterConverter.GetBlockParameter(filter["toBlock"]?.Value<string>()); | ||
| } | ||
| else | ||
| FromBlock = | ||
| ToBlock = BlockParameterConverter.GetBlockParameter(blockHash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main change
|
@MarekM25 Tested with Lighthouse. Everything looks alright. I'm going to merge soon. |
Fixes #4384
Changes
Added support for the
blockHashparameter to theeth_getLogsRPC method. When this parameter is specified, thefromBlockandtoBlockparameters are ignored if provided.Types of changes
What types of changes does your code introduce?
Testing
Requires testing
In case you checked yes, did you write tests??