diff --git a/e2e/tests/core/02-client/client_test.go b/e2e/tests/core/02-client/client_test.go index 889806b632e..cb196a3a726 100644 --- a/e2e/tests/core/02-client/client_test.go +++ b/e2e/tests/core/02-client/client_test.go @@ -336,7 +336,7 @@ func (s *ClientTestSuite) TestClient_Update_Misbehaviour() { trustedHeight clienttypes.Height latestHeight clienttypes.Height clientState ibcexported.ClientState - header testsuite.Header + header *cmtservice.Header signers []cmttypes.PrivValidator validatorSet []*cmttypes.Validator maliciousHeader *ibctm.Header @@ -527,7 +527,7 @@ func (s *ClientTestSuite) extractChainPrivateKeys(ctx context.Context, chain ibc } // createMaliciousTMHeader creates a header with the provided trusted height with an invalid app hash. -func createMaliciousTMHeader(chainID string, blockHeight int64, trustedHeight clienttypes.Height, timestamp time.Time, tmValSet, tmTrustedVals *cmttypes.ValidatorSet, signers []cmttypes.PrivValidator, oldHeader testsuite.Header) (*ibctm.Header, error) { +func createMaliciousTMHeader(chainID string, blockHeight int64, trustedHeight clienttypes.Height, timestamp time.Time, tmValSet, tmTrustedVals *cmttypes.ValidatorSet, signers []cmttypes.PrivValidator, oldHeader *cmtservice.Header) (*ibctm.Header, error) { tmHeader := cmttypes.Header{ Version: cmtprotoversion.Consensus{Block: cmtversion.BlockProtocol, App: 2}, ChainID: chainID, diff --git a/e2e/testsuite/grpc_query.go b/e2e/testsuite/grpc_query.go index 1d9dc8b15ee..87620f86329 100644 --- a/e2e/testsuite/grpc_query.go +++ b/e2e/testsuite/grpc_query.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "sort" - "time" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v8/ibc" @@ -106,13 +105,6 @@ func (s *E2ETestSuite) InitGRPCClients(chain ibc.Chain) { } } -// Header defines an interface which is implemented by both the sdk block header and the cometbft Block Header. -// this interfaces allows us to use the same function to fetch the block header for both chains. -type Header interface { - GetTime() time.Time - GetLastCommitHash() []byte -} - // QueryClientState queries the client state on the given chain for the provided clientID. func (s *E2ETestSuite) QueryClientState(ctx context.Context, chain ibc.Chain, clientID string) (ibcexported.ClientState, error) { queryClient := s.GetChainGRCPClients(chain).ClientQueryClient @@ -351,7 +343,7 @@ func (s *E2ETestSuite) QueryProposalV1(ctx context.Context, chain ibc.Chain, pro } // GetBlockHeaderByHeight fetches the block header at a given height. -func (s *E2ETestSuite) GetBlockHeaderByHeight(ctx context.Context, chain ibc.Chain, height uint64) (Header, error) { +func (s *E2ETestSuite) GetBlockHeaderByHeight(ctx context.Context, chain ibc.Chain, height uint64) (*cmtservice.Header, error) { consensusService := s.GetChainGRCPClients(chain).ConsensusServiceClient res, err := consensusService.GetBlockByHeight(ctx, &cmtservice.GetBlockByHeightRequest{ Height: int64(height), @@ -360,13 +352,7 @@ func (s *E2ETestSuite) GetBlockHeaderByHeight(ctx context.Context, chain ibc.Cha return nil, err } - // Clean up when v4 is not supported, see: https://github.com/cosmos/ibc-go/issues/3540 - // versions newer than 0.46 SDK use the SdkBlock field while versions older - // than 0.46 SDK, which do not have the SdkBlock field, use the Block field. - if res.SdkBlock != nil { - return &res.SdkBlock.Header, nil - } - return &res.Block.Header, nil // needed for v4 (uses SDK v0.45) + return &res.SdkBlock.Header, nil } // GetValidatorSetByHeight returns the validators of the given chain at the specified height. The returned validators