diff --git a/modules/apps/29-fee/keeper/grpc_query_test.go b/modules/apps/29-fee/keeper/grpc_query_test.go index fdededc0b37..abec15426d4 100644 --- a/modules/apps/29-fee/keeper/grpc_query_test.go +++ b/modules/apps/29-fee/keeper/grpc_query_test.go @@ -66,7 +66,8 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPackets() { tc.malleate() // malleate mutates test data ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.IncentivizedPackets(ctx, req) + + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.IncentivizedPackets(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -125,7 +126,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacket() { tc.malleate() // malleate mutates test data ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.IncentivizedPacket(ctx, req) + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.IncentivizedPacket(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -219,7 +220,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketsForChannel() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.IncentivizedPacketsForChannel(ctx, req) + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.IncentivizedPacketsForChannel(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -275,7 +276,7 @@ func (suite *KeeperTestSuite) TestQueryTotalRecvFees() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.TotalRecvFees(ctx, req) + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.TotalRecvFees(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -334,7 +335,7 @@ func (suite *KeeperTestSuite) TestQueryTotalAckFees() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.TotalAckFees(ctx, req) + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.TotalAckFees(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -393,7 +394,7 @@ func (suite *KeeperTestSuite) TestQueryTotalTimeoutFees() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.TotalTimeoutFees(ctx, req) + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.TotalTimeoutFees(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -460,7 +461,7 @@ func (suite *KeeperTestSuite) TestQueryPayee() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.Payee(ctx, req) + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.Payee(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -523,7 +524,7 @@ func (suite *KeeperTestSuite) TestQueryCounterpartyPayee() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.CounterpartyPayee(ctx, req) + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.CounterpartyPayee(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -630,7 +631,7 @@ func (suite *KeeperTestSuite) TestQueryFeeEnabledChannels() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.FeeEnabledChannels(ctx, req) + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.FeeEnabledChannels(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -679,7 +680,7 @@ func (suite *KeeperTestSuite) TestQueryFeeEnabledChannel() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.FeeEnabledChannel(ctx, req) + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.FeeEnabledChannel(ctx, req) if tc.expPass { suite.Require().NoError(err) diff --git a/modules/apps/29-fee/keeper/keeper_test.go b/modules/apps/29-fee/keeper/keeper_test.go index 89dfcd7a30e..26a573042b7 100644 --- a/modules/apps/29-fee/keeper/keeper_test.go +++ b/modules/apps/29-fee/keeper/keeper_test.go @@ -4,7 +4,6 @@ import ( "fmt" "testing" - "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" @@ -33,8 +32,6 @@ type KeeperTestSuite struct { path *ibctesting.Path pathAToC *ibctesting.Path - - queryClient types.QueryClient } func (suite *KeeperTestSuite) SetupTest() { @@ -57,10 +54,6 @@ func (suite *KeeperTestSuite) SetupTest() { path.EndpointA.ChannelConfig.PortID = ibctesting.MockFeePort path.EndpointB.ChannelConfig.PortID = ibctesting.MockFeePort suite.pathAToC = path - - queryHelper := baseapp.NewQueryServerTestHelper(suite.chainA.GetContext(), suite.chainA.GetSimApp().InterfaceRegistry()) - types.RegisterQueryServer(queryHelper, suite.chainA.GetSimApp().IBCFeeKeeper) - suite.queryClient = types.NewQueryClient(queryHelper) } func TestKeeperTestSuite(t *testing.T) { diff --git a/modules/apps/transfer/keeper/grpc_query_test.go b/modules/apps/transfer/keeper/grpc_query_test.go index ffb4833d25e..cabea73824e 100644 --- a/modules/apps/transfer/keeper/grpc_query_test.go +++ b/modules/apps/transfer/keeper/grpc_query_test.go @@ -76,7 +76,7 @@ func (suite *KeeperTestSuite) TestQueryDenomTrace() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.DenomTrace(ctx, req) + res, err := suite.chainA.GetSimApp().TransferKeeper.DenomTrace(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -92,7 +92,7 @@ func (suite *KeeperTestSuite) TestQueryDenomTrace() { func (suite *KeeperTestSuite) TestQueryDenomTraces() { var ( req *types.QueryDenomTracesRequest - expTraces = types.Traces(nil) + expTraces = types.Traces{} ) testCases := []struct { @@ -136,7 +136,7 @@ func (suite *KeeperTestSuite) TestQueryDenomTraces() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.DenomTraces(ctx, req) + res, err := suite.chainA.GetSimApp().TransferKeeper.DenomTraces(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -152,7 +152,7 @@ func (suite *KeeperTestSuite) TestQueryDenomTraces() { func (suite *KeeperTestSuite) TestQueryParams() { ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) expParams := types.DefaultParams() - res, _ := suite.queryClient.Params(ctx, &types.QueryParamsRequest{}) + res, _ := suite.chainA.GetSimApp().TransferKeeper.Params(ctx, &types.QueryParamsRequest{}) suite.Require().Equal(&expParams, res.Params) } @@ -209,7 +209,7 @@ func (suite *KeeperTestSuite) TestQueryDenomHash() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.DenomHash(ctx, req) + res, err := suite.chainA.GetSimApp().TransferKeeper.DenomHash(ctx, req) if tc.expPass { suite.Require().NoError(err) @@ -249,7 +249,7 @@ func (suite *KeeperTestSuite) TestEscrowAddress() { tc.malleate() ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.EscrowAddress(ctx, req) + res, err := suite.chainA.GetSimApp().TransferKeeper.EscrowAddress(ctx, req) if tc.expPass { suite.Require().NoError(err) diff --git a/modules/apps/transfer/keeper/keeper_test.go b/modules/apps/transfer/keeper/keeper_test.go index 6e56dbbd4bc..0d2e9cf9a4d 100644 --- a/modules/apps/transfer/keeper/keeper_test.go +++ b/modules/apps/transfer/keeper/keeper_test.go @@ -19,8 +19,6 @@ type KeeperTestSuite struct { chainA *ibctesting.TestChain chainB *ibctesting.TestChain chainC *ibctesting.TestChain - - queryClient types.QueryClient } func (suite *KeeperTestSuite) SetupTest() { @@ -31,7 +29,6 @@ func (suite *KeeperTestSuite) SetupTest() { queryHelper := baseapp.NewQueryServerTestHelper(suite.chainA.GetContext(), suite.chainA.GetSimApp().InterfaceRegistry()) types.RegisterQueryServer(queryHelper, suite.chainA.GetSimApp().TransferKeeper) - suite.queryClient = types.NewQueryClient(queryHelper) } func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { diff --git a/modules/core/02-client/keeper/grpc_query_test.go b/modules/core/02-client/keeper/grpc_query_test.go index 6b48f466aba..636a23aaae5 100644 --- a/modules/core/02-client/keeper/grpc_query_test.go +++ b/modules/core/02-client/keeper/grpc_query_test.go @@ -5,9 +5,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/metadata" "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" "github.com/cosmos/ibc-go/v7/modules/core/exported" @@ -631,10 +629,7 @@ func (suite *KeeperTestSuite) TestQueryUpgradedConsensusStates() { tc.malleate() - ctx := sdk.WrapSDKContext(suite.ctx) - ctx = metadata.AppendToOutgoingContext(ctx, grpctypes.GRPCBlockHeightHeader, fmt.Sprintf("%d", height)) - - res, err := suite.queryClient.UpgradedConsensusState(ctx, req) + res, err := suite.keeper.UpgradedConsensusState(suite.ctx, req) if tc.expPass { suite.Require().NoError(err) suite.Require().True(expConsensusState.Equal(res.UpgradedConsensusState)) diff --git a/modules/core/02-client/keeper/keeper_test.go b/modules/core/02-client/keeper/keeper_test.go index 839ee00553d..ac9d9269322 100644 --- a/modules/core/02-client/keeper/keeper_test.go +++ b/modules/core/02-client/keeper/keeper_test.go @@ -8,13 +8,10 @@ import ( tmbytes "github.com/cometbft/cometbft/libs/bytes" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/suite" - "github.com/cosmos/ibc-go/v7/modules/core/02-client/keeper" "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" @@ -25,6 +22,7 @@ import ( ibctesting "github.com/cosmos/ibc-go/v7/testing" ibctestingmock "github.com/cosmos/ibc-go/v7/testing/mock" "github.com/cosmos/ibc-go/v7/testing/simapp" + "github.com/stretchr/testify/suite" ) const ( @@ -68,9 +66,6 @@ type KeeperTestSuite struct { solomachine *ibctesting.Solomachine signers map[string]tmtypes.PrivValidator - - // TODO: deprecate - queryClient types.QueryClient } func (suite *KeeperTestSuite) SetupTest() { @@ -89,7 +84,6 @@ func (suite *KeeperTestSuite) SetupTest() { suite.ctx = app.BaseApp.NewContext(isCheckTx, tmproto.Header{Height: height, ChainID: testClientID, Time: now2}) suite.keeper = &app.IBCKeeper.ClientKeeper suite.privVal = ibctestingmock.NewPV() - pubKey, err := suite.privVal.GetPubKey() suite.Require().NoError(err) @@ -124,11 +118,6 @@ func (suite *KeeperTestSuite) SetupTest() { } suite.solomachine = ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "solomachinesingle", "testing", 1) - - // TODO: deprecate - queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, app.InterfaceRegistry()) - types.RegisterQueryServer(queryHelper, app.IBCKeeper.ClientKeeper) - suite.queryClient = types.NewQueryClient(queryHelper) } func TestKeeperTestSuite(t *testing.T) {