app

package
v1.1.0-dev.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
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

func NewApplication(cfg kvstore.Config, opts ...kvstore.OptFunc) (*Application, error)

NewApplication creates the application.

func (*Application) ExtendVote

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 (*Application) Rollback

func (app *Application) Rollback() error

func (*Application) VerifyVoteExtension

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL