github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/zrealm_example.gno (about)

     1  // PKGPATH: gno.land/r/example
     2  package example
     3  
     4  import (
     5  	"gno.land/p/demo/dom"
     6  )
     7  
     8  var gPlot *dom.Plot
     9  
    10  func init() {
    11  	gPlot = &dom.Plot{Name: "First Plot"}
    12  }
    13  
    14  func main() {
    15  	gPlot.AddPost("TEST_TITLE", "TEST_BODY")
    16  	println(gPlot.String())
    17  }
    18  
    19  // Output:
    20  // # [plot] First Plot
    21  //
    22  // ## TEST_TITLE
    23  // TEST_BODY
    24  
    25  // Realm:
    26  // switchrealm["gno.land/r/example"]
    27  // c[1ffd45e074aa1b8df562907c95ad97526b7ca187:8]={
    28  //     "Fields": [
    29  //         {
    30  //             "T": {
    31  //                 "@type": "/gno.PointerType",
    32  //                 "Elt": {
    33  //                     "@type": "/gno.RefType",
    34  //                     "ID": "gno.land/p/demo/avl.Node"
    35  //                 }
    36  //             }
    37  //         }
    38  //     ],
    39  //     "ObjectInfo": {
    40  //         "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:8",
    41  //         "ModTime": "0",
    42  //         "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:7",
    43  //         "RefCount": "1"
    44  //     }
    45  // }
    46  // c[1ffd45e074aa1b8df562907c95ad97526b7ca187:7]={
    47  //     "Fields": [
    48  //         {
    49  //             "T": {
    50  //                 "@type": "/gno.PrimitiveType",
    51  //                 "value": "16"
    52  //             },
    53  //             "V": {
    54  //                 "@type": "/gno.StringValue",
    55  //                 "value": "TEST_TITLE"
    56  //             }
    57  //         },
    58  //         {
    59  //             "T": {
    60  //                 "@type": "/gno.PrimitiveType",
    61  //                 "value": "16"
    62  //             },
    63  //             "V": {
    64  //                 "@type": "/gno.StringValue",
    65  //                 "value": "TEST_BODY"
    66  //             }
    67  //         },
    68  //         {
    69  //             "T": {
    70  //                 "@type": "/gno.RefType",
    71  //                 "ID": "gno.land/p/demo/avl.Tree"
    72  //             },
    73  //             "V": {
    74  //                 "@type": "/gno.RefValue",
    75  //                 "Hash": "c3dc30d2f2a57a0eeb4336dae59355aa7bee0ff5",
    76  //                 "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:8"
    77  //             }
    78  //         }
    79  //     ],
    80  //     "ObjectInfo": {
    81  //         "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:7",
    82  //         "ModTime": "0",
    83  //         "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:6",
    84  //         "RefCount": "1"
    85  //     }
    86  // }
    87  // c[1ffd45e074aa1b8df562907c95ad97526b7ca187:6]={
    88  //     "Fields": [
    89  //         {
    90  //             "T": {
    91  //                 "@type": "/gno.PrimitiveType",
    92  //                 "value": "16"
    93  //             },
    94  //             "V": {
    95  //                 "@type": "/gno.StringValue",
    96  //                 "value": "0"
    97  //             }
    98  //         },
    99  //         {
   100  //             "T": {
   101  //                 "@type": "/gno.PointerType",
   102  //                 "Elt": {
   103  //                     "@type": "/gno.RefType",
   104  //                     "ID": "gno.land/p/demo/dom.Post"
   105  //                 }
   106  //             },
   107  //             "V": {
   108  //                 "@type": "/gno.PointerValue",
   109  //                 "Base": null,
   110  //                 "Index": "0",
   111  //                 "TV": {
   112  //                     "T": {
   113  //                         "@type": "/gno.RefType",
   114  //                         "ID": "gno.land/p/demo/dom.Post"
   115  //                     },
   116  //                     "V": {
   117  //                         "@type": "/gno.RefValue",
   118  //                         "Hash": "f5d48c5a050326190d971fabb76835de31f83b20",
   119  //                         "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:7"
   120  //                     }
   121  //                 }
   122  //             }
   123  //         },
   124  //         {
   125  //             "T": {
   126  //                 "@type": "/gno.PrimitiveType",
   127  //                 "value": "64"
   128  //             }
   129  //         },
   130  //         {
   131  //             "N": "AQAAAAAAAAA=",
   132  //             "T": {
   133  //                 "@type": "/gno.PrimitiveType",
   134  //                 "value": "32"
   135  //             }
   136  //         },
   137  //         {
   138  //             "T": {
   139  //                 "@type": "/gno.PointerType",
   140  //                 "Elt": {
   141  //                     "@type": "/gno.RefType",
   142  //                     "ID": "gno.land/p/demo/avl.Node"
   143  //                 }
   144  //             }
   145  //         },
   146  //         {
   147  //             "T": {
   148  //                 "@type": "/gno.PointerType",
   149  //                 "Elt": {
   150  //                     "@type": "/gno.RefType",
   151  //                     "ID": "gno.land/p/demo/avl.Node"
   152  //                 }
   153  //             }
   154  //         }
   155  //     ],
   156  //     "ObjectInfo": {
   157  //         "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:6",
   158  //         "ModTime": "0",
   159  //         "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:5",
   160  //         "RefCount": "1"
   161  //     }
   162  // }
   163  // u[1ffd45e074aa1b8df562907c95ad97526b7ca187:5]={
   164  //     "Fields": [
   165  //         {
   166  //             "T": {
   167  //                 "@type": "/gno.PointerType",
   168  //                 "Elt": {
   169  //                     "@type": "/gno.RefType",
   170  //                     "ID": "gno.land/p/demo/avl.Node"
   171  //                 }
   172  //             },
   173  //             "V": {
   174  //                 "@type": "/gno.PointerValue",
   175  //                 "Base": null,
   176  //                 "Index": "0",
   177  //                 "TV": {
   178  //                     "T": {
   179  //                         "@type": "/gno.RefType",
   180  //                         "ID": "gno.land/p/demo/avl.Node"
   181  //                     },
   182  //                     "V": {
   183  //                         "@type": "/gno.RefValue",
   184  //                         "Hash": "e373f3e5c834170fe6e8b6cf5a95d185e80b0ad7",
   185  //                         "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:6"
   186  //                     }
   187  //                 }
   188  //             }
   189  //         }
   190  //     ],
   191  //     "ObjectInfo": {
   192  //         "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:5",
   193  //         "ModTime": "5",
   194  //         "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:4",
   195  //         "RefCount": "1"
   196  //     }
   197  // }
   198  // u[1ffd45e074aa1b8df562907c95ad97526b7ca187:4]={
   199  //     "Fields": [
   200  //         {
   201  //             "T": {
   202  //                 "@type": "/gno.PrimitiveType",
   203  //                 "value": "16"
   204  //             },
   205  //             "V": {
   206  //                 "@type": "/gno.StringValue",
   207  //                 "value": "First Plot"
   208  //             }
   209  //         },
   210  //         {
   211  //             "T": {
   212  //                 "@type": "/gno.RefType",
   213  //                 "ID": "gno.land/p/demo/avl.Tree"
   214  //             },
   215  //             "V": {
   216  //                 "@type": "/gno.RefValue",
   217  //                 "Hash": "05c2d0709574f676715a23d0161d2e151c0b21c7",
   218  //                 "ObjectID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:5"
   219  //             }
   220  //         },
   221  //         {
   222  //             "N": "AQAAAAAAAAA=",
   223  //             "T": {
   224  //                 "@type": "/gno.PrimitiveType",
   225  //                 "value": "32"
   226  //             }
   227  //         }
   228  //     ],
   229  //     "ObjectInfo": {
   230  //         "ID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:4",
   231  //         "ModTime": "5",
   232  //         "OwnerID": "1ffd45e074aa1b8df562907c95ad97526b7ca187:2",
   233  //         "RefCount": "1"
   234  //     }
   235  // }