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
11 "gno.land/r/demo/banktest"
12)
13
14func main() {
15 banktestAddr := std.DerivePkgAddr("gno.land/r/demo/banktest")
16
17 // simulate a Deposit call.
18 std.TestSetOrigPkgAddr(banktestAddr)
19 std.TestIssueCoins(banktestAddr, std.Coins{{"ugnot", 100000000}})
20 std.TestSetOrigSend(std.Coins{{"ugnot", 100000000}}, nil)
21 res := banktest.Deposit("ugnot", 101000000)
22 println(res)
23}
24
25// Error:
26// cannot send "101000000ugnot", limit "100000000ugnot" exceeded with "" already spent
z_1_filetest.gno
0.62 Kb ยท 26 lines