Skip to content

Commit 18735ba

Browse files
committed
fix low gas price
1 parent 846ea77 commit 18735ba

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

dkg/providers/blockchain/async_blockchain.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ async def fetch_gas_price(oracle_url: str) -> Wei | None:
183183
response.raise_for_status()
184184
data: dict = await response.json()
185185

186-
if "result" in data:
186+
if "fast" in data:
187+
return self.w3.to_wei(data["fast"], "gwei")
188+
elif "result" in data:
187189
return int(data["result"], 16)
188-
elif "average" in data:
189-
return self.w3.to_wei(data["average"], "gwei")
190190
else:
191191
return None
192192
except Exception:

dkg/providers/blockchain/blockchain.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ def fetch_gas_price(oracle_url: str) -> Wei | None:
168168
response.raise_for_status()
169169
data: dict = response.json()
170170

171-
if "result" in data:
171+
if "fast" in data:
172+
return self.w3.to_wei(data["fast"], "gwei")
173+
elif "result" in data:
172174
return int(data["result"], 16)
173-
elif "average" in data:
174-
return self.w3.to_wei(data["average"], "gwei")
175175
else:
176176
return None
177177
except Exception:

0 commit comments

Comments
 (0)