blockchaintesting

package
v0.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package blockchaintesting contains test utilies for packages that depend on the blockchain packages.

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL