Documentation ¶
Index ¶
- Constants
- func AddTransaction(dest *common.Address, gst *GstMaker)
- func Factory(name, fork string) func() *GstMaker
- func FactoryNames() []string
- func GasRandomizer() valFunc
- func GenerateCallFProgram(maxSections int) ([]byte, int)
- func MemRandomizer() memFunc
- func RandCall(gas, addr, val valFunc, memIn, memOut memFunc) []byte
- func RandCall2200(addresses []common.Address) []byte
- func RandCallBLS() []byte
- func RandCallBlake() []byte
- func RandCallTStore(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 (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 ¶
const DisallowEOF = true
DisallowEOF makes it so that any statetest that are created never contain 0xEF-prefixed code. See https://github.com/holiman/goevmlab/issues/127
Variables ¶
This section is empty.
Functions ¶
func AddTransaction ¶
func FactoryNames ¶
func FactoryNames() []string
FactoryNames returns the names of the available factories
func GasRandomizer ¶
func GasRandomizer() valFunc
func GenerateCallFProgram ¶
func MemRandomizer ¶
func MemRandomizer() memFunc
func RandCall2200 ¶
func RandCallBLS ¶
func RandCallBLS() []byte
func RandCallBlake ¶
func RandCallBlake() []byte
func RandCallTStore ¶
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)
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 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"` Sender common.Address `json:"sender"` 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.