Skip to content

Commit

Permalink
Change ABI suffix to Trait in dual case account and eth account traits (
Browse files Browse the repository at this point in the history
#1096)

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

* Add changelog

* Update CHANGELOG.md

Co-authored-by: Eric Nordelo <[email protected]>

* remove new line from changelog

* fix lint

* fix lint

---------

Co-authored-by: Eric Nordelo <[email protected]>
  • Loading branch information
ggonzalez94 and ericnordelo authored Aug 15, 2024
1 parent 329a218 commit 7cd11ab
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
9 changes: 8 additions & 1 deletion 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,12 @@ 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 modules (#1096).
- `DualCaseAccountABI` renamed to `DualCaseAccountTrait`
- `DualCaseEthAccountABI` renamed to `DualCaseEthAccountTrait`

## 0.15.1 (2024-08-13)

### Changed
Expand Down Expand Up @@ -70,7 +77,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
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::{DualCaseEthAccount, DualCaseEthAccountABI};
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

0 comments on commit 7cd11ab

Please sign in to comment.