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

fix(provider): custom deser for pending blocks #2146

Merged
merged 6 commits into from
Mar 6, 2025
Merged

Conversation

yash-atreya
Copy link
Member

@yash-atreya yash-atreya commented Mar 6, 2025

Motivation

Closes #2117
Closes #2139

Solution

  • Add new variant PendingBlock for fetching pending blocks.
  • Deser to serde_json::Value first
  • Check if any of these fields are missing/null hash, miner, nonce.
  • If yes, set them to their respective Zero types.
  • Finally, Deser to BlockResponse from Value representation

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@yash-atreya yash-atreya changed the title fix(rpc-types): account for missing/null fields in Header fix(provider): custom deser for pending blocks Mar 6, 2025
@yash-atreya yash-atreya marked this pull request as ready for review March 6, 2025 13:04
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

great!

@yash-atreya yash-atreya merged commit 43c2edf into main Mar 6, 2025
27 checks passed
@yash-atreya yash-atreya deleted the yash/deser-header branch March 6, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants