Documentation
¶
Overview ¶
Package blockchaintesting contains test utilies for packages that depend on the blockchain packages.
Index ¶
- type MockTimestamper
- func (t *MockTimestamper) GetInfo() *blockchain.Info
- func (t *MockTimestamper) Timestamp(ctx context.Context, _ interface{}) (types.TransactionID, error)
- func (t *MockTimestamper) TimestampHash(_ context.Context, _ []byte) (types.TransactionID, error)
- func (t *MockTimestamper) WithError(err error) *MockTimestamper
- func (t *MockTimestamper) WithTransactionID(txid types.TransactionID) *MockTimestamper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockTimestamper ¶
type MockTimestamper struct {
// contains filtered or unexported fields
}
MockTimestamper mocks the Timestamper and HashTimestamper interfaces.
func NewTimestamper ¶
func NewTimestamper() *MockTimestamper
NewTimestamper creates a new mock timestamper.
func (*MockTimestamper) GetInfo ¶
func (t *MockTimestamper) GetInfo() *blockchain.Info
GetInfo returns dummy information.
func (*MockTimestamper) Timestamp ¶
func (t *MockTimestamper) Timestamp(ctx context.Context, _ interface{}) (types.TransactionID, error)
Timestamp returns a dummy transaction ID.
func (*MockTimestamper) TimestampHash ¶
func (t *MockTimestamper) TimestampHash(_ context.Context, _ []byte) (types.TransactionID, error)
TimestampHash returns a dummy transaction ID.
func (*MockTimestamper) WithError ¶
func (t *MockTimestamper) WithError(err error) *MockTimestamper
WithError configures the mock to return an error.
func (*MockTimestamper) WithTransactionID ¶
func (t *MockTimestamper) WithTransactionID(txid types.TransactionID) *MockTimestamper
WithTransactionID configures the mock to return the given transaction ID.
Click to show internal directories.
Click to hide internal directories.