utilstest

package
v0.8.33 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: GPL-3.0, LGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EVMTestChainID = ids.GenerateTestID()

EVMTestChainID is a evm specific chain ID for testing

Functions

func NewTestConsensusContext added in v0.8.6

func NewTestConsensusContext(t testing.TB) context.Context

NewTestConsensusContext returns a context.Context with runtime properly configured for testing.

func NewTestConsensusContextWithChainID added in v0.8.6

func NewTestConsensusContextWithChainID(t testing.TB, chainID ids.ID) context.Context

NewTestConsensusContextWithChainID returns a context.Context with runtime properly configured for testing with a specific chain ID.

func NewTestRuntime added in v0.8.33

func NewTestRuntime(t testing.TB, chainID ids.ID) *runtime.Runtime

NewTestRuntime creates a new Runtime suitable for testing with the given chain ID

func NewTestValidatorState added in v0.8.4

func NewTestValidatorState() runtime.ValidatorState

NewTestValidatorState creates a new test validator state

func NewTestValidatorStateFromBase added in v0.8.8

func NewTestValidatorStateFromBase(baseState *validatorstest.State) runtime.ValidatorState

NewTestValidatorStateFromBase creates a testValidatorState that wraps an existing validatorstest.State This is useful when you need to use a specific validatorstest.State with custom functions but still implement the runtime.ValidatorState interface.

Types

type Key

type Key struct {
	Address    common.Address
	PrivateKey *ecdsa.PrivateKey
}

Key contains an ecdsa private key field as well as an address field obtained from converting the ecdsa public key.

func NewKey

func NewKey(t *testing.T) *Key

NewKey generates a new key pair and returns a pointer to a Key.

Jump to

Keyboard shortcuts

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