Documentation ¶
Overview ¶
Package tests implements execution of Ethereum JSON tests.
Index ¶
- Variables
- func BenchStateTest(chainConfig *params.ChainConfig, p string, conf bconf, b *testing.B) error
- func BenchVmTest(p string, conf bconf, b *testing.B) error
- func LoadBlockTests(file string) (map[string]*BlockTest, error)
- func NewEVMEnvironment(vmTest bool, chainConfig *params.ChainConfig, statedb *state.StateDB, ...) (*vm.EVM, core.Message)
- func RunBlockTest(homesteadBlock, daoForkBlock, gasPriceFork *big.Int, file string, ...) error
- func RunBlockTestWithReader(homesteadBlock, daoForkBlock, gasPriceFork *big.Int, r io.Reader, ...) error
- func RunRLPTest(file string, skip []string) error
- func RunRLPTestWithReader(r io.Reader, skip []string) error
- func RunState(chainConfig *params.ChainConfig, statedb *state.StateDB, ...) ([]byte, []*types.Log, *big.Int, error)
- func RunStateTest(chainConfig *params.ChainConfig, p string, skipTests []string) error
- func RunStateTestWithReader(chainConfig *params.ChainConfig, r io.Reader, skipTests []string) error
- func RunTransactionTests(config *params.ChainConfig, file string, skipTests []string) error
- func RunTransactionTestsWithReader(config *params.ChainConfig, r io.Reader, skipTests []string) error
- func RunVm(statedb *state.StateDB, env, exec map[string]string) ([]byte, []*types.Log, *big.Int, error)
- func RunVmTest(p string, skipTests []string) error
- func RunVmTestWithReader(r io.Reader, skipTests []string) error
- type Account
- type BlockTest
- func (t *BlockTest) InsertPreState(db ethdb.Database) (*state.StateDB, error)
- func (t *BlockTest) TryBlocksInsert(blockchain *core.BlockChain) ([]btBlock, error)
- func (test *BlockTest) ValidateImportedHeaders(cm *core.BlockChain, validBlocks []btBlock) error
- func (t *BlockTest) ValidatePostState(statedb *state.StateDB) error
- type Log
- type RLPTest
- type TransactionTest
- type TtTransaction
- type VmEnv
- type VmTest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BlockSkipTests = []string{ "BLOCK__RandomByteAtTheEnd", "TRANSCT__RandomByteAtTheEnd", "BLOCK__ZeroByteAtTheEnd", "TRANSCT__ZeroByteAtTheEnd", "ChainAtoChainB_blockorder2", "ChainAtoChainB_blockorder1", "GasLimitHigherThan2p63m1", "SuicideIssue", } /* Go client does not support transaction (account) nonces above 2^64. This technically breaks consensus but is regarded as "reasonable engineering constraint" as accounts cannot easily reach such high nonce values in practice */ TransSkipTests = []string{ "TransactionWithHihghNonce256", "Vitalik_15", "Vitalik_16", "Vitalik_17", } StateSkipTests = []string{} VmSkipTests = []string{} )
View Source
var ( ForceJit bool EnableJit bool )
Functions ¶
func BenchStateTest ¶ added in v1.1.0
func LoadBlockTests ¶ added in v0.9.17
func NewEVMEnvironment ¶ added in v1.5.5
func RunBlockTest ¶ added in v0.9.32
func RunBlockTestWithReader ¶ added in v0.9.32
func RunRLPTest ¶ added in v0.9.39
RunRLPTest runs the tests in the given file, skipping tests by name.
func RunRLPTestWithReader ¶ added in v0.9.39
RunRLPTest runs the tests encoded in r, skipping tests by name.
func RunStateTest ¶ added in v0.9.32
func RunStateTest(chainConfig *params.ChainConfig, p string, skipTests []string) error
func RunStateTestWithReader ¶ added in v0.9.32
func RunTransactionTests ¶ added in v0.9.17
func RunTransactionTests(config *params.ChainConfig, file string, skipTests []string) error
func RunTransactionTestsWithReader ¶ added in v0.9.32
Types ¶
type BlockTest ¶
type BlockTest struct { Genesis *types.Block Json *btJSON // contains filtered or unexported fields }
Block Test JSON Format
func (*BlockTest) InsertPreState ¶ added in v0.9.17
InsertPreState populates the given database with the genesis accounts defined by the test.
func (*BlockTest) TryBlocksInsert ¶ added in v0.9.17
func (t *BlockTest) TryBlocksInsert(blockchain *core.BlockChain) ([]btBlock, error)
See https://github.com/ethereum/tests/wiki/Blockchain-Tests-II
Whether a block is valid or not is a bit subtle, it's defined by presence of blockHeader, transactions and uncleHeaders fields. If they are missing, the block is invalid and we must verify that we do not accept it. Since some tests mix valid and invalid blocks we need to check this for every block. If a block is invalid it does not necessarily fail the test, if it's invalidness is expected we are expected to ignore it and continue processing and then validate the post state.
func (*BlockTest) ValidateImportedHeaders ¶ added in v1.2.2
func (test *BlockTest) ValidateImportedHeaders(cm *core.BlockChain, validBlocks []btBlock) error
type Log ¶ added in v0.9.32
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 TransactionTest ¶
type TransactionTest struct { Blocknumber string Rlp string Sender string Transaction TtTransaction }
type TtTransaction ¶ added in v0.9.17
type TtTransaction struct { Data string GasLimit string GasPrice string Nonce string R string S string To string V string Value string }
Transaction Test JSON Format
Click to show internal directories.
Click to hide internal directories.