testutil

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Weight = 42
)

Variables

This section is empty.

Functions

func BallotMode

func BallotMode() spec.BallotMode

func BallotModePacked added in v0.0.2

func BallotModePacked() *big.Int

func DeterministicAddress

func DeterministicAddress(n uint64) common.Address

func DeterministicK added in v0.0.4

func DeterministicK(processID types.ProcessID, nValidVoters int) *big.Int

DeterministicK returns a deterministic big.Int value based on a ProcessID and voter count.

func DeterministicProcessID

func DeterministicProcessID(n uint64) types.ProcessID

DeterministicProcessID is a deterministic ProcessID used for testing purposes.

func DeterministicSeed added in v0.0.4

func DeterministicSeed(processID types.ProcessID, index int) int64

DeterministicSeed returns a deterministic seed based on a ProcessID and index.

func DeterministicStateRoot

func DeterministicStateRoot(n uint64) *types.BigInt

func FixedProcessID

func FixedProcessID() types.ProcessID

FixedProcessID should be used by circuit tests that need reproducible process data.

func FixedStateRoot added in v0.0.2

func FixedStateRoot() *types.BigInt

func GenDeterministicBallotFields

func GenDeterministicBallotFields(seed int64) [params.FieldsPerBallot]*types.BigInt

GenDeterministicBallotFields generates a list of deterministic fields based on the provided seed for reproducible testing.

func RandomAddress

func RandomAddress() common.Address

func RandomCensus

func RandomCensus(origin types.CensusOrigin) *types.Census

func RandomCensusRoot

func RandomCensusRoot() *big.Int

func RandomEncryptionKeys

func RandomEncryptionKeys() (babyjub.PrivateKey, types.EncryptionKey)

func RandomEncryptionPubKey

func RandomEncryptionPubKey() types.EncryptionKey

func RandomProcess added in v0.0.2

func RandomProcess(processID types.ProcessID) *types.Process

func RandomProcessID

func RandomProcessID() types.ProcessID

func RandomStateRoot

func RandomStateRoot() *types.BigInt

func RandomVoteID

func RandomVoteID() types.VoteID

func RandomVoteIDs added in v0.0.2

func RandomVoteIDs(n int) []types.VoteID

func SepoliaChainID

func SepoliaChainID() uint32

SepoliaChainID returns 11155111 (i.e. Sepolia)

Types

This section is empty.

Jump to

Keyboard shortcuts

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