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
fc7396bb
Commit
fc7396bb
authored
Mar 14, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move typeConversion into remixLib
parent
b841624b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
index.js
remix-lib/index.js
+3
-1
typeConversion.js
remix-lib/src/execution/typeConversion.js
+42
-0
No files found.
remix-lib/index.js
View file @
fc7396bb
...
...
@@ -23,6 +23,7 @@ var txHelper = require('./src/execution/txHelper')
var
txFormat
=
require
(
'./src/execution/txFormat'
)
var
txListener
=
require
(
'./src/execution/txListener'
)
var
executionContext
=
require
(
'./src/execution/execution-context'
)
var
typeConversion
=
require
(
'./src/execution/typeConversion'
)
if
(
typeof
(
module
)
!==
'undefined'
&&
typeof
(
module
.
exports
)
!==
'undefined'
)
{
module
.
exports
=
modules
()
...
...
@@ -63,7 +64,8 @@ function modules () {
txHelper
:
txHelper
,
executionContext
:
executionContext
,
txFormat
:
txFormat
,
txListener
:
txListener
txListener
:
txListener
,
typeConversion
:
typeConversion
}
}
}
remix-lib/src/execution/typeConversion.js
0 → 100644
View file @
fc7396bb
'use strict'
var
ethJSUtil
=
require
(
'ethereumjs-util'
)
var
BN
=
ethJSUtil
.
BN
module
.
exports
=
{
toInt
:
(
h
)
=>
{
if
(
h
.
indexOf
&&
h
.
indexOf
(
'0x'
)
===
0
)
{
return
(
new
BN
(
h
.
replace
(
'0x'
,
''
),
16
)).
toString
(
10
)
}
else
if
(
h
.
constructor
&&
h
.
constructor
.
name
===
'BigNumber'
||
BN
.
isBN
(
h
))
{
return
h
.
toString
(
10
)
}
return
h
},
stringify
:
stringify
}
function
stringify
(
v
)
{
try
{
if
(
v
instanceof
Array
)
{
var
ret
=
[]
for
(
var
k
in
v
)
{
ret
.
push
(
stringify
(
v
[
k
]))
}
return
ret
}
else
if
(
BN
.
isBN
(
v
)
||
(
v
.
constructor
&&
v
.
constructor
.
name
===
'BigNumber'
))
{
return
v
.
toString
(
10
)
}
else
if
(
v
.
_isBuffer
)
{
return
ethJSUtil
.
bufferToHex
(
v
)
}
else
if
(
typeof
v
===
'object'
)
{
var
retObject
=
{}
for
(
var
i
in
v
)
{
retObject
[
i
]
=
stringify
(
v
[
i
])
}
return
retObject
}
else
{
return
v
}
}
catch
(
e
)
{
console
.
log
(
e
)
return
v
}
}
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