data

package
v1.0.3-rc3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

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 *c_type.Uint256) (ret []byte)

func Name2BKey

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

func OutName0

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

Types

type AddDelLog

type AddDelLog struct {
	In *c_type.Uint256
}

func (AddDelLog) Op

func (log AddDelLog) Op(state IData)

type AddNilLog

type AddNilLog struct {
	In *c_type.Uint256
}

func (AddNilLog) Op

func (log AddNilLog) Op(state IData)

type AddOutLog

type AddOutLog struct {
	Root   *c_type.Uint256
	Out    *localdb.OutState
	Txhash *c_type.Uint256
}

func (AddOutLog) Op

func (log AddOutLog) Op(state IData)

type AddTxOutLog

type AddTxOutLog struct {
	Pkr *c_type.PKr
}

func (AddTxOutLog) Op

func (log AddTxOutLog) Op(state IData)

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[c_type.Uint256]*localdb.OutState
	H2tx   map[c_type.Uint256]*c_type.Uint256

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

func NewData

func NewData(num uint64) (ret *Data)

func (*Data) AddDel

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

func (*Data) AddNil

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

func (*Data) AddOut

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

func (*Data) AddTxOut

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

func (*Data) Clear

func (state *Data) Clear()

func (*Data) GetDels

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

func (*Data) GetIndex

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

func (*Data) GetOut

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

func (*Data) GetRoots

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

func (*Data) HasIn

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

func (*Data) HashRoot

func (self *Data) HashRoot(tr tri.Tri, root *c_type.Uint256) bool

func (*Data) LoadState

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

func (*Data) RecordState

func (self *Data) RecordState(putter axisdb.Putter, root *c_type.Uint256)

func (*Data) SaveState

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

type IData

type IData interface {
	Clear()

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

	LoadState(tr tri.Tri)
	SaveState(tr tri.Tri)
	RecordState(putter axisdb.Putter, root *c_type.Uint256)

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

	HashRoot(tr tri.Tri, root *c_type.Uint256) bool

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

type Log

type Log interface {
	Op(state IData)
}

type Revision

type Revision struct {
	Id           int
	JournalIndex int
}

type State0BlockGet

type State0BlockGet struct {
	Out StateBlock
}

func (*State0BlockGet) Unserial

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

type StateBlock

type StateBlock struct {
	Roots []c_type.Uint256
	Dels  []c_type.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