aboutsummaryrefslogtreecommitdiffstats
path: root/eth/handler_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-04-15 17:06:57 +0800
committerFelix Lange <fjl@twurst.com>2016-04-15 17:17:27 +0800
commit6fdd0893c3ebf57e5a9ba2af569c595c859ab902 (patch)
tree2df67265a0350b68b2f10ba2f7dcd292fef59ad0 /eth/handler_test.go
parent68c755a238f1a204087c2843f01d48fc6039716f (diff)
downloaddexon-6fdd0893c3ebf57e5a9ba2af569c595c859ab902.tar
dexon-6fdd0893c3ebf57e5a9ba2af569c595c859ab902.tar.gz
dexon-6fdd0893c3ebf57e5a9ba2af569c595c859ab902.tar.bz2
dexon-6fdd0893c3ebf57e5a9ba2af569c595c859ab902.tar.lz
dexon-6fdd0893c3ebf57e5a9ba2af569c595c859ab902.tar.xz
dexon-6fdd0893c3ebf57e5a9ba2af569c595c859ab902.tar.zst
dexon-6fdd0893c3ebf57e5a9ba2af569c595c859ab902.zip
all: fix go vet warnings
Diffstat (limited to 'eth/handler_test.go')
-rw-r--r--eth/handler_test.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/eth/handler_test.go b/eth/handler_test.go
index 76748b6e3..9e593f040 100644
--- a/eth/handler_test.go
+++ b/eth/handler_test.go
@@ -17,7 +17,6 @@
package eth
import (
- "fmt"
"math/big"
"math/rand"
"testing"
@@ -448,12 +447,12 @@ func testGetNodeData(t *testing.T, protocol int) {
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(testBankKey)
+ tx, _ := types.NewTransaction(block.TxNonce(testBank.Address), acc1Addr, big.NewInt(10000), params.TxGas, nil, nil).SignECDSA(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.
- tx1, _ := types.NewTransaction(block.TxNonce(testBankAddress), acc1Addr, big.NewInt(1000), params.TxGas, nil, nil).SignECDSA(testBankKey)
+ tx1, _ := types.NewTransaction(block.TxNonce(testBank.Address), acc1Addr, big.NewInt(1000), params.TxGas, nil, nil).SignECDSA(testBankKey)
tx2, _ := types.NewTransaction(block.TxNonce(acc1Addr), acc2Addr, big.NewInt(1000), params.TxGas, nil, nil).SignECDSA(acc1Key)
block.AddTx(tx1)
block.AddTx(tx2)
@@ -498,14 +497,14 @@ func testGetNodeData(t *testing.T, protocol int) {
// Verify that all hashes correspond to the requested data, and reconstruct a state tree
for i, want := range hashes {
if hash := crypto.Keccak256Hash(data[i]); hash != want {
- fmt.Errorf("data hash mismatch: have %x, want %x", hash, want)
+ t.Errorf("data hash mismatch: have %x, want %x", hash, want)
}
}
statedb, _ := ethdb.NewMemDatabase()
for i := 0; i < len(data); i++ {
statedb.Put(hashes[i].Bytes(), data[i])
}
- accounts := []common.Address{testBankAddress, acc1Addr, acc2Addr}
+ accounts := []common.Address{testBank.Address, acc1Addr, acc2Addr}
for i := uint64(0); i <= pm.blockchain.CurrentBlock().NumberU64(); i++ {
trie, _ := state.New(pm.blockchain.GetBlockByNumber(i).Root(), statedb)
@@ -539,12 +538,12 @@ func testGetReceipt(t *testing.T, protocol int) {
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(testBankKey)
+ tx, _ := types.NewTransaction(block.TxNonce(testBank.Address), acc1Addr, big.NewInt(10000), params.TxGas, nil, nil).SignECDSA(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.
- tx1, _ := types.NewTransaction(block.TxNonce(testBankAddress), acc1Addr, big.NewInt(1000), params.TxGas, nil, nil).SignECDSA(testBankKey)
+ tx1, _ := types.NewTransaction(block.TxNonce(testBank.Address), acc1Addr, big.NewInt(1000), params.TxGas, nil, nil).SignECDSA(testBankKey)
tx2, _ := types.NewTransaction(block.TxNonce(acc1Addr), acc2Addr, big.NewInt(1000), params.TxGas, nil, nil).SignECDSA(acc1Key)
block.AddTx(tx1)
block.AddTx(tx2)