style: gofumpt everything (#15518)
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package autocli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/depinject"
|
||||
"fmt"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
@@ -3,6 +3,9 @@ package autocli
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
reflectionv2alpha1 "cosmossdk.io/api/cosmos/base/reflection/v2alpha1"
|
||||
"cosmossdk.io/client/v2/autocli/flag"
|
||||
"cosmossdk.io/client/v2/internal/testpb"
|
||||
@@ -12,8 +15,6 @@ import (
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func testExecCommon(t *testing.T, buildModuleCommand func(string, *Builder) (*cobra.Command, error), args ...string) *testClientConn {
|
||||
@@ -46,7 +47,6 @@ func testExecCommon(t *testing.T, buildModuleCommand func(string, *Builder) (*co
|
||||
}
|
||||
b := &Builder{
|
||||
Builder: flag.Builder{
|
||||
|
||||
GetClientConn: func() (grpc.ClientConnInterface, error) {
|
||||
return conn, nil
|
||||
}},
|
||||
|
||||
@@ -2,6 +2,7 @@ package flag
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
reflectionv2alpha1 "cosmossdk.io/api/cosmos/base/reflection/v2alpha1"
|
||||
"github.com/cosmos/cosmos-sdk/types"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
@@ -10,7 +11,6 @@ import (
|
||||
type addressStringType struct{}
|
||||
|
||||
func (a addressStringType) NewValue(ctx context.Context, b *Builder) Value {
|
||||
|
||||
if b.AddressPrefix == "" {
|
||||
conn, err := b.GetClientConn()
|
||||
if err != nil {
|
||||
|
||||
@@ -40,7 +40,6 @@ func (b *Builder) init() {
|
||||
b.scalarFlagTypes = map[string]Type{}
|
||||
b.scalarFlagTypes["cosmos.AddressString"] = addressStringType{}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (b *Builder) DefineMessageFlagType(messageName protoreflect.FullName, flagType Type) {
|
||||
|
||||
@@ -73,7 +73,6 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc
|
||||
// validate that methods exist
|
||||
if m := methods.ByName(methodName); m == nil {
|
||||
return fmt.Errorf("rpc method %q not found for service %q", methodName, service.FullName())
|
||||
|
||||
}
|
||||
rpcOptMap[methodName] = option
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@ package autocli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
|
||||
"gotest.tools/v3/golden"
|
||||
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
@@ -127,7 +128,6 @@ func TestMsgOutputFormat(t *testing.T) {
|
||||
)
|
||||
|
||||
assert.Assert(t, strings.Contains(conn.out.String(), "positional1: 5"))
|
||||
|
||||
}
|
||||
|
||||
func TestMsgOptionsError(t *testing.T) {
|
||||
@@ -145,7 +145,6 @@ func TestMsgOptionsError(t *testing.T) {
|
||||
"--u64", "abc",
|
||||
)
|
||||
assert.Assert(t, strings.Contains(conn.errorOut.String(), "invalid argument "))
|
||||
|
||||
}
|
||||
|
||||
func TestDeprecatedMsg(t *testing.T) {
|
||||
@@ -325,7 +324,6 @@ func TestNotFoundErrorsMsg(t *testing.T) {
|
||||
},
|
||||
})
|
||||
assert.ErrorContains(t, err, "can't find field un-existent-flag")
|
||||
|
||||
}
|
||||
|
||||
func TestEnhanceMessageCommand(t *testing.T) {
|
||||
@@ -368,7 +366,6 @@ func TestEnhanceMessageCommand(t *testing.T) {
|
||||
customCommands = map[string]*cobra.Command{}
|
||||
err = b.enhanceCommandCommon(cmd, options, customCommands, enhanceMsg)
|
||||
assert.NilError(t, err)
|
||||
|
||||
}
|
||||
|
||||
type testMessageServer struct {
|
||||
|
||||
@@ -18,7 +18,6 @@ import (
|
||||
)
|
||||
|
||||
var buildModuleQueryCommand = func(moduleName string, b *Builder) (*cobra.Command, error) {
|
||||
|
||||
cmd := topLevelCmd(moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName))
|
||||
|
||||
err := b.AddQueryServiceCommands(cmd, testCmdDesc)
|
||||
@@ -194,7 +193,6 @@ func TestOutputFormat(t *testing.T) {
|
||||
)
|
||||
fmt.Println(conn.out.String())
|
||||
assert.Assert(t, strings.Contains(conn.out.String(), " positional1: 1"))
|
||||
|
||||
}
|
||||
|
||||
func TestHelp(t *testing.T) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package autocli
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"strings"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"cosmossdk.io/client/v2/internal/strcase"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user