cosmos-sdk/x/epochs/keeper/grpc_query_test.go
Facundo Medica 150ca963f2
feat(x/mint)!: Replace InflationCalculationFn with MintFn + simple epoch minting (#20363)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Marko <marko@baricevic.me>
2024-06-11 12:27:20 +00:00

23 lines
688 B
Go

package keeper_test
import (
"cosmossdk.io/x/epochs/types"
)
func (s *KeeperTestSuite) TestQueryEpochInfos() {
s.SetupTest()
queryClient := s.queryClient
// Check that querying epoch infos on default genesis returns the default genesis epoch infos
epochInfosResponse, err := queryClient.EpochInfos(s.Ctx, &types.QueryEpochsInfoRequest{})
s.Require().NoError(err)
s.Require().Len(epochInfosResponse.Epochs, 4)
expectedEpochs := types.DefaultGenesis().Epochs
for id := range expectedEpochs {
expectedEpochs[id].StartTime = s.Ctx.BlockTime()
expectedEpochs[id].CurrentEpochStartHeight = s.Ctx.BlockHeight()
}
s.Require().Equal(expectedEpochs, epochInfosResponse.Epochs)
}