Skip to content

Commit

Permalink
Support istanbul on devchain (#1180)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xGabi authored Jan 7, 2020
1 parent 050f262 commit b99c80a
Show file tree
Hide file tree
Showing 8 changed files with 517 additions and 497 deletions.
2 changes: 2 additions & 0 deletions docs/Main-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Available options to customize the `run` command:
- `--reset`: If reset is present it will reset the devchain before running. The chain will then start from scratch and all published packages will need to be recreated.
- `--port`: The port where the devchain will be started.
- `--network-id`: Network id to connect with.
- `--hardfork`: Allows to specify which hardfork should be used. Supported hardforks are byzantium, constantinople, petersburg, and istanbul (default).
- `--block-time`: Specify blockTime in seconds for automatic mining.
- `--accounts`: Number of accounts to print. Defaults to `2`.
- `--files`: The path to the files that will be published. Defaults to the current directory.
Expand Down Expand Up @@ -96,6 +97,7 @@ Options:
- `--reset`: Resets the devchain to the snapshot.
- `--port`: The port number where the devchain will be started. Defaults to `8545`.
- `--network-id`: Network id to connect with.
- `--hardfork`: Allows to specify which hardfork should be used. Supported hardforks are byzantium, constantinople, petersburg, and istanbul (default).
- `--block-time`: Specify blockTime in seconds for automatic mining.
- `--gas-limit`: Block gas limit. Must be specified as a hex string.
- `--accounts`: Number of accounts to print.
Expand Down
983 changes: 493 additions & 490 deletions packages/cli/npm-shrinkwrap.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"ganache-cli": "^6.7.0",
"ganache-core": "^2.8.0",
"ganache-core": "^2.9.0",
"nyc": "^14.1.1",
"prettier": "^1.15.3",
"proxyquire": "^2.1.0",
Expand Down
8 changes: 7 additions & 1 deletion packages/cli/src/commands/devchain_cmds/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ganache from 'ganache-core'
import listrOpts from '../../helpers/listr-options'
import pjson from '../../../package.json'
import { task as devchainStatusTask } from './status'
import { BLOCK_GAS_LIMIT, MNEMONIC } from './utils/ganache-vars'
import { BLOCK_GAS_LIMIT, MNEMONIC } from './utils/constants'

export const command = 'start'
export const describe =
Expand All @@ -31,6 +31,10 @@ export const builder = yargs => {
description: 'Network id to connect with',
alias: 'i',
})
.option('hardfork', {
description:
'Allows to specify which hardfork should be used. Supported hardforks are byzantium, constantinople, petersburg, and istanbul (default).',
})
.option('block-time', {
description: 'Specify blockTime in seconds for automatic mining',
alias: 'b',
Expand Down Expand Up @@ -61,6 +65,7 @@ export const builder = yargs => {
export const task = async function({
port = 8545,
networkId,
hardfork = 'istanbul',
blockTime,
gasLimit = BLOCK_GAS_LIMIT,
verbose = false,
Expand Down Expand Up @@ -119,6 +124,7 @@ export const task = async function({

const options = {
network_id: ctx.id,
hardfork,
blockTime,
gasLimit,
mnemonic: MNEMONIC,
Expand Down
3 changes: 0 additions & 3 deletions packages/cli/src/commands/devchain_cmds/utils/ganache-vars.js

This file was deleted.

14 changes: 13 additions & 1 deletion packages/cli/src/commands/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export const builder = function(yargs) {
.option('network-id', {
description: 'Network id to connect with',
})
.option('hardfork', {
description:
'Allows to specify which hardfork should be used. Supported hardforks are byzantium, constantinople, petersburg, and istanbul (default).',
})
.option('block-time', {
description: 'Specify blockTime in seconds for automatic mining',
})
Expand Down Expand Up @@ -196,6 +200,7 @@ export const handler = async function({
files,
port,
networkId,
hardfork,
blockTime,
accounts,
reset,
Expand Down Expand Up @@ -251,7 +256,14 @@ export const handler = async function({
}
},
task: async (ctx, task) =>
devchainTask({ port, networkId, blockTime, reset, showAccounts }),
devchainTask({
port,
networkId,
hardfork,
blockTime,
reset,
showAccounts,
}),
},
{
title: 'Setup before publish',
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/test/token/snapshots/token.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Generated by [AVA](https://ava.li).

> the transaction gas is correct
3546390
2916618
Binary file modified packages/toolkit/test/token/snapshots/token.test.js.snap
Binary file not shown.

0 comments on commit b99c80a

Please sign in to comment.