Skip to content

Commit

Permalink
fix test due to pagination counting total is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao001 committed Oct 30, 2023
1 parent ff24663 commit ea0069c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
10 changes: 3 additions & 7 deletions tests/e2e/bank/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ func (s *E2ETestSuite) TestTotalSupplyGRPCHandler() {
sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens),
sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))),
),
Pagination: &query.PageResponse{
Total: 2,
},
Pagination: &query.PageResponse{},
},
},
{
Expand Down Expand Up @@ -160,7 +158,7 @@ func (s *E2ETestSuite) TestDenomMetadataGRPCHandler() {
Display: "eth",
},
},
Pagination: &query.PageResponse{Total: 2},
Pagination: &query.PageResponse{},
},
},
{
Expand Down Expand Up @@ -244,9 +242,7 @@ func (s *E2ETestSuite) TestBalancesGRPCHandler() {
sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens),
sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Sub(s.cfg.BondedTokens)),
),
Pagination: &query.PageResponse{
Total: 2,
},
Pagination: &query.PageResponse{},
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/bank/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func (s *E2ETestSuite) TestGetCmdQueryDenomsMetadata() {
Display: "eth",
},
},
Pagination: &query.PageResponse{Total: 2},
Pagination: &query.PageResponse{},
},
},
{
Expand Down
4 changes: 1 addition & 3 deletions tests/e2e/slashing/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ func (s *E2ETestSuite) TestGRPCQueries() {
JailedUntil: time.Unix(0, 0),
},
},
Pagination: &query.PageResponse{
Total: uint64(1),
},
Pagination: &query.PageResponse{},
},
},
{
Expand Down
5 changes: 2 additions & 3 deletions tests/e2e/staking/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func (s *E2ETestSuite) TestGRPCQueryDelegatorDelegations() {
DelegationResponses: types.DelegationResponses{
types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)),
},
Pagination: &query.PageResponse{Total: 1},
Pagination: &query.PageResponse{},
},
},
{
Expand All @@ -413,7 +413,7 @@ func (s *E2ETestSuite) TestGRPCQueryDelegatorDelegations() {
&types.QueryDelegatorDelegationsResponse{},
&types.QueryDelegatorDelegationsResponse{
DelegationResponses: types.DelegationResponses{},
Pagination: &query.PageResponse{Total: 0},
Pagination: &query.PageResponse{},
},
},
}
Expand Down Expand Up @@ -592,7 +592,6 @@ func (s *E2ETestSuite) TestGRPCQueryDelegatorValidators() {
} else {
s.Require().NoError(err)
s.Require().Len(validators.Validators, len(s.network.Validators))
s.Require().Equal(int(validators.Pagination.Total), len(s.network.Validators))
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion x/oracle/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func (s *TestSuite) TestKeeper_IsRelayerValid() {
for idx, test := range tests {
s.ctx = s.ctx.WithBlockTime(time.Unix(test.blockTime, 0))
relayer := sdk.MustAccAddressFromHex(test.claimMsg.FromAddress)
isValid, err := s.oracleKeeper.IsRelayerValid(s.ctx, relayer, vals, test.claimMsg.Timestamp)
isValid, err := s.oracleKeeper.IsRelayerValid(s.ctx, relayer, vals, test.claimMsg.Timestamp, types.CLAIM_SRC_CHAIN_BSC)

if test.expectedPass {
s.Require().Nil(err)
Expand Down
28 changes: 28 additions & 0 deletions x/oracle/types/expected_keeper_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ea0069c

Please sign in to comment.