diff --git a/ethers-etherscan/src/gas.rs b/ethers-etherscan/src/gas.rs index f3284e4b..0137ac0f 100644 --- a/ethers-etherscan/src/gas.rs +++ b/ethers-etherscan/src/gas.rs @@ -54,7 +54,11 @@ impl Client { } } - /// Returns the gas oracle + /// Returns the current Safe, Proposed and Fast gas prices + /// Post EIP-1559 changes: + /// - Safe/Proposed/Fast gas price recommendations are now modeled as Priority Fees. + /// - New field `suggestBaseFee`, the baseFee of the next pending block + /// - New field `gasUsedRatio`, to estimate how busy the network is pub async fn gas_oracle(&self) -> Result { let query = self.create_query("gastracker", "gasoracle", serde_json::Value::Null); let response: Response = self.get_json(&query).await?; diff --git a/ethers-middleware/tests/gas_oracle.rs b/ethers-middleware/tests/gas_oracle.rs index 959fdbf5..916ca036 100644 --- a/ethers-middleware/tests/gas_oracle.rs +++ b/ethers-middleware/tests/gas_oracle.rs @@ -70,9 +70,9 @@ async fn etherscan() { assert!(data.is_err()); // but fetching the `standard` gas price should work fine - let etherscan_oracle_2 = Etherscan::new(etherscan_client).category(GasCategory::SafeLow); + let etherscan_oracle = Etherscan::new(etherscan_client).category(GasCategory::SafeLow); - let data = etherscan_oracle_2.fetch().await; + let data = etherscan_oracle.fetch().await; assert!(data.is_ok()); }