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
0437df1c
Commit
0437df1c
authored
Sep 01, 2016
by
chriseth
Committed by
GitHub
Sep 01, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #205 from ethereum/contract-detail-cleanup
Contract detail cleanup
parents
48ebe3f1
162cc107
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
13 deletions
+23
-13
ui-helper.js
src/app/ui-helper.js
+23
-13
No files found.
src/app/ui-helper.js
View file @
0437df1c
...
@@ -21,6 +21,13 @@ module.exports = {
...
@@ -21,6 +21,13 @@ module.exports = {
cls
);
cls
);
},
},
preRow
:
function
(
description
,
data
)
{
return
this
.
tableRowItems
(
$
(
'<span/>'
).
text
(
description
),
$
(
'<pre/>'
).
text
(
data
)
);
},
formatAssemblyText
:
function
(
asm
,
prefix
,
source
)
{
formatAssemblyText
:
function
(
asm
,
prefix
,
source
)
{
var
self
=
this
;
var
self
=
this
;
if
(
typeof
asm
===
typeof
''
||
asm
===
null
||
asm
===
undefined
)
{
if
(
typeof
asm
===
typeof
''
||
asm
===
null
||
asm
===
undefined
)
{
...
@@ -96,7 +103,11 @@ module.exports = {
...
@@ -96,7 +103,11 @@ module.exports = {
if
(
data
.
creation
===
undefined
&&
data
.
external
===
undefined
&&
data
.
internal
===
undefined
)
{
if
(
data
.
creation
===
undefined
&&
data
.
external
===
undefined
&&
data
.
internal
===
undefined
)
{
return
;
return
;
}
}
var
gasToText
=
function
(
g
)
{
return
g
===
null
?
'unknown'
:
g
;
};
var
gasToText
=
function
(
g
)
{
return
g
===
null
?
'unknown'
:
g
;
};
var
text
=
''
;
var
text
=
''
;
var
fun
;
var
fun
;
if
(
'creation'
in
data
)
{
if
(
'creation'
in
data
)
{
...
@@ -125,35 +136,34 @@ module.exports = {
...
@@ -125,35 +136,34 @@ module.exports = {
var
details
=
$
(
'<div style="display: none;"/>'
)
var
details
=
$
(
'<div style="display: none;"/>'
)
.
append
(
this
.
tableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
));
.
append
(
this
.
tableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
));
if
(
contract
.
opcodes
!==
''
)
{
details
.
append
(
this
.
tableRow
(
'Opcodes'
,
contract
.
opcodes
));
}
var
funHashes
=
''
;
var
funHashes
=
''
;
for
(
var
fun
in
contract
.
functionHashes
)
{
for
(
var
fun
in
contract
.
functionHashes
)
{
funHashes
+=
contract
.
functionHashes
[
fun
]
+
' '
+
fun
+
'
\
n'
;
funHashes
+=
contract
.
functionHashes
[
fun
]
+
' '
+
fun
+
'
\
n'
;
}
}
details
.
append
(
$
(
'<span class="col1">Functions</span>'
));
details
.
append
(
this
.
preRow
(
'Functions'
,
funHashes
));
details
.
append
(
$
(
'<pre/>'
).
text
(
funHashes
));
var
gasEstimates
=
this
.
formatGasEstimates
(
contract
.
gasEstimates
);
var
gasEstimates
=
this
.
formatGasEstimates
(
contract
.
gasEstimates
);
if
(
gasEstimates
)
{
if
(
gasEstimates
)
{
details
.
append
(
$
(
'<span class="col1">Gas Estimates</span>'
));
details
.
append
(
this
.
preRow
(
'Gas Estimates'
,
gasEstimates
));
details
.
append
(
$
(
'<pre/>'
).
text
(
gasEstimates
));
}
}
if
(
contract
.
runtimeBytecode
&&
contract
.
runtimeBytecode
.
length
>
0
)
{
if
(
contract
.
runtimeBytecode
&&
contract
.
runtimeBytecode
.
length
>
0
)
{
details
.
append
(
this
.
tableRow
(
'Runtime Bytecode'
,
contract
.
runtimeBytecode
));
details
.
append
(
this
.
tableRow
(
'Runtime Bytecode'
,
contract
.
runtimeBytecode
));
}
}
if
(
contract
.
opcodes
!==
undefined
&&
contract
.
opcodes
!==
''
)
{
details
.
append
(
this
.
tableRow
(
'Opcodes'
,
contract
.
opcodes
));
}
if
(
contract
.
assembly
!==
null
)
{
if
(
contract
.
assembly
!==
null
)
{
details
.
append
(
$
(
'<span class="col1">Assembly</span>'
));
details
.
append
(
this
.
preRow
(
'Assembly'
,
this
.
formatAssemblyText
(
contract
.
assembly
,
''
,
source
)));
var
assembly
=
$
(
'<pre/>'
).
text
(
this
.
formatAssemblyText
(
contract
.
assembly
,
''
,
source
));
details
.
append
(
assembly
);
}
}
var
self
=
this
;
var
self
=
this
;
button
.
click
(
function
()
{
self
.
detailsOpen
[
contractName
]
=
!
self
.
detailsOpen
[
contractName
];
details
.
toggle
();
});
button
.
click
(
function
()
{
self
.
detailsOpen
[
contractName
]
=
!
self
.
detailsOpen
[
contractName
];
details
.
toggle
();
});
if
(
this
.
detailsOpen
[
contractName
])
{
if
(
this
.
detailsOpen
[
contractName
])
{
details
.
show
();
details
.
show
();
}
}
...
...
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