MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / deserialize

Method deserialize

projects/Python/proto/proto.py:2383–2398  ·  view source on GitHub ↗
(self, value=None)

Source from the content-addressed store, hash-verified

2381
2382 # Deserialize the struct value
2383 def deserialize(self, value=None):
2384 if value is None:
2385 value = Account()
2386
2387 assert ((self.buffer.offset + self._model.fbe_offset) <= self.buffer.size), "Model is broken!"
2388 if (self.buffer.offset + self._model.fbe_offset) > self.buffer.size:
2389 return Account(), 0
2390
2391 fbe_struct_size = self.read_uint32(self._model.fbe_offset - 8)
2392 fbe_struct_type = self.read_uint32(self._model.fbe_offset - 4)
2393 assert ((fbe_struct_size > 0) and (fbe_struct_type == self.fbe_type)), "Model is broken!"
2394 if (fbe_struct_size <= 0) or (fbe_struct_type != self.fbe_type):
2395 return Account(), 8
2396
2397 fbe_result = self._model.get(value)
2398 return fbe_result[0], (8 + fbe_result[1])
2399
2400 # Move to the next struct value
2401 def next(self, prev):

Callers 2

mainFunction · 0.95

Calls 3

AccountClass · 0.70
read_uint32Method · 0.45
getMethod · 0.45

Tested by 1