test flattener

pull/5370/head
bunsenstraat 3 years ago
parent 97396e69d9
commit fded51d244
  1. 24
      apps/remix-ide/src/app/components/plugin-manager-component.js

@ -105,25 +105,25 @@ class PluginManagerComponent extends ViewPlugin {
async registerFlattener (event) {
if (!this.appManager.isActive('solidity')) { await this.appManager.activatePlugin('solidity') }
const compiledSuccessfully = await this.call('solidity', 'compileFile', event)
console.log(compiledSuccessfully)
const reportCompileIssue = async () => {
this.call('fileManager', 'open', event.path[0])
addToolTip('Cannot flatten the file. Please make sure it is compiling successfully.')
await this.call('menuicons', 'select', 'solidity')
}
setTimeout(async () => {
if (compiledSuccessfully) {
const res = await this.call('solidity', 'getCompilationResult')
if (!res) {
reportCompileIssue()
} else {
await this.call('menuicons', 'select', 'flattener')
const path = await this.call('flattener', 'flattenAndSave', res)
await this.call('fileManager', 'open', path)
}
} else {
if (compiledSuccessfully) {
const res = await this.call('solidity', 'getCompilationResult')
if (!res) {
reportCompileIssue()
} else {
await this.call('menuicons', 'select', 'f3')
console.log(res)
await this.call('f3', 'flattenAndSave', res)
}
}, 1000)
} else {
reportCompileIssue()
}
}
async registerOptimismCompiler (event) {

Loading…
Cancel
Save