diff --git a/accounts/url_test.go b/accounts/url_test.go index bd6f35fa2a..8a328a9bee 100644 --- a/accounts/url_test.go +++ b/accounts/url_test.go @@ -54,7 +54,7 @@ func TestURLMarshalJSON(t *testing.T) { url := URL{Scheme: "https", Path: "ethereum.org"} json, err := url.MarshalJSON() if err != nil { - t.Errorf("unexpcted error: %v", err) + t.Errorf("unexpected error: %v", err) } if string(json) != "\"https://ethereum.org\"" { t.Errorf("expected: %v, got: %v", "\"https://ethereum.org\"", string(json)) @@ -65,13 +65,13 @@ func TestURLUnmarshalJSON(t *testing.T) { url := &URL{} err := url.UnmarshalJSON([]byte("\"https://ethereum.org\"")) if err != nil { - t.Errorf("unexpcted error: %v", err) + t.Errorf("unexpected error: %v", err) } if url.Scheme != "https" { t.Errorf("expected: %v, got: %v", "https", url.Scheme) } if url.Path != "ethereum.org" { - t.Errorf("expected: %v, got: %v", "https", url.Path) + t.Errorf("expected: %v, got: %v", "ethereum.org", url.Path) } } diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 64c49d1fed..ae3d9f03a6 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -390,7 +390,7 @@ func (w *wallet) selfDerive() { // of legacy-ledger, the first account on the legacy-path will // be shown to the user, even if we don't actively track it if i < len(nextAddrs)-1 { - w.log.Info("Skipping trakcking first account on legacy path, use personal.deriveAccount(,, false) to track", + w.log.Info("Skipping tracking first account on legacy path, use personal.deriveAccount(,, false) to track", "path", path, "address", nextAddrs[i]) break } diff --git a/cmd/evm/README.md b/cmd/evm/README.md index 1a029ab709..a0eedd70ac 100644 --- a/cmd/evm/README.md +++ b/cmd/evm/README.md @@ -4,14 +4,14 @@ The `evm t8n` tool is a stateless state transition utility. It is a utility which can 1. Take a prestate, including -- Accounts, -- Block context information, +- Accounts +- Block context information - Previous blockshashes (*optional) -2. Apply a set of transactions, -3. Apply a mining-reward (*optional), -4. And generate a post-state, including -- State root, transaction root, receipt root, -- Information about rejected transactions, +2. Apply a set of transactions +3. Apply a mining-reward (*optional) +4. Generate a post-state, including +- State root, transaction root, receipt root +- Information about rejected transactions - Optionally: a full or partial post-state dump ## Specification @@ -53,10 +53,10 @@ There are a few (not many) errors that can occur, those are defined below. #### EVM-based errors (`2` to `9`) - Other EVM error. Exit code `2` -- Failed configuration: when a non-supported or invalid fork was specified. Exit code `3`. +- Failed configuration: when a non-supported or invalid fork was specified. Exit code `3` - Block history is not supplied, but needed for a `BLOCKHASH` operation. If `BLOCKHASH` is invoked targeting a block which history has not been provided for, the program will - exit with code `4`. + exit with code `4` #### IO errors (`10`-`20`) @@ -319,7 +319,7 @@ rlpdump -hex $(cat signed_txs.rlp | jq -r ) 02f864010280820fa08284d09411111111111111111111111111111111111111118080c080a0d4ec563b6568cd42d998fc4134b36933c6568d01533b5adf08769270243c6c7fa072bf7c21eac6bbeae5143371eef26d5e279637f3bd73482b55979d76d935b1e9, ] ``` -Now, we can now use those (or any other already signed transactions), as input, like so: +Now, we can use those (or any other already signed transactions), as input, like so: ``` ./evm t8n --state.fork=London --input.alloc=./testdata/13/alloc.json --input.txs=./signed_txs.rlp --input.env=./testdata/13/env.json --output.result=alloc_rlptx.json INFO [07-27|11:53:41.253] Trie dumping started root=e4b924..6aef61 diff --git a/cmd/mycelo/README.md b/cmd/mycelo/README.md index c645a7d2d1..b5f5a8f228 100644 --- a/cmd/mycelo/README.md +++ b/cmd/mycelo/README.md @@ -1,7 +1,7 @@ # Mycelo -`mycelo` is a developer utility to easy running celo blockchain testnets and related jobs around testnets. +`mycelo` is a developer utility to easily run celo blockchain testnets and related jobs around testnets. Its main advantage over previous solutions is that it's able to create a `genesis.json` where all core conctracts are already deployed in it. Eventually it can be extended to support other cases, like e2e tests, load tests, and other operations. @@ -10,7 +10,7 @@ Its main advantage over previous solutions is that it's able to create a `genesi There are 2 main use cases for mycelo: 1. Run a local tesnet - 2. Create a genesis.json to be used in another testnet that will be run on a CloudProvider/Kubernetes + 2. Create a `genesis.json` to be used in another testnet that will be run on a CloudProvider/Kubernetes ### Generating a genesis.json @@ -40,7 +40,7 @@ Genesis creation has many configuration options, for that `mycelo` use the conce mycelo genesis --template=[local|loadtest|monorepo] ``` -Additionally, you can override template options via command line, chedk `mycelo genesis --help` for options: +Additionally, you can override template options via command line, check `mycelo genesis --help` for options: ```bash --validators value Number of Validators (default: 0) @@ -52,7 +52,7 @@ Additionally, you can override template options via command line, chedk `mycelo ### Configuring Genesis (Advanced) -If that's not enough, you can ask mycelo to generate a genesis-config file that you can then customize and use to generate genesis +If that's not enough, you can ask mycelo to generate a `genesis-config` file that you can then customize and use to generate genesis ```bash mycelo genesis-config path/to/env @@ -66,7 +66,7 @@ Next step is to customize those files with your desired options, and then run: mycelo genesis-from-config path/to/env ``` -This command will read those file, and generate a `genesis.json` on the env folder +This command will read those files, and generate a `genesis.json` on the env folder ### Running a local testnet @@ -99,7 +99,7 @@ You can run a simple load bot with: mycelo load-bot path/to/env ``` -This will generate cUSD transfer on each of the developers account of the enviroment. +This will generate cUSD transfer on each of the developers account in the enviroment. This feature is still experimental and needs more work, but it's already usable. diff --git a/cmd/mycelo/genesis_commands.go b/cmd/mycelo/genesis_commands.go index a54ed8a6e7..2812e98785 100644 --- a/cmd/mycelo/genesis_commands.go +++ b/cmd/mycelo/genesis_commands.go @@ -67,7 +67,7 @@ var templateFlags = []cli.Flag{ var buildpathFlag = cli.StringFlag{ Name: "buildpath", - Usage: "Directory where smartcontract truffle build file live", + Usage: "Directory where smartcontract truffle build file resides", } var newEnvFlag = cli.StringFlag{ diff --git a/cmd/mycelo/main.go b/cmd/mycelo/main.go index 55b409ba7c..bdea216af8 100644 --- a/cmd/mycelo/main.go +++ b/cmd/mycelo/main.go @@ -103,7 +103,7 @@ var loadTestMixFeeCurrencyFlag = cli.BoolFlag{ var initValidatorsCommand = cli.Command{ Name: "validator-init", - Usage: "Setup all validators nodes", + Usage: "Setup all validator nodes", ArgsUsage: "[envdir]", Action: validatorInit, Flags: []cli.Flag{gethPathFlag}, diff --git a/miner/block.go b/miner/block.go index 96e774f1c9..043134ec02 100644 --- a/miner/block.go +++ b/miner/block.go @@ -99,7 +99,7 @@ func prepareBlock(w *worker) (*blockState, error) { // Initialize the block state itself state, err := w.chain.StateAt(parent.Root()) if err != nil { - return nil, fmt.Errorf("Failed to get the parent state: %w:", err) + return nil, fmt.Errorf("Failed to get the parent state: %w", err) } state.StartPrefetcher("miner") @@ -158,7 +158,7 @@ func prepareBlock(w *worker) (*blockState, error) { err := w.chain.RecoverRandomnessCache(lastCommitment, b.header.ParentHash) if err != nil { log.Error("Error in recovering randomness cache", "error", err, "number", header.Number.Uint64()) - return b, errors.New("failed to to recover the randomness cache after miss") + return b, errors.New("failed to recover the randomness cache after miss") } lastRandomnessParentHash = rawdb.ReadRandomCommitmentCache(w.db, lastCommitment) if (lastRandomnessParentHash == common.Hash{}) { diff --git a/miner/worker_test.go b/miner/worker_test.go index a678e84ec6..f6db1d1674 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -276,7 +276,7 @@ func getAuthorizedIstanbulEngine() consensus.Istanbul { func TestEmptyWorkIstanbul(t *testing.T) { // TODO(nambrot): Fix this - t.Skip("Disabled due to flakyness") + t.Skip("Disabled due to flakiness") testEmptyWork(t, istanbulChainConfig, getAuthorizedIstanbulEngine(), false, true) testEmptyWork(t, istanbulChainConfig, getAuthorizedIstanbulEngine(), true, false) } diff --git a/mycelo/cluster/node.go b/mycelo/cluster/node.go index 0c28831cba..4dfd071f23 100644 --- a/mycelo/cluster/node.go +++ b/mycelo/cluster/node.go @@ -72,7 +72,7 @@ func (n *Node) SetStaticNodes(enodeUrls ...string) error { } //nolint:gosec if err = ioutil.WriteFile(n.staticNodesFile(), staticNodesRaw, 0644); err != nil { - return fmt.Errorf("Can't serialize static nodes: %w", err) + return fmt.Errorf("Can't write file in order to serialize static nodes: %w", err) } return nil diff --git a/mycelo/env/core_contracts.go b/mycelo/env/core_contracts.go index 5f62830cbd..dc5cb046b3 100644 --- a/mycelo/env/core_contracts.go +++ b/mycelo/env/core_contracts.go @@ -111,7 +111,7 @@ func Libraries() []string { return libraries } func LibraryAddressFor(name string) (common.Address, error) { address, ok := libraryAddresses[name] if !ok { - return common.ZeroAddress, fmt.Errorf("can't find genesis address for %s", name) + return common.ZeroAddress, fmt.Errorf("can't find library address for %s", name) } return address, nil } diff --git a/mycelo/internal/scripts/generate/main.go b/mycelo/internal/scripts/generate/main.go index 8978393a0c..7636c6a8d6 100644 --- a/mycelo/internal/scripts/generate/main.go +++ b/mycelo/internal/scripts/generate/main.go @@ -20,7 +20,7 @@ import ( func readABI(truffleJsonFile string) (string, error) { jsonData, err := ioutil.ReadFile(truffleJsonFile) if err != nil { - return "", fmt.Errorf("Can't read build fild for %s: %w", truffleJsonFile, err) + return "", fmt.Errorf("Can't read build file for %s: %w", truffleJsonFile, err) } var data struct { @@ -71,7 +71,7 @@ var contractNames = []string{ "FeeHandler", } -var buildPath = flag.String("buildpath", "", "the folder where truffle contract build live (on monorepo ./packages/protocol/build/contracts )") +var buildPath = flag.String("buildpath", "", "the folder where truffle contract build resides (on monorepo ./packages/protocol/build/contracts )") var outPath = flag.String("outpath", "./mycelo/contract", "relative path to mycelo/contract package") func main() { diff --git a/mycelo/loadbot/bot.go b/mycelo/loadbot/bot.go index 221a6175a9..9e3944e73a 100644 --- a/mycelo/loadbot/bot.go +++ b/mycelo/loadbot/bot.go @@ -147,7 +147,7 @@ func runTransaction(ctx context.Context, client *ethclient.Client, chainID *big. transactor.GasLimit = GasForTransferWithComment } - tx, err := stableToken.TxObj(transactor, "transferWithComment", txCfg.Recipient, txCfg.Value, "need to proivde some long comment to make it similar to an encrypted comment").Send() + tx, err := stableToken.TxObj(transactor, "transferWithComment", txCfg.Recipient, txCfg.Value, "need to provide some long comment to make it similar to an encrypted comment").Send() if err != nil { if err != context.Canceled { fmt.Printf("Error sending transaction: %v\n", err)