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
c5fcbc3c
Commit
c5fcbc3c
authored
Aug 14, 2017
by
yann300
Committed by
GitHub
Aug 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #678 from ethereum/fixNoCompiledContract
Check if there are compiled contract before doing anything
parents
cb160c43
2dd82a3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
compile-tab.js
src/app/tabs/compile-tab.js
+21
-17
run-tab.js
src/app/tabs/run-tab.js
+1
-1
No files found.
src/app/tabs/compile-tab.js
View file @
c5fcbc3c
...
@@ -286,27 +286,31 @@ function compileTab (container, appAPI, appEvents, opts) {
...
@@ -286,27 +286,31 @@ function compileTab (container, appAPI, appEvents, opts) {
function
details
()
{
function
details
()
{
var
select
=
el
.
querySelector
(
'select'
)
var
select
=
el
.
querySelector
(
'select'
)
var
contractName
=
select
.
children
[
select
.
selectedIndex
].
innerText
if
(
select
.
children
.
length
>
0
&&
select
.
selectedIndex
>=
0
)
{
var
details
=
contractsDetails
[
contractName
]
var
contractName
=
select
.
children
[
select
.
selectedIndex
].
innerText
var
keys
=
Object
.
keys
(
contractsDetails
[
contractName
])
var
details
=
contractsDetails
[
contractName
]
var
log
=
yo
`<div class="
${
css
.
detailsJSON
}
"></div>`
var
keys
=
Object
.
keys
(
contractsDetails
[
contractName
])
keys
.
map
(
x
=>
{
var
log
=
yo
`<div class="
${
css
.
detailsJSON
}
"></div>`
var
copyDetails
=
yo
`<span class="
${
css
.
copyDetails
}
"><i title="Copy details" class="fa fa-clipboard" onclick=
${()
=>
{
copy
(
details
[
x
])
}}
aria
-
hidden
=
"true"
><
/i></
span
>
`
keys
.
map
(
x
=>
{
log.appendChild(yo`
<
div
class
=
$
{
css
.
log
}
><pre>
${
x
}
:
${
JSON
.
stringify
(
details
[
x
],
null
,
4
)}
</pre>
${
copyDetails
}
</div>`
)
var
copyDetails
=
yo
`<span class="
${
css
.
copyDetails
}
"><i title="Copy details" class="fa fa-clipboard" onclick=
${()
=>
{
copy
(
details
[
x
])
}}
aria
-
hidden
=
"true"
><
/i></
span
>
`
})
log.appendChild(yo`
<
div
class
=
$
{
css
.
log
}
><pre>
${
x
}
:
${
JSON
.
stringify
(
details
[
x
],
null
,
4
)}
</pre>
${
copyDetails
}
</div>`
)
modalDialog
(
contractName
,
log
,
{
label
:
'OK'
},
{
label
:
''
})
})
modalDialog
(
contractName
,
log
,
{
label
:
'OK'
},
{
label
:
''
})
}
}
}
function
publish
(
appAPI
)
{
function
publish
(
appAPI
)
{
var
selectContractNames
=
document
.
querySelector
(
`.
${
css
.
contractNames
.
classNames
[
0
]}
`
)
var
selectContractNames
=
document
.
querySelector
(
`.
${
css
.
contractNames
.
classNames
[
0
]}
`
)
var
contract
=
contractsDetails
[
selectContractNames
.
children
[
selectContractNames
.
selectedIndex
].
innerText
]
if
(
selectContractNames
.
children
.
length
>
0
&&
selectContractNames
.
selectedIndex
>=
0
)
{
publishOnSwarm
(
contract
,
appAPI
,
function
(
err
)
{
var
contract
=
contractsDetails
[
selectContractNames
.
children
[
selectContractNames
.
selectedIndex
].
innerText
]
if
(
err
)
{
publishOnSwarm
(
contract
,
appAPI
,
function
(
err
)
{
alert
(
'Failed to publish metadata: '
+
err
)
if
(
err
)
{
}
else
{
alert
(
'Failed to publish metadata: '
+
err
)
alert
(
'Metadata published successfully'
)
}
else
{
}
alert
(
'Metadata published successfully'
)
})
}
})
}
}
}
return
el
return
el
}
}
...
...
src/app/tabs/run-tab.js
View file @
c5fcbc3c
...
@@ -231,7 +231,7 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
...
@@ -231,7 +231,7 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
function
setInputParamsPlaceHolder
()
{
function
setInputParamsPlaceHolder
()
{
createButtonInput
.
value
=
''
createButtonInput
.
value
=
''
if
(
appAPI
.
getContracts
())
{
if
(
appAPI
.
getContracts
()
&&
selectContractNames
.
selectedIndex
>=
0
&&
selectContractNames
.
children
.
length
>
0
)
{
var
contract
=
appAPI
.
getContracts
()[
selectContractNames
.
children
[
selectContractNames
.
selectedIndex
].
innerText
]
var
contract
=
appAPI
.
getContracts
()[
selectContractNames
.
children
[
selectContractNames
.
selectedIndex
].
innerText
]
var
ctrabi
=
txHelper
.
getConstructorInterface
(
contract
.
interface
)
var
ctrabi
=
txHelper
.
getConstructorInterface
(
contract
.
interface
)
if
(
ctrabi
.
inputs
.
length
)
{
if
(
ctrabi
.
inputs
.
length
)
{
...
...
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