Skip to content

Commit

Permalink
docs: add web3py intersphinx references
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed Apr 29, 2020
1 parent 260cc31 commit d091038
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
14 changes: 7 additions & 7 deletions docs/api-network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The ``main`` module contains methods for conncting to or disconnecting from the

* If no argument is given, the current default is displayed.
* If an integer value is given, this will be the default gas limit.
* If set to ``auto``, the gas limit is determined automatically via ``web3.eth.estimateGas``.
* If set to ``auto``, the gas limit is determined automatically via :meth:`web3.eth.estimateGas <web3.eth.Eth.estimateGas>`.

Returns ``False`` if the gas limit is set automatically, or an ``int`` if it is set to a fixed value.

Expand All @@ -81,7 +81,7 @@ The ``main`` module contains methods for conncting to or disconnecting from the
Gets and optionally sets the default gas price.

* If an integer value is given, this will be the default gas price.
* If set to ``auto``, the gas price is determined automatically via ``web3.eth.getPrice``.
* If set to ``auto``, the gas price is determined automatically via :attr:`web3.eth.gasPrice <web3.eth.Eth.gasPrice>`.

Returns ``False`` if the gas price is set automatically, or an ``int`` if it is set to a fixed value.

Expand Down Expand Up @@ -204,7 +204,7 @@ Account
.. py:class:: brownie.network.account.Account
An ethereum address that you control the private key for, and so can send transactions from. Generated automatically from ``web3.eth.accounts`` and stored in the :func:`Accounts <brownie.network.account.Accounts>` container.
An ethereum address that you control the private key for, and so can send transactions from. Generated automatically from :attr:`web3.eth.accounts <web3.eth.Eth.accounts>` and stored in the :func:`Accounts <brownie.network.account.Accounts>` container.
.. code-block:: python
Expand Down Expand Up @@ -318,7 +318,7 @@ LocalAccount

.. py:class:: brownie.network.account.LocalAccount
Functionally identical to :func:`Account <brownie.network.account.Account>`. The only difference is that a ``LocalAccount`` is one where the private key was directly inputted, and so is not found in ``web3.eth.accounts``.
Functionally identical to :func:`Account <brownie.network.account.Account>`. The only difference is that a ``LocalAccount`` is one where the private key was directly inputted, and so is not found in :attr:`web3.eth.accounts <web3.eth.Eth.accounts>`.

.. note:: Resetting the RPC client will delete all ``LocalAccount`` objects from the :func:`Account <brownie.network.account.Accounts>` container.

Expand Down Expand Up @@ -2122,16 +2122,16 @@ TransactionReceipt Methods
``brownie.network.web3``
========================
The ``web3`` module contains a slightly modified version of the web3.py ``Web3`` class that is used throughout various Brownie modules for RPC communication.
The ``web3`` module contains a slightly modified version of the web3.py :class:`Web3 <web3.Web3>` class that is used throughout various Brownie modules for RPC communication.
Web3
----
See the `Web3 API documentation <https://web3py.readthedocs.io/en/stable/web3.main.html#web3.Web3>`_ for detailed information on all the methods and attributes available here. This document only outlines methods that differ from the normal ``Web3`` public interface.
See the `Web3 API documentation <https://web3py.readthedocs.io/en/stable/web3.main.html#web3.Web3>`_ for detailed information on all the methods and attributes available here. This document only outlines methods that differ from the normal :class:`Web3 <web3.Web3>` public interface.
.. py:class:: brownie.network.web3.Web3
Brownie subclass of ``Web3``. An instance is created at ``brownie.network.web3.web`` and available for import from the main package.
Brownie subclass of :class:`Web3 <web3.Web3>`. An instance is created at ``brownie.network.web3.web`` and available for import from the main package.
.. code-block:: python
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,5 @@ def setup(sphinx):
"hypothesis": ("https://hypothesis.readthedocs.io/en/latest", None),
"pytest": ("https://docs.pytest.org/en/latest/", None),
"python": ("https://docs.python.org/3.8/", None),
"web3py": ("https://web3py.readthedocs.io/en/stable/", None),
}
6 changes: 3 additions & 3 deletions docs/core-contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ Transaction Parameters
When executing a transaction to a contract, you can optionally include a :py:class:`dict <dict>` of transaction parameters as the final input. It may contain the following values:

* ``from``: the :func:`Account <brownie.network.account.Account>` that the transaction it sent from. If not given, the transaction is sent from the account that deployed the contract.
* ``gas_limit``: The amount of gas provided for transaction execution, in wei. If not given, the gas limit is determined using ``web3.eth.estimateGas``.
* ``gas_price``: The gas price for the transaction, in wei. If not given, the gas price is set according to ``web3.eth.getPrice``.
* ``gas_limit``: The amount of gas provided for transaction execution, in wei. If not given, the gas limit is determined using :meth:`web3.eth.estimateGas <web3.eth.Eth.estimateGas>`.
* ``gas_price``: The gas price for the transaction, in wei. If not given, the gas price is set according to :attr:`web3.eth.gasPrice <web3.eth.Eth.gasPrice>`.
* ``amount``: The amount of Ether to include with the transaction, in wei.

All integer values can also be given as strings that will be converted by :func:`Wei <brownie.convert.datatypes.Wei>`.

.. note::

To maintain compatibility with ``web3.eth.sendTransaction``, you can use ``gas``, ``gasPrice`` and ``value`` as aliases for ``gas_limit``, ``gas_price``, and ``amount``.
To maintain compatibility with :meth:`web3.eth.sendTransaction <web3.eth.Eth.sendTransaction>`, you can use ``gas``, ``gasPrice`` and ``value`` as aliases for ``gas_limit``, ``gas_price``, and ``amount``.

Calls
-----
Expand Down
2 changes: 1 addition & 1 deletion docs/core-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The :func:`Fixed <brownie.convert.datatypes.Fixed>` class is used to handle Vype
True
Attempting to assign, compare or perform arithmetic against a float raises a ``TypeError``.
Attempting to assign, compare or perform arithmetic against a float raises a :class:`TypeError`.

.. code-block:: python
Expand Down

0 comments on commit d091038

Please sign in to comment.