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

logic/v1 package

Overview

Package logic is version 1 of the logic realm of the "state realm + swappable logic" upgrade pattern (pattern C of the exploration; see ../../README.md).

Same shape as v0, different rule. The counter it reads and writes is the same one v0 was using: the upgrade changed the code without touching the data.

Functions

Get

func Get() int

Get reads the shared counter, including everything v0 wrote.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/upgrade/store/logic/v1.Get()"

Result

Inc

func Inc(cur realm) int

Inc applies this version's rule to the shared counter.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/upgrade/store/logic/v1" -func "Inc" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/upgrade/store/logic/v1" -func "Inc" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

Render

func Render(_ string) string

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/upgrade/store/logic/v1.Render()"

Result