testutils

package
v0.33.36-pebble-util Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyPartFixture

func KeyPartFixture(typ uint16, val string) l.KeyPart

KeyPartFixture returns a key part fixture

func LightPayload

func LightPayload(key uint16, value uint16) *l.Payload

LightPayload returns a payload with 2 byte key and 2 byte value

func LightPayload8

func LightPayload8(key uint8, value uint8) *l.Payload

LightPayload8 returns a payload with 1 byte key and 1 byte value

func PathByUint16

func PathByUint16(inp uint16) l.Path

PathByUint16 returns a path (32 bytes) given a uint16 (big endian)

func PathByUint16LeftPadded

func PathByUint16LeftPadded(inp uint16) l.Path

PathByUint16LeftPadded returns a path (32 bytes) given a uint16 (left padded big endian)

func PathByUint8

func PathByUint8(inp uint8) l.Path

PathByUint8 returns a path (32 bytes) given a uint8

func QueryFixture

func QueryFixture() *l.Query

QueryFixture returns a query fixture

func RandomPaths

func RandomPaths(n int) []l.Path

RandomPaths generates n random (no repetition)

func RandomPathsRandLen

func RandomPathsRandLen(maxN int) []l.Path

RandomPathsRandLen generate m random paths. the number of paths, m, is also randomly selected from the range [1, maxN]

func RandomPayload

func RandomPayload(minByteSize int, maxByteSize int) *l.Payload

RandomPayload returns a random payload

func RandomPayloads

func RandomPayloads(n int, minByteSize int, maxByteSize int) []*l.Payload

RandomPayloads returns n random payloads

func RandomUniqueKeys

func RandomUniqueKeys(n, m, minByteSize, maxByteSize int) []l.Key

RandomUniqueKeys generates n random keys (each with m random key parts)

func RandomValues

func RandomValues(n int, minByteSize, maxByteSize int) []l.Value

RandomValues returns n random values with variable sizes (minByteSize <= size < maxByteSize)

func RootHashFixture

func RootHashFixture() l.RootHash

RootHashFixture returns a root hash fixture

func TrieBatchProofFixture

func TrieBatchProofFixture() (*l.TrieBatchProof, l.State)

TrieBatchProofFixture returns a trie batch proof fixture

func TrieProofFixture

func TrieProofFixture() (*l.TrieProof, l.State)

TrieProofFixture returns a trie proof fixture

func TrieUpdateFixture

func TrieUpdateFixture(n int, minPayloadByteSize int, maxPayloadByteSize int) *l.TrieUpdate

TrieUpdateFixture returns a trie update fixture

func UpdateFixture

func UpdateFixture() *l.Update

UpdateFixture returns an update fixture

Types

This section is empty.

Jump to

Keyboard shortcuts

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