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

Minor typo/wording/formatting fixes 01 #2343

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions accounts/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion accounts/usbwallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(<url>,<path>, false) to track",
w.log.Info("Skipping tracking first account on legacy path, use personal.deriveAccount(<url>,<path>, false) to track",
"path", path, "address", nextAddrs[i])
break
}
Expand Down
20 changes: 10 additions & 10 deletions cmd/evm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`)

Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions cmd/mycelo/README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion cmd/mycelo/genesis_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion cmd/mycelo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
4 changes: 2 additions & 2 deletions miner/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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{}) {
Expand Down
2 changes: 1 addition & 1 deletion miner/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion mycelo/cluster/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mycelo/env/core_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions mycelo/internal/scripts/generate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion mycelo/loadbot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down