Skip to content

Support starknet_getCompiledCasm #1514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
ffcc501
Remove unused import
franciszekjob Oct 29, 2024
c2db084
Add `get_compiled_casm` in `Client` and `FullNodeClient`
franciszekjob Oct 29, 2024
3feacdd
Add `get_compiled_casm` in `Client` and `FullNodeClient`
franciszekjob Oct 29, 2024
d2a2691
Add schemas for deprecated, core and Starknet hints
franciszekjob Oct 29, 2024
d0e20b7
Remove todos; Add validation error
franciszekjob Oct 29, 2024
8bb768e
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Nov 3, 2024
28229b7
Add dataclasses
franciszekjob Nov 3, 2024
f1e68ee
Remove unnecessary file
franciszekjob Nov 3, 2024
31c2553
Remove unnecessary file
franciszekjob Nov 3, 2024
c5b5cd5
Move enums to `client_models.py`
franciszekjob Nov 4, 2024
0cdcb89
Refactor serialization and deserialization in schemas
franciszekjob Nov 4, 2024
4cc441c
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Nov 4, 2024
1cce722
Minor refactor of serialize/deserialize methods
franciszekjob Nov 4, 2024
65c3e7b
Format
franciszekjob Nov 4, 2024
69497d7
Remove `pythonic_hints` from `CasmClass`
franciszekjob Nov 4, 2024
cbb6042
Format
franciszekjob Nov 4, 2024
2421806
Add todo for `get_compiled_casm` test
franciszekjob Nov 4, 2024
0c2cc36
Add `make_dataclass()` to schemas
franciszekjob Nov 4, 2024
2c9c736
Fix cyclic imports test
franciszekjob Nov 4, 2024
ebaa859
Fix circular imports
franciszekjob Nov 7, 2024
03fa3f2
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Nov 8, 2024
20ad81a
Update resource bounds params
franciszekjob Jan 30, 2025
c7fb9bd
Apply code review suggestion
franciszekjob Jan 30, 2025
7819a66
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Jan 30, 2025
8ff797a
Remove code, tests and docs for old txs
franciszekjob Feb 27, 2025
1702e0e
Fix lint and typecheck
franciszekjob Feb 27, 2025
4d13bfc
Fix formatting
franciszekjob Feb 27, 2025
f2392e5
Fix lint and typecheck
franciszekjob Feb 27, 2025
ca2acab
Remove old txs usages, adjust tests and docs
franciszekjob Feb 27, 2025
093f956
Fix tests
franciszekjob Feb 27, 2025
7c49192
Remove todos
franciszekjob Feb 27, 2025
0774348
Remove `test_account_get_balance_eth`
franciszekjob Feb 27, 2025
ddafd39
Fix other tests
franciszekjob Feb 27, 2025
fd351ca
Skip test
franciszekjob Feb 28, 2025
73f2692
Adjust devnet
franciszekjob Feb 28, 2025
9475a36
Fix skip mark
franciszekjob Feb 28, 2025
2b2d7a5
Remove skip marks; Fix tests
franciszekjob Feb 28, 2025
e019506
Update ledger app sha
franciszekjob Feb 28, 2025
8152c21
Refactor assertion in test
franciszekjob Feb 28, 2025
1e3643b
Restore original `test_ci_v2`
franciszekjob Feb 28, 2025
8c1a4c3
Add todos
franciszekjob Feb 28, 2025
f3a83cb
Formatting
franciszekjob Feb 28, 2025
ad110dc
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Feb 28, 2025
c3b3366
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Feb 28, 2025
061a17e
Adjust todos and fixmes
franciszekjob Feb 28, 2025
240c8ad
Use `argent_account_class_hash` in `test_deploy_account_and_transfer`
franciszekjob Feb 28, 2025
d4c2eed
Fix `test_deploy_account_and_transfer`
franciszekjob Feb 28, 2025
df36664
Revert "Fix `test_deploy_account_and_transfer`"
franciszekjob Feb 28, 2025
f67ad37
Revert "Use `argent_account_class_hash` in `test_deploy_account_and_t…
franciszekjob Feb 28, 2025
2468055
Skip and add todo for `test_deploy_account_and_transfer`
franciszekjob Feb 28, 2025
db6b342
Update skip message for `test_get_transaction_by_block_id`
franciszekjob Feb 28, 2025
6a943fd
Update todo
franciszekjob Feb 28, 2025
d9a2091
Remove `--initial-balance` flag for devnet start
franciszekjob Feb 28, 2025
dd9a037
Revert "Remove `--initial-balance` flag for devnet start"
franciszekjob Feb 28, 2025
d6dd873
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Feb 28, 2025
eadc306
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Feb 28, 2025
3472c77
Update migration guide
franciszekjob Feb 28, 2025
dfa2565
Pull changes from upstream
franciszekjob Feb 28, 2025
26ae3b2
Remove unused imports
franciszekjob Feb 28, 2025
005df53
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Feb 28, 2025
b1324fb
Pull changes from upstream
franciszekjob Feb 28, 2025
91df2ae
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Feb 28, 2025
00ae4bc
Merge branch 'franciszekjob/1498-remove-old-txs' of https://github.co…
franciszekjob Feb 28, 2025
3471fd0
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Feb 28, 2025
53c6720
Merge branch 'franciszekjob/1498-remove-old-txs' of https://github.co…
franciszekjob Feb 28, 2025
edf6244
Fix and update network tests
franciszekjob Mar 3, 2025
9a24a3a
Fix devnet client tests
franciszekjob Mar 3, 2025
874d549
Fix CI
franciszekjob Mar 3, 2025
88eae81
Use asdf action
franciszekjob Mar 3, 2025
6a08d7a
Restore `Download contracts` step in CI
franciszekjob Mar 3, 2025
d3ee384
Temporarily list contracts dir
franciszekjob Mar 3, 2025
a0da29a
Update listing dirs
franciszekjob Mar 3, 2025
ab7201a
Update listing dirs
franciszekjob Mar 3, 2025
95b6612
Temporary CI change
franciszekjob Mar 3, 2025
ad3092a
Display compiled contracts path
franciszekjob Mar 3, 2025
09582cb
Compile contract before running tests in CI
franciszekjob Mar 3, 2025
afc276d
Merge branch 'franciszekjob/1498-fix-network-tests' of https://github…
franciszekjob Mar 3, 2025
6919c41
Partially implement `test_get_compiled_casm`
franciszekjob Mar 3, 2025
bf40c24
Fix params in `FullNodeClient.get_compiled_casm`
franciszekjob Mar 3, 2025
334ae73
Update dependencies
franciszekjob Mar 3, 2025
98102b2
Restore read api for txs other than v3
franciszekjob Mar 3, 2025
9130912
Merge branch 'franciszekjob/1498-remove-old-txs' of https://github.co…
franciszekjob Mar 3, 2025
403acda
Refactor broadcasted txn schemas
franciszekjob Mar 3, 2025
be1d06c
Add todo as skip reason
franciszekjob Mar 3, 2025
96437db
Add `test_sign_invoke_v3_auto_estimate`
franciszekjob Mar 3, 2025
6e89aeb
Merge branch 'franciszekjob/1498-remove-old-txs' of https://github.co…
franciszekjob Mar 3, 2025
ff9e751
Run `poetry lock`
franciszekjob Mar 3, 2025
504a4bf
Merge branch 'franciszekjob/1498-remove-old-txs' of https://github.co…
franciszekjob Mar 3, 2025
149b3e7
Restore test values in `test_get_transaction_by_block_id_and_index`
franciszekjob Mar 3, 2025
8dff862
Fix docs
franciszekjob Mar 3, 2025
e769188
Merge branch 'franciszekjob/1498-remove-old-txs' of https://github.co…
franciszekjob Mar 3, 2025
4560095
Docstrings formatting
franciszekjob Mar 3, 2025
425a1ab
Merge branch 'franciszekjob/1498-remove-old-txs' of https://github.co…
franciszekjob Mar 3, 2025
4b30550
Merge branch 'franciszekjob/1498-fix-network-tests' of https://github…
franciszekjob Mar 3, 2025
bd795f2
Add todos
franciszekjob Mar 4, 2025
f2c8725
Merge branch 'franciszekjob/1498-remove-old-txs' of https://github.co…
franciszekjob Mar 4, 2025
555c0f2
Merge branch 'franciszekjob/1498-fix-network-tests' of https://github…
franciszekjob Mar 4, 2025
7b6c1cf
Fix `test_transaction_not_received_max_fee_too_big`
franciszekjob Mar 4, 2025
7e2482b
Resolve merge conflicts
franciszekjob Mar 4, 2025
b859d78
Merge branch 'franciszekjob/1498-fix-network-tests' of https://github…
franciszekjob Mar 4, 2025
f02a234
Add `HintSchema`; Rename fields
franciszekjob Mar 4, 2025
8911fca
Update field names in models
franciszekjob Mar 4, 2025
d135bc5
Add tests for `get_compiled_casm`
franciszekjob Mar 4, 2025
86dee4d
Merge branch 'franciszekjob/1498-rpc-0.8.0' of https://github.com/sof…
franciszekjob Mar 4, 2025
7ccbf0e
Move models and schema from executables api to separate files
franciszekjob Mar 4, 2025
b4da6f5
Add docs
franciszekjob Mar 4, 2025
5484105
Pull changes from upstream
franciszekjob Mar 4, 2025
d097214
Rename file
franciszekjob Mar 4, 2025
e0ecdf5
Fix `test_get_compiled_casm` for devnet
franciszekjob Mar 4, 2025
90b1060
Remove unused import
franciszekjob Mar 4, 2025
a8ad3c6
Add `STARKNET_PY_MARSHMALLOW_UNKNOWN_EXCLUDE` to CI
franciszekjob Mar 4, 2025
c1d9235
Change `index_delta_minus_1` to `index_delta_minus1`
franciszekjob Mar 4, 2025
01fe3df
Add fixes in executables schemas and models
franciszekjob Mar 5, 2025
3e7578f
Use schema with excluding unknown fields for `CasmClassSchema`
franciszekjob Mar 5, 2025
57a3ec2
Update todos
franciszekjob Mar 5, 2025
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
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ API
api/devnet_client
api/account
api/client_models
api/executable_models
api/client_errors
api/transaction_errors
api/contract
Expand Down
6 changes: 6 additions & 0 deletions docs/api/executable_models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Models for executables
======================

.. automodule:: starknet_py.net.executable_models
:members:
:member-order: groupwise
2 changes: 1 addition & 1 deletion docs/migration_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Version [Unreleased] of **starknet.py** comes with support for RPC 0.8.0!

.. py:currentmodule:: starknet_py.net.full_node_client

2. New methods have been added: :meth:`~FullNodeClient.get_storage_proof` and :meth:`~FullNodeClient.get_messages_status`.
2. New methods have been added: :meth:`~FullNodeClient.get_storage_proof`, :meth:`~FullNodeClient.get_messages_status` and :meth:`~FullNodeClient.get_compiled_casm`.

.. py:currentmodule:: starknet_py.net.client_models

Expand Down
2 changes: 1 addition & 1 deletion starknet_py/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from marshmallow import EXCLUDE, ValidationError

from starknet_py.net.client_models import (
CasmClass,
DeprecatedCompiledContract,
DeprecatedContractClass,
SierraCompiledContract,
)
from starknet_py.net.executable_models import CasmClass
from starknet_py.net.schemas.rpc.contract import (
CasmClassSchema,
ContractClassSchema,
Expand Down
3 changes: 2 additions & 1 deletion starknet_py/hash/casm_class_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
BytecodeSegmentStructure,
NestedIntList,
)
from starknet_py.net.client_models import CasmClass, CasmClassEntryPoint
from starknet_py.net.client_models import CasmClassEntryPoint
from starknet_py.net.executable_models import CasmClass

