Make MerkleTree.nodes public or refactor MerkleTree to not use depreciated in o1js 0.18.0 CircuitValue and arrayProp
dfstio opened this issue · comments
The MerkleTree.nodes is private:
class MerkleTree {
private nodes: Record<number, Record<string, Field>> = {};
private zeroes: Field[];
...
https://github.com/o1-labs/o1js/blob/main/src/lib/provable/merkle-tree.ts#L28
I need to serialize MerkleTree in my project, so I need access to nodes. In o1js 0.17.0, I have copied the MerkleTree code and defined the toJSON() method. With o1js 0.18.0, CircuitValue and arrayProp, which MerkleTree is using, are depreciated, and this code does not work anymore. I can copy CircuitValue and arrayProp code also, but a better way is to make MerkleTree.nodes public.
See also #1482
thanks for reporting this, I made #1555
Thanks a lot!