consensus

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytePair

type BytePair struct {
	Key   []byte
	Value []byte
}

func (*BytePair) CopyFrom

func (self *BytePair) CopyFrom(from CItem)

func (*BytePair) CopyTo

func (self *BytePair) CopyTo() CItem

func (*BytePair) Id

func (self *BytePair) Id() (ret []byte)

func (*BytePair) State

func (self *BytePair) State() (ret []byte)

type Bytes

type Bytes []byte

func (*Bytes) CopyFrom

func (self *Bytes) CopyFrom(from CItem)

func (*Bytes) CopyTo

func (self *Bytes) CopyTo() CItem

func (*Bytes) Id

func (self *Bytes) Id() (ret []byte)

type CItem

type CItem interface {
	CopyTo() (ret CItem)
	CopyFrom(CItem)
}

type Cons

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

func NewCons

func NewCons(db DB, pre string) (ret Cons)

func (*Cons) Copy

func (self *Cons) Copy(db DB) (ret *Cons)

func (*Cons) CreateSnapshot

func (self *Cons) CreateSnapshot(ver int)

func (*Cons) Record

func (self *Cons) Record(header *types.Header, batch DPutter)

func (*Cons) ReportConItems

func (self *Cons) ReportConItems(name string, items consItems, num uint64)

func (*Cons) ReportRecords

func (self *Cons) ReportRecords(records []*Record, num uint64)

func (*Cons) RevertToSnapshot

func (self *Cons) RevertToSnapshot(ver int)

func (*Cons) Update

func (self *Cons) Update()

type DB

type DB interface {
	CurrentTri() axisdb.Tri
	GlobalGetter() axisdb.Getter
}

type DBObj

type DBObj struct {
	Pre string
}

func (DBObj) GetBlockRecords

func (self DBObj) GetBlockRecords(getter axisdb.Getter, num uint64, hash *common.Hash) (records []*Record)

func (DBObj) GetBlockRecordsMap

func (self DBObj) GetBlockRecordsMap(getter axisdb.Getter, num uint64, hash *common.Hash) (records map[string][]RecordPair)

func (DBObj) GetObject

func (self DBObj) GetObject(getter axisdb.Getter, hash []byte, item CItem) (ret CItem)

type DPutter

type DPutter interface {
	axisdb.Putter
	axisdb.Deleter
}

type FakeDB

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

func NewFakeDB

func NewFakeDB() (ret FakeDB)

func (*FakeDB) CurrentTri

func (self *FakeDB) CurrentTri() axisdb.Tri

func (*FakeDB) GlobalGetter

func (self *FakeDB) GlobalGetter() axisdb.Getter

func (*FakeDB) Num

func (self *FakeDB) Num() uint64

type FakeTri

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

func NewFakeTri

func NewFakeTri() (ret FakeTri)

func (*FakeTri) Delete

func (self *FakeTri) Delete(key []byte) error

func (*FakeTri) Get

func (self *FakeTri) Get(key []byte) ([]byte, error)

func (*FakeTri) Has

func (self *FakeTri) Has(key []byte) (bool, error)

func (*FakeTri) Put

func (self *FakeTri) Put(key, value []byte) error

func (*FakeTri) TryDelete

func (self *FakeTri) TryDelete(key []byte) error

func (*FakeTri) TryGet

func (self *FakeTri) TryGet(key []byte) ([]byte, error)

func (*FakeTri) TryUpdate

func (self *FakeTri) TryUpdate(key, value []byte) error

type KVPoint

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

func NewKVPt

func NewKVPt(cons *Cons, keyPre string, inblock string) (ret KVPoint)

func (*KVPoint) GetValue

func (self *KVPoint) GetValue(id []byte) (ret []byte)

func (*KVPoint) SetValue

func (self *KVPoint) SetValue(id []byte, value []byte)

type ObjPoint

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

func NewObjPt

func NewObjPt(cons *Cons, objPre string, statePre string, inblock string) (ret ObjPoint)

func (*ObjPoint) AddObj

func (self *ObjPoint) AddObj(item PItem)

func (*ObjPoint) GetObj

func (self *ObjPoint) GetObj(id []byte, item PItem) (ret CItem)

type PItem

type PItem interface {
	CItem
	Id() (ret []byte)
	State() (ret []byte)
}

type Record

type Record struct {
	Name  string
	Pairs []RecordPair
}

func (*Record) Log

func (self *Record) Log() string

type RecordPair

type RecordPair struct {
	Ref  []byte
	Hash []byte
}

Jump to

Keyboard shortcuts

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