mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Removed null members from JSON output
This commit is contained in:
committed by
Harikrishnan Mulackal
parent
d422a406ba
commit
4a001d568e
@@ -433,7 +433,7 @@ void CommandLineInterface::handleABI(string const& _contract)
|
||||
if (!m_args.count(g_argAbi))
|
||||
return;
|
||||
|
||||
string data = jsonCompactPrint(m_compiler->contractABI(_contract));
|
||||
string data = jsonCompactPrint(removeNullMembers(m_compiler->contractABI(_contract)));
|
||||
if (m_args.count(g_argOutputDir))
|
||||
createFile(m_compiler->filesystemFriendlyName(_contract) + ".abi", data);
|
||||
else
|
||||
@@ -445,7 +445,7 @@ void CommandLineInterface::handleStorageLayout(string const& _contract)
|
||||
if (!m_args.count(g_argStorageLayout))
|
||||
return;
|
||||
|
||||
string data = jsonCompactPrint(m_compiler->storageLayout(_contract));
|
||||
string data = jsonCompactPrint(removeNullMembers(m_compiler->storageLayout(_contract)));
|
||||
if (m_args.count(g_argOutputDir))
|
||||
createFile(m_compiler->filesystemFriendlyName(_contract) + "_storage.json", data);
|
||||
else
|
||||
@@ -474,9 +474,11 @@ void CommandLineInterface::handleNatspec(bool _natspecDev, string const& _contra
|
||||
if (m_args.count(argName))
|
||||
{
|
||||
std::string output = jsonPrettyPrint(
|
||||
_natspecDev ?
|
||||
m_compiler->natspecDev(_contract) :
|
||||
m_compiler->natspecUser(_contract)
|
||||
removeNullMembers(
|
||||
_natspecDev ?
|
||||
m_compiler->natspecDev(_contract) :
|
||||
m_compiler->natspecUser(_contract)
|
||||
)
|
||||
);
|
||||
|
||||
if (m_args.count(g_argOutputDir))
|
||||
@@ -1399,7 +1401,8 @@ void CommandLineInterface::handleCombinedJSON()
|
||||
}
|
||||
}
|
||||
|
||||
string json = m_args.count(g_argPrettyJson) ? jsonPrettyPrint(output) : jsonCompactPrint(output);
|
||||
string json = m_args.count(g_argPrettyJson) ? jsonPrettyPrint(removeNullMembers(std::move(output))) :
|
||||
jsonCompactPrint(removeNullMembers(std::move(output)));
|
||||
|
||||
if (m_args.count(g_argOutputDir))
|
||||
createJson("combined", json);
|
||||
@@ -1715,7 +1718,7 @@ void CommandLineInterface::outputCompilationResults()
|
||||
{
|
||||
string ret;
|
||||
if (m_args.count(g_argAsmJson))
|
||||
ret = jsonPrettyPrint(m_compiler->assemblyJSON(contract));
|
||||
ret = jsonPrettyPrint(removeNullMembers(m_compiler->assemblyJSON(contract)));
|
||||
else
|
||||
ret = m_compiler->assemblyString(contract, m_sourceCodes);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user