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

curchain_b package

Overview

Package curchain_b is the terminal hop in the multi-level cross-call chain test helpers. It prints the full captured chain visible from this realm, and asserts parity with unsafe.CurrentRealm() / unsafe.PreviousRealm() at the cross-callee position.

Function

B

func B(cur realm)

B is a crossing function that prints the captured chain reached via .Previous() walks and asserts parity with unsafe.CurrentRealm() / unsafe.PreviousRealm() at the cross-callee position. The chain-root case is covered separately by zrealm_cur_parity.

Chain layout for callsite main -> curchain_a.A -> curchain_b.B:

Example
1cur                  = B
2cur.Previous()       = A
3cur.Previous()^2     = main
4cur.Previous()^3     = EOA origin (PkgPath() == "")
5cur.Previous()^4     = panics (origin has no further previous)

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/tests/vm/curchain_b" -func "B" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "https://api.gno.berty.io:443" ADDRESSgnokey query -remote "https://api.gno.berty.io:443" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/tests/vm/curchain_b" -func "B" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://api.gno.berty.io:443" call.tx