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
05645cb5
Commit
05645cb5
authored
Mar 14, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix local (add async)
parent
7a3b7d89
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
9 deletions
+13
-9
localDecoder.js
src/solidity/localDecoder.js
+2
-2
StringType.js
src/solidity/types/StringType.js
+2
-2
ValueType.js
src/solidity/types/ValueType.js
+1
-1
SolidityLocals.js
src/ui/SolidityLocals.js
+5
-2
helper.js
test/solidity/localsTests/helper.js
+3
-2
No files found.
src/solidity/localDecoder.js
View file @
05645cb5
'use strict'
function
solidityLocals
(
vmtraceIndex
,
internalTreeCall
,
stack
,
memory
,
storageResolver
,
currentSourceLocation
)
{
async
function
solidityLocals
(
vmtraceIndex
,
internalTreeCall
,
stack
,
memory
,
storageResolver
,
currentSourceLocation
)
{
var
scope
=
internalTreeCall
.
findScope
(
vmtraceIndex
)
if
(
!
scope
)
{
var
error
=
{
'message'
:
'Can
\'
t display locals. reason: compilation result might not have been provided'
}
...
...
@@ -17,7 +17,7 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory, storageR
name
=
'<'
+
anonymousIncr
+
'>'
anonymousIncr
++
}
locals
[
name
]
=
variable
.
type
.
decodeFromStack
(
variable
.
stackDepth
,
stack
,
memory
,
storageResolver
)
locals
[
name
]
=
await
variable
.
type
.
decodeFromStack
(
variable
.
stackDepth
,
stack
,
memory
,
storageResolver
)
}
}
return
locals
...
...
src/solidity/types/StringType.js
View file @
05645cb5
...
...
@@ -12,8 +12,8 @@ class StringType extends DynamicBytes {
return
format
(
decoded
)
}
decodeFromStack
(
stackDepth
,
stack
,
memory
)
{
return
super
.
decodeFromStack
(
stackDepth
,
stack
,
memory
)
async
decodeFromStack
(
stackDepth
,
stack
,
memory
)
{
return
await
super
.
decodeFromStack
(
stackDepth
,
stack
,
memory
)
}
decodeFromMemoryInternal
(
offset
,
memory
)
{
...
...
src/solidity/types/ValueType.js
View file @
05645cb5
...
...
@@ -32,7 +32,7 @@ class ValueType {
* @param {String} - memory
* @return {Object} - decoded value
*/
decodeFromStack
(
stackDepth
,
stack
,
memory
)
{
async
decodeFromStack
(
stackDepth
,
stack
,
memory
)
{
var
value
if
(
stackDepth
>=
stack
.
length
)
{
value
=
this
.
decodeValue
(
''
)
...
...
src/ui/SolidityLocals.js
View file @
05645cb5
...
...
@@ -41,8 +41,11 @@ class SolidityLocals {
var
stack
=
result
[
0
].
value
var
memory
=
result
[
1
].
value
try
{
var
locals
=
localDecoder
.
solidityLocals
(
this
.
parent
.
currentStepIndex
,
this
.
internalTreeCall
,
stack
,
memory
,
this
.
storageResolver
,
sourceLocation
)
this
.
basicPanel
.
update
(
locals
)
localDecoder
.
solidityLocals
(
this
.
parent
.
currentStepIndex
,
this
.
internalTreeCall
,
stack
,
memory
,
this
.
storageResolver
,
sourceLocation
).
then
((
locals
)
=>
{
if
(
!
result
.
error
)
{
this
.
basicPanel
.
update
(
locals
)
}
})
}
catch
(
e
)
{
warningDiv
.
innerHTML
=
e
.
message
}
...
...
test/solidity/localsTests/helper.js
View file @
05645cb5
...
...
@@ -12,8 +12,9 @@ function decodeLocal (st, index, traceManager, callTree, verifier) {
index
,
function
(
error
,
result
)
{
if
(
!
error
)
{
var
locals
=
localDecoder
.
solidityLocals
(
index
,
callTree
,
result
[
0
].
value
,
result
[
1
].
value
,
{},
{
start
:
5000
})
verifier
(
locals
)
localDecoder
.
solidityLocals
(
index
,
callTree
,
result
[
0
].
value
,
result
[
1
].
value
,
{},
{
start
:
5000
}).
then
((
locals
)
=>
{
verifier
(
locals
)
})
}
else
{
st
.
fail
(
error
)
}
...
...
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