// PKGPATH: gno.land/r/aib/main package main import ( "time" tmtesting "gno.land/p/aib/ibc/lightclient/tendermint/testing" "gno.land/p/aib/ibc/types" "gno.land/r/aib/ibc/core" ) // UpdateClient revision number mismatch func main(cur realm) { // CreateClient and RegisterCounterparty var ( chainID = "chain-id-2" clientState = tmtesting.NewClientState(chainID, types.NewHeight(2, 2)) apphash = tmtesting.Hash("apphash") trustedValset = tmtesting.GenValset() consensusState = tmtesting.GenConsensusState(time.Now(), apphash, trustedValset.Hash()) ) clientID := core.CreateClient(cross(cur), clientState, consensusState) core.RegisterCounterparty(cross(cur), clientID, [][]byte{[]byte("iavlStoreKey"), []byte("prefix2")}, "07-tendermint-2") // Update clientID var ( newHeight = clientState.LatestHeight.RevisionHeight + 1 newTimestamp = consensusState.Timestamp.Add(time.Minute) trustedHeight = clientState.LatestHeight ) // Alter chainID (same revision number) chainID = "other-chain-id-2" msgHeader := tmtesting.GenMsgHeader( chainID, newTimestamp, apphash, newHeight, trustedHeight, trustedValset, trustedValset, trustedValset, ) core.UpdateClient(cross(cur), clientID, msgHeader) } // Error: // header belongs to another chain "other-chain-id-2", not "chain-id-2"