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

assert.gno

0.76 Kb · 32 lines
 1package ucs03_zkgm
 2
 3import "gno.land/r/onbloc/ibc/union/access"
 4
 5// assert.gno holds the proxy's trust gates. The App receiver surface is reachable
 6// only through core (assertIsCoreRealm), while governance entrypoints use the app's
 7// access manager state. State writes are gated by the interrealm borrow rule on
 8// the injected store, so no separate impl-realm gate is needed here.
 9
10func assertIsCoreRealm(cur realm) {
11	if cur.Previous().PkgPath() != access.CoreRealmPath {
12		panic(ErrNotCoreRealm)
13	}
14}
15
16func assertIsRlmCurrent(_ int, rlm realm) {
17	if !rlm.IsCurrent() {
18		panic(ErrSpoofedRealm)
19	}
20}
21
22func assertIsProxyRealm(_ int, rlm realm) {
23	if rlm.PkgPath() != proxyPkgPath {
24		panic(ErrNotProxyRealm)
25	}
26}
27
28func assertIsNotPaused() {
29	if paused {
30		panic("paused")
31	}
32}