| 106 | } |
| 107 | |
| 108 | void checkLinkReferencesSchema(Json const& _contractResult) |
| 109 | { |
| 110 | BOOST_TEST_REQUIRE(_contractResult.is_object()); |
| 111 | BOOST_TEST_REQUIRE(_contractResult["evm"]["bytecode"].is_object()); |
| 112 | |
| 113 | Json const& linkReferenceResult = _contractResult["evm"]["bytecode"]["linkReferences"]; |
| 114 | BOOST_TEST_REQUIRE(linkReferenceResult.is_object()); |
| 115 | |
| 116 | for (auto const& [fileName, references]: linkReferenceResult.items()) |
| 117 | { |
| 118 | BOOST_TEST_REQUIRE(references.is_object()); |
| 119 | for (auto const& [libraryName, libraryValue]: references.items()) |
| 120 | { |
| 121 | BOOST_TEST_REQUIRE(libraryValue.is_array()); |
| 122 | BOOST_TEST_REQUIRE(!libraryValue.empty()); |
| 123 | for (size_t i = 0; i < static_cast<size_t>(linkReferenceResult.size()); ++i) |
| 124 | { |
| 125 | BOOST_TEST_REQUIRE(libraryValue[i].is_object()); |
| 126 | BOOST_TEST_REQUIRE(libraryValue[i].size() == 2); |
| 127 | BOOST_TEST_REQUIRE(libraryValue[i]["length"].is_number_unsigned()); |
| 128 | BOOST_TEST_REQUIRE(libraryValue[i]["start"].is_number_unsigned()); |
| 129 | } |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | void expectLinkReferences(Json const& _contractResult, std::map<std::string, std::set<std::string>> const& _expectedLinkReferences) |
| 135 | { |
no test coverage detected