diff --git a/e2e/interchaintestv8/go.mod b/e2e/interchaintestv8/go.mod index 93a60d0..1e268a0 100644 --- a/e2e/interchaintestv8/go.mod +++ b/e2e/interchaintestv8/go.mod @@ -261,7 +261,7 @@ require ( sigs.k8s.io/yaml v1.4.0 // indirect ) -replace github.com/cosmos/ibc-go/v8 => github.com/cosmos/ibc-go/v8 v8.0.0-beta.1.0.20240614115135-d9ec0c8c512d +replace github.com/cosmos/ibc-go/v8 => github.com/cosmos/ibc-go/v8 v8.0.0-beta.1.0.20240626084404-83f90bbd2580 replace github.com/strangelove-ventures/interchaintest/v8 => github.com/DimitrisJim/interchaintest/v8 v8.0.0-20240419095404-2c9270423b9a diff --git a/e2e/interchaintestv8/go.sum b/e2e/interchaintestv8/go.sum index ee04b34..d00474a 100644 --- a/e2e/interchaintestv8/go.sum +++ b/e2e/interchaintestv8/go.sum @@ -391,8 +391,8 @@ github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= -github.com/cosmos/ibc-go/v8 v8.0.0-beta.1.0.20240614115135-d9ec0c8c512d h1:V9rWzyEvaqutctkhgDe2YDL8i2m0wrDQQBqb/1DqRNY= -github.com/cosmos/ibc-go/v8 v8.0.0-beta.1.0.20240614115135-d9ec0c8c512d/go.mod h1:1r6hWEhBg9a8bmWA3wtOeWhf86+9JkmXznLOoU0pCrY= +github.com/cosmos/ibc-go/v8 v8.0.0-beta.1.0.20240626084404-83f90bbd2580 h1:CXYlFz54SeXghW2RbhVRz/3zOBtV4AXjomsQlLSLOFM= +github.com/cosmos/ibc-go/v8 v8.0.0-beta.1.0.20240626084404-83f90bbd2580/go.mod h1:1r6hWEhBg9a8bmWA3wtOeWhf86+9JkmXznLOoU0pCrY= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/e2e/interchaintestv8/ibclite_test.go b/e2e/interchaintestv8/ibclite_test.go index f9a32a1..4729a89 100644 --- a/e2e/interchaintestv8/ibclite_test.go +++ b/e2e/interchaintestv8/ibclite_test.go @@ -264,6 +264,13 @@ func (s *IBCLiteTestSuite) TestWasmProofs() { // TODO: Can't finish this test because ibc-go does not have a way to verify proofs in wasm path: // https://github.com/cosmos/ibc-go/issues/6496 + s.Require().True(s.Run("Verify wasm proof", func() { + e2esuite.GRPCQuery[clienttypes.QueryVerifyMembershipResponse](ctx, wasmd, &clienttypes.QueryVerifyMembershipRequest{ + ClientId: ibctesting.FirstClientID, + Proof: proof, + Value: value, + }) + })) } func (s *IBCLiteTestSuite) UpdateClientContract(ctx context.Context, tmContract *ics07tendermint.Contract, counterpartyChain *cosmos.CosmosChain) { diff --git a/e2e/interchaintestv8/ics07tendermint_test.go b/e2e/interchaintestv8/ics07tendermint_test.go index 21d8365..d132ef7 100644 --- a/e2e/interchaintestv8/ics07tendermint_test.go +++ b/e2e/interchaintestv8/ics07tendermint_test.go @@ -12,6 +12,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types" + commitmenttypesv2 "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types/v2" host "github.com/cosmos/ibc-go/v8/modules/core/24-host" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" @@ -172,14 +173,14 @@ func (s *ICS07TendermintTestSuite) TestVerifyMembership() { proofHeight int64 proof []byte value []byte - merklePath commitmenttypes.MerklePath + merklePath commitmenttypesv2.MerklePath ) s.Require().True(s.Run("CreateClientStateProof", func() { s.UpdateClientContract(ctx, s.ics07Tendermint, simd) var err error key := host.FullClientStateKey(ibctesting.FirstClientID) - merklePath = commitmenttypes.NewMerklePath(string(key)) + merklePath = commitmenttypes.NewMerklePath(key) merklePath, err = commitmenttypes.ApplyPrefix(commitmenttypes.NewMerklePrefix([]byte(ibcexported.StoreKey)), merklePath) s.Require().NoError(err) @@ -200,7 +201,7 @@ func (s *ICS07TendermintTestSuite) TestVerifyMembership() { RevisionHeight: int(proofHeight), }, Path: ics07tendermint.MerklePath{ - KeyPath: merklePath.KeyPath, + KeyPath: types.ToLegacyMerklePath(&merklePath).KeyPath, }, Proof: base64.StdEncoding.EncodeToString(proof), Value: base64.StdEncoding.EncodeToString(value), @@ -217,7 +218,7 @@ func (s *ICS07TendermintTestSuite) TestVerifyMembership() { RevisionHeight: int(proofHeight), }, Path: ics07tendermint.MerklePath{ - KeyPath: merklePath.KeyPath, + KeyPath: types.ToLegacyMerklePath(&merklePath).KeyPath, }, Proof: base64.StdEncoding.EncodeToString(proof), Value: base64.StdEncoding.EncodeToString(incorrectValue), diff --git a/e2e/interchaintestv8/types/storekeys.go b/e2e/interchaintestv8/types/storekeys.go index 6b3e799..41166a0 100644 --- a/e2e/interchaintestv8/types/storekeys.go +++ b/e2e/interchaintestv8/types/storekeys.go @@ -7,6 +7,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types" + commitmenttypesv2 "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types/v2" ) /* @@ -23,8 +24,8 @@ func GetBankBalanceKey(address sdk.AccAddress, denom string) ([]byte, error) { return key, nil } -func ConvertToMerklePath(prefix []byte, key []byte) (*commitmenttypes.MerklePath, error) { - merklePath := commitmenttypes.NewMerklePath(string(key)) +func ConvertToMerklePath(prefix []byte, key []byte) (*commitmenttypesv2.MerklePath, error) { + merklePath := commitmenttypes.NewMerklePath(key) merklePrefix := commitmenttypes.NewMerklePrefix(prefix) path, err := commitmenttypes.ApplyPrefix(merklePrefix, merklePath) if err != nil { @@ -33,3 +34,12 @@ func ConvertToMerklePath(prefix []byte, key []byte) (*commitmenttypes.MerklePath return &path, nil } + +func ToLegacyMerklePath(path *commitmenttypesv2.MerklePath) *commitmenttypes.MerklePath { + legacyPath := commitmenttypes.MerklePath{} + for _, key := range path.KeyPath { + legacyPath.KeyPath = append(legacyPath.KeyPath, string(key)) + } + + return &legacyPath +}