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

Method deserialize

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

Source from the content-addressed store, hash-verified

1629
1630 # Deserialize the struct value
1631 def deserialize(self, value=None):
1632 if value is None:
1633 value = Balance()
1634
1635 assert ((self.buffer.offset + self._model.fbe_offset) <= self.buffer.size), "Model is broken!"
1636 if (self.buffer.offset + self._model.fbe_offset) > self.buffer.size:
1637 return Balance(), 0
1638
1639 fbe_struct_size = self.read_uint32(self._model.fbe_offset - 8)
1640 fbe_struct_type = self.read_uint32(self._model.fbe_offset - 4)
1641 assert ((fbe_struct_size > 0) and (fbe_struct_type == self.fbe_type)), "Model is broken!"
1642 if (fbe_struct_size <= 0) or (fbe_struct_type != self.fbe_type):
1643 return Balance(), 8
1644
1645 fbe_result = self._model.get(value)
1646 return fbe_result[0], (8 + fbe_result[1])
1647
1648 # Move to the next struct value
1649 def next(self, prev):

Callers

nothing calls this directly

Calls 3

BalanceClass · 0.70
read_uint32Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected