Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

z_wrap_filetest.gno

0.59 Kb · 29 lines
 1// PKGPATH: gno.land/r/nym-moultest123/main
 2package main
 3
 4import (
 5	v0 "gno.land/r/nym-moultest123/x/upgrade/wrap/v0"
 6	v1 "gno.land/r/nym-moultest123/x/upgrade/wrap/v1"
 7)
 8
 9// Both versions stay writable, and writing one never moves the other.
10func main(cur realm) {
11	print(v0.Render(""))
12	print(v1.Render(""))
13
14	v0.Inc(cross(cur), 10)
15	print(v0.Render(""))
16	print(v1.Render(""))
17
18	v1.Inc(cross(cur), 100)
19	print(v0.Render(""))
20	print(v1.Render(""))
21}
22
23// Output:
24// wrap/v0: 0
25// wrap/v1: 0 (own 0 + v0 0)
26// wrap/v0: 10
27// wrap/v1: 10 (own 0 + v0 10)
28// wrap/v0: 10
29// wrap/v1: 110 (own 100 + v0 10)