Search Apps Documentation Source Content File Folder Download Copy Actions Download

z9c_recover_client_filetest.gno

0.75 Kb · 26 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
12// RecoverClient failure: substitute client not found.
13func main(cur realm) {
14	core.SetAdmin(cross(cur), "g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm")
15	var (
16		clientState    = tmtesting.NewClientState("chain-id-2", types.NewHeight(2, 2))
17		trustedValset  = tmtesting.GenValset()
18		consensusState = tmtesting.GenConsensusState(time.Now(), tmtesting.Hash("apphash"), trustedValset.Hash())
19	)
20	subjectID := core.CreateClient(cross(cur), clientState, consensusState)
21
22	core.RecoverClient(cross(cur), subjectID, "07-tendermint-99")
23}
24
25// Error:
26// substitute client 07-tendermint-99 not found