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

Optimize parse_block_identifier #3242

Closed
wants to merge 1 commit into from

Conversation

reedsa
Copy link
Contributor

@reedsa reedsa commented Feb 22, 2024

What was wrong?

Closes #2816

How was it fixed?

  • Separate each case to short circuit when possible
  • Returns block_identifier when is_hex_encoded_block_hash is true or returns add_0x_prefix(block_identifier.hex()) when the block_identifier is bytes.

Todo:

Cute Animal Picture

Screen Shot 2024-02-22 at 9 53 17 AM

* Check `is_hex_encoded_block_hash` separately from `isinstance(block_identifier, bytes)`
* Return appropriate `block_identifier` value for each case
@reedsa reedsa closed this Feb 27, 2024
@reedsa reedsa deleted the 2816-parse-block-identifier branch February 27, 2024 15:52
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.

Call contract function using block hash makes two requests inside
1 participant