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
ad96e2cc
Commit
ad96e2cc
authored
Jun 23, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- clean code
- normalize hex
parent
837a695b
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
14 deletions
+19
-14
ButtonNavigator.js
src/ButtonNavigator.js
+1
-1
Ethdebugger.js
src/Ethdebugger.js
+1
-3
StackPanel.js
src/StackPanel.js
+3
-1
StoragePanel.js
src/StoragePanel.js
+0
-0
TxBrowser.js
src/TxBrowser.js
+1
-5
traceHelper.js
src/helpers/traceHelper.js
+2
-1
ui.js
src/helpers/ui.js
+8
-0
traceRetriever.js
src/trace/traceRetriever.js
+2
-2
TestTraceRetriever.js
test/TestTraceRetriever.js
+1
-1
No files found.
src/ButtonNavigator.js
View file @
ad96e2cc
...
@@ -63,7 +63,7 @@ ButtonNavigator.prototype.stepChanged = function (step) {
...
@@ -63,7 +63,7 @@ ButtonNavigator.prototype.stepChanged = function (step) {
}
else
{
}
else
{
self
.
intoForwardDisabled
=
step
>=
length
-
1
self
.
intoForwardDisabled
=
step
>=
length
-
1
self
.
overForwardDisabled
=
step
>=
length
-
1
self
.
overForwardDisabled
=
step
>=
length
-
1
self
.
Nextc
allDisabled
=
step
>=
length
-
1
self
.
nextC
allDisabled
=
step
>=
length
-
1
}
}
})
})
}
}
...
...
src/Ethdebugger.js
View file @
ad96e2cc
...
@@ -10,9 +10,8 @@ var yo = require('yo-yo')
...
@@ -10,9 +10,8 @@ var yo = require('yo-yo')
var
init
=
require
(
'./helpers/init'
)
var
init
=
require
(
'./helpers/init'
)
var
ui
=
require
(
'./helpers/ui'
)
var
ui
=
require
(
'./helpers/ui'
)
function
Ethdebugger
(
_context
)
{
function
Ethdebugger
()
{
util
.
extend
(
this
,
new
EventManager
())
util
.
extend
(
this
,
new
EventManager
())
this
.
context
=
_context
this
.
currentStepIndex
=
-
1
this
.
currentStepIndex
=
-
1
this
.
tx
this
.
tx
...
@@ -35,7 +34,6 @@ function Ethdebugger (_context) {
...
@@ -35,7 +34,6 @@ function Ethdebugger (_context) {
}
}
Ethdebugger
.
prototype
.
render
=
function
()
{
Ethdebugger
.
prototype
.
render
=
function
()
{
var
self
=
this
return
(
return
(
yo
`<div style=
${
ui
.
formatCss
(
style
.
font
)}
>
yo
`<div style=
${
ui
.
formatCss
(
style
.
font
)}
>
<h1 style=
${
ui
.
formatCss
(
style
.
container
)}
>Eth Debugger</h1>
<h1 style=
${
ui
.
formatCss
(
style
.
container
)}
>Eth Debugger</h1>
...
...
src/StackPanel.js
View file @
ad96e2cc
'use strict'
'use strict'
var
BasicPanel
=
require
(
'./BasicPanel'
)
var
BasicPanel
=
require
(
'./BasicPanel'
)
var
ui
=
require
(
'./helpers/ui'
)
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
function
StackPanel
(
_parent
,
_traceManager
)
{
function
StackPanel
(
_parent
,
_traceManager
)
{
...
@@ -36,7 +37,8 @@ StackPanel.prototype.init = function () {
...
@@ -36,7 +37,8 @@ StackPanel.prototype.init = function () {
StackPanel
.
prototype
.
format
=
function
(
stack
)
{
StackPanel
.
prototype
.
format
=
function
(
stack
)
{
var
ret
=
''
var
ret
=
''
for
(
var
key
in
stack
)
{
for
(
var
key
in
stack
)
{
ret
+=
stack
[
key
]
+
'
\
n'
var
hex
=
ui
.
normalizeHex
(
stack
[
key
])
ret
+=
hex
+
'
\
n'
}
}
return
ret
return
ret
}
}
...
...
src/StoragePanel.js
View file @
ad96e2cc
src/TxBrowser.js
View file @
ad96e2cc
...
@@ -17,12 +17,8 @@ function TxBrowser (_web3) {
...
@@ -17,12 +17,8 @@ function TxBrowser (_web3) {
this
.
view
this
.
view
}
}
/*
getInitialState: function () {
return {blockNumber: '1000110', txNumber: '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51', from: '', to: '', hash: ''}
},
*/
// 0xcda2b2835add61af54cf83bd076664d98d7908c6cd98d86423b3b48d8b8e51ff
// creation 0xa9619e1d0a35b2c1d686f5b661b3abd87f998d2844e8e9cc905edb57fc9ce349
// creation 0xa9619e1d0a35b2c1d686f5b661b3abd87f998d2844e8e9cc905edb57fc9ce349
// invokation 0x71a6d583d16d142c5c3e8903060e8a4ee5a5016348a9448df6c3e63b68076ec4
// invokation 0x71a6d583d16d142c5c3e8903060e8a4ee5a5016348a9448df6c3e63b68076ec4
// test:
// test:
...
...
src/helpers/traceHelper.js
View file @
ad96e2cc
'use strict'
'use strict'
var
ui
=
require
(
'../helpers/ui'
)
module
.
exports
=
{
module
.
exports
=
{
// util section
// util section
findLowerBound
:
function
(
target
,
changes
)
{
findLowerBound
:
function
(
target
,
changes
)
{
...
@@ -32,7 +33,7 @@ module.exports = {
...
@@ -32,7 +33,7 @@ module.exports = {
return
this
.
contractCreationToken
(
vmTraceIndex
)
return
this
.
contractCreationToken
(
vmTraceIndex
)
}
else
if
(
this
.
isCallInstruction
(
step
))
{
}
else
if
(
this
.
isCallInstruction
(
step
))
{
var
stack
=
step
.
stack
// callcode, delegatecall, ...
var
stack
=
step
.
stack
// callcode, delegatecall, ...
return
stack
[
stack
.
length
-
2
]
return
ui
.
normalizeHex
(
stack
[
stack
.
length
-
2
])
}
}
return
undefined
return
undefined
},
},
...
...
src/helpers/ui.js
View file @
ad96e2cc
...
@@ -41,5 +41,13 @@ module.exports = {
...
@@ -41,5 +41,13 @@ module.exports = {
}
}
}
}
return
ret
return
ret
},
normalizeHex
:
function
(
hex
)
{
if
(
hex
.
indexOf
(
'0x'
)
===
0
)
{
hex
=
hex
.
replace
(
'0x'
,
''
)
}
hex
=
hex
.
replace
(
/^0+/
,
''
)
return
'0x'
+
hex
}
}
}
}
src/trace/traceRetriever.js
View file @
ad96e2cc
...
@@ -11,7 +11,7 @@ TraceRetriever.prototype.getTrace = function (txHash, callback) {
...
@@ -11,7 +11,7 @@ TraceRetriever.prototype.getTrace = function (txHash, callback) {
disableStorage
:
this
.
debugStorageAtAvailable
(),
disableStorage
:
this
.
debugStorageAtAvailable
(),
disableMemory
:
false
,
disableMemory
:
false
,
disableStack
:
false
,
disableStack
:
false
,
fullStorage
:
!
this
.
debugStorageAtAvailable
()
fullStorage
:
false
//
!this.debugStorageAtAvailable()
}
}
this
.
web3
.
debug
.
traceTransaction
(
txHash
,
options
,
function
(
error
,
result
)
{
this
.
web3
.
debug
.
traceTransaction
(
txHash
,
options
,
function
(
error
,
result
)
{
callback
(
error
,
result
)
callback
(
error
,
result
)
...
@@ -33,7 +33,7 @@ TraceRetriever.prototype.getStorage = function (tx, address, callback) {
...
@@ -33,7 +33,7 @@ TraceRetriever.prototype.getStorage = function (tx, address, callback) {
}
}
TraceRetriever
.
prototype
.
debugStorageAtAvailable
=
function
()
{
TraceRetriever
.
prototype
.
debugStorageAtAvailable
=
function
()
{
return
t
rue
// storageAt not available if using geth
return
t
his
.
web3
.
version
.
node
.
toLowerCase
().
indexOf
(
'geth'
)
===
-
1
// storageAt not available if using geth
}
}
module
.
exports
=
TraceRetriever
module
.
exports
=
TraceRetriever
test/TestTraceRetriever.js
View file @
ad96e2cc
...
@@ -32,7 +32,7 @@ TestTraceRetriever.prototype.getStorage = function (tx, address, callback) {
...
@@ -32,7 +32,7 @@ TestTraceRetriever.prototype.getStorage = function (tx, address, callback) {
}
}
TestTraceRetriever
.
prototype
.
debugStorageAtAvailable
=
function
()
{
TestTraceRetriever
.
prototype
.
debugStorageAtAvailable
=
function
()
{
return
false
//
storageAt not available if using geth
return
false
//
test scenario does not require web3.
}
}
module
.
exports
=
TestTraceRetriever
module
.
exports
=
TestTraceRetriever
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