z2_filetest.gno

1.12 Kb ยท 50 lines
 1package main
 2
 3import (
 4	"std"
 5
 6	"gno.land/p/demo/testutils"
 7	"gno.land/r/gnoland/faucet"
 8)
 9
10// mints ugnot to current realm
11func init() {
12	facuetaddr := std.DerivePkgAddr("gno.land/r/gnoland/faucet")
13	std.TestIssueCoins(facuetaddr, std.Coins{{"ugnot", 200000000}})
14}
15
16// assert render with empty path and 2 controllers
17func main() {
18	var (
19		adminaddr       = std.Address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5")
20		controlleraddr1 = testutils.TestAddress("controller1")
21		controlleraddr2 = testutils.TestAddress("controller2")
22	)
23	std.TestSetOrigCaller(adminaddr)
24	err := faucet.AdminAddController(controlleraddr1)
25	if err != "" {
26		panic(err)
27	}
28	err = faucet.AdminAddController(controlleraddr2)
29	if err != "" {
30		panic(err)
31	}
32	println(faucet.Render(""))
33}
34
35// Output:
36// # Community Faucet.
37//
38// Status: active.
39// Balance: 200000000ugnot.
40// Total transfers:  (in 0 times).
41//
42// Package address: g1ttrq7mp4zy6dssnmgyyktnn4hcj3ys8xhju0n7
43//
44// Admin: g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5
45//
46//  Controllers:
47//
48//  g1vdhkuarjdakxcetjx9047h6lta047h6lsdacav  g1vdhkuarjdakxcetjxf047h6lta047h6lnrev3v
49//
50// Per request limit: 350000000ugnot