Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

Commit

Permalink
query test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidterpay committed Nov 27, 2023
1 parent f6c723e commit 0f8c6f8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
21 changes: 21 additions & 0 deletions x/auction/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package keeper_test

import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/skip-mev/block-sdk/x/auction/types"
)

func (s *KeeperTestSuite) TestQueryParams() {
s.Run("can query module params", func() {
params, err := s.auctionkeeper.GetParams(s.ctx)
s.Require().NoError(err)

escrowAddress := sdk.AccAddress(params.EscrowAccountAddress)

res, err := s.queryServer.Params(s.ctx, &types.QueryParamsRequest{})
s.Require().NoError(err)
s.Require().Equal(params, res.Params)
s.Require().Equal(escrowAddress.String(), res.EscrowAddressString)
})
}
5 changes: 4 additions & 1 deletion x/auction/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ type KeeperTestSuite struct {
stakingKeeper *mocks.StakingKeeper
encCfg testutils.EncodingConfig
ctx sdk.Context
msgServer types.MsgServer
key *storetypes.KVStoreKey
authorityAccount sdk.AccAddress

msgServer types.MsgServer
queryServer types.QueryServer
}

func TestKeeperTestSuite(t *testing.T) {
Expand Down Expand Up @@ -61,4 +63,5 @@ func (s *KeeperTestSuite) SetupTest() {
s.Require().NoError(err)

s.msgServer = keeper.NewMsgServerImpl(s.auctionkeeper)
s.queryServer = keeper.NewQueryServer(s.auctionkeeper)
}

0 comments on commit 0f8c6f8

Please sign in to comment.