|
54 | 54 | from eth.typing import (
|
55 | 55 | AccountState,
|
56 | 56 | GeneralState,
|
| 57 | + VMFork, |
| 58 | + VMConfiguration, |
57 | 59 | )
|
58 | 60 | from eth.validation import (
|
59 | 61 | validate_vm_configuration,
|
|
71 | 73 | )
|
72 | 74 |
|
73 | 75 |
|
74 |
| -VMConfiguration = Iterable[Tuple[int, Type[BaseVM]]] |
75 |
| - |
76 |
| - |
77 | 76 | def build(obj: Any, *applicators: Callable[..., Any]) -> Any:
|
78 | 77 | """
|
79 | 78 | Run the provided object through the series of applicator functions.
|
@@ -159,7 +158,7 @@ def _is_homestead(vm_class: Type[BaseVM]) -> bool:
|
159 | 158 |
|
160 | 159 |
|
161 | 160 | @to_tuple
|
162 |
| -def _set_vm_dao_support_false(vm_configuration: VMConfiguration) -> VMConfiguration: |
| 161 | +def _set_vm_dao_support_false(vm_configuration: VMConfiguration) -> Iterable[VMFork]: |
163 | 162 | for fork_block, vm_class in vm_configuration:
|
164 | 163 | if _is_homestead(vm_class):
|
165 | 164 | yield fork_block, vm_class.configure(support_dao_fork=False)
|
@@ -187,7 +186,7 @@ def disable_dao_fork(chain_class: Type[BaseChain]) -> Type[BaseChain]:
|
187 | 186 |
|
188 | 187 | @to_tuple
|
189 | 188 | def _set_vm_dao_fork_block_number(dao_fork_block_number: BlockNumber,
|
190 |
| - vm_configuration: VMConfiguration) -> VMConfiguration: |
| 189 | + vm_configuration: VMConfiguration) -> Iterable[VMFork]: |
191 | 190 | for fork_block, vm_class in vm_configuration:
|
192 | 191 | if _is_homestead(vm_class):
|
193 | 192 | yield fork_block, vm_class.configure(
|
@@ -257,7 +256,7 @@ def _get_default_genesis_params(genesis_state: AccountState) -> Iterable[Tuple[s
|
257 | 256 |
|
258 | 257 |
|
259 | 258 | @to_tuple
|
260 |
| -def _mix_in_pow_mining(vm_configuration: VMConfiguration) -> VMConfiguration: |
| 259 | +def _mix_in_pow_mining(vm_configuration: VMConfiguration) -> Iterable[VMFork]: |
261 | 260 | for fork_block, vm_class in vm_configuration:
|
262 | 261 | vm_class_with_pow_mining = type(vm_class.__name__, (POWMiningMixin, vm_class), {})
|
263 | 262 | yield fork_block, vm_class_with_pow_mining
|
@@ -289,7 +288,7 @@ def validate_seal(cls, header: BlockHeader) -> None:
|
289 | 288 |
|
290 | 289 |
|
291 | 290 | @to_tuple
|
292 |
| -def _mix_in_disable_seal_validation(vm_configuration: VMConfiguration) -> VMConfiguration: |
| 291 | +def _mix_in_disable_seal_validation(vm_configuration: VMConfiguration) -> Iterable[VMFork]: |
293 | 292 | for fork_block, vm_class in vm_configuration:
|
294 | 293 | vm_class_without_seal_validation = type(
|
295 | 294 | vm_class.__name__,
|
|
0 commit comments