Skip to content

Commit ae1e3e4

Browse files
aashutoshrathicburgdorf
authored andcommitted
Migrated encode and decode hex
1 parent e427ac2 commit ae1e3e4

File tree

23 files changed

+79
-102
lines changed

23 files changed

+79
-102
lines changed

eth/beacon/types/active_states.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
from eth_typing import (
1010
Hash32,
1111
)
12+
from eth_utils import (
13+
encode_hex,
14+
)
1215

1316
from eth.rlp.sedes import (
1417
hash32
1518
)
16-
from eth.utils.hexadecimal import (
17-
encode_hex,
18-
)
1919
from eth.utils.blake import (
2020
blake,
2121
)

eth/beacon/types/blocks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
from eth_typing import (
66
Hash32,
77
)
8+
from eth_utils import (
9+
encode_hex,
10+
)
811
import rlp
912
from rlp.sedes import (
1013
CountableList,
@@ -19,9 +22,6 @@
1922
int64,
2023
hash32,
2124
)
22-
from eth.utils.hexadecimal import (
23-
encode_hex,
24-
)
2525

2626
from .attestation_records import AttestationRecord
2727

eth/beacon/types/crystallized_states.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
from eth_typing import (
77
Hash32,
88
)
9+
from eth_utils import (
10+
encode_hex,
11+
)
912

1013
import rlp
1114
from rlp.sedes import (
@@ -16,9 +19,6 @@
1619
int64,
1720
hash32,
1821
)
19-
from eth.utils.hexadecimal import (
20-
encode_hex,
21-
)
2222
from eth.utils.blake import (
2323
blake,
2424
)

eth/chains/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
BlockNumber,
2929
Hash32,
3030
)
31+
from eth_utils import (
32+
encode_hex,
33+
)
3134

3235
from eth.db.backends.base import BaseAtomicDB
3336
from eth.db.chain import (
@@ -82,9 +85,6 @@
8285
from eth.utils.headers import (
8386
compute_gas_limit_bounds,
8487
)
85-
from eth.utils.hexadecimal import (
86-
encode_hex,
87-
)
8888
from eth.utils.rlp import (
8989
validate_imported_block_unchanged,
9090
)

eth/consensus/pow.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44
Tuple
55
)
66

7-
from pyethash import (
8-
EPOCH_LENGTH,
9-
hashimoto_light,
10-
mkcache_bytes,
11-
)
12-
137
from eth_typing import (
148
Hash32
159
)
10+
1611
from eth_utils import (
1712
big_endian_to_int,
1813
ValidationError,
14+
encode_hex,
1915
)
2016

2117
from eth_hash.auto import keccak
2218

23-
from eth.utils.hexadecimal import (
24-
encode_hex,
19+
from pyethash import (
20+
EPOCH_LENGTH,
21+
hashimoto_light,
22+
mkcache_bytes,
2523
)
24+
25+
2626
from eth.validation import (
2727
validate_length,
2828
validate_lte,

eth/db/__init__.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import os
22
from typing import (
33
Any,
4-
cast,
5-
Type
4+
Type,
5+
cast
66
)
77

8-
from eth.utils.module_loading import (
9-
import_string,
10-
)
11-
from eth.db.backends.base import (
12-
BaseAtomicDB,
13-
)
8+
from eth_utils import import_string
9+
10+
from eth.db.backends.base import BaseAtomicDB
11+
1412

1513
DEFAULT_DB_BACKEND = 'eth.db.atomic.AtomicDB'
1614

eth/db/chain.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
BlockNumber,
1818
Hash32
1919
)
20+
from eth_utils import (
21+
encode_hex,
22+
)
2023

2124
from eth_hash.auto import keccak
2225

@@ -39,9 +42,6 @@
3942
from eth.rlp.receipts import (
4043
Receipt
4144
)
42-
from eth.utils.hexadecimal import (
43-
encode_hex,
44-
)
4545
from eth.validation import (
4646
validate_word,
4747
)
@@ -59,9 +59,7 @@
5959

6060
if TYPE_CHECKING:
6161
from eth.rlp.blocks import ( # noqa: F401
62-
BaseBlock
63-
)
64-
from eth.rlp.transactions import ( # noqa: F401
62+
BaseBlock,
6563
BaseTransaction
6664
)
6765

eth/estimators/__init__.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import os
22
from typing import (
33
Callable,
4-
cast,
4+
cast
55
)
66

7-
from eth.rlp.transactions import (
8-
BaseTransaction,
9-
)
10-
from eth.utils.module_loading import (
11-
import_string,
12-
)
13-
from eth.vm.state import (
14-
BaseState,
15-
)
7+
8+
from eth_utils import import_string
9+
10+
from eth.rlp.transactions import BaseTransaction
11+
from eth.vm.state import BaseState
1612

1713

1814
def get_gas_estimator() -> Callable[[BaseState, BaseTransaction], int]:

eth/rlp/headers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
from eth_hash.auto import keccak
2222

23+
from eth_utils import (
24+
encode_hex,
25+
)
26+
2327
from eth.constants import (
2428
ZERO_ADDRESS,
2529
ZERO_HASH32,
@@ -29,8 +33,8 @@
2933
BLANK_ROOT_HASH,
3034
)
3135

32-
from eth.utils.hexadecimal import (
33-
encode_hex,
36+
from eth.vm.execution_context import (
37+
ExecutionContext,
3438
)
3539

3640
from .sedes import (
@@ -40,10 +44,6 @@
4044
trie_root,
4145
)
4246

43-
from eth.vm.execution_context import (
44-
ExecutionContext,
45-
)
46-
4747

4848
class MiningHeader(rlp.Serializable):
4949
fields = [

eth/utils/hexadecimal.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)