I’m trying to implement the installCode_
method below. The canister actor that I’m trying to install the wasmModule to is constructed like so:
shared(msg) actor class Journal (principal : Principal) = this {
//code
}
I’m pretty sure the issue with the implementation is with the way I’m defining the arg
variable.
private func installCode_ (arg: Blob, wasmModule: Blob, canister_id: Principal) : async () {
await ic.stop_canister({canister_id = canister_id});
await ic.install_code({
arg = arg;
wasm_module = wasmModule;
mode = #upgrade;
canister_id = canister_id;
});
await ic.start_canister({canister_id = canister_id});
};
here is how I’m defining the arg
varibale that I pass into the installCode_()
method:
let arg = Principal.toBlob(principal);
the method is trapping at the ic.install_code() method.
How do I properly define the arg
argument that is passed into the