aboutsummaryrefslogtreecommitdiffstats
path: root/tests/transaction_test_util.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-11-02 20:44:13 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-11-13 21:55:30 +0800
commit4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188 (patch)
tree5c55a3088c944ddf517aa4d7c85c5dc7f02d00e4 /tests/transaction_test_util.go
parent5cd86443ee071b5e3abe4995c777ce467c29f2c5 (diff)
downloadgo-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.gz
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.bz2
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.lz
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.xz
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.zst
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.zip
core/types, params: EIP#155
Diffstat (limited to 'tests/transaction_test_util.go')
-rw-r--r--tests/transaction_test_util.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/transaction_test_util.go b/tests/transaction_test_util.go
index be3514737..184bdee2a 100644
--- a/tests/transaction_test_util.go
+++ b/tests/transaction_test_util.go
@@ -159,16 +159,11 @@ func verifyTxFields(txTest TransactionTest, decodedTx *types.Transaction) (err e
}
}()
- var (
- decodedSender common.Address
- )
+ var decodedSender common.Address
chainConfig := &params.ChainConfig{HomesteadBlock: params.MainNetHomesteadBlock}
- if chainConfig.IsHomestead(common.String2Big(txTest.Blocknumber)) {
- decodedSender, err = decodedTx.From()
- } else {
- decodedSender, err = decodedTx.FromFrontier()
- }
+ signer := types.MakeSigner(chainConfig, common.String2Big(txTest.Blocknumber))
+ decodedSender, err = types.Sender(signer, decodedTx)
if err != nil {
return err
}
@@ -198,7 +193,7 @@ func verifyTxFields(txTest TransactionTest, decodedTx *types.Transaction) (err e
return fmt.Errorf("Nonce mismatch: %v %v", expectedNonce, decodedTx.Nonce())
}
- v, r, s := decodedTx.SignatureValues()
+ v, r, s := types.SignatureValues(signer, decodedTx)
expectedR := mustConvertBigInt(txTest.Transaction.R, 16)
if r.Cmp(expectedR) != 0 {
return fmt.Errorf("R mismatch: %v %v", expectedR, r)