CASM_CLASS_VERSION = "COMPILED_CLASS_V1"

Expand Down
10 changes: 10 additions & 0 deletions starknet_py/net/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
TransactionStatus,
TransactionStatusResponse,
)
from starknet_py.net.executable_models import CasmClass
from starknet_py.net.models.transaction import (
AccountTransaction,
DeclareV3,
Expand Down Expand Up @@ -338,3 +339,12 @@ async def get_messages_status(self, transaction_hash: str) -> List[MessageStatus
:param transaction_hash: Hash of the L1 transaction
:return: Status of the messages
"""

@abstractmethod
async def get_compiled_casm(self, class_hash: int) -> CasmClass:
"""
Get the contract class definition in the given block associated with the given hash.

:param class_hash: Hash of the contract class whose CASM will be returned
:return: CasmClass object
"""
17 changes: 1 addition & 16 deletions starknet_py/net/client_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from abc import ABC
from dataclasses import dataclass, field
from enum import Enum
from typing import Any, Dict, Iterable, List, Literal, Optional, Union, cast
from typing import Dict, Iterable, List, Literal, Optional, Union, cast

from marshmallow import EXCLUDE

Expand Down Expand Up @@ -938,21 +938,6 @@ class CasmClassEntryPointsByType:
l1_handler: List[CasmClassEntryPoint]


@dataclass
class CasmClass:
"""
Dataclass representing class compiled to Cairo assembly.
"""

prime: int
bytecode: List[int]
hints: List[Any]
pythonic_hints: List[Any]
compiler_version: str
entry_points_by_type: CasmClassEntryPointsByType
bytecode_segment_lengths: Optional[List[int]]


@dataclass
class TransactionStatusResponse:
"""
Expand Down
Loading