Actor interface upgradeCanister
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 13
- Avg merge
- 4h 41m
- Merged PRs (30d)
- 1
Description
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()
});
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the existing upgradeCanister and setupCanister entry points and their related tests. Add support for the ActorInterface generic and return an updated actor from upgradeCanister, then verify the shown upgrade flow works when the candid declaration changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100