From 7efdb6362de12fa7940a9628489698194e4c0834 Mon Sep 17 00:00:00 2001 From: johnzhu0907 <90296451+johnzhu0907@users.noreply.github.com> Date: Tue, 29 Nov 2022 21:32:14 +0800 Subject: [PATCH] Typo in Comments and Functions (#9765) List of typos in comments and functions. * L26: `conflictinge` seems to be `conflicting` * L77: `melevolent` seems to be `malevolent` * L218, L226: `challendingBlock` seems to be `challengingBlock` * L375: `heght` seems to be `height` * L395: `avoud` seems to be `avoid` --- #### PR checklist - [ ] Tests written/updated, or no tests needed - [ ] `CHANGELOG_PENDING.md` updated, or no changelog entry needed - [ ] Updated relevant documentation (`docs/`) and code comments, or no documentation updates needed --- light/detector.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/light/detector.go b/light/detector.go index 1fd21f41e..8fde53889 100644 --- a/light/detector.go +++ b/light/detector.go @@ -23,7 +23,7 @@ import ( // trace that was produced from the primary. If successful, it produces two sets of evidence // and sends them to the opposite provider before halting. // -// If there are no conflictinge headers, the light client deems the verified target header +// If there are no conflicting headers, the light client deems the verified target header // trusted and saves it to the trusted store. func (c *Client) detectDivergence(ctx context.Context, primaryTrace []*types.LightBlock, now time.Time) error { if primaryTrace == nil || len(primaryTrace) < 2 { @@ -74,7 +74,7 @@ func (c *Client) detectDivergence(ctx context.Context, primaryTrace []*types.Lig witnessesToRemove = append(witnessesToRemove, e.WitnessIndex) case errBadWitness: - // these are all melevolent errors and should result in removing the + // these are all malevolent errors and should result in removing the // witness c.logger.Info("witness returned an error during header comparison, removing...", "witness", c.witnesses[e.WitnessIndex], "err", err) @@ -217,7 +217,7 @@ func (c *Client) sendEvidence(ctx context.Context, ev *types.LightClientAttackEv func (c *Client) handleConflictingHeaders( ctx context.Context, primaryTrace []*types.LightBlock, - challendingBlock *types.LightBlock, + challengingBlock *types.LightBlock, witnessIndex int, now time.Time, ) error { @@ -225,7 +225,7 @@ func (c *Client) handleConflictingHeaders( witnessTrace, primaryBlock, err := c.examineConflictingHeaderAgainstTrace( ctx, primaryTrace, - challendingBlock, + challengingBlock, supportingWitness, now, ) @@ -374,7 +374,7 @@ func (c *Client) examineConflictingHeaderAgainstTrace( } // getTargetBlockOrLatest gets the latest height, if it is greater than the target height then it queries -// the target heght else it returns the latest. returns true if it successfully managed to acquire the target +// the target height else it returns the latest. returns true if it successfully managed to acquire the target // height. func (c *Client) getTargetBlockOrLatest( ctx context.Context, @@ -394,7 +394,7 @@ func (c *Client) getTargetBlockOrLatest( if lightBlock.Height > height { // the witness has caught up. We recursively call the function again. However in order - // to avoud a wild goose chase where the witness sends us one header below and one header + // to avoid a wild goose chase where the witness sends us one header below and one header // above the height we set a timeout to the context lightBlock, err := witness.LightBlock(ctx, height) return true, lightBlock, err