Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zeth helper #403

Merged
merged 3 commits into from
Aug 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions client/zeth/helper/eth_fund.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def eth_fund(
amount: int) -> None:
"""
Fund an address. If no source address is given, the first hosted account on
the RPC host is used.
the RPC host is used. This command should only be used in test environments
such as ganache or autonity-helloworld.
"""
eth_addr = load_eth_address(eth_addr)
eth_network = get_eth_network(ctx.obj["eth_network"])
Expand All @@ -45,9 +46,10 @@ def eth_fund(
# with the password 'test'. Attempt to unlock it.
# pylint: disable=import-outside-toplevel, no-member
from web3.middleware import geth_poa_middleware # type: ignore
web3.middleware_stack.inject(geth_poa_middleware, layer=0)
web3.middleware_onion.inject(geth_poa_middleware, layer=0)
web3.personal.unlockAccount(source_addr, "test")

source_addr = load_eth_address(source_addr)
print(f"eth_addr = {eth_addr}")
print(f"source_addr = {source_addr}")
print(f"amount = {amount}")
Expand Down