relaycoretest

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 SendNodeErrorWithRetryable

func SendNodeErrorWithRetryable(relayProcessor *relaycore.RelayProcessor, provider string, delay time.Duration, nonRetryable bool)

SendNodeErrorWithRetryable sends a node error and lets the caller set the IsNonRetryable flag that the classifier would normally populate.

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) RecordHedgeRelaySent

func (romm *RelayProcessorMetricsMock) RecordHedgeRelaySent(chainId string, apiInterface string, method string)

func (*RelayProcessorMetricsMock) SetRelayNodeErrorMetric

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

Jump to

Keyboard shortcuts

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