Open MartinOndejka opened 1 year ago
Hi @MartinOndejka, can you share an example of the JSON you are trying to deserialize?
Hi @MartinOndejka We have some lining-up with Mina JSON for V2 structures, thought there are some missing bits still. Also we never applied that JSON encoding to snarkyjs (yet).
Here is the minimal example of simple transfer and snarkyjs local blockchain that I've been trying it with so far. Let me know if you need more.
Snarkyjs deserializes it directly to the Mina Ocaml type, that's why I was hoping it might work here as well.
So, after some short investigation I see these issues:
a. Signature in our lib doesn't have proper base58 encoding.
b. snarkyjs uses camelCase fields while Mina (and our code) uses snake_case.
c. Account update in Mina/our lib has more data then snarkyjs, that's why that error about elt
is reported.
While a is very easy to fix, b can be worked around by modifying snarkyjs JSON, c is not obvious for me right now. I will need to check how types on snarkyjs are generated/mapped from Mina ones.
I am trying to deserialize zkapp command generated from snarkyjs and apply it to the ledger.
The idea is to deserialize it to MinaBaseZkappCommandTStableV1WireStableV1 and then convert it to ZkappCommand from ledger.
There are few issues with deserialization of json:
missing field "elt"
here.