Skip to content

Commit

Permalink
remove parity namespace and refs
Browse files Browse the repository at this point in the history
  • Loading branch information
wolovim committed Nov 16, 2022
1 parent de95191 commit 30e16a1
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 410 deletions.
25 changes: 4 additions & 21 deletions docs/README-freebsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

### Prerequisites

Make sure you've UTF-8 defined for charset and lang in your [~/.login_conf](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/using-localization.html),
Make sure you've UTF-8 defined for charset and lang in your [~/.login_conf](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/using-localization.html),
otherwise almost every Python 3 module will fail to install.

`~/.login_conf`:

```
me:\
:charset=UTF-8:\
Expand All @@ -17,6 +18,7 @@ me:\
Also make sure you've defined valid include and library paths in `~/.pydistutils.cfg`, otherwise native compilations fail.

`~/.pydistutils.cfg`:

```
[build_ext]
include_dirs=/usr/local/include
Expand Down Expand Up @@ -48,6 +50,7 @@ pip install -e .\[dev\]
#### Prerequisites for integration tests:

##### geth (https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-FreeBSD)

```
pkg install go
cd /tmp
Expand All @@ -56,23 +59,3 @@ cd go-ethereum
make geth
cp build/bin/geth /usr/local/bin/
```

##### parity (https://github.com/paukstis/freebsd_parity/blob/v1.6/README.md)
```
BROKEN (build crashes on FreeBSD 11.2)
```

```
cd web3.py
tox -e py36-core
tox -e py36-ens
tox -e py36-integration
etc
or
py.test tests/core
py.test tests/ens
py.test tests/integration
etc
```
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ Table of Contents
web3.net
web3.miner
web3.geth
web3.parity
web3.utils
gas_price
ens
Expand Down
2 changes: 1 addition & 1 deletion docs/middleware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Middleware Order
~~~~~~~~~~~~~~~~~~

Think of the middleware as being layered in an onion, where you initiate a web3.py request at
the outermost layer of the onion, and the Ethereum node (like geth or parity) receives and responds
the outermost layer of the onion, and the Ethereum node (like geth) receives and responds
to the request inside the innermost layer of the onion. Here is a (simplified) diagram:

.. code-block:: none
Expand Down
32 changes: 8 additions & 24 deletions docs/node.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ How do I choose which node to use?
Due to the nature of Ethereum, this is largely a question of personal preference, but
it has significant ramifications on security and usability. Further, node software is
evolving quickly, so please do your own research about the current options.
We won't advocate for any particular node,
but list some popular options and some basic details on each.

One of the key decisions is whether to use a local node or a hosted
node. A quick summary is at :ref:`local_vs_hosted`.
Expand All @@ -47,20 +45,16 @@ node manage keys for you (a popular option), you must use a local node.
Note that even if you run a node on your own machine, you are still trusting
the node software with any accounts you create on the node.

The most popular self-run node options are:

- `geth (go-ethereum) <https://ethereum.github.io/go-ethereum/>`_
- `parity <https://www.parity.io/>`_

You can find a fuller list of node software at `ethdocs.org
<http://ethdocs.org/en/latest/ethereum-clients/>`_.
You can find a list of node software at `ethereum.org
<https://ethereum.org/en/developers/docs/nodes-and-clients/>`__.

Some people decide that the time it takes to sync a local node from scratch is too
high, especially if they are just exploring Ethereum for the first time. One way to
work around this issue is to use a hosted node.

The most popular hosted node option is `Infura <infura.io>`_.
You can connect to it as if it were a local node,
Hosted node options can also be found at
`ethereum.org <https://ethereum.org/en/developers/docs/nodes-and-clients/nodes-as-a-service/>`__.
You can connect to a hosted node as if it were a local node,
with a few caveats. It cannot (and *should not*) host private keys for
you, meaning that some common methods like :meth:`w3.eth.send_transaction()
<web3.eth.Eth.send_transaction>` are not directly available. To send transactions
Expand Down Expand Up @@ -94,20 +88,10 @@ then you connect to the main Ethereum network.

If you want to test these things without using real ether, though, then you
need to connect to a test network. There are several test networks to
choose from, Rinkeby and Goerli being the longest running.

There are some alternative networks that limit the damage of spam attacks, but
they are not standardized across node software. Geth runs their own (Rinkeby).
See a full comparison in this `Stackexchange Q&A
<https://ethereum.stackexchange.com/a/30072/1461>`_.

So roughly, choose this way:

- If using Parity, connect to Kovan
- If using Geth, connect to Rinkeby
- If using a different node, or testing mining, connect to Ropsten
choose from; view the list on
`ethereum.org <https://ethereum.org/en/developers/docs/networks/#ethereum-testnets>`__.

Each of their networks has their own version of Ether. Main network ether must
Each network has its own version of Ether. Main network ether must
be purchased, naturally, but test network ether is usually available for free.
See :ref:`faucets`

