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
ef848d44
Commit
ef848d44
authored
Nov 16, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renaming
parent
3ea4abeb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
decodeInfo.js
src/solidity/decodeInfo.js
+5
-5
Struct.js
src/solidity/types/Struct.js
+1
-1
No files found.
src/solidity/decodeInfo.js
View file @
ef848d44
...
@@ -170,7 +170,7 @@ function getStructMembers (typeName, stateDefinitions) {
...
@@ -170,7 +170,7 @@ function getStructMembers (typeName, stateDefinitions) {
var
offsets
=
computeOffsets
(
dec
.
children
,
stateDefinitions
)
var
offsets
=
computeOffsets
(
dec
.
children
,
stateDefinitions
)
return
{
return
{
members
:
offsets
.
typesOffsets
,
members
:
offsets
.
typesOffsets
,
storage
Byte
s
:
offsets
.
endLocation
.
slot
storage
Slot
s
:
offsets
.
endLocation
.
slot
}
}
}
}
}
}
...
@@ -238,14 +238,14 @@ function computeOffsets (types, stateItems, cb) {
...
@@ -238,14 +238,14 @@ function computeOffsets (types, stateItems, cb) {
for
(
var
i
in
types
)
{
for
(
var
i
in
types
)
{
var
variable
=
types
[
i
]
var
variable
=
types
[
i
]
var
type
=
parseType
(
variable
.
attributes
.
type
,
stateItems
)
var
type
=
parseType
(
variable
.
attributes
.
type
,
stateItems
)
if
(
location
.
offset
+
type
.
storageBytes
>
32
)
{
location
.
slot
++
location
.
offset
=
0
}
if
(
!
type
)
{
if
(
!
type
)
{
console
.
log
(
'unable to retrieve decode info of '
+
variable
.
attributes
.
type
)
console
.
log
(
'unable to retrieve decode info of '
+
variable
.
attributes
.
type
)
return
null
return
null
}
}
if
(
location
.
offset
+
type
.
storageBytes
>
32
)
{
location
.
slot
++
location
.
offset
=
0
}
ret
.
push
({
ret
.
push
({
name
:
variable
.
attributes
.
name
,
name
:
variable
.
attributes
.
name
,
type
:
type
,
type
:
type
,
...
...
src/solidity/types/Struct.js
View file @
ef848d44
'use strict'
'use strict'
function
Struct
(
memberDetails
)
{
function
Struct
(
memberDetails
)
{
this
.
storageSlots
=
memberDetails
.
storage
Byte
s
this
.
storageSlots
=
memberDetails
.
storage
Slot
s
this
.
storageBytes
=
32
this
.
storageBytes
=
32
this
.
members
=
memberDetails
.
members
this
.
members
=
memberDetails
.
members
this
.
typeName
=
'struct'
this
.
typeName
=
'struct'
...
...
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