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

Method serialise

libsolidity/interface/CompilerStack.cpp:1902–1915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1900 }
1901
1902 bytes serialise() const
1903 {
1904 size_t size = m_data.size() + 1;
1905 solAssert(size <= 0xffff, "Metadata too large.");
1906 solAssert(m_entryCount <= 0x1f, "Too many map entries.");
1907
1908 // CBOR fixed-length map
1909 bytes ret{static_cast<unsigned char>(0xa0 + m_entryCount)};
1910 // The already encoded key-value pairs
1911 ret += m_data;
1912 // 16-bit big endian length
1913 ret += toCompactBigEndian(size, 2);
1914 return ret;
1915 }
1916
1917private:
1918 void pushTextString(std::string const& key)

Callers 1

createCBORMetadataMethod · 0.80

Calls 2

toCompactBigEndianFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected