Skip to content
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

Change ABI suffix to Trait in dual case account and eth account traits #1096

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- markdownlint-disable MD024 -->

# Changelog

All notable changes to this project will be documented in this file.
Expand All @@ -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).
ggonzalez94 marked this conversation as resolved.
Show resolved Hide resolved

## 0.15.0 (2024-08-08)

### Added
Expand Down Expand Up @@ -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):

ggonzalez94 marked this conversation as resolved.
Show resolved Hide resolved
- 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.
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/guides/snip12.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl StructHashImpl of StructHash<Message> {

#[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;
Expand Down
4 changes: 2 additions & 2 deletions packages/account/src/dual_account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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<felt252>);
fn get_public_key(self: @DualCaseAccount) -> felt252;
fn is_valid_signature(
Expand All @@ -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<felt252>) {
let mut args = array![new_public_key];
args.append_serde(signature);
Expand Down
4 changes: 2 additions & 2 deletions packages/account/src/dual_eth_account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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<felt252>
);
Expand All @@ -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<felt252>
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/account/src/tests/test_dual_account.cairo
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 1 addition & 1 deletion packages/account/src/tests/test_dual_eth_account.cairo
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/token/src/erc20/extensions/erc20_votes.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down