Documentation ¶
Index ¶
- type MapStorage
- func (m *MapStorage) GetBlock(height int64) (*types.Block, error)
- func (m *MapStorage) GetCommit(height int64) (*types.Commit, error)
- func (m *MapStorage) GetResponses(height int64) (*protostate.ABCIResponses, error)
- func (m *MapStorage) GetState(height int64) (*cometstate.State, error)
- func (m *MapStorage) InsertBlock(height int64, block *types.Block) error
- func (m *MapStorage) InsertCommit(height int64, commit *types.Commit) error
- func (m *MapStorage) InsertResponses(height int64, responses *protostate.ABCIResponses) error
- func (m *MapStorage) InsertState(height int64, state *cometstate.State) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MapStorage ¶
type MapStorage struct {
// contains filtered or unexported fields
}
MapStorage is a simple in-memory implementation of Storage.
func (*MapStorage) GetResponses ¶
func (m *MapStorage) GetResponses(height int64) (*protostate.ABCIResponses, error)
func (*MapStorage) GetState ¶
func (m *MapStorage) GetState(height int64) (*cometstate.State, error)
func (*MapStorage) InsertBlock ¶
func (m *MapStorage) InsertBlock(height int64, block *types.Block) error
func (*MapStorage) InsertCommit ¶
func (m *MapStorage) InsertCommit(height int64, commit *types.Commit) error
func (*MapStorage) InsertResponses ¶
func (m *MapStorage) InsertResponses(height int64, responses *protostate.ABCIResponses) error
func (*MapStorage) InsertState ¶
func (m *MapStorage) InsertState(height int64, state *cometstate.State) error
type Storage ¶
type Storage interface { // InsertBlock inserts a block at a given height. // If there is already a block at that height, it should be overwritten. InsertBlock(height int64, block *types.Block) error // GetBlock returns the block at a given height. GetBlock(height int64) (*types.Block, error) // InsertCommit inserts a commit at a given height. // If there is already a commit at that height, it should be overwritten. InsertCommit(height int64, commit *types.Commit) error // GetCommit returns the commit at a given height. GetCommit(height int64) (*types.Commit, error) // InsertState inserts a state at a given height. This is the state after // applying the block at that height. // If there is already a state at that height, it should be overwritten. InsertState(height int64, state *cometstate.State) error // GetState returns the state at a given height. This is the state after // applying the block at that height. GetState(height int64) (*cometstate.State, error) // InsertResponses inserts the ABCI responses from a given height. // If there are already responses at that height, they should be overwritten. InsertResponses(height int64, responses *protostate.ABCIResponses) error // GetResponses returns the ABCI responses from a given height. GetResponses(height int64) (*protostate.ABCIResponses, error) }
Storage is an interface for storing blocks, commits and states by height. All methods are thread-safe.
Click to show internal directories.
Click to hide internal directories.