MCPcopy Create free account
hub / github.com/DNAProject/DNA / Serialize

Method Serialize

consensus/vbft/msg_types.go:339–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

337}
338
339func (msg *BlockFetchRespMsg) Serialize() ([]byte, error) {
340 buffer := bytes.NewBuffer([]byte{})
341 serialization.WriteUint32(buffer, msg.BlockNumber)
342 msg.BlockHash.Serialize(buffer)
343 blockbuff := msg.BlockData.Serialize()
344 buffer.Write(blockbuff)
345 return buffer.Bytes(), nil
346}
347
348func (msg *BlockFetchRespMsg) Deserialize(data []byte) error {
349 buffer := bytes.NewBuffer(data)

Calls 4

WriteUint32Function · 0.92
WriteMethod · 0.80
SerializeMethod · 0.65
BytesMethod · 0.45

Tested by 2