Skip to content

Commit d8e7b7d

Browse files
authored
Update web3 dependency (#212)
* Feature: Update web3 dependency * Fix: Reduce minimal ETH balance to 0.001 instead 0.005 * Fix: Change `rawTransaction` method to the new `raw_transaction` * Fix: Solve python 3.9 dependencies for coincurve
1 parent 142fc18 commit d8e7b7d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ dependencies = [
3131
"aiohttp>=3.8.3",
3232
"aioresponses>=0.7.6",
3333
"aleph-message>=1",
34-
"aleph-superfluid>=0.2.1",
35-
"base58==2.1.1", # Needed now as default with _load_account changement
36-
"coincurve; python_version<'3.11'",
37-
"coincurve>=19; python_version>='3.11'",
38-
"eth-abi>=4; python_version>='3.11'",
39-
"eth-typing==4.3.1",
34+
"aleph-superfluid @ git+https://github.com/aleph-im/superfluid.py",
35+
"base58==2.1.1", # Needed now as default with _load_account changement
36+
"coincurve; python_version>='3.9'",
37+
"coincurve>=19; python_version>='3.9'",
38+
"eth-abi>=5.0.1; python_version>='3.9'",
39+
"eth-typing>=5.0.1",
4040
"jwcrypto==1.5.6",
4141
"pydantic>=2,<3",
4242
"pydantic-settings>=2",
43-
"pynacl==1.5", # Needed now as default with _load_account changement
43+
"pynacl==1.5", # Needed now as default with _load_account changement
4444
"python-magic",
4545
"typing-extensions",
46-
"web3==6.3",
46+
"web3>=7.10",
4747
]
4848

4949
optional-dependencies.all = [

src/aleph/sdk/chains/ethereum.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from eth_keys.exceptions import BadSignature as EthBadSignatureError
1212
from superfluid import Web3FlowInfo
1313
from web3 import Web3
14-
from web3.middleware import geth_poa_middleware
14+
from web3.middleware import ExtraDataToPOAMiddleware
1515
from web3.types import TxParams, TxReceipt
1616

1717
from aleph.sdk.exceptions import InsufficientFundsError
@@ -104,7 +104,7 @@ def connect_chain(self, chain: Optional[Chain] = None):
104104
self._provider = Web3(Web3.HTTPProvider(self.rpc))
105105
if chain == Chain.BSC:
106106
self._provider.middleware_onion.inject(
107-
geth_poa_middleware, "geth_poa", layer=0
107+
ExtraDataToPOAMiddleware, "geth_poa", layer=0
108108
)
109109
else:
110110
self.chain_id = None
@@ -144,7 +144,7 @@ def sign_and_send() -> TxReceipt:
144144
signed_tx = self._provider.eth.account.sign_transaction(
145145
tx_params, self._account.key
146146
)
147-
tx_hash = self._provider.eth.send_raw_transaction(signed_tx.rawTransaction)
147+
tx_hash = self._provider.eth.send_raw_transaction(signed_tx.raw_transaction)
148148
tx_receipt = self._provider.eth.wait_for_transaction_receipt(
149149
tx_hash, settings.TX_TIMEOUT
150150
)

src/aleph/sdk/evm_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from .conf import settings
1111

12-
MIN_ETH_BALANCE: float = 0.005
12+
MIN_ETH_BALANCE: float = 0.001
1313
MIN_ETH_BALANCE_WEI = Decimal(to_wei(MIN_ETH_BALANCE, "ether"))
1414
BALANCEOF_ABI = """[{
1515
"name": "balanceOf",

0 commit comments

Comments
 (0)