Commit 48c01aee authored by bunsenstraat's avatar bunsenstraat

test flattener

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