Skip to content

Commit

Permalink
Fix docs related to message computation refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
fselmo committed Apr 19, 2023
1 parent 20b6e2e commit bf7f3aa
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 35 deletions.
9 changes: 8 additions & 1 deletion docs/api/api.abc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,16 @@ ExecutionContextAPI
:members:


MessageComputationAPI
ComputationAPI
--------------

.. autoclass:: eth.abc.ComputationAPI
:members:


MessageComputationAPI
---------------------

.. autoclass:: eth.abc.MessageComputationAPI
:members:

Expand Down
9 changes: 7 additions & 2 deletions docs/api/vm/api.vm.computation.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
Computation
===========

MessageComputation
BaseComputation
---------------

.. autoclass:: eth.vm.computation.MessageComputation
.. autoclass:: eth.vm.computation.BaseComputation
:members:

MessageComputation
------------------

.. autoclass:: eth.vm.computation.MessageComputation
:members:
50 changes: 25 additions & 25 deletions docs/api/vm/api.vm.forks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ FrontierState
.. autoclass:: eth.vm.forks.frontier.state.FrontierState
:members:

FrontierComputation
~~~~~~~~~~~~~~~~~~~
FrontierMessageComputation
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: eth.vm.forks.frontier.computation.FrontierComputation
.. autoclass:: eth.vm.forks.frontier.computation.FrontierMessageComputation
:members:


Expand All @@ -39,10 +39,10 @@ HomesteadState
.. autoclass:: eth.vm.forks.homestead.state.HomesteadState
:members:

HomesteadComputation
~~~~~~~~~~~~~~~~~~~~
HomesteadMessageComputation
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: eth.vm.forks.homestead.computation.HomesteadComputation
.. autoclass:: eth.vm.forks.homestead.computation.HomesteadMessageComputation
:members:


Expand All @@ -61,10 +61,10 @@ TangerineWhistleState
.. autoclass:: eth.vm.forks.tangerine_whistle.state.TangerineWhistleState
:members:

TangerineWhistleComputation
~~~~~~~~~~~~~~~~~~~~~~~~~~~
TangerineWhistleMessageComputation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: eth.vm.forks.tangerine_whistle.computation.TangerineWhistleComputation
.. autoclass:: eth.vm.forks.tangerine_whistle.computation.TangerineWhistleMessageComputation
:members:


Expand All @@ -83,18 +83,18 @@ SpuriousDragonState
.. autoclass:: eth.vm.forks.spurious_dragon.state.SpuriousDragonState
:members:

SpuriousDragonComputation
~~~~~~~~~~~~~~~~~~~~~~~~~
SpuriousDragonMessageComputation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: eth.vm.forks.spurious_dragon.computation.SpuriousDragonComputation
.. autoclass:: eth.vm.forks.spurious_dragon.computation.SpuriousDragonMessageComputation
:members:


Byzantium
---------

ByzantiumVM
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~

.. autoclass:: eth.vm.forks.byzantium.ByzantiumVM
:members:
Expand All @@ -105,10 +105,10 @@ ByzantiumState
.. autoclass:: eth.vm.forks.byzantium.state.ByzantiumState
:members:

ByzantiumComputation
~~~~~~~~~~~~~~~~~~~~
ByzantiumMessageComputation
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: eth.vm.forks.byzantium.computation.ByzantiumComputation
.. autoclass:: eth.vm.forks.byzantium.computation.ByzantiumMessageComputation
:members:


Expand All @@ -127,10 +127,10 @@ ConstantinopleState
.. autoclass:: eth.vm.forks.constantinople.state.ConstantinopleState
:members:

ConstantinopleComputation
~~~~~~~~~~~~~~~~~~~~~~~~~
ConstantinopleMessageComputation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: eth.vm.forks.constantinople.computation.ConstantinopleComputation
.. autoclass:: eth.vm.forks.constantinople.computation.ConstantinopleMessageComputation
:members:


Expand All @@ -149,10 +149,10 @@ PetersburgState
.. autoclass:: eth.vm.forks.petersburg.state.PetersburgState
:members:

PetersburgComputation
~~~~~~~~~~~~~~~~~~~~~
PetersburgMessageComputation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: eth.vm.forks.petersburg.computation.PetersburgComputation
.. autoclass:: eth.vm.forks.petersburg.computation.PetersburgMessageComputation
:members:


Expand All @@ -171,10 +171,10 @@ IstanbulState
.. autoclass:: eth.vm.forks.istanbul.state.IstanbulState
:members:

IstanbulComputation
~~~~~~~~~~~~~~~~~~~~~
IstanbulMessageComputation
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: eth.vm.forks.istanbul.computation.IstanbulComputation
.. autoclass:: eth.vm.forks.istanbul.computation.IstanbulMessageComputation
:members:


Expand Down
4 changes: 2 additions & 2 deletions docs/guides/creating_opcodes.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Creating Opcodes
================

An opcode is just a function which takes a :class:`~eth.vm.computation.MessageComputation`
An opcode is just a function which takes a :class:`~eth.vm.computation.BaseComputation`
instance as it's sole argument. If an opcode function has a return value, this
value will be discarded during normal VM execution.

Expand Down Expand Up @@ -52,7 +52,7 @@ Usage of the :func:`~eth.vm.opcode.as_opcode` helper:
def custom_op(computation):
... # opcode logic here
class ExampleComputation(MessageComputation):
class ExampleComputation(BaseComputation):
opcodes = {
b'\x01': as_opcode(custom_op, 'CUSTOM_OP', 10),
}
Expand Down
4 changes: 2 additions & 2 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ Internal Changes - for Contributors
- Fix for creating a duplicate "ghost" Computation that was never used. It didn't
break anything, but was inelegant and surprising to get extra objects created
that were mostly useless. This was achieved by changing
:meth:`eth.abc.MessageComputationAPI.apply_message` and
:meth:`eth.abc.MessageComputationAPI.apply_create_message` to be class methods. (`#1921 <https://github.com/ethereum/py-evm/issues/1921>`__)
:meth:`eth.abc.ComputationAPI.apply_message` and
:meth:`eth.abc.ComputationAPI.apply_create_message` to be class methods. (`#1921 <https://github.com/ethereum/py-evm/issues/1921>`__)


py-evm 0.3.0-alpha.14 (2020-02-10)
Expand Down
2 changes: 1 addition & 1 deletion eth/vm/forks/tangerine_whistle/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .opcodes import TANGERINE_WHISTLE_OPCODES


class TangerineWhistleComputation(HomesteadMessageComputation):
class TangerineWhistleMessageComputation(HomesteadMessageComputation):
"""
A class for all execution *message* computations in the ``TangerineWhistle`` fork.
Inherits from
Expand Down
4 changes: 2 additions & 2 deletions eth/vm/forks/tangerine_whistle/state.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from eth.vm.forks.homestead.state import HomesteadState

from .computation import TangerineWhistleComputation
from .computation import TangerineWhistleMessageComputation


class TangerineWhistleState(HomesteadState):
message_computation_class = TangerineWhistleComputation
message_computation_class = TangerineWhistleMessageComputation

0 comments on commit bf7f3aa

Please sign in to comment.