Skip to content

Commit

Permalink
Move RPC types to their own package
Browse files Browse the repository at this point in the history
  • Loading branch information
fjarri committed May 29, 2024
1 parent 588ea64 commit baa2053
Show file tree
Hide file tree
Showing 32 changed files with 396 additions and 1,262 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ jobs:
pdm run py.test --cov=pons --cov-report=xml tests
- name: Upload coverage
if: matrix.python-version == '3.10'
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}

doctest:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For more information see [the documentation](https://pons.readthedocs.io/en/late
[pypi-license-image]: https://img.shields.io/pypi/l/pons
[rtd-image]: https://readthedocs.org/projects/pons/badge/?version=latest
[rtd-link]: https://pons.readthedocs.io/en/latest/
[cov-image]: https://codecov.io/gh/fjarri/pons/branch/master/graph/badge.svg?token=RZP1LK1HB2
[cov-link]: https://codecov.io/gh/fjarri/pons
[cov-image]: https://codecov.io/gh/fjarri-eth/pons/branch/master/graph/badge.svg?token=RZP1LK1HB2
[cov-link]: https://codecov.io/gh/fjarri-eth/pons
[black-image]: https://img.shields.io/badge/code%20style-black-000000.svg
[black-link]: https://github.com/psf/black
61 changes: 17 additions & 44 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ Testing utilities

``pons`` exposes several types useful for testing applications that connect to Ethereum RPC servers. Not intended for the production environment.

Install with the feature ``local-provider`` for it to be available.


.. autoclass:: LocalProvider
:show-inheritance:
:members: disable_auto_mine_transactions, enable_auto_mine_transactions, take_snapshot, revert_to_snapshot
Expand All @@ -140,6 +143,18 @@ Testing utilities
:special-members: __call__


Compiler
--------

Install with the feature ``compiler`` for it to be available.


.. autofunction:: compile_contract_file

.. autoclass:: EVMVersion
:members:


Secondary classes
-----------------

Expand Down Expand Up @@ -205,57 +220,15 @@ Compiled and deployed contracts
:members:


Entities
--------

.. autoclass:: Amount
:members:

.. class:: pons._entities.CustomAmount

A type derived from :py:class:`Amount`.

.. autoclass:: Address
:members:

.. class:: pons._entities.CustomAddress

A type derived from :py:class:`Address`.

.. autoclass:: Block()
:members:

.. autoclass:: TxHash
:members:

.. autoclass:: BlockHash
:members:

.. autoclass:: pons._entities.TxReceipt()
:members:

.. autoclass:: pons._entities.BlockInfo()
:members:

.. autoclass:: pons._entities.TxInfo()
:members:
Filter objects
--------------

.. autoclass:: pons._entities.BlockFilter()

.. autoclass:: pons._entities.PendingTransactionFilter()

.. autoclass:: pons._entities.LogFilter()

.. autoclass:: pons._entities.LogTopic()

.. autoclass:: pons._entities.LogEntry()
:members:

.. class:: JSON

A JSON-ifiable object (``bool``, ``int``, ``float``, ``str``, ``None``,
iterable of ``JSON``, or mapping of ``str`` to ``JSON``).


Solidity types
--------------
Expand Down
68 changes: 34 additions & 34 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ Fixed
- Expect the block number to be non-null even for pending blocks, since that's what providers return. (PR_70_)


.. _PR_51: https://github.com/fjarri/pons/pull/51
.. _PR_52: https://github.com/fjarri/pons/pull/52
.. _PR_54: https://github.com/fjarri/pons/pull/54
.. _PR_56: https://github.com/fjarri/pons/pull/56
.. _PR_57: https://github.com/fjarri/pons/pull/57
.. _PR_59: https://github.com/fjarri/pons/pull/59
.. _PR_61: https://github.com/fjarri/pons/pull/61
.. _PR_62: https://github.com/fjarri/pons/pull/62
.. _PR_63: https://github.com/fjarri/pons/pull/63
.. _PR_64: https://github.com/fjarri/pons/pull/64
.. _PR_65: https://github.com/fjarri/pons/pull/65
.. _PR_67: https://github.com/fjarri/pons/pull/67
.. _PR_68: https://github.com/fjarri/pons/pull/68
.. _PR_70: https://github.com/fjarri/pons/pull/70
.. _PR_72: https://github.com/fjarri/pons/pull/72
.. _PR_75: https://github.com/fjarri/pons/pull/75
.. _PR_76: https://github.com/fjarri/pons/pull/76
.. _PR_51: https://github.com/fjarri-eth/pons/pull/51
.. _PR_52: https://github.com/fjarri-eth/pons/pull/52
.. _PR_54: https://github.com/fjarri-eth/pons/pull/54
.. _PR_56: https://github.com/fjarri-eth/pons/pull/56
.. _PR_57: https://github.com/fjarri-eth/pons/pull/57
.. _PR_59: https://github.com/fjarri-eth/pons/pull/59
.. _PR_61: https://github.com/fjarri-eth/pons/pull/61
.. _PR_62: https://github.com/fjarri-eth/pons/pull/62
.. _PR_63: https://github.com/fjarri-eth/pons/pull/63
.. _PR_64: https://github.com/fjarri-eth/pons/pull/64
.. _PR_65: https://github.com/fjarri-eth/pons/pull/65
.. _PR_67: https://github.com/fjarri-eth/pons/pull/67
.. _PR_68: https://github.com/fjarri-eth/pons/pull/68
.. _PR_70: https://github.com/fjarri-eth/pons/pull/70
.. _PR_72: https://github.com/fjarri-eth/pons/pull/72
.. _PR_75: https://github.com/fjarri-eth/pons/pull/75
.. _PR_76: https://github.com/fjarri-eth/pons/pull/76


0.7.0 (09-07-2023)
Expand All @@ -88,9 +88,9 @@ Added
- ``Mutability`` enum for defining contract method mutability. (PR_50_)


.. _PR_48: https://github.com/fjarri/pons/pull/48
.. _PR_49: https://github.com/fjarri/pons/pull/49
.. _PR_50: https://github.com/fjarri/pons/pull/50
.. _PR_48: https://github.com/fjarri-eth/pons/pull/48
.. _PR_49: https://github.com/fjarri-eth/pons/pull/49
.. _PR_50: https://github.com/fjarri-eth/pons/pull/50



Expand All @@ -115,7 +115,7 @@ Fixed
- Support the existence of outputs in the JSON ABI of a mutating method. (PR_47_)


.. _PR_47: https://github.com/fjarri/pons/pull/47
.. _PR_47: https://github.com/fjarri-eth/pons/pull/47


0.5.1 (14-11-2022)
Expand All @@ -127,7 +127,7 @@ Fixed
- A bug in processing keyword arguments to contract calls. (PR_42_)


.. _PR_42: https://github.com/fjarri/pons/pull/42
.. _PR_42: https://github.com/fjarri-eth/pons/pull/42


0.5.0 (14-09-2022)
Expand All @@ -145,8 +145,8 @@ Fixed
- Return type of classmethods of ``Amount`` and ``Address`` now provides correct information to ``mypy`` in dependent projects. (PR_37_)


.. _PR_37: https://github.com/fjarri/pons/pull/37
.. _PR_40: https://github.com/fjarri/pons/pull/40
.. _PR_37: https://github.com/fjarri-eth/pons/pull/37
.. _PR_40: https://github.com/fjarri-eth/pons/pull/40


0.4.2 (05-06-2022)
Expand All @@ -170,8 +170,8 @@ Fixed
- Removed ``TxReceipt`` export (making an exception here and not counting it as a breaking change, since nobody would have any use for creating one manually). (PR_32_)


.. _PR_32: https://github.com/fjarri/pons/pull/32
.. _PR_33: https://github.com/fjarri/pons/pull/33
.. _PR_32: https://github.com/fjarri-eth/pons/pull/32
.. _PR_33: https://github.com/fjarri-eth/pons/pull/33


0.4.1 (01-05-2022)
Expand All @@ -185,9 +185,9 @@ Added
- Support for gas overrides in ``transfer()``, ``transact()``, and ``deploy()``. (PR_30_)


.. _PR_27: https://github.com/fjarri/pons/pull/27
.. _PR_29: https://github.com/fjarri/pons/pull/29
.. _PR_30: https://github.com/fjarri/pons/pull/30
.. _PR_27: https://github.com/fjarri-eth/pons/pull/27
.. _PR_29: https://github.com/fjarri-eth/pons/pull/29
.. _PR_30: https://github.com/fjarri-eth/pons/pull/30


0.4.0 (23-04-2022)
Expand All @@ -214,8 +214,8 @@ Added
- ``RemoteError`` and ``Unreachable`` exception types to report errors from client sessions in a standardized way. (PR_5_)


.. _PR_4: https://github.com/fjarri/pons/pull/4
.. _PR_5: https://github.com/fjarri/pons/pull/5
.. _PR_4: https://github.com/fjarri-eth/pons/pull/4
.. _PR_5: https://github.com/fjarri-eth/pons/pull/5


0.3.0 (03-04-2022)
Expand All @@ -236,9 +236,9 @@ Fixed
- Replaced assertions with more informative exceptions. (PR_3_)


.. _PR_1: https://github.com/fjarri/pons/pull/1
.. _PR_2: https://github.com/fjarri/pons/pull/2
.. _PR_3: https://github.com/fjarri/pons/pull/3
.. _PR_1: https://github.com/fjarri-eth/pons/pull/1
.. _PR_2: https://github.com/fjarri-eth/pons/pull/2
.. _PR_3: https://github.com/fjarri-eth/pons/pull/3


0.2.0 (19-03-2022)
Expand Down
Loading

0 comments on commit baa2053

Please sign in to comment.