lstate

package
v0.5.0-dev Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(bc BlockChain)

func SortOutStats

func SortOutStats(st *txstate.State, outs []*OutState)

func UpdateOutStat

func UpdateOutStat(st *txstate.State, out *OutState)

Types

type BlockChain

type BlockChain interface {
	GetCurrenHeader() *types.Header
	GetHeader(hash *common.Hash) *types.Header
	NewState(hash *common.Hash) *zstate.ZState
	GetTks() []keys.Uint512

	CashChose() *atomic.Value
}

type OutStat

type OutStat struct {
	Time  int64
	Value utils.U256
	Z     bool
}

func (*OutStat) Serial

func (self *OutStat) Serial() (ret []byte, e error)

type OutStatGet

type OutStatGet struct {
	// contains filtered or unexported fields
}

func (*OutStatGet) Unserial

func (self *OutStatGet) Unserial(v []byte) (e error)

type OutStatWrap

type OutStatWrap struct {
	// contains filtered or unexported fields
}

type OutState

type OutState struct {
	Root     keys.Uint256
	RootCM   keys.Uint256
	OutIndex uint64
	Num      uint64
	Tk       keys.Uint512
	Out_O    stx.Out_O
	Out_Z    *stx.Out_Z `rlp:"nil"`
	Trace    keys.Uint256
	Z        bool
}

func (*OutState) IsMine

func (self *OutState) IsMine(tk *keys.Uint512) bool

func (*OutState) Serial

func (self *OutState) Serial() (ret []byte, e error)

func (*OutState) Unserial

func (self *OutState) Unserial(v []byte) (*OutState, error)

type OutStats

type OutStats []OutStatWrap

func (OutStats) Len

func (self OutStats) Len() int

func (OutStats) Less

func (self OutStats) Less(i, j int) bool

func (OutStats) Swap

func (self OutStats) Swap(i, j int)

type Pkg

type Pkg struct {
	Pkg pkgstate.OPkg
	Key keys.Uint256
}

type State

type State struct {
	State *zstate.ZState

	G2outs      map[keys.Uint256]*OutState
	G2wouts     []keys.Uint256
	G2pkgs_from map[keys.Uint256]*Pkg
	G2pkgs_to   map[keys.Uint256]*Pkg
	// contains filtered or unexported fields
}

func CurrentState1

func CurrentState1() *State

func LoadState

func LoadState(zstate *zstate.ZState, loadName string) (state State)

func (*State) Finalize

func (self *State) Finalize(saveName string, num uint64)

func (*State) GetOut

func (state *State) GetOut(root *keys.Uint256) (src *OutState, e error)

func (*State) GetOuts

func (self *State) GetOuts(tk *keys.Uint512) (outs []*OutState, e error)

func (*State) GetPkgs

func (state *State) GetPkgs(tk *keys.Uint512, is_from bool) (ret []*Pkg)

func (*State) UpdateWitness

func (state *State) UpdateWitness(tks []keys.Uint512, num uint64, block *zstate.Block)

type StateData

type StateData struct {
	Outs      []*OutState
	Pkgs_from []*Pkg
	Pkgs_to   []*Pkg
	MaxNum    uint64
}

func (*StateData) Serial

func (self *StateData) Serial() (ret []byte)

type StateDataGet

type StateDataGet struct {
	// contains filtered or unexported fields
}

func (*StateDataGet) Unserial

func (self *StateDataGet) Unserial(v []byte)

Jump to

Keyboard shortcuts

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