testutils

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 23 Imported by: ? 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 testutils serves feeder test data through Juno's own JSON-RPC stack.

Index

Constants

View Source
const (
	ChainHeight         = 5
	MissingBlockNumber  = 100
	DeprecatedClassHash = "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3"
	SierraClassHash     = "0x3cc90db763e736ca9b6c581ea4008408842b1a125947ab087438676a7e40b7b"
)

Variables

View Source
var GenesisClassHashes = []string{
	DeprecatedClassHash,
	"0x5c478ee27f2112411f86f207605b2e2c58cdb647bac0df27f660ef2252359c6",
}

Functions

func Listen

func Listen(t testing.TB, handler http.Handler) *url.URL

func NewChain

func NewChain(t testing.TB) *blockchain.Blockchain

No test data chain declares a Sierra class from genesis, so it is stored with block 0's deprecated ones.

func NewChainFor

func NewChainFor(
	t testing.TB,
	network *networks.Network,
	height uint64,
	genesisClassHashes ...string,
) *blockchain.Blockchain

func NewGenesisChain

func NewGenesisChain(
	t testing.TB,
	network *networks.Network,
	classHashes ...string,
) *blockchain.Blockchain

NewGenesisChain declares the classes in a genesis of its own, since no test data chain declares a Sierra class in a block.

func Serve

func Serve(t testing.TB, chain *blockchain.Blockchain) http.Handler

func ServeV0_9

func ServeV0_9(t testing.TB, chain *blockchain.Blockchain) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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