From 85c1c99c34e0982be8a8b2ad181f76b6037250bb Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Mon, 13 Jan 2025 12:31:30 +0100 Subject: [PATCH 1/8] Add migration guide for v0.25.0 --- docs/api/data_types.rst | 32 +++++++++++++++++++++++++++++++- docs/migration_guide.rst | 14 ++++++++------ pyproject.toml | 2 +- starknet_py/cairo/data_types.py | 2 +- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/docs/api/data_types.rst b/docs/api/data_types.rst index fe198cd1b..e88e8c3bd 100644 --- a/docs/api/data_types.rst +++ b/docs/api/data_types.rst @@ -11,6 +11,9 @@ Module containing representations of Cairo types. Mostly used to generate proper .. autoclass:: FeltType :exclude-members: __init__, __new__ +.. autoclass:: BoolType + :exclude-members: __init__, __new__ + .. autoclass:: TupleType :exclude-members: __init__, __new__ :members: types @@ -25,4 +28,31 @@ Module containing representations of Cairo types. Mostly used to generate proper .. autoclass:: StructType :exclude-members: __init__, __new__ - :members: types + :members: name, types + +.. autoclass:: EnumType + :exclude-members: __init__, __new__ + :members: name, variants + +.. autoclass:: OptionType + :exclude-members: __init__, __new__ + :members: type + +.. autoclass:: UintType + :exclude-members: __init__, __new__ + :members: bits + +.. autoclass:: TypeIdentifier + :exclude-members: __init__, __new__ + :members: name + +.. autoclass:: UnitType + :exclude-members: __init__, __new__ + +.. autoclass:: EventType + :exclude-members: __init__, __new__ + :members: name, types, keys + +.. autoclass:: NonZeroType + :exclude-members: __init__, __new__ + :members: type diff --git a/docs/migration_guide.rst b/docs/migration_guide.rst index 04e434230..5fe2fc419 100644 --- a/docs/migration_guide.rst +++ b/docs/migration_guide.rst @@ -2,19 +2,21 @@ Migration guide =============== ****************************** -[unreleased] Migration guide +0.25.0 Migration guide ****************************** This version of starknet.py requires Python 3.9 as a minimum version. -[unreleased] Minor changes --------------------------- +1. Added :class:`~starknet_py.cairo.data_types.NonZeroType` in order to fix parsing ABI which contains Cairo`s `core::zeroable::NonZero `_. -.. currentmodule:: starknet_py.cairo.data_types +2. Added `SNIP-9 `_ support to :class:`~starknet_py.net.account.account.Account`. Now it's possible to create a :class:`~starknet_py.net.client_models.Call` for outside execution using :meth:`~starknet_py.net.account.account.Account.sign_outside_execution_call`. -1. Added :class:`NonZeroType` in order to fix parsing ABI which contains Cairo`s `core::zeroable::NonZero `_ +3. All methods and classes using transactions other than v3 are now deprecated. -2. Added `SNIP-9 `_ support to :class:`~starknet_py.net.account.account.Account`. Now it's possible to create a :class:`~starknet_py.net.client_models.Call` for outside execution using :meth:`~starknet_py.net.account.account.Account.sign_outside_execution_call`. +0.25.0 Minor changes +-------------------- + +1. Added ``keys`` field to :class:`~starknet_py.cairo.data_types.EventType` which contains the list of event fields marked with ``#[key]`` in Cairo code. ****************************** 0.24.3 Migration guide diff --git a/pyproject.toml b/pyproject.toml index b122274be..ed189bae6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "starknet-py" -version = "0.24.3" +version = "0.25.0" description = "A python SDK for Starknet" authors = [ { name = "Tomasz Rejowski", email = "tomasz.rejowski@swmansion.com" }, diff --git a/starknet_py/cairo/data_types.py b/starknet_py/cairo/data_types.py index 4d6ab72e5..53c29c15d 100644 --- a/starknet_py/cairo/data_types.py +++ b/starknet_py/cairo/data_types.py @@ -130,4 +130,4 @@ class NonZeroType(CairoType): Type representation of Cairo NonZero. """ - type: CairoType + type: CairoType #: Type of element wrapped in NonZero. From 2083c6f6887aa1606d8b79dbcf33ca2603f61734 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Mon, 13 Jan 2025 12:37:07 +0100 Subject: [PATCH 2/8] Fix Cairo data types docs --- docs/api/data_types.rst | 32 +++++++++++++++++++++++++++++++- starknet_py/cairo/data_types.py | 24 ++++++++++++------------ 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/docs/api/data_types.rst b/docs/api/data_types.rst index fe198cd1b..15c9fa638 100644 --- a/docs/api/data_types.rst +++ b/docs/api/data_types.rst @@ -11,6 +11,9 @@ Module containing representations of Cairo types. Mostly used to generate proper .. autoclass:: FeltType :exclude-members: __init__, __new__ +.. autoclass:: BoolType + :exclude-members: __init__, __new__ + .. autoclass:: TupleType :exclude-members: __init__, __new__ :members: types @@ -25,4 +28,31 @@ Module containing representations of Cairo types. Mostly used to generate proper .. autoclass:: StructType :exclude-members: __init__, __new__ - :members: types + :members: name, types + +.. autoclass:: EnumType + :exclude-members: __init__, __new__ + :members: name, variants + +.. autoclass:: OptionType + :exclude-members: __init__, __new__ + :members: type + +.. autoclass:: UintType + :exclude-members: __init__, __new__ + :members: bits + +.. autoclass:: TypeIdentifier + :exclude-members: __init__, __new__ + :members: name + +.. autoclass:: UnitType + :exclude-members: __init__, __new__ + +.. autoclass:: EventType + :exclude-members: __init__, __new__ + :members: name, types, keys + +.. autoclass:: NonZeroType + :exclude-members: __init__, __new__ + :members: type \ No newline at end of file diff --git a/starknet_py/cairo/data_types.py b/starknet_py/cairo/data_types.py index 4d6ab72e5..d13555a35 100644 --- a/starknet_py/cairo/data_types.py +++ b/starknet_py/cairo/data_types.py @@ -32,7 +32,7 @@ class TupleType(CairoType): Type representation of Cairo tuples without named fields. """ - types: List[CairoType] #: types of every tuple element. + types: List[CairoType] #: Types of every tuple element. @dataclass @@ -41,7 +41,7 @@ class NamedTupleType(CairoType): Type representation of Cairo tuples with named fields. """ - types: OrderedDict[str, CairoType] #: types of every tuple member. + types: OrderedDict[str, CairoType] #: Types of every tuple member. @dataclass @@ -50,7 +50,7 @@ class ArrayType(CairoType): Type representation of Cairo arrays. """ - inner_type: CairoType #: type of element inside array. + inner_type: CairoType #: Type of element inside array. @dataclass @@ -70,8 +70,8 @@ class EnumType(CairoType): Type representation of Cairo enums. """ - name: str - variants: OrderedDict[str, CairoType] + name: str #: Enum name. + variants: OrderedDict[str, CairoType] #: Enum variants. @dataclass @@ -80,7 +80,7 @@ class OptionType(CairoType): Type representation of Cairo options. """ - type: CairoType + type: CairoType #: Typed of element wrapped in the Option. @dataclass @@ -89,7 +89,7 @@ class UintType(CairoType): Type representation of Cairo unsigned integers. """ - bits: int + bits: int #: Number of bits in the integer. def check_range(self, value: int): """ @@ -103,7 +103,7 @@ class TypeIdentifier(CairoType): Type representation of Cairo identifiers. """ - name: str + name: str #: Identifier name. @dataclass @@ -119,9 +119,9 @@ class EventType(CairoType): Type representation of Cairo Event. """ - name: str - types: OrderedDict[str, CairoType] - keys: List[str] + name: str #: Event name. + types: OrderedDict[str, CairoType] #: Types of every event member. + keys: List[str] #: Keys of every event member. @dataclass @@ -130,4 +130,4 @@ class NonZeroType(CairoType): Type representation of Cairo NonZero. """ - type: CairoType + type: CairoType #: Type of element wrapped in NonZero. From 0b7873a10e03deacb0e9778815aca98e1b362bc6 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Mon, 13 Jan 2025 12:42:25 +0100 Subject: [PATCH 3/8] Adjust migration guide --- docs/migration_guide.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/migration_guide.rst b/docs/migration_guide.rst index 5fe2fc419..c5b76fb23 100644 --- a/docs/migration_guide.rst +++ b/docs/migration_guide.rst @@ -7,7 +7,9 @@ Migration guide This version of starknet.py requires Python 3.9 as a minimum version. -1. Added :class:`~starknet_py.cairo.data_types.NonZeroType` in order to fix parsing ABI which contains Cairo`s `core::zeroable::NonZero `_. +.. currentmodule:: starknet_py.cairo.data_types + +1. Added :class:`NonZeroType` in order to fix parsing ABI which contains Cairo`s `core::zeroable::NonZero `_. 2. Added `SNIP-9 `_ support to :class:`~starknet_py.net.account.account.Account`. Now it's possible to create a :class:`~starknet_py.net.client_models.Call` for outside execution using :meth:`~starknet_py.net.account.account.Account.sign_outside_execution_call`. @@ -16,7 +18,7 @@ This version of starknet.py requires Python 3.9 as a minimum version. 0.25.0 Minor changes -------------------- -1. Added ``keys`` field to :class:`~starknet_py.cairo.data_types.EventType` which contains the list of event fields marked with ``#[key]`` in Cairo code. +1. Added ``keys`` field to :class:`EventType` which contains the list of event fields marked with ``#[key]`` in Cairo code. ****************************** 0.24.3 Migration guide From dd8e65041d4eceb3e15c2cecaf18d0a5276af6f7 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Mon, 13 Jan 2025 12:43:43 +0100 Subject: [PATCH 4/8] Adjust migration guide --- docs/migration_guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migration_guide.rst b/docs/migration_guide.rst index c5b76fb23..3fc61888a 100644 --- a/docs/migration_guide.rst +++ b/docs/migration_guide.rst @@ -13,7 +13,7 @@ This version of starknet.py requires Python 3.9 as a minimum version. 2. Added `SNIP-9 `_ support to :class:`~starknet_py.net.account.account.Account`. Now it's possible to create a :class:`~starknet_py.net.client_models.Call` for outside execution using :meth:`~starknet_py.net.account.account.Account.sign_outside_execution_call`. -3. All methods and classes using transactions other than v3 are now deprecated. +3. All methods and classes which use transactions other than v3 are now deprecated. 0.25.0 Minor changes -------------------- From ed7a322d0e45267734fdf59e4fd04508e781ca2b Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Mon, 13 Jan 2025 12:46:29 +0100 Subject: [PATCH 5/8] Restore old version in `pyproject.toml` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ed189bae6..b122274be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "starknet-py" -version = "0.25.0" +version = "0.24.3" description = "A python SDK for Starknet" authors = [ { name = "Tomasz Rejowski", email = "tomasz.rejowski@swmansion.com" }, From e4bd02321bfad2bdaccbf2f2761912aedb27bde4 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Mon, 13 Jan 2025 12:48:14 +0100 Subject: [PATCH 6/8] Bump version to `0.25.0` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b122274be..ed189bae6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "starknet-py" -version = "0.24.3" +version = "0.25.0" description = "A python SDK for Starknet" authors = [ { name = "Tomasz Rejowski", email = "tomasz.rejowski@swmansion.com" }, From fb45dd840e8c7acd48bdf1cbdbbdac823d91beaa Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Mon, 13 Jan 2025 12:51:54 +0100 Subject: [PATCH 7/8] Trigger CI From 8d5ab1b89581503139d495a2d03385ae46bf3e4e Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Mon, 13 Jan 2025 14:14:07 +0100 Subject: [PATCH 8/8] Remove `TypeIdentifier` from data types docs --- docs/api/data_types.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/api/data_types.rst b/docs/api/data_types.rst index 15c9fa638..9ae57300f 100644 --- a/docs/api/data_types.rst +++ b/docs/api/data_types.rst @@ -42,10 +42,6 @@ Module containing representations of Cairo types. Mostly used to generate proper :exclude-members: __init__, __new__ :members: bits -.. autoclass:: TypeIdentifier - :exclude-members: __init__, __new__ - :members: name - .. autoclass:: UnitType :exclude-members: __init__, __new__