Skip to content

Commit 9d3690d

Browse files
authored
Merge branch 'master' into tiffany/getFilterChanges-to-snakecase
2 parents 268119d + d9accbe commit 9d3690d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+555
-280
lines changed

.circleci/config.yml

+74-40
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2.0
1+
version: 2.1
22

33
# heavily inspired by https://raw.githubusercontent.com/pinax/pinax-wiki/6bd2a99ab6f702e300d708532a6d1d9aa638b9f8/.circleci/config.yml
44

@@ -116,7 +116,7 @@ ethpm_steps: &ethpm_steps
116116
- checkout
117117
- restore_cache:
118118
keys:
119-
- cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
119+
- ethpm-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
120120
- run:
121121
name: install ipfs
122122
command:
@@ -142,10 +142,34 @@ ethpm_steps: &ethpm_steps
142142
- .tox
143143
- ~/.cache/pip
144144
- ~/.local
145-
- ./eggs
146-
- ~/.ethash
147-
- ~/.py-geth
148-
key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
145+
key: ethpm-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
146+
147+
orbs:
148+
win: circleci/windows@2.2.0
149+
150+
windows_steps: &windows_steps
151+
executor:
152+
name: win/default
153+
shell: bash.exe
154+
working_directory: C:\Users\circleci\project\web3py
155+
steps:
156+
- checkout
157+
- restore_cache:
158+
keys:
159+
- windows-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
160+
- run:
161+
name: checkout ethpm-spec submodule
162+
command: git submodule update --init --recursive
163+
- run:
164+
name: install dependencies
165+
command: pip install --user tox
166+
- run:
167+
name: run tox
168+
command: 'C:/Users/circleci/AppData/Roaming/Python/Python37/Scripts/tox.exe -r'
169+
- save_cache:
170+
paths:
171+
- .tox
172+
key: windows-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
149173

150174

151175
jobs:
@@ -189,29 +213,29 @@ jobs:
189213
# Please don't use this key for any shenanigans
190214
WEB3_INFURA_PROJECT_ID: 7707850c2fb7465ebe6f150d67182e22
191215

192-
py36-integration-goethereum-ipc-1.9.19:
216+
py36-integration-goethereum-ipc:
193217
<<: *geth_steps
194218
docker:
195219
- image: circleci/python:3.6
196220
environment:
197221
TOXENV: py36-integration-goethereum-ipc
198-
GETH_VERSION: v1.9.19
222+
GETH_VERSION: v1.10.1
199223

200-
py36-integration-goethereum-http-1.9.19:
224+
py36-integration-goethereum-http:
201225
<<: *geth_steps
202226
docker:
203227
- image: circleci/python:3.6
204228
environment:
205229
TOXENV: py36-integration-goethereum-http
206-
GETH_VERSION: v1.9.19
230+
GETH_VERSION: v1.10.1
207231

208-
py36-integration-goethereum-ws-1.9.19:
232+
py36-integration-goethereum-ws:
209233
<<: *geth_steps
210234
docker:
211235
- image: circleci/python:3.6
212236
environment:
213237
TOXENV: py36-integration-goethereum-ws
214-
GETH_VERSION: v1.9.19
238+
GETH_VERSION: v1.10.1
215239

216240
# py36-integration-parity-ipc:
217241
# <<: *parity_steps
@@ -247,12 +271,14 @@ jobs:
247271
environment:
248272
TOXENV: py36-integration-ethtester
249273
ETHEREUM_TESTER_CHAIN_BACKEND: eth_tester.backends.PyEVMBackend
274+
250275
py36-wheel-cli:
251276
<<: *common
252277
docker:
253278
- image: circleci/python:3.6
254-
environment:
255-
TOXENV: py36-wheel-cli
279+
environment:
280+
TOXENV: py36-wheel-cli
281+
256282
#
257283
# Python 3.7
258284
#
@@ -279,29 +305,29 @@ jobs:
279305
# Please don't use this key for any shenanigans
280306
WEB3_INFURA_PROJECT_ID: 7707850c2fb7465ebe6f150d67182e22
281307

282-
py37-integration-goethereum-ipc-1.9.19:
308+
py37-integration-goethereum-ipc:
283309
<<: *geth_steps
284310
docker:
285311
- image: circleci/python:3.7
286312
environment:
287313
TOXENV: py37-integration-goethereum-ipc
288-
GETH_VERSION: v1.9.19
314+
GETH_VERSION: v1.10.1
289315

