Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
a25a6759
Unverified
Commit
a25a6759
authored
Nov 24, 2020
by
yann300
Committed by
GitHub
Nov 24, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #603 from ethereum/optF
optimisation runs recover default
parents
b8dabed8
e007f62b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
compiler_api.test.ts
apps/remix-ide-e2e/src/tests/compiler_api.test.ts
+25
-0
compilerContainer.js
apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js
+2
-0
No files found.
apps/remix-ide-e2e/src/tests/compiler_api.test.ts
View file @
a25a6759
...
...
@@ -34,6 +34,14 @@ module.exports = {
.
journalChildIncludes
(
`\\"optimizer\\":{\\"enabled\\":true,\\"runs\\":300}`
)
},
'Should compile using "compileWithParamaters" API with optimization off check default runs'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
addFile
(
'test_jsCompileWithOptimizationDefault.js'
,
{
content
:
jsCompileWithOptimizationDefault
})
.
executeScript
(
'remix.exeCurrent()'
)
.
pause
(
10000
)
.
journalChildIncludes
(
`\\"optimizer\\":{\\"enabled\\":false,\\"runs\\":200}`
)
},
'Should update the compiler configuration with "setCompilerConfig" API'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
addFile
(
'test_updateConfiguration.js'
,
{
content
:
updateConfiguration
})
...
...
@@ -112,10 +120,27 @@ const jsCompileWithOptimization = `(async () => {
const result = await remix.call('solidity', 'compileWithParameters', contract, params)
console.log('result ', result)
} catch (e) {
console.log(e.message)
}
})()`
const
jsCompileWithOptimizationDefault
=
`(async () => {
try {
const contract = {
"storage.sol": {content : \`
${
simpleContract
}
\` }
}
console.log('compile')
const params = {
optimize: false,
}
const result = await remix.call('solidity', 'compileWithParameters', contract, params)
console.log('result ', result)
} catch (e) {
console.log(e.message)
}
})()`
const
updateConfiguration
=
`(async () => {
try {
const params = {
...
...
apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js
View file @
a25a6759
...
...
@@ -345,7 +345,9 @@ class CompilerContainer {
this
.
compileTabLogic
.
setOptimize
(
!!
this
.
_view
.
optimize
.
checked
)
if
(
this
.
compileTabLogic
.
optimize
)
{
this
.
_view
.
runs
.
removeAttribute
(
'disabled'
)
this
.
compileTabLogic
.
setRuns
(
parseInt
(
this
.
_view
.
runs
.
value
))
}
else
{
this
.
compileTabLogic
.
setRuns
(
200
)
this
.
_view
.
runs
.
setAttribute
(
'disabled'
,
''
)
}
this
.
compileIfAutoCompileOn
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment