Skip to content

Commit

Permalink
Merge pull request #569 from bancorprotocol/ignore-access-list-when-c…
Browse files Browse the repository at this point in the history
…ontaining-an-error

Refrain from including the access-list when it contains an error
  • Loading branch information
barakman authored Apr 24, 2024
2 parents a2e488b + 38ca1be commit 33c5bca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fastlane_bot/helpers/txhelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ def _create_transaction(self, contract, fn_name: str, args: list, value: int) ->
}

def _update_transaction(self, tx: dict):
tx["gas"] = self.cfg.w3.eth.estimate_gas(tx) # occasionally throws an exception
tx["gas"] = self.cfg.w3.eth.estimate_gas(tx) # may throw an exception
if self.use_access_list:
result = self.cfg.w3.eth.create_access_list(tx) # rarely throws an exception
if tx["gas"] > result["gasUsed"]:
result = self.cfg.w3.eth.create_access_list(tx) # may return an error
if tx["gas"] > result["gasUsed"] and "error" not in result:
tx["gas"] = result["gasUsed"]
tx["accessList"] = loads(self.cfg.w3.to_json(result["accessList"]))
tx.update(self.cfg.network.gas_strategy(self.cfg.w3))
Expand Down

0 comments on commit 33c5bca

Please sign in to comment.