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

Method Deserialization

core/payload/invoke_code.go:36–47  ·  view source on GitHub ↗

note: InvokeCode.Code has data reference of param source

(source *common.ZeroCopySource)

Source from the content-addressed store, hash-verified

34
35//note: InvokeCode.Code has data reference of param source
36func (self *InvokeCode) Deserialization(source *common.ZeroCopySource) error {
37 code, _, irregular, eof := source.NextVarBytes()
38 if eof {
39 return io.ErrUnexpectedEOF
40 }
41 if irregular {
42 return common.ErrIrregularData
43 }
44
45 self.Code = code
46 return nil
47}
48
49func (self *InvokeCode) Serialization(sink *common.ZeroCopySink) {
50 sink.WriteVarBytes(self.Code)

Callers 1

TestInvokeCode_SerializeFunction · 0.95

Calls 1

NextVarBytesMethod · 0.80

Tested by 1

TestInvokeCode_SerializeFunction · 0.76