@@ -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' is missing 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;
@@ -514,24 +514,25 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
514
514
static std::set<std::string> const validMembers{" .code" , " .data" , " .auxdata" , " sourceList" };
515
515
for (std::string const & attribute: _json.getMemberNames ())
516
516
solRequire (validMembers.count (attribute), AssemblyImportException, " Unknown attribute '" + attribute + " '." );
517
- solRequire (_json.isMember (" .code" ), AssemblyImportException, " Member '.code' does not exist." );
517
+
518
+ solRequire (_json.isMember (" .code" ), AssemblyImportException, " Member '.code' is missing." );
518
519
solRequire (_json[" .code" ].isArray (), AssemblyImportException, " Member '.code' is not an array." );
519
520
for (Json::Value const & codeItem: _json[" .code" ])
520
- solRequire (codeItem.isObject (), AssemblyImportException, " Item of '.code' array is not an object." );
521
+ solRequire (codeItem.isObject (), AssemblyImportException, " The '.code' array contains an item that is not an object." );
521
522
522
523
if (_level == 0 )
523
524
{
524
525
if (_json.isMember (" sourceList" ))
525
526
{
526
527
solRequire (_json[" sourceList" ].isArray (), AssemblyImportException, " Optional member 'sourceList' is not an array." );
527
528
for (Json::Value const & sourceListItem: _json[" sourceList" ])
528
- solRequire (sourceListItem.isString (), AssemblyImportException, " Item of 'sourceList' array is not of type string." );
529
+ solRequire (sourceListItem.isString (), AssemblyImportException, " The 'sourceList' array contains an item that is not a string." );
529
530
}
530
531
} else
531
532
solRequire (
532
533
!_json.isMember (" sourceList" ),
533
534
AssemblyImportException,
534
- " Member 'sourceList' is only allowed in root JSON object."
535
+ " Member 'sourceList' may only be present in the root JSON object."
535
536
);
536
537
537
538
std::shared_ptr<Assembly> result = std::make_shared<Assembly>(langutil::EVMVersion (), _level == 0 , " " );
@@ -554,7 +555,7 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
554
555
result->importAssemblyItemsFromJSON (_json[" .code" ], sourceList);
555
556
if (_json[" .auxdata" ])
556
557
{
557
- solRequire (_json[" .auxdata" ].isString (), AssemblyImportException, " Optional member '.auxdata' is not of type string." );
558
+ solRequire (_json[" .auxdata" ].isString (), AssemblyImportException, " Optional member '.auxdata' is not a string." );
558
559
bytes auxdata{fromHex (_json[" .auxdata" ].asString ())};
559
560
solRequire (!auxdata.empty (), AssemblyImportException, " Optional member '.auxdata' is not a valid hexadecimal string." );
560
561
result->m_auxiliaryData = auxdata;
@@ -566,7 +567,7 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
566
567
Json::Value const & data = _json[" .data" ];
567
568
for (Json::ValueConstIterator dataIter = data.begin (); dataIter != data.end (); dataIter++)
568
569
{
569
- solRequire (dataIter.key ().isString (), AssemblyImportException, " Key inside '.data' is not of type string." );
570
+ solRequire (dataIter.key ().isString (), AssemblyImportException, " Key inside '.data' is not a string." );
570
571
std::string dataItemID = dataIter.key ().asString ();
571
572
Json::Value const & code = data[dataItemID];
572
573
if (code.isString ())
@@ -577,7 +578,7 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
577
578
solRequire (
578
579
!data_value.empty (),
579
580
AssemblyImportException,
580
- " Member '.data' contains a value for '" + dataItemID + " ' that is not a valid hexadecimal string." );
581
+ " The value for key '" + dataItemID + " ' inside '.data' is not a valid hexadecimal string." );
581
582
}
582
583
result->m_data [h256 (fromHex (dataItemID))] = fromHex (code.asString ());
583
584
}
@@ -591,7 +592,7 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
591
592
result->m_subs [index] = subassembly;
592
593
}
593
594
else
594
- solThrow (AssemblyImportException, " Key inside '.data' '" + dataItemID + " ' can only be a valid hex- string or an object." );
595
+ solThrow (AssemblyImportException, " The value of key '" + dataItemID + " ' inside '.data' is neither a hex string nor an object." );
595
596
}
596
597
}
597
598
if (_level == 0 )
0 commit comments