Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.

Commit 943d74d

Browse files
committed
Upgrade to contract-loader 0.6.1.rc-0, add new config options
1 parent 2a1e4d4 commit 943d74d

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"typescript": "^3.6.2"
7272
},
7373
"dependencies": {
74-
"@openzeppelin/contract-loader": "^0.5.0",
74+
"@openzeppelin/contract-loader": "^0.6.1-rc.0",
7575
"@truffle/contract": "^4.0.38",
7676
"ansi-colors": "^4.1.1",
7777
"ethereumjs-wallet": "^0.6.3",

src/config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const CONFIG_FILE = 'test-environment.config.js';
1111

1212
type Config = {
1313
accounts: { amount: number; ether: number };
14-
contracts: { type: string; defaultGas: number };
14+
contracts: { type: string; defaultGas: number, defaultGasPrice: number, artifactsDir: string, };
1515
blockGasLimit: number;
1616
gasPrice: number;
1717
setupProvider: (baseProvider: Provider) => Promise<Provider>;
@@ -29,6 +29,8 @@ const defaultConfig: Config = {
2929
contracts: {
3030
type: 'truffle',
3131
defaultGas: DEFAULT_BLOCK_GAS_LIMIT * 0.75,
32+
defaultGasPrice: 20e9, // 20 gigawei
33+
artifactsDir: 'build/contracts',
3234
},
3335

3436
blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT,
@@ -61,6 +63,7 @@ function getConfig(): Config {
6163

6264
config.blockGasLimit = 0xfffffffffffff;
6365
config.contracts.defaultGas = config.blockGasLimit * 0.75;
66+
config.contracts.defaultGasPrice = 1;
6467
config.gasPrice = 1;
6568
}
6669

src/setup-loader.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ if (config.contracts.type !== 'truffle' && config.contracts.type !== 'web3') {
99
}
1010

1111
export default setupLoader({
12+
provider,
1213
defaultSender,
1314
defaultGas: config.contracts.defaultGas,
14-
provider,
15+
defaultGasPrice: config.contracts.defaultGasPrice,
16+
artifactsDir: config.contracts.artifactsDir,
1517
})[config.contracts.type];

0 commit comments

Comments
 (0)