Documentation ¶
Index ¶
- func BlockFromFilePath(filePath string) (state.Block, error)
- func BlockIndexFromFilePath(filePath string) (uint32, error)
- func BlocksEqual(block1, block2 state.Block) bool
- func CheckBlockInStore(t require.TestingT, store state.Store, origBlock state.Block)
- func CheckBlocksDifferent(t require.TestingT, block1, block2 state.Block)
- func CheckBlocksEqual(t require.TestingT, block1, block2 state.Block)
- func CheckStateInStore(t require.TestingT, store state.Store, origState state.State)
- func CheckStateInStores(t require.TestingT, storeOrig, storeNew state.Store, ...)
- func NewReadOnlyStore(store state.Store) state.Store
- func StatesEqual(state1, state2 state.State) bool
- type BlockCache
- 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) GetChainInitParameters() dict.Dict
- func (bfT *BlockFactory) GetNextBlock(commitment *state.L1Commitment, incrementOpt ...uint64) state.Block
- func (bfT *BlockFactory) GetOriginOutput() *isc.AliasOutputWithID
- func (bfT *BlockFactory) GetStateDraft(block state.Block) state.StateDraft
- func (bfT *BlockFactory) GetStore() state.Store
- type BlockKey
- type BlockWAL
- type TestBlockWAL
- type TimeProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockIndexFromFilePath ¶
func BlocksEqual ¶
func CheckBlockInStore ¶
func CheckBlocksDifferent ¶
NOTE: this function should not exist. state.Block should have Equals method
func CheckBlocksEqual ¶
NOTE: this function should not exist. state.Block should have Equals method
func CheckStateInStore ¶
func CheckStateInStores ¶
func CheckStateInStores(t require.TestingT, storeOrig, storeNew state.Store, commitment *state.L1Commitment)
-----------------------------------------------------------------------------
func StatesEqual ¶
NOTE: this function should not exist. state.State should have Equals method
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, metrics *metrics.ChainStateManagerMetrics, log *logger.Logger) (BlockCache, error)
type BlockFactory ¶
type BlockFactory struct {
// contains filtered or unexported fields
}
func NewBlockFactory ¶
func NewBlockFactory(t require.TestingT, chainInitParamsOpt ...dict.Dict) *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) GetChainInitParameters ¶
func (bfT *BlockFactory) GetChainInitParameters() dict.Dict
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) GetStateDraft ¶
func (bfT *BlockFactory) GetStateDraft(block state.Block) state.StateDraft
func (*BlockFactory) GetStore ¶
func (bfT *BlockFactory) GetStore() state.Store
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
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.