z_1_filetest.gno

0.48 Kb ยท 21 lines
 1package main
 2
 3import (
 4	"std"
 5
 6	"gno.land/r/demo/banktest"
 7)
 8
 9func main() {
10	banktestAddr := std.DerivePkgAddr("gno.land/r/demo/banktest")
11
12	// simulate a Deposit call.
13	std.TestSetOrigPkgAddr(banktestAddr)
14	std.TestIssueCoins(banktestAddr, std.Coins{{"ugnot", 100000000}})
15	std.TestSetOrigSend(std.Coins{{"ugnot", 100000000}}, nil)
16	res := banktest.Deposit("ugnot", 101000000)
17	println(res)
18}
19
20// Error:
21// cannot send "101000000ugnot", limit "100000000ugnot" exceeded with "" already spent