Skip to content

Commit

Permalink
Revert address check, which returned a gRPC status code. Also I don't…
Browse files Browse the repository at this point in the history
… think this is necessary, it doesn't save much and this does not cause an error.
  • Loading branch information
Crystal Lemire committed Oct 20, 2023
1 parent 2973c33 commit 3d4c70d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
11 changes: 0 additions & 11 deletions protocol/x/clob/client/cli/query_stateful_orders.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ package cli

import (
"context"
"fmt"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/dydxprotocol/v4-chain/protocol/x/clob/types"
satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types"
"github.com/spf13/cast"
"github.com/spf13/cobra"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

func CmdListStatefulOrders() *cobra.Command {
Expand Down Expand Up @@ -63,13 +59,6 @@ func CmdGetStatefulOrderCount() *cobra.Command {
return err
}

if _, err := sdk.AccAddressFromBech32(argOwner); err != nil {
return status.Error(
codes.InvalidArgument,
fmt.Sprintf("Invalid owner address: %v", err),
)
}

params := &types.QueryStatefulOrderCountRequest{
SubaccountId: &satypes.SubaccountId{
Owner: argOwner,
Expand Down
12 changes: 1 addition & 11 deletions protocol/x/clob/client/cli/query_stateful_orders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
clobcli "github.com/dydxprotocol/v4-chain/protocol/x/clob/client/cli"
"github.com/dydxprotocol/v4-chain/protocol/x/clob/types"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"testing"
)

Expand Down Expand Up @@ -46,19 +44,11 @@ func TestCmdGetStatefulOrderCount(t *testing.T) {
count uint32
expectedErr error
}{
"valid": {
"success": {
owner: constants.AliceAccAddress.String(),
number: 0,
count: 0,
},
"invalid owner": {
owner: "invalid",
number: 0,
expectedErr: status.Error(
codes.InvalidArgument,
"Invalid owner address: decoding bech32 failed: invalid bech32 string length 7",
),
},
} {
t.Run(name, func(t *testing.T) {
args := []string{
Expand Down

0 comments on commit 3d4c70d

Please sign in to comment.