mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Properly split contract filename and name
This commit is contained in:
parent
ad1fe86508
commit
ef559de84f
@ -280,6 +280,11 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
|||||||
Json::Value contractsOutput = Json::objectValue;
|
Json::Value contractsOutput = Json::objectValue;
|
||||||
for (string const& contractName: m_compilerStack.contractNames())
|
for (string const& contractName: m_compilerStack.contractNames())
|
||||||
{
|
{
|
||||||
|
size_t colon = contractName.find(':');
|
||||||
|
solAssert(colon != string::npos, "");
|
||||||
|
string file = contractName.substr(0, colon);
|
||||||
|
string name = contractName.substr(colon + 1);
|
||||||
|
|
||||||
// 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"] = dev::jsonCompactPrint(m_compilerStack.metadata(contractName, DocumentationType::ABIInterface));
|
||||||
@ -317,10 +322,12 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
|||||||
|
|
||||||
contractData["evm"] = evmData;
|
contractData["evm"] = evmData;
|
||||||
|
|
||||||
contractsOutput[contractName] = contractData;
|
if (!contractsOutput.isMember(file))
|
||||||
|
contractsOutput[file] = Json::objectValue;
|
||||||
|
|
||||||
|
contractsOutput[file][name] = contractData;
|
||||||
}
|
}
|
||||||
output["contracts"] = Json::objectValue;
|
output["contracts"] = contractsOutput;
|
||||||
output["contracts"][""] = contractsOutput;
|
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user