290-
py37-integration-goethereum-http-1.9.19:
316+
py37-integration-goethereum-http:
291317
<<: *geth_steps
292318
docker:
293319
- image: circleci/python:3.7
294320
environment:
295321
TOXENV: py37-integration-goethereum-http
296-
GETH_VERSION: v1.9.19
322+
GETH_VERSION: v1.10.1
297323

298-
py37-integration-goethereum-ws-1.9.19:
324+
py37-integration-goethereum-ws:
299325
<<: *geth_steps
300326
docker:
301327
- image: circleci/python:3.7
302328
environment:
303329
TOXENV: py37-integration-goethereum-ws
304-
GETH_VERSION: v1.9.19
330+
GETH_VERSION: v1.10.1
305331

306332
# py37-integration-parity-ipc:
307333
# <<: *parity_steps
@@ -337,12 +363,19 @@ jobs:
337363
environment:
338364
TOXENV: py37-integration-ethtester
339365
ETHEREUM_TESTER_CHAIN_BACKEND: eth_tester.backends.PyEVMBackend
366+
340367
py37-wheel-cli:
341368
<<: *common
342369
docker:
343370
- image: circleci/python:3.7
344-
environment:
345-
TOXENV: py37-wheel-cli
371+
environment:
372+
TOXENV: py37-wheel-cli
373+
374+
py37-wheel-cli-windows:
375+
<<: *windows_steps
376+
environment:
377+
TOXENV: py37-wheel-cli-windows
378+
346379
#
347380
# Python 3.8
348381
#
@@ -369,29 +402,29 @@ jobs:
369402
# Please don't use this key for any shenanigans
370403
WEB3_INFURA_PROJECT_ID: 7707850c2fb7465ebe6f150d67182e22
371404

372-
py38-integration-goethereum-ipc-1.9.19:
405+
py38-integration-goethereum-ipc:
373406
<<: *geth_steps
374407
docker:
375408
- image: circleci/python:3.8
376409
environment:
377410
TOXENV: py38-integration-goethereum-ipc
378-
GETH_VERSION: v1.9.19
411+
GETH_VERSION: v1.10.1
379412

380-
py38-integration-goethereum-http-1.9.19:
413+
py38-integration-goethereum-http:
381414
<<: *geth_steps
382415
docker:
383416
- image: circleci/python:3.8
384417
environment:
385418
TOXENV: py38-integration-goethereum-http
386-
GETH_VERSION: v1.9.19
419+
GETH_VERSION: v1.10.1
387420

388-
py38-integration-goethereum-ws-1.9.19:
421+
py38-integration-goethereum-ws:
389422
<<: *geth_steps
390423
docker:
391424
- image: circleci/python:3.8
392425
environment:
393426
TOXENV: py38-integration-goethereum-ws
394-
GETH_VERSION: v1.9.19
427+
GETH_VERSION: v1.10.1
395428

396429
# py38-integration-parity-ipc:
397430
# <<: *parity_steps
@@ -432,11 +465,11 @@ jobs:
432465
<<: *common
433466
docker:
434467
- image: circleci/python:3.8
435-
environment:
436-
TOXENV: py38-wheel-cli
468+
environment:
469+
TOXENV: py38-wheel-cli
437470

438471
workflows:
439-
version: 2
472+
version: 2.1
440473
test:
441474
jobs:
442475
# These are the longest running tests, start them first
@@ -447,29 +480,30 @@ workflows:
447480
- docs
448481
- py36-ens
449482
- py36-ethpm
450-
- py36-integration-goethereum-ipc-1.9.19
451-
- py36-integration-goethereum-http-1.9.19
452-
- py36-integration-goethereum-ws-1.9.19
483+
- py36-integration-goethereum-ipc
484+
- py36-integration-goethereum-http
485+
- py36-integration-goethereum-ws
453486
# - py36-integration-parity-ipc
454487
# - py36-integration-parity-http
455488
# - py36-integration-parity-ws
456489
- py36-integration-ethtester-pyevm
457490
- py36-wheel-cli
458491
- py37-ens
459492
- py37-ethpm
460-
- py37-integration-goethereum-ipc-1.9.19
461-
- py37-integration-goethereum-http-1.9.19
462-
- py37-integration-goethereum-ws-1.9.19
493+
- py37-integration-goethereum-ipc
494+
- py37-integration-goethereum-http
495+
- py37-integration-goethereum-ws
463496
# - py37-integration-parity-ipc
464497
# - py37-integration-parity-http
465498
# - py37-integration-parity-ws
466499
- py37-integration-ethtester-pyevm
467500
- py37-wheel-cli
501+
- py37-wheel-cli-windows
468502
- py38-ens
469503
- py38-ethpm
470-
- py38-integration-goethereum-ipc-1.9.19
471-
- py38-integration-goethereum-http-1.9.19
472-
- py38-integration-goethereum-ws-1.9.19
504+
- py38-integration-goethereum-ipc
505+
- py38-integration-goethereum-http
506+
- py38-integration-goethereum-ws
473507
# - py38-integration-parity-ipc
474508
# - py38-integration-parity-http
475509
# - py38-integration-parity-ws

