Skip to content

chore: fix some minor issues in comments #4673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion action/protocol/poll/slasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (sh *Slasher) CreatePreStates(ctx context.Context, sm protocol.StateManager
nextEpochStartHeight := rp.GetEpochHeight(epochNum + 1)
if featureCtx.UpdateBlockMeta {
if err := sh.updateCurrentBlockMeta(ctx, sm); err != nil {
return errors.Wrap(err, "faild to update current epoch meta")
return errors.Wrap(err, "failed to update current epoch meta")
}
}
if blkCtx.BlockHeight == epochLastHeight && featureWithHeightCtx.CalculateProbationList(nextEpochStartHeight) {
Expand Down
2 changes: 1 addition & 1 deletion action/protocol/staking/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func (p *Protocol) handleStakingIndexer(ctx context.Context, epochStartHeight ui
return p.candBucketsIndexer.PutCandidates(epochStartHeight, candidateList)
}

// PreCommit preforms pre-commit
// PreCommit performs pre-commit
func (p *Protocol) PreCommit(ctx context.Context, sm protocol.StateManager) error {
height, err := sm.Height()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions api/grpcserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ func TestGrpcServer_GetReceiptByAction(t *testing.T) {
require.Contains(err.Error(), expectedErr.Error())
})

t.Run("failed to get reciept by action hash", func(t *testing.T) {
expectedErr := errors.New("failed to get reciept by action hash")
t.Run("failed to get receipt by action hash", func(t *testing.T) {
expectedErr := errors.New("failed to get receipt by action hash")
core.EXPECT().ReceiptByActionHash(gomock.Any()).Return(receipt, expectedErr)

_, err := grpcSvr.GetReceiptByAction(context.Background(), &iotexapi.GetReceiptByActionRequest{})
Expand Down
2 changes: 1 addition & 1 deletion api/web3server.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func parseWeb3Reqs(reader io.Reader) (gjson.Result, error) {
return gjson.Result{}, errors.New("request json format is not valid")
}
ret := gjson.Parse(string(data))
// check rquired field
// check required field
for _, req := range ret.Array() {
id := req.Get("id")
method := req.Get("method")
Expand Down
2 changes: 1 addition & 1 deletion db/batch/kv_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func BenchmarkMapKey_ValueOperate(b *testing.B) {
}
}
})
b.Run("orign map assign", func(b *testing.B) {
b.Run("origin map assign", func(b *testing.B) {
for i := 0; i < b.N; i++ {
for k := range keyTags2 {
keyTags2[k] = []int{0}
Expand Down
4 changes: 2 additions & 2 deletions db/kvstorewithbuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ func (kvb *kvStoreWithBuffer) Get(ns string, key []byte) ([]byte, error) {
}

func (kvb *kvStoreWithBuffer) Put(ns string, key, value []byte) error {
kvb.buffer.Put(ns, key, value, fmt.Sprintf("faild to put %x in %s", key, ns))
kvb.buffer.Put(ns, key, value, fmt.Sprintf("failed to put %x in %s", key, ns))
return nil
}

func (kvb *kvStoreWithBuffer) MustPut(ns string, key, value []byte) {
kvb.buffer.Put(ns, key, value, fmt.Sprintf("faild to put %x in %s", key, ns))
kvb.buffer.Put(ns, key, value, fmt.Sprintf("failed to put %x in %s", key, ns))
}

func (kvb *kvStoreWithBuffer) Delete(ns string, key []byte) error {
Expand Down