filler

package
v0.0.0-...-5d8902e Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filler

type Filler struct {
	// contains filtered or unexported fields
}

Filler can be used to fill objects from a data source.

func NewFiller

func NewFiller(data []byte) *Filler

NewFiller creates a new Filler.

func (*Filler) BigInt16

func (f *Filler) BigInt16() *big.Int

BigInt16 returns a new big int in [0, 2^16).

func (*Filler) BigInt256

func (f *Filler) BigInt256() *big.Int

BigInt256 returns a new big int in [0, 2^256).

func (*Filler) BigInt32

func (f *Filler) BigInt32() *big.Int

BigInt32 returns a new big int in [0, 2^32).

func (*Filler) BigInt64

func (f *Filler) BigInt64() *big.Int

BigInt64 returns a new big int in [0, 2^64).

func (*Filler) Bool

func (f *Filler) Bool() bool

Bool returns a new bool.

func (*Filler) Byte

func (f *Filler) Byte() byte

Byte returns a new byte.

func (*Filler) ByteSlice

func (f *Filler) ByteSlice(items int) []byte

ByteSlice returns a byteslice with `items` values.

func (*Filler) ByteSlice256

func (f *Filler) ByteSlice256() []byte

ByteSlice256 returns a byteslice with 0..255 values.

func (*Filler) FillAmount

func (f *Filler) FillAmount() uint64

FillAmount generates a random amount for BlockHeader requests.

func (*Filler) FillChallengeData

func (f *Filler) FillChallengeData() []byte

FillChallengeData generates random challenge data.

func (*Filler) FillDistances

func (f *Filler) FillDistances() []uint

FillDistances generates random distances for Findnode.

func (*Filler) FillENRRecords

func (f *Filler) FillENRRecords(count int) []*enr.Record

FillENRRecords generates random ENR records.

func (*Filler) FillENRSeq

func (f *Filler) FillENRSeq() uint64

FillENRSeq generates a random ENR sequence number.

func (*Filler) FillExpiration

func (f *Filler) FillExpiration() uint64

FillExpiration fills the expiration field with a random uint64 value.

func (*Filler) FillForkID

func (f *Filler) FillForkID() forkid.ID

FillForkID generates a new forkid.ID using random data from the filler.

func (*Filler) FillGasCap

func (f *Filler) FillGasCap() *big.Int

FillGasCap generates random gas cap values.

func (*Filler) FillHash

func (f *Filler) FillHash() [32]byte

FillHash fills a Hash field (32 bytes).

func (*Filler) FillIP

func (f *Filler) FillIP() net.IP

FillIP fills the IP field with a random IP address.

func (*Filler) FillMessage

func (f *Filler) FillMessage() []byte

FillMessage generates a random message.

func (*Filler) FillNetworkID

func (f *Filler) FillNetworkID() uint64

FillNetworkID fills the NetworkID field.

func (*Filler) FillNode

func (f *Filler) FillNode() *enode.Node

FillNode generates a random node.

func (*Filler) FillNonce

func (f *Filler) FillNonce() Nonce

FillNonce generates a random Nonce.

func (*Filler) FillPort

func (f *Filler) FillPort() int

FillPort generates a random port number.

func (*Filler) FillProtocolVersion

func (f *Filler) FillProtocolVersion() uint32

FillProtocolVersion fills the ProtocolVersion field.

func (*Filler) FillPubkey

func (f *Filler) FillPubkey() Pubkey

FillPubkey fills the Pubkey field with a random 64-byte value.

func (*Filler) FillReplyToken

func (f *Filler) FillReplyToken() []byte

FillReplyToken generates a random reply token.

func (*Filler) FillReqID

func (f *Filler) FillReqID() []byte

FillReqID generates a random request ID.

func (*Filler) FillRequestId

func (f *Filler) FillRequestId() uint64

FillRequestId generates a random request ID for network requests.

func (*Filler) FillRest

func (f *Filler) FillRest() []rlp.RawValue

FillRest fills the Rest field with random RLP raw values.

func (*Filler) FillTD

func (f *Filler) FillTD() *big.Int

FillTD fills the TD (Total Difficulty) field.

func (*Filler) FillTime

func (f *Filler) FillTime() uint64

FillTime generates a future timestamp as the expiration time.

func (*Filler) GasInt

func (f *Filler) GasInt() *big.Int

GasInt returns a new big int to be used as a gas value. With probability 254/255 its in [0, 20.000.000]. With probability 1/255 its in [0, 2^32].

func (*Filler) MemInt

func (f *Filler) MemInt() *big.Int

MemInt returns a new big int to be used as a memory or offset value. With probability 252/255 its in [0, 256]. With probability 1/255 its in [0, 2^32]. With probability 1/255 its in [0, 2^64]. With probability 1/255 its in [0, 2^256].

func (*Filler) Read

func (f *Filler) Read(b []byte) (n int, err error)

Read implements the io.Reader interface.

func (*Filler) Reset

func (f *Filler) Reset()

Reset resets a filler.

func (*Filler) Uint16

func (f *Filler) Uint16() uint16

Uint16 returns a new uint16.

func (*Filler) Uint32

func (f *Filler) Uint32() uint32

Uint32 returns a new uint32.

func (*Filler) Uint64

func (f *Filler) Uint64() uint64

Uint64 returns a new uint64.

func (*Filler) UsedUp

func (f *Filler) UsedUp() bool

UsedUp returns wether all bytes from the source have been used.

type Nonce

type Nonce [12]byte

type Pubkey

type Pubkey [64]byte

Jump to

Keyboard shortcuts

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