test_utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockChain

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

MockChain is a simple in-memory implementation of spec.Blockchain for tests.

func NewMockChain

func NewMockChain() *MockChain

func (*MockChain) AddBlock

func (m *MockChain) AddBlock(hash string)

func (*MockChain) AddHeader

func (m *MockChain) AddHeader(h spec.BlockHeader)

Helpers for constructing chains in tests.

func (*MockChain) EstimateFee

func (m *MockChain) EstimateFee(ctx context.Context, confirmTarget int) (koinuPerKB koinu.Koinu, err error)

func (*MockChain) GetBestBlockHash

func (m *MockChain) GetBestBlockHash(ctx context.Context) (string, error)

Unused by current tests; minimal stubs provided.

func (*MockChain) GetBlock

func (m *MockChain) GetBlock(blockHash string, ctx context.Context) (doge.Block, int, error)

func (*MockChain) GetBlockCount

func (m *MockChain) GetBlockCount(ctx context.Context) (int64, error)

func (*MockChain) GetBlockHash

func (m *MockChain) GetBlockHash(blockHeight int64, ctx context.Context) (string, error)

func (*MockChain) GetBlockHeader

func (m *MockChain) GetBlockHeader(blockHash string, ctx context.Context) (spec.BlockHeader, error)

func (*MockChain) GetBlockchainInfo

func (m *MockChain) GetBlockchainInfo(ctx context.Context) (spec.BlockchainInfo, error)

func (*MockChain) GetRawMempool

func (m *MockChain) GetRawMempool(ctx context.Context) (spec.RawMempool, error)

func (*MockChain) GetRawMempoolTxList

func (m *MockChain) GetRawMempoolTxList(ctx context.Context) ([]string, error)

func (*MockChain) GetRawTransaction

func (m *MockChain) GetRawTransaction(ctx context.Context, txID string) (doge.BlockTx, error)

func (*MockChain) RetryMode

func (m *MockChain) RetryMode(attempts int, delay time.Duration) spec.Blockchain

func (*MockChain) SendRawTransaction

func (m *MockChain) SendRawTransaction(ctx context.Context, txHex string) (string, error)

func (*MockChain) SetHeight

func (m *MockChain) SetHeight(height int64, hash string)

func (*MockChain) WaitForSync

func (m *MockChain) WaitForSync(ctx context.Context) bool

Jump to

Keyboard shortcuts

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