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

update anvil type to match alloy #9637

Closed
Show file tree
Hide file tree
Changes from 2 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
6 changes: 3 additions & 3 deletions crates/anvil/src/eth/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1902,10 +1902,10 @@ impl EthApi {
TransactionOrder::Fees => "fees".to_string(),
},
environment: NodeEnvironment {
base_fee: U256::from(self.backend.base_fee()),
base_fee: self.backend.base_fee() as u128,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
base_fee: self.backend.base_fee() as u128,
base_fee: self.backend.base_fee().to::<u128>(),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

u64 and u128 have no method to

chain_id: self.backend.chain_id().to::<u64>(),
gas_limit: U256::from(self.backend.gas_limit()),
gas_price: U256::from(self.gas_price()),
gas_limit: self.backend.gas_limit() as u64,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
gas_limit: self.backend.gas_limit() as u64,
gas_limit: self.backend.gas_limit().to::<u64>(),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CI error

gas_price: self.gas_price(),
},
fork_config: fork_config
.map(|fork| {
Expand Down
6 changes: 3 additions & 3 deletions crates/anvil/tests/it/anvil_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@ async fn can_get_node_info() {
hard_fork: hard_fork.to_string(),
transaction_order: "fees".to_owned(),
environment: NodeEnvironment {
base_fee: U256::from_str("0x3b9aca00").unwrap().to(),
base_fee: u128::from_str("0x3b9aca00").unwrap(),
chain_id: 0x7a69,
gas_limit: U256::from_str("0x1c9c380").unwrap().to(),
gas_price: U256::from_str("0x77359400").unwrap().to(),
gas_limit: u64::from_str("0x1c9c380").unwrap(),
gas_price: u128::from_str("0x77359400").unwrap(),
},
fork_config: NodeForkConfig {
fork_url: None,
Expand Down
Loading