Documentation ¶
Index ¶
- type BatchStore
- func (bs *BatchStore) Get(id []byte) (*postage.Batch, error)
- func (bs *BatchStore) GetChainState() *postage.ChainState
- func (bs *BatchStore) GetReserveState() *postage.ReserveState
- func (bs *BatchStore) Put(batch *postage.Batch, newValue *big.Int, newDepth uint8) error
- func (bs *BatchStore) PutChainState(cs *postage.ChainState) error
- func (bs *BatchStore) Reset() error
- func (bs *BatchStore) ResetCalls() int
- func (bs *BatchStore) SetRadiusSetter(r postage.RadiusSetter)
- type 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) Get ¶
func (bs *BatchStore) Get(id []byte) (*postage.Batch, error)
Get mocks the Get method from the BatchStore
func (*BatchStore) GetChainState ¶
func (bs *BatchStore) GetChainState() *postage.ChainState
GetChainState mocks the GetChainState method from the BatchStore
func (*BatchStore) GetReserveState ¶
func (bs *BatchStore) GetReserveState() *postage.ReserveState
func (*BatchStore) PutChainState ¶
func (bs *BatchStore) PutChainState(cs *postage.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) SetRadiusSetter ¶
func (bs *BatchStore) SetRadiusSetter(r postage.RadiusSetter)
type Option ¶
type Option func(*BatchStore)
Option is a an option passed to New
func WithChainState ¶
func WithChainState(cs *postage.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 WithPutErr ¶
WithPutErr will set the put error returned by the ChainStore mock. The error will be returned on each subsequent call after delayCnt calls to Put have been made.
func WithReserveState ¶
func WithReserveState(rs *postage.ReserveState) Option
WithChainState will set the initial chainstate in the ChainStore mock.