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
dc7741e9
Commit
dc7741e9
authored
Feb 05, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comply with linter
parent
e2f1d740
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
compiler.js
src/compiler.js
+3
-3
deployer.js
src/deployer.js
+7
-8
No files found.
src/compiler.js
View file @
dc7741e9
...
...
@@ -36,10 +36,10 @@ function compileFileOrFiles (filename, isDirectory, cb) {
compiler
.
compile
(
sources
,
filepath
)
}
],
function
(
err
,
result
)
{
let
errors
=
result
.
errors
.
filter
((
e
)
=>
e
.
type
===
'Error'
)
;
let
errors
=
result
.
errors
.
filter
((
e
)
=>
e
.
type
===
'Error'
)
if
(
errors
.
length
>
0
)
{
console
.
dir
(
errors
)
;
return
cb
(
"errors compiling"
);
console
.
dir
(
errors
)
return
cb
(
new
Error
(
'errors compiling'
))
}
cb
(
err
,
result
.
contracts
)
})
...
...
src/deployer.js
View file @
dc7741e9
...
...
@@ -31,7 +31,7 @@ function deployAll (compileResult, web3, callback) {
compiledObject
[
className
].
filename
=
filename
compiledObject
[
className
].
className
=
className
if
(
contractFile
.
indexOf
(
"_test.sol"
)
>=
0
)
{
if
(
contractFile
.
indexOf
(
'_test.sol'
)
>=
0
)
{
compiledObject
[
className
].
isTest
=
true
}
}
...
...
@@ -39,22 +39,22 @@ function deployAll (compileResult, web3, callback) {
next
()
},
function
determineContractsToDeploy
(
next
)
{
let
contractsToDeploy
=
[
'Assert'
]
;
let
allContracts
=
Object
.
keys
(
compiledObject
)
;
let
contractsToDeploy
=
[
'Assert'
]
let
allContracts
=
Object
.
keys
(
compiledObject
)
for
(
let
contractName
of
allContracts
)
{
if
(
contractName
===
'Assert'
)
{
continue
;
continue
}
if
(
compiledObject
[
contractName
].
isTest
)
{
contractsToDeploy
.
push
(
contractName
)
}
}
next
(
null
,
contractsToDeploy
)
;
next
(
null
,
contractsToDeploy
)
},
function
deployContracts
(
contractsToDeploy
,
next
)
{
async
.
eachOfLimit
(
contractsToDeploy
,
1
,
function
(
contractName
,
index
,
nextEach
)
{
let
contract
=
compiledObject
[
contractName
]
;
let
contract
=
compiledObject
[
contractName
]
let
contractObject
=
new
web3
.
eth
.
Contract
(
contract
.
abi
)
let
contractCode
=
'0x'
+
contract
.
code
...
...
@@ -76,7 +76,7 @@ function deployAll (compileResult, web3, callback) {
contractCode
=
contractCode
.
replace
(
new
RegExp
(
toReplace
,
'g'
),
contractObj
.
deployedAddress
.
slice
(
2
))
}
let
deployObject
=
contractObject
.
deploy
({
arguments
:
[],
data
:
contractCode
})
;
let
deployObject
=
contractObject
.
deploy
({
arguments
:
[],
data
:
contractCode
})
deployObject
.
estimateGas
().
then
((
gasValue
)
=>
{
deployObject
.
send
({
...
...
@@ -93,7 +93,6 @@ function deployAll (compileResult, web3, callback) {
nextEach
()
})
})
},
function
()
{
next
(
null
,
contracts
)
})
...
...
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