Skip to content

Commit a5e30c2

Browse files
committed
Chain parity tweaks
- Don't override builtin `bin` function - Document containers with labels
1 parent ca6a6d4 commit a5e30c2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

docker-compose.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,23 @@ version: "3"
33
services:
44
ganache:
55
image: "trufflesuite/ganache-cli:latest"
6-
# Corresponding account address: 0xD68D840e1e971750E6d45049ff579925456d5893
76
command: "--account=\"0x3660582119566511de16f4dcf397fa324b27bd6247f653cf0298a0993f3432ed,100000000000000000000\""
87
ports:
98
- "8545:8545"
109
depends_on:
1110
- compiler
11+
labels:
12+
net.consensys.description: >
13+
Starts an instance of ganache-cli for chain parity tests.
14+
Unlocks address 0xD68D840e1e971750E6d45049ff579925456d5893"
1215
1316
compiler:
1417
image: "ethereum/solc:stable"
1518
command: "--abi --bin -o /tmp/contracts/build --overwrite /tmp/contracts/hash_test_contract.sol"
1619
volumes:
17-
- ./tests/contracts:/tmp/contracts
20+
- ./tests/contracts:/tmp/contracts
21+
labels:
22+
net.consensys.description: >
23+
Compiles ./tests/contracts/hash_test_contract.sol. Places generated files in ./tests/contracts/build/.
24+
Generates JSON ABI and Bytecode hex: TestContract.abi, TestContract.bin.
25+
See ./tests/test_chain_parity.py::contract to see how this is deployed.

tests/test_chain_parity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def contract(w3):
2626
with open(f'{base_path}.abi', 'r') as f:
2727
abi = f.read()
2828
with open(f'{base_path}.bin', 'r') as f:
29-
bin = f.read()
29+
bytecode = f.read()
3030

31-
tmp_contract = w3.eth.contract(abi=abi, bytecode=bin)
31+
tmp_contract = w3.eth.contract(abi=abi, bytecode=bytecode)
3232
deploy_hash = tmp_contract.constructor().transact()
3333
deploy_receipt = w3.eth.waitForTransactionReceipt(deploy_hash)
3434

0 commit comments

Comments
 (0)