MinaFoundation / mina-fungible-token

https://minafoundation.github.io/mina-fungible-token/
Apache License 2.0
5 stars 1 forks source link

Error running example after admin contract adding: TypeError: Cannot destructure property 'publicKey' of 'account' as it is null. #56

Closed asimaranov closed 1 week ago

asimaranov commented 1 month ago

When I try to run npm run task examples/concurrent-transfer.eg.ts I got the following trace:

➜  mina-fungible-token git:(main) npm run task examples/concurrent-transfer.eg.ts

(END)...skipping...
> mina-fungible-token@0.0.0-local task
> node --enable-source-maps --no-warnings= --loader ts-node/esm examples/concurrent-transfer.eg.ts

alexa EKF6.. B62q..
billy .. ..
jackie ...
contract ..
admin ..

Deploying token contract.
Deploy tx: 5JuX8Ye99WoRaDNZodcL6sTihwJLByJTr1cubFXAtKh1V7RQvPg8
Minting new tokens to Alexa.
/workspace_root/src/bindings/ocaml/overrides.js:45
    if (err instanceof Error) throw err;
                              ^

TypeError: Cannot destructure property 'publicKey' of 'account' as it is null.
    at parseFetchedAccount (/Users/andrey/projects/mina-fungible-token/node_modules/o1js/src/lib/mina/account.ts:40:5)
    at fetchAccountInternal (/Users/andrey/projects/mina-fungible-token/node_modules/o1js/src/lib/mina/fetch.ts:222:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at <anonymous> (/Users/andrey/projects/mina-fungible-token/node_modules/o1js/src/lib/mina/fetch.ts:341:22)
    at async Promise.all (index 1)
    at Module.fetchMissingData (/Users/andrey/projects/mina-fungible-token/node_modules/o1js/src/lib/mina/fetch.ts:373:3)
    at <anonymous> (/Users/andrey/projects/mina-fungible-token/node_modules/o1js/src/lib/mina/mina.ts:376:9)
    at <anonymous> (/Users/andrey/projects/mina-fungible-token/examples/concurrent-transfer.eg.ts:109:16)

Node.js v18.19.1
asimaranov commented 1 month ago

Example stopped to work after moving to the admin contract (commit 0975d5a0a29885cb6f9b88a29d6167d735ab2e84)

asimaranov commented 1 month ago

@kantp could you please check? It's a blocker for us

kantp commented 1 month ago

@qwadratic, could you have a look at this please? I suspect the graphql query might no longer work.

asimaranov commented 1 month ago

@kantp Example works pretty well on commit 895ec08c9da1c4ed7bc6d9f86b7f0be1b3536107 but on 0975d5a0a29885cb6f9b88a29d6167d735ab2e84 it fails with this error. For some reason o1js tries to fetch empty public key since admin contract addition and fails here

kantp commented 1 week ago

Closed by #61