| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985 |
- // Copyright 2015 The go-ethereum Authors
- // This file is part of the go-ethereum library.
- //
- // The go-ethereum library is free software: you can redistribute it and/or modify
- // it under the terms of the GNU Lesser General Public License as published by
- // the Free Software Foundation, either version 3 of the License, or
- // (at your option) any later version.
- //
- // The go-ethereum library is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU Lesser General Public License for more details.
- //
- // You should have received a copy of the GNU Lesser General Public License
- // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
- package tests
- import (
- "math/big"
- "os"
- "path/filepath"
- "testing"
- "github.com/ethereum/go-ethereum/params"
- )
- func BenchmarkStateCall1024(b *testing.B) {
- fn := filepath.Join(stateTestDir, "stCallCreateCallCodeTest.json")
- if err := BenchVmTest(fn, bconf{"Call1024BalanceTooLow", true, os.Getenv("JITVM") == "true"}, b); err != nil {
- b.Error(err)
- }
- }
- func TestStateSystemOperations(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stSystemOperationsTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStateExample(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stExample.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStatePreCompiledContracts(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stPreCompiledContracts.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStateRecursiveCreate(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stRecursiveCreate.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStateSpecial(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stSpecialTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStateRefund(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stRefundTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStateBlockHash(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stBlockHashTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStateInitCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stInitCodeTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStateLog(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stLogTests.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStateTransaction(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stTransactionTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStateTransition(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stTransitionTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestCallCreateCallCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stCallCreateCallCodeTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestCallCodes(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stCallCodes.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestMemory(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stMemoryTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestMemoryStress(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- if os.Getenv("TEST_VM_COMPLEX") == "" {
- t.Skip()
- }
- fn := filepath.Join(stateTestDir, "stMemoryStressTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestQuadraticComplexity(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- if os.Getenv("TEST_VM_COMPLEX") == "" {
- t.Skip()
- }
- fn := filepath.Join(stateTestDir, "stQuadraticComplexityTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestSolidity(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stSolidityTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestWallet(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "stWalletTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestStateTestsRandom(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fns, _ := filepath.Glob("./files/StateTests/RandomTests/*")
- for _, fn := range fns {
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(fn, err)
- }
- }
- }
- // homestead tests
- func TestHomesteadDelegateCall(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: big.NewInt(1150000),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stDelegatecallTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadStateSystemOperations(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stSystemOperationsTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadStatePreCompiledContracts(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stPreCompiledContracts.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadStateRecursiveCreate(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stSpecialTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadStateRefund(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stRefundTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadStateInitCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stInitCodeTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadStateLog(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stLogTests.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadStateTransaction(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stTransactionTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadCallCreateCallCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stCallCreateCallCodeTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadCallCodes(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stCallCodes.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadMemory(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stMemoryTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadMemoryStress(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- if os.Getenv("TEST_VM_COMPLEX") == "" {
- t.Skip()
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stMemoryStressTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadQuadraticComplexity(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- if os.Getenv("TEST_VM_COMPLEX") == "" {
- t.Skip()
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stQuadraticComplexityTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadWallet(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stWalletTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadDelegateCodes(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stCallDelegateCodes.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadDelegateCodesCallCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stCallDelegateCodesCallCode.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestHomesteadBounds(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- }
- fn := filepath.Join(stateTestDir, "Homestead", "stBoundsTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- // EIP150 tests
- func TestEIP150Specific(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "stEIPSpecificTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150SingleCodeGasPrice(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "stEIPSingleCodeGasPrices.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150MemExpandingCalls(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "stMemExpandingEIPCalls.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadStateSystemOperations(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stSystemOperationsTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadStatePreCompiledContracts(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stPreCompiledContracts.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadStateRecursiveCreate(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stSpecialTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadStateRefund(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stRefundTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadStateInitCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stInitCodeTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadStateLog(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stLogTests.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadStateTransaction(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stTransactionTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadCallCreateCallCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stCallCreateCallCodeTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadCallCodes(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stCallCodes.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadMemory(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stMemoryTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadMemoryStress(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- if os.Getenv("TEST_VM_COMPLEX") == "" {
- t.Skip()
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stMemoryStressTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadQuadraticComplexity(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- if os.Getenv("TEST_VM_COMPLEX") == "" {
- t.Skip()
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stQuadraticComplexityTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadWallet(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stWalletTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadDelegateCodes(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stCallDelegateCodes.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadDelegateCodesCallCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stCallDelegateCodesCallCode.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP150HomesteadBounds(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- }
- fn := filepath.Join(stateTestDir, "EIP150", "Homestead", "stBoundsTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- // EIP158 tests
- func TestEIP158Create(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "stCreateTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158Specific(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "stEIP158SpecificTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158NonZeroCalls(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "stNonZeroCallsTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158ZeroCalls(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "stZeroCallsTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158_150Specific(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "EIP150", "stEIPSpecificTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158_150SingleCodeGasPrice(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "EIP150", "stEIPsingleCodeGasPrices.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158_150MemExpandingCalls(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "EIP150", "stMemExpandingEIPCalls.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadStateSystemOperations(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stSystemOperationsTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadStatePreCompiledContracts(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stPreCompiledContracts.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadStateRecursiveCreate(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stSpecialTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadStateRefund(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stRefundTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadStateInitCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stInitCodeTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadStateLog(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stLogTests.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadStateTransaction(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stTransactionTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadCallCreateCallCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stCallCreateCallCodeTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadCallCodes(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stCallCodes.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadMemory(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stMemoryTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadMemoryStress(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- if os.Getenv("TEST_VM_COMPLEX") == "" {
- t.Skip()
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stMemoryStressTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadQuadraticComplexity(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- if os.Getenv("TEST_VM_COMPLEX") == "" {
- t.Skip()
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stQuadraticComplexityTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadWallet(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stWalletTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadDelegateCodes(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stCallDelegateCodes.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadDelegateCodesCallCode(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stCallDelegateCodesCallCode.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
- func TestEIP158HomesteadBounds(t *testing.T) {
- chainConfig := ¶ms.ChainConfig{
- HomesteadBlock: new(big.Int),
- EIP150Block: big.NewInt(2457000),
- EIP158Block: big.NewInt(3500000),
- }
- fn := filepath.Join(stateTestDir, "EIP158", "Homestead", "stBoundsTest.json")
- if err := RunStateTest(chainConfig, fn, StateSkipTests); err != nil {
- t.Error(err)
- }
- }
|