Documentation ¶
Index ¶
- type BatchStore
- func (bs *BatchStore) Exists(id []byte) (bool, error)
- func (bs *BatchStore) Get(id []byte) (*voucher.Batch, error)
- func (bs *BatchStore) GetChainState() *voucher.ChainState
- func (bs *BatchStore) GetReserveState() *voucher.ReserveState
- func (bs *BatchStore) Iterate(f func(*voucher.Batch) (bool, error)) error
- func (bs *BatchStore) PutChainState(cs *voucher.ChainState) error
- func (bs *BatchStore) Reset() error
- func (bs *BatchStore) ResetCalls() int
- func (bs *BatchStore) Save(batch *voucher.Batch) error
- func (bs *BatchStore) SetBatchExpiryHandler(eh voucher.BatchExpiryHandler)
- func (bs *BatchStore) SetStorageRadius(f func(uint8) uint8) error
- func (bs *BatchStore) SetStorageRadiusSetter(r voucher.StorageRadiusSetter)
- func (bs *BatchStore) Unreserve(_ voucher.UnreserveIteratorFn) error
- func (bs *BatchStore) Update(batch *voucher.Batch, newValue *big.Int, newDepth uint8) error
- type MockEventUpdater
- type Option
- func WithAcceptAllExistsFunc() Option
- func WithBatch(b *voucher.Batch) Option
- func WithChainState(cs *voucher.ChainState) Option
- func WithExistsFunc(f func([]byte) (bool, error)) Option
- func WithGetErr(err error, delayCnt int) Option
- func WithReserveState(rs *voucher.ReserveState) Option
- func WithUpdateErr(err error, delayCnt int) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchStore ¶
type BatchStore struct {
// contains filtered or unexported fields
}
BatchStore is a mock BatchStorer
func (*BatchStore) Exists ¶
func (bs *BatchStore) Exists(id []byte) (bool, error)
Exists reports whether batch referenced by the give id exists.
func (*BatchStore) Get ¶
func (bs *BatchStore) Get(id []byte) (*voucher.Batch, error)
Get mocks the Get method from the BatchStore.
func (*BatchStore) GetChainState ¶
func (bs *BatchStore) GetChainState() *voucher.ChainState
GetChainState mocks the GetChainState method from the BatchStore
func (*BatchStore) GetReserveState ¶
func (bs *BatchStore) GetReserveState() *voucher.ReserveState
func (*BatchStore) PutChainState ¶
func (bs *BatchStore) PutChainState(cs *voucher.ChainState) error
PutChainState mocks the PutChainState method from the BatchStore
func (*BatchStore) Reset ¶
func (bs *BatchStore) Reset() error
func (*BatchStore) ResetCalls ¶
func (bs *BatchStore) ResetCalls() int
func (*BatchStore) Save ¶
func (bs *BatchStore) Save(batch *voucher.Batch) error
Save mocks the Save method from the BatchStore.
func (*BatchStore) SetBatchExpiryHandler ¶
func (bs *BatchStore) SetBatchExpiryHandler(eh voucher.BatchExpiryHandler)
func (*BatchStore) SetStorageRadius ¶
func (bs *BatchStore) SetStorageRadius(f func(uint8) uint8) error
func (*BatchStore) SetStorageRadiusSetter ¶
func (bs *BatchStore) SetStorageRadiusSetter(r voucher.StorageRadiusSetter)
func (*BatchStore) Unreserve ¶
func (bs *BatchStore) Unreserve(_ voucher.UnreserveIteratorFn) error
type MockEventUpdater ¶
type MockEventUpdater struct {
// contains filtered or unexported fields
}
func NewNotReady ¶
func NewNotReady() *MockEventUpdater
func NewWithError ¶
func NewWithError(err error) *MockEventUpdater
func (*MockEventUpdater) GetSyncStatus ¶
func (s *MockEventUpdater) GetSyncStatus() (isDone bool, err error)
type Option ¶
type Option func(*BatchStore)
Option is an option passed to New.
func WithAcceptAllExistsFunc ¶
func WithAcceptAllExistsFunc() Option
func WithBatch ¶
WithBatch will set batch to the one provided by user. This will be returned in the next Get.
func WithChainState ¶
func WithChainState(cs *voucher.ChainState) Option
WithChainState will set the initial chainstate in the ChainStore mock.
func WithGetErr ¶
WithGetErr will set the get error returned by the ChainStore mock. The error will be returned on each subsequent call after delayCnt calls to Get have been made.
func WithReserveState ¶
func WithReserveState(rs *voucher.ReserveState) Option
WithReserveState will set the initial reservestate in the ChainStore mock.
func WithUpdateErr ¶
WithUpdateErr will set the put error returned by the ChainStore mock. The error will be returned on each subsequent call after delayCnt calls to Update have been made.