Commit e889cf7b authored by aniket-engg's avatar aniket-engg

dynamic filename

parent c27ed724
......@@ -24,7 +24,7 @@ export default class gasCosts implements AnalyzerModule {
report (compilationResults: CompilationResult): ReportObj[] {
const report: ReportObj[] = []
const filename = Object.keys(compilationResults.contracts)[0]
const methodsWithSignature = this.warningNodes.map(node => {
let signature;
if(node.nodeType === 'FunctionDefinition')
......@@ -39,8 +39,8 @@ export default class gasCosts implements AnalyzerModule {
}
})
for (const method of methodsWithSignature) {
for (const contractName in compilationResults.contracts['test.sol']) {
const contract = compilationResults.contracts['test.sol'][contractName]
for (const contractName in compilationResults.contracts[filename]) {
const contract = compilationResults.contracts[filename][contractName]
const methodGas: any = this.checkMethodGas(contract, method.signature)
if(methodGas && methodGas.isInfinite) {
if(methodGas.isFallback) {
......@@ -79,6 +79,7 @@ export default class gasCosts implements AnalyzerModule {
if (gas === null || parseInt(gas) >= 3000000 || gas === 'infinite') {
return {
isInfinite: true,
isFallback: false,
msg: gasString
}
}
......
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