{"modulePath":"github.com/Evolution404/simcore","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package tests\n\nPackage tests implements execution of Ethereum JSON tests.\n\n## Variables\n\n```go\nvar Forks = map[string]*params.ChainConfig{\n\t\"Frontier\": {\n\t\tChainID: big.NewInt(1),\n\t},\n\t\"Homestead\": {\n\t\tChainID:        big.NewInt(1),\n\t\tHomesteadBlock: big.NewInt(0),\n\t},\n\t\"EIP150\": {\n\t\tChainID:        big.NewInt(1),\n\t\tHomesteadBlock: big.NewInt(0),\n\t\tEIP150Block:    big.NewInt(0),\n\t},\n\t\"EIP158\": {\n\t\tChainID:        big.NewInt(1),\n\t\tHomesteadBlock: big.NewInt(0),\n\t\tEIP150Block:    big.NewInt(0),\n\t\tEIP155Block:    big.NewInt(0),\n\t\tEIP158Block:    big.NewInt(0),\n\t},\n\t\"Byzantium\": {\n\t\tChainID:        big.NewInt(1),\n\t\tHomesteadBlock: big.NewInt(0),\n\t\tEIP150Block:    big.NewInt(0),\n\t\tEIP155Block:    big.NewInt(0),\n\t\tEIP158Block:    big.NewInt(0),\n\t\tDAOForkBlock:   big.NewInt(0),\n\t\tByzantiumBlock: big.NewInt(0),\n\t},\n\t\"Constantinople\": {\n\t\tChainID:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP155Block:         big.NewInt(0),\n\t\tEIP158Block:         big.NewInt(0),\n\t\tDAOForkBlock:        big.NewInt(0),\n\t\tByzantiumBlock:      big.NewInt(0),\n\t\tConstantinopleBlock: big.NewInt(0),\n\t\tPetersburgBlock:     big.NewInt(10000000),\n\t},\n\t\"ConstantinopleFix\": {\n\t\tChainID:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP155Block:         big.NewInt(0),\n\t\tEIP158Block:         big.NewInt(0),\n\t\tDAOForkBlock:        big.NewInt(0),\n\t\tByzantiumBlock:      big.NewInt(0),\n\t\tConstantinopleBlock: big.NewInt(0),\n\t\tPetersburgBlock:     big.NewInt(0),\n\t},\n\t\"Istanbul\": {\n\t\tChainID:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP155Block:         big.NewInt(0),\n\t\tEIP158Block:         big.NewInt(0),\n\t\tDAOForkBlock:        big.NewInt(0),\n\t\tByzantiumBlock:      big.NewInt(0),\n\t\tConstantinopleBlock: big.NewInt(0),\n\t\tPetersburgBlock:     big.NewInt(0),\n\t\tIstanbulBlock:       big.NewInt(0),\n\t},\n\t\"FrontierToHomesteadAt5\": {\n\t\tChainID:        big.NewInt(1),\n\t\tHomesteadBlock: big.NewInt(5),\n\t},\n\t\"HomesteadToEIP150At5\": {\n\t\tChainID:        big.NewInt(1),\n\t\tHomesteadBlock: big.NewInt(0),\n\t\tEIP150Block:    big.NewInt(5),\n\t},\n\t\"HomesteadToDaoAt5\": {\n\t\tChainID:        big.NewInt(1),\n\t\tHomesteadBlock: big.NewInt(0),\n\t\tDAOForkBlock:   big.NewInt(5),\n\t\tDAOForkSupport: true,\n\t},\n\t\"EIP158ToByzantiumAt5\": {\n\t\tChainID:        big.NewInt(1),\n\t\tHomesteadBlock: big.NewInt(0),\n\t\tEIP150Block:    big.NewInt(0),\n\t\tEIP155Block:    big.NewInt(0),\n\t\tEIP158Block:    big.NewInt(0),\n\t\tByzantiumBlock: big.NewInt(5),\n\t},\n\t\"ByzantiumToConstantinopleAt5\": {\n\t\tChainID:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP155Block:         big.NewInt(0),\n\t\tEIP158Block:         big.NewInt(0),\n\t\tByzantiumBlock:      big.NewInt(0),\n\t\tConstantinopleBlock: big.NewInt(5),\n\t},\n\t\"ByzantiumToConstantinopleFixAt5\": {\n\t\tChainID:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP155Block:         big.NewInt(0),\n\t\tEIP158Block:         big.NewInt(0),\n\t\tByzantiumBlock:      big.NewInt(0),\n\t\tConstantinopleBlock: big.NewInt(5),\n\t\tPetersburgBlock:     big.NewInt(5),\n\t},\n\t\"ConstantinopleFixToIstanbulAt5\": {\n\t\tChainID:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP155Block:         big.NewInt(0),\n\t\tEIP158Block:         big.NewInt(0),\n\t\tByzantiumBlock:      big.NewInt(0),\n\t\tConstantinopleBlock: big.NewInt(0),\n\t\tPetersburgBlock:     big.NewInt(0),\n\t\tIstanbulBlock:       big.NewInt(5),\n\t},\n\t\"Berlin\": {\n\t\tChainID:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP155Block:         big.NewInt(0),\n\t\tEIP158Block:         big.NewInt(0),\n\t\tByzantiumBlock:      big.NewInt(0),\n\t\tConstantinopleBlock: big.NewInt(0),\n\t\tPetersburgBlock:     big.NewInt(0),\n\t\tIstanbulBlock:       big.NewInt(0),\n\t\tMuirGlacierBlock:    big.NewInt(0),\n\t\tBerlinBlock:         big.NewInt(0),\n\t},\n\t\"BerlinToLondonAt5\": {\n\t\tChainID:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP155Block:         big.NewInt(0),\n\t\tEIP158Block:         big.NewInt(0),\n\t\tByzantiumBlock:      big.NewInt(0),\n\t\tConstantinopleBlock: big.NewInt(0),\n\t\tPetersburgBlock:     big.NewInt(0),\n\t\tIstanbulBlock:       big.NewInt(0),\n\t\tMuirGlacierBlock:    big.NewInt(0),\n\t\tBerlinBlock:         big.NewInt(0),\n\t\tLondonBlock:         big.NewInt(5),\n\t},\n\t\"London\": {\n\t\tChainID:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP155Block:         big.NewInt(0),\n\t\tEIP158Block:         big.NewInt(0),\n\t\tByzantiumBlock:      big.NewInt(0),\n\t\tConstantinopleBlock: big.NewInt(0),\n\t\tPetersburgBlock:     big.NewInt(0),\n\t\tIstanbulBlock:       big.NewInt(0),\n\t\tMuirGlacierBlock:    big.NewInt(0),\n\t\tBerlinBlock:         big.NewInt(0),\n\t\tLondonBlock:         big.NewInt(0),\n\t},\n\t\"ArrowGlacier\": {\n\t\tChainID:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP155Block:         big.NewInt(0),\n\t\tEIP158Block:         big.NewInt(0),\n\t\tByzantiumBlock:      big.NewInt(0),\n\t\tConstantinopleBlock: big.NewInt(0),\n\t\tPetersburgBlock:     big.NewInt(0),\n\t\tIstanbulBlock:       big.NewInt(0),\n\t\tMuirGlacierBlock:    big.NewInt(0),\n\t\tBerlinBlock:         big.NewInt(0),\n\t\tLondonBlock:         big.NewInt(0),\n\t\tArrowGlacierBlock:   big.NewInt(0),\n\t},\n}\n```\nForks table defines supported forks and their chain config.\n\n## Functions\n\n```go\nfunc AvailableForks() []string\n```\nReturns the set of defined fork names\n\n```go\nfunc FromHex(s string) ([]byte, error)\n```\nFromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with \"0x\". This is copy-pasted from bytes.go, which does not return the error\n\n```go\nfunc GetChainConfig(forkString string) (baseConfig *params.ChainConfig, eips []int, err error)\n```\nGetChainConfig takes a fork definition and returns a chain config. The fork definition can be - a plain forkname, e.g. \\`Byzantium\\`, - a fork basename, and a list of EIPs to enable; e.g. \\`Byzantium+1884+1283\\`.\n\n```go\nfunc MakePreState(db ethdb.Database, accounts core.GenesisAlloc, snapshotter bool) (*snapshot.Tree, *state.StateDB)\n```\n\n## Types\n\n```go\ntype BlockTest struct {\n\t// contains filtered or unexported fields\n}\n```\nA BlockTest checks handling of entire blocks.\n\n```go\nfunc (t *BlockTest) Run(snapshotter bool) error\n```\n\n```go\nfunc (t *BlockTest) UnmarshalJSON(in []byte) error\n```\nUnmarshalJSON implements json.Unmarshaler interface.\n\n```go\ntype DifficultyTest struct {\n\tParentTimestamp    uint64      `json:\"parentTimestamp\"`\n\tParentDifficulty   *big.Int    `json:\"parentDifficulty\"`\n\tUncleHash          common.Hash `json:\"parentUncles\"`\n\tCurrentTimestamp   uint64      `json:\"currentTimestamp\"`\n\tCurrentBlockNumber uint64      `json:\"currentBlockNumber\"`\n\tCurrentDifficulty  *big.Int    `json:\"currentDifficulty\"`\n}\n```\n\n```go\nfunc (d DifficultyTest) MarshalJSON() ([]byte, error)\n```\nMarshalJSON marshals as JSON.\n\n```go\nfunc (test *DifficultyTest) Run(config *params.ChainConfig) error\n```\n\n```go\nfunc (d *DifficultyTest) UnmarshalJSON(input []byte) error\n```\nUnmarshalJSON unmarshals from JSON.\n\n```go\ntype RLPTest struct {\n\t// If the value of In is \"INVALID\" or \"VALID\", the test\n\t// checks whether Out can be decoded into a value of\n\t// type interface{}.\n\t//\n\t// For other JSON values, In is treated as a driver for\n\t// calls to rlp.Stream. The test also verifies that encoding\n\t// In produces the bytes in Out.\n\tIn interface{}\n\n\t// Out is a hex-encoded RLP value.\n\tOut string\n}\n```\nRLPTest is the JSON structure of a single RLP test.\n\n```go\nfunc (t *RLPTest) Run() error\n```\nRun executes the test.\n\n```go\ntype StateSubtest struct {\n\tFork  string\n\tIndex int\n}\n```\nStateSubtest selects a specific configuration of a General State Test.\n\n```go\ntype StateTest struct {\n\t// contains filtered or unexported fields\n}\n```\nStateTest checks transaction processing without block context. See [https://github.com/ethereum/EIPs/issues/176](https://github.com/ethereum/EIPs/issues/176) for the test format specification.\n\n```go\nfunc (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config, snapshotter bool) (*snapshot.Tree, *state.StateDB, error)\n```\nRun executes a specific subtest and verifies the post-state and logs\n\n```go\nfunc (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapshotter bool) (*snapshot.Tree, *state.StateDB, common.Hash, error)\n```\nRunNoVerify runs a specific subtest and returns the statedb and post-state root\n\n```go\nfunc (t *StateTest) Subtests() []StateSubtest\n```\nSubtests returns all valid subtests of the test.\n\n```go\nfunc (t *StateTest) UnmarshalJSON(in []byte) error\n```\n\n```go\ntype TransactionTest struct {\n\tRLP            hexutil.Bytes `json:\"rlp\"`\n\tByzantium      ttFork\n\tConstantinople ttFork\n\tIstanbul       ttFork\n\tEIP150         ttFork\n\tEIP158         ttFork\n\tFrontier       ttFork\n\tHomestead      ttFork\n}\n```\nTransactionTest checks RLP decoding and sender derivation of transactions.\n\n```go\nfunc (tt *TransactionTest) Run(config *params.ChainConfig) error\n```\n\n```go\ntype UnsupportedForkError struct {\n\tName string\n}\n```\nUnsupportedForkError is returned when a test requests a fork that isn't implemented.\n\n```go\nfunc (e UnsupportedForkError) Error() string\n```\n\n","path":"github.com/Evolution404/simcore/tests","name":"tests","synopsis":"Package tests implements execution of Ethereum JSON tests.","isRedistributable":true}
