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
427801ec
Commit
427801ec
authored
Apr 18, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename sha3_32 => sha3_256
parent
6c20c60b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
7 deletions
+7
-7
util.js
src/helpers/util.js
+1
-1
ArrayType.js
src/solidity/types/ArrayType.js
+1
-1
DynamicByteArray.js
src/solidity/types/DynamicByteArray.js
+1
-1
storageViewer.js
src/storage/storageViewer.js
+1
-1
traceCache.js
src/trace/traceCache.js
+1
-1
mockStorageResolver.js
test/solidity/mockStorageResolver.js
+2
-2
No files found.
src/helpers/util.js
View file @
427801ec
...
...
@@ -125,7 +125,7 @@ module.exports = {
* @param {String} value - value to sha3
* @return {Object} - return sha3ied value
*/
sha3_
32
:
function
(
value
)
{
sha3_
256
:
function
(
value
)
{
var
ret
=
ethutil
.
bufferToHex
(
ethutil
.
setLengthLeft
(
value
,
32
))
ret
=
ethutil
.
sha3
(
ret
)
return
ethutil
.
bufferToHex
(
ret
)
...
...
src/solidity/types/ArrayType.js
View file @
427801ec
...
...
@@ -43,7 +43,7 @@ class ArrayType extends RefType {
}
if
(
this
.
arraySize
===
'dynamic'
)
{
size
=
util
.
toBN
(
'0x'
+
slotValue
)
currentLocation
.
slot
=
helper
.
sha3_
32
(
location
.
slot
)
currentLocation
.
slot
=
helper
.
sha3_
256
(
location
.
slot
)
}
else
{
size
=
new
BN
(
this
.
arraySize
)
}
...
...
src/solidity/types/DynamicByteArray.js
View file @
427801ec
...
...
@@ -23,7 +23,7 @@ class DynamicByteArray extends RefType {
var
bn
=
new
BN
(
value
,
16
)
if
(
bn
.
testn
(
0
))
{
var
length
=
bn
.
div
(
new
BN
(
2
))
var
dataPos
=
new
BN
(
helper
.
sha3_
32
(
location
.
slot
).
replace
(
'0x'
,
''
),
16
)
var
dataPos
=
new
BN
(
helper
.
sha3_
256
(
location
.
slot
).
replace
(
'0x'
,
''
),
16
)
var
ret
=
''
var
currentSlot
=
'0x'
try
{
...
...
src/storage/storageViewer.js
View file @
427801ec
...
...
@@ -30,7 +30,7 @@ class StorageViewer {
* @param {Function} - callback - {key, hashedKey, value} -
*/
storageSlot
(
slot
,
callback
)
{
var
hashed
=
helper
.
sha3_
32
(
slot
)
var
hashed
=
helper
.
sha3_
256
(
slot
)
this
.
storageResolver
.
storageSlot
(
hashed
,
this
.
context
.
tx
,
this
.
context
.
stepIndex
,
this
.
storageChanges
,
this
.
context
.
address
,
(
error
,
result
)
=>
{
if
(
error
)
{
callback
(
error
)
...
...
src/trace/traceCache.js
View file @
427801ec
...
...
@@ -87,7 +87,7 @@ TraceCache.prototype.pushStoreChanges = function (index, address, key, value) {
'address'
:
address
,
'key'
:
key
,
'value'
:
value
,
'hashedKey'
:
helper
.
sha3_
32
(
key
)
'hashedKey'
:
helper
.
sha3_
256
(
key
)
}
this
.
storageChanges
.
push
(
index
)
}
...
...
test/solidity/mockStorageResolver.js
View file @
427801ec
...
...
@@ -5,7 +5,7 @@ class MockStorageResolver {
constructor
(
_storage
)
{
this
.
storage
=
{}
for
(
var
k
in
_storage
)
{
var
hashed
=
util
.
sha3_
32
(
k
)
var
hashed
=
util
.
sha3_
256
(
k
)
this
.
storage
[
hashed
]
=
{
hashed
:
hashed
,
key
:
k
,
...
...
@@ -19,7 +19,7 @@ class MockStorageResolver {
}
storageSlot
(
slot
,
callback
)
{
var
hashed
=
util
.
sha3_
32
(
slot
)
var
hashed
=
util
.
sha3_
256
(
slot
)
callback
(
null
,
this
.
storage
[
hashed
])
}
...
...
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