diff --git a/client/v2/autocli/flag/coin.go b/client/v2/autocli/flag/coin.go index 549e15f165e0..c6ec9f363e0a 100644 --- a/client/v2/autocli/flag/coin.go +++ b/client/v2/autocli/flag/coin.go @@ -2,13 +2,13 @@ package flag import ( "context" - "fmt" + "errors" "strings" "google.golang.org/protobuf/reflect/protoreflect" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/core/coins" + "cosmossdk.io/client/v2/internal/coins" ) type coinType struct{} @@ -22,8 +22,7 @@ func (c coinType) NewValue(*context.Context, *Builder) Value { } func (c coinType) DefaultValue() string { - stringCoin, _ := coins.FormatCoins([]*basev1beta1.Coin{}, nil) - return stringCoin + return "zero" } func (c *coinValue) Get(protoreflect.Value) (protoreflect.Value, error) { @@ -43,7 +42,7 @@ func (c *coinValue) String() string { func (c *coinValue) Set(stringValue string) error { if strings.Contains(stringValue, ",") { - return fmt.Errorf("coin flag must be a single coin, specific multiple coins with multiple flags or spaces") + return errors.New("coin flag must be a single coin, specific multiple coins with multiple flags or spaces") } coin, err := coins.ParseCoin(stringValue)