|
|
@ -118,8 +118,12 @@ export class CompilerImports extends Plugin { |
|
|
|
async resolveAndSave (url, targetPath) { |
|
|
|
async resolveAndSave (url, targetPath) { |
|
|
|
if (url.indexOf('remix_tests.sol') !== -1 || url.indexOf('remix_accounts.sol') !== -1) { |
|
|
|
if (url.indexOf('remix_tests.sol') !== -1 || url.indexOf('remix_accounts.sol') !== -1) { |
|
|
|
const { assertLibCode, accountsLibCode } = await this.call('solidityUnitTesting', 'getTestlibs') |
|
|
|
const { assertLibCode, accountsLibCode } = await this.call('solidityUnitTesting', 'getTestlibs') |
|
|
|
if (url === 'remix_tests.sol') return assertLibCode |
|
|
|
let content |
|
|
|
else if (url === 'remix_accounts.sol') return accountsLibCode |
|
|
|
if (url === 'remix_tests.sol') content = assertLibCode |
|
|
|
|
|
|
|
else if (url === 'remix_accounts.sol') content = accountsLibCode |
|
|
|
|
|
|
|
const provider = await this.call('fileManager', 'getProviderOf', null) |
|
|
|
|
|
|
|
if (provider) provider.addExternal('.deps/remix-tests/' + url, content, url) |
|
|
|
|
|
|
|
return content |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|
const provider = await this.call('fileManager', 'getProviderOf', url) |
|
|
|
const provider = await this.call('fileManager', 'getProviderOf', url) |
|
|
|