Skip to content

Commit 9b193b4

Browse files
Merge pull request #403 from clearmatics/fix-zeth-helper
Fix zeth helper
2 parents 1c075bc + e4b1575 commit 9b193b4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

client/zeth/helper/eth_fund.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def eth_fund(
3030
amount: int) -> None:
3131
"""
3232
Fund an address. If no source address is given, the first hosted account on
33-
the RPC host is used.
33+
the RPC host is used. This command should only be used in test environments
34+
such as ganache or autonity-helloworld.
3435
"""
3536
eth_addr = load_eth_address(eth_addr)
3637
eth_network = get_eth_network(ctx.obj["eth_network"])
@@ -45,9 +46,10 @@ def eth_fund(
4546
# with the password 'test'. Attempt to unlock it.
4647
# pylint: disable=import-outside-toplevel, no-member
4748
from web3.middleware import geth_poa_middleware # type: ignore
48-
web3.middleware_stack.inject(geth_poa_middleware, layer=0)
49+
web3.middleware_onion.inject(geth_poa_middleware, layer=0)
4950
web3.personal.unlockAccount(source_addr, "test")
5051

52+
source_addr = load_eth_address(source_addr)
5153
print(f"eth_addr = {eth_addr}")
5254
print(f"source_addr = {source_addr}")
5355
print(f"amount = {amount}")

0 commit comments

Comments
 (0)