Documentation ¶
Overview ¶
Package tests implements execution of CommerciumX JSON tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Forks = map[string]*params.ChainConfig{ "Frontier": { ChainId: big.NewInt(210110), }, "Homestead": { ChainId: big.NewInt(210110), HomesteadBlock: big.NewInt(0), }, "EIP150": { ChainId: big.NewInt(210110), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), }, "EIP158": { ChainId: big.NewInt(210110), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), }, "Byzantium": { ChainId: big.NewInt(210110), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), DAOForkBlock: big.NewInt(0), ByzantiumBlock: big.NewInt(0), }, "FrontierToHomesteadAt5": { ChainId: big.NewInt(210110), HomesteadBlock: big.NewInt(5), }, "HomesteadToEIP150At5": { ChainId: big.NewInt(210110), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(5), }, "HomesteadToDaoAt5": { ChainId: big.NewInt(210110), HomesteadBlock: big.NewInt(0), DAOForkBlock: big.NewInt(5), DAOForkSupport: true, }, "EIP158ToByzantiumAt5": { ChainId: big.NewInt(210110), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(5), }, }
This table defines supported forks and their chain config.
Functions ¶
func MakePreState ¶
Types ¶
type BlockTest ¶
type BlockTest struct {
// contains filtered or unexported fields
}
A BlockTest checks handling of entire blocks.
func (*BlockTest) UnmarshalJSON ¶
type DifficultyTest ¶
type DifficultyTest struct { ParentTimestamp *big.Int `json:"parentTimestamp"` ParentDifficulty *big.Int `json:"parentDifficulty"` UncleHash common.Hash `json:"parentUncles"` CurrentTimestamp *big.Int `json:"currentTimestamp"` CurrentBlockNumber uint64 `json:"currentBlockNumber"` CurrentDifficulty *big.Int `json:"currentDifficulty"` }
func (DifficultyTest) MarshalJSON ¶
func (d DifficultyTest) MarshalJSON() ([]byte, error)
func (*DifficultyTest) Run ¶
func (test *DifficultyTest) Run(config *params.ChainConfig) error
func (*DifficultyTest) UnmarshalJSON ¶
func (d *DifficultyTest) UnmarshalJSON(input []byte) error
type RLPTest ¶
type RLPTest struct { // If the value of In is "INVALID" or "VALID", the test // checks whether Out can be decoded into a value of // type interface{}. // // For other JSON values, In is treated as a driver for // calls to rlp.Stream. The test also verifies that encoding // In produces the bytes in Out. In interface{} // Out is a hex-encoded RLP value. Out string }
RLPTest is the JSON structure of a single RLP test.
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/CommerciumBlockchain/EIPs/issues/176 for the test format specification.
func (*StateTest) Subtests ¶
func (t *StateTest) Subtests() []StateSubtest
Subtests returns all valid subtests of the test.
func (*StateTest) UnmarshalJSON ¶
type TransactionTest ¶
type TransactionTest struct {
// contains filtered or unexported fields
}
TransactionTest checks RLP decoding and sender derivation of transactions.
func (*TransactionTest) Run ¶
func (tt *TransactionTest) Run(config *params.ChainConfig) error
type UnsupportedForkError ¶
type UnsupportedForkError struct {
Name string
}
UnsupportedForkError is returned when a test requests a fork that isn't implemented.
func (UnsupportedForkError) Error ¶
func (e UnsupportedForkError) Error() string
type VMTest ¶
type VMTest struct {
// contains filtered or unexported fields
}
VMTest checks EVM execution without block or transaction context. See https://github.com/CommerciumBlockchain/tests/wiki/VM-Tests for the test format specification.