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
59037664
Unverified
Commit
59037664
authored
Nov 20, 2018
by
yann300
Committed by
GitHub
Nov 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1069 from ethereum/yann300-patch-7
Make unit testing work for solidity < 0.5.0
parents
2a3ba608
a57862fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
compiler.js
remix-tests/src/compiler.js
+4
-3
No files found.
remix-tests/src/compiler.js
View file @
59037664
...
@@ -11,11 +11,12 @@ String.prototype.regexIndexOf = function (regex, startpos) {
...
@@ -11,11 +11,12 @@ String.prototype.regexIndexOf = function (regex, startpos) {
function
writeTestAccountsContract
(
accounts
)
{
function
writeTestAccountsContract
(
accounts
)
{
var
testAccountContract
=
require
(
'../sol/tests_accounts.sol.js'
)
var
testAccountContract
=
require
(
'../sol/tests_accounts.sol.js'
)
// TODO: this will only work for solidity 0.5.0
var
body
=
'address['
+
accounts
.
length
+
'] memory accounts;'
var
body
=
'address payable['
+
accounts
.
length
+
'] memory accounts'
if
(
!
accounts
.
length
)
body
+=
';'
if
(
!
accounts
.
length
)
body
+=
';'
else
{
else
{
body
+=
'= ['
+
accounts
.
map
((
value
)
=>
{
return
`address(
${
value
}
)`
}).
join
(
','
)
+
'];'
accounts
.
map
((
address
,
index
)
=>
{
body
+=
`\naccounts[
${
index
}
] =
${
address
}
;\n`
})
}
}
return
testAccountContract
.
replace
(
'>accounts<'
,
body
)
return
testAccountContract
.
replace
(
'>accounts<'
,
body
)
}
}
...
...
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