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

execute eth_estimateGas and eth_createAccessList on latest block #3220

Merged
merged 4 commits into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions crates/driver/src/infra/blockchain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ impl Ethereum {
.transport()
.execute(
"eth_createAccessList",
vec![serde_json::to_value(&tx).unwrap()],
vec![
serde_json::to_value(&tx).unwrap(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe instead of unwrap() we can return an error (function returns Result)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this would require a new error type and given that this unwrap never caused issues (all possible values are serializable) I prefer not to touch it.

serde_json::Value::String("latest".into()),
],
)
.await?;
if let Some(err) = json.get("error") {
Expand All @@ -207,7 +210,7 @@ impl Ethereum {
gas_price: self.simulation_gas_price().await,
..Default::default()
},
None,
Some(ethcontract::BlockNumber::Latest),
)
.await
.map(Into::into)
Expand Down
Loading