aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-19 21:09:40 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-11-30 04:10:18 +0800
commitbbcec95bac84314d947814ace7da85f69168df94 (patch)
tree6b757b942cc2838ae4bd4040bb5b7a862e92cf75 /libsolidity/interface
parent123d85a19e7f20f06d07fd9a0e4201a3d38ce252 (diff)
downloaddexon-solidity-bbcec95bac84314d947814ace7da85f69168df94.tar.gz
dexon-solidity-bbcec95bac84314d947814ace7da85f69168df94.tar.zst
dexon-solidity-bbcec95bac84314d947814ace7da85f69168df94.zip
Add workaround for bytecode/deployedBytecode selection
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/StandardCompiler.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp
index 8a4e81e4..d9ad0759 100644
--- a/libsolidity/interface/StandardCompiler.cpp
+++ b/libsolidity/interface/StandardCompiler.cpp
@@ -187,6 +187,14 @@ bool isTargetRequired(Json::Value const& _targets, string const& _file, string c
return false;
}
+bool isTargetRequired(Json::Value const& _targets, string const& _file, string const& _contract, vector<string> const& _requested)
+{
+ for (auto const& requested: _requested)
+ if (isTargetRequired(_targets, _file, _contract, requested))
+ return true;
+ return false;
+}
+
Json::Value formatLinkReferences(std::map<size_t, std::string> const& linkReferences)
{
Json::Value ret(Json::objectValue);
@@ -490,13 +498,23 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
if (isTargetRequired(outputSelection, file, name, "evm.gasEstimates"))
evmData["gasEstimates"] = m_compilerStack.gasEstimates(contractName);
- if (isTargetRequired(outputSelection, file, name, "evm.bytecode"))
+ if (isTargetRequired(
+ outputSelection,
+ file,
+ name,
+ { "evm.bytecode", "evm.bytecode.object", "evm.bytecode.opcodes", "evm.bytecode.sourceMap", "evm.bytecode.linkReferences" }
+ ))
evmData["bytecode"] = collectEVMObject(
m_compilerStack.object(contractName),
m_compilerStack.sourceMapping(contractName)
);
- if (isTargetRequired(outputSelection, file, name, "evm.deployedBytecode"))
+ if (isTargetRequired(
+ outputSelection,
+ file,
+ name,
+ { "evm.deployedBytecode", "evm.deployedBytecode.object", "evm.deployedBytecode.opcodes", "evm.deployedBytecode.sourceMap", "evm.deployedBytecode.linkReferences" }
+ ))
evmData["deployedBytecode"] = collectEVMObject(
m_compilerStack.runtimeObject(contractName),
m_compilerStack.runtimeSourceMapping(contractName)