Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Load gas and gasPrice from networkConfig #1345

Merged
merged 2 commits into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"ganache-cli": "^6.3.0",
"husky": "^2.7.0",
"lint-staged": "4.3.0",
"lodash.isnil": "^4.0.0",
"lodash.mapkeys": "^4.6.0",
"lodash.random": "^3.2.0",
"mocha": "^6.2.2",
Expand Down
5 changes: 5 additions & 0 deletions packages/cli/src/models/config/ConfigManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import TruffleConfig from './TruffleConfig';
import Session from '../network/Session';
import NetworkConfig from './NetworkConfig';

import pick from 'lodash.pick';
import pickBy from 'lodash.pickby';
import isNil from 'lodash.isnil';

const ConfigManager = {
config: undefined,

Expand Down Expand Up @@ -38,6 +42,7 @@ const ConfigManager = {
await ZWeb3.checkNetworkId(network.networkId);
const txParams = {
from: ZWeb3.toChecksumAddress(from || artifactDefaults.from || (await ZWeb3.defaultAccount())),
...pickBy(pick(artifactDefaults, ['gas', 'gasPrice']), x => !isNil(x)),
nventuro marked this conversation as resolved.
Show resolved Hide resolved
};

return { network: await ZWeb3.getNetworkName(), txParams };
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7290,6 +7290,7 @@ lodash.ismatch@^4.4.0:
lodash.isnil@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/lodash.isnil/-/lodash.isnil-4.0.0.tgz#49e28cd559013458c814c5479d3c663a21bfaa6c"
integrity sha1-SeKM1VkBNFjIFMVHnTxmOiG/qmw=

lodash.isnull@^3.0.0:
version "3.0.0"
Expand Down