Skip to content

Commit

Permalink
fix: arc4_prefix annotated to also accept algopy.Bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-makerx committed Aug 27, 2024
1 parent d6c6dd2 commit 40328ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/_algopy_testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

from _algopy_testing.op.global_values import GlobalFields

_TBytes = typing.TypeVar("_TBytes", bytes, algopy.Bytes)


def resolve_app_index(app_id_or_index: algopy.UInt64 | int) -> int:
from _algopy_testing.context_helpers import lazy_context
Expand Down Expand Up @@ -168,7 +170,7 @@ def get_new_scratch_space() -> list[algopy.Bytes | algopy.UInt64]:
return [algopy.UInt64(0)] * 256


def arc4_prefix(value: bytes) -> bytes:
def arc4_prefix(value: _TBytes) -> _TBytes:
"""Return the value with the ARC4 prefix prepended."""
return ARC4_RETURN_PREFIX + value

Expand Down

0 comments on commit 40328ca

Please sign in to comment.