testutils

package
v1.0.1-stable-dd60dab Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultQuickCheckConfig = &quick.Config{
	MaxCount: 128,
	Rand:     rand.New(rand.NewSource(time.Now().Unix())),
}

Functions

This section is empty.

Types

type FaultyBlockchain

type FaultyBlockchain struct {
	// contains filtered or unexported fields
}

func NewFaultyBlockchain

func NewFaultyBlockchain(balance map[tokens.Name]blockchain.Balance) *FaultyBlockchain

func (*FaultyBlockchain) Balances

func (blockchain *FaultyBlockchain) Balances() (map[tokens.Name]blockchain.Balance, error)

type MockBlockchain

type MockBlockchain struct {
	// contains filtered or unexported fields
}

MockBlockchain implements the `balance.Blockchain` interface.

func NewMockBlockchain

func NewMockBlockchain(balance map[tokens.Name]blockchain.Balance) *MockBlockchain

NewMockBlockchain creates a new `MockBlockchain`.

func (*MockBlockchain) Balances

func (blockchain *MockBlockchain) Balances() (map[tokens.Name]blockchain.Balance, error)

Balances implements the `balance.Blockchain` interface.

func (*MockBlockchain) GetAddress

func (bc *MockBlockchain) GetAddress(password string, blockchainName tokens.BlockchainName) (string, error)

func (*MockBlockchain) Lookup

func (bc *MockBlockchain) Lookup(token tokens.Token, txHash string) (transfer.UpdateReceipt, error)

func (*MockBlockchain) Transfer

func (bc *MockBlockchain) Transfer(password string, token tokens.Token, to string, amount *big.Int, speed blockchain.TxExecutionSpeed, sendAll bool) (string, blockchain.Cost, error)

func (*MockBlockchain) UpdateBalance

func (blockchain *MockBlockchain) UpdateBalance(balance map[tokens.Name]blockchain.Balance)

UpdateBalance with given data.

type MockCallback

type MockCallback struct {
	// contains filtered or unexported fields
}

func NewMockCallback

func NewMockCallback(err error) *MockCallback

func (*MockCallback) DelayCallback

func (callback *MockCallback) DelayCallback(swap swap.SwapBlob) (swap.SwapBlob, error)

type MockStorage

type MockStorage struct {
	// contains filtered or unexported fields
}

func NewMockStorage

func NewMockStorage() *MockStorage

func (*MockStorage) PutReceipt

func (store *MockStorage) PutReceipt(receipt swap.SwapReceipt) error

func (*MockStorage) PutTransfer

func (store *MockStorage) PutTransfer(receipt transfer.TransferReceipt) error

func (*MockStorage) Receipt

func (store *MockStorage) Receipt(id swap.SwapID) (swap.SwapReceipt, error)

func (*MockStorage) Receipts

func (store *MockStorage) Receipts() ([]swap.SwapReceipt, error)

func (*MockStorage) Transfers

func (store *MockStorage) Transfers() ([]transfer.TransferReceipt, error)

func (*MockStorage) UpdateReceipt

func (store *MockStorage) UpdateReceipt(update swap.ReceiptUpdate) error

Jump to

Keyboard shortcuts

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