From 84b136b876bd8d249da2311a92bf177d3e52da91 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Mon, 20 Nov 2023 22:37:54 +0900 Subject: [PATCH] chore: fix typos --- client/keys/add.go | 2 +- client/query.go | 8 ++++---- client/rpc/status.go | 6 +++--- client/tx/legacy_test.go | 8 ++++---- server/config/toml.go | 6 +++--- server/start.go | 18 +++++++++--------- server/tm_cmds.go | 4 ++-- simapp/simd/cmd/testnet.go | 6 +++--- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/client/keys/add.go b/client/keys/add.go index 059d544c36..5b14ea8fd7 100644 --- a/client/keys/add.go +++ b/client/keys/add.go @@ -251,7 +251,7 @@ func runAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf } if len(mnemonic) == 0 { - // read entropy seed straight from occrypto.Rand and convert to mnemonic + // read entropy seed straight from tmcrypto.Rand and convert to mnemonic entropySeed, err := bip39.NewEntropy(mnemonicEntropySize) if err != nil { return err diff --git a/client/query.go b/client/query.go index bf7751eeac..b37960df74 100644 --- a/client/query.go +++ b/client/query.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" abci "github.com/tendermint/tendermint/abci/types" - tmbyptes "github.com/tendermint/tendermint/libs/bytes" + tmbytes "github.com/tendermint/tendermint/libs/bytes" rpcclient "github.com/tendermint/tendermint/rpc/client" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -44,7 +44,7 @@ func (ctx Context) QueryWithData(path string, data []byte) ([]byte, int64, error // QueryStore performs a query to a Tendermint node with the provided key and // store name. It returns the result and height of the query upon success // or an error if the query fails. -func (ctx Context) QueryStore(key tmbyptes.HexBytes, storeName string) ([]byte, int64, error) { +func (ctx Context) QueryStore(key tmbytes.HexBytes, storeName string) ([]byte, int64, error) { return ctx.queryStore(key, storeName, "key") } @@ -123,7 +123,7 @@ func sdkErrorToGRPCError(resp abci.ResponseQuery) error { // query performs a query to a Tendermint node with the provided store name // and path. It returns the result and height of the query upon success // or an error if the query fails. -func (ctx Context) query(path string, key tmbyptes.HexBytes) ([]byte, int64, error) { +func (ctx Context) query(path string, key tmbytes.HexBytes) ([]byte, int64, error) { resp, err := ctx.queryABCI(abci.RequestQuery{ Path: path, Data: key, @@ -139,7 +139,7 @@ func (ctx Context) query(path string, key tmbyptes.HexBytes) ([]byte, int64, err // queryStore performs a query to a Tendermint node with the provided a store // name and path. It returns the result and height of the query upon success // or an error if the query fails. -func (ctx Context) queryStore(key tmbyptes.HexBytes, storeName, endPath string) ([]byte, int64, error) { +func (ctx Context) queryStore(key tmbytes.HexBytes, storeName, endPath string) ([]byte, int64, error) { path := fmt.Sprintf("/store/%s/%s", storeName, endPath) return ctx.query(path, key) } diff --git a/client/rpc/status.go b/client/rpc/status.go index 48f84ee7e6..5fa4d5b527 100644 --- a/client/rpc/status.go +++ b/client/rpc/status.go @@ -14,7 +14,7 @@ import ( cryptotypes "github.com/Finschia/finschia-sdk/crypto/types" ) -// ValidatorInfo is info about the node's validator, same as tendermint, +// ValidatorInfo is info about the node's validator, same as Tendermint, // except that we use our own PubKey. type validatorInfo struct { Address bytes.HexBytes @@ -22,7 +22,7 @@ type validatorInfo struct { VotingPower int64 } -// ResultStatus is node's info, same as tendermint, except that we use our own +// ResultStatus is node's info, same as Tendermint, except that we use our own // PubKey. type resultStatus struct { NodeInfo p2p.DefaultNodeInfo @@ -46,7 +46,7 @@ func StatusCommand() *cobra.Command { return err } - // `status` has OC pubkeys, we need to convert them to our pubkeys. + // `status` has TM pubkeys, we need to convert them to our pubkeys. pk, err := cryptocodec.FromTmPubKeyInterface(status.ValidatorInfo.PubKey) if err != nil { return err diff --git a/client/tx/legacy_test.go b/client/tx/legacy_test.go index 333fb8c193..f804b66e48 100644 --- a/client/tx/legacy_test.go +++ b/client/tx/legacy_test.go @@ -12,7 +12,7 @@ import ( "github.com/Finschia/finschia-sdk/simapp" "github.com/Finschia/finschia-sdk/simapp/params" "github.com/Finschia/finschia-sdk/testutil/testdata" - sdk "github.com/Finschia/finschia-sdk/types" + "github.com/Finschia/finschia-sdk/types" signing2 "github.com/Finschia/finschia-sdk/types/tx/signing" "github.com/Finschia/finschia-sdk/x/auth/legacy/legacytx" "github.com/Finschia/finschia-sdk/x/auth/tx" @@ -26,7 +26,7 @@ const ( ) var ( - fee = sdk.NewCoins(sdk.NewInt64Coin("bam", 100)) + fee = types.NewCoins(types.NewInt64Coin("bam", 100)) _, pub1, addr1 = testdata.KeyTestPubAddr() _, _, addr2 = testdata.KeyTestPubAddr() sig = signing2.SignatureV2{ @@ -36,8 +36,8 @@ var ( Signature: []byte("dummy"), }, } - msg0 = banktypes.NewMsgSend(addr1, addr2, sdk.NewCoins(sdk.NewInt64Coin("wack", 1))) - msg1 = banktypes.NewMsgSend(addr1, addr2, sdk.NewCoins(sdk.NewInt64Coin("wack", 2))) + msg0 = banktypes.NewMsgSend(addr1, addr2, types.NewCoins(types.NewInt64Coin("wack", 1))) + msg1 = banktypes.NewMsgSend(addr1, addr2, types.NewCoins(types.NewInt64Coin("wack", 2))) ) func buildTestTx(t *testing.T, builder client.TxBuilder) { diff --git a/server/config/toml.go b/server/config/toml.go index c4e4b11b97..ff05e58eca 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -139,13 +139,13 @@ address = "{{ .API.Address }}" # MaxOpenConnections defines the number of maximum open connections. max-open-connections = {{ .API.MaxOpenConnections }} -# RPCReadTimeout defines the tendermint RPC read timeout (in seconds). +# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds). rpc-read-timeout = {{ .API.RPCReadTimeout }} -# RPCWriteTimeout defines the tendermint RPC write timeout (in seconds). +# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). rpc-write-timeout = {{ .API.RPCWriteTimeout }} -# RPCMaxBodyBytes defines the tendermint maximum response body (in bytes). +# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). rpc-max-body-bytes = {{ .API.RPCMaxBodyBytes }} # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). diff --git a/server/start.go b/server/start.go index 84b6889ec7..8313fe41ee 100644 --- a/server/start.go +++ b/server/start.go @@ -292,7 +292,7 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App genDocProvider := node.DefaultGenesisDocProviderFunc(cfg) var ( - ocNode *node.Node + tmNode *node.Node gRPCOnly = ctx.Viper.GetBool(flagGRPCOnly) ) @@ -304,7 +304,7 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App pv := genPvFileOnlyWhenKmsAddressEmpty(cfg) - ocNode, err = node.NewNode( + tmNode, err = node.NewNode( cfg, pv, nodeKey, @@ -317,18 +317,18 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App if err != nil { return err } - ctx.Logger.Debug("initialization: ocNode created") - if err := ocNode.Start(); err != nil { + ctx.Logger.Debug("initialization: tmNode created") + if err := tmNode.Start(); err != nil { return err } - ctx.Logger.Debug("initialization: ocNode started") + ctx.Logger.Debug("initialization: tmNode started") } // Add the tx service to the gRPC router. We only need to register this // service if API or gRPC is enabled, and avoid doing so in the general // case, because it spawns a new local tendermint RPC client. - if (config.API.Enable || config.GRPC.Enable) && ocNode != nil { - clientCtx = clientCtx.WithClient(local.New(ocNode)) + if (config.API.Enable || config.GRPC.Enable) && tmNode != nil { + clientCtx = clientCtx.WithClient(local.New(tmNode)) app.RegisterTxService(clientCtx) app.RegisterTendermintService(clientCtx) @@ -443,8 +443,8 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App } defer func() { - if ocNode.IsRunning() { - _ = ocNode.Stop() + if tmNode.IsRunning() { + _ = tmNode.Stop() } if cpuProfileCleanup != nil { diff --git a/server/tm_cmds.go b/server/tm_cmds.go index 15162d09c5..e05b52e4ab 100644 --- a/server/tm_cmds.go +++ b/server/tm_cmds.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" cfg "github.com/tendermint/tendermint/config" tmjson "github.com/tendermint/tendermint/libs/json" - ostos "github.com/tendermint/tendermint/libs/os" + tmos "github.com/tendermint/tendermint/libs/os" "github.com/tendermint/tendermint/node" "github.com/tendermint/tendermint/p2p" pvm "github.com/tendermint/tendermint/privval" @@ -72,7 +72,7 @@ func showValidator(_ *cobra.Command, config *cfg.Config) error { // } //} else { keyFilePath := config.PrivValidatorKeyFile() - if !ostos.FileExists(keyFilePath) { + if !tmos.FileExists(keyFilePath) { return fmt.Errorf("private validator file %s does not exist", keyFilePath) } pv = pvm.LoadFilePV(keyFilePath, config.PrivValidatorStateFile()) diff --git a/simapp/simd/cmd/testnet.go b/simapp/simd/cmd/testnet.go index 1e510c8b91..3b4bc0cc2b 100644 --- a/simapp/simd/cmd/testnet.go +++ b/simapp/simd/cmd/testnet.go @@ -12,7 +12,7 @@ import ( "github.com/spf13/cobra" tmconfig "github.com/tendermint/tendermint/config" - ostos "github.com/tendermint/tendermint/libs/os" + tmos "github.com/tendermint/tendermint/libs/os" tmrand "github.com/tendermint/tendermint/libs/rand" "github.com/tendermint/tendermint/types" tmtime "github.com/tendermint/tendermint/types/time" @@ -387,12 +387,12 @@ func writeFile(name, dir string, contents []byte) error { writePath := filepath.Join(dir) //nolint:gocritic file := filepath.Join(writePath, name) - err := ostos.EnsureDir(writePath, 0o755) + err := tmos.EnsureDir(writePath, 0o755) if err != nil { return err } - err = ostos.WriteFile(file, contents, 0o644) + err = tmos.WriteFile(file, contents, 0o644) if err != nil { return err }