Skip to content

Commit

Permalink
chore: emit event on registration
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Jul 5, 2024
1 parent cdbe6da commit a65537b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/gno.land/r/demo/grc20reg/grc20reg.gno
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ func Register(token grc20.IGRC20, slug string) {
rlmPath := std.PrevRealm().PkgPath()
key := fqname.Construct(rlmPath, slug)
registry.Set(key, token)
std.Emit(
registerEvent,
"pkgpath", rlmPath,
"slug", slug,
)
}

func Get(key string) grc20.IGRC20 {
Expand Down Expand Up @@ -51,3 +56,5 @@ func Render(path string) string {
}
return s
}

const registerEvent = "register"

0 comments on commit a65537b

Please sign in to comment.