-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: rpc result serde and avoid rate limits #4325
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -36,7 +36,7 @@ pub struct Transaction { | |
/// block number where this transaction was in | ||
pub block_number: Option<U256>, | ||
/// integer of the transactions index position in the block. null when its pending | ||
#[serde(deserialize_with = "crate::serde::optional_u64_from_hex")] | ||
#[serde(with = "crate::serde::optional_u64")] | ||
pub transaction_index: Option<u64>, | ||
/// address of the sender | ||
pub from: Address, | ||
|
@@ -52,14 +52,23 @@ pub struct Transaction { | |
#[serde(with = "crate::serde::bytes")] | ||
pub input: Bytes, | ||
/// ECDSA recovery id | ||
#[serde(alias = "yParity", with = "crate::serde::u64")] | ||
#[serde(with = "crate::serde::u64")] | ||
pub v: u64, | ||
/// Y-parity for EIP-2930 and EIP-1559 transactions. In theory these transactions types | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did this cause a crash when deserializing? |
||
/// shouldn't have a `v` field, but in practice they are returned by nodes. | ||
#[serde( | ||
default, | ||
rename = "yParity", | ||
skip_serializing_if = "Option::is_none", | ||
with = "crate::serde::optional_u64" | ||
)] | ||
pub y_parity: Option<u64>, | ||
/// ECDSA signature r | ||
pub r: U256, | ||
/// ECDSA signature s | ||
pub s: U256, | ||
/// chain ID | ||
#[serde(default, deserialize_with = "crate::serde::optional_u64_from_hex")] | ||
#[serde(default, with = "crate::serde::optional_u64")] | ||
pub chain_id: Option<u64>, | ||
/// integer of the transaction type, 0x0 for legacy transactions, 0x1 for access list types, 0x2 for dynamic fees | ||
#[serde(rename = "type", default, with = "crate::serde::u64")] | ||
|
@@ -139,7 +148,7 @@ pub struct Block<TX> { | |
/// mix hash | ||
pub mix_hash: B256, | ||
/// hash of the generated proof-of-work. null when its pending block. | ||
#[serde(deserialize_with = "crate::serde::optional_u64_from_hex")] | ||
#[serde(with = "crate::serde::optional_u64")] | ||
pub nonce: Option<u64>, | ||
/// base fee per gas | ||
pub base_fee_per_gas: Option<U256>, | ||
|
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Should this be renamed to signal that you're testing caching?