Skip to content

Commit

Permalink
Update evm.py (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkoch78 authored Feb 7, 2025
1 parent 0f40685 commit 7ba866c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alphaswarm/services/chains/evm/evm.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_contract(self, address: ChecksumAddress, abi: List[dict]) -> Contract:
return self._client.eth.contract(address=address, abi=abi)

def _build_transaction(self, function: ContractFunction, wallet_address: ChecksumAddress) -> TxParams:
latest_block = self._client.eth.get_block("latest")
latest_block = self.get_block_latest()
base_fee = latest_block["baseFeePerGas"]
priority_fee = self._client.eth.max_priority_fee
max_fee_per_gas = self._client.to_wei(base_fee * 2 + priority_fee, "wei")
Expand All @@ -118,7 +118,7 @@ def _build_transaction(self, function: ContractFunction, wallet_address: Checksu
"from": wallet_address,
"maxFeePerGas": max_fee_per_gas,
"maxPriorityFeePerGas": priority_fee,
"nonce": self._client.eth.get_transaction_count(wallet_address),
"nonce": self._client.eth.get_transaction_count(wallet_address, "pending"),
}
)

Expand Down

0 comments on commit 7ba866c

Please sign in to comment.