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
661d6cf0
Commit
661d6cf0
authored
Dec 14, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decodeFromMemory enum, int, uint
parent
e14125ff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
Enum.js
src/solidity/types/Enum.js
+7
-0
Int.js
src/solidity/types/Int.js
+5
-0
Uint.js
src/solidity/types/Uint.js
+5
-0
No files found.
src/solidity/types/Enum.js
View file @
661d6cf0
...
@@ -30,6 +30,13 @@ Enum.prototype.decodeLocals = function (stackHeight, stack, memory) {
...
@@ -30,6 +30,13 @@ Enum.prototype.decodeLocals = function (stackHeight, stack, memory) {
return
output
(
defaultValue
,
this
.
enumDef
)
return
output
(
defaultValue
,
this
.
enumDef
)
}
}
Enum
.
prototype
.
decodeFromMemory
=
function
(
offset
,
memory
)
{
var
value
=
memory
.
substr
(
offset
,
64
)
value
=
util
.
extractHexByteSlice
(
value
,
this
.
storageBytes
,
0
)
value
=
parseInt
(
value
,
16
)
return
output
(
value
,
this
.
enumDef
)
}
function
output
(
value
,
enumDef
)
{
function
output
(
value
,
enumDef
)
{
if
(
enumDef
.
children
.
length
>
value
)
{
if
(
enumDef
.
children
.
length
>
value
)
{
return
enumDef
.
children
[
value
].
attributes
.
name
return
enumDef
.
children
[
value
].
attributes
.
name
...
...
src/solidity/types/Int.js
View file @
661d6cf0
...
@@ -19,4 +19,9 @@ Int.prototype.decodeLocals = function (stackHeight, stack, memory) {
...
@@ -19,4 +19,9 @@ Int.prototype.decodeLocals = function (stackHeight, stack, memory) {
}
}
}
}
Int
.
prototype
.
decodeFromMemory
=
function
(
offset
,
memory
)
{
var
value
=
memory
.
substr
(
offset
,
64
)
return
util
.
decodeIntFromHex
(
value
,
32
,
true
)
}
module
.
exports
=
Int
module
.
exports
=
Int
src/solidity/types/Uint.js
View file @
661d6cf0
...
@@ -19,4 +19,9 @@ Uint.prototype.decodeLocals = function (stackHeight, stack, memory) {
...
@@ -19,4 +19,9 @@ Uint.prototype.decodeLocals = function (stackHeight, stack, memory) {
}
}
}
}
Uint
.
prototype
.
decodeFromMemory
=
function
(
offset
,
memory
)
{
var
value
=
memory
.
substr
(
offset
,
64
)
return
util
.
decodeIntFromHex
(
value
,
this
.
storageBytes
,
false
)
}
module
.
exports
=
Uint
module
.
exports
=
Uint
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