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
15c33e75
Commit
15c33e75
authored
Nov 09, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add more null test
parent
679e24f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
decodeInfo.js
src/solidity/decodeInfo.js
+3
-2
No files found.
src/solidity/decodeInfo.js
View file @
15c33e75
...
...
@@ -181,6 +181,7 @@ function Struct (type, stateDefinitions) {
return
null
}
var
memberDetails
=
getStructMembers
(
match
[
1
],
stateDefinitions
)
// type is used to extract the ast struct definition
if
(
!
memberDetails
)
return
null
return
{
needsFreeStorageSlot
:
true
,
storageBytes
:
memberDetails
.
storageBytes
,
...
...
@@ -224,7 +225,7 @@ function getStructMembers (typeName, stateDefinitions) {
var
decoded
=
decode
(
member
.
attributes
.
type
,
stateDefinitions
)
if
(
!
decoded
)
{
console
.
log
(
'unable to retrieve decode info of '
+
member
.
attributes
.
type
)
continue
return
null
}
members
.
push
(
decoded
)
if
(
decoded
.
needsFreeStorageSlot
)
{
...
...
@@ -263,7 +264,7 @@ function typeClass (fullType) {
*
* @param {Object} type - type name given by the ast node
* @param {Object} stateDefinitions - all state stateDefinitions given by the AST (including struct and enum type declaration)
* @return {Object} - return the corresponding decoder
* @return {Object} - return the corresponding decoder
or null on error
*/
function
decode
(
type
,
stateDefinitions
)
{
var
decodeInfos
=
{
...
...
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