Documentation ¶
Index ¶
- Constants
- type Application
- func (app *Application) ExtendVote(_ context.Context, req *abci.RequestExtendVote) (*abci.ResponseExtendVote, error)
- func (app *Application) FinalizeBlock(ctx context.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error)
- func (app *Application) Rollback() error
- func (app *Application) VerifyVoteExtension(_ context.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error)
Constants ¶
const (
VoteExtensionKey string = "extensionSum"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { *kvstore.Application PreviousCommittedState kvstore.State // contains filtered or unexported fields }
Application is an ABCI application for use by end-to-end tests. It is a simple key/value store for strings, storing data in memory and persisting to disk as JSON, taking state sync snapshots if requested.
func NewApplication ¶
NewApplication creates the application.
func (*Application) ExtendVote ¶
func (app *Application) ExtendVote(_ context.Context, req *abci.RequestExtendVote) (*abci.ResponseExtendVote, error)
ExtendVote will produce vote extensions in the form of random numbers to demonstrate vote extension nondeterminism.
In the next block, if there are any vote extensions from the previous block, a new transaction will be proposed that updates a special value in the key/value store ("extensionSum") with the sum of all of the numbers collected from the vote extensions.
func (*Application) FinalizeBlock ¶
func (app *Application) FinalizeBlock(ctx context.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error)
func (*Application) Rollback ¶
func (app *Application) Rollback() error
func (*Application) VerifyVoteExtension ¶
func (app *Application) VerifyVoteExtension(_ context.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error)
VerifyVoteExtension simply validates vote extensions from other validators without doing anything about them. In this case, it just makes sure that the vote extension is a well-formed integer value.