diff --git a/src/app/files/compiler-metadata.js b/src/app/files/compiler-metadata.js index 0b26ce193a..84d4bd5f31 100644 --- a/src/app/files/compiler-metadata.js +++ b/src/app/files/compiler-metadata.js @@ -44,6 +44,23 @@ class CompilerMetadata { } }) } + + metadataOf (contractName, callback) { + var self = this + var provider = self._opts.fileManager.currentFileProvider() + var path = self._opts.fileManager.currentPath() + if (provider && path) { + var fileName = path + contractName + '.json' + provider.get(fileName, (error, content) => { + if (error) return callback(error) + try { + callback(null, JSON.parse(content)) + } catch (e) { + callback(e.message) + } + }) + } + } } module.exports = CompilerMetadata diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index 575464d29b..e990d4a9db 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -71,6 +71,7 @@ function filepanel (localRegistry) { ) self._compilerMetadata.syncContractMetadata() + self.compilerMetadata = () => { return self._compilerMetadata } var dragbar = yo`
` function remixdDialog () {