z9d_recover_client_filetest.gno
0.86 Kb · 27 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: subject client is Active (not Frozen or Expired).
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 substituteID := core.CreateClient(cross(cur), clientState, consensusState)
22
23 core.RecoverClient(cross(cur), subjectID, substituteID)
24}
25
26// Error:
27// cannot recover subject client 07-tendermint-1 with status Active