Skip to content

Commit

Permalink
Fixup imports for ethereum_types
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Sep 25, 2024
1 parent 49be8c2 commit 1ebc24b
Show file tree
Hide file tree
Showing 577 changed files with 1,203 additions and 905 deletions.
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ extend-exclude =
tests/fixtures/

per-file-ignores =
src/ethereum/base_types.py:D105,SC100,SC200
tests/*:D100,D101,D103,D104,E501,SC100,SC200

# vim: set ft=dosini:
5 changes: 4 additions & 1 deletion src/ethereum/arrow_glacier/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
from dataclasses import dataclass
from typing import Tuple, Union

from ..base_types import U256, Bytes, Bytes8, Bytes32, Uint, slotted_freezable
from ethereum_types.bytes import Bytes, Bytes8, Bytes32
from ethereum_types.frozen import slotted_freezable
from ethereum_types.numeric import U256, Uint

from ..crypto.hash import Hash32
from .fork_types import Address, Bloom, Root
from .transactions import LegacyTransaction
Expand Down
3 changes: 2 additions & 1 deletion src/ethereum/arrow_glacier/bloom.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

from typing import Tuple

from ethereum.base_types import Uint
from ethereum_types.numeric import Uint

from ethereum.crypto.hash import keccak256

from .blocks import Log
Expand Down
5 changes: 3 additions & 2 deletions src/ethereum/arrow_glacier/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
from dataclasses import dataclass
from typing import List, Optional, Set, Tuple, Union

from ethereum.base_types import Bytes0
from ethereum_types.bytes import Bytes, Bytes0
from ethereum_types.numeric import U64, U256, Uint

from ethereum.crypto.elliptic_curve import SECP256K1N, secp256k1_recover
from ethereum.crypto.hash import Hash32, keccak256
from ethereum.ethash import dataset_size, generate_cache, hashimoto_light
from ethereum.exceptions import InvalidBlock

from .. import rlp
from ..base_types import U64, U256, Bytes, Uint
from . import vm
from .blocks import Block, Header, Log, Receipt
from .bloom import logs_bloom
Expand Down
12 changes: 4 additions & 8 deletions src/ethereum/arrow_glacier/fork_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@

from dataclasses import dataclass

from ethereum_types.bytes import Bytes, Bytes20, Bytes256
from ethereum_types.frozen import slotted_freezable
from ethereum_types.numeric import U256, Uint

from .. import rlp
from ..base_types import (
U256,
Bytes,
Bytes20,
Bytes256,
Uint,
slotted_freezable,
)
from ..crypto.hash import Hash32, keccak256

Address = Bytes20
Expand Down
4 changes: 3 additions & 1 deletion src/ethereum/arrow_glacier/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
from dataclasses import dataclass, field
from typing import Callable, Dict, List, Optional, Set, Tuple

from ethereum.base_types import U256, Bytes, Uint, modify
from ethereum_types.bytes import Bytes
from ethereum_types.frozen import modify
from ethereum_types.numeric import U256, Uint

from .fork_types import EMPTY_ACCOUNT, Account, Address, Root
from .trie import EMPTY_TRIE_ROOT, Trie, copy_trie, root, trie_get, trie_set
Expand Down
13 changes: 4 additions & 9 deletions src/ethereum/arrow_glacier/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@
from dataclasses import dataclass
from typing import Tuple, Union

from ethereum_types.bytes import Bytes, Bytes0, Bytes32
from ethereum_types.frozen import slotted_freezable
from ethereum_types.numeric import U64, U256, Uint

from .. import rlp
from ..base_types import (
U64,
U256,
Bytes,
Bytes0,
Bytes32,
Uint,
slotted_freezable,
)
from ..exceptions import InvalidBlock
from .fork_types import Address

Expand Down
5 changes: 4 additions & 1 deletion src/ethereum/arrow_glacier/trie.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@
Union,
)

from ethereum_types.bytes import Bytes
from ethereum_types.frozen import slotted_freezable
from ethereum_types.numeric import U256, Uint

from ethereum.crypto.hash import keccak256
from ethereum.london import trie as previous_trie
from ethereum.utils.hexadecimal import hex_to_bytes

from .. import rlp
from ..base_types import U256, Bytes, Uint, slotted_freezable
from .blocks import Receipt
from .fork_types import Account, Address, Root, encode_account
from .transactions import LegacyTransaction
Expand Down
4 changes: 3 additions & 1 deletion src/ethereum/arrow_glacier/utils/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"""
from typing import Union

from ethereum.base_types import U256, Bytes32, Uint
from ethereum_types.bytes import Bytes32
from ethereum_types.numeric import U256, Uint

from ethereum.crypto.hash import keccak256
from ethereum.utils.byte import left_pad_zero_bytes

Expand Down
3 changes: 2 additions & 1 deletion src/ethereum/arrow_glacier/utils/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"""
from typing import FrozenSet, Optional, Tuple, Union

from ethereum.base_types import U256, Bytes, Bytes0, Bytes32, Uint
from ethereum_types.bytes import Bytes, Bytes0, Bytes32
from ethereum_types.numeric import U256, Uint

from ..fork_types import Address
from ..state import get_account
Expand Down
4 changes: 3 additions & 1 deletion src/ethereum/arrow_glacier/vm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
from dataclasses import dataclass
from typing import List, Optional, Set, Tuple, Union

from ethereum.base_types import U64, U256, Bytes, Bytes0, Bytes32, Uint
from ethereum_types.bytes import Bytes, Bytes0, Bytes32
from ethereum_types.numeric import U64, U256, Uint

from ethereum.crypto.hash import Hash32

from ..blocks import Log
Expand Down
3 changes: 2 additions & 1 deletion src/ethereum/arrow_glacier/vm/gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
from dataclasses import dataclass
from typing import List, Tuple

from ethereum.base_types import U256, Uint
from ethereum_types.numeric import U256, Uint

from ethereum.trace import GasAndRefund, evm_trace
from ethereum.utils.numeric import ceil32

Expand Down
3 changes: 2 additions & 1 deletion src/ethereum/arrow_glacier/vm/instructions/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
Implementations of the EVM Arithmetic instructions.
"""

from ethereum.base_types import U256, Uint
from ethereum_types.numeric import U256, Uint

from ethereum.utils.numeric import get_sign

from .. import Evm
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/arrow_glacier/vm/instructions/bitwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Implementations of the EVM bitwise instructions.
"""

from ethereum.base_types import U256, Uint
from ethereum_types.numeric import U256, Uint

from .. import Evm
from ..gas import GAS_VERY_LOW, charge_gas
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/arrow_glacier/vm/instructions/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Implementations of the EVM block instructions.
"""

from ethereum.base_types import U256, Uint
from ethereum_types.numeric import U256, Uint

from .. import Evm
from ..gas import GAS_BASE, GAS_BLOCK_HASH, charge_gas
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/arrow_glacier/vm/instructions/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Implementations of the EVM Comparison instructions.
"""

from ethereum.base_types import U256, Uint
from ethereum_types.numeric import U256, Uint

from .. import Evm
from ..gas import GAS_VERY_LOW, charge_gas
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/arrow_glacier/vm/instructions/control_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Implementations of the EVM control flow instructions.
"""

from ethereum.base_types import U256, Uint
from ethereum_types.numeric import U256, Uint

from ...vm.gas import GAS_BASE, GAS_HIGH, GAS_JUMPDEST, GAS_MID, charge_gas
from .. import Evm
Expand Down
3 changes: 1 addition & 2 deletions src/ethereum/arrow_glacier/vm/instructions/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
Implementations of the EVM environment related instructions.
"""

from ethereum_types.numeric import ulen
from ethereum_types.numeric import U256, Uint, ulen

from ethereum.base_types import U256, Uint
from ethereum.crypto.hash import keccak256
from ethereum.utils.numeric import ceil32

Expand Down
3 changes: 2 additions & 1 deletion src/ethereum/arrow_glacier/vm/instructions/keccak.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
Implementations of the EVM keccak instructions.
"""

from ethereum.base_types import U256, Uint
from ethereum_types.numeric import U256, Uint

from ethereum.crypto.hash import keccak256
from ethereum.utils.numeric import ceil32

Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/arrow_glacier/vm/instructions/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""
from functools import partial

from ethereum.base_types import U256, Uint
from ethereum_types.numeric import U256, Uint

from ...blocks import Log
from .. import Evm
Expand Down
3 changes: 2 additions & 1 deletion src/ethereum/arrow_glacier/vm/instructions/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
Implementations of the EVM Memory instructions.
"""
from ethereum.base_types import U256, Bytes, Uint
from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint

from .. import Evm
from ..gas import (
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/arrow_glacier/vm/instructions/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from functools import partial

from ethereum.base_types import U256, Uint
from ethereum_types.numeric import U256, Uint

from .. import Evm, stack
from ..exceptions import StackUnderflowError
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/arrow_glacier/vm/instructions/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Implementations of the EVM storage related instructions.
"""
from ethereum.base_types import Uint
from ethereum_types.numeric import Uint

from ...state import get_storage, get_storage_original, set_storage
from .. import Evm
Expand Down
4 changes: 3 additions & 1 deletion src/ethereum/arrow_glacier/vm/instructions/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
Implementations of the EVM system related instructions.
"""
from ethereum.base_types import U256, Bytes0, Uint
from ethereum_types.bytes import Bytes0
from ethereum_types.numeric import U256, Uint

from ethereum.utils.numeric import ceil32

from ...fork_types import Address
Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/arrow_glacier/vm/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from dataclasses import dataclass
from typing import Iterable, Optional, Set, Tuple

from ethereum_types.numeric import ulen
from ethereum_types.bytes import Bytes0
from ethereum_types.numeric import U256, Uint, ulen

from ethereum.base_types import U256, Bytes0, Uint
from ethereum.trace import (
EvmStop,
OpEnd,
Expand Down
5 changes: 3 additions & 2 deletions src/ethereum/arrow_glacier/vm/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
EVM memory operations.
"""
from ethereum.utils.byte import right_pad_zero_bytes
from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint

from ...base_types import U256, Bytes, Uint
from ethereum.utils.byte import right_pad_zero_bytes


def memory_write(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
Implementation of the ALT_BN128 precompiled contracts.
"""
from ethereum.base_types import U256, Uint
from ethereum_types.numeric import U256, Uint

from ethereum.crypto.alt_bn128 import (
ALT_BN128_CURVE_ORDER,
ALT_BN128_PRIME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
Implementation of the ECRECOVER precompiled contract.
"""
from ethereum.base_types import U256
from ethereum_types.numeric import U256

from ethereum.crypto.elliptic_curve import SECP256K1N, secp256k1_recover
from ethereum.crypto.hash import Hash32, keccak256
from ethereum.utils.byte import left_pad_zero_bytes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
Implementation of the `IDENTITY` precompiled contract.
"""
from ethereum.base_types import Uint
from ethereum_types.numeric import Uint

from ethereum.utils.numeric import ceil32

from ...vm import Evm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
Implementation of the `MODEXP` precompiled contract.
"""
from ethereum.base_types import U256, Bytes, Uint
from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint

from ...vm import Evm
from ...vm.gas import charge_gas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"""
import hashlib

from ethereum.base_types import Uint
from ethereum_types.numeric import Uint

from ethereum.utils.byte import left_pad_zero_bytes
from ethereum.utils.numeric import ceil32

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"""
import hashlib

from ethereum.base_types import Uint
from ethereum_types.numeric import Uint

from ethereum.utils.numeric import ceil32

from ...vm import Evm
Expand Down
4 changes: 1 addition & 3 deletions src/ethereum/arrow_glacier/vm/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
"""
from typing import Set

from ethereum_types.numeric import ulen

from ethereum.base_types import Uint
from ethereum_types.numeric import Uint, ulen

from .instructions import Ops

Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/arrow_glacier/vm/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from typing import List

from ethereum.base_types import U256
from ethereum_types.numeric import U256

from .exceptions import StackOverflowError, StackUnderflowError

Expand Down
Loading

0 comments on commit 1ebc24b

Please sign in to comment.