Skip to content

Commit

Permalink
fix: misspelling comments (#1698)
Browse files Browse the repository at this point in the history
  • Loading branch information
criadoperez committed Jul 20, 2023
1 parent c3e23fa commit 851b76c
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion command/bridge/deposit/erc721/deposit_erc721.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func runCommand(cmd *cobra.Command, _ []string) {
outputter.SetCommandResult(res)
}

// createDepositTxn encodes parameters for deposit fnction on rootchain predicate contract
// createDepositTxn encodes parameters for deposit function on rootchain predicate contract
func createDepositTxn(sender ethgo.Address,
receivers []ethgo.Address, tokenIDs []*big.Int) (*ethgo.Transaction, error) {
depositToRoot := &contractsapi.DepositBatchRootERC721PredicateFn{
Expand Down
2 changes: 1 addition & 1 deletion command/regenesis/howtotest.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ This document outlines step necessary to perform a regenesis data migration.
[4] + exit 1 ./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json :40000
```
It fails, because we havent provided trie database with correct state trie.
It fails, because we haven't provided trie database with correct state trie.
9. Copy snapshot trie to our data directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func runCommand(cmd *cobra.Command, _ []string) error {
}

if err != nil {
return fmt.Errorf("faield to get deployer key: %w", err)
return fmt.Errorf("failed to get deployer key: %w", err)
}

txRelayer, err := txrelayer.NewTxRelayer(txrelayer.WithIPAddress(params.jsonRPC))
Expand All @@ -124,7 +124,7 @@ func runCommand(cmd *cobra.Command, _ []string) error {
txn := &ethgo.Transaction{To: &deployerAddr, Value: ethgo.Ether(1)}

if _, err = txRelayer.SendTransactionLocal(txn); err != nil {
return fmt.Errorf("faield to send local transaction: %w", err)
return fmt.Errorf("failed to send local transaction: %w", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion consensus/polybft/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ It has a native support for running bridge, which enables running cross-chain tr
$ polygon-edge genesis --block-gas-limit 10000000 --epoch-size 10 \
[--validators-path ./] [--validators-prefix test-chain-] \
[--consensus polybft] \
[--reward-wallet adress:amount]
[--reward-wallet address:amount]
```

- validators information are scafollded on multiple hosts and therefore necessary information are supplied using `--validators` flag. Validator information needs to be supplied in the strictly following format:
Expand Down
4 changes: 2 additions & 2 deletions consensus/polybft/polybft.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type Polybft struct {
// state is reference to the struct which encapsulates consensus data persistence logic
state *State

// consensus parametres
// consensus parameters
config *consensus.Params

// consensusConfig is genesis configuration for polybft consensus protocol
Expand Down Expand Up @@ -598,7 +598,7 @@ func (p *Polybft) startConsensusProtocol() {
p.txPool.SetSealing(isValidator) // update tx pool

if isValidator {
// initialze FSM as a stateless ibft backend via runtime as an adapter
// initialize FSM as a stateless ibft backend via runtime as an adapter
err = p.runtime.FSM()
if err != nil {
p.logger.Error("failed to create fsm", "block number", latestHeader.Number, "error", err)
Expand Down
2 changes: 1 addition & 1 deletion consensus/polybft/state_sync_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func (s *stateSyncManager) GetStateSyncProof(stateSyncID uint64) (types.Proof, e

if stateSyncProof == nil {
// check if we might've missed a commitment. if it is so, we didn't build proofs for it while syncing
// if we are all synced up, commitment will be saved through PostBlock, but we wont have proofs,
// if we are all synced up, commitment will be saved through PostBlock, but we won't have proofs,
// so we will build them now and save them to db so that we have proofs for missed commitment
commitment, err := s.state.StateSyncStore.getCommitmentForStateSync(stateSyncID)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion crypto/crypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func TestValidateSignatureValues(t *testing.T) {
name: "should be invalid if v & s are out of range",
homestead: true, v: two, r: one, s: zero, res: false,
},
// correct v, incorrent r, s
// correct v, incorrect r, s
{
name: "should be invalid if r & s are nil",
homestead: true, v: zero, r: nil, s: nil, res: false,
Expand Down
2 changes: 1 addition & 1 deletion e2e-polybft/e2e/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func TestE2E_Bridge_Transfers(t *testing.T) {
require.NoError(t, err)

// wait for next sprint block as the starting point,
// in order to be able to make assertions against blocks offseted by sprints
// in order to be able to make assertions against blocks offsetted by sprints
initialBlockNum = initialBlockNum + sprintSize - (initialBlockNum % sprintSize)
require.NoError(t, cluster.WaitForBlock(initialBlockNum, 1*time.Minute))

Expand Down
2 changes: 1 addition & 1 deletion jsonrpc/eth_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (e *Eth) SendRawTransaction(buf argBytes) (interface{}, error) {
// SendTransaction rejects eth_sendTransaction json-rpc call as we don't support wallet management
func (e *Eth) SendTransaction(_ *txnArgs) (interface{}, error) {
return nil, fmt.Errorf("request calls to eth_sendTransaction method are not supported," +
" use eth_sendRawTransaction insead")
" use eth_sendRawTransaction instead")
}

// GetTransactionByHash returns a transaction by its hash.
Expand Down
2 changes: 1 addition & 1 deletion scripts/cluster
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ case "$2" in
# cluster {consensus} --docker stop
elif [ "$3" == "stop" ]; then
stopDockerEnvironment
echo "Docker $1 environment stoped!"
echo "Docker $1 environment stopped!"
exit 0
fi

Expand Down
6 changes: 3 additions & 3 deletions state/immutable-trie/copy_trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ func copyTrie(node Node, storage Storage, newStorage Storage, agg []byte, isStor
if !isStorage {
var account state.Account
if err := account.UnmarshalRlp(n.buf); err != nil {
return fmt.Errorf("cant parse account %s: %w", hex.EncodeToString(encodeCompact(agg)), err)
return fmt.Errorf("can't parse account %s: %w", hex.EncodeToString(encodeCompact(agg)), err)
} else {
if account.CodeHash != nil && bytes.Equal(account.CodeHash, emptyCodeHash) == false {
code, ok := storage.GetCode(types.BytesToHash(account.CodeHash))
if ok {
newStorage.SetCode(types.BytesToHash(account.CodeHash), code)
} else {
return fmt.Errorf("cant find code %s", hex.EncodeToString(account.CodeHash))
return fmt.Errorf("can't find code %s", hex.EncodeToString(account.CodeHash))
}
}

Expand Down Expand Up @@ -118,7 +118,7 @@ func HashChecker(stateRoot []byte, storage Storage) (types.Hash, error) {

h, ok := hasherPool.Get().(*hasher)
if !ok {
return types.Hash{}, errors.New("cant get hasher")
return types.Hash{}, errors.New("can't get hasher")
}

arena, _ := h.AcquireArena()
Expand Down
2 changes: 1 addition & 1 deletion txpool/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type accountsMap struct {
maxEnqueuedLimit uint64
}

// Intializes an account for the given address.
// Initializes an account for the given address.
func (m *accountsMap) initOnce(addr types.Address, nonce uint64) *account {
a, loaded := m.LoadOrStore(addr, &account{
enqueued: newAccountQueue(),
Expand Down
2 changes: 1 addition & 1 deletion txpool/txpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ func TestAddGossipTx(t *testing.T) {

signedTx, err := signer.SignTx(tx, key)
if err != nil {
t.Fatalf("cannot sign transction - err: %v", err)
t.Fatalf("cannot sign transaction - err: %v", err)
}

// send tx
Expand Down
2 changes: 1 addition & 1 deletion types/rlp_encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func TestRLPMarshall_Unmarshall_Missing_Data(t *testing.T) {
fromAddrSet bool
}{
{
name: fmt.Sprintf("[%s] Insuficient params", txType),
name: fmt.Sprintf("[%s] Insufficient params", txType),
expectedErr: true,
omittedValues: map[string]bool{
"Nonce": true,
Expand Down
8 changes: 4 additions & 4 deletions validate/validate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ message StringRules {
// at a maximum
optional uint64 max_bytes = 5;

// Pattern specifes that this field must match against the specified
// Pattern specifies that this field must match against the specified
// regular expression (RE2 syntax). The included expression should elide
// any delimiters.
optional string pattern = 6;
Expand Down Expand Up @@ -646,7 +646,7 @@ message BytesRules {
// at a maximum
optional uint64 max_len = 3;

// Pattern specifes that this field must match against the specified
// Pattern specifies that this field must match against the specified
// regular expression (RE2 syntax). The included expression should elide
// any delimiters.
optional string pattern = 4;
Expand Down Expand Up @@ -732,11 +732,11 @@ message RepeatedRules {
optional uint64 max_items = 2;

// Unique specifies that all elements in this field must be unique. This
// contraint is only applicable to scalar and enum types (messages are not
// constraint is only applicable to scalar and enum types (messages are not
// supported).
optional bool unique = 3;

// Items specifies the contraints to be applied to each item in the field.
// Items specifies the constraints to be applied to each item in the field.
// Repeated message fields will still execute validation against each item
// unless skip is specified here.
optional FieldRules items = 4;
Expand Down

0 comments on commit 851b76c

Please sign in to comment.