engine.gno
0.84 Kb · 24 lines
1// Package engine is the honest engine of spike (a): a stateless realm that
2// registers a zero-size value with spike/registry, exactly like
3// r/moul/x/upgrade/selfreg/impl/v1 registers greeter{} with its facade.
4package engine
5
6import (
7 "gno.land/r/g19dzk54hhsdc3gllpksuj6gu4a3e6fl8cr6rn4w/minhwa/spike/registry"
8)
9
10type impl struct{}
11
12func (impl) Name() string { return "spike-honest" }
13
14// Render is deterministic in the seed and touches no state.
15func (impl) Render(seed string) string {
16 return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" fill="#0b7"/><desc>` +
17 seed + `</desc></svg>`
18}
19
20// Register is an explicit call rather than init: under the inert package
21// policy init runs inside the approver's transaction (RA B-1).
22func Register(cur realm) string {
23 return registry.Register(cross(cur), impl{})
24}