Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
bitdivine committed Sep 5, 2024
1 parent 621d594 commit 601bb0e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"cycles_wallet": {
"type": "custom",
"candid": "https://github.com/dfinity/cycles-wallet/releases/download/20240410/wallet.did",
"wasm": "https://github.com/dfinity/cycles-wallet/releases/download/20240410/wallet.wasm"
"wasm": "https://github.com/dfinity/cycles-wallet/releases/download/20240410/wallet.wasm",
"gzip": true
}
},
"defaults": {
Expand Down
5 changes: 4 additions & 1 deletion src/example/paid_service/tests/it/icrc2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ pub struct CallerPaysWithIcRc2TestSetup {
paid_service: PicCanister,
/// ICRC2 ledger
ledger: PicCanister,
/// User's cycles wallet
/// User's wallet. We use the cycles wallet so that we can top it up easily, but any source of funds will do, with any ICRC-2 token.
wallet: PicCanister,
}
impl Default for CallerPaysWithIcRc2TestSetup {
fn default() -> Self {
Expand All @@ -33,10 +34,12 @@ impl Default for CallerPaysWithIcRc2TestSetup {
.expect("Failed to encode ledger init arg"),
)
.deploy_to(pic.clone());
let wallet = PicCanister::new(pic.clone(), &PicCanister::dfx_wasm_path("cycles_wallet"));
Self {
pic,
paid_service: api_canister,
ledger,
wallet,
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/example/paid_service/tests/it/util/pic_canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ pub trait PicCanisterTrait {
.unwrap()
.to_string()
}
/// The path to the wasm after `dfx deploy`.
/// The path to the wasm after `dfx deploy`. Expects the Wasm to be gzipped.
///
/// If not already gzipped, please add this to the canister declaration in `dfx.json`: `"gzip": true`
fn dfx_wasm_path(name: &str) -> String {
Self::workspace_dir().join(format!(".dfx/local/canisters/{name}/{name}.wasm.gz"))
.to_str()
Expand Down

0 comments on commit 601bb0e

Please sign in to comment.