I’m calling update method using pocketIc.
The update method internally calls canister_info
Here is the brief code of test.
Code:
let pocket_ic = PocketIcBuilder::new()
.with_nns_subnet()
.with_application_subnet()
.with_application_subnet()
.with_system_subnet()
.build();
.
.
pocket_ic
.update_call(
canister_id_1,
principal_id_1,
"update_which_calls_canister_info",
candid::encode_one(principal_id_1).unwrap(),
)...
Here is the brief code inside my update method. Here I check for canister_response.0.controllers and compare them to one of my expected values for further processing.
match canister_info(CanisterInfoRequest {
canister_id,
num_requested_changes: None,
})
.await
{
Ok(canister_response) => {
// check canister_response.0.controllers
}
Err(error) => {}
}
Here it fails when called from pocket_ic integration test. With below error.
DestinationInvalid : Unable to route management canister request canister_info: SubnetNotFound(CanisterId(2syes-usqll-dfpna-aiuxj-milj3-czoql-2wr3g-oy5nk-f6fvk-wvej2-mae), CanisterInfo)
How do I enable pocket ic to call canister_info from management canister?
Do i need to load management canister from wasm? If so, where to download from?
Is there any better way to run/test this in integration tests?