Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: gofumpt code formatting for v7 #1579

Merged
merged 1 commit into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}

var sigGasConsumer = opts.SigGasConsumer
sigGasConsumer := opts.SigGasConsumer
if sigGasConsumer == nil {
sigGasConsumer = ante.DefaultSigVerificationGasConsumer
}
Expand Down
2 changes: 0 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ func NewGaiaApp(
appOpts servertypes.AppOptions,
baseAppOptions ...func(*baseapp.BaseApp),
) *GaiaApp {

appCodec := encodingConfig.Marshaler
legacyAmino := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry
Expand Down Expand Up @@ -629,7 +628,6 @@ func NewGaiaApp(
app.UpgradeKeeper.SetUpgradeHandler(
upgradeName,
func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {

fromVM[icatypes.ModuleName] = icaModule.ConsensusVersion()
// create ICS27 Controller submodule params
controllerParams := icacontrollertypes.Params{}
Expand Down
2 changes: 0 additions & 2 deletions cmd/gaiad/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ func (ac appCreator) newApp(
traceStore io.Writer,
appOpts servertypes.AppOptions,
) servertypes.Application {

var cache sdk.MultiStorePersistentCache

if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) {
Expand Down Expand Up @@ -245,7 +244,6 @@ func (ac appCreator) appExport(
jailAllowedAddrs []string,
appOpts servertypes.AppOptions,
) (servertypes.ExportedApp, error) {

homePath, ok := appOpts.Get(flags.FlagHome).(string)
if !ok || homePath == "" {
return servertypes.ExportedApp{}, errors.New("application home is not set")
Expand Down
9 changes: 3 additions & 6 deletions cmd/gaiad/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Example:
return cmd
}

const nodeDirPerm = 0755
const nodeDirPerm = 0o755

// Initialize the testnet
func InitTestnet(
Expand All @@ -117,7 +117,6 @@ func InitTestnet(
algoStr string,
numValidators int,
) error {

if chainID == "" {
chainID = "chain-" + tmrand.NewRand().Str(6)
}
Expand Down Expand Up @@ -281,7 +280,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
Expand Down Expand Up @@ -330,7 +328,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()

Expand Down Expand Up @@ -398,12 +395,12 @@ func calculateIP(ip string, i int) (string, error) {
func writeFile(name string, dir string, contents []byte) error {
file := filepath.Join(dir, name)

err := tmos.EnsureDir(dir, 0755)
err := tmos.EnsureDir(dir, 0o755)
if err != nil {
return err
}

err = tmos.WriteFile(file, contents, 0644)
err = tmos.WriteFile(file, contents, 0o644)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (s *IntegrationTestSuite) runIBCRelayer() {
gaiaBVal := s.chainB.validators[0]
hermesCfgPath := path.Join(tmpDir, "hermes")

s.Require().NoError(os.MkdirAll(hermesCfgPath, 0755))
s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755))
_, err = copyFile(
filepath.Join("./scripts/", "hermes_bootstrap.sh"),
filepath.Join(hermesCfgPath, "hermes_bootstrap.sh"),
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ func writeFile(path string, body []byte) error {
return err
}

return ioutil.WriteFile(path, body, 0600)
return ioutil.WriteFile(path, body, 0o600)
}
6 changes: 3 additions & 3 deletions tests/e2e/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (v *validator) configDir() string {

func (v *validator) createConfig() error {
p := path.Join(v.configDir(), "config")
return os.MkdirAll(p, 0755)
return os.MkdirAll(p, 0o755)
}

func (v *validator) init() error {
Expand Down Expand Up @@ -109,12 +109,12 @@ func (v *validator) createConsensusKey() error {
config.Moniker = v.moniker

pvKeyFile := config.PrivValidatorKeyFile()
if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0777); err != nil {
if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0o777); err != nil {
return err
}

pvStateFile := config.PrivValidatorStateFile()
if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0777); err != nil {
if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0o777); err != nil {
return err
}

Expand Down