Expand Down
2 changes: 1 addition & 1 deletion docs/web3.eth.account.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Local vs Hosted Nodes

Local Node
A local node is started and controlled by you. It is as safe as you keep it.
When you run ``geth`` or ``parity`` on your machine, you are running a local node.
When you run ``geth`` on your machine, for example, you are running a local node.

Hosted Node
A hosted node is controlled by someone else. When you connect to Infura, you are
Expand Down
2 changes: 1 addition & 1 deletion docs/web3.geth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ GethTxPool API

The ``web3.geth.txpool`` object exposes methods to interact with the RPC APIs under
the ``txpool_`` namespace. These methods are only exposed under the ``geth`` namespace
since they are not standard nor supported in Parity.
since they are not standard.

The following methods are available on the ``web3.geth.txpool`` namespace.

Expand Down
4 changes: 0 additions & 4 deletions docs/web3.main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,6 @@ Each ``Web3`` instance also exposes these namespaced API modules.
See :doc:`./web3.geth`

.. py:attribute:: Web3.parity
See :doc:`./web3.parity`


These internal modules inherit from the ``web3.module.Module`` class which give them some configurations internal to the
web3.py library.
Expand Down
82 changes: 0 additions & 82 deletions docs/web3.parity.rst

This file was deleted.

1 change: 1 addition & 0 deletions newsfragments/2718.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove Parity module and references.
8 changes: 0 additions & 8 deletions web3/_utils/method_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
from web3.exceptions import (
BlockNotFound,
ContractLogicError,
InvalidParityMode,
OffchainLookup,
TransactionNotFound,
)
Expand Down Expand Up @@ -642,16 +641,9 @@ def raise_contract_logic_error_on_revert(response: RPCResponse) -> RPCResponse:
return response


def raise_invalid_parity_mode(response: RPCResponse) -> NoReturn:
# eth-tester sends back an invalid RPCError, which makes mypy complain
error_message = response["error"].get("message") # type: ignore
raise InvalidParityMode(error_message)


ERROR_FORMATTERS: Dict[RPCEndpoint, Callable[..., Any]] = {
RPC.eth_estimateGas: raise_contract_logic_error_on_revert,
RPC.eth_call: raise_contract_logic_error_on_revert,
RPC.parity_setMode: raise_invalid_parity_mode,
}


Expand Down
10 changes: 0 additions & 10 deletions web3/_utils/rpc_abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,6 @@ class RPC:
net_peerCount = RPCEndpoint("net_peerCount")
net_version = RPCEndpoint("net_version")

# parity
parity_addReservedPeer = RPCEndpoint("parity_addReservedPeer")
parity_enode = RPCEndpoint("parity_enode")
parity_listStorageKeys = RPCEndpoint("parity_listStorageKeys")
parity_netPeers = RPCEndpoint("parity_netPeers")
parity_mode = RPCEndpoint("parity_mode")
parity_setMode = RPCEndpoint("parity_setMode")

# personal
personal_ecRecover = RPCEndpoint("personal_ecRecover")
personal_importRawKey = RPCEndpoint("personal_importRawKey")
Expand Down Expand Up @@ -220,8 +212,6 @@ class RPC:
"personal_sign": [None, "address", None],
"personal_signTypedData": [None, "address", None],
"trace_call": TRACE_PARAMS_ABIS,
# parity
"parity_listStorageKeys": ["address", None, None, None],
}


Expand Down
8 changes: 0 additions & 8 deletions web3/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,6 @@ def __init__(self, payload: Dict[str, Any]) -> None:
super().__init__()


class InvalidParityMode(TypeError, ValueError):
# Inherits from TypeError for backwards compatibility
"""
Raised when web3.parity.set_mode() is called with no or invalid args
"""
pass


class InvalidTransaction(Exception):
"""
Raised when a transaction includes an invalid combination of arguments.
Expand Down
11 changes: 0 additions & 11 deletions web3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@
AsyncNet,
Net,
)
from web3.parity import (
Parity,
ParityPersonal,
)
from web3.providers import (
AsyncBaseProvider,
BaseProvider,
Expand Down Expand Up @@ -138,12 +134,6 @@ def get_default_modules() -> Dict[str, Union[Type[Module], Sequence[Any]]]:
"eth": Eth,
"net": Net,
"version": Version,
"parity": (
Parity,
{
"personal": ParityPersonal,
},
),
"geth": (
Geth,
{
Expand Down Expand Up @@ -231,7 +221,6 @@ def to_checksum_address(value: Union[AnyAddress, str, bytes]) -> ChecksumAddress

# mypy Types
eth: Eth
parity: Parity
geth: Geth
net: Net
async_net: AsyncNet
Expand Down
Loading

0 comments on commit 30e16a1

Please sign in to comment.