consensus

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: GPL-3.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsKeysKey added in v1.1.0

func ConsKeysKey(num uint64, bhash common.Hash) []byte

func GetConsKeys added in v1.1.0

func GetConsKeys(getter serodb.Getter, num uint64, bhash common.Hash) [][]byte

func PutConsKeys added in v1.1.0

func PutConsKeys(putter serodb.Putter, num uint64, bhash common.Hash, keys [][]byte)

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() serodb.Tri
	GlobalGetter() serodb.Getter
}

type DBObj

type DBObj struct {
	Pre string
}

func (DBObj) GetBlockRecords

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

func (DBObj) GetBlockRecordsMap

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

func (DBObj) GetObject

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

type DPutter

type DPutter interface {
	serodb.Putter
	serodb.Deleter
}

type FakeDB

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

func NewFakeDB

func NewFakeDB() (ret FakeDB)

func (*FakeDB) CurrentTri

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

func (*FakeDB) GlobalGetter

func (self *FakeDB) GlobalGetter() serodb.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