Documentation
¶
Index ¶
- func Fuzz(num int, base FuzzObject, opts ...FuzzOption) error
- func MarshalRLP(m Marshaler) ([]byte, error)
- func UnmarshalRLP(buf []byte, m Unmarshaler) error
- type Arena
- func (a *Arena) NewArray() *Value
- func (a *Arena) NewBigInt(b *big.Int) *Value
- func (a *Arena) NewBool(b bool) *Value
- func (a *Arena) NewBytes(b []byte) *Value
- func (a *Arena) NewCopyBytes(b []byte) *Value
- func (a *Arena) NewFalse() *Value
- func (a *Arena) NewNull() *Value
- func (a *Arena) NewNullArray() *Value
- func (a *Arena) NewString(s string) *Value
- func (a *Arena) NewTrue() *Value
- func (a *Arena) NewUint(i uint64) *Value
- func (a *Arena) Reset()
- type ArenaPool
- type FuzzError
- type FuzzObject
- type FuzzOption
- type Fuzzer
- type Keccak
- type Marshaler
- type Parser
- type ParserPool
- type Type
- type Unmarshaler
- type Value
- func (v *Value) Bytes() ([]byte, error)
- func (v *Value) Elems() int
- func (v *Value) Get(i int) *Value
- func (v *Value) GetAddr(buf []byte) error
- func (v *Value) GetBigInt(b *big.Int) error
- func (v *Value) GetBool() (bool, error)
- func (v *Value) GetByte() (byte, error)
- func (v *Value) GetBytes(dst []byte, bits ...int) ([]byte, error)
- func (v *Value) GetElems() ([]*Value, error)
- func (v *Value) GetHash(buf []byte) error
- func (v *Value) GetString() (string, error)
- func (v *Value) GetUint64() (uint64, error)
- func (v *Value) Len() uint64
- func (v *Value) MarshalTo(dst []byte) []byte
- func (v *Value) Raw() []byte
- func (v *Value) Set(vv *Value)
- func (v *Value) Type() Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fuzz ¶
func Fuzz(num int, base FuzzObject, opts ...FuzzOption) error
func UnmarshalRLP ¶
func UnmarshalRLP(buf []byte, m Unmarshaler) error
UnmarshalRLP unmarshals an RLP object
Types ¶
type Arena ¶
type Arena struct {
// contains filtered or unexported fields
}
Arena is a pool of RLP values.
func (*Arena) NewCopyBytes ¶
NewCopyBytes returns a bytes value that copies the input.
func (*Arena) NewNullArray ¶
NewNullArray returns a null array value.
type ArenaPool ¶
type ArenaPool struct {
// contains filtered or unexported fields
}
ArenaPool may be used for pooling Arenas for similarly typed RLPs.
var DefaultArenaPool ArenaPool
DefaultArenaPool is a default ArenaPool
type FuzzObject ¶
type FuzzObject interface { Marshaler Unmarshaler }
type FuzzOption ¶
type FuzzOption func(f *Fuzzer)
func WithDefaults ¶
func WithDefaults(fnc func(FuzzObject)) FuzzOption
func WithPostHook ¶
func WithPostHook(fnc func(FuzzObject) error) FuzzOption
type Keccak ¶
type Keccak struct {
// contains filtered or unexported fields
}
Keccak is the sha256 keccak hash
func NewKeccak256 ¶
func NewKeccak256() *Keccak
type Marshaler ¶
type Marshaler interface { MarshalRLPTo(dst []byte) ([]byte, error) MarshalRLPWith(a *Arena) (*Value, error) }
Marshaler is the interface implemented by types that can marshal themselves into valid RLP messages.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a RLP parser
type ParserPool ¶
type ParserPool struct {
// contains filtered or unexported fields
}
ParserPool may be used for pooling Parsers for similarly typed RLPs.
var DefaultParserPool ParserPool
DefaultParserPool is a default ParserPool
type Unmarshaler ¶
Unmarshaler is the interface implemented by types that can unmarshal a RLP description of themselves
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is an RLP value