@@ -101,7 +101,7 @@ AssemblyItem Assembly::createAssemblyItemFromJSON(Json::Value const& _json, std:
101
101
solRequire (
102
102
validMembers.count (member),
103
103
AssemblyImportException,
104
- " Unknown member '" + member + " '. Valid members are " +
104
+ " Unknown member '" + member + " '. Valid members are: " +
105
105
solidity::util::joinHumanReadable (validMembers, " , " ) + " ."
106
106
);
107
107
solRequire (isOfType<std::string>(_json[" name" ]), AssemblyImportException, " Member 'name' missing or not of type string." );
@@ -121,7 +121,7 @@ AssemblyItem Assembly::createAssemblyItemFromJSON(Json::Value const& _json, std:
121
121
);
122
122
123
123
std::string name = get<std::string>(_json[" name" ]);
124
- solRequire (!name.empty (), AssemblyImportException, " Member 'name' was empty." );
124
+ solRequire (!name.empty (), AssemblyImportException, " Member 'name' is empty." );
125
125
126
126
SourceLocation location;
127
127
location.start = get<int >(_json[" begin" ]);
@@ -158,7 +158,7 @@ AssemblyItem Assembly::createAssemblyItemFromJSON(Json::Value const& _json, std:
158
158
solRequire (
159
159
!_value.empty (),
160
160
AssemblyImportException,
161
- " Member 'value' was not defined for instruction '" + _name + " ', but the instruction needs a value."
161
+ " Member 'value' not defined for instruction '" + _name + " ', but the instruction needs a value."
162
162
);
163
163
};
164
164
@@ -171,7 +171,7 @@ AssemblyItem Assembly::createAssemblyItemFromJSON(Json::Value const& _json, std:
171
171
);
172
172
};
173
173
174
- solRequire (srcIndex >= -1 && srcIndex < static_cast <int >(_sourceList.size ()), AssemblyImportException, " srcIndex out of bound ." );
174
+ solRequire (srcIndex >= -1 && srcIndex < static_cast <int >(_sourceList.size ()), AssemblyImportException, " Source index out of bounds ." );
175
175
if (srcIndex != -1 )
176
176
{
177
177
static std::map<std::string, std::shared_ptr<std::string const >> sharedSourceNames;
@@ -518,24 +518,25 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
518
518
static std::set<std::string> const validMembers{" .code" , " .data" , " .auxdata" , " sourceList" };
519
519
for (std::string const & attribute: _json.getMemberNames ())
520
520
solRequire (validMembers.count (attribute), AssemblyImportException, " Unknown attribute '" + attribute + " '." );
521
- solRequire (_json.isMember (" .code" ), AssemblyImportException, " Member '.code' does not exist." );
521
+
522
+ solRequire (_json.isMember (" .code" ), AssemblyImportException, " Member '.code' is missing." );
522
523
solRequire (_json[" .code" ].isArray (), AssemblyImportException, " Member '.code' is not an array." );
523
524
for (Json::Value const & codeItem: _json[" .code" ])
524
- solRequire (codeItem.isObject (), AssemblyImportException, " Item of '.code' array is not an object." );
525
+ solRequire (codeItem.isObject (), AssemblyImportException, " The '.code' array contains an item that is not an object." );
525
526
526
527
if (_level == 0 )
527
528
{
528
529
if (_json.isMember (" sourceList" ))
529
530
{
530
531
solRequire (_json[" sourceList" ].isArray (), AssemblyImportException, " Optional member 'sourceList' is not an array." );
531
532
for (Json::Value const & sourceListItem: _json[" sourceList" ])
532
- solRequire (sourceListItem.isString (), AssemblyImportException, " Item of 'sourceList' array is not of type string." );
533
+ solRequire (sourceListItem.isString (), AssemblyImportException, " The 'sourceList' array contains an item that is not a string." );
533
534
}
534
535
} else
535
536
solRequire (
536
537
!_json.isMember (" sourceList" ),
537
538
AssemblyImportException,
538
- " Member 'sourceList' is only allowed in root JSON object."
539
+ " Member 'sourceList' may only be present in the root JSON object."
539
540
);
540
541
541
542
std::vector<std::string> sourceList;
@@ -557,7 +558,7 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
557
558
result->importAssemblyItemsFromJSON (_json[" .code" ], sourceList);
558
559
if (_json[" .auxdata" ])
559
560
{
560
- solRequire (_json[" .auxdata" ].isString (), AssemblyImportException, " Optional member '.auxdata' is not of type string." );
561
+ solRequire (_json[" .auxdata" ].isString (), AssemblyImportException, " Optional member '.auxdata' is not a string." );
561
562
bytes auxdata{fromHex (_json[" .auxdata" ].asString ())};
562
563
solRequire (!auxdata.empty (), AssemblyImportException, " Optional member '.auxdata' is not a valid hexadecimal string." );
563
564
result->m_auxiliaryData = auxdata;
@@ -569,7 +570,7 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
569
570
Json::Value const & data = _json[" .data" ];
570
571
for (Json::ValueConstIterator dataIter = data.begin (); dataIter != data.end (); dataIter++)
571
572
{
572
- solRequire (dataIter.key ().isString (), AssemblyImportException, " Key inside '.data' is not of type string." );
573
+ solRequire (dataIter.key ().isString (), AssemblyImportException, " Key inside '.data' is not a string." );
573
574
std::string dataItemID = dataIter.key ().asString ();
574
575
Json::Value const & code = data[dataItemID];
575
576
if (code.isString ())
@@ -594,7 +595,7 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
594
595
result->m_subs [index] = subassembly;
595
596
}
596
597
else
597
- solThrow (AssemblyImportException, " Key inside '.data' '" + dataItemID + " ' can only be a valid hex-string or an object." );
598
+ solThrow (AssemblyImportException, " The value of key '" + dataItemID + " ' inside '.data' is neither a hex-string nor an object." );
598
599
}
599
600
}
600
601
if (_level == 0 )
0 commit comments