diff --git a/examples/gno.land/p/demo/avl/z_0_filetest.gno b/examples/gno.land/p/demo/avl/z_0_filetest.gno index e91788ac8eb..e3f1363e205 100644 --- a/examples/gno.land/p/demo/avl/z_0_filetest.gno +++ b/examples/gno.land/p/demo/avl/z_0_filetest.gno @@ -25,67 +25,25 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ -// "Fields": [ -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "16" -// }, -// "V": { -// "@type": "/gno.StringValue", -// "value": "key0" -// } -// }, -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "16" -// }, -// "V": { -// "@type": "/gno.StringValue", -// "value": "value0" -// } -// }, -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "64" -// } -// }, -// { -// "N": "AQAAAAAAAAA=", -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "32" -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// } -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// } -// } -// } -// ], // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", -// "ModTime": "5", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ModTime": "7", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "627e8e517e7ae5db0f3b753e2a32b607989198b6", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" +// } // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:9]={ // "Fields": [ // { // "T": { @@ -140,13 +98,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", // "RefCount": "1" // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:8]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "b28057ab7be6383785c0a5503e8a531bdbc21851", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9" +// } +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ // "Fields": [ // { // "T": { @@ -183,19 +160,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "6da365f0d6cacbcdf53cd5a4b125803cddce08c2", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "091729e38bda8724bce4c314f9624b91af679459", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" -// } -// } +// "TV": null // } // }, // { @@ -208,27 +179,40 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "f216afe7b5a17f4ebdbb98dceccedbc22e237596", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "0b5493aa4ea42087780bdfcaebab2c3eec351c15", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", // "ModTime": "0", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "ff1a50d8489090af37a2c7766d659f0d717939b5", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" +// } // } // } // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:2]={ @@ -236,7 +220,7 @@ func main() { // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "IsEscaped": true, -// "ModTime": "4", +// "ModTime": "5", // "RefCount": "2" // }, // "Parent": null, @@ -333,19 +317,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "ae86874f9b47fa5e64c30b3e92e9d07f2ec967a4", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "6c9948281d4c60b2d95233b76388d54d8b1a2fad", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" -// } -// } +// "TV": null // } // } // ] diff --git a/examples/gno.land/p/demo/avl/z_1_filetest.gno b/examples/gno.land/p/demo/avl/z_1_filetest.gno index cdd56a5ad89..a6d2205e240 100644 --- a/examples/gno.land/p/demo/avl/z_1_filetest.gno +++ b/examples/gno.land/p/demo/avl/z_1_filetest.gno @@ -24,7 +24,7 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:9]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:15]={ // "Fields": [ // { // "T": { @@ -79,13 +79,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:15", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:14", // "RefCount": "1" // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:8]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:14]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:14", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "143aebc820da33550f7338723fb1e2eec575b196", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:15" +// } +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:13]={ // "Fields": [ // { // "T": { @@ -122,19 +141,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "2f3adc5d0f2a3fe0331cfa93572a7abdde14c9aa", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "7a8a63e17a567d7b0891ac89d5cd90072a73787d", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" -// } -// } +// "TV": null // } // }, // { @@ -147,30 +160,43 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "2e733a8e9e74fe14f0a5d10fb0f6728fa53d052d", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:14" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "ab5a297f4eb033d88bdf1677f4dc151ccb9fde9f", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12", // "RefCount": "1" // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:12]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "fe20a19f956511f274dc77854e9e5468387260f4", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13" +// } +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:11]={ // "Fields": [ // { // "T": { @@ -207,19 +233,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "c89a71bdf045e8bde2059dc9d33839f916e02e5d", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "627e8e517e7ae5db0f3b753e2a32b607989198b6", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" -// } -// } +// "TV": null // } // }, // { @@ -232,27 +252,40 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "90fa67f8c47db4b9b2a60425dff08d5a3385100f", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "fe8afd501233fb95375016199f0443b3c6ab1fbc", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:10]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10", // "ModTime": "0", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "83e42caaf53070dd95b5f859053eb51ed900bbda", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11" +// } // } // } // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:2]={ @@ -260,7 +293,7 @@ func main() { // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "IsEscaped": true, -// "ModTime": "6", +// "ModTime": "9", // "RefCount": "2" // }, // "Parent": null, @@ -357,21 +390,16 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "1faa9fa4ba1935121a6d3f0a623772e9d4499b0a", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "c5eefc40ed065461b4a920c1349ed734ffdead8f", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" -// } -// } +// "TV": null // } // } // ] // } // d[a8ada09dee16d791fd406d629fe29bb0ed084a30:4] +// d[a8ada09dee16d791fd406d629fe29bb0ed084a30:5] diff --git a/examples/gno.land/p/demo/avl/z_2_filetest.gno b/examples/gno.land/p/demo/avl/z_2_filetest.gno index 65181bffcac..1d3f20651ed 100644 --- a/examples/gno.land/p/demo/avl/z_2_filetest.gno +++ b/examples/gno.land/p/demo/avl/z_2_filetest.gno @@ -23,7 +23,7 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:10]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:16]={ // "Fields": [ // { // "T": { @@ -78,13 +78,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:16", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:15", // "RefCount": "1" // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:9]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:15]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:15", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:14", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "db333c89cd6773709e031f1f4e4ed4d3fed66c11", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:16" +// } +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:14]={ // "Fields": [ // { // "T": { @@ -121,19 +140,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "849a50d6c78d65742752e3c89ad8dd556e2e63cb", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "213baed7e3326f2403b5f30e5d4397510ba4f37d", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" -// } -// } +// "TV": null // } // }, // { @@ -146,30 +159,43 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "b4fc2fdd2d0fe936c87ed2ace97136cffeed207f", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:15" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "be751422ef4c2bc068a456f9467d2daca27db8ca", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:14", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:13]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "a1160b0060ad752dbfe5fe436f7734bb19136150", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:14" +// } // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:8]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:12]={ // "Fields": [ // { // "T": { @@ -206,19 +232,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "fd95e08763159ac529e26986d652e752e78b6325", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "af4d0b158681d85eb2a7f6888b39a05ca7b790ee", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" -// } -// } +// "TV": null // } // }, // { @@ -231,27 +251,40 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "3ecdcf148fe2f9e97b72a3bedf303b2ba56d4f4b", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "ef853d70e334fd2c807d6c2c751da1fcd1e5ad58", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:11]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11", // "ModTime": "0", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "63126557dba88f8556f7a0ccbbfc1d218ae7a302", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12" +// } // } // } // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ @@ -266,27 +299,22 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "425bc3bff1f4c36b175d055ed8b2c289123fcca1", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "3a5af0895c2c45b8a5e894644bcd689f1fdc4785", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", -// "ModTime": "7", +// "ModTime": "10", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "RefCount": "1" // } // } // d[a8ada09dee16d791fd406d629fe29bb0ed084a30:5] +// d[a8ada09dee16d791fd406d629fe29bb0ed084a30:6] diff --git a/examples/gno.land/r/demo/boards/z_4_filetest.gno b/examples/gno.land/r/demo/boards/z_4_filetest.gno index bb98fa289ba..a8b932db892 100644 --- a/examples/gno.land/r/demo/boards/z_4_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_4_filetest.gno @@ -48,83 +48,26 @@ func main() { // Realm: // switchrealm["gno.land/r/demo/users"] // switchrealm["gno.land/r/demo/boards"] -// u[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:101]={ -// "Fields": [ -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "16" -// }, -// "V": { -// "@type": "/gno.StringValue", -// "value": "0000000003" -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/boards.Post" -// } -// }, -// "V": { -// "@type": "/gno.PointerValue", -// "Base": null, -// "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/boards.Post" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Escaped": true, -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:102" -// } -// } -// } -// }, -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "64" -// } -// }, -// { -// "N": "AQAAAAAAAAA=", -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "32" -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// } -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// } -// } -// } -// ], +// u[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111]={ // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:101", -// "ModTime": "109", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:109", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111", +// "ModTime": "123", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:123", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "68663c8895d37d479e417c11e21badfe21345c61", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:112" +// } // } // } -// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:110]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:125]={ // "Fields": [ // { // "T": { @@ -146,19 +89,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Escaped": true, +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:126" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/boards.Post" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Escaped": true, -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111" -// } -// } +// "TV": null // } // }, // { @@ -194,13 +131,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:110", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:125", +// "ModTime": "0", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:124", +// "RefCount": "1" +// } +// } +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:124]={ +// "ObjectInfo": { +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:124", // "ModTime": "0", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:109", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:123", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "3f34ac77289aa1d5f9a2f8b6d083138325816fb0", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:125" +// } // } // } -// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:109]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:123]={ // "Fields": [ // { // "T": { @@ -237,19 +193,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "94a6665a44bac6ede7f3e3b87173e537b12f9532", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "b58581159917d8d7ad0992009d7184fc8ca00fcc", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:101" -// } -// } +// "TV": null // } // }, // { @@ -262,30 +212,43 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "bc8e5b4e782a0bbc4ac9689681f119beb7b34d59", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:124" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "fb593e86d35aaf607e0d21e6bd4f84519c44585f", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:110" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:109", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:123", // "ModTime": "0", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:96", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:122", // "RefCount": "1" // } // } -// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:112]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:122]={ +// "ObjectInfo": { +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:122", +// "ModTime": "0", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:106", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "9957eadbc91dd32f33b0d815e041a32dbdea0671", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:123" +// } +// } +// } +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:128]={ // "Fields": [ // { // "T": { @@ -298,13 +261,13 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:112", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:128", // "ModTime": "0", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:127", // "RefCount": "1" // } // } -// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:113]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:129]={ // "Fields": [ // { // "T": { @@ -317,13 +280,13 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:113", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:129", // "ModTime": "0", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:127", // "RefCount": "1" // } // } -// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:114]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:130]={ // "Fields": [ // { // "T": { @@ -336,13 +299,13 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:114", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:130", // "ModTime": "0", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:127", // "RefCount": "1" // } // } -// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:115]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:131]={ // "Fields": [ // { // "N": "AAAAgJSeXbo=", @@ -379,13 +342,13 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:115", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:131", // "ModTime": "0", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:127", // "RefCount": "1" // } // } -// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:116]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:132]={ // "Fields": [ // { // "T": { @@ -410,13 +373,13 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:116", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:132", // "ModTime": "0", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:127", // "RefCount": "1" // } // } -// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:127]={ // "Fields": [ // { // "T": { @@ -428,19 +391,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Escaped": true, +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:84" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/boards.Board" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Escaped": true, -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:81" -// } -// } +// "TV": null // } // }, // { @@ -487,8 +444,8 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "130542396d7549d1d516a3ef4a63bb44ef3da06f", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:112" +// "Hash": "f91e355bd19240f0f3350a7fa0e6a82b72225916", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:128" // } // }, // { @@ -498,8 +455,8 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "80acd8746478317194b8546170335c796a4dfb3f", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:113" +// "Hash": "9ee9c4117be283fc51ffcc5ecd65b75ecef5a9dd", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:129" // } // }, // { @@ -509,8 +466,8 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "c1a8f769f3b9d52dd38ac4759116edaca287636f", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:114" +// "Hash": "eb768b0140a5fe95f9c58747f0960d647dacfd42", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:130" // } // }, // { @@ -540,8 +497,8 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "1dd77a196db00a4d1a3471539279df79f6ae950e", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:115" +// "Hash": "f56a463a97d103e183f1f368bf00a2ce99d4de88", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:131" // } // }, // { @@ -551,95 +508,57 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "c3a60b602b564d07677a212372f4ac1cae4270fd", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:116" +// "Hash": "bed4afa8ffdbbf775451c947fc68b27a345ce32a", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:132" // } // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:127", +// "ModTime": "0", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:126", +// "RefCount": "1" +// } +// } +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:126]={ +// "ObjectInfo": { +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:126", // "IsEscaped": true, // "ModTime": "0", // "RefCount": "2" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/r/demo/boards.Post" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "0651ea376feea18422dbe079f9d7fcbe3dfd32ad", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:127" +// } // } // } -// u[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:108]={ -// "Fields": [ -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "16" -// }, -// "V": { -// "@type": "/gno.StringValue", -// "value": "0000000003" -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/boards.Post" -// } -// }, -// "V": { -// "@type": "/gno.PointerValue", -// "Base": null, -// "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/boards.Post" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Escaped": true, -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:102" -// } -// } -// } -// }, -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "64" -// } -// }, -// { -// "N": "AQAAAAAAAAA=", -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "32" -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// } -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// } -// } -// } -// ], +// u[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:120]={ // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:108", -// "ModTime": "117", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:117", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:120", +// "ModTime": "134", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:134", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "dc1f011553dc53e7a846049e08cc77fa35ea6a51", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:121" +// } // } // } -// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:118]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:136]={ // "Fields": [ // { // "T": { @@ -661,19 +580,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Escaped": true, +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:126" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/boards.Post" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Escaped": true, -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:111" -// } -// } +// "TV": null // } // }, // { @@ -709,13 +622,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:118", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:136", +// "ModTime": "0", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:135", +// "RefCount": "1" +// } +// } +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:135]={ +// "ObjectInfo": { +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:135", // "ModTime": "0", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:117", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:134", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "96b86b4585c7f1075d7794180a5581f72733a7ab", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:136" +// } // } // } -// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:117]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:134]={ // "Fields": [ // { // "T": { @@ -752,19 +684,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "32274e1f28fb2b97d67a1262afd362d370de7faa", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:120" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "6a86bc7763703c8f2b9d286368921159d6db121c", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:108" -// } -// } +// "TV": null // } // }, // { @@ -777,30 +703,43 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "c2cfd6aec36a462f35bf02e5bf4a127aa1bb7ac2", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:135" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "52faa8a2dfefd4b6b6249eff2f9c123ad455e81d", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:118" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:117", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:134", // "ModTime": "0", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:97", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:133", // "RefCount": "1" // } // } -// u[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:81]={ +// c[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:133]={ +// "ObjectInfo": { +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:133", +// "ModTime": "0", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:107", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "5cb875179e86d32c517322af7a323b2a5f3e6cc5", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:134" +// } +// } +// } +// u[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:85]={ // "Fields": [ // { // "N": "AQAAAAAAAAA=", @@ -846,8 +785,8 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "6e8ecb1c773e0e34ba560dcff1b2dee0bc2e5660", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:82" +// "Hash": "1d70015c486ccc9bfb7c425152605fabc78be1dd", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:86" // } // }, // { @@ -864,8 +803,8 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "796da27e11e6d75db3e0e8f9d633f4559f1b1a82", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:83" +// "Hash": "b8ee1687a4f45886912ba624c8513a2a1526b94c", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:87" // } // }, // { @@ -875,19 +814,19 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "edb1857302fa916c562cd077cdf2a3626e29ae2b", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:84" +// "Hash": "af6ed0268f99b7f369329094eb6dfaea7812708b", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:88" // } // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:81", -// "IsEscaped": true, -// "ModTime": "108", -// "RefCount": "6" +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:85", +// "ModTime": "121", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:84", +// "RefCount": "1" // } // } -// u[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:96]={ +// u[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:106]={ // "Fields": [ // { // "T": { @@ -899,30 +838,24 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "9809329dc1ddc5d3556f7a8fa3c2cebcbf65560b", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:122" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "609e7f519c65f94503427a14f973b4b83989cdc8", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:109" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:96", -// "ModTime": "108", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:95", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:106", +// "ModTime": "121", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:105", // "RefCount": "1" // } // } -// u[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:97]={ +// u[f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:107]={ // "Fields": [ // { // "T": { @@ -934,26 +867,20 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "ceae9a1c4ed28bb51062e6ccdccfad0caafd1c4f", +// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:133" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "6760340f5b40e05221dc530940683b0b9a422503", -// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:117" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:97", -// "ModTime": "108", -// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:95", +// "ID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:107", +// "ModTime": "121", +// "OwnerID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:105", // "RefCount": "1" // } // } diff --git a/examples/gno.land/r/demo/nft/z_0_filetest.gno b/examples/gno.land/r/demo/nft/z_0_filetest.gno index 9e8010abaf5..0595e76a0ed 100644 --- a/examples/gno.land/r/demo/nft/z_0_filetest.gno +++ b/examples/gno.land/r/demo/nft/z_0_filetest.gno @@ -22,7 +22,7 @@ func main() { // Realm: // switchrealm["gno.land/r/demo/nft"] // switchrealm["gno.land/r/demo/nft"] -// c[67c479d3d51d4056b2f4111d5352912a00be311e:8]={ +// c[67c479d3d51d4056b2f4111d5352912a00be311e:11]={ // "Fields": [ // { // "T": { @@ -62,13 +62,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:8", +// "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:11", // "ModTime": "0", -// "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:7", +// "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:10", // "RefCount": "1" // } // } -// c[67c479d3d51d4056b2f4111d5352912a00be311e:7]={ +// c[67c479d3d51d4056b2f4111d5352912a00be311e:10]={ +// "ObjectInfo": { +// "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:10", +// "ModTime": "0", +// "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:9", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/r/demo/nft.NFToken" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "564a9e78be869bd258fc3c9ad56f5a75ed68818f", +// "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:11" +// } +// } +// } +// c[67c479d3d51d4056b2f4111d5352912a00be311e:9]={ // "Fields": [ // { // "T": { @@ -90,19 +109,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "b53ffc464e1b5655d19b9d5277f3491717c24aca", +// "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:10" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/nft.NFToken" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "c06f58d0ff2bc26ad3e65e953b127a0d03353e97", -// "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:8" -// } -// } +// "TV": null // } // }, // { @@ -138,13 +151,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:7", +// "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:9", // "ModTime": "0", -// "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:5", +// "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:8", // "RefCount": "1" // } // } -// u[67c479d3d51d4056b2f4111d5352912a00be311e:5]={ +// c[67c479d3d51d4056b2f4111d5352912a00be311e:8]={ +// "ObjectInfo": { +// "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:8", +// "ModTime": "0", +// "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:6", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "b1d928b3716b147c92730e8d234162bec2f0f2fc", +// "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:9" +// } +// } +// } +// u[67c479d3d51d4056b2f4111d5352912a00be311e:6]={ // "Fields": [ // { // "T": { @@ -156,30 +188,24 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "75850e56fa2c3c8b6d6814b1f150919b75355752", +// "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:8" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "45a64533aa57b49b6b4a1d3f6de79db8bea3a710", -// "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:7" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:5", -// "ModTime": "6", -// "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:4", +// "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:6", +// "ModTime": "7", +// "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:5", // "RefCount": "1" // } // } -// u[67c479d3d51d4056b2f4111d5352912a00be311e:4]={ +// u[67c479d3d51d4056b2f4111d5352912a00be311e:5]={ // "Fields": [ // {}, // { @@ -196,8 +222,8 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "dad3106a54e1facb92bce473898b8aec0eb930ff", -// "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:5" +// "Hash": "700d932c087f30499941de2b589867dc17aaea5a", +// "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:6" // } // }, // { @@ -207,15 +233,15 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "05ab6746ea84b55ca133806af215d99a1c4b045e", -// "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:6" +// "Hash": "e06585aff551113920c929453ea40250f3cc01bc", +// "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:7" // } // } // ], // "ObjectInfo": { -// "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:4", -// "ModTime": "6", -// "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:2", +// "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:5", +// "ModTime": "7", +// "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:4", // "RefCount": "1" // } // } diff --git a/gnovm/pkg/gnolang/alloc.go b/gnovm/pkg/gnolang/alloc.go index 495be0d2dc2..6fef5eda834 100644 --- a/gnovm/pkg/gnolang/alloc.go +++ b/gnovm/pkg/gnolang/alloc.go @@ -62,6 +62,7 @@ const ( // allocPackge = 1 allocAmino = _allocBase + _allocPointer + _allocAny allocAminoByte = 10 // XXX + allocHeapItem = _allocBase + _allocPointer + _allocTypedValue ) func NewAllocator(maxBytes int64) *Allocator { @@ -180,6 +181,10 @@ func (alloc *Allocator) AllocateAmino(l int64) { alloc.Allocate(allocAmino + allocAminoByte*l) } +func (alloc *Allocator) AllocateHeapItem() { + alloc.Allocate(allocHeapItem) +} + //---------------------------------------- // constructor utilities. @@ -291,3 +296,8 @@ func (alloc *Allocator) NewType(t Type) Type { alloc.AllocateType() return t } + +func (alloc *Allocator) NewHeapItem(tv TypedValue) *HeapItemValue { + alloc.AllocateHeapItem() + return &HeapItemValue{Value: tv} +} diff --git a/gnovm/pkg/gnolang/machine.go b/gnovm/pkg/gnolang/machine.go index 48a2145af3a..864384ea122 100644 --- a/gnovm/pkg/gnolang/machine.go +++ b/gnovm/pkg/gnolang/machine.go @@ -1956,9 +1956,11 @@ func (m *Machine) PopAsPointer(lx Expr) PointerValue { return ptr case *CompositeLitExpr: // for *RefExpr tv := *m.PopValue() + hv := m.Alloc.NewHeapItem(tv) return PointerValue{ - TV: &tv, // heap alloc - Base: nil, + TV: &hv.Value, + Base: hv, + Index: 0, } default: panic("should not happen") diff --git a/gnovm/pkg/gnolang/ownership.go b/gnovm/pkg/gnolang/ownership.go index f2afc393d05..24d70b5dd84 100644 --- a/gnovm/pkg/gnolang/ownership.go +++ b/gnovm/pkg/gnolang/ownership.go @@ -129,6 +129,7 @@ var ( _ Object = &BoundMethodValue{} _ Object = &MapValue{} _ Object = &Block{} + _ Object = &HeapItemValue{} ) type ObjectInfo struct { @@ -332,11 +333,7 @@ func (tv *TypedValue) GetFirstObject(store Store) Object { // something in it; in that case, ignore the base. That will // likely require maybe a preparation step in persistence // ( or unlikely, a second type of ref-counting). - if cv.Base != nil { - return cv.Base.(Object) - } else { - return cv.TV.GetFirstObject(store) - } + return cv.Base.(Object) case *ArrayValue: return cv case *SliceValue: @@ -359,6 +356,9 @@ func (tv *TypedValue) GetFirstObject(store Store) Object { oo := store.GetObject(cv.ObjectID) tv.V = oo return oo + case *HeapItemValue: + // should only appear in PointerValue.Base + panic("heap item value should only appear as a pointer's base") default: return nil } diff --git a/gnovm/pkg/gnolang/package.go b/gnovm/pkg/gnolang/package.go index 4d4cb5aaf45..e2fdb2580ca 100644 --- a/gnovm/pkg/gnolang/package.go +++ b/gnovm/pkg/gnolang/package.go @@ -31,6 +31,7 @@ var Package = amino.RegisterPackage(amino.NewPackage( // &NativeValue{}, &Block{}, RefValue{}, + &HeapItemValue{}, //---------------------------------------- // Realm/Object diff --git a/gnovm/pkg/gnolang/realm.go b/gnovm/pkg/gnolang/realm.go index 85f94d4fcbe..508c408f561 100644 --- a/gnovm/pkg/gnolang/realm.go +++ b/gnovm/pkg/gnolang/realm.go @@ -148,6 +148,12 @@ func (rlm *Realm) DidUpdate(po, xo, co Object) { if po.GetObjectID().PkgID != rlm.ID { panic("cannot modify external-realm or non-realm object") } + + // XXX check if this boosts performance + // XXX with broad integration benchmarking. + // XXX if co == xo { + // XXX } + // From here on, po is real (not new-real). // Updates to .newCreated/.newEscaped /.newDeleted made here. (first gen) // More appends happen during FinalizeRealmTransactions(). (second+ gen) @@ -724,18 +730,6 @@ func (rlm *Realm) saveObject(store Store, oo Object) { if oid.IsZero() { panic("unexpected zero object id") } - /* XXX DELETE - // ensure all types were already saved (@ preprocessor). - if debug { - types := getUnsavedTypes(oo, nil) - for _, typ := range types { - tid := typ.TypeID() - if store.GetType(tid) == nil { - panic("missing type") - } - } - } - */ // set hash to escape index. if oo.GetIsNewEscaped() { oo.SetIsNewEscaped(false) @@ -823,11 +817,10 @@ func getChildObjects(val Value, more []Value) []Value { case DataByteValue: panic("cannot get children from data byte objects") case PointerValue: - if cv.Base != nil { - more = getSelfOrChildObjects(cv.Base, more) - } else { - more = getSelfOrChildObjects(cv.TV.V, more) + if cv.Base == nil { + panic("should not happen") } + more = getSelfOrChildObjects(cv.Base, more) return more case *ArrayValue: for _, ctv := range cv.List { @@ -869,8 +862,14 @@ func getChildObjects(val Value, more []Value) []Value { for _, ctv := range cv.Values { more = getSelfOrChildObjects(ctv.V, more) } + // Generally the parent block must also be persisted. + // Otherwise NamePath may not resolve when referencing + // a parent block. more = getSelfOrChildObjects(cv.Parent, more) return more + case *HeapItemValue: + more = getSelfOrChildObjects(cv.Value.V, more) + return more case *NativeValue: panic("native values not supported") default: @@ -936,7 +935,7 @@ func copyMethods(methods []TypedValue) []TypedValue { // gets saved (e.g. from *Machine.savePackage()). res[i] = TypedValue{ T: copyTypeWithRefs(mtv.T), - V: copyValueWithRefs(nil, mtv.V), + V: copyValueWithRefs(mtv.V), } } return res @@ -1055,7 +1054,7 @@ func copyTypeWithRefs(typ Type) Type { // persistence bytes serialization. // Also checks for integrity of immediate children -- they must already be // persistent (real), and not dirty, or else this function panics. -func copyValueWithRefs(parent Object, val Value) Value { +func copyValueWithRefs(val Value) Value { switch cv := val.(type) { case nil: return nil @@ -1068,33 +1067,25 @@ func copyValueWithRefs(parent Object, val Value) Value { case DataByteValue: panic("cannot copy data byte value with references") case PointerValue: - if cv.Base != nil { - return PointerValue{ - /* - already represented in .Base[Index]: - TypedValue: &TypedValue{ - T: cv.TypedValue.T, - V: copyValueWithRefs(cv.TypedValue.V), - }, - */ - Base: toRefValue(parent, cv.Base), - Index: cv.Index, - } - } else { - etv := refOrCopyValue(parent, *cv.TV) - return PointerValue{ - TV: &etv, - /* - Base: nil, - Index: 0, - */ - } + if cv.Base == nil { + panic("should not happen") + } + return PointerValue{ + /* + already represented in .Base[Index]: + TypedValue: &TypedValue{ + T: cv.TypedValue.T, + V: copyValueWithRefs(cv.TypedValue.V), + }, + */ + Base: toRefValue(cv.Base), + Index: cv.Index, } case *ArrayValue: if cv.Data == nil { list := make([]TypedValue, len(cv.List)) for i, etv := range cv.List { - list[i] = refOrCopyValue(cv, etv) + list[i] = refOrCopyValue(etv) } return &ArrayValue{ ObjectInfo: cv.ObjectInfo.Copy(), @@ -1108,7 +1099,7 @@ func copyValueWithRefs(parent Object, val Value) Value { } case *SliceValue: return &SliceValue{ - Base: toRefValue(parent, cv.Base), + Base: toRefValue(cv.Base), Offset: cv.Offset, Length: cv.Length, Maxcap: cv.Maxcap, @@ -1116,7 +1107,7 @@ func copyValueWithRefs(parent Object, val Value) Value { case *StructValue: fields := make([]TypedValue, len(cv.Fields)) for i, ftv := range cv.Fields { - fields[i] = refOrCopyValue(cv, ftv) + fields[i] = refOrCopyValue(ftv) } return &StructValue{ ObjectInfo: cv.ObjectInfo.Copy(), @@ -1130,7 +1121,7 @@ func copyValueWithRefs(parent Object, val Value) Value { } var closure Value if cv.Closure != nil { - closure = toRefValue(parent, cv.Closure) + closure = toRefValue(cv.Closure) } // nativeBody funcs which don't come from NativeStore (and thus don't // have NativePkg/Name) can't be persisted, and should not be able @@ -1151,8 +1142,8 @@ func copyValueWithRefs(parent Object, val Value) Value { NativeName: cv.NativeName, } case *BoundMethodValue: - fnc := copyValueWithRefs(cv, cv.Func).(*FuncValue) - rtv := refOrCopyValue(cv, cv.Receiver) + fnc := copyValueWithRefs(cv.Func).(*FuncValue) + rtv := refOrCopyValue(cv.Receiver) return &BoundMethodValue{ ObjectInfo: cv.ObjectInfo.Copy(), // XXX ??? Func: fnc, @@ -1161,8 +1152,8 @@ func copyValueWithRefs(parent Object, val Value) Value { case *MapValue: list := &MapList{} for cur := cv.List.Head; cur != nil; cur = cur.Next { - key2 := refOrCopyValue(cv, cur.Key) - val2 := refOrCopyValue(cv, cur.Value) + key2 := refOrCopyValue(cur.Key) + val2 := refOrCopyValue(cur.Value) list.Append(nilAllocator, key2).Value = val2 } return &MapValue{ @@ -1172,10 +1163,10 @@ func copyValueWithRefs(parent Object, val Value) Value { case TypeValue: return toTypeValue(copyTypeWithRefs(cv.Type)) case *PackageValue: - block := toRefValue(cv, cv.Block) + block := toRefValue(cv.Block) fblocks := make([]Value, len(cv.FBlocks)) for i, fb := range cv.FBlocks { - fblocks[i] = toRefValue(cv, fb) + fblocks[i] = toRefValue(fb) } return &PackageValue{ ObjectInfo: cv.ObjectInfo.Copy(), @@ -1190,11 +1181,11 @@ func copyValueWithRefs(parent Object, val Value) Value { source := toRefNode(cv.Source) vals := make([]TypedValue, len(cv.Values)) for i, tv := range cv.Values { - vals[i] = refOrCopyValue(cv, tv) + vals[i] = refOrCopyValue(tv) } var bparent Value if cv.Parent != nil { - bparent = toRefValue(parent, cv.Parent) + bparent = toRefValue(cv.Parent) } bl := &Block{ ObjectInfo: cv.ObjectInfo.Copy(), @@ -1206,6 +1197,24 @@ func copyValueWithRefs(parent Object, val Value) Value { return bl case RefValue: return cv + case *HeapItemValue: + // NOTE: While this could be eliminated sometimes with some + // intelligence prior to persistence, to unwrap the + // HeapItemValue in case where the HeapItemValue only has + // refcount of 1, + // + // 1. The HeapItemValue is necessary when the .Value is a + // primitive non-object anyways, and + // 2. This would mean PointerValue.Base is nil, and we'd need + // additional logic to re-wrap when necessary, and + // 3. And with the above point, it's not clear the result + // would be any faster. But this is something we could + // explore after launch. + hiv := &HeapItemValue{ + ObjectInfo: cv.ObjectInfo.Copy(), + Value: refOrCopyValue(cv.Value), + } + return hiv case *NativeValue: panic("native values not supported") default: @@ -1377,6 +1386,9 @@ func fillTypesOfValue(store Store, val Value) Value { panic("native values not supported") case RefValue: // do nothing return cv + case *HeapItemValue: + fillTypesTV(store, &cv.Value) + return cv default: panic(fmt.Sprintf( "unexpected type %v", @@ -1424,7 +1436,7 @@ func toRefNode(bn BlockNode) RefNode { } } -func toRefValue(parent Object, val Value) RefValue { +func toRefValue(val Value) RefValue { // TODO use type switch stmt. if ref, ok := val.(RefValue); ok { return ref @@ -1497,15 +1509,15 @@ func ensureUniq(oozz ...[]Object) { } } -func refOrCopyValue(parent Object, tv TypedValue) TypedValue { +func refOrCopyValue(tv TypedValue) TypedValue { if tv.T != nil { tv.T = refOrCopyType(tv.T) } if obj, ok := tv.V.(Object); ok { - tv.V = toRefValue(parent, obj) + tv.V = toRefValue(obj) return tv } else { - tv.V = copyValueWithRefs(parent, tv.V) + tv.V = copyValueWithRefs(tv.V) return tv } } diff --git a/gnovm/pkg/gnolang/store.go b/gnovm/pkg/gnolang/store.go index 3db53213f8b..b2ec25e2778 100644 --- a/gnovm/pkg/gnolang/store.go +++ b/gnovm/pkg/gnolang/store.go @@ -305,7 +305,7 @@ func (ds *defaultStore) loadObjectSafe(oid ObjectID) Object { func (ds *defaultStore) SetObject(oo Object) { oid := oo.GetObjectID() // replace children/fields with Ref. - o2 := copyValueWithRefs(nil, oo) + o2 := copyValueWithRefs(oo) // marshal to binary. bz := amino.MustMarshalAny(o2) // set hash. diff --git a/gnovm/pkg/gnolang/uverse.go b/gnovm/pkg/gnolang/uverse.go index df16ecf0ad9..880a75396ca 100644 --- a/gnovm/pkg/gnolang/uverse.go +++ b/gnovm/pkg/gnolang/uverse.go @@ -911,16 +911,18 @@ func UverseNode() *PackageNode { tt := arg0.TV.GetType() vv := defaultValue(m.Alloc, tt) m.Alloc.AllocatePointer() + hi := m.Alloc.NewHeapItem(TypedValue{ + T: tt, + V: vv, + }) m.PushValue(TypedValue{ T: m.Alloc.NewType(&PointerType{ Elt: tt, }), V: PointerValue{ - TV: &TypedValue{ - T: tt, - V: vv, - }, - Base: nil, + TV: &hi.Value, + Base: hi, + Index: 0, }, }) return diff --git a/gnovm/pkg/gnolang/values.go b/gnovm/pkg/gnolang/values.go index 344977a849c..d38c083428c 100644 --- a/gnovm/pkg/gnolang/values.go +++ b/gnovm/pkg/gnolang/values.go @@ -41,6 +41,7 @@ func (*PackageValue) assertValue() {} func (*NativeValue) assertValue() {} func (*Block) assertValue() {} func (RefValue) assertValue() {} +func (*HeapItemValue) assertValue() {} const ( nilStr = "nil" @@ -64,6 +65,7 @@ var ( _ Value = &NativeValue{} _ Value = &Block{} _ Value = RefValue{} + _ Value = &HeapItemValue{} ) // ---------------------------------------- @@ -166,14 +168,20 @@ func (dbv DataByteValue) SetByte(b byte) { // Index is -1 for the shared "_" block var, // and -2 for (gno and native) map items. // +// A pointer constructed via a &x{} composite lit expression or constructed via +// new() or make() will have a virtual HeapItemValue as base. +// // Allocation for PointerValue is not immediate, // as usually PointerValues are temporary for assignment // or binary operations. When a pointer is to be // allocated, *Allocator.AllocatePointer() is called separately, // as in OpRef. +// +// Since PointerValue is used internally for assignment etc, +// it MUST stay minimal for computational efficiency. type PointerValue struct { TV *TypedValue // escape val if pointer to var. - Base Value // array/struct/block. + Base Value // array/struct/block, or heapitem. Index int // list/fields/values index, or -1 or -2 (see below). Key *TypedValue `json:",omitempty"` // for maps. } @@ -2336,12 +2344,12 @@ func (tv *TypedValue) GetSlice2(alloc *Allocator, low, high, max int) TypedValue // TODO rename to BlockValue. type Block struct { - ObjectInfo // for closures - Source BlockNode - Values []TypedValue - Parent Value - Blank TypedValue // captures "_" // XXX remove and replace with global instance. - bodyStmt bodyStmt // XXX expose for persistence, not needed for MVP. + ObjectInfo + Source BlockNode + Values []TypedValue + Parent Value + Blank TypedValue // captures "_" // XXX remove and replace with global instance. + bodyStmt bodyStmt // XXX expose for persistence, not needed for MVP. } // NOTE: for allocation, use *Allocator.NewBlock. @@ -2501,6 +2509,15 @@ type RefValue struct { Hash ValueHash `json:",omitempty"` } +// Base for a detached singleton (e.g. new(int) or &struct{}) +// Conceptually like a Block that holds one value. +// NOTE: could be renamed to HeapItemBaseValue. +// See also note in realm.go about auto-unwrapping. +type HeapItemValue struct { + ObjectInfo + Value TypedValue +} + // ---------------------------------------- func defaultStructFields(alloc *Allocator, st *StructType) []TypedValue { @@ -2629,6 +2646,8 @@ func fillValueTV(store Store, tv *TypedValue) *TypedValue { case *Block: vpv := cb.GetPointerToInt(store, cv.Index) cv.TV = vpv.TV // TODO optimize? + case *HeapItemValue: + cv.TV = &cb.Value default: panic("should not happen") } diff --git a/gnovm/pkg/gnolang/values_string.go b/gnovm/pkg/gnolang/values_string.go index 4ae05c8a97d..204fab62c86 100644 --- a/gnovm/pkg/gnolang/values_string.go +++ b/gnovm/pkg/gnolang/values_string.go @@ -258,6 +258,11 @@ func (v RefValue) String() string { v.PkgPath) } +func (v *HeapItemValue) String() string { + return fmt.Sprintf("heapitem(%v)", + v.Value) +} + // ---------------------------------------- // *TypedValue.Sprint diff --git a/gnovm/tests/files/assign_unnamed_type/more/realm_compositelit_filetest.gno b/gnovm/tests/files/assign_unnamed_type/more/realm_compositelit_filetest.gno index 6549d1824ed..6ef12bd33d4 100644 --- a/gnovm/tests/files/assign_unnamed_type/more/realm_compositelit_filetest.gno +++ b/gnovm/tests/files/assign_unnamed_type/more/realm_compositelit_filetest.gno @@ -30,7 +30,7 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ // "Data": null, // "List": [ // { @@ -41,13 +41,13 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", // "RefCount": "1" // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ // "Fields": [ // { // "T": { @@ -58,8 +58,8 @@ func main() { // "@type": "/gno.SliceValue", // "Base": { // "@type": "/gno.RefValue", -// "Hash": "9263ebf7e55e2d929e9c190bc4490ee58db148ec", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" +// "Hash": "e256933ba4dfda233a7edb0902880d554118ba6e", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" // }, // "Length": "1", // "Maxcap": "1", @@ -68,10 +68,29 @@ func main() { // } // ], // "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ +// "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", // "ModTime": "0", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/r/test.Int" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "2b8a024c53e94431e6203115feaf86b36413d7b2", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" +// } // } // } // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:2]={ @@ -209,19 +228,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "3c89d875f7d6daa94113aa4c7e03432ba56202c2", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/test.Int" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "91ebdb8ff6b68e0b93179fae022213185a450649", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" -// } -// } +// "TV": null // } // } // ] diff --git a/gnovm/tests/files/heap_item_value.gno b/gnovm/tests/files/heap_item_value.gno new file mode 100644 index 00000000000..fe2873f9b60 --- /dev/null +++ b/gnovm/tests/files/heap_item_value.gno @@ -0,0 +1,178 @@ +// PKGPATH: gno.land/r/test +package test + +type S struct { + A int +} + +var a, b *S + +func main() { + a = new(S) + a.A = 4 + b = a +} + +// Realm: +// switchrealm["gno.land/r/test"] +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ +// "Fields": [ +// { +// "N": "BAAAAAAAAAA=", +// "T": { +// "@type": "/gno.PrimitiveType", +// "value": "32" +// } +// } +// ], +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", +// "IsEscaped": true, +// "ModTime": "0", +// "RefCount": "2" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/r/test.S" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "8c001dde13b1f4dc01fc6d3a5bb4bc0cdfe2a50b", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" +// } +// } +// } +// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:2]={ +// "Blank": {}, +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", +// "IsEscaped": true, +// "ModTime": "3", +// "RefCount": "2" +// }, +// "Parent": null, +// "Source": { +// "@type": "/gno.RefNode", +// "BlockNode": null, +// "Location": { +// "File": "", +// "Line": "0", +// "Nonce": "0", +// "PkgPath": "gno.land/r/test" +// } +// }, +// "Values": [ +// { +// "T": { +// "@type": "/gno.TypeType" +// }, +// "V": { +// "@type": "/gno.TypeValue", +// "Type": { +// "@type": "/gno.DeclaredType", +// "Base": { +// "@type": "/gno.StructType", +// "Fields": [ +// { +// "Embedded": false, +// "Name": "A", +// "Tag": "", +// "Type": { +// "@type": "/gno.PrimitiveType", +// "value": "32" +// } +// } +// ], +// "PkgPath": "gno.land/r/test" +// }, +// "Methods": [], +// "Name": "S", +// "PkgPath": "gno.land/r/test" +// } +// } +// }, +// { +// "T": { +// "@type": "/gno.FuncType", +// "Params": [], +// "Results": [] +// }, +// "V": { +// "@type": "/gno.FuncValue", +// "Closure": { +// "@type": "/gno.RefValue", +// "Escaped": true, +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3" +// }, +// "FileName": "main.gno", +// "IsMethod": false, +// "Name": "main", +// "NativeName": "", +// "NativePkg": "", +// "PkgPath": "gno.land/r/test", +// "Source": { +// "@type": "/gno.RefNode", +// "BlockNode": null, +// "Location": { +// "File": "main.gno", +// "Line": "10", +// "Nonce": "0", +// "PkgPath": "gno.land/r/test" +// } +// }, +// "Type": { +// "@type": "/gno.FuncType", +// "Params": [], +// "Results": [] +// } +// } +// }, +// { +// "T": { +// "@type": "/gno.PointerType", +// "Elt": { +// "@type": "/gno.RefType", +// "ID": "gno.land/r/test.S" +// } +// }, +// "V": { +// "@type": "/gno.PointerValue", +// "Base": { +// "@type": "/gno.RefValue", +// "Escaped": true, +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, +// "Index": "0", +// "TV": null +// } +// }, +// { +// "T": { +// "@type": "/gno.PointerType", +// "Elt": { +// "@type": "/gno.RefType", +// "ID": "gno.land/r/test.S" +// } +// }, +// "V": { +// "@type": "/gno.PointerValue", +// "Base": { +// "@type": "/gno.RefValue", +// "Escaped": true, +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, +// "Index": "0", +// "TV": null +// } +// } +// ] +// } diff --git a/gnovm/tests/files/heap_item_value_init.gno b/gnovm/tests/files/heap_item_value_init.gno new file mode 100644 index 00000000000..0d1db7bcb76 --- /dev/null +++ b/gnovm/tests/files/heap_item_value_init.gno @@ -0,0 +1,185 @@ +// PKGPATH: gno.land/r/test +package test + +type S struct { + A *int +} + +var a, b *S + +func init() { + a = new(S) + a.A = new(int) + *a.A = 4 +} + +func main() { + b = a +} + +// Realm: +// switchrealm["gno.land/r/test"] +// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:2]={ +// "Blank": {}, +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", +// "IsEscaped": true, +// "ModTime": "6", +// "RefCount": "2" +// }, +// "Parent": null, +// "Source": { +// "@type": "/gno.RefNode", +// "BlockNode": null, +// "Location": { +// "File": "", +// "Line": "0", +// "Nonce": "0", +// "PkgPath": "gno.land/r/test" +// } +// }, +// "Values": [ +// { +// "T": { +// "@type": "/gno.TypeType" +// }, +// "V": { +// "@type": "/gno.TypeValue", +// "Type": { +// "@type": "/gno.DeclaredType", +// "Base": { +// "@type": "/gno.StructType", +// "Fields": [ +// { +// "Embedded": false, +// "Name": "A", +// "Tag": "", +// "Type": { +// "@type": "/gno.PointerType", +// "Elt": { +// "@type": "/gno.PrimitiveType", +// "value": "32" +// } +// } +// } +// ], +// "PkgPath": "gno.land/r/test" +// }, +// "Methods": [], +// "Name": "S", +// "PkgPath": "gno.land/r/test" +// } +// } +// }, +// { +// "T": { +// "@type": "/gno.FuncType", +// "Params": [], +// "Results": [] +// }, +// "V": { +// "@type": "/gno.FuncValue", +// "Closure": { +// "@type": "/gno.RefValue", +// "Escaped": true, +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3" +// }, +// "FileName": "main.gno", +// "IsMethod": false, +// "Name": "init.1", +// "NativeName": "", +// "NativePkg": "", +// "PkgPath": "gno.land/r/test", +// "Source": { +// "@type": "/gno.RefNode", +// "BlockNode": null, +// "Location": { +// "File": "main.gno", +// "Line": "10", +// "Nonce": "0", +// "PkgPath": "gno.land/r/test" +// } +// }, +// "Type": { +// "@type": "/gno.FuncType", +// "Params": [], +// "Results": [] +// } +// } +// }, +// { +// "T": { +// "@type": "/gno.FuncType", +// "Params": [], +// "Results": [] +// }, +// "V": { +// "@type": "/gno.FuncValue", +// "Closure": { +// "@type": "/gno.RefValue", +// "Escaped": true, +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3" +// }, +// "FileName": "main.gno", +// "IsMethod": false, +// "Name": "main", +// "NativeName": "", +// "NativePkg": "", +// "PkgPath": "gno.land/r/test", +// "Source": { +// "@type": "/gno.RefNode", +// "BlockNode": null, +// "Location": { +// "File": "main.gno", +// "Line": "16", +// "Nonce": "0", +// "PkgPath": "gno.land/r/test" +// } +// }, +// "Type": { +// "@type": "/gno.FuncType", +// "Params": [], +// "Results": [] +// } +// } +// }, +// { +// "T": { +// "@type": "/gno.PointerType", +// "Elt": { +// "@type": "/gno.RefType", +// "ID": "gno.land/r/test.S" +// } +// }, +// "V": { +// "@type": "/gno.PointerValue", +// "Base": { +// "@type": "/gno.RefValue", +// "Escaped": true, +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, +// "Index": "0", +// "TV": null +// } +// }, +// { +// "T": { +// "@type": "/gno.PointerType", +// "Elt": { +// "@type": "/gno.RefType", +// "ID": "gno.land/r/test.S" +// } +// }, +// "V": { +// "@type": "/gno.PointerValue", +// "Base": { +// "@type": "/gno.RefValue", +// "Escaped": true, +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, +// "Index": "0", +// "TV": null +// } +// } +// ] +// } diff --git a/gnovm/tests/files/issue_1326.gno b/gnovm/tests/files/issue_1326.gno new file mode 100644 index 00000000000..a86058a63e0 --- /dev/null +++ b/gnovm/tests/files/issue_1326.gno @@ -0,0 +1,64 @@ +// PKGPATH: gno.land/r/test +package test + +import ( + "strconv" +) + +func init() { + New() + println(Delta()) +} + +func main() { + println(Delta()) +} + +type Move struct { + N1, N2, N3 byte +} + +type S struct { + Moves []Move +} + +func (s S) clone() S { + mv := s.Moves + return S{Moves: mv} +} + +func (olds S) change() S { + s := olds.clone() + + counter++ + s.Moves = append([]Move{}, s.Moves...) + s.Moves = append(s.Moves, Move{counter, counter, counter}) + return s +} + +var ( + el *S + counter byte +) + +func New() { + el = new(S) +} + +func Delta() string { + n := el.change() + *el = n + return Values() +} + +func Values() string { + s := "" + for _, val := range el.Moves { + s += strconv.Itoa(int(val.N1)) + "," + strconv.Itoa(int(val.N2)) + "," + strconv.Itoa(int(val.N3)) + ";" + } + return s +} + +// Output: +// 1,1,1; +// 1,1,1;2,2,2; diff --git a/gnovm/tests/files/star_assign.gno b/gnovm/tests/files/star_assign.gno new file mode 100644 index 00000000000..e40fe2794ac --- /dev/null +++ b/gnovm/tests/files/star_assign.gno @@ -0,0 +1,54 @@ +// PKGPATH: gno.land/r/test +package test + +import ( + "gno.land/p/demo/ufmt" +) + +type A struct { + nums []int +} + +var ( + intPtr *int + strPtr *string + aPtr *A + concretePtr *int + concreteValue int +) + +func init() { + New() +} + +func main() { + Delta() + println(Values()) +} + +func New() { + intPtr = new(int) + strPtr = new(string) + aPtr = &A{} + concretePtr = &concreteValue +} + +func Delta() { + *intPtr++ + *strPtr += "hello" + *aPtr = A{nums: []int{8, 5, 8}} + *concretePtr = 100 +} + +func Values() string { + var results string + results += ufmt.Sprintf("%d, %s, %d, %d", *intPtr, *strPtr, *concretePtr, concreteValue) + for _, n := range aPtr.nums { + results += ufmt.Sprintf(", %d", n) + } + + return results +} + +// Output: +// 1, hello, 100, 100, 8, 5, 8 diff --git a/gnovm/tests/files/zrealm3.gno b/gnovm/tests/files/zrealm3.gno index da8a581375c..8e2b9827322 100644 --- a/gnovm/tests/files/zrealm3.gno +++ b/gnovm/tests/files/zrealm3.gno @@ -25,7 +25,7 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ // "Fields": [ // { // "T": { @@ -57,10 +57,29 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", // "ModTime": "0", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/r/test.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "567a18d9c7594ece7956ce54384b0858888bb834", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" +// } // } // } // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:2]={ @@ -68,7 +87,7 @@ func main() { // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "IsEscaped": true, -// "ModTime": "4", +// "ModTime": "5", // "RefCount": "2" // }, // "Parent": null, @@ -238,21 +257,16 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "8197b7c5b4f2c7bf9c12b1c614f6b4dc6e7ce8dd", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/test.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "b1d00c9606ffbb00b2aa3d475c5a390514f6dc14", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" -// } -// } +// "TV": null // } // } // ] // } // d[a8ada09dee16d791fd406d629fe29bb0ed084a30:4] +// d[a8ada09dee16d791fd406d629fe29bb0ed084a30:5] diff --git a/gnovm/tests/files/zrealm4.gno b/gnovm/tests/files/zrealm4.gno index 4f5254b6951..8a4bac1fe32 100644 --- a/gnovm/tests/files/zrealm4.gno +++ b/gnovm/tests/files/zrealm4.gno @@ -23,7 +23,7 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] -// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ +// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ // "Fields": [ // { // "T": { @@ -72,9 +72,9 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", -// "ModTime": "4", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ModTime": "5", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", // "RefCount": "1" // } // } @@ -83,7 +83,7 @@ func main() { // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "IsEscaped": true, -// "ModTime": "4", +// "ModTime": "5", // "RefCount": "2" // }, // "Parent": null, @@ -180,19 +180,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "7b9d58f40430bbbcbafd47eefb7a6dd342477f71", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "de0c4b2dd935220f7d37d10fc9feb1448bfb011d", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" -// } -// } +// "TV": null // } // } // ] diff --git a/gnovm/tests/files/zrealm5.gno b/gnovm/tests/files/zrealm5.gno index ebe107290e7..108483a435c 100644 --- a/gnovm/tests/files/zrealm5.gno +++ b/gnovm/tests/files/zrealm5.gno @@ -23,7 +23,7 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ // "Fields": [ // { // "T": { @@ -72,13 +72,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "8a86634afa28ef7d7a1f4272255637f16daae2cd", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" +// } // } // } -// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ +// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ // "Fields": [ // { // "T": { @@ -126,26 +145,20 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "7c63a8fd451cd7c470c1851f1ead037246422ded", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "1a4158d473290431f9d4f9c5a85a3b6697640f2a", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", -// "ModTime": "4", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ModTime": "5", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", // "RefCount": "1" // } // } @@ -154,7 +167,7 @@ func main() { // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "IsEscaped": true, -// "ModTime": "4", +// "ModTime": "5", // "RefCount": "2" // }, // "Parent": null, @@ -251,19 +264,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "7b9d58f40430bbbcbafd47eefb7a6dd342477f71", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "011a2960ff92aedda8acd122b9f4d251902e0cd8", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" -// } -// } +// "TV": null // } // } // ] diff --git a/gnovm/tests/files/zrealm6.gno b/gnovm/tests/files/zrealm6.gno index 9884ab1909c..ff5e7e758a1 100644 --- a/gnovm/tests/files/zrealm6.gno +++ b/gnovm/tests/files/zrealm6.gno @@ -24,7 +24,7 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:9]={ // "Fields": [ // { // "T": { @@ -73,13 +73,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", // "RefCount": "1" // } // } -// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:8]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "34a46349a2bc1b58591d0222a145b585452683be", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9" +// } +// } +// } +// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ // "Fields": [ // { // "T": { @@ -127,30 +146,24 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "81074f5da453299a913435a2ddd05248ee012f8c", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "b1719c55a9b07d432385f020b0bdbc678ba2b9ac", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", -// "ModTime": "5", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "ModTime": "7", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", // "RefCount": "1" // } // } -// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ +// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ // "Fields": [ // { // "T": { @@ -198,26 +211,20 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "7c63a8fd451cd7c470c1851f1ead037246422ded", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "8d00c3fa6c15cb0d78dcbaa23df49f96bbc9591b", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", -// "ModTime": "5", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ModTime": "7", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", // "RefCount": "1" // } // } @@ -226,7 +233,7 @@ func main() { // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "IsEscaped": true, -// "ModTime": "5", +// "ModTime": "7", // "RefCount": "2" // }, // "Parent": null, @@ -323,19 +330,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "ade9fce2a987ef1924040a1d75c0172410c66952", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "8f2cb2a771ddc55ab5798b791e16df547c94d862", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" -// } -// } +// "TV": null // } // } // ] diff --git a/gnovm/tests/files/zrealm7.gno b/gnovm/tests/files/zrealm7.gno index a706ffcad78..e6fd99503be 100644 --- a/gnovm/tests/files/zrealm7.gno +++ b/gnovm/tests/files/zrealm7.gno @@ -25,7 +25,7 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:11]={ // "Fields": [ // { // "T": { @@ -74,13 +74,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10", // "RefCount": "1" // } // } -// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:10]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "42cd813e173ad23c7873e9605901e8bea1176c96", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11" +// } +// } +// } +// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:9]={ // "Fields": [ // { // "T": { @@ -128,30 +147,43 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "4f88fcdc73a4a94905e8e4044aa50c2ec7bf2227", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "2ac7cc7e6fdb1ff6dc1f340486011f1449757d85", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", -// "ModTime": "6", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", +// "ModTime": "9", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "RefCount": "1" +// } +// } +// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:8]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "ModTime": "9", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "2c172bbe0183ccc73c59d9acb196c45b0331c39e", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9" +// } // } // } -// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ +// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ // "Fields": [ // { // "T": { @@ -160,7 +192,7 @@ func main() { // }, // "V": { // "@type": "/gno.StringValue", -// "value": "key0" +// "value": "key1" // } // }, // { @@ -170,11 +202,11 @@ func main() { // }, // "V": { // "@type": "/gno.StringValue", -// "value": "value0" +// "value": "value1" // } // }, // { -// "N": "AQAAAAAAAAA=", +// "N": "AwAAAAAAAAA=", // "T": { // "@type": "/gno.PrimitiveType", // "value": "32" @@ -187,6 +219,16 @@ func main() { // "@type": "/gno.RefType", // "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" // } +// }, +// "V": { +// "@type": "/gno.PointerValue", +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "a4fa9bdf45caf8c6b5be7a3752704423817b3ef2", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, +// "Index": "0", +// "TV": null // } // }, // { @@ -196,13 +238,23 @@ func main() { // "@type": "/gno.RefType", // "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" // } +// }, +// "V": { +// "@type": "/gno.PointerValue", +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "43f69f24b7827a331921b4af0f667346d186e0c3", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8" +// }, +// "Index": "0", +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", -// "ModTime": "6", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "ModTime": "9", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", // "RefCount": "1" // } // } @@ -215,7 +267,7 @@ func main() { // }, // "V": { // "@type": "/gno.StringValue", -// "value": "key1" +// "value": "key0" // } // }, // { @@ -225,11 +277,11 @@ func main() { // }, // "V": { // "@type": "/gno.StringValue", -// "value": "value1" +// "value": "value0" // } // }, // { -// "N": "AwAAAAAAAAA=", +// "N": "AQAAAAAAAAA=", // "T": { // "@type": "/gno.PrimitiveType", // "value": "32" @@ -242,22 +294,6 @@ func main() { // "@type": "/gno.RefType", // "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" // } -// }, -// "V": { -// "@type": "/gno.PointerValue", -// "Base": null, -// "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "a0af92becf7bef8d5d71c94e8f8f044e4cfe526d", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" -// } -// } // } // }, // { @@ -267,38 +303,41 @@ func main() { // "@type": "/gno.RefType", // "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" // } -// }, -// "V": { -// "@type": "/gno.PointerValue", -// "Base": null, -// "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "752161efcfe5a3e2ef70c03ff4354097f09ada56", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" -// } -// } // } // } // ], // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", -// "ModTime": "6", +// "ModTime": "9", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", // "RefCount": "1" // } // } +// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "ModTime": "9", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "f56fbd9c8db299689cc0cf806fe741b6a6e641e6", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" +// } +// } +// } // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:2]={ // "Blank": {}, // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "IsEscaped": true, -// "ModTime": "6", +// "ModTime": "9", // "RefCount": "2" // }, // "Parent": null, @@ -395,19 +434,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "450aef9858564ed4ec1c418f1e8dac828079016b", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "github.com/gnolang/gno/_test/timtadh/data_structures/tree/avl.AvlNode" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "c59d05a21bf190551bb15a8b9d41a9e8da717f3d", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" -// } -// } +// "TV": null // } // } // ] diff --git a/gnovm/tests/files/zrealm_avl0.gno b/gnovm/tests/files/zrealm_avl0.gno index e91788ac8eb..e3f1363e205 100644 --- a/gnovm/tests/files/zrealm_avl0.gno +++ b/gnovm/tests/files/zrealm_avl0.gno @@ -25,67 +25,25 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ -// "Fields": [ -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "16" -// }, -// "V": { -// "@type": "/gno.StringValue", -// "value": "key0" -// } -// }, -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "16" -// }, -// "V": { -// "@type": "/gno.StringValue", -// "value": "value0" -// } -// }, -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "64" -// } -// }, -// { -// "N": "AQAAAAAAAAA=", -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "32" -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// } -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// } -// } -// } -// ], // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", -// "ModTime": "5", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ModTime": "7", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "627e8e517e7ae5db0f3b753e2a32b607989198b6", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" +// } // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:9]={ // "Fields": [ // { // "T": { @@ -140,13 +98,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", // "RefCount": "1" // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:8]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "b28057ab7be6383785c0a5503e8a531bdbc21851", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9" +// } +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ // "Fields": [ // { // "T": { @@ -183,19 +160,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "6da365f0d6cacbcdf53cd5a4b125803cddce08c2", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "091729e38bda8724bce4c314f9624b91af679459", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4" -// } -// } +// "TV": null // } // }, // { @@ -208,27 +179,40 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "f216afe7b5a17f4ebdbb98dceccedbc22e237596", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "0b5493aa4ea42087780bdfcaebab2c3eec351c15", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", // "ModTime": "0", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "ff1a50d8489090af37a2c7766d659f0d717939b5", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" +// } // } // } // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:2]={ @@ -236,7 +220,7 @@ func main() { // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "IsEscaped": true, -// "ModTime": "4", +// "ModTime": "5", // "RefCount": "2" // }, // "Parent": null, @@ -333,19 +317,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "ae86874f9b47fa5e64c30b3e92e9d07f2ec967a4", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "6c9948281d4c60b2d95233b76388d54d8b1a2fad", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" -// } -// } +// "TV": null // } // } // ] diff --git a/gnovm/tests/files/zrealm_avl1.gno b/gnovm/tests/files/zrealm_avl1.gno index cdd56a5ad89..a6d2205e240 100644 --- a/gnovm/tests/files/zrealm_avl1.gno +++ b/gnovm/tests/files/zrealm_avl1.gno @@ -24,7 +24,7 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:9]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:15]={ // "Fields": [ // { // "T": { @@ -79,13 +79,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:15", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:14", // "RefCount": "1" // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:8]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:14]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:14", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "143aebc820da33550f7338723fb1e2eec575b196", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:15" +// } +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:13]={ // "Fields": [ // { // "T": { @@ -122,19 +141,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "2f3adc5d0f2a3fe0331cfa93572a7abdde14c9aa", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "7a8a63e17a567d7b0891ac89d5cd90072a73787d", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" -// } -// } +// "TV": null // } // }, // { @@ -147,30 +160,43 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "2e733a8e9e74fe14f0a5d10fb0f6728fa53d052d", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:14" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "ab5a297f4eb033d88bdf1677f4dc151ccb9fde9f", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12", // "RefCount": "1" // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:12]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "fe20a19f956511f274dc77854e9e5468387260f4", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13" +// } +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:11]={ // "Fields": [ // { // "T": { @@ -207,19 +233,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "c89a71bdf045e8bde2059dc9d33839f916e02e5d", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "627e8e517e7ae5db0f3b753e2a32b607989198b6", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" -// } -// } +// "TV": null // } // }, // { @@ -232,27 +252,40 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "90fa67f8c47db4b9b2a60425dff08d5a3385100f", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "fe8afd501233fb95375016199f0443b3c6ab1fbc", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:10]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10", // "ModTime": "0", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "83e42caaf53070dd95b5f859053eb51ed900bbda", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11" +// } // } // } // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:2]={ @@ -260,7 +293,7 @@ func main() { // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "IsEscaped": true, -// "ModTime": "6", +// "ModTime": "9", // "RefCount": "2" // }, // "Parent": null, @@ -357,21 +390,16 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "1faa9fa4ba1935121a6d3f0a623772e9d4499b0a", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "c5eefc40ed065461b4a920c1349ed734ffdead8f", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" -// } -// } +// "TV": null // } // } // ] // } // d[a8ada09dee16d791fd406d629fe29bb0ed084a30:4] +// d[a8ada09dee16d791fd406d629fe29bb0ed084a30:5] diff --git a/gnovm/tests/files/zrealm_avl2.gno b/gnovm/tests/files/zrealm_avl2.gno index 8ecf6ba52bc..a89f0540f47 100644 --- a/gnovm/tests/files/zrealm_avl2.gno +++ b/gnovm/tests/files/zrealm_avl2.gno @@ -24,67 +24,25 @@ func main() { // Realm: // switchrealm["gno.land/r/test"] // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]={ -// "Fields": [ -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "16" -// }, -// "V": { -// "@type": "/gno.StringValue", -// "value": "key1" -// } -// }, -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "16" -// }, -// "V": { -// "@type": "/gno.StringValue", -// "value": "value1" -// } -// }, -// { -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "64" -// } -// }, -// { -// "N": "AQAAAAAAAAA=", -// "T": { -// "@type": "/gno.PrimitiveType", -// "value": "32" -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// } -// } -// }, -// { -// "T": { -// "@type": "/gno.PointerType", -// "Elt": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// } -// } -// } -// ], // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5", -// "ModTime": "6", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "ModTime": "8", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "0b5493aa4ea42087780bdfcaebab2c3eec351c15", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" +// } // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:10]={ // "Fields": [ // { // "T": { @@ -139,13 +97,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:9]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9", // "ModTime": "0", -// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "be751422ef4c2bc068a456f9467d2daca27db8ca", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10" +// } // } // } -// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]={ +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:8]={ // "Fields": [ // { // "T": { @@ -182,19 +159,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "9fa04d8791e205a6de2eedce81bb4dbd0883cac7", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "23c8d928ce614d559719cb47e71a75a456b49a2a", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5" -// } -// } +// "TV": null // } // }, // { @@ -207,27 +178,40 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "a55a6a6b2027d6ec5e322aa32d4269b974fe1a4f", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "fc92b122743503329a416d02fb4fe84cbca6dc57", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6", +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8", +// "ModTime": "0", +// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", +// "RefCount": "1" +// } +// } +// c[a8ada09dee16d791fd406d629fe29bb0ed084a30:7]={ +// "ObjectInfo": { +// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7", // "ModTime": "0", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", // "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "03d901636a4e56d5bd32a75a7b923c7700c8859a", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8" +// } // } // } // u[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={ @@ -242,25 +226,19 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "2c8281b6c5a347a3d3aeedb74e61f081060ac050", +// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "e6d40c7e6f2c94668ab964b4c356d7cbd537a2b5", -// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { // "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4", -// "ModTime": "5", +// "ModTime": "6", // "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2", // "RefCount": "1" // } diff --git a/gnovm/tests/files/zrealm_example.gno b/gnovm/tests/files/zrealm_example.gno index 1ce70c04390..45aeb7c5ddb 100644 --- a/gnovm/tests/files/zrealm_example.gno +++ b/gnovm/tests/files/zrealm_example.gno @@ -24,7 +24,7 @@ func main() { // Realm: // switchrealm["gno.land/r/example"] -// c[1ffd45e074aa1b8df562907c95ad97526b7ca187:8]={ +// c[1ffd45e074aa1b8df562907c95ad97526b7ca187:11]={ // "Fields": [ // { // "T": { @@ -37,13 +37,13 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:8", +// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:11", // "ModTime": "0", -// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:7", +// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:10", // "RefCount": "1" // } // } -// c[1ffd45e074aa1b8df562907c95ad97526b7ca187:7]={ +// c[1ffd45e074aa1b8df562907c95ad97526b7ca187:10]={ // "Fields": [ // { // "T": { @@ -72,19 +72,38 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "c3dc30d2f2a57a0eeb4336dae59355aa7bee0ff5", -// "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:8" +// "Hash": "f190df54e397e2006cee3fc525bcc1b4d556e4c4", +// "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:11" // } // } // ], // "ObjectInfo": { -// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:7", +// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:10", // "ModTime": "0", -// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:6", +// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:9", // "RefCount": "1" // } // } -// c[1ffd45e074aa1b8df562907c95ad97526b7ca187:6]={ +// c[1ffd45e074aa1b8df562907c95ad97526b7ca187:9]={ +// "ObjectInfo": { +// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:9", +// "ModTime": "0", +// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:8", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/dom.Post" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "a74fad6da10f1cec74ad3a8751490b4dca957761", +// "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:10" +// } +// } +// } +// c[1ffd45e074aa1b8df562907c95ad97526b7ca187:8]={ // "Fields": [ // { // "T": { @@ -106,19 +125,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "8b11b3d07ddeb034f70a114c9433ec6bd5cbf899", +// "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:9" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/dom.Post" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "f5d48c5a050326190d971fabb76835de31f83b20", -// "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:7" -// } -// } +// "TV": null // } // }, // { @@ -154,13 +167,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:6", +// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:8", // "ModTime": "0", -// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:5", +// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:7", // "RefCount": "1" // } // } -// u[1ffd45e074aa1b8df562907c95ad97526b7ca187:5]={ +// c[1ffd45e074aa1b8df562907c95ad97526b7ca187:7]={ +// "ObjectInfo": { +// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:7", +// "ModTime": "0", +// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:6", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/p/demo/avl.Node" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "869abdac30a3ae78b2191806e1c894c48e399122", +// "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:8" +// } +// } +// } +// u[1ffd45e074aa1b8df562907c95ad97526b7ca187:6]={ // "Fields": [ // { // "T": { @@ -172,30 +204,24 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "a919087d0eba652876f9a8df18b30ec5ddc8c26e", +// "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:7" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/p/demo/avl.Node" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "e373f3e5c834170fe6e8b6cf5a95d185e80b0ad7", -// "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:6" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:5", -// "ModTime": "5", -// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:4", +// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:6", +// "ModTime": "6", +// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:5", // "RefCount": "1" // } // } -// u[1ffd45e074aa1b8df562907c95ad97526b7ca187:4]={ +// u[1ffd45e074aa1b8df562907c95ad97526b7ca187:5]={ // "Fields": [ // { // "T": { @@ -214,8 +240,8 @@ func main() { // }, // "V": { // "@type": "/gno.RefValue", -// "Hash": "05c2d0709574f676715a23d0161d2e151c0b21c7", -// "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:5" +// "Hash": "dfdeb7ed80c5b030c3a5e9701d00c66203de6f57", +// "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:6" // } // }, // { @@ -227,9 +253,9 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:4", -// "ModTime": "5", -// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:2", +// "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:5", +// "ModTime": "6", +// "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:4", // "RefCount": "1" // } // } diff --git a/gnovm/tests/files/zrealm_std1_stdlibs.gno b/gnovm/tests/files/zrealm_std1_stdlibs.gno index 87f75bcb871..d75a2c60b71 100644 --- a/gnovm/tests/files/zrealm_std1_stdlibs.gno +++ b/gnovm/tests/files/zrealm_std1_stdlibs.gno @@ -25,7 +25,7 @@ func main() { } // Output: -// (slice[ref(1ed29bd278d735e20e296bd4afe927501941392f:4)] std.AddressList) +// (slice[ref(1ed29bd278d735e20e296bd4afe927501941392f:5)] std.AddressList) // error: address already exists // has: true // has: false diff --git a/gnovm/tests/files/zrealm_std2_stdlibs.gno b/gnovm/tests/files/zrealm_std2_stdlibs.gno index 1ae1fb4a881..810210c6160 100644 --- a/gnovm/tests/files/zrealm_std2_stdlibs.gno +++ b/gnovm/tests/files/zrealm_std2_stdlibs.gno @@ -26,7 +26,7 @@ func main() { } // Output: -// (slice[ref(1ed29bd278d735e20e296bd4afe927501941392f:4)] std.AddressList) +// (slice[ref(1ed29bd278d735e20e296bd4afe927501941392f:5)] std.AddressList) // error: address already exists // has: true // has: false diff --git a/gnovm/tests/files/zrealm_tests0_stdlibs.gno b/gnovm/tests/files/zrealm_tests0_stdlibs.gno index d68c1f652f7..bfd4ad30a1e 100644 --- a/gnovm/tests/files/zrealm_tests0_stdlibs.gno +++ b/gnovm/tests/files/zrealm_tests0_stdlibs.gno @@ -23,7 +23,7 @@ func main() { // Realm: // switchrealm["gno.land/r/demo/tests"] -// c[0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:14]={ +// c[0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:18]={ // "Fields": [ // { // "T": { @@ -37,13 +37,32 @@ func main() { // } // ], // "ObjectInfo": { -// "ID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:14", +// "ID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:18", // "ModTime": "0", -// "OwnerID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:13", +// "OwnerID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:17", // "RefCount": "1" // } // } -// c[0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:13]={ +// c[0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:17]={ +// "ObjectInfo": { +// "ID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:17", +// "ModTime": "0", +// "OwnerID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:16", +// "RefCount": "1" +// }, +// "Value": { +// "T": { +// "@type": "/gno.RefType", +// "ID": "gno.land/r/demo/tests_foo.FooStringer" +// }, +// "V": { +// "@type": "/gno.RefValue", +// "Hash": "d3d6ffa52602f2bc976051d79294d219750aca64", +// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:18" +// } +// } +// } +// c[0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:16]={ // "Data": null, // "List": [ // { @@ -56,19 +75,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "4ea1e08156f3849b74a0f41f92cd4b48fb94926b", +// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:11" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/tests_foo.FooStringer" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "63ef2b51ca911a9b1727588bacb958ec3cb2a392", -// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:10" -// } -// } +// "TV": null // } // }, // { @@ -81,19 +94,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "ce86ea1156e75a44cd9d7ba2261819b100aa4ed1", +// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:14" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/tests_foo.FooStringer" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "54c554e1d1f61e19feb13bb229f43540338c0f8f", -// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:12" -// } -// } +// "TV": null // } // }, // { @@ -106,24 +113,18 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "b66192fbd8a8dde79b6f854b5cc3c4cc965cfd92", +// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:17" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/tests_foo.FooStringer" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "4e50e2cdaeb022a6fcbdb96d9fbd7f3af8df1379", -// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:14" -// } -// } +// "TV": null // } // } // ], // "ObjectInfo": { -// "ID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:13", +// "ID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:16", // "ModTime": "0", // "OwnerID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:2", // "RefCount": "1" @@ -134,7 +135,7 @@ func main() { // "ObjectInfo": { // "ID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:2", // "IsEscaped": true, -// "ModTime": "12", +// "ModTime": "15", // "RefCount": "5" // }, // "Parent": null, @@ -1511,8 +1512,8 @@ func main() { // "@type": "/gno.SliceValue", // "Base": { // "@type": "/gno.RefValue", -// "Hash": "5f12a61dd16d828be8584debc0e395e8d2136acb", -// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:13" +// "Hash": "ad25f70f66c8c53042afd1377e5ff5ab744bf1a5", +// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:16" // }, // "Length": "3", // "Maxcap": "3", @@ -1529,19 +1530,13 @@ func main() { // }, // "V": { // "@type": "/gno.PointerValue", -// "Base": null, +// "Base": { +// "@type": "/gno.RefValue", +// "Hash": "b662d2bfde61831128c908a3d1afff97e05e6227", +// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:7" +// }, // "Index": "0", -// "TV": { -// "T": { -// "@type": "/gno.RefType", -// "ID": "gno.land/r/demo/tests.Int" -// }, -// "V": { -// "@type": "/gno.RefValue", -// "Hash": "90b77781ec2b1e153ac020b1102354174bde972e", -// "ObjectID": "0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:7" -// } -// } +// "TV": null // } // }, // { @@ -1595,7 +1590,7 @@ func main() { // } // ] // } -// d[0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:11] +// d[0ffe7732b4d549b4cf9ec18bd68641cd2c75ad0a:13] // switchrealm["gno.land/r/demo/tests_foo"] // switchrealm["gno.land/r/demo/tests_foo"] // switchrealm["gno.land/r/demo/tests_foo"]