// 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/p/aib/ics23" "gno.land/r/aib/ibc/core" ) // RecvPacket fails invalid proof func main(cur realm) { var ( chainID = "chain-id-2" trustedHeight = types.NewHeight(2, 2) clientState = tmtesting.NewClientState(chainID, trustedHeight) apphash = tmtesting.Hash("apphash") trustedValset = tmtesting.GenValset() consensusState = tmtesting.GenConsensusState(time.Now(), apphash, trustedValset.Hash()) counterpartyID = "07-tendermint-42" ) clientID := core.CreateClient(cross(cur), clientState, consensusState) core.RegisterCounterparty(cross(cur), clientID, [][]byte{[]byte("iavlStoreKey"), []byte("prefix2")}, counterpartyID) // Receive the packet recvPacket := types.MsgRecvPacket{ Packet: types.Packet{ Sequence: 1, SourceClient: counterpartyID, DestinationClient: clientID, TimeoutTimestamp: uint64(time.Now().Add(time.Hour).Unix()), Payloads: []types.Payload{{ SourcePort: "appID", DestinationPort: "destinationPort", Encoding: "application/json", Value: []byte("{}"), Version: "v1", }}, }, ProofCommitment: []ics23.CommitmentProof{ ics23.CommitmentProof_Exist{ Exist: &ics23.ExistenceProof{}, }, ics23.CommitmentProof_Exist{ Exist: &ics23.ExistenceProof{}, }, }, ProofHeight: trustedHeight, } core.RecvPacket(cross(cur), recvPacket) } // Error: // failed packet commitment verification for client (07-tendermint-1): could not calculate proof root at index 0, merkle tree may be empty. existence Proof needs defined LeafOp