Unverified Commit 59037664 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #1069 from ethereum/yann300-patch-7

Make unit testing work for solidity < 0.5.0
parents 2a3ba608 a57862fa
......@@ -11,11 +11,12 @@ String.prototype.regexIndexOf = function (regex, startpos) {
function writeTestAccountsContract (accounts) {
var testAccountContract = require('../sol/tests_accounts.sol.js')
// TODO: this will only work for solidity 0.5.0
var body = 'address payable[' + accounts.length + '] memory accounts'
var body = 'address[' + accounts.length + '] memory accounts;'
if (!accounts.length) body += ';'
else {
body += '= [' + accounts.map((value) => { return `address(${value})` }).join(',') + '];'
accounts.map((address, index) => {
body += `\naccounts[${index}] = ${address};\n`
})
}
return testAccountContract.replace('>accounts<', body)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment