Skip to content

Commit

Permalink
fix(devops): Use the right canister nam in integration tests (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitdivine authored Sep 17, 2024
1 parent 5740b69 commit 91cd0cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/example/paid_service/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use candid::Principal;
use example_paid_service_api::InitArgs;

thread_local! {
pub static INIT_ARGS: RefCell<Option<InitArgs>> = RefCell::new(None);
pub static INIT_ARGS: RefCell<Option<InitArgs>> = const {RefCell::new(None)};
}

pub fn init_element<F, T>(f: F) -> T
Expand All @@ -16,12 +16,7 @@ where

/// Provides the canister_id of the ledger used for payments.
pub fn payment_ledger() -> Principal {
init_element(|init_args| {
init_args
.ledger
.expect("Init args specify no ledger")
.clone()
})
init_element(|init_args| init_args.ledger.expect("Init args specify no ledger"))
}

/// Sets the payment ledger canister ID.
Expand Down
2 changes: 1 addition & 1 deletion src/example/paid_service/tests/it/icrc2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl Default for CallerPaysWithIcRc2TestSetup {
Principal::from_text("rg3gz-22tjp-jh7hl-migkq-vb7in-i2ylc-6umlc-dtbug-v6jgc-uo24d-nqe")
.unwrap();
let wallet = PicCanisterBuilder::default()
.with_wasm(&PicCanister::dfx_wasm_path("cycles_wallet"))
.with_wasm(&PicCanister::dfx_wasm_path("cycles_depositor"))
.with_controllers(vec![user])
.with_arg(
encode_one(cycles_depositor::InitArg {
Expand Down
2 changes: 1 addition & 1 deletion src/guard/src/guards/icrc2_cycles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl PaymentGuard for Icrc2CyclesPaymentGuard {
async fn deduct(&self, fee: u64) -> Result<(), PaymentError> {
cycles_ledger_client::Service(self.ledger_canister_id)
.withdraw_from(&WithdrawFromArgs {
to: self.own_canister_id.clone(),
to: self.own_canister_id,
amount: Nat::from(fee),
from: self.payer_account.clone(),
spender_subaccount: self.spender_subaccount.clone(),
Expand Down

0 comments on commit 91cd0cf

Please sign in to comment.