Skip to content

Commit

Permalink
in Sei use o as max_priority_fee
Browse files Browse the repository at this point in the history
  • Loading branch information
zavelevsky committed May 27, 2024
1 parent c7db4ae commit 077f0cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions fastlane_bot/config/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,12 @@ class ConfigNetwork(ConfigBase):
# HOOKS
#######################################################################################
@staticmethod
def gas_strategy(web3):
def gas_strategy(web3, max_priority_fee_supported=True):
gas_price = web3.eth.gas_price # send `eth_gasPrice` request
max_priority_fee = web3.eth.max_priority_fee # send `eth_maxPriorityFeePerGas` request
max_priority_fee = 0
if max_priority_fee_supported:
max_priority_fee = web3.eth.max_priority_fee # send `eth_maxPriorityFeePerGas` request

return {
"maxFeePerGas": gas_price + max_priority_fee,
"maxPriorityFeePerGas": max_priority_fee
Expand Down
2 changes: 1 addition & 1 deletion fastlane_bot/helpers/txhelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _update_transaction(self, tx: dict):
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))
tx.update(self.cfg.network.gas_strategy(self.cfg.w3, self.cfg.network == self.cfg.NETWORK_SEI))

def _sign_transaction(self, tx: dict) -> str:
return self.cfg.w3.eth.account.sign_transaction(tx, self.cfg.ETH_PRIVATE_KEY_BE_CAREFUL).rawTransaction.hex()
Expand Down

0 comments on commit 077f0cd

Please sign in to comment.