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
cfe1903a
Commit
cfe1903a
authored
May 11, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
load storage async
parent
71cd5801
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
271 additions
and
70 deletions
+271
-70
assemblyItemsBrowser.js
src/assemblyItemsBrowser.js
+136
-42
debugger.js
src/debugger.js
+13
-6
storageResolver.js
src/storageResolver.js
+113
-0
txBrowser.js
src/txBrowser.js
+3
-1
vmTraceBrowser.js
src/vmTraceBrowser.js
+0
-13
vmTraceManager.js
src/vmTraceManager.js
+0
-8
web3Admin.js
src/web3Admin.js
+6
-0
No files found.
src/assemblyItemsBrowser.js
View file @
cfe1903a
This diff is collapsed.
Click to expand it.
src/debugger.js
View file @
cfe1903a
'use strict'
'use strict'
var
React
=
require
(
'react'
)
var
React
=
require
(
'react'
)
var
TxBrowser
=
require
(
'./txBrowser'
)
var
TxBrowser
=
require
(
'./txBrowser'
)
var
VmTraceBrowser
=
require
(
'./vmTrace
Browser'
)
var
AssemblyItemsBrowser
=
require
(
'./assemblyItems
Browser'
)
var
style
=
require
(
'./basicStyles'
)
var
style
=
require
(
'./basicStyles'
)
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
getInitialState
:
function
()
{
getInitialState
:
function
()
{
return
{
vmTrace
:
null
,
state
:
''
,
currentStep
:
-
1
}
return
{
vmTrace
:
null
,
state
:
''
,
currentStep
:
-
1
}
},
},
childContextTypes
:
{
childContextTypes
:
{
...
@@ -25,19 +29,22 @@ module.exports = React.createClass({
...
@@ -25,19 +29,22 @@ module.exports = React.createClass({
<
div
style
=
{
style
.
container
}
>
<
div
style
=
{
style
.
container
}
>
{
this
.
state
.
state
}
{
this
.
state
.
state
}
<
/div
>
<
/div
>
<
VmTraceBrowser
vmTrace
=
{
this
.
state
.
vmTrace
}
/
>
<
AssemblyItemsBrowser
vmTrace
=
{
this
.
state
.
vmTrace
}
transaction
=
{
this
.
state
.
transaction
}
/
>
<
/div
>
<
/div
>
)
)
},
},
retrieveVmTrace
:
function
(
blockNumber
,
txNumber
)
{
retrieveVmTrace
:
function
(
blockNumber
,
txNumber
,
tx
)
{
this
.
setState
({
state
:
'loading...'
})
if
(
this
.
state
.
state
!==
''
)
return
var
self
=
this
var
self
=
this
this
.
setState
({
state
:
'loading...'
})
this
.
props
.
web3
.
debug
.
trace
(
blockNumber
,
parseInt
(
txNumber
),
function
(
error
,
result
)
{
this
.
props
.
web3
.
debug
.
trace
(
blockNumber
,
parseInt
(
txNumber
),
function
(
error
,
result
)
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
{
}
else
{
self
.
setState
({
vmTrace
:
result
,
state
:
''
})
self
.
setState
({
vmTrace
:
result
,
transaction
:
tx
,
state
:
''
})
}
}
})
})
}
}
...
...
src/storageResolver.js
0 → 100644
View file @
cfe1903a
'use strict'
var
React
=
require
(
'react'
)
module
.
exports
=
React
.
createClass
({
contextTypes
:
{
web3
:
React
.
PropTypes
.
object
},
getInitialState
:
function
()
{
return
{
storage
:
{},
storageChanges
:
[],
vmTraceIndexByStorageChange
:
{},
vmTraceChangesRef
:
[]
}
},
init
:
function
()
{
var
defaultState
=
this
.
getInitialState
()
this
.
state
.
storage
=
defaultState
.
storage
this
.
state
.
storageChanges
=
defaultState
.
storageChanges
this
.
state
.
vmTraceIndexByStorageChange
=
defaultState
.
vmTraceIndexByStorageChange
this
.
state
.
vmTraceChangesRef
=
defaultState
.
vmTraceChangesRef
},
render
:
function
()
{
return
null
},
// retrieve the storage of an account just after the execution of txHash
retrieveStorage
:
function
(
address
,
transaction
,
callBack
)
{
if
(
this
.
state
.
storage
[
address
])
{
callBack
(
this
.
state
.
storage
[
address
])
}
var
self
=
this
if
(
transaction
)
{
this
.
context
.
web3
.
debug
.
storageAt
(
transaction
.
blockNumber
.
toString
(),
transaction
.
transactionIndex
,
address
,
function
(
error
,
result
)
{
if
(
error
)
{
console
.
log
(
error
)
}
else
{
self
.
state
.
storage
[
address
]
=
result
callBack
(
result
)
}
})
}
else
{
console
.
log
(
'transaction is not defined'
)
}
},
trackStorageChange
:
function
(
vmTraceIndex
,
trace
)
{
var
change
=
false
if
(
trace
.
address
)
{
// new context
this
.
state
.
storageChanges
.
push
({
address
:
trace
.
address
,
changes
:
[]
})
change
=
true
}
else
if
(
trace
.
depth
&&
!
trace
.
address
)
{
// returned from context
this
.
state
.
storageChanges
.
push
({
address
:
this
.
state
.
storageChanges
[
this
.
state
.
storageChanges
.
length
-
1
].
address
,
changes
:
[]
})
change
=
true
}
else
if
(
trace
.
inst
===
'SSTORE'
)
{
this
.
state
.
storageChanges
[
this
.
state
.
storageChanges
.
length
-
1
].
changes
.
push
(
{
'key'
:
trace
.
stack
[
trace
.
stack
.
length
-
1
],
'value'
:
trace
.
stack
[
trace
.
stack
.
length
-
2
]
})
change
=
true
}
if
(
change
)
{
this
.
state
.
vmTraceIndexByStorageChange
[
vmTraceIndex
]
=
{
context
:
this
.
state
.
storageChanges
.
length
-
1
,
changes
:
this
.
state
.
storageChanges
[
this
.
state
.
storageChanges
.
length
-
1
].
changes
.
length
-
1
}
this
.
state
.
vmTraceChangesRef
.
push
(
vmTraceIndex
)
}
},
rebuildStorageAt
:
function
(
vmTraceIndex
,
transaction
,
callBack
)
{
var
changesLocation
=
this
.
retrieveLastChange
(
vmTraceIndex
)
if
(
!
changesLocation
)
{
console
.
log
(
'unable to build storage'
)
callBack
({})
}
else
{
var
address
=
this
.
state
.
storageChanges
[
changesLocation
.
context
].
address
this
.
retrieveStorage
(
address
,
transaction
,
function
(
storage
)
{
for
(
var
k
=
0
;
k
<
changesLocation
.
context
;
k
++
)
{
var
context
=
this
.
state
.
storageChanges
[
k
]
if
(
context
.
address
===
address
)
{
for
(
var
i
=
0
;
i
<
context
.
changes
.
length
;
i
++
)
{
if
(
i
>
changesLocation
.
changes
)
break
var
change
=
context
.
changes
[
i
]
storage
[
change
.
key
]
=
change
.
value
}
}
}
callBack
(
storage
)
})
}
},
retrieveLastChange
:
function
(
vmTraceIndex
)
{
var
change
=
this
.
state
.
vmTraceIndexByStorageChange
[
vmTraceIndex
]
if
(
change
)
{
return
change
}
else
{
for
(
var
k
in
this
.
state
.
vmTraceChangesRef
)
{
if
(
this
.
state
.
vmTraceChangesRef
[
k
]
>
vmTraceIndex
)
{
return
this
.
state
.
vmTraceIndexByStorageChange
[
k
-
1
]
}
}
}
}
})
src/txBrowser.js
View file @
cfe1903a
...
@@ -19,8 +19,10 @@ module.exports = React.createClass({
...
@@ -19,8 +19,10 @@ module.exports = React.createClass({
var
tx
=
this
.
context
.
web3
.
eth
.
getTransactionFromBlock
(
this
.
state
.
blockNumber
,
this
.
state
.
txNumber
)
var
tx
=
this
.
context
.
web3
.
eth
.
getTransactionFromBlock
(
this
.
state
.
blockNumber
,
this
.
state
.
txNumber
)
if
(
tx
)
{
if
(
tx
)
{
this
.
setState
({
from
:
tx
.
from
,
to
:
tx
.
to
,
hash
:
tx
.
hash
})
this
.
setState
({
from
:
tx
.
from
,
to
:
tx
.
to
,
hash
:
tx
.
hash
})
this
.
props
.
onNewTxRequested
(
this
.
state
.
blockNumber
,
parseInt
(
this
.
state
.
txNumber
),
tx
)
}
else
{
console
.
log
(
'cannot find '
+
this
.
state
.
blockNumber
+
' '
+
this
.
state
.
txNumber
)
}
}
this
.
props
.
onNewTxRequested
(
this
.
state
.
blockNumber
,
parseInt
(
this
.
state
.
txNumber
))
},
},
updateBlockN
:
function
(
ev
)
{
updateBlockN
:
function
(
ev
)
{
...
...
src/vmTraceBrowser.js
deleted
100644 → 0
View file @
71cd5801
'use strict'
var
React
=
require
(
'react'
)
var
AssemblyItemsBrowser
=
require
(
'./assemblyItemsBrowser'
)
module
.
exports
=
React
.
createClass
({
render
:
function
()
{
return
(
<
div
>
<
AssemblyItemsBrowser
vmTrace
=
{
this
.
props
.
vmTrace
}
/
>
<
/div
>
)
}
})
src/vmTraceManager.js
deleted
100644 → 0
View file @
71cd5801
'use strict'
module
.
exports
=
{
retrieveVmTrace
:
function
(
blockNumber
,
txNumber
,
callBack
)
{
this
.
context
.
web3
.
debug
.
trace
(
blockNumber
,
parseInt
(
txNumber
),
function
(
error
,
result
)
{
callBack
(
error
,
result
)
})
}
}
src/web3Admin.js
View file @
cfe1903a
...
@@ -90,6 +90,12 @@ module.exports = {
...
@@ -90,6 +90,12 @@ module.exports = {
property
:
'debug'
,
property
:
'debug'
,
methods
:
[
methods
:
[
new
web3
.
_extend
.
Method
({
new
web3
.
_extend
.
Method
({
name
:
'storageAt'
,
call
:
'debug_storageAt'
,
inputFormatter
:
[
null
,
null
,
null
],
params
:
3
}),
new
web3
.
_extend
.
Method
({
name
:
'trace'
,
name
:
'trace'
,
call
:
'debug_trace'
,
call
:
'debug_trace'
,
inputFormatter
:
[
null
,
null
],
inputFormatter
:
[
null
,
null
],
...
...
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