rpc: remove BlockStoreRPC in favor of BlockStore (#4510)

* rpc: use BlockStoreRPC instead of BlockStore

BlockStoreRPC is a limited version of BlockStore interface, which does
not include SaveBlock method.

Closes #4159

* remove BlockStoreRPC interface in favor of single BlockStore

interface

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Anton Kaliaev
2020-03-02 17:55:50 +04:00
committed by GitHub
parent 67224fd174
commit 51e1b4e42a

View File

@@ -12,12 +12,15 @@ import (
//------------------------------------------------------
// blockstore
// BlockStoreRPC is the block store interface used by the RPC.
type BlockStoreRPC interface {
// BlockStore defines the interface used by the ConsensusState.
type BlockStore interface {
Height() int64
LoadBlockMeta(height int64) *types.BlockMeta
LoadBlock(height int64) *types.Block
SaveBlock(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit)
LoadBlockByHash(hash []byte) *types.Block
LoadBlockPart(height int64, index int) *types.Part
@@ -25,13 +28,7 @@ type BlockStoreRPC interface {
LoadSeenCommit(height int64) *types.Commit
}
// BlockStore defines the BlockStore interface used by the ConsensusState.
type BlockStore interface {
BlockStoreRPC
SaveBlock(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit)
}
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// evidence pool
// EvidencePool defines the EvidencePool interface used by the ConsensusState.