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

Method GetVersion

core/store/ledgerstore/block_store.go:432–440  ·  view source on GitHub ↗

GetVersion return the version of store

()

Source from the content-addressed store, hash-verified

430
431//GetVersion return the version of store
432func (this *BlockStore) GetVersion() (byte, error) {
433 key := this.getVersionKey()
434 value, err := this.store.Get(key)
435 if err != nil {
436 return 0, err
437 }
438 reader := bytes.NewReader(value)
439 return reader.ReadByte()
440}
441
442//SaveVersion persist version to store
443func (this *BlockStore) SaveVersion(ver byte) error {

Callers

nothing calls this directly

Calls 3

getVersionKeyMethod · 0.95
ReadByteMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected