-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: add eth_getTransactionByHash
support
#4577
Conversation
Co-authored-by: Patricio Palladino <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
skip_serializing_if = "Option::is_none", | ||
with = "crate::serde::optional_u64" | ||
)] | ||
pub transaction_type: Option<u64>, |
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.
Had to make it an Option
in case we're running in pre-Berlin mode.
@@ -72,7 +72,7 @@ impl ProviderData { | |||
network_id: config.network_id, | |||
beneficiary: config.coinbase, | |||
// TODO: Add config option (https://github.com/NomicFoundation/edr/issues/111) | |||
min_gas_price: U256::MAX, | |||
min_gas_price: U256::from(1), |
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.
Had to decrease this to let us mine transactions in tests.
use tempfile::TempDir; | ||
|
||
use super::*; | ||
use crate::{test_utils::create_test_config_with_impersonated_accounts, ProviderConfig}; | ||
|
||
struct NodeTestFixture { | ||
struct ProviderTestFixture { |
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.
Did a rename as this slipped by in review previously
@@ -763,7 +830,8 @@ mod tests { | |||
vec![impersonated_account], | |||
); | |||
|
|||
let mut provider_data = ProviderData::new(runtime, &config).await?; | |||
let runtime = runtime::Handle::try_current()?; | |||
let mut provider_data = ProviderData::new(&runtime, &config).await?; |
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.
Changed it so that we pass in the current runtime handle here instead of on initialization to avoid repetition, since this fixture is only used here.
.transpose() | ||
} | ||
|
||
fn get_transaction_result_to_rpc_result( |
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.
We might want to introduce a separate module at some point for these RPC conversions, but seemed like an overkill for now.
@@ -23,43 +23,39 @@ pub use self::{ | |||
}; | |||
|
|||
/// A JSON-RPC provider for Ethereum. | |||
/// | |||
/// Add a layer in front that handles this |
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.
Made this a doc comment to prevent rustfmt
from breaking the lines.
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.
To expedite merging, if this feedback is resolved by borrowing the SignedTransaction
, feel free to merge the PR - after applying that improvement.
The other topic might take some time for the others to respond to and can be handled in a follow-up PR.
Add
eth_getTransactionByHash
to the EDR provider: