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
07ca1430
Commit
07ca1430
authored
Aug 01, 2016
by
Alex Beregszaszi
Committed by
GitHub
Aug 01, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #156 from ethereum/dont-display-empty-fields
Dont display empty compiler output fields
parents
28ac90a9
ec40094c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
16 deletions
+43
-16
renderer.js
src/app/renderer.js
+43
-16
No files found.
src/app/renderer.js
View file @
07ca1430
...
...
@@ -74,12 +74,17 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) {
removable_instances
:
true
,
renderOutputModifier
:
function
(
contractName
,
$contractOutput
)
{
var
contract
=
data
.
contracts
[
contractName
];
return
$contractOutput
.
append
(
textRow
(
'Bytecode'
,
contract
.
bytecode
))
.
append
(
textRow
(
'Interface'
,
contract
[
'interface'
]))
.
append
(
textRow
(
'Web3 deploy'
,
gethDeploy
(
contractName
.
toLowerCase
(),
contract
[
'interface'
],
contract
.
bytecode
),
'deploy'
))
.
append
(
textRow
(
'uDApp'
,
combined
(
contractName
,
contract
[
'interface'
],
contract
.
bytecode
),
'deploy'
))
.
append
(
getDetails
(
contract
,
source
,
contractName
));
if
(
contract
.
bytecode
)
{
$contractOutput
.
append
(
textRow
(
'Bytecode'
,
contract
.
bytecode
));
}
$contractOutput
.
append
(
textRow
(
'Interface'
,
contract
[
'interface'
]));
if
(
contract
.
bytecode
)
{
$contractOutput
.
append
(
textRow
(
'Web3 deploy'
,
gethDeploy
(
contractName
.
toLowerCase
(),
contract
[
'interface'
],
contract
.
bytecode
),
'deploy'
));
$contractOutput
.
append
(
textRow
(
'uDApp'
,
combined
(
contractName
,
contract
[
'interface'
],
contract
.
bytecode
),
'deploy'
));
}
return
$contractOutput
.
append
(
getDetails
(
contract
,
source
,
contractName
));
}
},
transactionDebugger
);
...
...
@@ -129,24 +134,35 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) {
var
getDetails
=
function
(
contract
,
source
,
contractName
)
{
var
button
=
$
(
'<button>Toggle Details</button>'
);
var
details
=
$
(
'<div style="display: none;"/>'
)
.
append
(
tableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
))
.
append
(
tableRow
(
'Opcodes'
,
contract
.
opcodes
));
.
append
(
tableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
));
if
(
contract
.
opcodes
!==
''
)
{
details
.
append
(
tableRow
(
'Opcodes'
,
contract
.
opcodes
));
}
var
funHashes
=
''
;
for
(
var
fun
in
contract
.
functionHashes
)
{
funHashes
+=
contract
.
functionHashes
[
fun
]
+
' '
+
fun
+
'
\
n'
;
}
details
.
append
(
$
(
'<span class="col1">Functions</span>'
));
details
.
append
(
$
(
'<pre/>'
).
text
(
funHashes
));
details
.
append
(
$
(
'<span class="col1">Gas Estimates</span>'
));
details
.
append
(
$
(
'<pre/>'
).
text
(
formatGasEstimates
(
contract
.
gasEstimates
)));
var
gasEstimates
=
formatGasEstimates
(
contract
.
gasEstimates
);
if
(
gasEstimates
)
{
details
.
append
(
$
(
'<span class="col1">Gas Estimates</span>'
));
details
.
append
(
$
(
'<pre/>'
).
text
(
gasEstimates
));
}
if
(
contract
.
runtimeBytecode
&&
contract
.
runtimeBytecode
.
length
>
0
)
{
details
.
append
(
tableRow
(
'Runtime Bytecode'
,
contract
.
runtimeBytecode
));
}
if
(
contract
.
assembly
!==
null
)
{
details
.
append
(
$
(
'<span class="col1">Assembly</span>'
));
var
assembly
=
$
(
'<pre/>'
).
text
(
formatAssemblyText
(
contract
.
assembly
,
''
,
source
));
details
.
append
(
assembly
);
}
button
.
click
(
function
()
{
detailsOpen
[
contractName
]
=
!
detailsOpen
[
contractName
];
details
.
toggle
();
});
if
(
detailsOpen
[
contractName
])
{
details
.
show
();
...
...
@@ -155,20 +171,31 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) {
};
var
formatGasEstimates
=
function
(
data
)
{
// FIXME: the whole gasEstimates object should be nil instead
if
(
data
.
creation
===
undefined
&&
data
.
external
===
undefined
&&
data
.
internal
===
undefined
)
{
return
;
}
var
gasToText
=
function
(
g
)
{
return
g
===
null
?
'unknown'
:
g
;
};
var
text
=
''
;
var
fun
;
if
(
'creation'
in
data
)
{
text
+=
'Creation: '
+
gasToText
(
data
.
creation
[
0
])
+
' + '
+
gasToText
(
data
.
creation
[
1
])
+
'
\
n'
;
}
text
+=
'External:
\
n'
;
for
(
fun
in
data
.
external
)
{
text
+=
' '
+
fun
+
': '
+
gasToText
(
data
.
external
[
fun
])
+
'
\
n'
;
if
(
'external'
in
data
)
{
text
+=
'External:
\
n'
;
for
(
fun
in
data
.
external
)
{
text
+=
' '
+
fun
+
': '
+
gasToText
(
data
.
external
[
fun
])
+
'
\
n'
;
}
}
text
+=
'Internal:
\
n'
;
for
(
fun
in
data
.
internal
)
{
text
+=
' '
+
fun
+
': '
+
gasToText
(
data
.
internal
[
fun
])
+
'
\
n'
;
if
(
'internal'
in
data
)
{
text
+=
'Internal:
\
n'
;
for
(
fun
in
data
.
internal
)
{
text
+=
' '
+
fun
+
': '
+
gasToText
(
data
.
internal
[
fun
])
+
'
\
n'
;
}
}
return
text
;
};
...
...
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