Search Apps Documentation Source Content File Folder Download Copy

z_3_filetest.gno

0.62 Kb ยท 25 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)
11
12func main() {
13	banktestAddr := std.DerivePkgAddr("gno.land/r/demo/banktest")
14
15	mainaddr := std.DerivePkgAddr("gno.land/r/demo/bank1")
16	std.TestSetOrigCaller(mainaddr)
17
18	banker := std.GetBanker(std.BankerTypeRealmSend)
19	send := std.Coins{{"ugnot", 123}}
20	banker.SendCoins(banktestAddr, mainaddr, send)
21
22}
23
24// Error:
25// can only send coins from realm that created banker "g1tnpdmvrmtgql8fmxgsq9rwtst5hsxahk3f05dk", not "g1dv3435088tlrgggf745kaud0ptrkc9v42k8llz"