z5b_transfer_filetest.gno
1.04 Kb · 32 lines
1// PKGPATH: gno.land/r/aib/main
2package main
3
4import (
5 "testing"
6 "time"
7
8 tmtesting "gno.land/p/aib/ibc/lightclient/tendermint/testing"
9 "gno.land/p/aib/ibc/types"
10
11 "gno.land/r/aib/ibc/apps/transfer"
12 "gno.land/r/aib/ibc/core"
13)
14
15// OnSendPacket: caller did not send any coins
16func main(cur realm) {
17 var (
18 chainID = "chain-id-2"
19 clientState = tmtesting.NewClientState(chainID, types.NewHeight(2, 2))
20 apphash = tmtesting.Hash("apphash")
21 trustedValset = tmtesting.GenValset()
22 consensusState = tmtesting.GenConsensusState(time.Now(), apphash, trustedValset.Hash())
23 )
24 clientID := core.CreateClient(cross(cur), clientState, consensusState)
25 core.RegisterCounterparty(cross(cur), clientID, [][]byte{[]byte("iavlStoreKey"), []byte("prefix2")}, "07-tendermint-2")
26
27 testing.SetRealm(testing.NewUserRealm("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))
28 transfer.Transfer(cross(cur), clientID, "atone1user", "ugnot", 100, uint64(time.Now().Add(time.Hour).Unix()), "")
29}
30
31// Error:
32// native transfer requires one non-zero coin to be sent