prepare_report: Report missing metadata as well

This commit is contained in:
Kamil Śliwak 2020-12-22 02:09:12 +01:00
parent 9f58f77b50
commit fe7cc2097b
2 changed files with 7 additions and 2 deletions

View File

@ -38,11 +38,16 @@ for (const optimize of [false, true])
const contractResults = result['contracts'][contractFile][contractName]
let bytecode = 'NO BYTECODE'
let metadata = 'NO METADATA'
if ('evm' in contractResults && 'bytecode' in contractResults['evm'] && 'object' in contractResults['evm']['bytecode'])
bytecode = contractResults.evm.bytecode.object
if ('metadata' in contractResults)
metadata = contractResults.metadata
console.log(filename + ':' + contractName + ' ' + bytecode)
console.log(filename + ':' + contractName + ' ' + contractResults['metadata'])
console.log(filename + ':' + contractName + ' ' + metadata)
}
}
}

View File

@ -40,7 +40,7 @@ for optimize in [False, True]:
for filename in sorted(result['contracts'].keys()):
for contractName in sorted(result['contracts'][filename].keys()):
bytecode = result['contracts'][filename][contractName].get('evm', {}).get('bytecode', {}).get('object', 'NO BYTECODE')
metadata = result['contracts'][filename][contractName]['metadata']
metadata = result['contracts'][filename][contractName].get('metadata', 'NO METADATA')
REPORT_FILE.write(filename + ':' + contractName + ' ' + bytecode + '\n')
REPORT_FILE.write(filename + ':' + contractName + ' ' + metadata + '\n')