Documentation ¶
Index ¶
- type BlockCache
- type BlockCacheTimers
- type BlockFactory
- func (bfT *BlockFactory) GetAliasOutput(commitment *state.L1Commitment) *isc.AliasOutputWithID
- func (bfT *BlockFactory) GetBlocks(count, branchingFactor int) []state.Block
- func (bfT *BlockFactory) GetBlocksFrom(count, branchingFactor int, commitment *state.L1Commitment, ...) []state.Block
- func (bfT *BlockFactory) GetChainID() isc.ChainID
- func (bfT *BlockFactory) GetNextBlock(commitment *state.L1Commitment, incrementOpt ...uint64) state.Block
- func (bfT *BlockFactory) GetOriginOutput() *isc.AliasOutputWithID
- func (bfT *BlockFactory) GetState(commitment *state.L1Commitment) state.State
- func (bfT *BlockFactory) GetStateDraft(block state.Block) state.StateDraft
- type BlockKey
- type BlockWAL
- type TestBlockWAL
- type TimeProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockCache ¶
type BlockCache interface { AddBlock(state.Block) GetBlock(*state.L1Commitment) state.Block CleanOlderThan(time.Time) Size() int }
func NewBlockCache ¶
func NewBlockCache(tp TimeProvider, maxCacheSize int, wal BlockWAL, log *logger.Logger) (BlockCache, error)
type BlockCacheTimers ¶
type BlockCacheTimers struct { // How long should the block stay in cache before being deleted BlocksInCacheDuration time.Duration // How often should the block cache be cleened BlockCleaningPeriod time.Duration }
func NewBlockCacheTimers ¶
func NewBlockCacheTimers() BlockCacheTimers
type BlockFactory ¶
type BlockFactory struct {
// contains filtered or unexported fields
}
func NewBlockFactory ¶
func NewBlockFactory(t require.TestingT) *BlockFactory
func (*BlockFactory) GetAliasOutput ¶
func (bfT *BlockFactory) GetAliasOutput(commitment *state.L1Commitment) *isc.AliasOutputWithID
func (*BlockFactory) GetBlocks ¶
func (bfT *BlockFactory) GetBlocks( count, branchingFactor int, ) []state.Block
func (*BlockFactory) GetBlocksFrom ¶
func (bfT *BlockFactory) GetBlocksFrom( count, branchingFactor int, commitment *state.L1Commitment, incrementFactorOpt ...uint64, ) []state.Block
func (*BlockFactory) GetChainID ¶
func (bfT *BlockFactory) GetChainID() isc.ChainID
func (*BlockFactory) GetNextBlock ¶
func (bfT *BlockFactory) GetNextBlock( commitment *state.L1Commitment, incrementOpt ...uint64, ) state.Block
func (*BlockFactory) GetOriginOutput ¶
func (bfT *BlockFactory) GetOriginOutput() *isc.AliasOutputWithID
func (*BlockFactory) GetState ¶
func (bfT *BlockFactory) GetState(commitment *state.L1Commitment) state.State
func (*BlockFactory) GetStateDraft ¶
func (bfT *BlockFactory) GetStateDraft(block state.Block) state.StateDraft
type BlockKey ¶
Type for block identifier to be used when putting blocks in maps.
func NewBlockKey ¶
func NewBlockKey(commitment *state.L1Commitment) BlockKey
func (BlockKey) AsBlockHash ¶
type BlockWAL ¶
type BlockWAL interface { Write(state.Block) error Contains(state.BlockHash) bool Read(state.BlockHash) (state.Block, error) ReadAllByStateIndex(cb func(stateIndex uint32, block state.Block) bool) error }
func NewBlockWAL ¶
func NewEmptyBlockWAL ¶
func NewEmptyBlockWAL() BlockWAL
func NewMockedBlockWAL ¶
func NewMockedBlockWAL() BlockWAL
type TestBlockWAL ¶
May be used only for tests; deleting in production should not be available.
func NewEmptyTestBlockWAL ¶
func NewEmptyTestBlockWAL() TestBlockWAL
func NewMockedTestBlockWAL ¶
func NewMockedTestBlockWAL() TestBlockWAL
type TimeProvider ¶
type TimeProvider interface { SetNow(time.Time) GetNow() time.Time After(time.Duration) <-chan time.Time }
func NewArtifficialTimeProvider ¶
func NewArtifficialTimeProvider(nowOpt ...time.Time) TimeProvider
func NewDefaultTimeProvider ¶
func NewDefaultTimeProvider() TimeProvider
Click to show internal directories.
Click to hide internal directories.