Skip to content

Commit a475216

Browse files
authored
Merge pull request #703 from sc-forks/patch-experimental-options
Fixes for beta release
2 parents 498b8cd + 2cbef21 commit a475216

12 files changed

+49
-41
lines changed

lib/parse.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@ parse.BinaryOperation = function(contract, expression, skipStatementRegistry) {
3131
// Free-floating ternary conditional
3232
if (expression.left && expression.left.type === 'Conditional'){
3333
parse[expression.left.type](contract, expression.left, true);
34-
register.statement(contract, expression);
3534

3635
// Ternary conditional assignment
3736
} else if (expression.right && expression.right.type === 'Conditional'){
3837
parse[expression.right.type](contract, expression.right, true);
39-
register.statement(contract, expression);
4038

4139
// Regular binary operation
4240
} else if(!skipStatementRegistry){
43-
register.statement(contract, expression);
41+
// noop
4442

4543
// LogicalOR condition search...
4644
} else {
@@ -89,7 +87,7 @@ parse.FunctionCall = function(contract, expression, skipStatementRegistry) {
8987

9088
parse.Conditional = function(contract, expression, skipStatementRegistry) {
9189
parse[expression.condition.type] &&
92-
parse[expression.condition.type](contract, expression.condition, skipStatementRegistry);
90+
parse[expression.condition.type](contract, expression.condition, true);
9391

9492
register.conditional(contract, expression);
9593
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"license": "ISC",
2626
"dependencies": {
2727
"@ethersproject/abi": "^5.0.9",
28-
"@solidity-parser/parser": "^0.11.0",
28+
"@solidity-parser/parser": "^0.14.1",
2929
"@truffle/provider": "^0.2.24",
3030
"chalk": "^2.4.2",
3131
"death": "^1.1.0",

plugins/hardhat.plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ task("coverage", "Generates a code coverage report for tests")
106106
api = new API(utils.loadSolcoverJS(config));
107107

108108
// Catch interrupt signals
109-
process.on("SIGINT", nomiclabsUtils.finish.bind(null, config, api));
109+
process.on("SIGINT", nomiclabsUtils.finish.bind(null, config, api, true));
110110

111111
// Version Info
112112
ui.report('hardhat-versions', [pkg.version]);

plugins/resources/nomiclabs.utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ function configureHardhatEVMGas(networkConfig, api){
128128
networkConfig.blockGasLimit = api.gasLimitNumber;
129129
networkConfig.gas = api.gasLimit;
130130
networkConfig.gasPrice = api.gasPrice;
131+
networkConfig.initialBaseFeePerGas = 0;
131132
}
132133

133134
function configureNetworkEnv(env, networkName, networkConfig, provider, isHardhatEVM){
@@ -239,7 +240,7 @@ function tempCacheDir(config){
239240
* @param {SolidityCoverage} api
240241
* @return {Promise}
241242
*/
242-
async function finish(config, api){
243+
async function finish(config, api, shouldKill){
243244
const {
244245
tempContractsDir,
245246
tempArtifactsDir
@@ -252,6 +253,7 @@ async function finish(config, api){
252253
shell.config.silent = false;
253254

254255
if (api) await api.finish();
256+
if (shouldKill) process.exit(1)
255257
}
256258

257259
module.exports = {

test/units/conditional.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('ternary conditionals', () => {
3333
1: [1, 0],
3434
});
3535
assert.deepEqual(mapping[util.filePath].s, {
36-
1: 1, 2: 1, 3: 1,
36+
1: 1, 2: 1,
3737
});
3838
assert.deepEqual(mapping[util.filePath].f, {
3939
1: 1,
@@ -50,7 +50,7 @@ describe('ternary conditionals', () => {
5050
1: [1, 0],
5151
});
5252
assert.deepEqual(mapping[util.filePath].s, {
53-
1: 1, 2: 1, 3: 1,
53+
1: 1, 2: 1,
5454
});
5555
assert.deepEqual(mapping[util.filePath].f, {
5656
1: 1,
@@ -67,7 +67,7 @@ describe('ternary conditionals', () => {
6767
1: [1, 0],
6868
});
6969
assert.deepEqual(mapping[util.filePath].s, {
70-
1: 1, 2: 1, 3: 1,
70+
1: 1, 2: 1,
7171
});
7272
assert.deepEqual(mapping[util.filePath].f, {
7373
1: 1,
@@ -84,7 +84,7 @@ describe('ternary conditionals', () => {
8484
1: [0, 1], 2: [1, 0],
8585
});
8686
assert.deepEqual(mapping[util.filePath].s, {
87-
1: 1, 2: 1, 3: 1,
87+
1: 1, 2: 1,
8888
});
8989
assert.deepEqual(mapping[util.filePath].f, {
9090
1: 1,
@@ -101,7 +101,7 @@ describe('ternary conditionals', () => {
101101
1: [0, 1], 2: [1, 0],
102102
});
103103
assert.deepEqual(mapping[util.filePath].s, {
104-
1: 1, 2: 1, 3: 1,
104+
1: 1, 2: 1,
105105
});
106106
assert.deepEqual(mapping[util.filePath].f, {
107107
1: 1,
@@ -118,7 +118,7 @@ describe('ternary conditionals', () => {
118118
1: [0, 0], 2: [0, 1],
119119
});
120120
assert.deepEqual(mapping[util.filePath].s, {
121-
1: 1, 2: 1, 3: 1,
121+
1: 1, 2: 1,
122122
});
123123
assert.deepEqual(mapping[util.filePath].f, {
124124
1: 1,
@@ -135,7 +135,7 @@ describe('ternary conditionals', () => {
135135
1: [0, 1],
136136
});
137137
assert.deepEqual(mapping[util.filePath].s, {
138-
1: 1, 2: 1, 3: 1,
138+
1: 1, 2: 1,
139139
});
140140
assert.deepEqual(mapping[util.filePath].f, {
141141
1: 1,
@@ -152,7 +152,7 @@ describe('ternary conditionals', () => {
152152
1: [1, 0],
153153
});
154154
assert.deepEqual(mapping[util.filePath].s, {
155-
1: 1, 2: 1, 3: 1,
155+
1: 1, 2: 1,
156156
});
157157
assert.deepEqual(mapping[util.filePath].f, {
158158
1: 1,
@@ -169,7 +169,7 @@ describe('ternary conditionals', () => {
169169
1: [0, 1],
170170
});
171171
assert.deepEqual(mapping[util.filePath].s, {
172-
1: 1, 2: 1, 3: 1,
172+
1: 1, 2: 1,
173173
});
174174
assert.deepEqual(mapping[util.filePath].f, {
175175
1: 1,
@@ -205,7 +205,7 @@ describe('ternary conditionals', () => {
205205
1: [0, 1],
206206
});
207207
assert.deepEqual(mapping[util.filePath].s, {
208-
1: 1, 2: 1, 3: 1, 4: 1,
208+
1: 1, 2: 1, 3: 1,
209209
});
210210
assert.deepEqual(mapping[util.filePath].f, {
211211
1: 1,
@@ -222,7 +222,7 @@ describe('ternary conditionals', () => {
222222
1: [0, 1],
223223
});
224224
assert.deepEqual(mapping[util.filePath].s, {
225-
1: 1, 2: 1,
225+
1: 1,
226226
});
227227
assert.deepEqual(mapping[util.filePath].f, {
228228
1: 1,

test/units/function.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe('function declarations', () => {
107107
});
108108
assert.deepEqual(mapping[util.filePath].b, {});
109109
assert.deepEqual(mapping[util.filePath].s, {
110-
1: 1, 2: 1
110+
1: 1,
111111
});
112112
assert.deepEqual(mapping[util.filePath].f, {
113113
1: 1,

test/units/if.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('if, else, and else if statements', () => {
3939
1: [1, 0],
4040
});
4141
assert.deepEqual(mapping[util.filePath].s, {
42-
1: 1, 2: 1,
42+
1: 1,
4343
});
4444
assert.deepEqual(mapping[util.filePath].f, {
4545
1: 1,
@@ -60,7 +60,7 @@ describe('if, else, and else if statements', () => {
6060
1: [1, 0],
6161
});
6262
assert.deepEqual(mapping[util.filePath].s, {
63-
1: 1, 2: 1,
63+
1: 1,
6464
});
6565
assert.deepEqual(mapping[util.filePath].f, {
6666
1: 1,
@@ -82,7 +82,7 @@ describe('if, else, and else if statements', () => {
8282
1: [1, 0],
8383
});
8484
assert.deepEqual(mapping[util.filePath].s, {
85-
1: 1, 2: 1,
85+
1: 1,
8686
});
8787
assert.deepEqual(mapping[util.filePath].f, {
8888
1: 1,
@@ -105,7 +105,7 @@ describe('if, else, and else if statements', () => {
105105
1: [1, 0],
106106
});
107107
assert.deepEqual(mapping[util.filePath].s, {
108-
1: 1, 2: 1,
108+
1: 1,
109109
});
110110
assert.deepEqual(mapping[util.filePath].f, {
111111
1: 1,
@@ -127,7 +127,7 @@ describe('if, else, and else if statements', () => {
127127
1: [0, 1],
128128
});
129129
assert.deepEqual(mapping[util.filePath].s, {
130-
1: 1, 2: 0,
130+
1: 1,
131131
});
132132
assert.deepEqual(mapping[util.filePath].f, {
133133
1: 1,
@@ -149,7 +149,7 @@ describe('if, else, and else if statements', () => {
149149
1: [0, 1],
150150
});
151151
assert.deepEqual(mapping[util.filePath].s, {
152-
1: 1, 2: 0, 3: 1,
152+
1: 1, 2: 0,
153153
});
154154
assert.deepEqual(mapping[util.filePath].f, {
155155
1: 1,
@@ -170,7 +170,7 @@ describe('if, else, and else if statements', () => {
170170
1: [0, 1],
171171
});
172172
assert.deepEqual(mapping[util.filePath].s, {
173-
1: 1, 2: 0, 3: 1,
173+
1: 1, 2: 0,
174174
});
175175
assert.deepEqual(mapping[util.filePath].f, {
176176
1: 1,
@@ -192,7 +192,7 @@ describe('if, else, and else if statements', () => {
192192
1: [0, 1], 2: [0, 1]
193193
});
194194
assert.deepEqual(mapping[util.filePath].s, {
195-
1: 1, 2: 0, 3: 1, 4: 0
195+
1: 1, 2: 0, 3: 1,
196196
});
197197
assert.deepEqual(mapping[util.filePath].f, {
198198
1: 1,
@@ -235,7 +235,7 @@ describe('if, else, and else if statements', () => {
235235
1: [0, 1], 2: [1, 0], 3: [0, 1], 4: [1, 0]
236236
});
237237
assert.deepEqual(mapping[util.filePath].s, {
238-
1: 1, 2: 0, 3: 1, 4: 1, 5: 0, 6: 1, 7: 0, 8: 1, 9: 1, 10: 0,
238+
1: 1, 2: 1, 3: 1, 4: 1,
239239
});
240240
assert.deepEqual(mapping[util.filePath].f, {
241241
1: 1,

test/units/loops.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('for and while statements', () => {
6666
});
6767
assert.deepEqual(mapping[util.filePath].b, {});
6868
assert.deepEqual(mapping[util.filePath].s, {
69-
1: 1, 2: 1, 3: 1,
69+
1: 1, 2: 1,
7070
});
7171
assert.deepEqual(mapping[util.filePath].f, {
7272
1: 1,
@@ -85,7 +85,7 @@ describe('for and while statements', () => {
8585
});
8686
assert.deepEqual(mapping[util.filePath].b, {});
8787
assert.deepEqual(mapping[util.filePath].s, {
88-
1: 1, 2: 1, 3: 1,
88+
1: 1, 2: 1,
8989
});
9090
assert.deepEqual(mapping[util.filePath].f, {
9191
1: 1,

test/units/modifiers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe('modifiers', () => {
159159
1: [1, 2], 2: [1, 2],
160160
});
161161
assert.deepEqual(mapping[util.filePath].s, {
162-
1: 3, 2: 1, 3: 1,
162+
1: 3, 2: 1,
163163
});
164164
assert.deepEqual(mapping[util.filePath].f, {
165165
1: 3, 2: 1, 3: 1
@@ -187,7 +187,7 @@ describe('modifiers', () => {
187187
"1":[3,0],"2":[1,2],"3":[3,0],"4":[1,2]
188188
});
189189
assert.deepEqual(mapping[util.filePath].s, {
190-
"1":3,"2":3,"3":1,"4":1
190+
"1":3,"2":3,"3":1,
191191
});
192192
assert.deepEqual(mapping[util.filePath].f, {
193193
"1":3,"2":3,"3":1,"4":1

test/units/options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('measureCoverage options', () => {
5959
});
6060
assert.deepEqual(mapping[util.filePath].b, {});
6161
assert.deepEqual(mapping[util.filePath].s, {
62-
1: 1, 2: 1,
62+
1: 1,
6363
});
6464
assert.deepEqual(mapping[util.filePath].f, {
6565
1: 1,
@@ -76,7 +76,7 @@ describe('measureCoverage options', () => {
7676
assert.deepEqual(mapping[util.filePath].b, {});
7777

7878
assert.deepEqual(mapping[util.filePath].s, {
79-
1: 1, 2: 1, 3: 1,
79+
1: 1, 2: 1,
8080
});
8181
assert.deepEqual(mapping[util.filePath].f, {
8282
1: 1,

test/units/statements.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('generic statements', () => {
112112
1: [0, 1],
113113
});
114114
assert.deepEqual(mapping[util.filePath].s, {
115-
1: 1, 2: 0, 3: 1,
115+
1: 1,
116116
});
117117
assert.deepEqual(mapping[util.filePath].f, {
118118
1: 1,
@@ -130,7 +130,7 @@ describe('generic statements', () => {
130130
});
131131
assert.deepEqual(mapping[util.filePath].b, {});
132132
assert.deepEqual(mapping[util.filePath].s, {
133-
1: 1, 2: 1, 3: 1,
133+
1: 1, 2: 1,
134134
});
135135
assert.deepEqual(mapping[util.filePath].f, {
136136
1: 1, 2: 1,
@@ -148,7 +148,7 @@ describe('generic statements', () => {
148148
});
149149
assert.deepEqual(mapping[util.filePath].b, {});
150150
assert.deepEqual(mapping[util.filePath].s, {
151-
1: 1, 2: 1, 3: 1,
151+
1: 1, 2: 1,
152152
});
153153
assert.deepEqual(mapping[util.filePath].f, {
154154
1: 1, 2: 1,

yarn.lock

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,12 @@
609609
version "0.7.0"
610610
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd"
611611

612-
"@solidity-parser/parser@^0.11.0":
613-
version "0.11.0"
614-
resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.11.0.tgz#28bc1972e1620f7b388b485bca76a78ac2cb5c59"
615-
integrity sha512-IaC4IaW8uoOB8lmEkw6c19y1vJBK/+7SzAbGQ+LmBYRPXSLNB+UgpORvmcAJEXhB04kWKyz/Os1U8onqm6U/+w==
612+
"@solidity-parser/parser@^0.14.1":
613+
version "0.14.1"
614+
resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.14.1.tgz#179afb29f4e295a77cc141151f26b3848abc3c46"
615+
integrity sha512-eLjj2L6AuQjBB6s/ibwCAc0DwrR5Ge+ys+wgWo+bviU7fV2nTMQhU63CGaDKXg9iTmMxwhkyoggdIR7ZGRfMgw==
616+
dependencies:
617+
antlr4ts "^0.5.0-alpha.4"
616618

617619
"@solidity-parser/parser@^0.5.2":
618620
version "0.5.2"
@@ -1008,6 +1010,11 @@ ansi-styles@^4.1.0:
10081010
dependencies:
10091011
color-convert "^2.0.1"
10101012

1013+
antlr4ts@^0.5.0-alpha.4:
1014+
version "0.5.0-alpha.4"
1015+
resolved "https://registry.yarnpkg.com/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz#71702865a87478ed0b40c0709f422cf14d51652a"
1016+
integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==
1017+
10111018
10121019
version "1.3.0"
10131020
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
@@ -7141,6 +7148,7 @@ websocket@^1.0.31:
71417148
dependencies:
71427149
debug "^2.2.0"
71437150
es5-ext "^0.10.50"
7151+
gulp "^4.0.2"
71447152
nan "^2.14.0"
71457153
typedarray-to-buffer "^3.1.5"
71467154
yaeti "^0.0.6"

0 commit comments

Comments
 (0)