Addressing feedback and fix bug that contracts can't be deployed

This commit is contained in:
Pascal Precht 2019-11-14 12:19:01 +01:00
parent 5a98f2d03a
commit 680e01c268
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
3 changed files with 12 additions and 9 deletions

View File

@ -2,7 +2,7 @@ import Web3 from "web3";
const TARGET = 0x7FFFFFFFFFFFFFFF;
export default async function fundAccount(web3: Web3, accountAddress: string, coinbaseAddress: string, hexBalance: string | number | undefined) {
export default async function fundAccount(web3: Web3, accountAddress: string, coinbaseAddress: string, hexBalance?: string | number) {
if (!hexBalance) {
hexBalance = TARGET;
}

View File

@ -53,11 +53,9 @@ export default class AccountsManager {
}
try {
const coinbase = await web3.eth.getCoinbase();
const accts = accounts
.filter((account) => account && account.address);
async.eachLimit(accts, 1, (acct, eachCb) => {
fundAccount(web3, acct.address, coinbase, acct.hexBalance)
async.eachLimit(accounts, 1, (acct, eachCb) => {
fundAccount(web3, acct, coinbase)
.then(() => {
eachCb();
})

View File

@ -30,11 +30,14 @@
"_build": "npm run solo -- build",
"ci": "npm run qa",
"clean": "npm run reset",
"lint": "eslint src/",
"qa": "npm-run-all lint _build test",
"lint": "npm-run-all lint:*",
"lint:js": "eslint src/",
"lint:ts": "tslint -c tslint.json \"src/**/*.ts\"",
"qa": "npm-run-all lint typecheck _build test",
"reset": "npx rimraf .nyc_output coverage dist embark-*.tgz package",
"solo": "embark-solo",
"test": "nyc --reporter=html --reporter=json mocha \"dist/test/**/*.js\" --exit --no-timeouts --require source-map-support/register"
"test": "nyc --reporter=html --reporter=json mocha \"dist/test/**/*.js\" --exit --no-timeouts --require source-map-support/register",
"typecheck": "tsc"
},
"eslintConfig": {
"extends": "../../../.eslintrc.json"
@ -54,7 +57,9 @@
"eslint": "5.7.0",
"mocha": "6.2.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0"
"rimraf": "3.0.0",
"tslint": "5.16.0",
"typescript": "3.6.3"
},
"engines": {
"node": ">=10.17.0 <12.0.0",