2323from typing import Any , Type
2424
2525import requests
26- from dkg .constants import BLOCKCHAINS , DEFAULT_GAS_PRICE_GWEI
26+ from dkg .constants import BLOCKCHAINS
2727from dkg .exceptions import (
2828 AccountMissing ,
2929 EnvironmentNotSupported ,
@@ -181,13 +181,15 @@ def call_function(
181181 "account."
182182 )
183183
184- gas_price = self .gas_price or gas_price or self ._get_network_gas_price ()
185-
186184 options = {
187- "gasPrice" : gas_price ,
188185 "gas" : gas_limit or contract_function (** args ).estimate_gas (),
189186 }
190187
188+ gas_price = self .gas_price or gas_price or self ._get_network_gas_price ()
189+
190+ if gas_price is not None :
191+ options ["gasPrice" ] = gas_price
192+
191193 tx_hash = contract_function (** args ).transact (options )
192194 tx_receipt = self .w3 .eth .wait_for_transaction_receipt (tx_hash )
193195
@@ -213,12 +215,6 @@ def _get_network_gas_price(self) -> Wei | None:
213215 if self .environment == "development" :
214216 return None
215217
216- blockchain_name , _ = self .blockchain_id .split (":" )
217-
218- default_gas_price = self .w3 .to_wei (
219- DEFAULT_GAS_PRICE_GWEI [blockchain_name ], "gwei"
220- )
221-
222218 def fetch_gas_price (oracle_url : str ) -> Wei | None :
223219 try :
224220 response = requests .get (oracle_url )
@@ -244,7 +240,7 @@ def fetch_gas_price(oracle_url: str) -> Wei | None:
244240 if gas_price is not None :
245241 return gas_price
246242
247- return default_gas_price
243+ return None
248244
249245 def _init_contracts (self ):
250246 for contract in self .abi .keys ():
0 commit comments