Documentation ¶
Index ¶
- func AddTransaction(dest *common.Address, gst *GstMaker)
- func GasRandomizer() valFunc
- func MemRandomizer() memFunc
- func NewFP2toG2() []byte
- func NewFPtoG1() []byte
- func NewFieldElement() []byte
- func NewG1Add() []byte
- func NewG1Exp() []byte
- func NewG1Mul() []byte
- func NewG1Point() []byte
- func NewG2Add() []byte
- func NewG2Exp() []byte
- func NewG2Mul() []byte
- func NewG2Point() []byte
- func NewPairing() []byte
- func RandCall(gas, addr, val valFunc, memIn, memOut memFunc) []byte
- func RandCall2200(addresses []common.Address) []byte
- func RandCallBLS() []byte
- func RandCallBlake() []byte
- func RandCallECRecover() []byte
- func RandCallSubroutine(addresses []common.Address) []byte
- func RandStorage(maxSlots, maxVal int) map[common.Hash]common.Hash
- func RandStorageOps() *program.Program
- func ValueRandomizer() valFunc
- type GeneralStateTest
- type GenesisAccount
- type GenesisAlloc
- type GstMaker
- func BasicStateTest(fork string) *GstMaker
- func Generate2200BerlinTest() *GstMaker
- func Generate2200Test() *GstMaker
- func GenerateBLS() (*GstMaker, []byte)
- func GenerateBlake() *GstMaker
- func GenerateECRecover() (*GstMaker, []byte)
- func GenerateSubroutineTest() *GstMaker
- func NewGstMaker() *GstMaker
- func (g *GstMaker) AddAccount(address common.Address, a GenesisAccount)
- func (g *GstMaker) EnableFork(fork string)
- func (g *GstMaker) Fill(traceOutput io.Writer) error
- func (g *GstMaker) GetDestination() common.Address
- func (g *GstMaker) SetCode(address common.Address, code []byte)
- func (g *GstMaker) SetPre(genesis *GenesisAlloc)
- func (g *GstMaker) SetResult(root, logs common.Hash)
- func (g *GstMaker) SetTx(tx *StTransaction)
- func (g *GstMaker) ToGeneralStateTest(name string) *GeneralStateTest
- func (g *GstMaker) ToStateTest() (tests.StateTest, error)
- func (g *GstMaker) ToSubTest() *stJSON
- type StTransaction
- type StateSubtest
- type StateTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTransaction ¶
func GasRandomizer ¶
func GasRandomizer() valFunc
func MemRandomizer ¶
func MemRandomizer() memFunc
func NewFP2toG2 ¶
func NewFP2toG2() []byte
func NewFieldElement ¶
func NewFieldElement() []byte
func NewG1Point ¶
func NewG1Point() []byte
func NewG2Point ¶
func NewG2Point() []byte
func NewPairing ¶
func NewPairing() []byte
NewPairing creates a new valid pairing. We create the following pairing: e(aMul1 * G1, bMul1 * G2) * e(aMul2 * G1, bMul2 * G2) * ... * e(aMuln * G1, bMuln * G2) == e(G1, G2) ^ s with s = sum(x: 1 -> n: (aMulx * bMulx))
func RandCall2200 ¶
func RandCallBLS ¶
func RandCallBLS() []byte
func RandCallBlake ¶
func RandCallBlake() []byte
func RandCallECRecover ¶
func RandCallECRecover() []byte
func RandCallSubroutine ¶
func RandStorage ¶
RandStorage sets some slots
func RandStorageOps ¶
func ValueRandomizer ¶
func ValueRandomizer() valFunc
Types ¶
type GeneralStateTest ¶
type GeneralStateTest map[string]*stJSON
func FromGeneralStateTest ¶
func FromGeneralStateTest(name string) (*GeneralStateTest, error)
func GenerateBlakeTest ¶
func GenerateBlakeTest(name string) *GeneralStateTest
GenerateBlakeTest generates a random test of the blake F precompile
func GenerateStateTest ¶
func GenerateStateTest(name string) *GeneralStateTest
GenerateStateTest generates a random state tests
type GenesisAccount ¶
type GenesisAccount struct { Code []byte `json:"code"` // N.B: parity demands storage even if it's empty Storage map[common.Hash]common.Hash `json:"storage"` Balance *big.Int `json:"balance" gencodec:"required"` Nonce uint64 `json:"nonce"` PrivateKey []byte `json:"secretKey,omitempty"` // for tests }
GenesisAccount is an account in the state of the genesis block. Copied from go-ethereum, with the mod of making Storage mandatory
func (GenesisAccount) MarshalJSON ¶
func (g GenesisAccount) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*GenesisAccount) UnmarshalJSON ¶
func (g *GenesisAccount) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type GenesisAlloc ¶
type GenesisAlloc map[common.Address]GenesisAccount
GenesisAlloc specifies the initial state that is part of the genesis block.
func (*GenesisAlloc) UnmarshalJSON ¶
func (ga *GenesisAlloc) UnmarshalJSON(data []byte) error
type GstMaker ¶
type GstMaker struct {
// contains filtered or unexported fields
}
GstMaker is a construct to generate General State Tests
func BasicStateTest ¶
func Generate2200BerlinTest ¶
func Generate2200BerlinTest() *GstMaker
func Generate2200Test ¶
func Generate2200Test() *GstMaker
func GenerateBLS ¶
func GenerateBlake ¶
func GenerateBlake() *GstMaker
func GenerateECRecover ¶
func GenerateSubroutineTest ¶
func GenerateSubroutineTest() *GstMaker
func NewGstMaker ¶
func NewGstMaker() *GstMaker
func (*GstMaker) AddAccount ¶
func (g *GstMaker) AddAccount(address common.Address, a GenesisAccount)
func (*GstMaker) EnableFork ¶
func (*GstMaker) Fill ¶
FillTest uses go-ethereum internally to determine the state root and logs, and optionally outputs the trace to the given writer (if non-nil)
func (*GstMaker) GetDestination ¶
GetDestination returns the to- address from the tx
func (*GstMaker) SetCode ¶
SetCode sets the code at the given address (creating the account if it did not previously exist)
func (*GstMaker) SetPre ¶
func (g *GstMaker) SetPre(genesis *GenesisAlloc)
func (*GstMaker) SetTx ¶
func (g *GstMaker) SetTx(tx *StTransaction)
func (*GstMaker) ToGeneralStateTest ¶
func (g *GstMaker) ToGeneralStateTest(name string) *GeneralStateTest
type StTransaction ¶
type StTransaction struct { GasPrice *big.Int `json:"gasPrice"` Nonce uint64 `json:"nonce"` To string `json:"to"` Data []string `json:"data"` GasLimit []uint64 `json:"gasLimit"` Value []string `json:"value"` PrivateKey []byte `json:"secretKey"` }
func (StTransaction) MarshalJSON ¶
func (s StTransaction) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*StTransaction) UnmarshalJSON ¶
func (s *StTransaction) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type StateSubtest ¶
StateSubtest selects a specific configuration of a General State Test.
type StateTest ¶
type StateTest struct {
// contains filtered or unexported fields
}
StateTest checks transaction processing without block context. See https://github.com/ethereum/EIPs/issues/176 for the test format specification.