I need to check the balance of an account id in one of my tests. Is there a way to do this using Pocket IC?
#[test]
fn should_transfer_icp_native() {
let receiver = generate_principal();
let pic = PocketIc::new();
let caller = generate_principal();
let account_id = pic.create_canister_with_settings(Some(caller), None);
pic.add_cycles(account_id, 2_000_000_000_000);
let wasm_module = include_bytes!("../../../target/wasm32-unknown-unknown/release/account.wasm").to_vec();
let receiver_account_id = ledger::to_subaccount_id_from_principal(receiver, to_subaccount(0));
let signer = generate_principal();
pic.install_canister(account_id, wasm_module, Vec::new(), Some(caller));
let wasm_result = pic.update_call(account_id, caller, "transaction_1", encode_one(0).unwrap());
if wasm_result.is_err() {
panic!("Update call failed: {:?}", wasm_result);
}
// I should check if balance of receiver's account id is higher than zero.
}