Skip to content
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

chore: fix some typos in comments #6323

Merged
merged 1 commit into from
Apr 26, 2024
Merged
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
4 changes: 2 additions & 2 deletions pkg/chainsync/syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ func (syncer *Syncer) Head() *types.TipSet {
// maybe this code should actually live in blocksync??
func zipTipSetAndMessages(bs blockstore.Blockstore, ts *types.TipSet, allbmsgs []*types.Message, allsmsgs []*types.SignedMessage, bmi, smi [][]uint64) (*types.FullTipSet, error) {
if len(ts.Blocks()) != len(smi) || len(ts.Blocks()) != len(bmi) {
return nil, fmt.Errorf("msgincl length didnt match tipset size")
return nil, fmt.Errorf("msgincl length didn't match tipset size")
}

fts := &types.FullTipSet{}
Expand Down Expand Up @@ -704,7 +704,7 @@ func zipTipSetAndMessages(bs blockstore.Blockstore, ts *types.TipSet, allbmsgs [
}

if b.Messages != mrcid {
return nil, fmt.Errorf("messages didnt match message root in header for ts %s", ts.Key())
return nil, fmt.Errorf("messages didn't match message root in header for ts %s", ts.Key())
}

fb := &types.FullBlock{
Expand Down
2 changes: 1 addition & 1 deletion pkg/consensus/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ func (bv *BlockValidator) checkBlockMessages(ctx context.Context,
return fmt.Errorf("serialize tx meta failed: %v", err)
}
if blk.Messages != b.Cid() {
return fmt.Errorf("messages didnt match message root in header")
return fmt.Errorf("messages didn't match message root in header")
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/market/fundmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ func (a *fundedAddress) processWithdrawals(withdrawals []*fundRequest) (msgCid c
return withdrawFundsCid, nil
}

// asynchonously wait for results of message
// asynchronously wait for results of message
func (a *fundedAddress) startWaitForResults(ctx context.Context, msgCid cid.Cid) {
go func() {
err := a.env.WaitMsg(a.ctx, msgCid)
Expand Down
2 changes: 1 addition & 1 deletion pkg/net/blocksub/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type BlockHeaderValidator interface {
ValidateBlockMsg(context.Context, *types.BlockMsg) pubsub.ValidationResult
}

// NewBlockTopicValidator retruns a BlockTopicValidator using `bv` for message validation
// NewBlockTopicValidator returns a BlockTopicValidator using `bv` for message validation
func NewBlockTopicValidator(bv BlockHeaderValidator, opts ...pubsub.ValidatorOpt) *BlockTopicValidator {
return &BlockTopicValidator{
opts: opts,
Expand Down
2 changes: 1 addition & 1 deletion pkg/net/exchange/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (c *client) processResponse(req *exchange.Request, res *exchange.Response,
// If we didn't request the headers they should have been provided
// by the caller.
if len(tipsets) < len(res.Chain) {
return nil, fmt.Errorf("not enought tipsets provided for message response validation, needed %d, have %d", len(res.Chain), len(tipsets))
return nil, fmt.Errorf("not enough tipsets provided for message response validation, needed %d, have %d", len(res.Chain), len(tipsets))
}
chain := make([]*exchange.BSTipSet, 0, resLength)
for i, resChain := range res.Chain {
Expand Down
12 changes: 6 additions & 6 deletions pkg/repo/fskeystore/fskeystore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ func TestKeystoreBasics(t *testing.T) {
}

if err := ks.Put("..///foo/", k1); err == nil {
t.Fatal("shouldnt be able to put a poorly named key")
t.Fatal("shouldn't be able to put a poorly named key")
}

if err := ks.Put("", k1); err == nil {
t.Fatal("shouldnt be able to put a key with no name")
t.Fatal("shouldn't be able to put a key with no name")
}

if err := ks.Put(".foo", k1); err == nil {
t.Fatal("shouldnt be able to put a key with a 'hidden' name")
t.Fatal("shouldn't be able to put a key with a 'hidden' name")
}
}

Expand Down Expand Up @@ -205,7 +205,7 @@ func TestInvalidKeyFiles(t *testing.T) {
}

if _, err = ks.Has(".invalid"); err == nil {
t.Fatal("shouldnt be able to put a key with a 'hidden' name")
t.Fatal("shouldn't be able to put a key with a 'hidden' name")
}
}

Expand Down Expand Up @@ -233,7 +233,7 @@ func TestMakeKeystoreNoDir(t *testing.T) {

_, err := NewFSKeystore("/this/is/not/a/real/dir")
if err == nil {
t.Fatal("shouldnt be able to make a keystore in a nonexistant directory")
t.Fatal("shouldn't be able to make a keystore in a nonexistant directory")
}
}

Expand Down Expand Up @@ -264,7 +264,7 @@ func assertGetKey(ks Keystore, name string, exp []byte) error {
}

if !bytes.Equal(outK, exp) {
return fmt.Errorf("key we got out didnt match expectation")
return fmt.Errorf("key we got out didn't match expectation")
}

return nil
Expand Down
6 changes: 3 additions & 3 deletions pkg/repo/fskeystore/memkeystore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ func TestMemKeyStoreBasics(t *testing.T) {
}

if err := ks.Put("..///foo/", k1); err == nil {
t.Fatal("shouldnt be able to put a poorly named key")
t.Fatal("shouldn't be able to put a poorly named key")
}

if err := ks.Put("", k1); err == nil {
t.Fatal("shouldnt be able to put a key with no name")
t.Fatal("shouldn't be able to put a key with no name")
}

if err := ks.Put(".foo", k1); err == nil {
t.Fatal("shouldnt be able to put a key with a 'hidden' name")
t.Fatal("shouldn't be able to put a key with a 'hidden' name")
}
}
2 changes: 1 addition & 1 deletion venus-component/libp2p/exchange/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (c *client) processResponse(req *exchange.Request, res *exchange.Response,
// If we didn't request the headers they should have been provided
// by the caller.
if len(tipsets) < len(res.Chain) {
return nil, fmt.Errorf("not enought tipsets provided for message response validation, needed %d, have %d", len(res.Chain), len(tipsets))
return nil, fmt.Errorf("not enough tipsets provided for message response validation, needed %d, have %d", len(res.Chain), len(tipsets))
}
chain := make([]*exchange.BSTipSet, 0, resLength)
for i, resChain := range res.Chain {
Expand Down
2 changes: 1 addition & 1 deletion venus-shared/types/tipset_marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type ExpTipSet struct {
}

func (ts *TipSet) MarshalJSON() ([]byte, error) {
// why didnt i just export the fields? Because the struct has methods with the
// why didn't i just export the fields? Because the struct has methods with the
// same names already
return json.Marshal(ExpTipSet{
Cids: ts.cids,
Expand Down
Loading