MCPcopy Create free account
hub / github.com/CPChain/chain / Get

Method Get

database/memdb.go:42–50  ·  view source on GitHub ↗
(key []byte)

Source from the content-addressed store, hash-verified

40}
41
42func (db *MemDatabase) Get(key []byte) ([]byte, error) {
43 db.rw.RLock()
44 defer db.rw.RUnlock()
45
46 if entry, ok := db.db[string(key)]; ok {
47 return common.CopyBytes(entry), nil
48 }
49 return nil, ErrKeyNotFound
50}
51
52func (db *MemDatabase) Keys() [][]byte {
53 db.rw.RLock()

Callers 3

TestUpdateLeaksFunction · 0.95
TestIntermediateLeaksFunction · 0.95
TestIncompleteStateSyncFunction · 0.95

Calls

no outgoing calls

Tested by 3

TestUpdateLeaksFunction · 0.76
TestIntermediateLeaksFunction · 0.76
TestIncompleteStateSyncFunction · 0.76