iface

package
v0.6.0-develop Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsensusInfoAccessDatabase

type ConsensusInfoAccessDatabase interface {
	ReadOnlyConsensusInfoDatabase

	SaveConsensusInfo(ctx context.Context, consensusInfo *types.MinimalEpochConsensusInfo) error
	SaveLatestEpoch(ctx context.Context, epoch uint64) error
}

ConsensusInfoAccessDatabase

type Database

type Database interface {
	io.Closer

	ConsensusInfoAccessDatabase

	InvalidSlotDatabase

	VerifiedShardInfoDatabase

	DatabasePath() string
	ClearDB() error
}

Database interface with full access.

type InvalidSlotDatabase

type InvalidSlotDatabase interface {
	ReadOnlyInvalidSlotInfoDatabase

	SaveInvalidSlotInfo(slot uint64, slotInfo *types.SlotInfo) error
}

type ReadOnlyConsensusInfoDatabase

type ReadOnlyConsensusInfoDatabase interface {
	ConsensusInfo(ctx context.Context, epoch uint64) (*types.MinimalEpochConsensusInfo, error)
	ConsensusInfos(fromEpoch uint64) ([]*types.MinimalEpochConsensusInfo, error)
	LatestSavedEpoch() uint64
}

ReadOnlyDatabase defines a struct which only has read access to database methods.

type ReadOnlyInvalidSlotInfoDatabase

type ReadOnlyInvalidSlotInfoDatabase interface {
	InvalidSlotInfo(slots uint64) (*types.SlotInfo, error)
}

type ReadOnlyVerifiedShardInfoDatabase

type ReadOnlyVerifiedShardInfoDatabase interface {
	VerifiedShardInfo(stepId uint64) (*types.MultiShardInfo, error)
	VerifiedShardInfos(fromStepId uint64) (map[uint64]*types.MultiShardInfo, error)
	LatestStepID() uint64
	GetStepIdBySlot(slot uint64) (uint64, error)
	FinalizedSlot() uint64
	FinalizedEpoch() uint64
	FindAncestor(fromStepId, toStepId uint64, blockHash common.Hash) (*types.MultiShardInfo, error)
}

type VerifiedShardInfoDatabase

type VerifiedShardInfoDatabase interface {
	ReadOnlyVerifiedShardInfoDatabase

	SaveVerifiedShardInfo(stepId uint64, shardInfo *types.MultiShardInfo) error
	SaveLatestStepID(stepID uint64) error
	RemoveShardingInfos(fromStepId uint64) error
	SaveSlotStepIndex(slot, stepId uint64) error
	SaveFinalizedSlot(latestFinalizedSlot uint64) error
	SaveFinalizedEpoch(latestFinalizedEpoch uint64) error
}

Jump to

Keyboard shortcuts

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