From 644073999603f8b64fcfcc3ac08668fd7376a030 Mon Sep 17 00:00:00 2001 From: Gustavo Gonzalez Date: Mon, 12 Aug 2024 16:21:44 -0300 Subject: [PATCH 1/6] Change ABI suffix to Trait in dual case account and eth account traits --- docs/modules/ROOT/pages/guides/snip12.adoc | 2 +- packages/account/src/dual_account.cairo | 4 ++-- packages/account/src/dual_eth_account.cairo | 4 ++-- packages/account/src/tests/test_dual_account.cairo | 2 +- packages/account/src/tests/test_dual_eth_account.cairo | 2 +- packages/token/src/erc20/extensions/erc20_votes.cairo | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/modules/ROOT/pages/guides/snip12.adoc b/docs/modules/ROOT/pages/guides/snip12.adoc index fb919e065..2cf8e9b88 100644 --- a/docs/modules/ROOT/pages/guides/snip12.adoc +++ b/docs/modules/ROOT/pages/guides/snip12.adoc @@ -278,7 +278,7 @@ impl StructHashImpl of StructHash { #[starknet::contract] mod CustomERC20 { - use openzeppelin::account::dual_account::{DualCaseAccount, DualCaseAccountABI}; + use openzeppelin::account::dual_account::{DualCaseAccount, DualCaseAccountTrait}; use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; use openzeppelin::utils::cryptography::nonces::NoncesComponent; use starknet::ContractAddress; diff --git a/packages/account/src/dual_account.cairo b/packages/account/src/dual_account.cairo index 6216df1a9..cade87bf3 100644 --- a/packages/account/src/dual_account.cairo +++ b/packages/account/src/dual_account.cairo @@ -14,7 +14,7 @@ pub struct DualCaseAccount { pub contract_address: ContractAddress } -pub trait DualCaseAccountABI { +pub trait DualCaseAccountTrait { fn set_public_key(self: @DualCaseAccount, new_public_key: felt252, signature: Span); fn get_public_key(self: @DualCaseAccount) -> felt252; fn is_valid_signature( @@ -23,7 +23,7 @@ pub trait DualCaseAccountABI { fn supports_interface(self: @DualCaseAccount, interface_id: felt252) -> bool; } -impl DualCaseAccountImpl of DualCaseAccountABI { +impl DualCaseAccountImpl of DualCaseAccountTrait { fn set_public_key(self: @DualCaseAccount, new_public_key: felt252, signature: Span) { let mut args = array![new_public_key]; args.append_serde(signature); diff --git a/packages/account/src/dual_eth_account.cairo b/packages/account/src/dual_eth_account.cairo index a7c1b44e1..2097ba0da 100644 --- a/packages/account/src/dual_eth_account.cairo +++ b/packages/account/src/dual_eth_account.cairo @@ -15,7 +15,7 @@ pub struct DualCaseEthAccount { pub contract_address: ContractAddress } -pub trait DualCaseEthAccountABI { +pub trait DualCaseEthAccountTrait { fn set_public_key( self: @DualCaseEthAccount, new_public_key: EthPublicKey, signature: Span ); @@ -26,7 +26,7 @@ pub trait DualCaseEthAccountABI { fn supports_interface(self: @DualCaseEthAccount, interface_id: felt252) -> bool; } -impl DualCaseEthAccountImpl of DualCaseEthAccountABI { +impl DualCaseEthAccountImpl of DualCaseEthAccountTrait { fn set_public_key( self: @DualCaseEthAccount, new_public_key: EthPublicKey, signature: Span ) { diff --git a/packages/account/src/tests/test_dual_account.cairo b/packages/account/src/tests/test_dual_account.cairo index b157d2ba4..c1089e022 100644 --- a/packages/account/src/tests/test_dual_account.cairo +++ b/packages/account/src/tests/test_dual_account.cairo @@ -1,4 +1,4 @@ -use openzeppelin_account::dual_account::{DualCaseAccountABI, DualCaseAccount}; +use openzeppelin_account::dual_account::{DualCaseAccountTrait, DualCaseAccount}; use openzeppelin_account::interface::{AccountABIDispatcherTrait, AccountABIDispatcher}; use openzeppelin_introspection::interface::ISRC5_ID; diff --git a/packages/account/src/tests/test_dual_eth_account.cairo b/packages/account/src/tests/test_dual_eth_account.cairo index dcb6c714d..701c00927 100644 --- a/packages/account/src/tests/test_dual_eth_account.cairo +++ b/packages/account/src/tests/test_dual_eth_account.cairo @@ -1,4 +1,4 @@ -use openzeppelin_account::dual_eth_account::{DualCaseEthAccountABI, DualCaseEthAccount}; +use openzeppelin_account::dual_eth_account::{DualCaseEthAccountTrait, DualCaseEthAccount}; use openzeppelin_account::interface::{EthAccountABIDispatcherTrait, EthAccountABIDispatcher}; use openzeppelin_account::utils::secp256k1::{DebugSecp256k1Point, Secp256k1PointPartialEq}; use openzeppelin_introspection::interface::ISRC5_ID; diff --git a/packages/token/src/erc20/extensions/erc20_votes.cairo b/packages/token/src/erc20/extensions/erc20_votes.cairo index 7f341af64..052eeb4b6 100644 --- a/packages/token/src/erc20/extensions/erc20_votes.cairo +++ b/packages/token/src/erc20/extensions/erc20_votes.cairo @@ -17,7 +17,7 @@ use starknet::ContractAddress; #[starknet::component] pub mod ERC20VotesComponent { use core::num::traits::Zero; - use openzeppelin_account::dual_account::{DualCaseAccount, DualCaseAccountABI}; + use openzeppelin_account::dual_account::{DualCaseAccount, DualCaseAccountTrait}; use openzeppelin_governance::utils::interfaces::IVotes; use openzeppelin_token::erc20::ERC20Component; use openzeppelin_token::erc20::interface::IERC20; From bb4f5f75af8f4b391562145c9091705d403fc0b1 Mon Sep 17 00:00:00 2001 From: Gustavo Gonzalez Date: Mon, 12 Aug 2024 17:13:48 -0300 Subject: [PATCH 2/6] Add changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5531becf4..5ab68f78e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + # Changelog All notable changes to this project will be documented in this file. @@ -8,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed (Breaking) + +- Changed ABI suffix to Trait in dual case account and eth account traits (#1096). + ## 0.15.0 (2024-08-08) ### Added @@ -55,6 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed (Breaking) - Migrated to the `2023_11` edition (#995): + - Component implementations annotated with `#[embeddable_as()]` (e.g: `AccessControlComponent::AccessControl`) are not public anymore. Note that the embeddable versions are still public (e.g: `AccessControlComponent::AccessControlImpl`). - Implementations that can be compiler-derived from traits are not public anymore (e.g: `DualCaseAccessControlImpl` is not public while `DualCaseAccessControlTrait` is). - `Secp256k1PointPartialEq` and `DebugSecp256k1Point` are not public anymore. From f4af57b611900da0233e30fe3430ccb58f3bd28b Mon Sep 17 00:00:00 2001 From: Gustavo Gonzalez Date: Tue, 13 Aug 2024 08:47:21 -0400 Subject: [PATCH 3/6] Update CHANGELOG.md Co-authored-by: Eric Nordelo --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab68f78e..12a35ddc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed (Breaking) -- Changed ABI suffix to Trait in dual case account and eth account traits (#1096). +- Changed ABI suffix to Trait in dual case account and eth account modules (#1096). + - `DualCaseAccountABI` renamed to `DualCaseAccountTrait` + - `DualCaseEthAccountABI` renamed to `DualCaseEthAccountTrait` ## 0.15.0 (2024-08-08) From ab9436a0593434a16bc1442d77c163d0be7ead14 Mon Sep 17 00:00:00 2001 From: Gustavo Gonzalez Date: Thu, 15 Aug 2024 12:25:52 -0300 Subject: [PATCH 4/6] remove new line from changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12a35ddc5..0587e22d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed (Breaking) - Migrated to the `2023_11` edition (#995): - - Component implementations annotated with `#[embeddable_as()]` (e.g: `AccessControlComponent::AccessControl`) are not public anymore. Note that the embeddable versions are still public (e.g: `AccessControlComponent::AccessControlImpl`). - Implementations that can be compiler-derived from traits are not public anymore (e.g: `DualCaseAccessControlImpl` is not public while `DualCaseAccessControlTrait` is). - `Secp256k1PointPartialEq` and `DebugSecp256k1Point` are not public anymore. @@ -71,7 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `Trace` and `Checkpoint` structs are not public anymore, since they are intended to be used in `ERC20Votes`, and not as generic utilities. - `StorageArray` is not public anymore, since this implementation is specific to `ERC20Votes`, and is not intended as a generic utility, but as a temporary solution until Starknet native implementation arrives. -- Apply underscore pattern to modules (#993) +- Apply underscore pattern to modules (#993): - AccessControlComponent - `_set_role_admin` function renamed to `set_role_admin` - PausableComponent From 93f691a354faaf85534dc300246fff154cb4a0d1 Mon Sep 17 00:00:00 2001 From: Gustavo Gonzalez Date: Thu, 15 Aug 2024 12:57:05 -0300 Subject: [PATCH 5/6] fix lint --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f20fea1fd..5a6875f6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,12 +8,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased + ### Changed (Breaking) - Changed ABI suffix to Trait in dual case account and eth account modules (#1096). - `DualCaseAccountABI` renamed to `DualCaseAccountTrait` - `DualCaseEthAccountABI` renamed to `DualCaseEthAccountTrait` - + ## 0.15.1 (2024-08-13) ### Changed From 78a68714b4a8dd6f8e04080c4e2b3d63c045637d Mon Sep 17 00:00:00 2001 From: Gustavo Gonzalez Date: Thu, 15 Aug 2024 13:00:19 -0300 Subject: [PATCH 6/6] fix lint --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a6875f6e..837ed7e3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,8 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Remove token dependency from account package (#1100) - Fix docsite links (#1094) - - ## 0.15.0 (2024-08-08) ### Added