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
a01abbc0
Commit
a01abbc0
authored
Jan 02, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix saving sha3 computation
parent
cd500e7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
web3VmProvider.js
remix-lib/src/web3Provider/web3VmProvider.js
+10
-6
No files found.
remix-lib/src/web3Provider/web3VmProvider.js
View file @
a01abbc0
...
...
@@ -139,9 +139,13 @@ web3VmProvider.prototype.pushTrace = function (self, data) {
console
.
log
(
'no tx processing'
)
return
}
if
(
this
.
previousDepth
>
depth
)
{
var
previousopcode
if
(
self
.
vmTraces
[
self
.
processingHash
]
&&
self
.
vmTraces
[
self
.
processingHash
].
structLogs
[
this
.
processingIndex
-
1
])
{
previousopcode
=
self
.
vmTraces
[
self
.
processingHash
].
structLogs
[
this
.
processingIndex
-
1
]
}
if
(
this
.
previousDepth
>
depth
&&
previousopcode
)
{
// returning from context, set error it is not STOP, RETURN
var
previousopcode
=
self
.
vmTraces
[
self
.
processingHash
].
structLogs
[
this
.
processingIndex
-
1
]
previousopcode
.
invalidDepthChange
=
previousopcode
.
op
!==
'RETURN'
&&
previousopcode
.
op
!==
'STOP'
}
var
step
=
{
...
...
@@ -169,14 +173,14 @@ web3VmProvider.prototype.pushTrace = function (self, data) {
}
}
}
if
(
traceHelper
.
isSHA3Instruction
(
step
))
{
var
sha3Input
=
getSha3Input
(
step
.
stack
,
step
.
memory
)
var
preimage
=
sha3Input
var
imageHash
=
ethutil
.
sha3
(
'0x'
+
sha3Input
).
toString
(
'hex'
)
if
(
previousopcode
&&
traceHelper
.
isSHA3Instruction
(
previousopcode
))
{
var
preimage
=
getSha3Input
(
previousopcode
.
stack
,
previousopcode
.
memory
)
var
imageHash
=
step
.
stack
[
step
.
stack
.
length
-
1
].
replace
(
'0x'
,
''
)
self
.
sha3Preimages
[
imageHash
]
=
{
'preimage'
:
preimage
}
}
this
.
processingIndex
++
this
.
previousDepth
=
depth
}
...
...
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