Skip to content

Commit

Permalink
Upgrade web3 version to 6.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-stakewise committed Oct 2, 2023
1 parent 3cc4a53 commit f0dbea0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 32 deletions.
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sw-utils"
version = "0.3.25"
version = "0.3.26"
description = "StakeWise Python utils"
authors = ["StakeWise Labs <[email protected]>"]
license = "GPL-3.0-or-later"
Expand All @@ -12,7 +12,7 @@ milagro-bls-binding = "==1.9.0"
py-ecc = "^6.0.0"
ipfshttpclient = "^0.8.0a2"
types-requests = "^2.28.11.15"
web3 = "==6.8.0"
web3 = "==6.10.0"
tenacity = "==8.2.2"
pyrsistent = "0.19.3"

Expand Down
26 changes: 1 addition & 25 deletions sw_utils/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,30 +111,6 @@ def set_retry_timeout(self, retry_timeout: int):
self.retry_timeout = retry_timeout


# pylint: disable=abstract-method
class ExtendedAsyncEth(AsyncEth):
"""
todo: remove when PR gets merged
https://github.com/ethereum/web3.py/pull/3084
"""

@property
async def max_priority_fee(self) -> Wei:
"""
Try to use eth_maxPriorityFeePerGas but, since this is not part
of the spec and is only supported by some clients, fall back to
an eth_feeHistory calculation with min and max caps.
"""
try:
return await self._max_priority_fee()
except (ValueError, MethodUnavailable):
warnings.warn(
'There was an issue with the method eth_maxPriorityFeePerGas. '
'Calculating using eth_feeHistory.'
)
return await async_fee_history_priority_fee(self)


def get_execution_client(
endpoints: list[str], is_poa=False, timeout=60, retry_timeout=0
) -> AsyncWeb3:
Expand All @@ -143,7 +119,7 @@ def get_execution_client(
)
client = AsyncWeb3(
provider,
modules={'eth': (ExtendedAsyncEth,), 'net': AsyncNet},
modules={'eth': (AsyncEth,), 'net': AsyncNet},
)

if is_poa:
Expand Down

0 comments on commit f0dbea0

Please sign in to comment.