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.

impl.gno

0.98 Kb · 31 lines
 1// Package impl is version 0 of the implementation realm of the "propose and
 2// accept" upgrade pattern (pattern F; see ../../README.md).
 3//
 4// Deploying it only nominates it. It serves nothing until the facade's owner
 5// accepts this path.
 6package impl
 7
 8import (
 9	facade "gno.land/r/nym-moultest123/x/upgrade/adminreg/facade/v0"
10)
11
12type greeter struct{}
13
14func (greeter) Greet(name string) string { return "hello, " + name }
15func (greeter) Version() string          { return "impl/v0" }
16
17// Instance exposes the singleton.
18func Instance() facade.Impl { return greeter{} }
19
20func init(cur realm) {
21	facade.Propose(cross(cur), Instance())
22}
23
24// Propose re-nominates this implementation. init does it at deploy; exposing it
25// as a transaction lets a candidate be restored without redeploying.
26func Propose(cur realm) {
27	facade.Propose(cross(cur), Instance())
28}
29
30// Path is this realm's own package path, the string the facade owner accepts.
31const Path = "gno.land/r/nym-moultest123/x/upgrade/adminreg/impl/v0"