This repository was archived by the owner on May 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -271,3 +271,25 @@ def test_abi_contract():
271
271
assert contract .seven () == 7
272
272
assert contract .mul2 (2 ) == 4
273
273
assert contract .mul2 (- 2 ) == - 4
274
+
275
+ @pytest .mark .skipif (not SOLIDITY_AVAILABLE , reason = 'solc compiler not available' )
276
+ def test_extra_args ():
277
+ src = """
278
+ contract foo {
279
+ function add7(uint a) returns(uint d) { return a + 7; }
280
+ function add42(uint a) returns(uint d) { return a + 42; }
281
+ }
282
+ """
283
+
284
+ contract_info = get_solidity ().compile_rich (
285
+ src ,
286
+ extra_args = "--optimize-runs 100"
287
+ )
288
+ expected_code = '0x6060604052605c8060106000396000f3606060405260e060020a6000350463651ae23981146026578063cb02919f146039575b6002565b34600257604a600435600781015b919050565b34600257604a600435602a81016034565b60408051918252519081900360200190f3'
289
+ assert expected_code == contract_info ['foo' ]['code' ]
290
+
291
+ contract_info = get_solidity ().compile_rich (
292
+ src ,
293
+ extra_args = ["--optimize-runs" , "100" ]
294
+ )
295
+ assert expected_code == contract_info ['foo' ]['code' ]
You can’t perform that action at this time.
0 commit comments