Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "combined json" output. #89

Merged
merged 1 commit into from Sep 23, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions solc/CommandLineInterface.cpp
Expand Up @@ -74,6 +74,7 @@ static string const g_stdinFileName = "<stdin>";
/// Possible arguments to for --combined-json
static set<string> const g_combinedJsonArgs{
"bin",
"bin-runtime",
"clone-bin",
"opcodes",
"abi",
Expand Down Expand Up @@ -144,7 +145,7 @@ void CommandLineInterface::handleBinary(string const& _contract)
if (m_args.count(g_argRuntimeBinaryStr))
{
if (m_args.count("output-dir"))
createFile(_contract + ".bin", m_compiler->runtimeObject(_contract).toHex());
createFile(_contract + ".bin-runtime", m_compiler->runtimeObject(_contract).toHex());
else
{
cout << "Binary of the runtime part: " << endl;
Expand Down Expand Up @@ -545,6 +546,7 @@ void CommandLineInterface::handleCombinedJSON()

Json::Value output(Json::objectValue);

output["version"] = ::dev::solidity::VersionString;
set<string> requests;
boost::split(requests, m_args["combined-json"].as<string>(), boost::is_any_of(","));
vector<string> contracts = m_compiler->contractNames();
Expand All @@ -559,7 +561,9 @@ void CommandLineInterface::handleCombinedJSON()
if (requests.count("abi"))
contractData["abi"] = m_compiler->interface(contractName);
if (requests.count("bin"))
contractData["bin"] = m_compiler->runtimeObject(contractName).toHex();
contractData["bin"] = m_compiler->object(contractName).toHex();
if (requests.count("bin-runtime"))
contractData["bin-runtime"] = m_compiler->runtimeObject(contractName).toHex();
if (requests.count("clone-bin"))
contractData["clone-bin"] = m_compiler->cloneObject(contractName).toHex();
if (requests.count("opcodes"))
Expand Down