Skip to content

Commit c7ce49d

Browse files
authored
Merge pull request #48 from algorandfoundation/update-langspec
feat: update langspec to 4.3.0
2 parents 7992edd + c05bdc0 commit c7ce49d

File tree

108 files changed

+935
-185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+935
-185
lines changed

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies = [
3232
"coincurve>=19.0.1",
3333
# TODO: uncomment below and remove direct git reference once puya 5.0 is released
3434
# "algorand-python>=3",
35-
"algorand-python@git+https://github.com/algorandfoundation/[email protected].11#subdirectory=stubs",
35+
"algorand-python@git+https://github.com/algorandfoundation/[email protected].12#subdirectory=stubs",
3636
]
3737

3838
[project.urls]
@@ -54,7 +54,7 @@ python = "3.12"
5454
dependencies = [
5555
# TODO: uncomment below and remove direct git reference once puya 5.0 is released
5656
# "puyapy>=5",
57-
"puyapy@git+https://github.com/algorandfoundation/[email protected].11",
57+
"puyapy@git+https://github.com/algorandfoundation/[email protected].12",
5858
"pytest>=7.4",
5959
"pytest-mock>=3.10.0",
6060
"pytest-xdist[psutil]>=3.3",
@@ -138,7 +138,7 @@ dependencies = [
138138
"algokit-utils>=3.0.0",
139139
# TODO: uncomment below and remove direct git reference once puya 5.0 is released
140140
# "puyapy>=5",
141-
"puyapy@git+https://github.com/algorandfoundation/[email protected].11",
141+
"puyapy@git+https://github.com/algorandfoundation/[email protected].12",
142142
]
143143

144144
[tool.hatch.envs.test.scripts]
@@ -191,7 +191,7 @@ post-install-commands = [
191191
dependencies = [
192192
# TODO: uncomment below and remove direct git reference once puya 5.0 is released
193193
# "algorand-python>=3",
194-
"algorand-python@git+https://github.com/algorandfoundation/[email protected].11#subdirectory=stubs",
194+
"algorand-python@git+https://github.com/algorandfoundation/[email protected].12#subdirectory=stubs",
195195
"pytest>=7.4",
196196
"pytest-mock>=3.10.0",
197197
"pytest-xdist[psutil]>=3.3",

src/_algopy_testing/models/application.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ApplicationFields(typing.TypedDict, total=False):
2525
local_num_bytes: algopy.UInt64
2626
extra_program_pages: algopy.UInt64
2727
creator: algopy.Account
28+
version: algopy.UInt64
2829

2930

3031
AccountKey = str

src/_algopy_testing/models/contract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __init_subclass__(
9494
algopy.urange | tuple[int | algopy.urange, ...] | list[int | algopy.urange] | None
9595
) = None,
9696
state_totals: StateTotals | None = None,
97-
avm_version: int = 10,
97+
avm_version: int = 11,
9898
):
9999
cls._name = name or cls.__name__
100100
cls._scratch_slots = scratch_slots

src/_algopy_testing/models/txn_fields.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class ApplicationCallFields(ActiveTransactionFields, total=False):
8484
approval_program: Sequence[algopy.Bytes]
8585
clear_state_program: Sequence[algopy.Bytes]
8686
created_app: algopy.Application
87+
reject_version: algopy.UInt64
8788

8889

8990
class KeyRegistrationFields(TransactionBaseFields, total=False):
@@ -153,6 +154,7 @@ class TransactionFields( # type: ignore[misc]
153154
"local_num_bytes": UInt64,
154155
"extra_program_pages": UInt64,
155156
"vote_first": UInt64,
157+
"reject_version": UInt64,
156158
"vote_last": UInt64,
157159
"vote_key_dilution": UInt64,
158160
"created_app": Application,
@@ -505,6 +507,10 @@ def num_logs(self) -> algopy.UInt64:
505507
def logs(self) -> Callable[[algopy.UInt64 | int], algopy.Bytes]:
506508
return _create_array_accessor(self._logs)
507509

510+
@property
511+
def reject_version(self) -> algopy.UInt64:
512+
return self.fields["reject_version"] # type: ignore[return-value]
513+
508514
def __getattr__(self, name: str) -> object:
509515
try:
510516
return self.fields[name]

src/_algopy_testing/op/pure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def bsqrt(a: BigUInt | int, /) -> BigUInt:
3131
def btoi(a: Bytes | bytes, /) -> UInt64:
3232
a_bytes = as_bytes(a)
3333
if len(a_bytes) > 8:
34-
raise ValueError(f"btoi arg too long, got [{len(a_bytes)}]bytes")
34+
raise ValueError(f"btoi arg too long, got {len(a_bytes)} bytes")
3535
return UInt64(int.from_bytes(a_bytes))
3636

3737

src/_algopy_testing/value_generators/avm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def application(
168168
"local_num_bytes": _algopy_testing.UInt64(0),
169169
"extra_program_pages": _algopy_testing.UInt64(0),
170170
"creator": lazy_context.value.default_sender,
171+
"version": _algopy_testing.UInt64(0),
171172
}
172173

173174
# Merge provided fields with defaults, prioritizing provided fields

tests/arc4/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from tests.common import AVMInvoker, create_avm_invoker
77

88
ARTIFACTS_DIR = Path(__file__).parent / ".." / "artifacts"
9-
APP_SPEC = ARTIFACTS_DIR / "Arc4PrimitiveOps" / "data" / "Arc4PrimitiveOpsContract.arc32.json"
9+
APP_SPEC = ARTIFACTS_DIR / "Arc4PrimitiveOps" / "data" / "Arc4PrimitiveOpsContract.arc56.json"
1010

1111

1212
@pytest.fixture(scope="module")

tests/arc4/test_arc4_method_signature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from tests.common import AVMInvoker, create_avm_invoker
2020

2121
ARTIFACTS_DIR = Path(__file__).parent / ".." / "artifacts"
22-
APP_SPEC = ARTIFACTS_DIR / "Arc4ABIMethod" / "data" / "SignaturesContract.arc32.json"
22+
APP_SPEC = ARTIFACTS_DIR / "Arc4ABIMethod" / "data" / "SignaturesContract.arc56.json"
2323
_FUNDED_ACCOUNT_SPENDING = 1234
2424

2525

tests/arc4/test_bool.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ def test_string_from_log_invalid_prefix(
5959
) -> None:
6060
with pytest.raises(
6161
algokit_utils.LogicError,
62-
match=re.compile("(assert failed)|(extraction start \\d+ is beyond length)"),
62+
match=re.compile(
63+
"(application log value is not the result of an ABI return)|"
64+
"(extraction start \\d+ is beyond length)"
65+
),
6366
):
6467
get_avm_result("verify_bool_from_log", a=prefix + value)
6568
with pytest.raises(ValueError, match="ABI return prefix not found"):

tests/arc4/test_string.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ def test_string_from_log_invalid_prefix(
120120
value = int_to_bytes(len(value), 2) + value
121121
with pytest.raises(
122122
algokit_utils.LogicError,
123-
match=re.compile("(assert failed)|(extraction start \\d+ is beyond length)"),
123+
match=re.compile(
124+
"(application log value is not the result of an ABI return)|"
125+
"(extraction start \\d+ is beyond length)"
126+
),
124127
):
125128
get_avm_result("verify_string_from_log", a=prefix + value)
126129
with pytest.raises(ValueError, match="ABI return prefix not found"):

0 commit comments

Comments
 (0)