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
3a8c593e
Commit
3a8c593e
authored
Nov 26, 2020
by
LianaHus
Committed by
Liana Husikyan
Dec 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
at address is disabled when no contract compiled
parent
25b83afd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
17 deletions
+68
-17
signingMessage.test.ts
apps/remix-ide-e2e/src/tests/signingMessage.test.ts
+1
-1
contractDropdown.js
apps/remix-ide/src/app/tabs/runTab/contractDropdown.js
+67
-16
No files found.
apps/remix-ide-e2e/src/tests/signingMessage.test.ts
View file @
3a8c593e
...
@@ -27,7 +27,7 @@ module.exports = {
...
@@ -27,7 +27,7 @@ module.exports = {
})
})
.
addFile
(
'signMassage.sol'
,
sources
[
0
][
'browser/signMassage.sol'
])
.
addFile
(
'signMassage.sol'
,
sources
[
0
][
'browser/signMassage.sol'
])
.
openFile
(
'browser/signMassage.sol'
)
.
openFile
(
'browser/signMassage.sol'
)
.
pause
(
5
000
)
.
pause
(
10
000
)
.
selectContract
(
'ECVerify'
)
.
selectContract
(
'ECVerify'
)
.
createContract
(
''
)
.
createContract
(
''
)
.
clickInstance
(
0
)
.
clickInstance
(
0
)
...
...
apps/remix-ide/src/app/tabs/runTab/contractDropdown.js
View file @
3a8c593e
...
@@ -21,6 +21,7 @@ class ContractDropdownUI {
...
@@ -21,6 +21,7 @@ class ContractDropdownUI {
this
.
ipfsCheckedState
=
false
this
.
ipfsCheckedState
=
false
this
.
exEnvironment
=
blockchain
.
getProvider
()
this
.
exEnvironment
=
blockchain
.
getProvider
()
this
.
listenToContextChange
()
this
.
listenToContextChange
()
this
.
loadType
=
'other'
}
}
listenToEvents
()
{
listenToEvents
()
{
...
@@ -29,13 +30,14 @@ class ContractDropdownUI {
...
@@ -29,13 +30,14 @@ class ContractDropdownUI {
var
contractNames
=
document
.
querySelector
(
`.
${
css
.
contractNames
.
classNames
[
0
]}
`
)
var
contractNames
=
document
.
querySelector
(
`.
${
css
.
contractNames
.
classNames
[
0
]}
`
)
contractNames
.
innerHTML
=
''
contractNames
.
innerHTML
=
''
if
(
success
)
{
if
(
success
)
{
this
.
selectContractNames
.
removeAttribute
(
'disabled'
)
this
.
enableContractNames
(
true
)
this
.
dropdownLogic
.
getCompiledContracts
(
compiler
,
compilerFullName
).
forEach
((
contract
)
=>
{
this
.
dropdownLogic
.
getCompiledContracts
(
compiler
,
compilerFullName
).
forEach
((
contract
)
=>
{
contractNames
.
appendChild
(
yo
`<option value="
${
contract
.
name
}
" compiler="
${
compilerFullName
}
">
${
contract
.
name
}
-
${
contract
.
file
}
</option>`
)
contractNames
.
appendChild
(
yo
`<option value="
${
contract
.
name
}
" compiler="
${
compilerFullName
}
">
${
contract
.
name
}
-
${
contract
.
file
}
</option>`
)
})
})
}
else
{
}
else
{
this
.
selectContractNames
.
setAttribute
(
'disabled'
,
true
)
this
.
enableContractNames
(
false
,
'sol'
)
}
}
this
.
enableAtAddress
(
success
)
this
.
setInputParamsPlaceHolder
()
this
.
setInputParamsPlaceHolder
()
if
(
success
)
{
if
(
success
)
{
...
@@ -80,14 +82,42 @@ class ContractDropdownUI {
...
@@ -80,14 +82,42 @@ class ContractDropdownUI {
window
.
localStorage
.
setItem
(
`ipfs/
${
this
.
exEnvironment
}
/
${
this
.
networkName
}
`
,
this
.
ipfsCheckedState
)
window
.
localStorage
.
setItem
(
`ipfs/
${
this
.
exEnvironment
}
/
${
this
.
networkName
}
`
,
this
.
ipfsCheckedState
)
}
}
enableContractNames
(
enable
)
{
if
(
enable
)
{
this
.
selectContractNames
.
removeAttribute
(
'disabled'
)
this
.
selectContractNames
.
setAttribute
(
'title'
,
'Select contract for Deploy or At Address.'
)
}
else
{
this
.
selectContractNames
.
setAttribute
(
'disabled'
,
true
)
if
(
this
.
loadType
===
'sol'
)
{
this
.
selectContractNames
.
setAttribute
(
'title'
,
'⚠ Select and compile *.sol file to deploy or access a contract.'
)
}
else
{
this
.
selectContractNames
.
setAttribute
(
'title'
,
'⚠ Selected *.abi file allows accessing contracts, select and compile *.sol file to deploy and access one.'
)
}
}
}
enableAtAddress
(
enable
)
{
if
(
enable
)
{
if
(
this
.
atAddressButtonInput
.
value
===
''
)
return
this
.
atAddress
.
removeAttribute
(
'disabled'
)
this
.
atAddress
.
setAttribute
(
'title'
,
'Interact with the given contract.'
)
}
else
{
this
.
atAddress
.
setAttribute
(
'disabled'
,
true
)
if
(
this
.
atAddressButtonInput
.
value
===
''
)
{
this
.
atAddress
.
setAttribute
(
'title'
,
'⚠ Compile *.sol file or select *.abi file & then enter the address of deployed contract.'
)
}
else
{
this
.
atAddress
.
setAttribute
(
'title'
,
'⚠ Compile *.sol file or select *.abi file.'
)
}
}
}
render
()
{
render
()
{
this
.
compFails
=
yo
`<i title="No contract compiled yet or compilation failed. Please check the compile tab for more information." class="m-2 ml-3 fas fa-times-circle
${
css
.
errorIcon
}
" ></i>`
this
.
compFails
=
yo
`<i title="No contract compiled yet or compilation failed. Please check the compile tab for more information." class="m-2 ml-3 fas fa-times-circle
${
css
.
errorIcon
}
" ></i>`
var
info
=
yo
`<i class="fas fa-info
${
css
.
infoDeployAction
}
" aria-hidden="true" title="*.sol files allows deploying and accessing contracts. *.abi files only allows accessing contracts."></i>`
this
.
atAddress
=
yo
`<button class="
${
css
.
atAddress
}
btn btn-sm btn-info" id="runAndDeployAtAdressButton" onclick=
${
this
.
loadFromAddress
.
bind
(
this
)}
>At Address</button>`
this
.
atAddress
=
yo
`<button class="
${
css
.
atAddress
}
btn btn-sm btn-info" disabled id="runAndDeployAtAdressButton" onclick=
${
this
.
loadFromAddress
.
bind
(
this
)}
>At Address</button>`
this
.
atAddressButtonInput
=
yo
`<input class="
${
css
.
input
}
${
css
.
ataddressinput
}
ataddressinput form-control" placeholder="Load contract from Address" title="address of contract" oninput=
${
this
.
atAddressChanged
.
bind
(
this
)}
/>`
this
.
atAddressButtonInput
=
yo
`<input class="
${
css
.
input
}
${
css
.
ataddressinput
}
ataddressinput form-control" placeholder="Load contract from Address" title="address of contract" oninput=
${
this
.
atAddressChanged
.
bind
(
this
)}
/>`
this
.
selectContractNames
=
yo
`<select class="
${
css
.
contractNames
}
custom-select" disabled></select>`
this
.
selectContractNames
=
yo
`<select class="
${
css
.
contractNames
}
custom-select" disabled title="Please compile *.sol file to deploy or access a contract"></select>`
if
(
this
.
exEnvironment
===
'vm'
)
this
.
networkName
=
'VM'
if
(
this
.
exEnvironment
===
'vm'
)
this
.
networkName
=
'VM'
this
.
enableAtAddress
(
false
)
const
savedConfig
=
window
.
localStorage
.
getItem
(
`ipfs/
${
this
.
exEnvironment
}
/
${
this
.
networkName
}
`
)
const
savedConfig
=
window
.
localStorage
.
getItem
(
`ipfs/
${
this
.
exEnvironment
}
/
${
this
.
networkName
}
`
)
this
.
ipfsCheckedState
=
savedConfig
===
'true'
?
true
:
false
// eslint-disable-line
this
.
ipfsCheckedState
=
savedConfig
===
'true'
?
true
:
false
// eslint-disable-line
...
@@ -119,11 +149,11 @@ class ContractDropdownUI {
...
@@ -119,11 +149,11 @@ class ContractDropdownUI {
this
.
createPanel
=
yo
`<div class="
${
css
.
deployDropdown
}
"></div>`
this
.
createPanel
=
yo
`<div class="
${
css
.
deployDropdown
}
"></div>`
this
.
orLabel
=
yo
`<div class="
${
css
.
orLabel
}
mt-2">or</div>`
this
.
orLabel
=
yo
`<div class="
${
css
.
orLabel
}
mt-2">or</div>`
const
el
=
yo
`
const
contractNamesContainer
=
yo
`
<div class="
${
css
.
container
}
" data-id="contractDropdownContainer">
<div class="
${
css
.
container
}
" data-id="contractDropdownContainer">
<label class="
${
css
.
settingsLabel
}
">Contract</label>
<label class="
${
css
.
settingsLabel
}
">Contract</label>
<div class="
${
css
.
subcontainer
}
">
<div class="
${
css
.
subcontainer
}
">
${
this
.
selectContractNames
}
${
this
.
compFails
}
${
info
}
${
this
.
selectContractNames
}
${
this
.
compFails
}
</div>
</div>
<div>
<div>
${
this
.
createPanel
}
${
this
.
createPanel
}
...
@@ -137,32 +167,53 @@ class ContractDropdownUI {
...
@@ -137,32 +167,53 @@ class ContractDropdownUI {
`
`
this
.
selectContractNames
.
addEventListener
(
'change'
,
this
.
setInputParamsPlaceHolder
.
bind
(
this
))
this
.
selectContractNames
.
addEventListener
(
'change'
,
this
.
setInputParamsPlaceHolder
.
bind
(
this
))
this
.
setInputParamsPlaceHolder
()
this
.
setInputParamsPlaceHolder
()
if
(
!
this
.
el
)
{
if
(
!
this
.
contractNamesContainer
)
{
this
.
el
=
el
this
.
contractNamesContainer
=
contractNamesContainer
}
}
return
el
return
contractNamesContainer
}
}
atAddressChanged
(
event
)
{
atAddressChanged
(
event
)
{
if
(
!
this
.
atAddressButtonInput
.
value
)
{
if
(
!
this
.
atAddressButtonInput
.
value
)
{
this
.
atAddress
.
setAttribute
(
'disabled'
,
'true'
)
this
.
enableAtAddress
(
false
)
}
else
{
}
else
{
this
.
atAddress
.
removeAttribute
(
'disabled'
)
if
((
this
.
selectContractNames
&&
!
this
.
selectContractNames
.
getAttribute
(
'disabled'
)
&&
this
.
loadType
===
'sol'
)
||
this
.
loadType
===
'abi'
)
{
this
.
enableAtAddress
(
true
)
}
else
{
this
.
enableAtAddress
(
false
)
}
}
}
}
}
changeCurrentFile
(
currentFile
)
{
changeCurrentFile
(
currentFile
)
{
if
(
!
document
.
querySelector
(
`.
${
css
.
contractNames
}
`
))
return
if
(
!
document
.
querySelector
(
`.
${
css
.
contractNames
}
`
))
return
var
contractNames
=
document
.
querySelector
(
`.
${
css
.
contractNames
.
classNames
[
0
]}
`
)
if
(
/.
(
.abi
)
$/
.
exec
(
currentFile
))
{
if
(
/.
(
.abi
)
$/
.
exec
(
currentFile
))
{
this
.
createPanel
.
style
.
display
=
'none'
this
.
createPanel
.
style
.
display
=
'none'
this
.
orLabel
.
style
.
display
=
'none'
this
.
orLabel
.
style
.
display
=
'none'
this
.
compFails
.
style
.
display
=
'none'
this
.
compFails
.
style
.
display
=
'none'
contractNames
.
appendChild
(
yo
`<option>(abi)</option>`
)
this
.
loadType
=
'abi'
this
.
selectContractNames
.
setAttribute
(
'disabled'
,
true
)
this
.
contractNamesContainer
.
style
.
display
=
'block'
while
(
this
.
selectContractNames
.
options
.
length
>
0
)
this
.
selectContractNames
.
remove
(
0
)
this
.
selectContractNames
.
appendChild
(
yo
`<option>
${
currentFile
}
</option>`
)
this
.
enableContractNames
(
true
)
this
.
enableAtAddress
(
true
)
}
else
if
(
/.
(
.sol
)
$/
.
exec
(
currentFile
))
{
}
else
if
(
/.
(
.sol
)
$/
.
exec
(
currentFile
))
{
this
.
createPanel
.
style
.
display
=
'block'
this
.
createPanel
.
style
.
display
=
'block'
this
.
orLabel
.
style
.
display
=
'block'
this
.
orLabel
.
style
.
display
=
'block'
this
.
contractNamesContainer
.
style
.
display
=
'block'
this
.
loadType
=
'sol'
while
(
this
.
selectContractNames
.
options
.
length
>
0
)
this
.
selectContractNames
.
remove
(
0
)
this
.
enableContractNames
(
false
)
this
.
enableAtAddress
(
false
)
}
else
{
this
.
loadType
=
'other'
this
.
createPanel
.
style
.
display
=
'none'
this
.
orLabel
.
style
.
display
=
'none'
this
.
compFails
.
style
.
display
=
'none'
this
.
contractNamesContainer
.
style
.
display
=
'none'
this
.
enableContractNames
(
false
)
this
.
enableAtAddress
(
false
)
}
}
}
}
...
...
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