Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
drknzz committed Jun 26, 2023
2 parents 4182976 + bab95fa commit ec49aca
Show file tree
Hide file tree
Showing 93 changed files with 3,617 additions and 606 deletions.
17 changes: 0 additions & 17 deletions .github/stale.yml

This file was deleted.

20 changes: 12 additions & 8 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ jobs:
- name: Run tests
run: |
poetry run poe test_ci
poetry run poe test_ci_gateway
poetry run poe test_ci_full_node
- name: Generate coverage in XML
run: |
Expand All @@ -242,7 +243,7 @@ jobs:
# ---------------------------------------------------------- #

run-tests-windows:
# if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' }}
name: Tests Windows
needs: setup-tests
runs-on: windows-latest
Expand Down Expand Up @@ -278,7 +279,7 @@ jobs:
apt-get install -y python3-pip
sudo apt install -y libgmp3-dev
sudo apt-get install -y git
pip3 install git+https://github.com/0xSpaceShard/starknet-devnet.git@744e9b3bd5fb9e856287158d87673e090df69d73
pip3 install git+https://github.com/0xSpaceShard/starknet-devnet.git@v0.5.4
# ====================== SETUP PYTHON ====================== #

Expand Down Expand Up @@ -311,7 +312,8 @@ jobs:
- name: Run tests
run: |
poetry run poe test_ci
poetry run poe test_ci_gateway
poetry run poe test_ci_full_node
- name: Generate coverage in XML
run: |
Expand Down Expand Up @@ -373,7 +375,8 @@ jobs:

- name: Run tests
run: |
poetry run poe test_ci_docs
poetry run poe test_ci_docs_gateway
poetry run poe test_ci_docs_full_node
- name: Generate coverage in XML
run: |
Expand All @@ -387,7 +390,7 @@ jobs:
# ---------------------------------------------------------- #

run-docs-tests-windows:
# if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' }}
name: Docs Tests Windows
needs: setup-tests
runs-on: windows-latest
Expand Down Expand Up @@ -423,7 +426,7 @@ jobs:
apt-get install -y python3-pip
sudo apt install -y libgmp3-dev
sudo apt-get install -y git
pip3 install git+https://github.com/0xSpaceShard/starknet-devnet.git@744e9b3bd5fb9e856287158d87673e090df69d73
pip3 install git+https://github.com/0xSpaceShard/starknet-devnet.git@v0.5.4
# ====================== SETUP PYTHON ====================== #

Expand Down Expand Up @@ -452,7 +455,8 @@ jobs:

- name: Run tests
run: |
poetry run poe test_ci_docs
poetry run poe test_ci_docs_gateway
poetry run poe test_ci_docs_full_node
- name: Generate coverage in XML
run: |
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v8
with:
exempt-all-pr-assignees: true
exempt-pr-labels: 'pinned'
stale-issue-message: 'This issue is stale because it has not received any activity in the last 30 days. Remove stale label or add a comment, otherwise it will be closed in 5 days.'
close-issue-message: 'This issue was closed because it has been stale for 5 days with no activity.'
days-before-issue-stale: 30
days-before-issue-close: 5
stale-pr-message: 'This PR is stale because it has not received any activity in the last 30 days. Remove stale label or add a comment, otherwise it will be closed in 5 days.'
close-pr-message: 'This PR was closed because it has been stale for 5 days with no activity.'
days-before-pr-stale: 30
days-before-pr-close: 5
2 changes: 0 additions & 2 deletions docs/api/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ Module containing base models and functions to operate on them.

.. autoenum:: StarknetChainId
:members:

.. autofunction:: compute_invoke_hash
25 changes: 17 additions & 8 deletions docs/guide/deploying_contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ Here's an example how to declare a Cairo1 contract.
:language: python
:dedent: 4

.. note::

This is currently the only supported method of declaring a Cairo1 contract to Starknet.
The support for declaring through :ref:`Contract` interface is planned for a future release.


Deploying Cairo1 contracts
##########################
Expand All @@ -118,8 +113,22 @@ After declaring a Cairo1 contract, it can be deployed using UDC.
:start-after: docs-deploy: start
:end-before: docs-deploy: end

.. note::

Currently only :meth:`~starknet_py.net.udc_deployer.deployer.Deployer.create_contract_deployment_raw` is supported.
:meth:`~starknet_py.net.udc_deployer.deployer.Deployer.create_contract_deployment` will not work.
Simple declare and deploy Cairo1 contract example
#################################################

.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_simple_declare_and_deploy_cairo1.py
:language: python
:dedent: 4
:start-after: docs: start
:end-before: docs: end


Simple deploy Cairo1 contract example
#####################################

.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_simple_deploy_cairo1.py
:language: python
:dedent: 4
:start-after: docs: start
:end-before: docs: end
12 changes: 10 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,13 @@ Apple silicon
Windows
-------

This library is incompatible with Windows devices.
Use virtual machine with Linux, `Windows Subsystem for Linux 2 <https://learn.microsoft.com/en-us/windows/wsl/>`_ (WSL2) or other solution.
You can install starknet.py on Windows in two ways:

1. Install it just like you would on Linux.

You might encounter problems related to ``libcrypto_c_exports``. Make sure that you have `MinGW <https://www.mingw-w64.org/>`_ installed and up-to-date.

If you encounter any further problems related to installation, you can create an `issue at our GitHub <https://github.com/software-mansion/starknet.py/issues/new?assignees=&labels=bug&projects=&template=bug_report.yaml&title=%5BBUG%5D+%3Ctitle%3E>`_
or ask for help in ``#🐍 | starknet-py`` channel on `Starknet Discord server <https://starknet.io/discord>`_.

