aboutsummaryrefslogtreecommitdiffstats
path: root/les
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-01-05 19:59:17 +0800
committerFelix Lange <fjl@twurst.com>2017-01-05 19:59:17 +0800
commite171bf74f8b6d15c2ae51e259d703ee5b729a298 (patch)
treeb7924c1c57d69d433cb8c6645d0b2e57743daeee /les
parentbbc4ea4ae8e8a962deae3d5693d9d4a9376eab88 (diff)
downloadgo-tangerine-e171bf74f8b6d15c2ae51e259d703ee5b729a298.tar
go-tangerine-e171bf74f8b6d15c2ae51e259d703ee5b729a298.tar.gz
go-tangerine-e171bf74f8b6d15c2ae51e259d703ee5b729a298.tar.bz2
go-tangerine-e171bf74f8b6d15c2ae51e259d703ee5b729a298.tar.lz
go-tangerine-e171bf74f8b6d15c2ae51e259d703ee5b729a298.tar.xz
go-tangerine-e171bf74f8b6d15c2ae51e259d703ee5b729a298.tar.zst
go-tangerine-e171bf74f8b6d15c2ae51e259d703ee5b729a298.zip
core/types: remove redundant SignECDSA wrappers, rename to SignTx
Diffstat (limited to 'les')
-rw-r--r--les/helper_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/les/helper_test.go b/les/helper_test.go
index 2df3faab2..ec98389cb 100644
--- a/les/helper_test.go
+++ b/les/helper_test.go
@@ -79,17 +79,17 @@ func testChainGen(i int, block *core.BlockGen) {
switch i {
case 0:
// In block 1, the test bank sends account #1 some ether.
- tx, _ := types.NewTransaction(block.TxNonce(testBankAddress), acc1Addr, big.NewInt(10000), params.TxGas, nil, nil).SignECDSA(signer, testBankKey)
+ tx, _ := types.SignTx(types.NewTransaction(block.TxNonce(testBankAddress), acc1Addr, big.NewInt(10000), params.TxGas, nil, nil), signer, testBankKey)
block.AddTx(tx)
case 1:
// In block 2, the test bank sends some more ether to account #1.
// acc1Addr passes it on to account #2.
// acc1Addr creates a test contract.
- tx1, _ := types.NewTransaction(block.TxNonce(testBankAddress), acc1Addr, big.NewInt(1000), params.TxGas, nil, nil).SignECDSA(signer, testBankKey)
+ tx1, _ := types.SignTx(types.NewTransaction(block.TxNonce(testBankAddress), acc1Addr, big.NewInt(1000), params.TxGas, nil, nil), signer, testBankKey)
nonce := block.TxNonce(acc1Addr)
- tx2, _ := types.NewTransaction(nonce, acc2Addr, big.NewInt(1000), params.TxGas, nil, nil).SignECDSA(signer, acc1Key)
+ tx2, _ := types.SignTx(types.NewTransaction(nonce, acc2Addr, big.NewInt(1000), params.TxGas, nil, nil), signer, acc1Key)
nonce++
- tx3, _ := types.NewContractCreation(nonce, big.NewInt(0), big.NewInt(200000), big.NewInt(0), testContractCode).SignECDSA(signer, acc1Key)
+ tx3, _ := types.SignTx(types.NewContractCreation(nonce, big.NewInt(0), big.NewInt(200000), big.NewInt(0), testContractCode), signer, acc1Key)
testContractAddr = crypto.CreateAddress(acc1Addr, nonce)
block.AddTx(tx1)
block.AddTx(tx2)
@@ -99,7 +99,7 @@ func testChainGen(i int, block *core.BlockGen) {
block.SetCoinbase(acc2Addr)
block.SetExtra([]byte("yeehaw"))
data := common.Hex2Bytes("C16431B900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001")
- tx, _ := types.NewTransaction(block.TxNonce(testBankAddress), testContractAddr, big.NewInt(0), big.NewInt(100000), nil, data).SignECDSA(signer, testBankKey)
+ tx, _ := types.SignTx(types.NewTransaction(block.TxNonce(testBankAddress), testContractAddr, big.NewInt(0), big.NewInt(100000), nil, data), signer, testBankKey)
block.AddTx(tx)
case 3:
// Block 4 includes blocks 2 and 3 as uncle headers (with modified extra data).
@@ -110,7 +110,7 @@ func testChainGen(i int, block *core.BlockGen) {
b3.Extra = []byte("foo")
block.AddUncle(b3)
data := common.Hex2Bytes("C16431B900000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002")
- tx, _ := types.NewTransaction(block.TxNonce(testBankAddress), testContractAddr, big.NewInt(0), big.NewInt(100000), nil, data).SignECDSA(signer, testBankKey)
+ tx, _ := types.SignTx(types.NewTransaction(block.TxNonce(testBankAddress), testContractAddr, big.NewInt(0), big.NewInt(100000), nil, data), signer, testBankKey)
block.AddTx(tx)
}
}
@@ -217,7 +217,7 @@ func (p *testTxPool) GetTransactions() types.Transactions {
// newTestTransaction create a new dummy transaction.
func newTestTransaction(from *ecdsa.PrivateKey, nonce uint64, datasize int) *types.Transaction {
tx := types.NewTransaction(nonce, common.Address{}, big.NewInt(0), big.NewInt(100000), big.NewInt(0), make([]byte, datasize))
- tx, _ = tx.SignECDSA(types.HomesteadSigner{}, from)
+ tx, _ = types.SignTx(tx, types.HomesteadSigner{}, from)
return tx
}