diff options
Diffstat (limited to 'tests/transaction_test_util.go')
-rw-r--r-- | tests/transaction_test_util.go | 13 |
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 := ¶ms.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) |