types: comments

This commit is contained in:
Ethan Buchman
2017-09-22 12:00:37 -04:00
parent db034e079a
commit d1a00c684e
9 changed files with 42 additions and 7 deletions
+10
View File
@@ -4,6 +4,8 @@ import (
abci "github.com/tendermint/abci/types"
)
// NOTE: all types in this file are considered UNSTABLE
//------------------------------------------------------
// blockchain services types
// NOTE: Interfaces used by RPC must be thread safe!
@@ -12,8 +14,10 @@ import (
//------------------------------------------------------
// mempool
// Mempool defines the mempool interface.
// Updates to the mempool need to be synchronized with committing a block
// so apps can reset their transient state on Commit
// UNSTABLE
type Mempool interface {
Lock()
Unlock()
@@ -28,6 +32,8 @@ type Mempool interface {
EnableTxsAvailable()
}
// MockMempool is an empty implementation of a Mempool, useful for testing.
// UNSTABLE
type MockMempool struct {
}
@@ -44,6 +50,8 @@ func (m MockMempool) EnableTxsAvailable() {}
//------------------------------------------------------
// blockstore
// BlockStoreRPC is the block store interface used by the RPC.
// UNSTABLE
type BlockStoreRPC interface {
Height() int
@@ -55,6 +63,8 @@ type BlockStoreRPC interface {
LoadSeenCommit(height int) *Commit
}
// BlockStore defines the BlockStore interface.
// UNSTABLE
type BlockStore interface {
BlockStoreRPC
SaveBlock(block *Block, blockParts *PartSet, seenCommit *Commit)