diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-01-20 06:48:50 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-02-18 17:08:18 +0800 |
commit | 4f4d2b647488eaa056613fa6f026229ac91f066a (patch) | |
tree | 3c5cfa2e5bf6da15a806a575921fe04263538375 /tests/transaction_test_util.go | |
parent | 371871d685d54b916aef28de689d6f0af7822083 (diff) | |
download | go-tangerine-4f4d2b647488eaa056613fa6f026229ac91f066a.tar.gz go-tangerine-4f4d2b647488eaa056613fa6f026229ac91f066a.tar.zst go-tangerine-4f4d2b647488eaa056613fa6f026229ac91f066a.zip |
tests: updated homestead tests
Diffstat (limited to 'tests/transaction_test_util.go')
-rw-r--r-- | tests/transaction_test_util.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/transaction_test_util.go b/tests/transaction_test_util.go index 6f9840523..6302b9d5b 100644 --- a/tests/transaction_test_util.go +++ b/tests/transaction_test_util.go @@ -21,11 +21,13 @@ import ( "errors" "fmt" "io" + "math/big" "runtime" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/logger/glog" + "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" ) @@ -43,6 +45,7 @@ type TtTransaction struct { } type TransactionTest struct { + Blocknumber string Rlp string Sender string Transaction TtTransaction @@ -88,6 +91,8 @@ func RunTransactionTests(file string, skipTests []string) error { } func runTransactionTests(tests map[string]TransactionTest, skipTests []string) error { + params.HomesteadBlock = big.NewInt(900000) + skipTest := make(map[string]bool, len(skipTests)) for _, name := range skipTests { skipTest[name] = true @@ -102,7 +107,7 @@ func runTransactionTests(tests map[string]TransactionTest, skipTests []string) e // test the block if err := runTransactionTest(test); err != nil { - return err + return fmt.Errorf("%s: %v", name, err) } glog.Infoln("Transaction test passed: ", name) @@ -157,7 +162,15 @@ func verifyTxFields(txTest TransactionTest, decodedTx *types.Transaction) (err e } }() - decodedSender, err := decodedTx.From() + var ( + decodedSender common.Address + ) + + if params.IsHomestead(common.String2Big(txTest.Blocknumber)) { + decodedSender, err = decodedTx.From() + } else { + decodedSender, err = decodedTx.FromFrontier() + } if err != nil { return err } |