z_check_crossrealm_filetest.gno
0.95 Kb · 27 lines
1// PKGPATH: gno.land/r/demo/lending
2package lending
3
4// Another realm integrates Bouncer: it gets policies from Bouncer's
5// constructors (a bouncer.Policy{...} literal written here would panic:
6// the VM refuses to allocate a Bouncer type in this realm) and calls the
7// plain reads. An unattested package never passes, whatever the policy.
8
9import bouncer "gno.land/r/g19wmd95cwm3s0w0c5592tgu3zh4zgrtlggvugnj/bouncer/v0"
10
11func main(cur realm) {
12 vault := "gno.land/r/demo/vault"
13 println("strict:", bouncer.Check(vault, bouncer.Strict()))
14 println("standard:", bouncer.Check(vault, bouncer.Standard()))
15 println("custom:", bouncer.Check(vault, bouncer.Custom(0).WithProvenCritical().WithProvenOther().WithOpenDisputes()))
16 s, ok := bouncer.Score(vault)
17 println("score:", s, ok)
18 a, ok := bouncer.Latest(vault)
19 println("latest:", a.Score, ok, len(a.Findings))
20}
21
22// Output:
23// strict: false
24// standard: false
25// custom: false
26// score: 0 false
27// latest: 0 false 0