mockchain

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 7 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) ClaimFee added in v1.3.4

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

func (*MockProvider) Config added in v1.3.4

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

func (*MockProvider) DeleteMessage

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

func (*MockProvider) FetchTxMessages added in v1.9.0

func (ip *MockProvider) FetchTxMessages(ctx context.Context, txHash string) ([]*types.Message, error)

func (*MockProvider) FinalityBlock

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

func (*MockProvider) FindMessages

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

func (*MockProvider) GenerateMessages added in v1.3.4

func (ip *MockProvider) GenerateMessages(ctx context.Context, fromHeight, toHeight uint64) ([]*types.Message, error)

func (*MockProvider) GenerateTxMessages added in v1.9.0

func (ip *MockProvider) GenerateTxMessages(ctx context.Context, txHash string) ([]*types.Message, error)

func (*MockProvider) GetFee added in v1.3.4

func (*MockProvider) GetLastProcessedBlockHeight added in v1.9.0

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

func (*MockProvider) ImportKeystore added in v1.3.4

func (p *MockProvider) ImportKeystore(context.Context, string, string) (string, error)

func (*MockProvider) Init

func (*MockProvider) Listener

func (p *MockProvider) Listener(ctx context.Context, lastProcessedTx relayertypes.LastProcessedTx, blockInfo 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) Name added in v1.3.4

func (p *MockProvider) Name() string

func (*MockProvider) NewKeystore added in v1.3.4

func (p *MockProvider) NewKeystore(string) (string, error)

func (*MockProvider) QueryBalance

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

func (*MockProvider) QueryBlockMessages added in v1.9.0

func (p *MockProvider) QueryBlockMessages(ctx context.Context, fromHeight, toHeight uint64) ([]*types.Message, 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) RestoreKeystore added in v1.3.4

func (p *MockProvider) RestoreKeystore(context.Context) error

func (*MockProvider) RevertMessage added in v1.3.4

func (p *MockProvider) RevertMessage(context.Context, *big.Int) error

func (*MockProvider) Route

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

func (*MockProvider) SetAdmin added in v1.3.4

func (p *MockProvider) SetAdmin(context.Context, string) error

func (*MockProvider) SetFee added in v1.3.4

func (p *MockProvider) SetFee(context.Context, string, *big.Int, *big.Int) error

func (*MockProvider) SetLastSavedHeightFunc added in v1.3.4

func (p *MockProvider) SetLastSavedHeightFunc(func() uint64)

func (*MockProvider) ShouldReceiveMessage

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

func (*MockProvider) ShouldSendMessage

func (p *MockProvider) ShouldSendMessage(ctx context.Context, message *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) ContractsAddress added in v1.9.0

func (pp *MockProviderConfig) ContractsAddress() types.ContractConfigMap

func (*MockProviderConfig) Enabled added in v1.3.4

func (pp *MockProviderConfig) Enabled() bool

func (*MockProviderConfig) GetWallet added in v1.3.4

func (pp *MockProviderConfig) GetWallet() string

func (*MockProviderConfig) NewProvider

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

NewProvider should provide a new Mock provider

func (*MockProviderConfig) SetWallet added in v1.3.4

func (pp *MockProviderConfig) SetWallet(string)

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