Skip to content

Commit

Permalink
chore: address review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aleem1314 committed Sep 29, 2021
1 parent 90f9312 commit 5dc114c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion x/ecocredit/client/testsuite/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (s *IntegrationTestSuite) TestQueryBatchInfo() {
name: "malformed batch denom",
args: []string{"abcde"},
expectErr: true,
expectedErrMsg: "denomination didn't match the format",
expectedErrMsg: "invalid denom",
},
{
name: "non-existent credit batch",
Expand Down
7 changes: 4 additions & 3 deletions x/ecocredit/client/testsuite/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package testsuite
import (
"encoding/base64"
"fmt"
"strings"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
Expand All @@ -17,7 +19,6 @@ import (
"github.com/regen-network/regen-ledger/x/ecocredit/client"
"github.com/stretchr/testify/suite"
tmcli "github.com/tendermint/tendermint/libs/cli"
"strings"
)

type IntegrationTestSuite struct {
Expand Down Expand Up @@ -795,7 +796,7 @@ func (s *IntegrationTestSuite) TestTxSend() {
s.commonTxFlags()...,
),
expectErr: true,
expectedErrMsg: "denomination didn't match the format",
expectedErrMsg: "invalid denom",
},
{
name: "invalid tradable amount",
Expand Down Expand Up @@ -946,7 +947,7 @@ func (s *IntegrationTestSuite) TestTxRetire() {
s.commonTxFlags()...,
),
expectErr: true,
expectedErrMsg: "denomination didn't match the format",
expectedErrMsg: "invalid denom",
},
{
name: "invalid amount",
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/denom.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func ValidateClassID(classId string) error {
func ValidateDenom(denom string) error {
matches := reFullBatchDenom.FindStringSubmatch(denom)
if matches == nil {
return ErrParseFailure.Wrapf("denomination didn't match the format: expected A00-00000000-00000000-000, got %s", denom)
return ErrParseFailure.Wrap("invalid denom. Valid denom format is: A00-00000000-00000000-000")
}
return nil
}
2 changes: 1 addition & 1 deletion x/ecocredit/server/testsuite/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (s *IntegrationTestSuite) TestQueryBatchInfo() {
"empty batch denom",
&ecocredit.QueryBatchInfoRequest{},
true,
"denomination didn't match the format",
"invalid denom",
},
{
"batch not found",
Expand Down

0 comments on commit 5dc114c

Please sign in to comment.