clientmock

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockAlphabillClient

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

MockAlphabillClient for testing. NOT thread safe.

func NewMockAlphabillClient

func NewMockAlphabillClient(options ...Option) *MockAlphabillClient

func (*MockAlphabillClient) ClearRecordedTransactions

func (c *MockAlphabillClient) ClearRecordedTransactions()

func (*MockAlphabillClient) Close added in v0.2.0

func (c *MockAlphabillClient) Close() error

func (*MockAlphabillClient) GetBlock

func (c *MockAlphabillClient) GetBlock(_ context.Context, blockNumber uint64) ([]byte, error)

func (*MockAlphabillClient) GetBlocks

func (c *MockAlphabillClient) GetBlocks(_ context.Context, blockNumber, _ uint64) (*alphabill.GetBlocksResponse, error)

func (*MockAlphabillClient) GetLastRequestedBlockNumber added in v0.2.0

func (c *MockAlphabillClient) GetLastRequestedBlockNumber() uint64

func (*MockAlphabillClient) GetRecordedTransactions

func (c *MockAlphabillClient) GetRecordedTransactions() []*types.TransactionOrder

func (*MockAlphabillClient) GetRoundNumber added in v0.2.0

func (c *MockAlphabillClient) GetRoundNumber(ctx context.Context) (uint64, error)

func (*MockAlphabillClient) IsShutdown

func (c *MockAlphabillClient) IsShutdown() bool

func (*MockAlphabillClient) SendTransaction

func (c *MockAlphabillClient) SendTransaction(_ context.Context, tx *types.TransactionOrder) error

func (*MockAlphabillClient) SendTransactionWithRetry added in v0.2.0

func (c *MockAlphabillClient) SendTransactionWithRetry(ctx context.Context, tx *types.TransactionOrder, maxTries int) error

func (*MockAlphabillClient) SetBlock

func (c *MockAlphabillClient) SetBlock(b *types.Block)

func (*MockAlphabillClient) SetIncrementOnFetch added in v0.2.0

func (c *MockAlphabillClient) SetIncrementOnFetch(incrementOnFetch bool)

func (*MockAlphabillClient) SetMaxBlockNumber

func (c *MockAlphabillClient) SetMaxBlockNumber(blockNumber uint64)

func (*MockAlphabillClient) SetMaxRoundNumber added in v0.2.0

func (c *MockAlphabillClient) SetMaxRoundNumber(roundNumber uint64)

func (*MockAlphabillClient) SetTxListener added in v0.2.0

func (c *MockAlphabillClient) SetTxListener(txListener func(tx *types.TransactionOrder))

func (*MockAlphabillClient) SetTxResponse

func (c *MockAlphabillClient) SetTxResponse(txResponse error)

type Option added in v0.2.0

type Option func(c *MockAlphabillClient)

MockAlphabillClient for testing. NOT thread safe.

func WithBlocks added in v0.2.0

func WithBlocks(blocks map[uint64]*types.Block) Option

func WithMaxBlockNumber added in v0.2.0

func WithMaxBlockNumber(blockNumber uint64) Option

func WithMaxRoundNumber added in v0.2.0

func WithMaxRoundNumber(roundNumber uint64) Option

Jump to

Keyboard shortcuts

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