From fb4bb48760c3d041a20503aee7fdba48804bb0a5 Mon Sep 17 00:00:00 2001 From: fselmo Date: Thu, 20 Apr 2023 12:19:17 -0600 Subject: [PATCH] Changes from comments on pr #2097 --- eth/vm/forks/shanghai/computation.py | 9 +++++++-- eth/vm/forks/shanghai/state.py | 4 ++-- tests/core/opcodes/test_opcodes.py | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/eth/vm/forks/shanghai/computation.py b/eth/vm/forks/shanghai/computation.py index 4f049cde8a..afd00e9183 100644 --- a/eth/vm/forks/shanghai/computation.py +++ b/eth/vm/forks/shanghai/computation.py @@ -1,5 +1,10 @@ from eth._utils.numeric import ceil32 -from eth.abc import MessageComputationAPI, MessageAPI, StateAPI, TransactionContextAPI +from eth.abc import ( + MessageComputationAPI, + MessageAPI, + StateAPI, + TransactionContextAPI, +) from .constants import ( INITCODE_WORD_COST, MAX_INITCODE_SIZE, @@ -11,7 +16,7 @@ from eth.vm.forks.paris.computation import ParisMessageComputation -class ShanghaiComputation(ParisMessageComputation): +class ShanghaiMessageComputation(ParisMessageComputation): """ A class for all execution *message* computations in the ``Shanghai`` hard fork """ diff --git a/eth/vm/forks/shanghai/state.py b/eth/vm/forks/shanghai/state.py index b67c5aa7de..5dbd97eda2 100644 --- a/eth/vm/forks/shanghai/state.py +++ b/eth/vm/forks/shanghai/state.py @@ -4,7 +4,7 @@ TransactionExecutorAPI, WithdrawalAPI, ) -from .computation import ShanghaiComputation +from .computation import ShanghaiMessageComputation from ..paris import ParisState from ..paris.state import ParisTransactionExecutor @@ -14,7 +14,7 @@ class ShanghaiTransactionExecutor(ParisTransactionExecutor): class ShanghaiState(ParisState): - message_computation_class = ShanghaiComputation + message_computation_class = ShanghaiMessageComputation transaction_executor_class: Type[TransactionExecutorAPI] = ShanghaiTransactionExecutor # noqa: E501 def apply_withdrawal(self, withdrawal: WithdrawalAPI) -> None: diff --git a/tests/core/opcodes/test_opcodes.py b/tests/core/opcodes/test_opcodes.py index 260575eecc..6b7941ecdf 100644 --- a/tests/core/opcodes/test_opcodes.py +++ b/tests/core/opcodes/test_opcodes.py @@ -7,7 +7,7 @@ POS_MAINNET_VMS, ) from eth.vm.forks.shanghai.computation import ( - ShanghaiComputation, + ShanghaiMessageComputation, ) from eth_utils import ( decode_hex, @@ -1599,7 +1599,7 @@ def test_selfdestruct_does_not_issue_deprecation_warning_pre_shanghai(vm_class): def test_selfdestruct_issues_deprecation_warning_for_shanghai(): - available_vm_opcodes = ShanghaiComputation.opcodes + available_vm_opcodes = ShanghaiMessageComputation.opcodes vm_opcodes_without_selfdestruct = { k: available_vm_opcodes[k] for k in available_vm_opcodes.keys()