testutils

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

* Dummy RPC backend for both Ethereum node and Flashbots Relay. * Implements JSON-RPC calls that the tests need.

* Test helpers.

Index

Constants

This section is empty.

Variables

View Source
var MockBackendLastJsonRpcRequest *types.JsonRpcRequest
View Source
var MockBackendLastJsonRpcRequestTimestamp time.Time
View Source
var MockBackendLastRawRequest *http.Request
View Source
var MockTxApiStatusForHash map[string]types.PrivateTxStatus = make(map[string]types.PrivateTxStatus)
View Source
var RpcEndpointUrl string // set by tests
View Source
var TestTx_BundleFailedTooManyTimes_From = "0xc84edF69E78C0E9dE5ccFE4fB9017F6F7566787f"
View Source
var TestTx_BundleFailedTooManyTimes_Hash = "0xfb34b88cd77215867aa8e8ff0abc7060178b8fed6519a85d0b22853dfd5e9fec"
View Source
var TestTx_BundleFailedTooManyTimes_Nonce = "0x1e"
View Source
var TestTx_BundleFailedTooManyTimes_RawTx = "" /* 836-byte string literal not displayed */

Test tx for bundle-failed-too-many-times MM1 fix

View Source
var TestTx_CancelAtRelay_Cancel_From = "0xc0E1142E97A9679FA0f9C13067Af656Cc2475373"
View Source
var TestTx_CancelAtRelay_Cancel_Hash = "0x0a5237dafa5e65d7e5030b08012fd8399206a9130fbc9f2d3d5cf3865fa972ef"
View Source
var TestTx_CancelAtRelay_Cancel_Nonce = "0xc"
View Source
var TestTx_CancelAtRelay_Cancel_RawTx = "" /* 226-byte string literal not displayed */
View Source
var TestTx_CancelAtRelay_Initial_RawTx = "" /* 824-byte string literal not displayed */

Test tx for MM2 fix

View Source
var TestTx_Invalid_Nonce_1 = "" /* 738-byte string literal not displayed */

Test sendRawTx invalid nonce

View Source
var TestTx_Invalid_Nonce_2 = "" /* 6320-byte string literal not displayed */
View Source
var TestTx_MM2_From = "0x7AaBc7915DF92a85E199DbB4B1D21E637e1a90A2"
View Source
var TestTx_MM2_Hash = "0xc543e2ad05cffdee95b984df20edd2e38e124c54461faa1276adc36e826588c9"
View Source
var TestTx_MM2_RawTx = "" /* 216-byte string literal not displayed */

Test tx for MM2 fix

Functions

func MockRpcBackendReset added in v1.4.3

func MockRpcBackendReset()

func MockTxApiHandler

func MockTxApiHandler(w http.ResponseWriter, req *http.Request)

func MockTxApiReset

func MockTxApiReset()

func RpcBackendHandler

func RpcBackendHandler(w http.ResponseWriter, req *http.Request)

func SendBatchRpcAndParseResponse added in v1.4.3

func SendBatchRpcAndParseResponse(req []*types.JsonRpcRequest) ([]*types.JsonRpcResponse, error)

func SendBatchRpcAndParseResponseTo added in v1.4.4

func SendBatchRpcAndParseResponseTo(url string, req []*types.JsonRpcRequest) ([]*types.JsonRpcResponse, error)

func SendRpcAndParseResponse

func SendRpcAndParseResponse(req *types.JsonRpcRequest) (*types.JsonRpcResponse, error)

func SendRpcAndParseResponseOrFailNow

func SendRpcAndParseResponseOrFailNow(t *testing.T, req *types.JsonRpcRequest) *types.JsonRpcResponse

func SendRpcAndParseResponseOrFailNowAllowRpcError

func SendRpcAndParseResponseOrFailNowAllowRpcError(t *testing.T, req *types.JsonRpcRequest) *types.JsonRpcResponse

func SendRpcAndParseResponseOrFailNowString

func SendRpcAndParseResponseOrFailNowString(t *testing.T, req *types.JsonRpcRequest) string

func SendRpcAndParseResponseTo added in v1.4.4

func SendRpcAndParseResponseTo(url string, req *types.JsonRpcRequest) (*types.JsonRpcResponse, error)

func SendRpcWithAuctionPreferenceAndParseResponse added in v1.6.0

func SendRpcWithAuctionPreferenceAndParseResponse(t *testing.T, req *types.JsonRpcRequest, urlSuffix string) *types.JsonRpcResponse

func SendRpcWithFastPreferenceAndParseResponse added in v1.5.1

func SendRpcWithFastPreferenceAndParseResponse(t *testing.T, req *types.JsonRpcRequest) *types.JsonRpcResponse

Types

This section is empty.

Jump to

Keyboard shortcuts

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