state

package
v0.0.0-...-4316ad3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrAppBlockHeightTooHigh

type ErrAppBlockHeightTooHigh struct {
	CoreHeight int
	AppHeight  int
}

func (ErrAppBlockHeightTooHigh) Error

func (e ErrAppBlockHeightTooHigh) Error() string

type ErrBlockHashMismatch

type ErrBlockHashMismatch struct {
	CoreHash []byte
	AppHash  []byte
	Height   int
}

func (ErrBlockHashMismatch) Error

func (e ErrBlockHashMismatch) Error() string

type ErrInvalidBlock

type ErrInvalidBlock error

type ErrLastStateMismatch

type ErrLastStateMismatch struct {
	Height int
	Core   []byte
	App    []byte
}

func (ErrLastStateMismatch) Error

func (e ErrLastStateMismatch) Error() string

type ErrNoABCIResponsesForHeight

type ErrNoABCIResponsesForHeight struct {
	Height int
}

func (ErrNoABCIResponsesForHeight) Error

type ErrProxyAppConn

type ErrProxyAppConn error

type ErrStateMismatch

type ErrStateMismatch struct {
	Got      *State
	Expected *State
}

func (ErrStateMismatch) Error

func (e ErrStateMismatch) Error() string

type ErrUnknownBlock

type ErrUnknownBlock struct {
	Height int
}

func (ErrUnknownBlock) Error

func (e ErrUnknownBlock) Error() string

type State

type State struct {

	/*
		ChainID    string
		Height     uint64 // Genesis state has this set to 0.  So, Block(H=0) does not exist.
		Time       time.Time
		BlockID    types.BlockID
		NeedToSave 	bool //record the number of the block which should be saved to main chain
		EpochNumber	uint64
	*/
	TdmExtra *types.TendermintExtra

	Epoch *epoch.Epoch
	// contains filtered or unexported fields
}

NOTE: not goroutine-safe.

func MakeGenesisState

func MakeGenesisState(chainID string, logger log.Logger) *State

MakeGenesisState creates state from types.GenesisDoc.

Used in tests.

func NewState

func NewState(logger log.Logger) *State

func (*State) Bytes

func (s *State) Bytes() []byte

func (*State) Copy

func (s *State) Copy() *State

func (*State) Equals

func (s *State) Equals(s2 *State) bool
func (s *State) Save() {
	s.mtx.Lock()
	defer s.mtx.Unlock()
	s.db.SetSync(stateKey, s.Bytes())
}

func (*State) GetValidators

func (s *State) GetValidators() (*types.ValidatorSet, *types.ValidatorSet, error)

func (*State) ValidateBlock

func (s *State) ValidateBlock(block *types.TdmBlock) error

Jump to

Keyboard shortcuts

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