tests

package
v0.9.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2015 License: LGPL-2.1-or-later Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadBlockTests added in v0.9.17

func LoadBlockTests(file string) (map[string]*BlockTest, error)

LoadBlockTests loads a block test JSON file.

func LoadJSON added in v0.9.17

func LoadJSON(file string, val interface{}) error

LoadJSON reads the given file and unmarshals its content.

func RunTransactionTests added in v0.9.17

func RunTransactionTests(file string, notWorking map[string]bool) error

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

func (t *BlockTest) InsertPreState(ethereum *eth.Ethereum) (*state.StateDB, error)

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(chainManager *core.ChainManager) 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) ValidatePostState added in v0.9.17

func (t *BlockTest) ValidatePostState(statedb *state.StateDB) error

type TransactionTest

type TransactionTest struct {
	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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL