Skip to content

Commit

Permalink
catch missing baseFee
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy committed Oct 25, 2023
1 parent 7fcca39 commit 514a6b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions boa/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def get_gas_price(self) -> int:
return self._gas_price
return to_int(self._rpc.fetch("eth_gasPrice", []))

def get_fee_info(self) -> tuple[str, str, str, str]:
def estimate_eip1559_fee(self) -> tuple[str, str, str, str]:
# returns: base_fee, max_fee, max_priority_fee
reqs = [
("eth_getBlockByNumber", ["pending", False]),
Expand Down Expand Up @@ -367,11 +367,11 @@ def _send_txn(self, from_, to=None, gas=None, value=None, data=None):

try:
# eip-1559 txn
base_fee, max_priority_fee, max_fee, chain_id = self.get_fee_info()
base_fee, max_priority_fee, max_fee, chain_id = self.estimate_eip1559_fee()
tx_data["maxPriorityFeePerGas"] = max_priority_fee
tx_data["maxFeePerGas"] = max_fee
tx_data["chainId"] = chain_id
except RPCError:
except (RPCError, KeyError):
tx_data["gasPrice"] = to_hex(self.get_gas_price())

tx_data["nonce"] = self._get_nonce(from_)
Expand Down

0 comments on commit 514a6b0

Please sign in to comment.