MCPcopy Create free account
hub / github.com/ElementsProject/elements / Ser

Method Ser

src/compressor.h:100–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98struct AmountCompression
99{
100 template<typename Stream, typename I> void Ser(Stream& s, I val)
101 {
102 if (g_con_elementsmode) {
103 if (val.IsExplicit()) {
104 uint8_t b = 0;
105 s << b;
106 s << VARINT(CompressAmount(val.GetAmount()));
107 } else {
108 uint8_t b = 1;
109 s << b;
110 s << val;
111 }
112 } else {
113 assert(val.IsExplicit());
114 s << VARINT(CompressAmount(val.GetAmount()));
115 }
116 }
117 template<typename Stream, typename I> void Unser(Stream& s, I& val)
118 {
119 if (g_con_elementsmode) {

Callers

nothing calls this directly

Calls 3

CompressAmountFunction · 0.85
IsExplicitMethod · 0.80
GetAmountMethod · 0.80

Tested by

no test coverage detected