z_1_filetest.gno
0.65 Kb ยท 27 lines
1// Empty line between the directives is important for them to be parsed
2// independently. :facepalm:
3
4// PKGPATH: gno.land/r/demo/bank1
5
6package bank1
7
8import (
9 "std"
10 "testing"
11
12 "gno.land/r/demo/banktest"
13)
14
15func main() {
16 banktestAddr := std.DerivePkgAddr("gno.land/r/demo/banktest")
17
18 // simulate a Deposit call.
19 testing.IssueCoins(banktestAddr, std.Coins{{"ugnot", 100000000}})
20 testing.SetOriginSend(std.Coins{{"ugnot", 100000000}})
21 testing.SetRealm(std.NewCodeRealm("gno.land/r/demo/banktest"))
22 res := banktest.Deposit("ugnot", 101000000)
23 println(res)
24}
25
26// Error:
27// cannot send "101000000ugnot", limit "100000000ugnot" exceeded with "" already spent