Skip to content

Commit b4416c8

Browse files
committed
lint fix and changes
1 parent 9454a31 commit b4416c8

File tree

5 files changed

+13
-21
lines changed

5 files changed

+13
-21
lines changed

app/keepers/keepers.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,11 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
590590
// register the key tables for legacy param subspaces
591591
keyTable := ibcclienttypes.ParamKeyTable()
592592
keyTable.RegisterParamSet(&ibcconnectiontypes.Params{})
593-
paramsKeeper.Subspace(authtypes.ModuleName).WithKeyTable(authtypes.ParamKeyTable()) //nolint: staticcheck
594-
paramsKeeper.Subspace(stakingtypes.ModuleName).WithKeyTable(stakingtypes.ParamKeyTable()) //nolint: staticcheck // SA1019
595-
paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) //nolint: staticcheck // SA1019
596-
paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable()) //nolint: staticcheck // SA1019
597-
paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) //nolint: staticcheck // SA1019
593+
paramsKeeper.Subspace(authtypes.ModuleName).WithKeyTable(authtypes.ParamKeyTable())
594+
paramsKeeper.Subspace(stakingtypes.ModuleName).WithKeyTable(stakingtypes.ParamKeyTable())
595+
paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) //nolint: staticcheck // SA1019
596+
paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable()) //nolint: staticcheck // SA1019
597+
paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable())
598598
paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) //nolint: staticcheck // SA1019
599599
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint: staticcheck // SA1019
600600
paramsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable)

app/sim/sim_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func SimulationOperations(app *gaia.GaiaApp, cdc codec.JSONCodec, config simtype
3636
}
3737

3838
// TODO: update deprecated code.
39-
simState.LegacyProposalContents = app.SimulationManager().GetProposalContents(simState) //nolint:staticcheck
39+
simState.LegacyProposalContents = app.SimulationManager().GetProposalContents(simState)
4040
simState.ProposalMsgs = app.SimulationManager().GetProposalMsgs(simState)
4141
return app.SimulationManager().WeightedOperations(simState)
4242
}

app/sim_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ func TestAppStateDeterminism(t *testing.T) {
5656
config.InitialBlockHeight = 1
5757
config.ExportParamsPath = ""
5858
// TODO: update deprecated code.
59-
config.OnOperation = false //nolint:staticcheck
60-
config.AllInvariants = false //nolint:staticcheck
59+
config.OnOperation = false
60+
config.AllInvariants = false
6161
config.GenesisTime = time.Now().UTC().Unix()
6262
config.ChainID = AppChainID
6363

cmd/gaiad/cmd/testnet.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bufio"
55
"encoding/json"
66
"fmt"
7-
"math/rand"
87
"net"
98
"os"
109
"path/filepath"
@@ -64,7 +63,6 @@ var (
6463
flagAPIAddress = "api.address"
6564
flagPrintMnemonic = "print-mnemonic"
6665
unsafeStartValidatorFn UnsafeStartValidatorCmdCreator
67-
strChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" // 62 characters
6866
)
6967

7068
type UnsafeStartValidatorCmdCreator func(ac appCreator) *cobra.Command
@@ -166,9 +164,6 @@ Example:
166164
args.keyringBackend, _ = cmd.Flags().GetString(flags.FlagKeyringBackend)
167165
args.chainID, _ = cmd.Flags().GetString(flags.FlagChainID)
168166
args.useDocker, _ = cmd.Flags().GetBool(flagsUseDocker)
169-
if args.chainID == "" {
170-
args.chainID = "localchain"
171-
}
172167
args.minGasPrices, _ = cmd.Flags().GetString(server.FlagMinGasPrices)
173168
args.nodeDirPrefix, _ = cmd.Flags().GetString(flagNodeDirPrefix)
174169
args.nodeDaemonHome, _ = cmd.Flags().GetString(flagNodeDaemonHome)
@@ -240,11 +235,7 @@ func initTestnetFiles(
240235
args initArgs,
241236
) error {
242237
if args.chainID == "" {
243-
chainID := []byte("chain-")
244-
for i := 0; i < 6; i++ {
245-
chainID = append(chainID, strChars[rand.Int()%len(strChars)])
246-
}
247-
args.chainID = string(chainID)
238+
args.chainID = "localchain"
248239
}
249240
nodeIDs := make([]string, args.numValidators)
250241
valPubKeys := make([]cryptotypes.PubKey, args.numValidators)
@@ -256,15 +247,15 @@ func initTestnetFiles(
256247
serverCfg.Telemetry.PrometheusRetentionTime = 60
257248
serverCfg.Telemetry.EnableHostnameLabel = false
258249
serverCfg.Telemetry.GlobalLabels = [][]string{{"chain_id", args.chainID}}
259-
telConfig := telemetry.LocalOtelConfig
250+
otelConfig := telemetry.LocalOtelConfig
260251
if args.useDocker {
261252
// if useDocker, we need to use the docker networking. localhost is troublesome in the setup.
262-
telConfig.CollectorEndpoint = "host.docker.internal:4318"
253+
otelConfig.CollectorEndpoint = "host.docker.internal:4318"
263254
}
264255
gaiaCfg := gaia.AppConfig{
265256
Config: *serverCfg,
266257
Wasm: wasmtypes.NodeConfig{},
267-
OpenTelemetry: telConfig,
258+
OpenTelemetry: otelConfig,
268259
}
269260

270261
var (

telemetry/otel.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func (o *OtelClient) StartExporter(logger log.Logger) error {
8888
"Authorization": "Basic " + formatBasicAuth(cfg.User, cfg.Token),
8989
}))
9090
} else if strings.HasPrefix(cfg.CollectorEndpoint, "localhost") || strings.HasPrefix(cfg.CollectorEndpoint, "host.docker.internal") {
91+
// host.docker.internal is the endpoint for docker containers to communicate with the host computer.
9192
opts = append(opts, otlpmetrichttp.WithInsecure())
9293
}
9394

0 commit comments

Comments
 (0)