MCPcopy Create free account
hub / github.com/argotorg/solidity / requireParsedCBORMetadata

Function requireParsedCBORMetadata

test/libsolidity/Metadata.cpp:39–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37{
38
39std::map<std::string, std::string> requireParsedCBORMetadata(bytes const& _bytecode, CompilerStack::MetadataFormat _metadataFormat)
40{
41 bytes cborMetadata = solidity::test::onlyMetadata(_bytecode);
42 if (_metadataFormat != CompilerStack::MetadataFormat::NoMetadata)
43 {
44 BOOST_REQUIRE(!cborMetadata.empty());
45 std::optional<std::map<std::string, std::string>> tmp = solidity::test::parseCBORMetadata(cborMetadata);
46 BOOST_REQUIRE(tmp);
47 return *tmp;
48 }
49 BOOST_REQUIRE(cborMetadata.empty());
50 return {};
51}
52
53std::optional<std::string> compileAndCheckLicenseMetadata(std::string const& _contractName, char const* _sourceCode)
54{

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 3

onlyMetadataFunction · 0.85
parseCBORMetadataFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected