From da7c7e1bcc8bed4e1382f91918fd70d8b4aac10a Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 20 Nov 2018 20:06:50 +0100 Subject: [PATCH] Update compiler.js --- remix-tests/src/compiler.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/remix-tests/src/compiler.js b/remix-tests/src/compiler.js index 998f6f8327..bd9758f3f8 100644 --- a/remix-tests/src/compiler.js +++ b/remix-tests/src/compiler.js @@ -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) }