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

register.gno

0.71 Kb · 21 lines
 1package ucs03_zkgm
 2
 3import (
 4	z "gno.land/p/onbloc/ibc/union/zkgm"
 5	core "gno.land/r/onbloc/ibc/union/core"
 6)
 7
 8// RegisterCoreApp registers the proxy App with core under the proxy pkgpath.
 9// core rejects re-registration, so the App identity is permanent once installed.
10func RegisterCoreApp(cur realm) {
11	core.RegisterApp(cross(cur), &App{})
12}
13
14// RegisterReceiver records the calling realm as an OP_CALL receiver target,
15// keyed by its package path. The impl looks it up via store.GetReceiver during
16// call dispatch.
17func RegisterReceiver(cur realm, receiver z.Zkgmable) {
18	receiverPkgPath := cur.Previous().PkgPath()
19	store.SetReceiver(0, cur, receiverPkgPath, receiver)
20	emitZkgmReceiverRegisteredEvent(receiverPkgPath)
21}