dummy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0, 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

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

func RandVal(i int) types.Validator

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

func RandVals

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) CleanData

CleanData clean all bcchain data when side chain genesis

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) GetGenesis

func (*PersistentDummyApplication) Info

func (*PersistentDummyApplication) InitChain

Save the validators in the merkle tree

func (*PersistentDummyApplication) Query

func (*PersistentDummyApplication) QueryEx

Query queryEx interface

func (*PersistentDummyApplication) Rollback

func (*PersistentDummyApplication) SetLogger

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

func (*PersistentDummyApplication) SetOption

func (*PersistentDummyApplication) Validators

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

type State

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