Feature request
It would be nice to be able to provide an ActorInterface to the upgradeCanister function, similar to setupCanister, and receive an updated actor as a result.
This can notably be useful if the candid declaration changes between version and one want to test an upgrade.
Currently, this can be solved by creating a new actor once the upgrade has been processed. Such a feature would spare few lines of code.
From:
await pic.upgradeCanister({
canisterId,
wasm: SATELLITE_WASM_PATH,
sender: controller.getPrincipal()
});
const newActor = pic.createActor<SatelliteActorNEW>(idlFactorSatellite, canisterId);
newActor.setIdentity(controller);
To:
const {actor: newActor} = await pic.upgradeCanister<SatelliteActorNEW>({
canisterId,
wasm: SATELLITE_WASM_PATH,
sender: controller.getPrincipal()
});
Feature request
It would be nice to be able to provide an
ActorInterfaceto theupgradeCanisterfunction, similar tosetupCanister, and receive an updated actor as a result.This can notably be useful if the candid declaration changes between version and one want to test an upgrade.
Currently, this can be solved by creating a new actor once the upgrade has been processed. Such a feature would spare few lines of code.
From:
To: