chore: gofumpt (#11839)
* fumpt using main not master... * be more descriptive * fumpt * fix nits Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
Julien Robert
parent
bc2d553f77
commit
55054282d2
@@ -3,10 +3,11 @@ package cmd_test
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/crypto/hd"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"testing"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -96,7 +97,8 @@ func TestAddGenesisAccountCmd(t *testing.T) {
|
||||
cmd.SetArgs([]string{
|
||||
tc.addr,
|
||||
tc.denom,
|
||||
fmt.Sprintf("--%s=home", flags.FlagHome)})
|
||||
fmt.Sprintf("--%s=home", flags.FlagHome),
|
||||
})
|
||||
|
||||
if tc.expectErr {
|
||||
require.Error(t, cmd.ExecuteContext(ctx))
|
||||
|
||||
@@ -297,9 +297,8 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a
|
||||
// appExport creates a new simapp (optionally at a given height)
|
||||
// and exports state.
|
||||
func (a appCreator) appExport(
|
||||
logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string,
|
||||
appOpts servertypes.AppOptions) (servertypes.ExportedApp, error) {
|
||||
|
||||
logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, appOpts servertypes.AppOptions,
|
||||
) (servertypes.ExportedApp, error) {
|
||||
var simApp *simapp.SimApp
|
||||
homePath, ok := appOpts.Get(flags.FlagHome).(string)
|
||||
if !ok || homePath == "" {
|
||||
|
||||
@@ -137,7 +137,6 @@ Example:
|
||||
args.algo, _ = cmd.Flags().GetString(flags.FlagKeyAlgorithm)
|
||||
|
||||
return initTestnetFiles(clientCtx, cmd, config, mbm, genBalIterator, args)
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
@@ -163,7 +162,6 @@ Example:
|
||||
simd testnet --v 4 --output-dir ./.testnets
|
||||
`,
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
|
||||
args := startArgs{}
|
||||
args.outputDir, _ = cmd.Flags().GetString(flagOutputDir)
|
||||
args.chainID, _ = cmd.Flags().GetString(flags.FlagChainID)
|
||||
@@ -177,7 +175,6 @@ Example:
|
||||
args.printMnemonic, _ = cmd.Flags().GetBool(flagPrintMnemonic)
|
||||
|
||||
return startTestnet(cmd, args)
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
@@ -190,7 +187,7 @@ Example:
|
||||
return cmd
|
||||
}
|
||||
|
||||
const nodeDirPerm = 0755
|
||||
const nodeDirPerm = 0o755
|
||||
|
||||
// initTestnetFiles initializes testnet files for a testnet to be run in a separate process
|
||||
func initTestnetFiles(
|
||||
@@ -356,7 +353,6 @@ func initGenFiles(
|
||||
genAccounts []authtypes.GenesisAccount, genBalances []banktypes.Balance,
|
||||
genFiles []string, numValidators int,
|
||||
) error {
|
||||
|
||||
appGenState := mbm.DefaultGenesis(clientCtx.Codec)
|
||||
|
||||
// set the accounts in the genesis state
|
||||
@@ -406,7 +402,6 @@ func collectGenFiles(
|
||||
nodeIDs []string, valPubKeys []cryptotypes.PubKey, numValidators int,
|
||||
outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator,
|
||||
) error {
|
||||
|
||||
var appState json.RawMessage
|
||||
genTime := tmtime.Now()
|
||||
|
||||
@@ -475,12 +470,12 @@ func writeFile(name string, dir string, contents []byte) error {
|
||||
writePath := filepath.Join(dir)
|
||||
file := filepath.Join(writePath, name)
|
||||
|
||||
err := tmos.EnsureDir(writePath, 0755)
|
||||
err := tmos.EnsureDir(writePath, 0o755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(file, contents, 0644) // nolint: gosec
|
||||
err = ioutil.WriteFile(file, contents, 0o644) // nolint: gosec
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user