Split out the JSON functionality from assembly.stream()

This commit is contained in:
Alex Beregszaszi committed 2017-09-11 15:48:52 +01:00
1 parent 55d2a459a9
commit a535a8b06e
10 files changed
+67 -46

No files matched your search

+13 -3
View File
@@ -347,18 +347,28 @@ eth::LinkerObject const& CompilerStack::cloneObject(string const& _contractName)
return contract(_contractName).cloneObject;
}
Json::Value CompilerStack::streamAssembly(ostream& _outStream, string const& _contractName, StringMap _sourceCodes, bool _inJsonFormat) const
ostream& CompilerStack::assemblyStream(ostream& _outStream, string const& _contractName, StringMap _sourceCodes) const
{
Contract const& currentContract = contract(_contractName);
if (currentContract.compiler)
return currentContract.compiler->streamAssembly(_outStream, _sourceCodes, _inJsonFormat);
return currentContract.compiler->assemblyStream(_outStream, _sourceCodes);
else
{
_outStream << "Contract not fully implemented" << endl;
return Json::Value();
return _outStream;
}
}
/// FIXME: cache the JSON
Json::Value CompilerStack::assemblyJSON(string const& _contractName, StringMap _sourceCodes) const
{
Contract const& currentContract = contract(_contractName);
if (currentContract.compiler)
return currentContract.compiler->assemblyJSON(_sourceCodes);
else
return Json::Value();
}
vector<string> CompilerStack::sourceNames() const
{
vector<string> names;