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

Method Has

database/ipfs.go:98–102  ·  view source on GitHub ↗

Has checks if the data specified by given key can be retrieved.

(key []byte)

Source from the content-addressed store, hash-verified

96
97// Has checks if the data specified by given key can be retrieved.
98func (db *IpfsDatabase) Has(key []byte) bool {
99 _, err := db.Get(key)
100 // We regard the case where the data cannot be retrieved as "not exist"
101 return err == nil
102}
103
104// FakeIpfsAdapter is a fake IPFS for unit test.
105type FakeIpfsAdapter struct {

Callers

nothing calls this directly

Calls 1

GetMethod · 0.95

Tested by

no test coverage detected