Skip to content

Commit

Permalink
chore: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
zemyblue committed Nov 20, 2023
1 parent 8fd88a0 commit 84b136b
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion client/keys/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions client/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {

Check warning on line 47 in client/query.go

View check run for this annotation

Codecov / codecov/patch

client/query.go#L47

Added line #L47 was not covered by tests
return ctx.queryStore(key, storeName, "key")
}

Expand Down Expand Up @@ -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) {

Check warning on line 126 in client/query.go

View check run for this annotation

Codecov / codecov/patch

client/query.go#L126

Added line #L126 was not covered by tests
resp, err := ctx.queryABCI(abci.RequestQuery{
Path: path,
Data: key,
Expand All @@ -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) {

Check warning on line 142 in client/query.go

View check run for this annotation

Codecov / codecov/patch

client/query.go#L142

Added line #L142 was not covered by tests
path := fmt.Sprintf("/store/%s/%s", storeName, endPath)
return ctx.query(path, key)
}
Expand Down
6 changes: 3 additions & 3 deletions client/rpc/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ 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
PubKey cryptotypes.PubKey
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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions client/tx/legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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{
Expand All @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions server/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
18 changes: 9 additions & 9 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)

Expand All @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions server/tm_cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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())
Expand Down
6 changes: 3 additions & 3 deletions simapp/simd/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 84b136b

Please sign in to comment.