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
312c6bd4
Unverified
Commit
312c6bd4
authored
Sep 27, 2019
by
yann300
Committed by
GitHub
Sep 27, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1303 from ethereum/tests_with_worker
remix tests worked with compiler loaded using web-worker
parents
b93b3577
a69f11be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
compiler.ts
remix-tests/src/compiler.ts
+6
-5
runTestSources.ts
remix-tests/src/runTestSources.ts
+2
-2
No files found.
remix-tests/src/compiler.ts
View file @
312c6bd4
...
@@ -85,7 +85,7 @@ export function compileFileOrFiles(filename: string, isDirectory: boolean, opts:
...
@@ -85,7 +85,7 @@ export function compileFileOrFiles(filename: string, isDirectory: boolean, opts:
}
}
}
}
export
function
compileContractSources
(
sources
:
SrcIfc
,
importFileCb
:
any
,
opts
:
any
,
cb
:
Function
)
{
export
function
compileContractSources
(
sources
:
SrcIfc
,
versionUrl
:
any
,
usingWorker
:
any
,
importFileCb
:
any
,
opts
:
any
,
cb
:
Function
)
{
let
compiler
,
filepath
:
string
let
compiler
,
filepath
:
string
let
accounts
=
opts
.
accounts
||
[]
let
accounts
=
opts
.
accounts
||
[]
// Iterate over sources keys. Inject test libraries. Inject test library import statements.
// Iterate over sources keys. Inject test libraries. Inject test library import statements.
...
@@ -105,10 +105,11 @@ export function compileContractSources(sources: SrcIfc, importFileCb: any, opts:
...
@@ -105,10 +105,11 @@ export function compileContractSources(sources: SrcIfc, importFileCb: any, opts:
async
.
waterfall
([
async
.
waterfall
([
function
loadCompiler
(
next
:
Function
)
{
function
loadCompiler
(
next
:
Function
)
{
compiler
=
new
RemixCompiler
(
importFileCb
)
compiler
=
new
RemixCompiler
(
importFileCb
)
compiler
.
onInternalCompilerLoaded
()
compiler
.
loadVersion
(
usingWorker
,
versionUrl
)
// compiler.event.register('compilerLoaded', this, function (version) {
// @ts-ignore
next
()
compiler
.
event
.
register
(
'compilerLoaded'
,
this
,
(
version
)
=>
{
// });
next
()
})
},
},
function
doCompilation
(
next
:
Function
)
{
function
doCompilation
(
next
:
Function
)
{
// @ts-ignore
// @ts-ignore
...
...
remix-tests/src/runTestSources.ts
View file @
312c6bd4
...
@@ -18,7 +18,7 @@ const createWeb3Provider = async function () {
...
@@ -18,7 +18,7 @@ const createWeb3Provider = async function () {
return
web3
return
web3
}
}
export
async
function
runTestSources
(
contractSources
,
testCallback
,
resultCallback
,
finalCallback
,
importFileCb
,
opts
)
{
export
async
function
runTestSources
(
contractSources
,
versionUrl
,
usingWorker
,
testCallback
,
resultCallback
,
finalCallback
,
importFileCb
,
opts
)
{
opts
=
opts
||
{}
opts
=
opts
||
{}
let
web3
=
opts
.
web3
||
await
createWeb3Provider
()
let
web3
=
opts
.
web3
||
await
createWeb3Provider
()
let
accounts
=
opts
.
accounts
||
null
let
accounts
=
opts
.
accounts
||
null
...
@@ -31,7 +31,7 @@ export async function runTestSources(contractSources, testCallback, resultCallba
...
@@ -31,7 +31,7 @@ export async function runTestSources(contractSources, testCallback, resultCallba
})
})
},
},
function
compile
(
next
)
{
function
compile
(
next
)
{
compileContractSources
(
contractSources
,
importFileCb
,
{
accounts
},
next
)
compileContractSources
(
contractSources
,
versionUrl
,
usingWorker
,
importFileCb
,
{
accounts
},
next
)
},
},
function
deployAllContracts
(
compilationResult
,
next
)
{
function
deployAllContracts
(
compilationResult
,
next
)
{
deployAll
(
compilationResult
,
web3
,
(
err
,
contracts
)
=>
{
deployAll
(
compilationResult
,
web3
,
(
err
,
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