Skip to content

Commit

Permalink
chore: modify error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
zemyblue committed Feb 10, 2023
1 parent 2dfac20 commit 97c936b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion x/auth/tx/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (s txServer) GetTx(ctx context.Context, req *txtypes.GetTxRequest) (*txtype

// GetBlockWithTxs returns a block with decoded txs.
func (s txServer) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockWithTxsRequest) (*txtypes.GetBlockWithTxsResponse, error) {
return nil, status.Error(codes.Unimplemented, "services not supported")
return nil, status.Error(codes.Unimplemented, "service not supported")
}

func (s txServer) BroadcastTx(ctx context.Context, req *txtypes.BroadcastTxRequest) (*txtypes.BroadcastTxResponse, error) {
Expand Down
18 changes: 9 additions & 9 deletions x/auth/tx/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,12 +605,12 @@ func (s IntegrationTestSuite) TestGetBlockWithTxs_GRPC() {
expErrMsg string
}{
{"nil request", nil, true, "request cannot be nil"},
{"empty request", &tx.GetBlockWithTxsRequest{}, true, "services not supported"},
{"bad height", &tx.GetBlockWithTxsRequest{Height: 99999999}, true, "services not supported"},
{"bad pagination", &tx.GetBlockWithTxsRequest{Height: s.txHeight, Pagination: &query.PageRequest{Offset: 1000, Limit: 100}}, true, "services not supported"},
{"good request", &tx.GetBlockWithTxsRequest{Height: s.txHeight}, true, "services not supported"},
{"with pagination request", &tx.GetBlockWithTxsRequest{Height: s.txHeight, Pagination: &query.PageRequest{Offset: 0, Limit: 1}}, true, "services not supported"},
{"page all request", &tx.GetBlockWithTxsRequest{Height: s.txHeight, Pagination: &query.PageRequest{Offset: 0, Limit: 100}}, true, "services not supported"},
{"empty request", &tx.GetBlockWithTxsRequest{}, true, "service not supported"},
{"bad height", &tx.GetBlockWithTxsRequest{Height: 99999999}, true, "service not supported"},
{"bad pagination", &tx.GetBlockWithTxsRequest{Height: s.txHeight, Pagination: &query.PageRequest{Offset: 1000, Limit: 100}}, true, "service not supported"},
{"good request", &tx.GetBlockWithTxsRequest{Height: s.txHeight}, true, "service not supported"},
{"with pagination request", &tx.GetBlockWithTxsRequest{Height: s.txHeight, Pagination: &query.PageRequest{Offset: 0, Limit: 1}}, true, "service not supported"},
{"page all request", &tx.GetBlockWithTxsRequest{Height: s.txHeight, Pagination: &query.PageRequest{Offset: 0, Limit: 100}}, true, "service not supported"},
}
for _, tc := range testCases {
s.Run(tc.name, func() {
Expand Down Expand Up @@ -642,17 +642,17 @@ func (s IntegrationTestSuite) TestGetBlockWithTxs_GRPCGateway() {
{
"empty params",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/block/0", val.APIAddress),
true, "services not supported",
true, "service not supported",
},
{
"bad height",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/block/%d", val.APIAddress, 9999999),
true, "services not supported",
true, "service not supported",
},
{
"good request",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/block/%d", val.APIAddress, s.txHeight),
true, "services not supported",
true, "service not supported",
},
}
for _, tc := range testCases {
Expand Down

0 comments on commit 97c936b

Please sign in to comment.