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

Struct DummyDatabase

database/dummydb.go:8–9  ·  view source on GitHub ↗

DummyDatabase is a dummy "remote database" which actually save all data to key, i.e. key is data, data is key. It does not save data to any store, but to the returned key. It is used to serve as an extremely stable remote database. For example, PrivateTx could use it as an option of its "remote data

Source from the content-addressed store, hash-verified

6// It does not save data to any store, but to the returned key. It is used to serve as an extremely stable remote database.
7// For example, PrivateTx could use it as an option of its "remote database" to ensure that it does not depend on any "single point" database.
8type DummyDatabase struct {
9}
10
11func (d *DummyDatabase) Get(key []byte) ([]byte, error) {
12 return key, nil

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected