PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/gov/dao/init/v0

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v0
Namespace
gov / dao / init
Files
2 (gnomod.toml)
Exported functions
2
Module
gno.land/r/gov/dao/init/v0
gno
0.9

Files (2)

  • gnomod.tomltoml
  • init.gnogno
init.gnogno
1
package init
2
3import (
4 "chain/runtime"
5
6 "gno.land/r/gov/dao"
7 "gno.land/r/gov/dao/impl/v0"
8 "gno.land/r/gov/dao/memberstore/v0"
9)
10
11func Init(cur realm) {
12 assertIsDevChain()
13
14 // This is needed because state is saved between unit tests,
15 // and we want to avoid having real members used on tests
16 memberstore.Get(0, cur).DeleteAll()
17 dao.UpdateImpl(cross(cur), dao.NewUpdateRequest(impl.NewGovDAO(), []string{"gno.land/r/gov/dao/impl/v0"}))
18}
19
20func InitWithUsers(cur realm, addrs ...address) {
21 assertIsDevChain()
22
23 // This is needed because state is saved between unit tests,
24 // and we want to avoid having real members used on tests
25 memberstore.Get(0, cur).DeleteAll()
26 memberstore.Get(0, cur).SetTier(memberstore.T1)
27 for _, a := range addrs {
28 if !a.IsValid() {
29 panic("invalid address: " + a.String())
30 }
31 memberstore.Get(0, cur).SetMember(memberstore.T1, a, memberstore.NewMember(3))
32 }
33
34 dao.UpdateImpl(cross(cur), dao.NewUpdateRequest(impl.NewGovDAO(), []string{"gno.land/r/gov/dao/impl/v0"}))
35}
36
37func assertIsDevChain() {
38 chainID := runtime.ChainID()
39 if chainID != "dev" && chainID != "tendermint_test" {
40 panic("unauthorized")
41 }
42}
43

Functions

  • Init(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})

  • InitWithUsers(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, addrs ....uverse.address)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered

RenderedRawgnoweb ↗
This realm does not provide renderable output (vm/qrender → NoRenderDeclError). View on gnoweb ↗

vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.