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
d7669a2b
Commit
d7669a2b
authored
Feb 01, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor waterfall and cleanup, pass file to compile module
parent
477c38bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
14 deletions
+8
-14
index.js
index.js
+5
-11
compiler.js
src/compiler.js
+3
-3
No files found.
index.js
View file @
d7669a2b
var
async
=
require
(
'async'
);
let
remixLib
=
require
(
'remix-lib'
);
let
Compiler
=
require
(
'./src/compiler.js'
);
let
Deployer
=
require
(
'./src/deployer.js'
);
...
...
@@ -10,17 +9,12 @@ var runTest = function(contractName, contractObj, cb) {
}
var
runTestFile
=
function
(
filename
,
web3
)
{
let
result
,
accounts
,
contracts
;
async
.
waterfall
([
function
compile
(
next
)
{
Compiler
.
compileAll
(
function
(
err
,
compilationResult
)
{
result
=
compilationResult
;
next
();
});
Compiler
.
compileFile
(
filename
,
next
);
},
function
deployAllContracts
(
next
)
{
Deployer
.
deployAll
(
r
esult
,
web3
,
next
);
function
deployAllContracts
(
compilationResult
,
next
)
{
Deployer
.
deployAll
(
compilationR
esult
,
web3
,
next
);
},
function
runTests
(
contracts
,
next
)
{
runTest
(
"SimpleStorage"
,
contracts
.
MyTest
,
next
);
...
...
@@ -29,7 +23,7 @@ var runTestFile = function(filename, web3) {
});
}
module
.
exports
=
{
runTestFile
:
runTestFile
runTestFile
:
runTestFile
,
runTest
:
runTest
};
src/compiler.js
View file @
d7669a2b
...
...
@@ -6,13 +6,13 @@ let compilerInput = remixLib.helpers.compiler;
let
RemixCompiler
=
require
(
'remix-solidity'
).
Compiler
;
// TODO: replace this with remix's own compiler code
function
compile
All
(
cb
)
{
function
compile
File
(
filename
,
cb
)
{
console
.
log
(
"compile all"
);
let
compiler
;
const
sources
=
{
"simple_storage.sol"
:
{
content
:
fs
.
readFileSync
(
"examples/simple_storage.sol"
).
toString
()},
"tests.sol"
:
{
content
:
fs
.
readFileSync
(
"sol/tests.sol"
).
toString
()},
"simple_storage.sol"
:
{
content
:
fs
.
readFileSync
(
"examples/simple_storage.sol"
).
toString
()},
"simple_storage_test.sol"
:
{
content
:
fs
.
readFileSync
(
"examples/simple_storage_test.sol"
).
toString
()}
};
...
...
@@ -39,6 +39,6 @@ function compileAll(cb) {
}
module
.
exports
=
{
compile
All
:
compileAll
compile
File
:
compileFile
}
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