Skip to content

Commit

Permalink
revert changes on account component
Browse files Browse the repository at this point in the history
  • Loading branch information
mubarak23 committed Aug 28, 2024
1 parent a39f12a commit e69964e
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions src/components/account/account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ pub mod AccountComponent {
// *************************************************************************
#[embeddable_as(AccountImpl)]
pub impl Account<
TContractState, +HasComponent<TContractState>, +Drop<TContractState>,
TContractState,
+HasComponent<TContractState>,
+Drop<TContractState>,
impl Permissionable: PermissionableComponent::HasComponent<TContractState>
> of IAccount<ComponentState<TContractState>> {
/// @notice used for signature validation
Expand Down Expand Up @@ -143,7 +145,6 @@ pub mod AccountComponent {
#[generate_trait]
pub impl InternalImpl<
TContractState, +HasComponent<TContractState>, +Drop<TContractState>,
impl Permissionable: PermissionableComponent::HasComponent<TContractState>
> of InternalTrait<TContractState> {
/// @notice initializes the account by setting the initial token contract and token id
fn initializer(
Expand Down Expand Up @@ -243,24 +244,11 @@ pub mod AccountComponent {
) -> bool {
let owner = self
._get_owner(self.account_token_contract.read(), self.account_token_id.read());
let permissionable_comp = get_dep_component!(ref self, Permissionable);

let has_permission = permissionable_comp.has_permission(owner, signer);

if(signer == owner){
if (signer == owner) {
return true;
}

if (has_permission){
return true
} else {
return false;
}
return false;
// if (signer == owner) {
// return true;
// } else {
// // run the chek here
// return false;
// }
}

/// @notice internal function for signature validation
Expand Down

0 comments on commit e69964e

Please sign in to comment.