txstate

package
v0.4.1-beta.r2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2019 License: GPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const BLOCK_NAME = "ZState0_BLOCK"
View Source
const DEPTH = cpt.DEPTH
View Source
const LAST_OUTSTATE0_NAME = tri.KEY_NAME("ZState0_Cur")

Variables

This section is empty.

Functions

func CalcRoot

func CalcRoot(value *keys.Uint256, pos uint64, paths *[DEPTH]keys.Uint256) (ret keys.Uint256)

func Combine

func Combine(l *keys.Uint256, r *keys.Uint256) (out keys.Uint256)

func Debug_Weak_panic

func Debug_Weak_panic(msg string, ctx ...interface{})

func Need_debug

func Need_debug() bool

Types

type Current

type Current struct {
	Index int64
}

func NewCur

func NewCur() (ret Current)

func (*Current) Serial

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

type CurrentGet

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

func (*CurrentGet) Unserial

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

type Data

type Data struct {
	Cur    Current
	Block  StateBlock
	G2ins  map[keys.Uint256]bool
	G2outs map[keys.Uint256]*OutState

	Dirty_last_out bool
	Dirty_G2ins    map[keys.Uint256]bool
	Dirty_G2outs   map[keys.Uint256]bool
}

type Leaf

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

type MerkleTree

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

func NewMerkleTree

func NewMerkleTree(db tri.Tri) (ret MerkleTree)

func (*MerkleTree) AppendLeaf

func (self *MerkleTree) AppendLeaf(value keys.Uint256) keys.Uint256

func (*MerkleTree) GetPaths

func (self *MerkleTree) GetPaths(value keys.Uint256) (pos uint64, paths [DEPTH]keys.Uint256, anchor keys.Uint256)

type OutState

type OutState struct {
	Index  uint64
	Out_O  *stx.Out_O    `rlp:"nil"`
	Out_Z  *stx.Out_Z    `rlp:"nil"`
	OutCM  *keys.Uint256 `rlp:"nil"`
	RootCM *keys.Uint256 `rlp:"nil"`
}

func (*OutState) Clone

func (self *OutState) Clone() (ret OutState)

func (*OutState) IsO

func (out *OutState) IsO() bool

func (*OutState) Serial

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

func (*OutState) ToIndexRsk

func (self *OutState) ToIndexRsk() (ret keys.Uint256)

func (*OutState) ToOutCM

func (self *OutState) ToOutCM() *keys.Uint256

func (*OutState) ToPKr

func (self *OutState) ToPKr() *keys.PKr

func (*OutState) ToRootCM

func (self *OutState) ToRootCM() *keys.Uint256

type OutState0Get

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

func (*OutState0Get) Unserial

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

type State

type State struct {
	MTree MerkleTree

	Data
	// contains filtered or unexported fields
}

func NewState

func NewState(tri tri.Tri, num uint64) (state State)

func (*State) AddOut

func (state *State) AddOut(out_o *stx.Out_O, out_z *stx.Out_Z) (root keys.Uint256)

func (*State) AddStx

func (state *State) AddStx(st *stx.T) (e error)

func (*State) GetOut

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

func (*State) HasIn

func (self *State) HasIn(hash *keys.Uint256) (exists bool)

func (*State) Name2BKey

func (self *State) Name2BKey(name string, num uint64) (ret []byte)

func (*State) Num

func (self *State) Num() uint64

func (*State) Revert

func (self *State) Revert(revid int)

func (*State) Snapshot

func (self *State) Snapshot(revid int)

func (*State) Tri

func (self *State) Tri() tri.Tri

func (*State) Update

func (self *State) Update()

type State0BlockGet

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

func (*State0BlockGet) Unserial

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

type State0Trees

type State0Trees struct {
	Trees       map[uint64]merkle.Tree
	Roots       []keys.Uint256
	Start_index uint64
}

type StateBlock

type StateBlock struct {
	//Tree        *merkle.Tree `rlp:"nil"`
	Roots []keys.Uint256
	Dels  []keys.Uint256
}

func (*StateBlock) Serial

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

Jump to

Keyboard shortcuts

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