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

Method Serialization

core/states/bookkeeper.go:37–49  ·  view source on GitHub ↗
(sink *common.ZeroCopySink)

Source from the content-addressed store, hash-verified

35}
36
37func (this *BookkeeperState) Serialization(sink *common.ZeroCopySink) {
38 this.StateBase.Serialization(sink)
39 sink.WriteUint32(uint32(len(this.CurrBookkeeper)))
40 for _, v := range this.CurrBookkeeper {
41 buf := keypair.SerializePublicKey(v)
42 sink.WriteVarBytes(buf)
43 }
44 sink.WriteUint32(uint32(len(this.NextBookkeeper)))
45 for _, v := range this.NextBookkeeper {
46 buf := keypair.SerializePublicKey(v)
47 sink.WriteVarBytes(buf)
48 }
49}
50
51func (this *BookkeeperState) Deserialization(source *common.ZeroCopySource) error {
52 err := this.StateBase.Deserialization(source)

Callers 1

Calls 3

WriteUint32Method · 0.80
WriteVarBytesMethod · 0.80
SerializationMethod · 0.65

Tested by 1