mockchain

package
v1.2.9-rc6 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockProvider

type MockProvider struct {
	PCfg   *MockProviderConfig
	Height uint64
	// contains filtered or unexported fields
}

func (*MockProvider) ChainName

func (p *MockProvider) ChainName() string

func (*MockProvider) DeleteMessage

func (p *MockProvider) DeleteMessage(msg *types.Message)

func (*MockProvider) FinalityBlock

func (p *MockProvider) FinalityBlock(ctx context.Context) uint64

func (*MockProvider) FindMessages

func (p *MockProvider) FindMessages() []*types.Message

func (*MockProvider) GenerateMessage

func (*MockProvider) Init

func (p *MockProvider) Init(ctx context.Context) error

func (*MockProvider) Listener

func (p *MockProvider) Listener(ctx context.Context, lastSavedHeight uint64, incoming chan types.BlockInfo) error

func (*MockProvider) MessageReceived

func (p *MockProvider) MessageReceived(ctx context.Context, key types.MessageKey) (bool, error)

func (*MockProvider) NID

func (p *MockProvider) NID() string

func (*MockProvider) ProviderConfig

func (p *MockProvider) ProviderConfig() provider.Config

func (*MockProvider) QueryBalance

func (p *MockProvider) QueryBalance(ctx context.Context, addr string) (*types.Coin, error)

func (*MockProvider) QueryLatestHeight

func (p *MockProvider) QueryLatestHeight(ctx context.Context) (uint64, error)

func (*MockProvider) QueryTransactionReceipt

func (p *MockProvider) QueryTransactionReceipt(ctx context.Context, txHash string) (*types.Receipt, error)

func (*MockProvider) Route

func (p *MockProvider) Route(ctx context.Context, message *types.Message, callback types.TxResponseFunc) error

func (*MockProvider) ShouldReceiveMessage

func (p *MockProvider) ShouldReceiveMessage(ctx context.Context, messagekey types.Message) (bool, error)

func (*MockProvider) ShouldSendMessage

func (p *MockProvider) ShouldSendMessage(ctx context.Context, messageKey types.Message) (bool, error)

func (*MockProvider) Type

func (p *MockProvider) Type() string

type MockProviderConfig

type MockProviderConfig struct {
	NId             string
	BlockDuration   time.Duration
	SendMessages    map[types.MessageKey]*types.Message
	ReceiveMessages map[types.MessageKey]*types.Message
	StartHeight     uint64
	// contains filtered or unexported fields
}

func (*MockProviderConfig) NewProvider

func (pp *MockProviderConfig) NewProvider(log *zap.Logger, homepath string, debug bool, chainName string) (provider.ChainProvider, error)

NewProvider should provide a new Mock provider

func (*MockProviderConfig) Validate

func (pp *MockProviderConfig) Validate() error

Jump to

Keyboard shortcuts

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