| 433 | } |
| 434 | |
| 435 | Json formatImmutableReferences(std::map<u256, evmasm::LinkerObject::ImmutableRefs> const& _immutableReferences) |
| 436 | { |
| 437 | Json ret = Json::object(); |
| 438 | |
| 439 | for (auto const& immutableReference: _immutableReferences) |
| 440 | { |
| 441 | auto const& [identifier, byteOffsets] = immutableReference.second; |
| 442 | Json array = Json::array(); |
| 443 | for (size_t byteOffset: byteOffsets) |
| 444 | { |
| 445 | Json byteRange; |
| 446 | byteRange["start"] = Json::number_unsigned_t(byteOffset); |
| 447 | byteRange["length"] = Json::number_unsigned_t(32); // immutable references are currently always 32 bytes wide |
| 448 | array.emplace_back(byteRange); |
| 449 | } |
| 450 | ret[identifier] = array; |
| 451 | } |
| 452 | |
| 453 | return ret; |
| 454 | } |
| 455 | |
| 456 | std::optional<Json> checkKeys(Json const& _input, std::set<std::string> const& _keys, std::string const& _name) |
| 457 | { |
no outgoing calls
no test coverage detected