state1

package
v0.3.1-beta.rc.5.hotfix.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug_State1_addout_assert

func Debug_State1_addout_assert(state *State1, os *zstate.OutState0)

func Debug_State1_addout_end_assert

func Debug_State1_addout_end_assert(state *State1, os *zstate.OutState0)

func Run

func Run(bc BlockChain)

func SortOutStats

func SortOutStats(st *zstate.State0, outs []*OutState1)

func UpdateOutStat

func UpdateOutStat(st *zstate.State0, out *OutState1)

Types

type BlockChain

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

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 OutState1

type OutState1 struct {
	Pg           witness.PathGen
	WitnessIndex uint64
	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 (*OutState1) IsMine

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

func (*OutState1) Serial

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

func (*OutState1) ToWitness

func (self *OutState1) ToWitness() (commitment keys.Uint256, index uint32, path [cpt.DEPTH * 32]byte, anchor keys.Uint256)

func (*OutState1) Unserial

func (self *OutState1) Unserial(v []byte) (*OutState1, 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 State1

type State1 struct {
	State0 *zstate.State0

	G2outs  map[keys.Uint256]*OutState1
	G2wouts []keys.Uint256
	// contains filtered or unexported fields
}

func CurrentState1

func CurrentState1() *State1

func LoadState1

func LoadState1(state0 *zstate.State0, loadName string) (state State1)

func (*State1) Finalize

func (self *State1) Finalize(saveName string)

func (*State1) GetOut

func (state *State1) GetOut(root *keys.Uint256) (src *OutState1, e error)

func (*State1) GetOuts

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

func (*State1) UpdateWitness

func (state *State1) UpdateWitness(tks []keys.Uint512)

type State1Data

type State1Data struct {
	Outs   []*OutState1
	MaxNum uint64
}

func (*State1Data) Serial

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

type State1DataGet

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

func (*State1DataGet) Unserial

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

Jump to

Keyboard shortcuts

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