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
936f4e81
Commit
936f4e81
authored
Jul 01, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed url test
parent
d1c7ee1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
22 deletions
+29
-22
url.spec.ts
apps/remix-ide-e2e/src/tests/url.spec.ts
+5
-5
compiler-container.tsx
...remix-ui/solidity-compiler/src/lib/compiler-container.tsx
+24
-17
No files found.
apps/remix-ide-e2e/src/tests/url.spec.ts
View file @
936f4e81
...
...
@@ -38,22 +38,22 @@ module.exports = {
.
refresh
()
.
pause
(
5000
)
.
clickLaunchIcon
(
'solidity'
)
.
assert
.
containsText
(
'#versionSelector option[
selecte
d="selected"]'
,
'0.7.4+commit.3f05b770'
)
.
assert
.
containsText
(
'#evmVersionSelector option[
selecte
d="selected"]'
,
'istanbul'
)
.
assert
.
containsText
(
'#versionSelector option[
data-i
d="selected"]'
,
'0.7.4+commit.3f05b770'
)
.
assert
.
containsText
(
'#evmVersionSelector option[
data-i
d="selected"]'
,
'istanbul'
)
.
verify
.
elementPresent
(
'#optimize:checked'
)
.
verify
.
attributeEquals
(
'#runs'
,
'value'
,
'300'
)
},
'Should load using compiler from link passed in remix URL'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
url
(
'http://127.0.0.1:8080/#version=https://solidity-blog.s3.eu-central-1.amazonaws.com/data/08preview/soljson.js'
)
.
url
(
'http://127.0.0.1:8080/#version=https://solidity-blog.s3.eu-central-1.amazonaws.com/data/08preview/soljson.js
&optimize=false
'
)
.
refresh
()
.
pause
(
5000
)
.
clickLaunchIcon
(
'solidity'
)
.
pause
(
5000
)
.
assert
.
containsText
(
'#versionSelector option[
selecte
d="selected"]'
,
'custom'
)
.
assert
.
containsText
(
'#versionSelector option[
data-i
d="selected"]'
,
'custom'
)
// default values
.
assert
.
containsText
(
'#evmVersionSelector option[
selecte
d="selected"]'
,
'default'
)
.
assert
.
containsText
(
'#evmVersionSelector option[
data-i
d="selected"]'
,
'default'
)
.
verify
.
elementPresent
(
'#optimize'
)
.
assert
.
elementNotPresent
(
'#optimize:checked'
)
.
verify
.
elementPresent
(
'#runs:disabled'
)
...
...
libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
View file @
936f4e81
...
...
@@ -56,12 +56,19 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
useEffect
(()
=>
{
if
(
compileTabLogic
&&
compileTabLogic
.
compiler
)
{
setState
(
prevState
=>
{
const
params
=
queryParams
.
get
()
const
optimize
=
params
.
optimize
===
'false'
?
false
:
params
.
optimize
===
'true'
?
true
:
null
const
runs
=
params
.
runs
const
evmVersion
=
params
.
evmVersion
return
{
...
prevState
,
hideWarnings
:
config
.
get
(
'hideWarnings'
)
||
false
,
autoCompile
:
config
.
get
(
'autoCompile'
)
||
false
,
optimise
:
config
.
get
(
'optimise'
)
||
false
,
includeNightlies
:
config
.
get
(
'includeNightlies'
)
||
false
includeNightlies
:
config
.
get
(
'includeNightlies'
)
||
false
,
optimise
:
(
optimize
!==
null
)
&&
(
optimize
!==
undefined
)
?
optimize
:
config
.
get
(
'optimise'
)
||
false
,
runs
:
(
runs
!==
null
)
&&
(
runs
!==
'null'
)
&&
(
runs
!==
undefined
)
&&
(
runs
!==
'undefined'
)
?
runs
:
200
,
evmVersion
:
(
evmVersion
!==
null
)
&&
(
evmVersion
!==
'null'
)
&&
(
evmVersion
!==
undefined
)
&&
(
evmVersion
!==
'undefined'
)
?
evmVersion
:
'default'
}
})
}
...
...
@@ -505,12 +512,12 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
<
button
className=
"far fa-plus-square border-0 p-0 mx-2 btn-sm"
onClick=
{
promptCompiler
}
title=
"Add a custom compiler with URL"
></
button
>
</
label
>
<
select
value=
{
state
.
selectedVersion
||
state
.
defaultVersion
}
onChange=
{
(
e
)
=>
handleLoadVersion
(
e
.
target
.
value
)
}
className=
"custom-select"
id=
"versionSelector"
disabled=
{
state
.
allversions
.
length
<=
0
}
>
{
state
.
allversions
.
length
<=
0
&&
<
option
disabled
>
{
state
.
defaultVersion
}
</
option
>
}
{
state
.
allversions
.
length
<=
0
&&
<
option
disabled
>
builtin
</
option
>
}
{
state
.
customVersions
.
map
((
url
,
i
)
=>
<
option
key=
{
i
}
value=
{
url
}
>
custom
</
option
>
)
}
{
state
.
allversions
.
length
<=
0
&&
<
option
disabled
data
-
id=
{
state
.
selectedVersion
===
state
.
defaultVersion
?
'selected'
:
''
}
>
{
state
.
defaultVersion
}
</
option
>
}
{
state
.
allversions
.
length
<=
0
&&
<
option
disabled
data
-
id=
{
state
.
selectedVersion
===
'builtin'
?
'selected'
:
''
}
>
builtin
</
option
>
}
{
state
.
customVersions
.
map
((
url
,
i
)
=>
<
option
key=
{
i
}
data
-
id=
{
state
.
selectedVersion
===
url
?
'selected'
:
''
}
value=
{
url
}
>
custom
</
option
>
)
}
{
state
.
allversions
.
map
((
build
,
i
)
=>
{
return
_shouldBeAdded
(
build
.
longVersion
)
?
<
option
key=
{
i
}
value=
{
build
.
path
}
>
{
build
.
longVersion
}
</
option
>
?
<
option
key=
{
i
}
value=
{
build
.
path
}
data
-
id=
{
state
.
selectedVersion
===
build
.
path
?
'selected'
:
''
}
>
{
build
.
longVersion
}
</
option
>
:
null
})
}
...
...
@@ -529,16 +536,16 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
</
div
>
<
div
className=
"mb-2"
>
<
label
className=
"remixui_compilerLabel form-check-label"
htmlFor=
"evmVersionSelector"
>
EVM Version
</
label
>
<
select
onChange=
{
(
e
)
=>
handleEvmVersionChange
(
e
.
target
.
value
)
}
className=
"custom-select"
id=
"evmVersionSelector"
>
<
option
value=
"default"
>
compiler default
</
option
>
<
option
value=
"muirGlacier"
>
muirGlacier
</
option
>
<
option
value=
"istanbul"
>
istanbul
</
option
>
<
option
value=
"petersburg"
>
petersburg
</
option
>
<
option
value=
"constantinople"
>
constantinople
</
option
>
<
option
value=
"byzantium"
>
byzantium
</
option
>
<
option
value=
"spuriousDragon"
>
spuriousDragon
</
option
>
<
option
value=
"tangerineWhistle"
>
tangerineWhistle
</
option
>
<
option
value=
"homestead"
>
homestead
</
option
>
<
select
value=
{
state
.
evmVersion
}
onChange=
{
(
e
)
=>
handleEvmVersionChange
(
e
.
target
.
value
)
}
className=
"custom-select"
id=
"evmVersionSelector"
>
<
option
data
-
id=
{
state
.
evmVersion
===
'default'
?
'selected'
:
''
}
value=
"default"
>
compiler default
</
option
>
<
option
data
-
id=
{
state
.
evmVersion
===
'muirGlacier'
?
'selected'
:
''
}
value=
"muirGlacier"
>
muirGlacier
</
option
>
<
option
data
-
id=
{
state
.
evmVersion
===
'istanbul'
?
'selected'
:
''
}
value=
"istanbul"
>
istanbul
</
option
>
<
option
data
-
id=
{
state
.
evmVersion
===
'petersburg'
?
'selected'
:
''
}
value=
"petersburg"
>
petersburg
</
option
>
<
option
data
-
id=
{
state
.
evmVersion
===
'constantinople'
?
'selected'
:
''
}
value=
"constantinople"
>
constantinople
</
option
>
<
option
data
-
id=
{
state
.
evmVersion
===
'byzantium'
?
'selected'
:
''
}
value=
"byzantium"
>
byzantium
</
option
>
<
option
data
-
id=
{
state
.
evmVersion
===
'spuriousDragon'
?
'selected'
:
''
}
value=
"spuriousDragon"
>
spuriousDragon
</
option
>
<
option
data
-
id=
{
state
.
evmVersion
===
'tangerineWhistle'
?
'selected'
:
''
}
value=
"tangerineWhistle"
>
tangerineWhistle
</
option
>
<
option
data
-
id=
{
state
.
evmVersion
===
'homestead'
?
'selected'
:
''
}
value=
"homestead"
>
homestead
</
option
>
</
select
>
</
div
>
<
div
className=
"mt-3"
>
...
...
@@ -556,7 +563,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
className=
"custom-select ml-2 remixui_runs"
id=
"runs"
placeholder=
"200"
defaultValue=
"200"
value=
{
state
.
runs
}
type=
"number"
title=
"Estimated number of times each opcode of the deployed code will be executed across the life-time of the contract."
onChange=
{
(
e
)
=>
onChangeRuns
(
e
.
target
.
value
)
}
...
...
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