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

Drop web3.providers.tester.py (V5 beta) #1199

Merged
merged 2 commits into from
Jan 11, 2019
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
58 changes: 0 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,6 @@ A Python implementation of [web3.js](https://github.com/ethereum/web3.js)

Read more in the [documentation on ReadTheDocs](http://web3py.readthedocs.io/). [View the change log on Github](docs/releases.rst).

## Quickstart

```python
import json
import web3

from web3 import Web3, HTTPProvider, TestRPCProvider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably remove this entire section from the README in favor of just using RTD.

from solc import compile_source
from web3.contract import ConciseContract

# Solidity source code
contract_source_code = '''
pragma solidity ^0.4.0;

contract Greeter {
string public greeting;

function Greeter() {
greeting = 'Hello';
}

function setGreeting(string _greeting) public {
greeting = _greeting;
}

function greet() constant returns (string) {
return greeting;
}
}
'''

compiled_sol = compile_source(contract_source_code) # Compiled source code
contract_interface = compiled_sol['<stdin>:Greeter']

# web3.py instance
w3 = Web3(TestRPCProvider())

# Instantiate and deploy contract
contract = w3.eth.contract(abi=contract_interface['abi'], bytecode=contract_interface['bin'])

# Get transaction hash from deployed contract
tx_hash = contract.deploy(transaction={'from': w3.eth.accounts[0], 'gas': 410000})

# Get tx receipt to get contract address
tx_receipt = w3.eth.getTransactionReceipt(tx_hash)
contract_address = tx_receipt['contractAddress']

# Contract instance in concise mode
abi = contract_interface['abi']
contract_instance = w3.eth.contract(address=contract_address, abi=abi,ContractFactoryClass=ConciseContract)

# Getters + Setters for web3.eth.contract object
print('Contract value: {}'.format(contract_instance.greet()))
contract_instance.setGreeting('Nihao', transact={'from': w3.eth.accounts[0]})
print('Setting value to: Nihao')
print('Contract value: {}'.format(contract_instance.greet()))
```

## Developer Setup

```sh
Expand Down
36 changes: 1 addition & 35 deletions docs/providers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,7 @@ EthereumTesterProvider
~~~~~~~~~~~~~~~~~~~~~~

.. warning:: Experimental: This provider is experimental. There are still significant gaps in
functionality. However, it is the default replacement for
:class:`web3.providers.tester.EthereumTesterProvider`
and is being actively developed and supported.
functionality. However it is being actively developed and supported.

.. py:class:: EthereumTesterProvider(eth_tester=None)

Expand All @@ -312,38 +310,6 @@ EthereumTesterProvider
>>> w3 = Web3(EthereumTesterProvider())



EthereumTesterProvider (legacy)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. warning:: Deprecated: This provider is deprecated in favor of
:class:`~web3.providers.eth_tester.EthereumTesterProvider` and the newly created eth-tester.

.. py:class:: web3.providers.tester.EthereumTesterProvider()

This provider can be used for testing. It uses an ephemeral blockchain
backed by the ``ethereum.tester`` module.

.. code-block:: python

>>> from web3 import Web3
>>> from web3.providers.tester import EthereumTesterProvider
>>> w3 = Web3(EthereumTesterProvider())

TestRPCProvider
~~~~~~~~~~~~~~~

.. warning:: Deprecated: This provider is deprecated in favor of
:class:`~web3.providers.eth_tester.EthereumTesterProvider` and the newly created eth-tester.

.. py:class:: TestRPCProvider()

This provider can be used for testing. It uses an ephemeral blockchain
backed by the ``ethereum.tester`` module. This provider will be slower
than the ``EthereumTesterProvider`` since it uses an HTTP server for RPC
interactions with.


AutoProvider
~~~~~~~~~~~~

Expand Down
3 changes: 0 additions & 3 deletions web3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
from web3.providers.eth_tester import ( # noqa: E402
EthereumTesterProvider,
)
from web3.providers.tester import ( # noqa: E402
TestRPCProvider,
)
from web3.providers.ipc import ( # noqa: E402
IPCProvider,
)
Expand Down
4 changes: 0 additions & 4 deletions web3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@
from web3.providers.rpc import (
HTTPProvider,
)
from web3.providers.tester import (
TestRPCProvider,
)
from web3.providers.websocket import (
WebsocketProvider,
)
Expand Down Expand Up @@ -102,7 +99,6 @@ class Web3:
# Providers
HTTPProvider = HTTPProvider
IPCProvider = IPCProvider
TestRPCProvider = TestRPCProvider
EthereumTesterProvider = EthereumTesterProvider
WebsocketProvider = WebsocketProvider

Expand Down
163 changes: 0 additions & 163 deletions web3/providers/tester.py

This file was deleted.