The full error is:
Error trace:
Cannot read properties of undefined (reading 'length')
at checkPermission
Any idea what this means or how to fix?
The code is:
import {
AccountUpdate,
Mina,
PrivateKey,
PublicKey,
fetchAccount,
isReady,
shutdown,
} from 'snarkyjs';
import { Add } from './Add.js';
await isReady;
const Local = Mina.LocalBlockchain({ proofsEnabled: true });
Mina.setActiveInstance(Local);
const { privateKey: deployerKey, publicKey: deployerAccount } =
Local.testAccounts[0];
const { privateKey: senderKey, publicKey: senderAccount } =
Local.testAccounts[1];
let zkAppPrivateKey = PrivateKey.random();
let appKey = zkAppPrivateKey.toPublicKey();
const zkApp = new Add(appKey);
const txn = await Mina.transaction(deployerKey, () => {
AccountUpdate.fundNewAccount(deployerAccount);
zkApp.deploy();
});
await txn.sign([deployerKey, zkAppPrivateKey]).send();
let num = zkApp.num.get();
console.log(num.toString());
// ----------------------------------------------------
await Add.compile();
const txn1 = await Mina.transaction(senderAccount, () => {
zkApp.update();
});
await txn1.prove();
await txn1.sign([senderKey]).send();
num = zkApp.num.get();
console.log('state after txn1:', num.toString());
// ----------------------------------------------------
console.log('Shutting down');
await shutdown();
almost directly from the tutorial 1