diff options
author | chriseth <c@ethdev.com> | 2016-11-16 21:36:19 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-12-01 23:03:59 +0800 |
commit | e666f8cda70ad5e03bc00f4509fc51571fff90a7 (patch) | |
tree | 387ea30ae1b5c02913163f92cd7bf0d677a52f26 /libsolidity | |
parent | 5789eaa78d0e00f6289101e02f7de5e9decdc7e5 (diff) | |
download | dexon-solidity-e666f8cda70ad5e03bc00f4509fc51571fff90a7.tar dexon-solidity-e666f8cda70ad5e03bc00f4509fc51571fff90a7.tar.gz dexon-solidity-e666f8cda70ad5e03bc00f4509fc51571fff90a7.tar.bz2 dexon-solidity-e666f8cda70ad5e03bc00f4509fc51571fff90a7.tar.lz dexon-solidity-e666f8cda70ad5e03bc00f4509fc51571fff90a7.tar.xz dexon-solidity-e666f8cda70ad5e03bc00f4509fc51571fff90a7.tar.zst dexon-solidity-e666f8cda70ad5e03bc00f4509fc51571fff90a7.zip |
Incorporate comments.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index ed44b109..0f861302 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -40,6 +40,7 @@ #include <libevmasm/Exceptions.h> #include <libdevcore/SwarmHash.h> +#include <libdevcore/JSON.h> #include <json/json.h> @@ -668,19 +669,19 @@ string CompilerStack::createOnChainMetadata(Contract const& _contract) const meta["version"] = 1; meta["language"] = "Solidity"; meta["compiler"]["version"] = VersionString; - meta["compilationTarget"] = - _contract.contract->sourceUnitName() + - ":" + - _contract.contract->annotation().canonicalName; for (auto const& s: m_sources) { solAssert(s.second.scanner, "Scanner not available"); - meta["sources"][s.first]["swarm"] = - "0x" + toHex(dev::swarmHash(s.second.scanner->source()).asBytes()); + meta["sources"][s.first]["keccak256"] = + "0x" + toHex(dev::keccak256(s.second.scanner->source()).asBytes()); + meta["sources"][s.first]["url"] = + "bzzr://" + toHex(dev::swarmHash(s.second.scanner->source()).asBytes()); } meta["settings"]["optimizer"]["enabled"] = m_optimize; meta["settings"]["optimizer"]["runs"] = m_optimizeRuns; + meta["settings"]["compilationTarget"][_contract.contract->sourceUnitName()] = + _contract.contract->annotation().canonicalName; set<string> remappings; for (auto const& r: m_remappings) @@ -692,11 +693,10 @@ string CompilerStack::createOnChainMetadata(Contract const& _contract) const meta["settings"]["libraries"][library.first] = "0x" + toHex(library.second.asBytes()); meta["output"]["abi"] = metadata(_contract, DocumentationType::ABIInterface); - meta["output"]["natspec"] = metadata(_contract, DocumentationType::NatspecUser); + meta["output"]["userdoc"] = metadata(_contract, DocumentationType::NatspecUser); + meta["output"]["devdoc"] = metadata(_contract, DocumentationType::NatspecDev); - Json::FastWriter writer; - writer.omitEndingLineFeed(); - return writer.write(meta); + return jsonCompactPrint(meta); } string CompilerStack::computeSourceMapping(eth::AssemblyItems const& _items) const |