2. Use virtual machine with Linux, `Windows Subsystem for Linux 2 <https://learn.microsoft.com/en-us/windows/wsl/>`_ (WSL2).
92 changes: 81 additions & 11 deletions docs/migration_guide.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,74 @@
Migration guide
===============

****************************
0.17.0-alpha Migration guide
****************************

.. currentmodule:: starknet_py.net.full_node_client

:class:`FullNodeClient` RPC specification has been updated from `v0.3.0-rc1 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.3.0-rc1>`_ to `v0.3.0 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.3.0>`_.

.. currentmodule:: starknet_py.contract


:class:`Contract` now *initially* supports contracts written in **Cairo1**.

To create an instance of such contract, a keyword parameter ``cairo_version=1`` in the Contract constructor is required.


.. note::
Please note that while using the interface with `Cairo1` contracts, it is possible for problems to occur due to some of the types being not yet implemented in the parser.

In such case, please open an issue at our `GitHub <https://github.com/software-mansion/starknet.py/issues/new?assignees=&labels=bug&projects=&template=bug_report.yaml&title=%5BBUG%5D+%3Ctitle%3E>`_ or contract us on `Starknet Discord server <https://starknet.io/discord>`_ in ``#🐍 | starknet-py`` channel.


Breaking changes
----------------

1. Deprecated function ``compute_invoke_hash`` in :mod:`starknet_py.net.models.transaction` has been removed in favor of :func:`starknet_py.hash.transaction.compute_invoke_transaction_hash`.


Minor changes
-------------

1. :meth:`DeclareResult.deploy`, :meth:`PreparedFunctionCall.invoke`, :meth:`PreparedFunctionCall.estimate_fee`, :meth:`ContractFunction.invoke`, :meth:`Contract.declare` and :meth:`Contract.deploy_contract` can now accept custom ``nonce`` parameter.

.. currentmodule:: starknet_py.net.account.account

2. :meth:`Account.sign_invoke_transaction`, :meth:`Account.sign_declare_transaction`, :meth:`Account.sign_declare_v2_transaction`, :meth:`Account.sign_deploy_account_transaction` and :meth:`Account.execute` can now accept custom ``nonce`` parameter.
3. :meth:`Account.get_nonce` can now be parametrized with ``block_number`` or ``block_hash``.
4. :meth:`Account.get_balance` can now be parametrized with ``block_number`` or ``block_hash``.

RPC related changes:

.. currentmodule:: starknet_py.net.client_models

5. :class:`L2toL1Message` dataclass now has an additional field: ``from_address``.
6. :class:`TransactionReceipt` dataclass now has two additional, optional fields: ``type`` and ``contract_address``.

.. currentmodule:: starknet_py.net.full_node_client

7. :meth:`FullNodeClient.get_events` ``keys`` and ``address`` parameters type are now optional.
8. :meth:`FullNodeClient.get_events` ``keys`` parameter can now also accept integers as felts.


Bugfixes
--------

.. currentmodule:: starknet_py.hash.class_hash

1. Fixed a bug when :func:`compute_class_hash` mutated the ``contract_class`` argument passed to a function.


|
.. raw:: html

<hr>

|
**********************
0.16.1 Migration guide
**********************
Expand All @@ -9,23 +77,25 @@ Migration guide

Additionally, this release brings support for `RPC v0.3.0rc1 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.3.0-rc1>`_!

Breaking changes
----------------
0.16.1 Breaking changes
-----------------------

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

1. ``FullNodeClient.get_events`` `keys` parameter type is now `List[List[str]]` instead of `List[str]`.
2. ``FullNodeClient.get_state_update`` return type has been changed from `StateUpdate` to `Union[BlockStateUpdate, PendingBlockStateUpdate]`
1. :meth:`FullNodeClient.get_events` ``keys`` parameter type is now ``List[List[str]]`` instead of ``List[str]``.
2. :meth:`FullNodeClient.get_state_update` return type has been changed from ``StateUpdate`` to ``Union[BlockStateUpdate, PendingBlockStateUpdate]``

.. currentmodule:: starknet_py.net.schemas
.. currentmodule:: starknet_py.net.client_models

3. ``StateDiff`` dataclass properties have been changed (more details in RPC specification linked above).
3. :class:`StateDiff` dataclass properties have been changed (more details in RPC specification linked above).


Minor changes
-------------
0.16.1 Minor changes
--------------------

.. currentmodule:: starknet_py.net.client

1. ``Client.estimate_fee`` can take a single transaction or a list of transactions to estimate.
1. :meth:`Client.estimate_fee` can take a single transaction or a list of transactions to estimate.


|
Expand Down Expand Up @@ -207,7 +277,7 @@ The only supported Python version is 3.9.

- :class:`starknet_py.net.client_models.InvokeTransaction`
- :class:`starknet_py.net.models.transaction.Invoke`
- :func:`starknet_py.net.models.transaction.compute_invoke_hash`
- ``compute_invoke_hash``
13. Replaced ``BlockStateUpdate.state_diff.declared_contract_hashes`` is now a list of ``DeclaredContractHash`` representing new Cairo classes. Old declared contract classes are still available at ``BlockStateUpdate.state_diff.deprecated_declared_contract_hashes``.
14. Removed ``version`` property from ``PreparedFunctionCall`` class.
15. Removed deprecated ``max_steps`` in :class:`~starknet_py.proxy.contract_abi_resolver.ProxyConfig`.
Expand Down
Loading

0 comments on commit ec49aca

Please sign in to comment.