From 2c18f122238b05daed73a784d2deab6fb3466baa Mon Sep 17 00:00:00 2001 From: mubarak23 Date: Mon, 19 Aug 2024 14:59:02 +0100 Subject: [PATCH] fix bug with read storage operation --- src/components/lockable/lockable.cairo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/lockable/lockable.cairo b/src/components/lockable/lockable.cairo index 666fd1c..a175f1a 100644 --- a/src/components/lockable/lockable.cairo +++ b/src/components/lockable/lockable.cairo @@ -8,6 +8,7 @@ pub mod LockableComponent { // IMPORTS // ************************************************************************* use starknet::storage::StoragePointerWriteAccess; + use starknet::storage::StoragePointerReadAccess; use starknet::{ContractAddress, get_caller_address, get_block_timestamp}; use token_bound_accounts::components::account::account::AccountComponent; use token_bound_accounts::interfaces::IAccount::{IAccount, IAccountDispatcherTrait}; @@ -17,13 +18,13 @@ pub mod LockableComponent { }; #[storage] - pub struct Storage { + struct Storage { lock_until: u64 } #[event] #[derive(Drop, starknet::Event)] - pub enum Event { + enum Event { AccountLocked: AccountLocked } @@ -96,8 +97,7 @@ pub mod LockableComponent { } fn is_lock(self: @ComponentState) -> bool { - // self.lock_until.read() > get_block_timestamp() - true + self.lock_until.read() > get_block_timestamp() } } }