Skip to content

Commit 2a614f7

Browse files
committed
fix after rebase
1 parent de486ba commit 2a614f7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/ethereum_test_base_types/conversions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ def to_fixed_size_bytes(input_bytes: FixedSizeBytesConvertible, size: int) -> by
6060
return bytes(input_bytes).rjust(size, b"\x00")
6161

6262

63-
def left_pad_zeros_up_to_size(input: bytes, size: int) -> bytes:
63+
def left_pad_zeros_up_to_size(input_bytes: bytes, size: int) -> bytes:
6464
"""
65-
Pads the given data to fit into a size-byte bytes. If the data is longer than
65+
Pad the given data to fit into a size-byte bytes. If the data is longer than
6666
size bytes, it raises a ValueError. If it is shorter, it left pads with zero bytes.
6767
6868
:param data: The input data to pad.
6969
:return: A Hash object of exactly size bytes.
7070
"""
71-
input = to_bytes(input)
72-
if len(input) > size:
71+
input_bytes = to_bytes(input_bytes)
72+
if len(input_bytes) > size:
7373
raise ValueError(f"Data cannot be longer than {size} bytes.")
74-
padded_data = bytes(input).rjust(size, b"\x00")
74+
padded_data = bytes(input_bytes).rjust(size, b"\x00")
7575
return bytes(padded_data)
7676

7777

tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
import pytest
1010

11+
from ethereum_test_base_types.conversions import left_pad_zeros_up_to_size
1112
from ethereum_test_tools import (
1213
Account,
1314
Address,
1415
Alloc,
1516
Bytecode,
1617
Environment,
17-
Hash,
1818
StateTestFiller,
1919
Transaction,
2020
)

tests/cancun/eip1153_tstore/test_tstorage_selfdestruct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
import pytest
1111

12+
from ethereum_test_base_types.conversions import left_pad_zeros_up_to_size
1213
from ethereum_test_tools import (
1314
Account,
1415
Alloc,
1516
Bytecode,
1617
CalldataCase,
1718
Environment,
18-
Hash,
1919
Initcode,
2020
StateTestFiller,
2121
Switch,

0 commit comments

Comments
 (0)