Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeruCodes committed Nov 19, 2024
1 parent c2d1fe4 commit d491db6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/canister/individual_user_template/src/api/cdao/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ic_cdk::api::time;
use ic_cdk_macros::update;
use icrc_ledger_types::icrc2::{allowance::{Allowance, AllowanceArgs}, approve::{ApproveArgs, ApproveError}, transfer_from::{TransferFromArgs, TransferFromError}};
use serde::Deserialize;
use shared_utils::canister_specific::individual_user_template::types::{cdao::{SwapRequestActions, TokenPairs}, error::SwapError};
use shared_utils::{canister_specific::individual_user_template::types::{cdao::{SwapRequestActions, TokenPairs}, error::SwapError}, common::utils::permissions::is_caller_global_admin};

use crate::{api::profile::get_profile_details_v2::get_profile_details_v2, CANISTER_DATA};

Expand Down Expand Up @@ -91,7 +91,7 @@ pub async fn swap_request_action(op: SwapRequestActions) -> Result<(), SwapError
Ok(())
}

#[update]
#[update(guard = "is_caller_global_admin")]
fn update_last_swap_price(token_ledger: Principal, price: f64){
CANISTER_DATA.with_borrow_mut(|data| {
if let Some(cdao) = data.cdao_canisters.iter_mut().find(|cdao| cdao.ledger == token_ledger){
Expand Down
5 changes: 4 additions & 1 deletion src/lib/integration_tests/tests/creator_dao/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,10 @@ fn creator_dao_tests() {
})
.unwrap();
ic_cdk::println!("🧪 Result: {:?}", res);


pocket_ic.advance_time(Duration::from_secs(200));
pocket_ic.tick();

let res = pocket_ic
.update_call(
swap_canister,
Expand Down

0 comments on commit d491db6

Please sign in to comment.