github.com/linapex/ethereum-go-chinese@v0.0.0-20190316121929-f8b7a73c3fa1/tests/transaction_test.go (about)

     1  
     2  //<developer>
     3  //    <name>linapex 曹一峰</name>
     4  //    <email>linapex@163.com</email>
     5  //    <wx>superexc</wx>
     6  //    <qqgroup>128148617</qqgroup>
     7  //    <url>https://jsq.ink</url>
     8  //    <role>pku engineer</role>
     9  //    <date>2019-03-16 19:16:45</date>
    10  //</624450122553495552>
    11  
    12  
    13  package tests
    14  
    15  import (
    16  	"math/big"
    17  	"testing"
    18  
    19  	"github.com/ethereum/go-ethereum/params"
    20  )
    21  
    22  func TestTransaction(t *testing.T) {
    23  	t.Parallel()
    24  
    25  	txt := new(testMatcher)
    26  	txt.config(`^Homestead/`, params.ChainConfig{
    27  		HomesteadBlock: big.NewInt(0),
    28  	})
    29  	txt.config(`^EIP155/`, params.ChainConfig{
    30  		HomesteadBlock: big.NewInt(0),
    31  		EIP150Block:    big.NewInt(0),
    32  		EIP155Block:    big.NewInt(0),
    33  		EIP158Block:    big.NewInt(0),
    34  		ChainID:        big.NewInt(1),
    35  	})
    36  	txt.config(`^Byzantium/`, params.ChainConfig{
    37  		HomesteadBlock: big.NewInt(0),
    38  		EIP150Block:    big.NewInt(0),
    39  		EIP155Block:    big.NewInt(0),
    40  		EIP158Block:    big.NewInt(0),
    41  		ByzantiumBlock: big.NewInt(0),
    42  	})
    43  
    44  	txt.walk(t, transactionTestDir, func(t *testing.T, name string, test *TransactionTest) {
    45  		cfg := txt.findConfig(name)
    46  		if err := txt.checkFailure(t, name, test.Run(cfg)); err != nil {
    47  			t.Error(err)
    48  		}
    49  	})
    50  }
    51