cache

package
v0.0.9-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsensusInfoCache

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

ConsensusInfoCache

func NewConsensusInfoCache

func NewConsensusInfoCache() *ConsensusInfoCache

NewConsensusInfoCache creates a new consensus info cache for storing/accessing previous epoch.

func (*ConsensusInfoCache) AddConsensusInfoCache

func (c *ConsensusInfoCache) AddConsensusInfoCache(
	epoch types.Epoch,
	consensusInfo *eventTypes.MinimalEpochConsensusInfo,
) error

AddConsensusInfoCache adds ConsensusInfoCache object to the cache.

func (*ConsensusInfoCache) ConsensusInfoByEpoch

func (c *ConsensusInfoCache) ConsensusInfoByEpoch(epoch types.Epoch) (*eventTypes.MinimalEpochConsensusInfo, error)

ConsensusInfoByEpoch fetches consensusInfo by epoch. Returns true with a reference to the consensusInfo, if exists. Otherwise returns false, nil.

func (*ConsensusInfoCache) ConsensusInfoByEpochRange

func (c *ConsensusInfoCache) ConsensusInfoByEpochRange(
	fromEpoch, toEpoch types.Epoch) map[types.Epoch]*eventTypes.MinimalEpochConsensusInfo

ConsensusInfoByEpochRange

Jump to

Keyboard shortcuts

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