mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Follow the JSON I/O spec closely
This commit is contained in:
parent
1b15291af2
commit
ed3ab3506a
@ -222,7 +222,7 @@ Output Description
|
|||||||
// Assembly (string)
|
// Assembly (string)
|
||||||
assembly: "",
|
assembly: "",
|
||||||
// Old-style assembly (object)
|
// Old-style assembly (object)
|
||||||
legacyAssembly: [],
|
legacyAssembly: {},
|
||||||
// Bytecode and related details.
|
// Bytecode and related details.
|
||||||
bytecode: {
|
bytecode: {
|
||||||
// The bytecode as a hex string.
|
// The bytecode as a hex string.
|
||||||
|
@ -391,10 +391,10 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
|||||||
|
|
||||||
// ABI, documentation and metadata
|
// ABI, documentation and metadata
|
||||||
Json::Value contractData(Json::objectValue);
|
Json::Value contractData(Json::objectValue);
|
||||||
contractData["abi"] = dev::jsonCompactPrint(m_compilerStack.metadata(contractName, DocumentationType::ABIInterface));
|
contractData["abi"] = m_compilerStack.metadata(contractName, DocumentationType::ABIInterface);
|
||||||
contractData["metadata"] = m_compilerStack.onChainMetadata(contractName);
|
contractData["metadata"] = m_compilerStack.onChainMetadata(contractName);
|
||||||
contractData["userdoc"] = dev::jsonCompactPrint(m_compilerStack.metadata(contractName, DocumentationType::NatspecUser));
|
contractData["userdoc"] = m_compilerStack.metadata(contractName, DocumentationType::NatspecUser);
|
||||||
contractData["devdoc"] = dev::jsonCompactPrint(m_compilerStack.metadata(contractName, DocumentationType::NatspecDev));
|
contractData["devdoc"] = m_compilerStack.metadata(contractName, DocumentationType::NatspecDev);
|
||||||
|
|
||||||
// EVM
|
// EVM
|
||||||
Json::Value evmData(Json::objectValue);
|
Json::Value evmData(Json::objectValue);
|
||||||
|
@ -235,12 +235,12 @@ BOOST_AUTO_TEST_CASE(basic_compilation)
|
|||||||
BOOST_CHECK(containsAtMostWarnings(result));
|
BOOST_CHECK(containsAtMostWarnings(result));
|
||||||
Json::Value contract = getContractResult(result, "fileA", "A");
|
Json::Value contract = getContractResult(result, "fileA", "A");
|
||||||
BOOST_CHECK(contract.isObject());
|
BOOST_CHECK(contract.isObject());
|
||||||
BOOST_CHECK(contract["abi"].isString());
|
BOOST_CHECK(contract["abi"].isArray());
|
||||||
BOOST_CHECK(contract["abi"].asString() == "[]");
|
BOOST_CHECK(dev::jsonCompactPrint(contract["abi"]) == "[]");
|
||||||
BOOST_CHECK(contract["devdoc"].isString());
|
BOOST_CHECK(contract["devdoc"].isObject());
|
||||||
BOOST_CHECK(contract["devdoc"].asString() == "{\"methods\":{}}");
|
BOOST_CHECK(dev::jsonCompactPrint(contract["devdoc"]) == "{\"methods\":{}}");
|
||||||
BOOST_CHECK(contract["userdoc"].isString());
|
BOOST_CHECK(contract["userdoc"].isObject());
|
||||||
BOOST_CHECK(contract["userdoc"].asString() == "{\"methods\":{}}");
|
BOOST_CHECK(dev::jsonCompactPrint(contract["userdoc"]) == "{\"methods\":{}}");
|
||||||
BOOST_CHECK(contract["evm"].isObject());
|
BOOST_CHECK(contract["evm"].isObject());
|
||||||
/// @TODO check evm.methodIdentifiers, legacyAssembly, bytecode, deployedBytecode
|
/// @TODO check evm.methodIdentifiers, legacyAssembly, bytecode, deployedBytecode
|
||||||
BOOST_CHECK(contract["evm"]["bytecode"].isObject());
|
BOOST_CHECK(contract["evm"]["bytecode"].isObject());
|
||||||
|
Loading…
Reference in New Issue
Block a user