store

package
v0.0.0-...-5cda5f8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CPKDataKeyPrefix                 = []byte{0x01}
	StateBatchKeyPrefix              = []byte{0x02}
	IndexStateBatchKeyPrefix         = []byte{0x03}
	SigningInfoKeyPrefix             = []byte{0x04}
	NodeMissedBatchBitArrayKeyPrefix = []byte{0x05}
	SlashingInfoKeyPrefix            = []byte{0x06}
	ScannedHeightKeyPrefix           = []byte{0x07}
	CulpritsKeyPrefix                = []byte{0x08}
)

Functions

This section is empty.

Types

type Storage

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

func NewStorage

func NewStorage(levelDbFolder string) (*Storage, error)

func (*Storage) AddCulprits

func (s *Storage) AddCulprits(culprits []string)

func (*Storage) ClearNodeMissedBatchBitArray

func (s *Storage) ClearNodeMissedBatchBitArray(address common.Address)

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) GetByElectionId

func (s *Storage) GetByElectionId(electionId uint64) (types.CpkData, error)

func (*Storage) GetCulprits

func (s *Storage) GetCulprits() []string

func (*Storage) GetIndexStateBatch

func (s *Storage) GetIndexStateBatch(index uint64) (bool, [32]byte)

func (*Storage) GetNodeMissedBatchBitArray

func (s *Storage) GetNodeMissedBatchBitArray(address common.Address, index uint64) bool

func (*Storage) GetScannedHeight

func (s *Storage) GetScannedHeight() (uint64, error)

func (*Storage) GetSigningInfo

func (s *Storage) GetSigningInfo(address common.Address) (bool, slash.SigningInfo)

func (*Storage) GetSlashingInfo

func (s *Storage) GetSlashingInfo(address common.Address, batchIndex uint64) (bool, slash.SlashingInfo)

func (*Storage) GetStateBatch

func (s *Storage) GetStateBatch(root [32]byte) (bool, index.StateBatchInfo)

func (*Storage) IndexStateBatch

func (s *Storage) IndexStateBatch(index uint64, root [32]byte) error

func (*Storage) Insert

func (s *Storage) Insert(cpkData types.CpkData) error

func (*Storage) IsInSlashing

func (s *Storage) IsInSlashing(address common.Address) bool

func (*Storage) ListSlashingInfo

func (s *Storage) ListSlashingInfo() (slashingInfos []slash.SlashingInfo)

func (*Storage) RemoveSlashingInfo

func (s *Storage) RemoveSlashingInfo(address common.Address, batchIndex uint64)

func (*Storage) ResetScanHeight

func (s *Storage) ResetScanHeight(height uint64) error

func (*Storage) SetNodeMissedBatchBitArray

func (s *Storage) SetNodeMissedBatchBitArray(address common.Address, index uint64, missed bool)

func (*Storage) SetSigningInfo

func (s *Storage) SetSigningInfo(signingInfo slash.SigningInfo)

func (*Storage) SetSlashingInfo

func (s *Storage) SetSlashingInfo(slashingInfo slash.SlashingInfo)

func (*Storage) SetStateBatch

func (s *Storage) SetStateBatch(info index.StateBatchInfo) error

func (*Storage) UpdateHeight

func (s *Storage) UpdateHeight(height uint64) error

Jump to

Keyboard shortcuts

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