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

Method Deserialization

common/config/config.go:192–280  ·  view source on GitHub ↗
(source *common.ZeroCopySource)

Source from the content-addressed store, hash-verified

190}
191
192func (this *VBFTConfig) Deserialization(source *common.ZeroCopySource) error {
193 n, eof := source.NextUint32()
194 if eof {
195 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadUint32, deserialize n error!")
196 }
197 c, eof := source.NextUint32()
198 if eof {
199 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadUint32, deserialize c error!")
200 }
201 k, eof := source.NextUint32()
202 if eof {
203 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadUint32, deserialize k error!")
204 }
205 l, eof := source.NextUint32()
206 if eof {
207 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadUint32, deserialize l error!")
208 }
209 blockMsgDelay, eof := source.NextUint32()
210 if eof {
211 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadUint32, deserialize blockMsgDelay error!")
212 }
213 hashMsgDelay, eof := source.NextUint32()
214 if eof {
215 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadUint32, deserialize hashMsgDelay error!")
216 }
217 peerHandshakeTimeout, eof := source.NextUint32()
218 if eof {
219 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadUint32, deserialize peerHandshakeTimeout error!")
220 }
221 maxBlockChangeView, eof := source.NextUint32()
222 if eof {
223 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadUint32, deserialize maxBlockChangeView error!")
224 }
225 minInitStake, eof := source.NextUint32()
226 if eof {
227 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadUint32, deserialize minInitStake error!")
228 }
229 adminOntID, _, irregular, eof := source.NextString()
230 if irregular {
231 return errors.NewDetailErr(common.ErrIrregularData, errors.ErrNoCode, "serialization.ReadString, deserialize adminOntID error!")
232 }
233 if eof {
234 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadString, deserialize adminOntID error!")
235 }
236 vrfValue, _, irregular, eof := source.NextString()
237 if irregular {
238 return errors.NewDetailErr(common.ErrIrregularData, errors.ErrNoCode, "serialization.ReadString, deserialize vrfValue error!")
239 }
240 if eof {
241 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadString, deserialize vrfValue error!")
242 }
243 vrfProof, _, irregular, eof := source.NextString()
244 if irregular {
245 return errors.NewDetailErr(common.ErrIrregularData, errors.ErrNoCode, "serialization.ReadString, deserialize vrfProof error!")
246 }
247 if eof {
248 return errors.NewDetailErr(io.ErrUnexpectedEOF, errors.ErrNoCode, "serialization.ReadString, deserialize vrfProof error!")
249 }

Callers

nothing calls this directly

Calls 5

NewDetailErrFunction · 0.92
NextUint32Method · 0.80
NextStringMethod · 0.80
NextVarUintMethod · 0.80
DeserializationMethod · 0.65

Tested by

no test coverage detected