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
422ac5cb
Commit
422ac5cb
authored
Dec 06, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename contractsDetail contracts
parent
dc2574e7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
16 deletions
+16
-16
sourceLocationTracker.js
src/code/sourceLocationTracker.js
+8
-8
localDecoder.js
src/solidity/localDecoder.js
+2
-2
Ethdebugger.js
src/ui/Ethdebugger.js
+3
-3
SolidityState.js
src/ui/SolidityState.js
+2
-2
localDecoder.js
test/solidity/localDecoder.js
+1
-1
No files found.
src/code/sourceLocationTracker.js
View file @
422ac5cb
...
...
@@ -20,11 +20,11 @@ function SourceLocationTracker (_codeManager) {
* @param {Object} contractDetails - AST of compiled contracts
* @param {Function} cb - callback function
*/
SourceLocationTracker
.
prototype
.
getSourceLocation
=
function
(
address
,
index
,
contracts
Details
,
cb
)
{
SourceLocationTracker
.
prototype
.
getSourceLocation
=
function
(
address
,
index
,
contracts
,
cb
)
{
var
self
=
this
this
.
codeManager
.
getCode
(
address
,
function
(
error
,
result
)
{
if
(
!
error
)
{
var
sourceMap
=
getSourceMap
(
address
,
result
.
bytecode
,
contracts
Details
)
var
sourceMap
=
getSourceMap
(
address
,
result
.
bytecode
,
contracts
)
if
(
sourceMap
)
{
cb
(
null
,
self
.
sourceMappingDecoder
.
atIndex
(
index
,
sourceMap
))
}
else
{
...
...
@@ -44,11 +44,11 @@ SourceLocationTracker.prototype.getSourceLocation = function (address, index, co
* @param {Object} contractDetails - AST of compiled contracts
* @param {Function} cb - callback function
*/
SourceLocationTracker
.
prototype
.
getSourceLocation
=
function
(
address
,
vmtraceStepIndex
,
contracts
Details
,
cb
)
{
SourceLocationTracker
.
prototype
.
getSourceLocation
=
function
(
address
,
vmtraceStepIndex
,
contracts
,
cb
)
{
var
self
=
this
this
.
codeManager
.
getCode
(
address
,
function
(
error
,
result
)
{
if
(
!
error
)
{
var
sourceMap
=
getSourceMap
(
address
,
result
.
bytecode
,
contracts
Details
)
var
sourceMap
=
getSourceMap
(
address
,
result
.
bytecode
,
contracts
)
if
(
sourceMap
)
{
self
.
codeManager
.
getInstructionIndex
(
address
,
vmtraceStepIndex
,
function
(
error
,
index
)
{
if
(
error
)
{
...
...
@@ -73,12 +73,12 @@ function srcmapRuntime (contract) {
return
contract
.
srcmapRuntime
?
contract
.
srcmapRuntime
:
contract
[
'srcmap-runtime'
]
}
function
getSourceMap
(
address
,
code
,
contracts
Details
)
{
function
getSourceMap
(
address
,
code
,
contracts
)
{
var
isCreation
=
helper
.
isContractCreation
(
address
)
var
byteProp
=
isCreation
?
'bytecode'
:
'runtimeBytecode'
for
(
var
k
in
contracts
Details
)
{
if
(
'0x'
+
contracts
Details
[
k
][
byteProp
]
===
code
)
{
return
isCreation
?
contracts
Details
[
k
].
srcmap
:
srcmapRuntime
(
contractsDetail
s
[
k
])
for
(
var
k
in
contracts
)
{
if
(
'0x'
+
contracts
[
k
][
byteProp
]
===
code
)
{
return
isCreation
?
contracts
[
k
].
srcmap
:
srcmapRuntime
(
contract
s
[
k
])
}
}
return
null
...
...
src/solidity/localDecoder.js
View file @
422ac5cb
...
...
@@ -5,7 +5,7 @@ var decodeInfo = require('../solidity/decodeInfo')
function
LocalDecoder
(
parent
,
codeManager
,
traceAnalyserEvent
)
{
this
.
astWalker
=
new
AstWalker
()
this
.
codeManager
=
this
.
codeManager
this
.
codeManager
=
codeManager
this
.
parent
=
parent
this
.
locals
=
{}
this
.
loading
=
false
...
...
@@ -26,7 +26,7 @@ LocalDecoder.prototype.push = function (index, step, callStack, cache) {
if
(
!
this
.
parent
.
sources
)
return
if
(
step
.
op
.
indexOf
(
'PUSH'
)
===
0
)
{
var
self
=
this
var
compiledContracts
=
this
.
parent
.
contracts
Detail
var
compiledContracts
=
this
.
parent
.
contracts
var
address
=
callStack
[
callStack
.
length
-
1
]
this
.
sourceLocationTracker
.
getSourceLocation
(
address
,
index
,
compiledContracts
,
function
(
error
,
result
)
{
if
(
error
)
{
...
...
src/ui/Ethdebugger.js
View file @
422ac5cb
...
...
@@ -20,7 +20,7 @@ function Ethdebugger () {
this
.
currentStepIndex
=
-
1
this
.
tx
this
.
sources
this
.
contracts
Detail
this
.
contracts
this
.
statusMessage
=
''
this
.
view
...
...
@@ -79,10 +79,10 @@ Ethdebugger.prototype.setCompilationResult = function (compilationResult) {
if
(
compilationResult
&&
compilationResult
.
sources
&&
compilationResult
.
contracts
)
{
this
.
sources
=
compilationResult
.
sources
this
.
sourceList
=
compilationResult
.
sourceList
this
.
contracts
Detail
=
compilationResult
.
contracts
this
.
contracts
=
compilationResult
.
contracts
}
else
{
this
.
sources
=
null
this
.
contracts
Detail
=
null
this
.
contracts
=
null
this
.
sourceList
=
null
}
}
...
...
src/ui/SolidityState.js
View file @
422ac5cb
...
...
@@ -24,7 +24,7 @@ SolidityState.prototype.init = function () {
return
}
if
(
self
.
parent
.
currentStepIndex
!==
index
)
return
if
(
!
this
.
parent
.
contracts
Detail
||
!
this
.
parent
.
sources
)
{
if
(
!
this
.
parent
.
contracts
||
!
this
.
parent
.
sources
)
{
self
.
basicPanel
.
update
({
info
:
'no source has been specified'
})
return
}
...
...
@@ -41,7 +41,7 @@ SolidityState.prototype.init = function () {
if
(
error
)
{
self
.
basicPanel
.
update
({
info
:
error
})
}
else
{
var
contractName
=
contractNameFromCode
(
self
.
parent
.
contracts
Detail
,
code
.
bytecode
,
address
)
var
contractName
=
contractNameFromCode
(
self
.
parent
.
contracts
,
code
.
bytecode
,
address
)
if
(
contractName
===
null
)
{
self
.
basicPanel
.
update
({
info
:
'could not find compiled contract with address '
+
address
})
}
else
{
...
...
test/solidity/localDecoder.js
View file @
422ac5cb
...
...
@@ -15,7 +15,7 @@ var util = require('../../src/helpers/global')
var
LocalDecoder
=
require
(
'../../src/solidity/localDecoder'
)
tape
(
'solidity'
,
function
(
t
)
{
t
.
test
(
'
storage
decoder'
,
function
(
st
)
{
t
.
test
(
'
local
decoder'
,
function
(
st
)
{
var
privateKey
=
new
Buffer
(
'dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a'
,
'hex'
)
var
address
=
utileth
.
privateToAddress
(
privateKey
)
var
vm
=
initVM
(
st
,
address
)
...
...
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