Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ type = "virtual"
path = ".venv"
python = "3.12"
dependencies = [
"puyapy>=5",
"puyapy>=5.7.1",
"pytest>=7.4",
"pytest-mock>=3.10.0",
"pytest-xdist[psutil]>=3.3",
"py-algorand-sdk>=2.4.0",
"algokit-utils>=4.0.0",
"pytest-cov>=4.1.0",
"prettytable>=3.9.0",
"mypy==1.10",
"mypy==1.19.1",
]

[tool.hatch.envs.default.env-vars]
Expand Down Expand Up @@ -132,7 +132,7 @@ dependencies = [
"pytest-cov>=4.1.0",
"py-algorand-sdk>=2.4.0",
"algokit-utils>=4.0.0",
"puyapy>=5",
"puyapy>=5.7.1",
]

[tool.hatch.envs.test.scripts]
Expand Down Expand Up @@ -190,7 +190,7 @@ dependencies = [
"py-algorand-sdk>=2.4.0",
"algokit-utils>=4.0.0",
"pytest-cov>=4.1.0",
"mypy==1.10",
"mypy==1.19.1",
]

[tool.hatch.envs.examples.scripts]
Expand Down
6 changes: 3 additions & 3 deletions src/_algopy_testing/arc4.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,17 +1154,17 @@ class _StructMeta(type):

def _tuple_type_from_struct(struct: type[Struct]) -> type[Tuple]: # type: ignore[type-arg]
field_types = [f.type for f in struct._type_info.fields]
return parameterize_type(Tuple, *field_types)
return parameterize_type(Tuple, *field_types) # type: ignore[arg-type]


class Struct(MutableBytes, _ABIEncoded, metaclass=_StructMeta): # type: ignore[misc]
class Struct(MutableBytes, _ABIEncoded, metaclass=_StructMeta):
"""Base class for ARC4 Struct types."""

_type_info: typing.ClassVar[_StructTypeInfo] # type: ignore[misc]

def __init_subclass__(cls, *args: typing.Any, **kwargs: dict[str, typing.Any]) -> None:
# make implementation not frozen, so we can conditionally control behaviour
dataclasses.dataclass(cls, *args, **{**kwargs, "frozen": False})
dataclasses.dataclass(cls, *args, **{**kwargs, "frozen": False}) # type: ignore[call-overload]
frozen = kwargs.get("frozen", False)
assert isinstance(frozen, bool)
cls._type_info = _StructTypeInfo(cls, frozen=frozen)
Expand Down
2 changes: 1 addition & 1 deletion src/_algopy_testing/itxn_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, inner_txn: InnerTransactionResultType):
def _get_itxn(self, txn_type: type[_T]) -> _T:
if (
not isinstance(self._inner_txn, txn_type)
and getattr(self._inner_txn, "type", None) != self._TXN_TYPE_MAP[txn_type]
and getattr(self._inner_txn, "type", None) != self._TXN_TYPE_MAP[txn_type] # type: ignore[index]
):
raise TypeError(f"transaction is not of type {txn_type.__name__}!")
return self._inner_txn # type: ignore[return-value]
Expand Down
2 changes: 1 addition & 1 deletion src/_algopy_testing/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class AccountContextData:

opted_assets: dict[int, AssetHolding] = dataclasses.field(default_factory=dict)
opted_apps: dict[int, algopy.Application] = dataclasses.field(default_factory=dict)
fields: AccountFields = dataclasses.field(default_factory=AccountFields) # type: ignore[arg-type]
fields: AccountFields = dataclasses.field(default_factory=AccountFields)


class Account(BytesBacked):
Expand Down
2 changes: 1 addition & 1 deletion src/_algopy_testing/primitives/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ class Struct(Serializable, MutableBytes):

def __init_subclass__(cls, *args: typing.Any, **kwargs: dict[str, typing.Any]) -> None:
# make implementation not frozen, so we can conditionally control behaviour
dataclasses.dataclass(cls, *args, **{**kwargs, "frozen": False})
dataclasses.dataclass(cls, *args, **{**kwargs, "frozen": False}) # type: ignore[call-overload]
frozen = kwargs.get("frozen", False)
cls._field_names = [
f.name for f in dataclasses.fields(typing.cast("type[DataclassInstance]", cls))
Expand Down
4 changes: 2 additions & 2 deletions src/_algopy_testing/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _items_to_native(items: Sequence[object]) -> tuple[object, ...]:
return tuple(result)

return _Serializer(
arc4_type=arc4.Tuple[*(s.arc4_type for s in serializers)], # type: ignore[misc]
arc4_type=arc4.Tuple[*(s.arc4_type for s in serializers)], # type: ignore[misc,arg-type]
native_to_arc4=lambda t: arc4.Tuple(_items_to_arc4(t)),
arc4_to_native=lambda t: _items_to_native(t),
)
Expand Down Expand Up @@ -190,7 +190,7 @@ def type_of(value: object) -> type:
if it is a generic type."""
# get fully parametrized tuples
if isinstance(value, tuple) and type(value) is tuple:
return tuple[*(type_of(i) for i in value)] # type: ignore[misc, no-any-return]
return tuple[*(type_of(i) for i in value)] # type: ignore[misc,return-value]
else:
return type(value)

Expand Down
6 changes: 3 additions & 3 deletions src/_algopy_testing/state/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ def deserialize(typ: type[_TValue], value: SerializableValue) -> _TValue:
elif issubclass(typ, bool):
return value != 0 # type: ignore[return-value]
elif issubclass(typ, UInt64 | Bytes):
return typ(value) # type: ignore[arg-type, return-value]
return typ(value) # type: ignore[arg-type]
elif issubclass(typ, UInt64Backed):
if isinstance(value, bytes):
raise TypeError("expected int, received bytes")
return typ.from_int(value) # type: ignore[return-value]
return typ.from_int(value)
elif issubclass(typ, BytesBacked | Serializable):
if isinstance(value, int):
raise TypeError("expected bytes, received int")
return typ.from_bytes(value) # type: ignore[return-value]
return typ.from_bytes(value)
else:
raise TypeError(f"Unsupported type: {typ}")

Expand Down
2 changes: 1 addition & 1 deletion tests/artifacts/AVM12/data/Contract.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 5,
"minor": 5,
"minor": 6,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/artifacts/AVM12/data/ContractV0.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 5,
"minor": 5,
"minor": 6,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/artifacts/AVM12/data/ContractV1.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 5,
"minor": 5,
"minor": 6,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 5,
"minor": 5,
"minor": 6,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 5,
"minor": 5,
"minor": 6,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1136,12 +1136,11 @@ verify_uintn_from_log:
// tests/artifacts/Arc4PrimitiveOps/contract.py:171
// return arc4.UInt32.from_log(a)
dup
extract 6 0
swap
extract 2 4
bytec_0 // 0x151f7c75
==
assert // application log value is not the result of an ABI return
extract 6 0
// tests/artifacts/Arc4PrimitiveOps/contract.py:169
// @arc4.abimethod()
bytec_0 // 0x151f7c75
Expand All @@ -1160,12 +1159,11 @@ verify_biguintn_from_log:
// tests/artifacts/Arc4PrimitiveOps/contract.py:175
// return arc4.UInt256.from_log(a)
dup
extract 6 0
swap
extract 2 4
bytec_0 // 0x151f7c75
==
assert // application log value is not the result of an ABI return
extract 6 0
// tests/artifacts/Arc4PrimitiveOps/contract.py:173
// @arc4.abimethod()
bytec_0 // 0x151f7c75
Expand Down Expand Up @@ -1381,12 +1379,11 @@ verify_ufixednxm_from_log:
// tests/artifacts/Arc4PrimitiveOps/contract.py:225
// return arc4.UFixedNxM[typing.Literal[32], typing.Literal[8]].from_log(a)
dup
extract 6 0
swap
extract 2 4
bytec_0 // 0x151f7c75
==
assert // application log value is not the result of an ABI return
extract 6 0
// tests/artifacts/Arc4PrimitiveOps/contract.py:221
// @arc4.abimethod()
bytec_0 // 0x151f7c75
Expand All @@ -1405,12 +1402,11 @@ verify_bigufixednxm_from_log:
// tests/artifacts/Arc4PrimitiveOps/contract.py:231
// return arc4.BigUFixedNxM[typing.Literal[256], typing.Literal[16]].from_log(a)
dup
extract 6 0
swap
extract 2 4
bytec_0 // 0x151f7c75
==
assert // application log value is not the result of an ABI return
extract 6 0
// tests/artifacts/Arc4PrimitiveOps/contract.py:227
// @arc4.abimethod()
bytec_0 // 0x151f7c75
Expand Down Expand Up @@ -1538,12 +1534,11 @@ verify_string_from_log:
// tests/artifacts/Arc4PrimitiveOps/contract.py:258
// return arc4.String.from_log(a)
dup
extract 6 0
swap
extract 2 4
bytec_0 // 0x151f7c75
==
assert // application log value is not the result of an ABI return
extract 6 0
// tests/artifacts/Arc4PrimitiveOps/contract.py:256
// @arc4.abimethod()
bytec_0 // 0x151f7c75
Expand Down Expand Up @@ -1595,12 +1590,11 @@ verify_bool_from_log:
// tests/artifacts/Arc4PrimitiveOps/contract.py:270
// return arc4.Bool.from_log(a)
dup
extract 6 0
swap
extract 2 4
bytec_0 // 0x151f7c75
==
assert // application log value is not the result of an ABI return
extract 6 0
// tests/artifacts/Arc4PrimitiveOps/contract.py:268
// @arc4.abimethod()
bytec_0 // 0x151f7c75
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/artifacts/Arrays/data/Contract.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 5,
"minor": 5,
"minor": 6,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 5,
"minor": 5,
"minor": 6,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 5,
"minor": 5,
"minor": 6,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/artifacts/Arrays/data/StaticSizeContract.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 5,
"minor": 5,
"minor": 6,
"patch": 0
}
},
Expand Down
Loading