diff --git a/examples/guard_functions/src/guards.ts b/examples/guard_functions/src/guards.ts index 773747dd91..5e2dce764c 100644 --- a/examples/guard_functions/src/guards.ts +++ b/examples/guard_functions/src/guards.ts @@ -42,11 +42,6 @@ export function throwCustomError() { ); } -export function preventUpgrades() { - console.log('preventUpgrades called'); - return 'Upgrades to this canister are disabled'; -} - export function returnNonStringErrValue() { console.log('nonStringErrValue called'); throw { badProp: 'Something other than a string' }; diff --git a/src/lib_new/ic.ts b/src/lib_new/ic.ts index 7fc84399b5..99af9b64de 100644 --- a/src/lib_new/ic.ts +++ b/src/lib_new/ic.ts @@ -564,7 +564,7 @@ export const ic: Ic = globalThis._azleIc }, caller: () => { const callerBytes = globalThis._azleIc.caller(); - return Principal.fromUint8Array(callerBytes); + return Principal.fromUint8Array(new Uint8Array(callerBytes)); }, candidDecode: (candidEncoded) => { return globalThis._azleIc.candidDecode(candidEncoded.buffer);