z_1_filetest.gno

0.59 Kb ยท 26 lines
 1// PKGPATH: gno.land/r/demo/bank1
 2
 3package bank1
 4
 5import (
 6	"std"
 7	"testing"
 8
 9	"gno.land/r/demo/banktest"
10)
11
12func main() {
13	banktestAddr := std.DerivePkgAddr("gno.land/r/demo/banktest")
14	mainaddr := std.DerivePkgAddr("gno.land/r/demo/bank1")
15
16	// simulate a Deposit call.
17	testing.IssueCoins(banktestAddr, std.Coins{{"ugnot", 100000000}})
18	testing.SetOriginSend(std.Coins{{"ugnot", 100000000}})
19	testing.SetRealm(std.NewUserRealm(mainaddr))
20
21	res := banktest.Deposit(cross, "ugnot", 101000000)
22	println(res)
23}
24
25// Error:
26// cannot send "101000000ugnot", limit "100000000ugnot" exceeded with "" already spent