MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / SaveSeenCommit

Method SaveSeenCommit

store/store.go:419–426  ·  view source on GitHub ↗

SaveSeenCommit saves a seen commit, used by e.g. the state sync reactor when bootstrapping node.

(height int64, seenCommit *types.Commit)

Source from the content-addressed store, hash-verified

417
418// SaveSeenCommit saves a seen commit, used by e.g. the state sync reactor when bootstrapping node.
419func (bs *BlockStore) SaveSeenCommit(height int64, seenCommit *types.Commit) error {
420 pbc := seenCommit.ToProto()
421 seenCommitBytes, err := proto.Marshal(pbc)
422 if err != nil {
423 return fmt.Errorf("unable to marshal commit: %w", err)
424 }
425 return bs.db.Set(calcSeenCommitKey(height), seenCommitBytes)
426}
427
428func (bs *BlockStore) Close() error {
429 return bs.db.Close()

Callers 2

startStateSyncFunction · 0.80
startStateSyncFunction · 0.80

Implementers 4

BlockStorestate/mocks/block_store.go
BlockStorestore/store.go
mockBlockStorerpc/core/blocks_test.go
mockBlockStoreconsensus/replay_test.go

Calls 4

calcSeenCommitKeyFunction · 0.85
SetMethod · 0.65
ToProtoMethod · 0.45
MarshalMethod · 0.45

Tested by

no test coverage detected