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

counter source realm

Package counter is the smallest realm that still proves the whole pipeline: it is deployed, approved, called with an ...

Overview

Package counter is the smallest realm that still proves the whole pipeline: it is deployed, approved, called with an int and a string, read back through Render and through QEval, and made to abort on purpose.

It imports nothing but strconv, deliberately. A smoke test that fails because a stdlib package moved between chain versions reports a problem with itself, not with the chain, and that is the one failure mode this file must not have.

Functions 4

func Get

Action
1func Get() int
source

Get is the QEval target: an int return, read with no gas and no key.

func Increment

crossing Action
1func Increment(cur realm, n int) int
source

Increment adds n and returns the new total. It panics on a non-positive n, which is what the scenario's expect_fail step exercises: a realm that aborts is a different outcome from one that is unreachable, and only a real chain tells the two apart.

func SetNote

crossing Action
1func SetNote(cur realm, s string)
source

SetNote stores a short string, so the scenario covers a string argument surviving the round trip through amino and back out of Render.

Imports 1

  • strconv stdlib

Source Files 2