Skip to content

Commit

Permalink
refactor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-sawlani-yral committed Nov 29, 2024
1 parent 5c26a88 commit 31eb160
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn delete_sns_creator_token(deployed_canisters: &DeployedCdaoCanisters) {
ic_cdk::spawn(async move {
let _ = request_cycles_from_subnet_orchestrator(5 * UNINSTALL_RECHARGE_AMOUNT).await;
for canister_id in canister_ids.iter() {
deposit_cycles(
let _ = deposit_cycles(
CanisterIdRecord {
canister_id: *canister_id,
},
Expand Down
5 changes: 4 additions & 1 deletion src/canister/user_index/can.did
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ service : (UserIndexInitArgs) -> {
create_pool_of_individual_user_available_canisters : (text, blob) -> (
Result_2,
);
delete_all_sns_creator_token_of_an_individual_user : (principal) -> (
delete_all_sns_creator_token_of_an_individual_canister : (principal) -> (
Result_3,
);
get_current_list_of_all_well_known_principal_values : () -> (
Expand Down Expand Up @@ -178,6 +178,9 @@ service : (UserIndexInitArgs) -> {
receive_creator_dao_stats_from_individual_canister : (vec principal) -> (
Result_3,
);
receive_empty_canister_from_individual_canister : (vec principal) -> (
Result_3,
);
recharge_individual_user_canister : () -> (Result_3);
reclaim_cycles_from_individual_canisters : () -> ();
request_cycles : (nat) -> (Result_3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use ic_cdk_macros::update;
use crate::util::types::individual_user_canister::IndividualUserCanister;

#[update]
async fn allot_number_of_empty_canister(number: u32) -> Result<Principal, String> {
async fn allot_empty_canister() -> Result<Principal, String> {
let registered_individual_canister = IndividualUserCanister::new(caller())?;
registered_individual_canister
.allot_number_of_empty_canisters(number)
.await
registered_individual_canister.allot_empty_canister().await
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ impl IndividualUserCanister {
alloted_canister_id_res
}

pub async fn delete_all_sns_creator_token(&self) -> Result<(), String> {
ic_cdk::call::<_, ()>(self.canister_id, "delete_all_creator_token", ())
.await
.map_err(|e| e.1)
}

pub fn notify_to_upgrade_creator_dao_governance_canisters(
&self,
wasm_module: Vec<u8>,
Expand Down

0 comments on commit 31eb160

Please sign in to comment.