MCPcopy Create free account
hub / github.com/ethstorage/es-node / EncodeKV

Method EncodeKV

ethstorage/shard_manager.go:232–234  ·  view source on GitHub ↗

EncodeKV Encode the raw KV data.

(kvIdx uint64, b []byte, hash common.Hash, providerAddr common.Address, encodeType uint64)

Source from the content-addressed store, hash-verified

230
231// EncodeKV Encode the raw KV data.
232func (sm *ShardManager) EncodeKV(kvIdx uint64, b []byte, hash common.Hash, providerAddr common.Address, encodeType uint64) ([]byte, bool, error) {
233 return sm.DecodeOrEncodeKV(kvIdx, b, hash, providerAddr, true, encodeType)
234}
235
236func (sm *ShardManager) DecodeOrEncodeKV(kvIdx uint64, b []byte, hash common.Hash, providerAddr common.Address, encode bool, encodeType uint64) ([]byte, bool, error) {
237 shardIdx := kvIdx / sm.kvEntries

Callers 3

TryEncodeKVMethod · 0.95
makeKVStorageFunction · 0.80
verifyKVsFunction · 0.80

Calls 1

DecodeOrEncodeKVMethod · 0.95

Tested by 2

makeKVStorageFunction · 0.64
verifyKVsFunction · 0.64