rawdb

package
v0.0.0-...-1f8a15b Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

nolint

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyLastFinality                    = errors.New("empty response while getting last finality")
	ErrIncorrectFinality                    = errors.New("last checkpoint in the DB is incorrect")
	ErrIncorrectFinalityToStore             = errors.New("failed to marshal the last finality struct")
	ErrDBNotResponding                      = errors.New("failed to store the last finality struct")
	ErrIncorrectLockFieldToStore            = errors.New("failed to marshal the lockField struct ")
	ErrIncorrectLockField                   = errors.New("lock field in the DB is incorrect")
	ErrIncorrectFutureMilestoneFieldToStore = errors.New("failed to marshal the future milestone field struct ")
	ErrIncorrectFutureMilestoneField        = errors.New("future milestone field  in the DB is incorrect")
)

Functions

func ReadFinality

func ReadFinality[T BlockFinality[T]](db kv.RwDB) (uint64, libcommon.Hash, error)

func ReadFutureMilestoneList

func ReadFutureMilestoneList(db kv.RwDB) ([]uint64, map[uint64]libcommon.Hash, error)

func ReadLockField

func ReadLockField(db kv.RwDB) (bool, uint64, libcommon.Hash, map[string]struct{}, error)

func WriteFutureMilestoneList

func WriteFutureMilestoneList(db kv.RwDB, order []uint64, list map[uint64]libcommon.Hash) error

func WriteLastFinality

func WriteLastFinality[T BlockFinality[T]](db kv.RwDB, block uint64, hash libcommon.Hash) error

func WriteLockField

func WriteLockField(db kv.RwDB, val bool, block uint64, hash libcommon.Hash, idListMap map[string]struct{}) error

Types

type BlockFinality

type BlockFinality[T any] interface {
	// contains filtered or unexported methods
}

type Checkpoint

type Checkpoint struct {
	Finality
}

type Finality

type Finality struct {
	Block uint64
	Hash  libcommon.Hash
}

type FutureMilestoneField

type FutureMilestoneField struct {
	Order []uint64
	List  map[uint64]libcommon.Hash
}

type LockField

type LockField struct {
	Val    bool
	Block  uint64
	Hash   libcommon.Hash
	IdList map[string]struct{}
}

type Milestone

type Milestone struct {
	Finality
}

Jump to

Keyboard shortcuts

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