github
294 of 792 new or added lines in 21 files covered. (37.12%)
15260 of 25596 relevant lines covered (59.62%)
37624.05 hits per line
1 |
package snapshot
|
|
2 |
|
|
3 |
import (
|
|
4 |
"go.vocdoni.io/dvote/statedb"
|
|
5 |
) |
|
6 |
|
|
7 |
// DumpTree dumps a tree to the snapshot.
|
|
|
func (s *Snapshot) DumpTree(name, parent string, key []byte, tr statedb.TreeViewer) error { |
224✔ |
|
s.lock.Lock() |
224✔ |
|
defer s.lock.Unlock()
|
224✔ |
|
|
224✔ |
|
root, err := tr.Root() |
224✔ |
|
if err != nil { |
224✔ |
NEW
|
return err
|
× |
NEW
|
} |
× |
16 |
|
|
|
s.header.Blobs = append(s.header.Blobs, SnapshotBlobHeader{
|
224✔ |
|
Type: snapshotBlobType_Tree, |
224✔ |
|
Name: name, |
224✔ |
|
Parent: parent, |
224✔ |
|
Key: key, |
224✔ |
|
Root: root, |
224✔ |
|
Size: 0,
|
224✔ |
|
}) |
224✔ |
|
|
224✔ |
|
return tr.Dump(s)
|
224✔ |
27 |
} |