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

Client changes to suppot geth-style nodes, such as autonity (depends on #239) #241

Merged
merged 1 commit into from
Aug 25, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions client/commands/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

ETH_RPC_ENDPOINT_DEFAULTS = {
"ganache": "http://localhost:8545",
"autonity-helloworld": "http://localhost:8541",
}

ETH_NETWORK_FILE_DEFAULT = "eth-network"
Expand Down
8 changes: 8 additions & 0 deletions client/test_commands/fund_eth_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ def fund_eth_address(
# Use the first hosted address.
source_addr = web3.eth.accounts[0] # pylint: disable=no-member

if eth_network.name == "autonity-helloworld":
# The Autonity helloworld network supplies hosted accounts, secured
# 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.personal.unlockAccount(source_addr, "test")

print(f"eth_addr = {eth_addr}")
print(f"source_addr = {source_addr}")
print(f"amount = {amount}")
Expand Down
5 changes: 5 additions & 0 deletions zeth_contracts/truffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ module.exports = {
gasprice: 0x1,
network_id: "*" // Match any network id
},
autonityhelloworld: {
host: "localhost",
port: 8541,
network_id: "*",
},
},
mocha: {
useColors: true,
Expand Down