z0bb_render_home_with_client_filetest.gno
1.83 Kb · 56 lines
1// PKGPATH: gno.land/r/aib/main
2package main
3
4import (
5 "time"
6
7 tmtesting "gno.land/p/aib/ibc/lightclient/tendermint/testing"
8 "gno.land/p/aib/ibc/types"
9
10 "gno.land/r/aib/ibc/apps/transfer"
11 "gno.land/r/aib/ibc/core"
12)
13
14// renderHome with a client registered: confirms the Transfer section lists one
15// txlink row per known client (pre-filling clientID).
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 println(transfer.Render(""))
28}
29
30// Output:
31// # IBC transfer
32//
33// ICS-20 style transfer state and voucher token queries.
34//
35// ## Transfer
36//
37// Trigger an IBC transfer from your wallet. Pick the client of the destination chain:
38//
39// - [send via `07-tendermint-1`](/r/aib/main$help&func=Transfer&amount=&clientID=07-tendermint-1&denom=&memo=&receiver=&timeoutTimestamp=1234571490) ([client details](/r/aib/ibc/core:clients/07-tendermint-1))
40//
41// ## Vouchers (0)
42//
43// No vouchers yet.
44//
45// ## Escrow (0)
46//
47// No escrow yet.
48//
49// ## JSON endpoints
50//
51// - [`denoms`](/r/aib/ibc/apps/transfer:denoms): list known IBC denoms (`?page`, `?limit`)
52// - `denoms/ibc/{hash}`: get metadata for an IBC denom
53// - `total_escrow/{denom}`: get total escrow tracked for a base denom
54// - [`vouchers`](/r/aib/ibc/apps/transfer:vouchers): list voucher tokens (`?page`, `?limit`)
55// - `voucher/ibc/{hash}`: get voucher token metadata
56// - `voucher/ibc/{hash}/balance/{addr}`: get a voucher balance for an address