dummy

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

README

Dummy

DEPRECATED. See KVStore

Documentation

Index

Constants

View Source
const (
	ValidatorSetChangePrefix string = "val:"
)

Variables

This section is empty.

Functions

func InitDummy added in v0.7.0

func InitDummy(app *PersistentDummyApplication)

InitDummy initializes the dummy app with some data, which allows tests to pass and is fine as long as you don't make any tx that modify the validator state

func MakeValSetChangeTx

func MakeValSetChangeTx(pubkey []byte, power int64) []byte

func RandVal added in v0.7.0

func RandVal(i int) types.Validator

RandVal creates one random validator, with a key derived from the input value

func RandVals added in v0.7.0

func RandVals(cnt int) []types.Validator

RandVals returns a list of cnt validators for initializing the application. Note that the keys are deterministically derived from the index in the array, while the power is random (Change this if not desired)

Types

type DummyApplication

type DummyApplication struct {
	types.BaseApplication
	// contains filtered or unexported fields
}

func NewDummyApplication

func NewDummyApplication() *DummyApplication

func (*DummyApplication) CheckTx

func (app *DummyApplication) CheckTx(tx []byte) types.ResponseCheckTx

func (*DummyApplication) Commit

func (app *DummyApplication) Commit() types.ResponseCommit

func (*DummyApplication) DeliverTx

func (app *DummyApplication) DeliverTx(tx []byte) types.ResponseDeliverTx

tx is either "key=value" or just arbitrary bytes

func (*DummyApplication) Info

func (app *DummyApplication) Info(req types.RequestInfo) (resInfo types.ResponseInfo)

func (*DummyApplication) Query

func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery)

type PersistentDummyApplication

type PersistentDummyApplication struct {

	// validator set
	ValUpdates []types.Validator
	// contains filtered or unexported fields
}

func NewPersistentDummyApplication

func NewPersistentDummyApplication(dbDir string) *PersistentDummyApplication

func (*PersistentDummyApplication) BeginBlock

Track the block hash and header information

func (*PersistentDummyApplication) CheckTx

func (*PersistentDummyApplication) Commit

Commit will panic if InitChain was not called

func (*PersistentDummyApplication) DeliverTx

tx is either "val:pubkey/power" or "key=value" or just arbitrary bytes

func (*PersistentDummyApplication) EndBlock

Update the validator set

func (*PersistentDummyApplication) Info

func (*PersistentDummyApplication) InitChain

Save the validators in the merkle tree

func (*PersistentDummyApplication) Query

func (*PersistentDummyApplication) SetLogger added in v0.5.0

func (app *PersistentDummyApplication) SetLogger(l log.Logger)

func (*PersistentDummyApplication) SetOption

func (*PersistentDummyApplication) Validators

func (app *PersistentDummyApplication) Validators() (validators []types.Validator)

type State added in v0.10.0

type State struct {
	Size    int64  `json:"size"`
	Height  int64  `json:"height"`
	AppHash []byte `json:"app_hash"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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