Skip to content

Commit 92ca763

Browse files
Bump the dev-dependencies group across 1 directory with 12 updates (#1394)
* Bump the dev-dependencies group across 1 directory with 12 updates Bumps the dev-dependencies group with 12 updates in the / directory: | Package | From | To | | --- | --- | --- | | [pytest](https://github.com/pytest-dev/pytest) | `7.4.4` | `8.2.2` | | [black](https://github.com/psf/black) | `23.12.1` | `24.4.2` | | [poethepoet](https://github.com/nat-n/poethepoet) | `0.24.4` | `0.27.0` | | [coverage](https://github.com/nedbat/coveragepy) | `7.4.1` | `7.5.4` | | [pylint](https://github.com/pylint-dev/pylint) | `3.0.3` | `3.2.5` | | [pytest-mock](https://github.com/pytest-dev/pytest-mock) | `3.12.0` | `3.14.0` | | [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) | `3.5.0` | `3.6.1` | | [pyright](https://github.com/RobertCraigie/pyright-python) | `1.1.338` | `1.1.371` | | [pytest-cov](https://github.com/pytest-dev/pytest-cov) | `4.1.0` | `5.0.0` | | [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) | `13.0` | `14.0` | | [setuptools](https://github.com/pypa/setuptools) | `69.0.3` | `70.3.0` | Updates `pytest` from 7.4.4 to 8.2.2 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@7.4.4...8.2.2) Updates `black` from 23.12.1 to 24.4.2 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](psf/black@23.12.1...24.4.2) Updates `poethepoet` from 0.24.4 to 0.27.0 - [Release notes](https://github.com/nat-n/poethepoet/releases) - [Commits](nat-n/poethepoet@v0.24.4...v0.27.0) Updates `coverage` from 7.4.1 to 7.5.4 - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](coveragepy/coveragepy@7.4.1...7.5.4) Updates `pylint` from 3.0.3 to 3.2.5 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](pylint-dev/pylint@v3.0.3...v3.2.5) Updates `pytest-mock` from 3.12.0 to 3.14.0 - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest-mock@v3.12.0...v3.14.0) Updates `pytest-xdist` from 3.5.0 to 3.6.1 - [Release notes](https://github.com/pytest-dev/pytest-xdist/releases) - [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst) - [Commits](pytest-dev/pytest-xdist@v3.5.0...v3.6.1) Updates `pyright` from 1.1.338 to 1.1.371 - [Release notes](https://github.com/RobertCraigie/pyright-python/releases) - [Commits](RobertCraigie/pyright-python@v1.1.338...v1.1.371) Updates `pytest-cov` from 4.1.0 to 5.0.0 - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](pytest-dev/pytest-cov@v4.1.0...v5.0.0) Updates `pytest-rerunfailures` from 13.0 to 14.0 - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](pytest-dev/pytest-rerunfailures@13.0...14.0) Updates `setuptools` from 69.0.3 to 70.3.0 - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](pypa/setuptools@v69.0.3...v70.3.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-major dependency-group: dev-dependencies - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major dependency-group: dev-dependencies - dependency-name: poethepoet dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: pytest-mock dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: pytest-xdist dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: pyright dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major dependency-group: dev-dependencies - dependency-name: pytest-rerunfailures dependency-type: direct:development update-type: version-update:semver-major dependency-group: dev-dependencies - dependency-name: setuptools dependency-type: direct:development update-type: version-update:semver-major dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * Use `pytest-asyncio` version `0.21.2` * Install sympy manually * Fix typecheck * Ignore temporarily some pyright checks * Fix incorrect type * Remove `test_serialize_deserialize_invoke` * Fix lint * Replace `Union[str, None]` with `Optional[str]` --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dariusz Doktorski <dariusz.doktorski@swmansion.com> Co-authored-by: ddoktorski <45050160+ddoktorski@users.noreply.github.com>
1 parent 9934ac3 commit 92ca763

File tree

11 files changed

+370
-357
lines changed

11 files changed

+370
-357
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ jobs:
134134
if: steps.cache-contracts.outputs.cache-hit != 'true'
135135
run: |
136136
pip install --upgrade setuptools
137+
pip install sympy==1.11.1
137138
pip install cairo-lang==${{ env.CAIRO_LANG_VERSION }}
138139
139140
- name: Compile contracts v0

poetry.lock

Lines changed: 304 additions & 275 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ eth-keyfile = "^0.8.1"
3434
docs = ["sphinx", "enum-tools", "furo"]
3535

3636
[tool.poetry.group.dev.dependencies]
37-
pytest = "^7.2.2"
38-
black = "^23.1.0"
39-
poethepoet = "^0.24.4"
37+
pytest = "^8.2.2"
38+
black = "^24.4.2"
39+
poethepoet = "^0.27.0"
4040
coverage = "^7.2.1"
4141
pytest-asyncio = "^0.21.1"
42-
pylint = "3.0.3"
42+
pylint = "3.2.5"
4343
pytest-mock = "^3.6.1"
4444
pytest-xdist = "^3.2.1"
45-
pyright = "1.1.338"
46-
pytest-cov = "^4.0.0"
45+
pyright = "1.1.371"
46+
pytest-cov = "^5.0.0"
4747
isort = "^5.11.4"
48-
pytest-rerunfailures = "^13.0"
48+
pytest-rerunfailures = "^14.0"
4949
python-dotenv = "^1.0.0"
50-
setuptools = "^69.0.3"
50+
setuptools = "^70.3.0"
5151

5252
[tool.poe.tasks]
5353
test = [
@@ -136,4 +136,5 @@ exclude = [
136136
"**/__pycache__",
137137
"starknet_py/tests/e2e/docs",
138138
]
139-
stubPath = "" # fix "not a valid directory" error
139+
reportIncompatibleMethodOverride = "warning"
140+
reportIncompatibleVariableOverride = "warning"

starknet_py/net/account/base_account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ async def sign_deploy_account_v1(
230230
contract_address_salt: int,
231231
constructor_calldata: Optional[List[int]] = None,
232232
*,
233-
nonce: Optional[int] = None,
233+
nonce: int = 0,
234234
max_fee: Optional[int] = None,
235235
auto_estimate: bool = False,
236236
) -> DeployAccountV1:

starknet_py/net/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
DeprecatedContractClass,
1515
EstimatedFee,
1616
Hash,
17+
PendingBlockStateUpdate,
18+
PendingStarknetBlock,
1719
SentTransactionResponse,
1820
SierraContractClass,
1921
StarknetBlock,
@@ -45,7 +47,7 @@ async def get_block(
4547
self,
4648
block_hash: Optional[Union[Hash, Tag]] = None,
4749
block_number: Optional[Union[int, Tag]] = None,
48-
) -> StarknetBlock:
50+
) -> Union[StarknetBlock, PendingStarknetBlock]:
4951
"""
5052
Retrieve the block's data by its number or hash
5153
@@ -73,7 +75,7 @@ async def get_state_update(
7375
self,
7476
block_hash: Optional[Union[Hash, Tag]] = None,
7577
block_number: Optional[Union[int, Tag]] = None,
76-
) -> BlockStateUpdate:
78+
) -> Union[BlockStateUpdate, PendingBlockStateUpdate]:
7779
"""
7880
Get the information about the result of executing the requested block
7981

starknet_py/net/full_node_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,9 @@ async def estimate_fee(
377377
method_name="estimateFee",
378378
params={
379379
"request": [_create_broadcasted_txn(transaction=t) for t in tx],
380-
"simulation_flags": [SimulationFlag.SKIP_VALIDATE]
381-
if skip_validate
382-
else [],
380+
"simulation_flags": (
381+
[SimulationFlag.SKIP_VALIDATE] if skip_validate else []
382+
),
383383
**block_identifier,
384384
},
385385
)

starknet_py/net/models/transaction.py

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
SierraContractClass,
3636
TransactionType,
3737
)
38-
from starknet_py.net.schemas.common import Felt, TransactionTypeField
38+
from starknet_py.net.schemas.common import Felt
3939
from starknet_py.net.schemas.rpc.contract import (
4040
ContractClassSchema,
4141
SierraContractClassSchema,
@@ -134,7 +134,10 @@ class DeclareV3(_AccountTransactionV3):
134134
compiled_class_hash: int
135135
contract_class: SierraContractClass
136136
account_deployment_data: List[int] = field(default_factory=list)
137-
type: TransactionType = TransactionType.DECLARE
137+
138+
@property
139+
def type(self) -> TransactionType:
140+
return TransactionType.DECLARE
138141

139142
def calculate_hash(self, chain_id: int) -> int:
140143
return compute_declare_v3_transaction_hash(
@@ -161,10 +164,10 @@ class DeclareV2(_DeprecatedAccountTransaction):
161164
)
162165
compiled_class_hash: int = field(metadata={"marshmallow_field": Felt()})
163166
sender_address: int = field(metadata={"marshmallow_field": Felt()})
164-
type: TransactionType = field(
165-
metadata={"marshmallow_field": TransactionTypeField()},
166-
default=TransactionType.DECLARE,
167-
)
167+
168+
@property
169+
def type(self) -> TransactionType:
170+
return TransactionType.DECLARE
168171

169172
def calculate_hash(self, chain_id: int) -> int:
170173
return compute_declare_v2_transaction_hash(
@@ -191,10 +194,10 @@ class DeclareV1(_DeprecatedAccountTransaction):
191194
)
192195
# The address of the account contract sending the declaration transaction.
193196
sender_address: int = field(metadata={"marshmallow_field": Felt()})
194-
type: TransactionType = field(
195-
metadata={"marshmallow_field": TransactionTypeField()},
196-
default=TransactionType.DECLARE,
197-
)
197+
198+
@property
199+
def type(self) -> TransactionType:
200+
return TransactionType.DECLARE
198201

199202
@marshmallow.post_dump
200203
def post_dump(self, data: Dict[str, Any], **kwargs) -> Dict[str, Any]:
@@ -232,7 +235,10 @@ class DeployAccountV3(_AccountTransactionV3):
232235
class_hash: int
233236
contract_address_salt: int
234237
constructor_calldata: List[int]
235-
type: TransactionType = TransactionType.DEPLOY_ACCOUNT
238+
239+
@property
240+
def type(self) -> TransactionType:
241+
return TransactionType.DEPLOY_ACCOUNT
236242

237243
def calculate_hash(self, chain_id: int) -> int:
238244
contract_address = compute_address(
@@ -265,10 +271,10 @@ class DeployAccountV1(_DeprecatedAccountTransaction):
265271
constructor_calldata: List[int] = field(
266272
metadata={"marshmallow_field": fields.List(fields.String())}
267273
)
268-
type: TransactionType = field(
269-
metadata={"marshmallow_field": TransactionTypeField()},
270-
default=TransactionType.DEPLOY_ACCOUNT,
271-
)
274+
275+
@property
276+
def type(self) -> TransactionType:
277+
return TransactionType.DEPLOY_ACCOUNT
272278

273279
def calculate_hash(self, chain_id: int) -> int:
274280
"""
@@ -302,7 +308,10 @@ class InvokeV3(_AccountTransactionV3):
302308
calldata: List[int]
303309
sender_address: int
304310
account_deployment_data: List[int] = field(default_factory=list)
305-
type: TransactionType = TransactionType.INVOKE
311+
312+
@property
313+
def type(self) -> TransactionType:
314+
return TransactionType.INVOKE
306315

307316
def calculate_hash(self, chain_id: int) -> int:
308317
return compute_invoke_v3_transaction_hash(
@@ -327,10 +336,10 @@ class InvokeV1(_DeprecatedAccountTransaction):
327336
calldata: List[int] = field(
328337
metadata={"marshmallow_field": fields.List(fields.String())}
329338
)
330-
type: TransactionType = field(
331-
metadata={"marshmallow_field": TransactionTypeField()},
332-
default=TransactionType.INVOKE,
333-
)
339+
340+
@property
341+
def type(self) -> TransactionType:
342+
return TransactionType.INVOKE
334343

335344
def calculate_hash(self, chain_id: int) -> int:
336345
"""

starknet_py/net/models/transaction_test.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
from typing import cast
44

55
from starknet_py.common import create_contract_class
6-
from starknet_py.net.client_models import TransactionType
7-
from starknet_py.net.models.transaction import (
8-
Declare,
9-
DeclareV1,
10-
DeclareV1Schema,
11-
InvokeV1,
12-
InvokeV1Schema,
13-
)
6+
from starknet_py.net.models.transaction import Declare, DeclareV1, DeclareV1Schema
147

158

169
def test_declare_compress_program(balance_contract):
@@ -36,22 +29,3 @@ def test_declare_compress_program(balance_contract):
3629

3730
deserialized = cast(Declare, schema.load(serialized))
3831
assert deserialized.contract_class == contract_class
39-
40-
41-
def test_serialize_deserialize_invoke():
42-
data = {
43-
"sender_address": "0x1",
44-
"calldata": ["0x1", "0x2", "0x3"],
45-
"max_fee": "0x1",
46-
"signature": [],
47-
"nonce": "0x1",
48-
"version": "0x1",
49-
"type": "INVOKE_FUNCTION",
50-
}
51-
invoke = InvokeV1Schema().load(data)
52-
serialized_invoke = InvokeV1Schema().dump(invoke)
53-
54-
assert isinstance(invoke, InvokeV1)
55-
assert invoke.type == TransactionType.INVOKE
56-
assert isinstance(serialized_invoke, dict)
57-
assert serialized_invoke["type"] == "INVOKE_FUNCTION"

starknet_py/net/schemas/common.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class NumberAsHex(fields.Field):
4242
MAX_VALUE = sys.maxsize
4343
REGEX_PATTERN = r"^0x[a-fA-F0-9]+$"
4444

45-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
45+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
4646
if self._is_int_and_in_range(value):
4747
return hex(value)
4848

@@ -56,7 +56,7 @@ def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
5656
def _deserialize(
5757
self,
5858
value: Any,
59-
attr: Union[str, None],
59+
attr: Optional[str],
6060
data: Union[Mapping[str, Any], None],
6161
**kwargs,
6262
):
@@ -108,7 +108,7 @@ class Uint128(NumberAsHex):
108108

109109

110110
class NonPrefixedHex(fields.Field):
111-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
111+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
112112
return hex(value).lstrip("0x")
113113

114114
def _deserialize(
@@ -122,7 +122,7 @@ def _deserialize(
122122

123123

124124
class StatusField(fields.Field):
125-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
125+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
126126
return value.name if value is not None else ""
127127

128128
def _deserialize(
@@ -143,7 +143,7 @@ def _deserialize(
143143

144144

145145
class ExecutionStatusField(fields.Field):
146-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
146+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
147147
return value.name if value is not None else ""
148148

149149
def _deserialize(
@@ -164,7 +164,7 @@ def _deserialize(
164164

165165

166166
class FinalityStatusField(fields.Field):
167-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
167+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
168168
return value.name if value is not None else ""
169169

170170
def _deserialize(
@@ -185,7 +185,7 @@ def _deserialize(
185185

186186

187187
class BlockStatusField(fields.Field):
188-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
188+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
189189
return value.name if value is not None else ""
190190

191191
def _deserialize(
@@ -207,7 +207,7 @@ def _deserialize(
207207

208208

209209
class TransactionTypeField(fields.Field):
210-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
210+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
211211
if value == TransactionType.INVOKE:
212212
return "INVOKE_FUNCTION"
213213
return value.name
@@ -233,7 +233,7 @@ def _deserialize(
233233

234234

235235
class EntryPointTypeField(fields.Field):
236-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
236+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
237237
return value.name if value is not None else ""
238238

239239
def _deserialize(
@@ -254,7 +254,7 @@ def _deserialize(
254254

255255

256256
class CallTypeField(fields.Field):
257-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
257+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
258258
return value.name if value is not None else ""
259259

260260
def _deserialize(
@@ -273,7 +273,7 @@ def _deserialize(
273273

274274

275275
class L1DAModeField(fields.Field):
276-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
276+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
277277
return value.name if value is not None else ""
278278

279279
def _deserialize(
@@ -292,7 +292,7 @@ def _deserialize(
292292

293293

294294
class PriceUnitField(fields.Field):
295-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
295+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
296296
return value.name if value is not None else ""
297297

298298
def _deserialize(
@@ -311,7 +311,7 @@ def _deserialize(
311311

312312

313313
class DAModeField(fields.Field):
314-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
314+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
315315
return value.name if value is not None else ""
316316

317317
def _deserialize(
@@ -349,7 +349,7 @@ class Revision(Enum):
349349

350350

351351
class RevisionField(fields.Field):
352-
def _serialize(self, value: Any, attr: str, obj: Any, **kwargs):
352+
def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwargs):
353353
if value is None or value == Revision.V0:
354354
return str(Revision.V0.value)
355355
return value.value

starknet_py/serialization/serialization_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
The purpose of this file is to test serialization for complex abi.
33
"""
4+
45
import json
56
from typing import NamedTuple
67

0 commit comments

Comments
 (0)