relaycoretest

package
v5.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package relaycoretest provides test utilities for relay processor tests. This package should only be imported by test files.

Index

Constants

This section is empty.

Variables

View Source
var (
	// RelayRetriesManagerInstance is a shared instance for tests
	RelayRetriesManagerInstance = lavaprotocol.NewRelayRetriesManager()
	// RelayProcessorMetrics is a mock metrics implementation for tests
	RelayProcessorMetrics = &RelayProcessorMetricsMock{}
)

Functions

func SendNodeError

func SendNodeError(relayProcessor *relaycore.RelayProcessor, provider string, delay time.Duration)

SendNodeError sends a node error response to the relay processor

func SendNodeErrorJsonRpc

func SendNodeErrorJsonRpc(relayProcessor *relaycore.RelayProcessor, provider string, delay time.Duration)

SendNodeErrorJsonRpc sends a JSON-RPC node error response to the relay processor

func SendProtocolError

func SendProtocolError(relayProcessor *relaycore.RelayProcessor, provider string, delay time.Duration, err error)

SendProtocolError sends a protocol error response to the relay processor

func SendSuccessResp

func SendSuccessResp(relayProcessor *relaycore.RelayProcessor, provider string, delay time.Duration)

SendSuccessResp sends a successful response to the relay processor

func SendSuccessRespJsonRpc

func SendSuccessRespJsonRpc(relayProcessor *relaycore.RelayProcessor, provider string, delay time.Duration)

SendSuccessRespJsonRpc sends a successful JSON-RPC response to the relay processor

Types

type RelayProcessorMetricsMock

type RelayProcessorMetricsMock struct{}

RelayProcessorMetricsMock is a mock implementation of metrics interfaces for testing

func (*RelayProcessorMetricsMock) GetChainIdAndApiInterface

func (romm *RelayProcessorMetricsMock) GetChainIdAndApiInterface() (string, string)

func (*RelayProcessorMetricsMock) SetNodeErrorRecoveredSuccessfullyMetric

func (romm *RelayProcessorMetricsMock) SetNodeErrorRecoveredSuccessfullyMetric(chainId string, apiInterface string, attempt string)

func (*RelayProcessorMetricsMock) SetProtocolErrorRecoveredSuccessfullyMetric

func (romm *RelayProcessorMetricsMock) SetProtocolErrorRecoveredSuccessfullyMetric(chainId string, apiInterface string, attempt string)

func (*RelayProcessorMetricsMock) SetRelayNodeErrorMetric

func (romm *RelayProcessorMetricsMock) SetRelayNodeErrorMetric(providerAddress, chainId, apiInterface string)

func (*RelayProcessorMetricsMock) SetRelaySentByNewBatchTickerMetric

func (romm *RelayProcessorMetricsMock) SetRelaySentByNewBatchTickerMetric(chainId string, apiInterface string)

Jump to

Keyboard shortcuts

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