Skip to content

Commit

Permalink
turn lockable and permissionable into private functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mubarak23 committed Sep 9, 2024
1 parent d9aec27 commit 933b583
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/components/lockable/lockable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ pub mod LockableComponent {
pub const YEAR_DAYS_SECONDS: u64 = 31536000;

// *************************************************************************
// EXTERNAL FUNCTIONS
// PRIVATE FUNCTIONS
// *************************************************************************
#[embeddable_as(LockableImpl)]
pub impl Lockable<
#[generate_trait]
pub impl Private<
TContractState,
+HasComponent<TContractState>,
+Drop<TContractState>,
impl Account: AccountComponent::HasComponent<TContractState>
> of ILockable<ComponentState<TContractState>> {
impl Account: AccountComponent::HasComponent<TContractState>,
> of PrivateTrait<TContractState> {
// @notice locks an account
// @param lock_until duration for which account should be locked
fn lock(ref self: ComponentState<TContractState>, lock_until: u64) {
Expand Down
11 changes: 5 additions & 6 deletions src/components/permissionable/permissionable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,16 @@ pub mod PermissionableComponent {
pub const UNAUTHORIZED: felt252 = 'Account: unauthorized';
}


// *************************************************************************
// EXTERNAL FUNCTIONS
// PRIVATE FUNCTIONS
// *************************************************************************
#[embeddable_as(PermissionableImpl)]
pub impl Permissionable<
#[generate_trait]
pub impl Private<
TContractState,
+HasComponent<TContractState>,
+Drop<TContractState>,
impl Account: AccountComponent::HasComponent<TContractState>
> of IPermissionable<ComponentState<TContractState>> {
impl Account: AccountComponent::HasComponent<TContractState>,
> of PrivateTrait<TContractState> {
// @notice sets permission for an account
// @permissioned_addresses array of addresses who's permission is to be updated
// @param permssions permission value <true, false>
Expand Down
5 changes: 3 additions & 2 deletions src/components/presets/account_preset.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ pub mod AccountPreset {

impl AccountInternalImpl = AccountComponent::InternalImpl<ContractState>;
impl UpgradeableInternalImpl = UpgradeableComponent::Private<ContractState>;
impl LockableImpl = LockableComponent::LockableImpl<ContractState>;
impl SignerImpl = SignatoryComponent::Private<ContractState>;
impl LockableImpl = LockableComponent::Private<ContractState>;
impl SignerImpl = SignatoryComponent::SingnatoryPrivate<ContractState>;
impl PermissionableImpl = PermissionableComponent::Private<ContractState>;

// *************************************************************************
// STORAGE
Expand Down
4 changes: 2 additions & 2 deletions src/components/signatory/signatory.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub mod SignatoryComponent {
use token_bound_accounts::components::account::account::AccountComponent;
use token_bound_accounts::components::account::account::AccountComponent::InternalImpl;
use token_bound_accounts::components::permissionable::permissionable::PermissionableComponent;
use token_bound_accounts::components::permissionable::permissionable::PermissionableComponent::PermissionableImpl;
use token_bound_accounts::components::permissionable::permissionable::PermissionableComponent::Private;
use token_bound_accounts::interfaces::ISRC6::{ISRC6Dispatcher, ISRC6DispatcherTrait};

// *************************************************************************
Expand All @@ -32,7 +32,7 @@ pub mod SignatoryComponent {
// PRIVATE FUNCTIONS
// *************************************************************************
#[generate_trait]
pub impl Private<
pub impl SingnatoryPrivate<
TContractState,
+HasComponent<TContractState>,
+Drop<TContractState>,
Expand Down

0 comments on commit 933b583

Please sign in to comment.