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

Method tryWrite

ethstorage/storage_manager.go:594–603  ·  view source on GitHub ↗
(kvIdx uint64, blob []byte, commit common.Hash)

Source from the content-addressed store, hash-verified

592}
593
594func (s *StorageManager) tryWrite(kvIdx uint64, blob []byte, commit common.Hash) error {
595 ok, err := s.shardManager.TryWrite(kvIdx, blob, PrepareCommit(commit))
596 if !ok {
597 return fmt.Errorf("failed to write blob: kv %d not exist", kvIdx)
598 }
599 if err != nil {
600 return fmt.Errorf("failed to write blob: kvIdx=%d, %w", kvIdx, err)
601 }
602 return nil
603}
604
605// TryReadEncoded This function will read the encoded data from the local storage file. It also check whether the blob is empty or not synced,
606// if they are these two cases, it will return err.

Callers 1

TryWriteWithMetaCheckMethod · 0.95

Calls 2

PrepareCommitFunction · 0.85
TryWriteMethod · 0.80

Tested by

no test coverage detected