docs/contracts.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ To run this example, you will need to install a few extra features:
8484
>>> tx_hash = Greeter.constructor().transact()
8585
8686
# Wait for the transaction to be mined, and get the transaction receipt
87-
>>> tx_receipt = w3.eth.waitForTransactionReceipt(tx_hash)
87+
>>> tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
8888
8989
>>> greeter = w3.eth.contract(
9090
... address=tx_receipt.contractAddress,
@@ -95,7 +95,7 @@ To run this example, you will need to install a few extra features:
9595
'Hello'
9696
9797
>>> tx_hash = greeter.functions.setGreeting('Nihao').transact()
98-
>>> tx_receipt = w3.eth.waitForTransactionReceipt(tx_hash)
98+
>>> tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
9999
>>> greeter.functions.greet().call()
100100
'Nihao'
101101
@@ -686,7 +686,7 @@ Taking the following contract code as an example:
686686
>>> ArraysContract = w3.eth.contract(abi=abi, bytecode=bytecode)
687687

688688
>>> tx_hash = ArraysContract.constructor([b'b']).transact()
689-
>>> tx_receipt = w3.eth.waitForTransactionReceipt(tx_hash)
689+
>>> tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
690690

691691
>>> array_contract = w3.eth.contract(
692692
... address=tx_receipt.contractAddress,
@@ -1069,15 +1069,15 @@ Event Log Object
10691069
assert bob == '0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF', bob
10701070
tx_hash = my_token_contract.constructor(1000000).transact({'from': alice, 'gas': 899000, 'gasPrice': 320000})
10711071
assert tx_hash == HexBytes('0x611aa2d5c3e51f08d0665c4529c5520ed32520d8a48ba2cf2aff3f2fce3f26e4'), tx_hash
1072-
txn_receipt = w3.eth.waitForTransactionReceipt(tx_hash)
1072+
txn_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
10731073
assert txn_receipt['contractAddress'] == '0xF2E246BB76DF876Cef8b38ae84130F4F55De395b', txn_receipt['contractAddress']
10741074
contract_address = txn_receipt['contractAddress']
10751075
contract = w3.eth.contract(contract_address, abi=ABI)
10761076
total_supply = contract.functions.totalSupply().call()
10771077
decimals = 10 ** 18
10781078
assert total_supply == 1000000 * decimals, total_supply
10791079
tx_hash = contract.functions.transfer(alice, 10).transact({'gas': 899000, 'gasPrice': 200000})
1080-
tx_receipt = w3.eth.waitForTransactionReceipt(tx_hash)
1080+
tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
10811081

10821082
.. doctest:: createFilter
10831083

@@ -1096,7 +1096,7 @@ Event Log Object
10961096
>>> transfer_filter.get_new_entries()
10971097
[]
10981098
>>> tx_hash = contract.functions.transfer(alice, 10).transact({'gas': 899000, 'gasPrice': 200000})
1099-
>>> tx_receipt = w3.eth.waitForTransactionReceipt(tx_hash)
1099+
>>> tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
11001100
>>> transfer_filter.get_new_entries()
11011101
[AttributeDict({'args': AttributeDict({'from': '0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf',
11021102
'to': '0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf',
@@ -1173,7 +1173,7 @@ For example:
11731173
ABI = json.loads('[{"constant":false,"inputs":[],"name":"return13","outputs":[{"name":"result","type":"int256"}],"type":"function"},{"constant":true,"inputs":[],"name":"counter","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"amt","type":"uint256"}],"name":"increment","outputs":[{"name":"result","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"a","type":"int256"},{"name":"b","type":"int256"}],"name":"add","outputs":[{"name":"result","type":"int256"}],"type":"function"},{"constant":false,"inputs":[],"name":"increment","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"a","type":"int256"}],"name":"multiply7","outputs":[{"name":"result","type":"int256"}],"type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"increased","type":"event"}]')
11741174
contract = w3.eth.contract(abi=ABI, bytecode=bytecode)
11751175
deploy_txn = contract.constructor().transact()
1176-
deploy_receipt = w3.eth.waitForTransactionReceipt(deploy_txn)
1176+
deploy_receipt = w3.eth.wait_for_transaction_receipt(deploy_txn)
11771177
address = deploy_receipt.contractAddress
11781178

11791179
.. doctest:: contractcaller

docs/contributing.rst

+16-10
Original file line numberDiff line numberDiff line change
@@ -272,22 +272,28 @@ generated.
272272
Geth fixtures
273273
^^^^^^^^^^^^^
274274

275-
1. Install the desired Geth version on your machine locally. The Geth team only
276-
explicitly supports the current version of their client at any given point,
277-
so older versions are best installed via `py-geth`_. Note that ``py-geth``
278-
will need updating to support each new version as well.
275+
1. Install the desired Geth version on your machine locally. We recommend `py-geth`_ for
276+
this purpose, because it enables you to easily manage multiple versions of Geth.
279277

280-
2. Specify the Geth binary and run the fixture creation script:
278+
Note that ``py-geth`` will need updating to support each new Geth version as well.
279+
Add newer Geth version to py-geth is straightforward; see past commits for a template.
280+
281+
If py-geth has the Geth version you need, install that version locally. For example:
282+
283+
.. code:: sh
284+
285+
$ python -m geth.install v1.10.1
286+
287+
2. Specify the Geth binary and run the fixture creation script (from within the web3.py directory):
281288

282289
.. code:: sh
283290
284-
$ GETH_BINARY=/path/to/py-geth/bin python /tests/integration/generate_fixtures/go_ethereum.py /tests/integration/geth-X.Y.Z-fixture
291+
$ GETH_BINARY=~/.py-geth/geth-v1.10.1/bin/geth python ./tests/integration/generate_fixtures/go_ethereum.py ./tests/integration/geth-1.10.1-fixture
285292
286-
3. The output of this script is your fixture, a zip file. Store the fixture in the
287-
``/tests/integration/`` directory and update the ``/tests/integration/go_ethereum/conftest.py``
288-
file to point to the new fixture.
293+
3. The output of this script is your fixture, a zip file, which is now stored in ``/tests/integration/``.
294+
Update the ``/tests/integration/go_ethereum/conftest.py`` file to point to this new fixture. Delete the old fixture.
289295

290-
4. Run the tests. To ensure that the tests run with the correct Geth version,
296+
4. Run the tests. To ensure that the tests run with the correct Geth version locally,
291297
you may again include the ``GETH_BINARY`` environment variable.
292298

293299

docs/ethpm.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ LinkableContract
109109
>>> # Deploy SafeSendLib
110110
>>> SafeSendFactory = EscrowPackage.get_contract_factory("SafeSendLib")
111111
>>> safe_send_tx_hash = SafeSendFactory.constructor().transact()
112-
>>> safe_send_tx_receipt = w3.eth.waitForTransactionReceipt(safe_send_tx_hash)
112+
>>> safe_send_tx_receipt = w3.eth.wait_for_transaction_receipt(safe_send_tx_hash)
113113

114114
>>> # Link Escrow factory to deployed SafeSendLib instance
115115
>>> LinkedEscrowFactory = EscrowFactory.link_bytecode({"SafeSendLib": safe_send_tx_receipt.contractAddress})
116116
>>> assert LinkedEscrowFactory.needs_bytecode_linking is False
117117
>>> escrow_tx_hash = LinkedEscrowFactory.constructor(w3.eth.accounts[0]).transact()
118-
>>> escrow_tx_receipt = w3.eth.waitForTransactionReceipt(escrow_tx_hash)
118+
>>> escrow_tx_receipt = w3.eth.wait_for_transaction_receipt(escrow_tx_hash)
119119
>>> assert is_address(escrow_tx_receipt.contractAddress)
120120

121121

0 commit comments

Comments
 (0)