Skip to content

Commit

Permalink
fix: fix typos (#1132)
Browse files Browse the repository at this point in the history
  • Loading branch information
rex4539 committed Feb 5, 2024
1 parent f863727 commit c96fc74
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ func (app *HeimdallApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain)
}
}

// TODO make sure old validtors dont go in validator updates ie deactivated validators have to be removed
// TODO make sure old validators dont go in validator updates ie deactivated validators have to be removed
// update validators
return abci.ResponseInitChain{
// validator updates
Expand Down
2 changes: 1 addition & 1 deletion app/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (

// SetupSimulation creates the config, db (levelDB), temporary directory and logger for
// the simulation tests. If `FlagEnabledValue` is false it skips the current test.
// Returns error on an invalid db intantiation or temp dir creation.
// Returns error on an invalid db instantiation or temp dir creation.
func SetupSimulation(dirPrefix, dbName string) (simTypes.Config, dbm.DB, string, log.Logger, bool, error) {
config := NewConfigFromFlags()
config.ChainID = SimAppChainID
Expand Down
2 changes: 1 addition & 1 deletion auth/types/stdtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (ss StdSignature) String() string {

// StdFee includes the amount of coins paid in fees and the maximum
// gas to be used by the transaction. The ratio yields an effective "gasprice",
// which must be above some miminum to be accepted into the mempool.
// which must be above some minimum to be accepted into the mempool.
type StdFee struct {
Amount sdk.Coins `json:"amount"`
Gas uint64 `json:"gas"`
Expand Down
4 changes: 2 additions & 2 deletions bor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if err != nil {
}
```

`FreezeSet` internally invokes `SelectNextProducers`, which pseudo-randomly picks producers from the validaor set, leaning more towards validators with higher voting power based on stake:
`FreezeSet` internally invokes `SelectNextProducers`, which pseudo-randomly picks producers from the validator set, leaning more towards validators with higher voting power based on stake:

```
// select next producers
Expand All @@ -76,7 +76,7 @@ if err != nil {
}
```

and then intialises and stores the span:
and then initialises and stores the span:

```
newSpan := hmTypes.NewSpan(
Expand Down
2 changes: 1 addition & 1 deletion bor/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func handleQueryLatestSpan(ctx sdk.Context, _ abci.RequestQuery, keeper Keeper)
return bz, nil
}

// explcitly fetch the last span
// explicitly fetch the last span
span, err := keeper.GetLastSpan(ctx)
if err != nil {
return nil, sdk.ErrInternal(sdk.AppendMsgToErr("could not get span", err.Error()))
Expand Down
2 changes: 1 addition & 1 deletion checkpoint/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func handleMsgCheckpoint(ctx sdk.Context, msg types.MsgCheckpoint, k Keeper, _ h
"currentTip", lastCheckpoint.EndBlock,
"startBlock", msg.StartBlock)

return common.ErrDisCountinuousCheckpoint(k.Codespace()).Result()
return common.ErrDisContinuousCheckpoint(k.Codespace()).Result()
}
} else if err.Error() == common.ErrNoCheckpointFound(k.Codespace()).Error() && msg.StartBlock != 0 {
logger.Error("First checkpoint to start from block 0", "checkpoint start block", msg.StartBlock, "error", err)
Expand Down
2 changes: 1 addition & 1 deletion checkpoint/side_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func PostHandleMsgCheckpoint(ctx sdk.Context, k Keeper, msg types.MsgCheckpoint,
"currentTip", lastCheckpoint.EndBlock,
"startBlock", msg.StartBlock)

return common.ErrDisCountinuousCheckpoint(k.Codespace()).Result()
return common.ErrDisContinuousCheckpoint(k.Codespace()).Result()
}
} else if err.Error() == common.ErrNoCheckpointFound(k.Codespace()).Error() && msg.StartBlock != 0 {
logger.Error("First checkpoint to start from block 0", "Error", err)
Expand Down
2 changes: 1 addition & 1 deletion checkpoint/types/merkel_milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func ValidateMilestone(start uint64, end uint64, rootHash hmTypes.HeimdallHash,

// Check if blocks+confirmations exist locally
if !contractCaller.CheckIfBlocksExist(end + confirmations) {
return false, errors.New(fmt.Sprint("End block number with confirmation is not availbale in the Bor chain", "EndBlock", end, "Confirmation", confirmations))
return false, errors.New(fmt.Sprint("End block number with confirmation is not available in the Bor chain", "EndBlock", end, "Confirmation", confirmations))
}

//Get the vote on hash of milestone from Bor
Expand Down
6 changes: 3 additions & 3 deletions client/tx/broadcast.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//nolint
// nolint
package tx

import (
Expand Down Expand Up @@ -73,7 +73,7 @@ func BroadcastTxRequest(cliCtx context.CLIContext) http.HandlerFunc {
return
}

// brodcast tx
// broadcast tx
res, err := helper.BroadcastTx(cliCtx, req.Tx, req.Mode)
if err != nil {
rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
Expand Down Expand Up @@ -104,7 +104,7 @@ $ gaiacli tx broadcast ./mytxn.json
return err
}

// brodcast tx
// broadcast tx
res, err := helper.BroadcastTx(cliCtx, stdTx, "")
if err != nil {
return err
Expand Down
46 changes: 23 additions & 23 deletions common/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ const (
CodeInvalidMsg CodeType = 1400
CodeOldTx CodeType = 1401

CodeInvalidProposerInput CodeType = 1500
CodeInvalidBlockInput CodeType = 1501
CodeInvalidACK CodeType = 1502
CodeNoACK CodeType = 1503
CodeBadTimeStamp CodeType = 1504
CodeInvalidNoACK CodeType = 1505
CodeTooManyNoAck CodeType = 1506
CodeLowBal CodeType = 1507
CodeNoCheckpoint CodeType = 1508
CodeOldCheckpoint CodeType = 1509
CodeDisCountinuousCheckpoint CodeType = 1510
CodeNoCheckpointBuffer CodeType = 1511
CodeCheckpointBuffer CodeType = 1512
CodeCheckpointAlreadyExists CodeType = 1513
CodeInvalidNoAckProposer CodeType = 1505
CodeInvalidProposerInput CodeType = 1500
CodeInvalidBlockInput CodeType = 1501
CodeInvalidACK CodeType = 1502
CodeNoACK CodeType = 1503
CodeBadTimeStamp CodeType = 1504
CodeInvalidNoACK CodeType = 1505
CodeTooManyNoAck CodeType = 1506
CodeLowBal CodeType = 1507
CodeNoCheckpoint CodeType = 1508
CodeOldCheckpoint CodeType = 1509
CodeDisContinuousCheckpoint CodeType = 1510
CodeNoCheckpointBuffer CodeType = 1511
CodeCheckpointBuffer CodeType = 1512
CodeCheckpointAlreadyExists CodeType = 1513
CodeInvalidNoAckProposer CodeType = 1505

CodeOldValidator CodeType = 2500
CodeNoValidator CodeType = 2501
Expand All @@ -50,7 +50,7 @@ const (
CodeNoSignerChangeError CodeType = 2513
CodeNonce CodeType = 2514

CodeSpanNotCountinuous CodeType = 3501
CodeSpanNotContinuous CodeType = 3501
CodeUnableToFreezeSet CodeType = 3502
CodeSpanNotFound CodeType = 3503
CodeValSetMisMatch CodeType = 3504
Expand Down Expand Up @@ -121,8 +121,8 @@ func ErrOldCheckpoint(codespace sdk.CodespaceType) sdk.Error {
return newError(codespace, CodeOldCheckpoint, "Checkpoint already received for given start and end block")
}

func ErrDisCountinuousCheckpoint(codespace sdk.CodespaceType) sdk.Error {
return newError(codespace, CodeDisCountinuousCheckpoint, "Checkpoint not in continuity")
func ErrDisContinuousCheckpoint(codespace sdk.CodespaceType) sdk.Error {
return newError(codespace, CodeDisContinuousCheckpoint, "Checkpoint not in continuity")
}

func ErrNoACK(codespace sdk.CodespaceType, expiresAt uint64) sdk.Error {
Expand Down Expand Up @@ -165,7 +165,7 @@ func ErrBadTimeStamp(codespace sdk.CodespaceType) sdk.Error {
return newError(codespace, CodeBadTimeStamp, "Invalid time stamp. It must be in near past.")
}

// -----------Milestone Erros
// -----------Milestone Errors
func ErrNoMilestoneFound(codespace sdk.CodespaceType) sdk.Error {
return newError(codespace, CodeNoMilestone, "Milestone Not Found")
}
Expand Down Expand Up @@ -263,7 +263,7 @@ func ErrInvalidBorChainID(codespace sdk.CodespaceType) sdk.Error {
}

func ErrSpanNotInContinuity(codespace sdk.CodespaceType) sdk.Error {
return newError(codespace, CodeSpanNotCountinuous, "Span not countinuous")
return newError(codespace, CodeSpanNotContinuous, "Span not continuous")
}

func ErrInvalidSpanDuration(codespace sdk.CodespaceType) sdk.Error {
Expand Down Expand Up @@ -333,7 +333,7 @@ func CodeToDefaultMsg(code CodeType) string {
return "Checkpoint Not Found"
case CodeOldCheckpoint:
return "Checkpoint already received for given start and end block"
case CodeDisCountinuousCheckpoint:
case CodeDisContinuousCheckpoint:
return "Checkpoint not in continuity"
case CodeNoCheckpointBuffer:
return "Checkpoint buffer Not Found"
Expand Down Expand Up @@ -361,8 +361,8 @@ func CodeToDefaultMsg(code CodeType) string {
return "wait for confirmation time before sending transaction"
case CodeValPubkeyMismatch:
return "Signer Pubkey mismatch between event and msg"
case CodeSpanNotCountinuous:
return "Span not countinuous"
case CodeSpanNotContinuous:
return "Span not continuous"
case CodeUnableToFreezeSet:
return "Unable to freeze validator set for next span"
case CodeSpanNotFound:
Expand Down
2 changes: 1 addition & 1 deletion params/subspace/subspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (s Subspace) WithKeyTable(table KeyTable) Subspace {
s.table.m[k] = v
}

// Allocate additional capicity for Subspace.name
// Allocate additional capacity for Subspace.name
// So we don't have to allocate extra space each time appending to the key
name := s.name
s.name = make([]byte, len(name), len(name)+table.maxKeyLength())
Expand Down
2 changes: 1 addition & 1 deletion server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To start the server, run the following command
heimdalld start-server
```

The `start-server` command is added into the heimdall binary and takes folowing flags
The `start-server` command is added into the heimdall binary and takes following flags

```bash
--chain-id string The chain ID to connect to
Expand Down
8 changes: 4 additions & 4 deletions sidechannel/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (keeper Keeper) SetValidators(ctx sdk.Context, height int64, validators []a
return nil
}

// GetValidators returnss all validators
// GetValidators returns all validators
func (keeper Keeper) GetValidators(ctx sdk.Context, height int64) (validators []abci.Validator) {
store := ctx.KVStore(keeper.key)

Expand Down Expand Up @@ -139,7 +139,7 @@ func (keeper Keeper) RemoveValidators(ctx sdk.Context, height int64) {
// Iterators
//

// IterateTxAndApplyFn interate tx and apply the given function.
// IterateTxAndApplyFn iterate tx and apply the given function.
func (keeper Keeper) IterateTxAndApplyFn(ctx sdk.Context, height int64, f func(tmTypes.Tx) error) {
store := ctx.KVStore(keeper.key)

Expand All @@ -158,7 +158,7 @@ func (keeper Keeper) IterateTxAndApplyFn(ctx sdk.Context, height int64, f func(t
}
}

// IterateTxsAndApplyFn interate all txs and apply the given function.
// IterateTxsAndApplyFn iterate all txs and apply the given function.
func (keeper Keeper) IterateTxsAndApplyFn(ctx sdk.Context, f func(int64, tmTypes.Tx) error) {
store := ctx.KVStore(keeper.key)

Expand All @@ -184,7 +184,7 @@ func (keeper Keeper) IterateTxsAndApplyFn(ctx sdk.Context, f func(int64, tmTypes
}
}

// IterateValidatorsAndApplyFn interate all validators and apply the given function.
// IterateValidatorsAndApplyFn iterate all validators and apply the given function.
func (keeper Keeper) IterateValidatorsAndApplyFn(ctx sdk.Context, f func(int64, []abci.Validator) error) {
store := ctx.KVStore(keeper.key)

Expand Down
8 changes: 4 additions & 4 deletions simulation/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"
)

// log writter
// log writer
type LogWriter interface {
AddEntry(OperationEntry)
PrintLogs()
Expand All @@ -22,12 +22,12 @@ func NewLogWriter(testingmode bool) LogWriter {
return &StandardLogWriter{}
}

// log writter
// log writer
type StandardLogWriter struct {
OpEntries []OperationEntry `json:"op_entries" yaml:"op_entries"`
}

// add an entry to the log writter
// add an entry to the log writer
func (lw *StandardLogWriter) AddEntry(opEntry OperationEntry) {
lw.OpEntries = append(lw.OpEntries, opEntry)
}
Expand Down Expand Up @@ -64,7 +64,7 @@ func createLogFile() *os.File {
}

// _____________________
// dummy log writter
// dummy log writer
type DummyLogWriter struct{}

// do nothing
Expand Down
2 changes: 1 addition & 1 deletion simulation/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ type blockSimFn func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context,
accounts []simulation.Account, header abci.Header) (opCount int)

// Returns a function to simulate blocks. Written like this to avoid constant
// parameters being passed everytime, to minimize memory overhead.
// parameters being passed every time, to minimize memory overhead.
func createBlockSimulator(tb testing.TB, testingMode bool, w io.Writer, params Params,
event func(route, op, evResult string), ops WeightedOperations,
operationQueue OperationQueue, timeOperationQueue []simulation.FutureOperation,
Expand Down
2 changes: 1 addition & 1 deletion types/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (br BaseReq) ValidateBasic(w http.ResponseWriter) bool {
return true
}

// ReadRESTReq reads and unmarshals a Request's body to the the BaseReq stuct.
// ReadRESTReq reads and unmarshals a Request's body to the the BaseReq struct.
// Writes an error response to ResponseWriter and returns true if errors occurred.
func ReadRESTReq(w http.ResponseWriter, r *http.Request, cdc *codec.Codec, req interface{}) bool {
body, err := io.ReadAll(r.Body)
Expand Down

0 comments on commit c96fc74

Please sign in to comment.