Search Apps Documentation Source Content File Folder Download Copy Actions Download

z0a_render_home_filetest.gno

2.63 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	"gno.land/r/aib/ibc/core"
10)
11
12func main(cur realm) {
13	var (
14		chainID        = "chain-id-2"
15		clientState    = tmtesting.NewClientState(chainID, types.NewHeight(2, 2))
16		apphash        = tmtesting.Hash("apphash")
17		trustedValset  = tmtesting.GenValset()
18		consensusState = tmtesting.GenConsensusState(time.Now(), apphash, trustedValset.Hash())
19	)
20	core.CreateClient(cross(cur), clientState, consensusState)
21
22	println(core.Render(""))
23}
24
25// Output:
26// # IBC core
27//
28// IBC v2 core state and query endpoints.
29//
30// ## Clients (1)
31//
32// | Client | St. | Creator | Cpty | Height | CS | Seq | Cmts | Rcpts | Acks |
33// |--------|-----|---------|------|--------|----|-----|------|-------|------|
34// | [`07-tendermint-1`](/r/aib/ibc/core:clients/07-tendermint-1) | [Active](/r/aib/ibc/core:clients/07-tendermint-1/status) | [g1wymu…yrsm](/u/g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm) |  | [2/2](/r/aib/ibc/core:clients/07-tendermint-1/consensus_states/2/2) | [1](/r/aib/ibc/core:clients/07-tendermint-1/consensus_states) | [1](/r/aib/ibc/core:clients/07-tendermint-1/next_sequence_send) | [0](/r/aib/ibc/core:clients/07-tendermint-1/packet_commitments) | [0](/r/aib/ibc/core:clients/07-tendermint-1/packet_receipts) | [0](/r/aib/ibc/core:clients/07-tendermint-1/packet_acknowledgements) |
35//
36// ## Apps (0)
37//
38// No apps registered yet.
39//
40// ## JSON endpoints
41//
42// - [`admin`](/r/aib/ibc/core:admin): admin and relayers
43// - [`apps`](/r/aib/ibc/core:apps): list registered IBC applications
44// - [`clients`](/r/aib/ibc/core:clients): list clients (`?page`, `?limit`)
45// - `clients/{id}`: get client details
46// - `clients/{id}/status`: get client status
47// - `clients/{id}/consensus_states`: list client consensus states (`?page`, `?limit`)
48// - `clients/{id}/consensus_states/{revision_number}/{revision_height}`: get a consensus state by height
49// - `clients/{id}/next_sequence_send`: get the next packet sequence to send
50// - `clients/{id}/packet_commitments`: list packet commitments (`?page`, `?limit`)
51// - `clients/{id}/packet_commitments/{sequence}`: get a packet commitment by sequence
52// - `clients/{id}/packet_receipts`: list packet receipts (`?page`, `?limit`)
53// - `clients/{id}/packet_receipts/{sequence}`: get a packet receipt by sequence
54// - `clients/{id}/packet_acknowledgements`: list packet acknowledgements (`?page`, `?limit`)
55// - `clients/{id}/packet_acknowledgements/{sequence}`: get a packet acknowledgement by sequence
56// - `clients/{id}/unreceived_packets?sequences=1,2,3`: return sequences without a local packet receipt