Documentation ¶
Overview ¶
包测试实现了以太坊JSON测试的执行。
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Forks = map[string]*params.ChainConfig{ "Frontier": { ChainID: big.NewInt(1), }, "Homestead": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), }, "EIP150": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), }, "EIP158": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), }, "Byzantium": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), DAOForkBlock: big.NewInt(0), ByzantiumBlock: big.NewInt(0), }, "Constantinople": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), DAOForkBlock: big.NewInt(0), ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: big.NewInt(0), }, "FrontierToHomesteadAt5": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(5), }, "HomesteadToEIP150At5": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(5), }, "HomesteadToDaoAt5": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), DAOForkBlock: big.NewInt(5), DAOForkSupport: true, }, "EIP158ToByzantiumAt5": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(5), }, "ByzantiumToConstantinopleAt5": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: big.NewInt(5), }, }
forks表定义支持的forks及其链配置。
Functions ¶
func MakePreState ¶
Types ¶
type BlockTest ¶
type BlockTest struct {
// contains filtered or unexported fields
}
块测试检查整个块的处理。
func (*BlockTest) UnmarshalJSON ¶
unmashaljson实现json.unmasheler接口。
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 { //如果in的值为“无效”或“有效”,则测试 //检查是否可以将out解码为值 //键入interface。 // //对于其他JSON值,in被视为 //调用rlp.stream。测试还验证编码 //In产生输入输出字节。 In interface{} //out是十六进制编码的rlp值。 Out string }
rlp test是单个rlp测试的JSON结构。
type StateTest ¶
type StateTest struct {
// contains filtered or unexported fields
}
StateTest检查没有块上下文的事务处理。 有关测试格式规范,请参阅https://github.com/ethereum/eips/issues/176。
func (*StateTest) UnmarshalJSON ¶
type TransactionTest ¶
type TransactionTest struct {
// contains filtered or unexported fields
}
TransactionTest检查事务的rlp解码和发送方派生。
func (*TransactionTest) Run ¶
func (tt *TransactionTest) Run(config *params.ChainConfig) error
type UnsupportedForkError ¶
type UnsupportedForkError struct {
Name string
}
当测试请求未实现的分叉时,将返回UnsupportedWorkError。
func (UnsupportedForkError) Error ¶
func (e UnsupportedForkError) Error() string
type VMTest ¶
type VMTest struct {
// contains filtered or unexported fields
}
vmtest检查没有块或事务上下文的evm执行。 有关测试格式规范,请参阅https://github.com/ethereum/tests/wiki/vm-tests。
func (*VMTest) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.