data

package
v0.7.0-hotfix.3-review Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: GPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const BLOCK_NAME = "ZState0_BLOCK"
View Source
const LAST_OUTSTATE0_NAME = tri.KEY_NAME("ZState0_Cur")
View Source
const ZSTATE0_INNAME = "ZState0_InName"
View Source
const ZSTATE0_OUTNAME = "ZState0_OutName"

Variables

This section is empty.

Functions

func InName

func InName(k *keys.Uint256) (ret []byte)

func Name2BKey

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

func OutName0

func OutName0(k *keys.Uint256) (ret []byte)

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 {
	Out Current
}

func (*CurrentGet) Unserial

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

type Data

type Data struct {
	Num    uint64
	Cur    Current
	Block  StateBlock
	G2outs map[keys.Uint256]*localdb.OutState
	H2tx   map[keys.Uint256]*keys.Uint256

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

func NewData

func NewData(num uint64) (ret *Data)

func (*Data) AddDel

func (self *Data) AddDel(in *keys.Uint256)

func (*Data) AddNil

func (self *Data) AddNil(in *keys.Uint256)

func (*Data) AddOut

func (self *Data) AddOut(root *keys.Uint256, out *localdb.OutState, txhash *keys.Uint256)

func (*Data) AddTxOut

func (self *Data) AddTxOut(pkr *keys.PKr) int

func (*Data) Clear

func (state *Data) Clear()

func (*Data) GetDels

func (self *Data) GetDels() (dels []keys.Uint256)

func (*Data) GetIndex

func (self *Data) GetIndex() (index int64)

func (*Data) GetOut

func (self *Data) GetOut(tr tri.Tri, root *keys.Uint256) (src *localdb.OutState)

func (*Data) GetRoots

func (self *Data) GetRoots() (roots []keys.Uint256)

func (*Data) HasIn

func (self *Data) HasIn(tr tri.Tri, hash *keys.Uint256) (exists bool)

func (*Data) LoadState

func (self *Data) LoadState(tr tri.Tri)

func (*Data) RecordState

func (self *Data) RecordState(putter serodb.Putter, root *keys.Uint256)

func (*Data) SaveState

func (self *Data) SaveState(tr tri.Tri)

type IData

type IData interface {
	Clear()

	AddTxOut(pkr *keys.PKr) int
	AddOut(root *keys.Uint256, out *localdb.OutState, txhash *keys.Uint256)
	AddNil(in *keys.Uint256)
	AddDel(in *keys.Uint256)

	LoadState(tr tri.Tri)
	SaveState(tr tri.Tri)
	RecordState(putter serodb.Putter, root *keys.Uint256)

	HasIn(tr tri.Tri, hash *keys.Uint256) (exists bool)
	GetOut(tr tri.Tri, root *keys.Uint256) (src *localdb.OutState)

	GetRoots() (roots []keys.Uint256)
	GetDels() (dels []keys.Uint256)
}

type State0BlockGet

type State0BlockGet struct {
	Out StateBlock
}

func (*State0BlockGet) Unserial

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

type StateBlock

type StateBlock struct {
	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