withdraw_limit_filetest.gno
0.47 Kb · 18 lines
1// PKGPATH: gno.land/r/test/withdrawfixture/main
2
3package main
4
5import (
6 "testing"
7
8 "gno.land/r/g132vz03ycpaagtef4jmxjakstkppgyc5wn3r807/erratabank/v0"
9)
10
11func main(cur realm) {
12 testing.SetRealm(testing.NewUserRealm(address("g1dmt3sa5ucvecxuhf3j6ne5r0e3z4x7h6c03xc0")))
13 bookID := erratabank.CreateBook(cross(cur), "Book", "First", "https://example.org/book", 1)
14 erratabank.Withdraw(cross(cur), bookID, 1)
15}
16
17// Error:
18// withdrawal must be positive and within available escrow