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
b2b42411
Commit
b2b42411
authored
Dec 03, 2016
by
chriseth
Committed by
GitHub
Dec 03, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #346 from ethereum/display-metadata-hash
Display metadata hash if found
parents
f89efc8e
6f04478e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
renderer.js
src/app/renderer.js
+13
-0
ui-helper.js
src/app/ui-helper.js
+4
-0
No files found.
src/app/renderer.js
View file @
b2b42411
...
...
@@ -91,6 +91,13 @@ Renderer.prototype.contracts = function (data, source) {
})
}
var
retrieveMetadataHash
=
function
(
bytecode
)
{
var
match
=
/a165627a7a72305820
([
0-9a-f
]{64})
0029$/
.
exec
(
bytecode
)
if
(
match
)
{
return
match
[
1
]
}
}
var
renderOutputModifier
=
function
(
contractName
,
$contractOutput
)
{
var
contract
=
data
.
contracts
[
contractName
]
if
(
contract
.
bytecode
)
{
...
...
@@ -101,6 +108,12 @@ Renderer.prototype.contracts = function (data, source) {
if
(
contract
.
bytecode
)
{
$contractOutput
.
append
(
uiHelper
.
preRow
(
'Web3 deploy'
,
uiHelper
.
gethDeploy
(
contractName
.
toLowerCase
(),
contract
[
'interface'
],
contract
.
bytecode
),
'deploy'
))
// check if there's a metadata hash appended
var
metadataHash
=
retrieveMetadataHash
(
contract
.
bytecode
)
if
(
metadataHash
)
{
$contractOutput
.
append
(
uiHelper
.
tableRow
(
'Metadata location'
,
'bzzr://'
+
metadataHash
))
}
}
var
ctrSource
=
getSource
(
contractName
,
source
,
data
)
...
...
src/app/ui-helper.js
View file @
b2b42411
...
...
@@ -130,6 +130,10 @@ module.exports = {
var
button
=
$
(
'<button>Toggle Details</button>'
)
var
details
=
$
(
'<div style="display: none;"/>'
)
if
(
contract
.
metadata
)
{
details
.
append
(
this
.
preRow
(
'Metadata'
,
contract
.
metadata
))
}
var
funHashes
=
''
for
(
var
fun
in
contract
.
functionHashes
)
{
funHashes
+=
contract
.
functionHashes
[
fun
]
+
' '
+
fun
+
'
\
n'
...
...
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