Skip to content

Commit b9b13c3

Browse files
committed
chore: move bytes definition to avoid type ignore
1 parent 00fe1bc commit b9b13c3

File tree

1 file changed

+10
-10
lines changed
  • src/_algopy_testing/value_generators

1 file changed

+10
-10
lines changed

src/_algopy_testing/value_generators/avm.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ def biguint(self, min_value: int = 0) -> algopy.BigUInt:
5757

5858
return _algopy_testing.BigUInt(generate_random_int(min_value, MAX_UINT512))
5959

60-
def bytes(self, length: int | None = None) -> algopy.Bytes:
61-
"""Generate a random byte sequence of a specified length.
62-
63-
:param length: Length of the byte sequence. Defaults to MAX_BYTES_SIZE.
64-
:returns: The randomly generated byte sequence.
65-
"""
66-
length = length or MAX_BYTES_SIZE
67-
return _algopy_testing.Bytes(secrets.token_bytes(length))
68-
6960
def string(self, length: int = MAX_BYTES_SIZE) -> algopy.String:
7061
"""Generate a random string of a specified length.
7162
@@ -146,7 +137,7 @@ def asset(
146137
def application(
147138
self,
148139
id: int | None = None,
149-
logs: list[bytes] | None = None, # type: ignore[valid-type]
140+
logs: list[bytes] | None = None,
150141
**application_fields: typing.Unpack[ApplicationFields],
151142
) -> algopy.Application:
152143
r"""Generate and add a new application with a unique ID."""
@@ -193,3 +184,12 @@ def application(
193184
)
194185

195186
return new_app
187+
188+
def bytes(self, length: int | None = None) -> algopy.Bytes:
189+
"""Generate a random byte sequence of a specified length.
190+
191+
:param length: Length of the byte sequence. Defaults to MAX_BYTES_SIZE.
192+
:returns: The randomly generated byte sequence.
193+
"""
194+
length = length or MAX_BYTES_SIZE
195+
return _algopy_testing.Bytes(secrets.token_bytes(length))

0 commit comments

Comments
 (0)