z_policy_literal_filetest.gno
0.49 Kb · 14 lines
1// PKGPATH: gno.land/r/demo/lending
2package lending
3
4// Pins the VM rule that makes Custom() necessary: another realm cannot
5// allocate a Bouncer-declared type with a composite literal.
6
7import bouncer "gno.land/r/g19wmd95cwm3s0w0c5592tgu3zh4zgrtlggvugnj/bouncer/v2"
8
9func main(cur realm) {
10 _ = bouncer.Check("gno.land/r/demo/vault", bouncer.Policy{MinScore: 10})
11}
12
13// Error:
14// cannot allocate gno.land/r/g19wmd95cwm3s0w0c5592tgu3zh4zgrtlggvugnj/bouncer/v2.Policy in realm gno.land/r/demo/lending