mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add more comprehensive tests and checks for libraries in JSONIO
This commit is contained in:
1 parent
908b46e9a7
commit
83fec0232d
2 files changed
+115
-1
No files matched your search
@@ -327,10 +327,14 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
||||
m_compilerStack.setOptimiserSettings(optimize, optimizeRuns);
|
||||
|
||||
map<string, h160> libraries;
|
||||
Json::Value jsonLibraries = settings.get("libraries", Json::Value());
|
||||
Json::Value jsonLibraries = settings.get("libraries", Json::Value(Json::objectValue));
|
||||
if (!jsonLibraries.isObject())
|
||||
return formatFatalError("JSONError", "\"libraries\" is not a JSON object.");
|
||||
for (auto const& sourceName: jsonLibraries.getMemberNames())
|
||||
{
|
||||
auto const& jsonSourceName = jsonLibraries[sourceName];
|
||||
if (!jsonSourceName.isObject())
|
||||
return formatFatalError("JSONError", "library entry is not a JSON object.");
|
||||
for (auto const& library: jsonSourceName.getMemberNames())
|
||||
// @TODO use libraries only for the given source
|
||||
libraries[library] = h160(jsonSourceName[library].asString());
|
||||
|
||||
Reference in new issue
Block a user