diff options
author | ferhat elmas <elmas.ferhat@gmail.com> | 2017-11-08 18:45:52 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-11-08 18:45:52 +0800 |
commit | 9619a610248e9630968ba1d9be8e214b645c9c55 (patch) | |
tree | 5844cfbee9a0ac5750dcc803cea461f75969f74e /core | |
parent | bfdc0fa3622d7c3b421d2f5a6dda5746be41bfde (diff) | |
download | go-tangerine-9619a610248e9630968ba1d9be8e214b645c9c55.tar go-tangerine-9619a610248e9630968ba1d9be8e214b645c9c55.tar.gz go-tangerine-9619a610248e9630968ba1d9be8e214b645c9c55.tar.bz2 go-tangerine-9619a610248e9630968ba1d9be8e214b645c9c55.tar.lz go-tangerine-9619a610248e9630968ba1d9be8e214b645c9c55.tar.xz go-tangerine-9619a610248e9630968ba1d9be8e214b645c9c55.tar.zst go-tangerine-9619a610248e9630968ba1d9be8e214b645c9c55.zip |
all: gofmt -w -s (#15419)
Diffstat (limited to 'core')
-rw-r--r-- | core/bloombits/matcher_test.go | 16 | ||||
-rw-r--r-- | core/bloombits/scheduler_test.go | 2 | ||||
-rw-r--r-- | core/genesis.go | 18 | ||||
-rw-r--r-- | core/tx_pool.go | 4 | ||||
-rw-r--r-- | core/tx_pool_test.go | 2 |
5 files changed, 21 insertions, 21 deletions
diff --git a/core/bloombits/matcher_test.go b/core/bloombits/matcher_test.go index 0d8544136..4a31854c5 100644 --- a/core/bloombits/matcher_test.go +++ b/core/bloombits/matcher_test.go @@ -31,14 +31,14 @@ const testSectionSize = 4096 // Tests that wildcard filter rules (nil) can be specified and are handled well. func TestMatcherWildcards(t *testing.T) { matcher := NewMatcher(testSectionSize, [][][]byte{ - [][]byte{common.Address{}.Bytes(), common.Address{0x01}.Bytes()}, // Default address is not a wildcard - [][]byte{common.Hash{}.Bytes(), common.Hash{0x01}.Bytes()}, // Default hash is not a wildcard - [][]byte{common.Hash{0x01}.Bytes()}, // Plain rule, sanity check - [][]byte{common.Hash{0x01}.Bytes(), nil}, // Wildcard suffix, drop rule - [][]byte{nil, common.Hash{0x01}.Bytes()}, // Wildcard prefix, drop rule - [][]byte{nil, nil}, // Wildcard combo, drop rule - [][]byte{}, // Inited wildcard rule, drop rule - nil, // Proper wildcard rule, drop rule + {common.Address{}.Bytes(), common.Address{0x01}.Bytes()}, // Default address is not a wildcard + {common.Hash{}.Bytes(), common.Hash{0x01}.Bytes()}, // Default hash is not a wildcard + {common.Hash{0x01}.Bytes()}, // Plain rule, sanity check + {common.Hash{0x01}.Bytes(), nil}, // Wildcard suffix, drop rule + {nil, common.Hash{0x01}.Bytes()}, // Wildcard prefix, drop rule + {nil, nil}, // Wildcard combo, drop rule + {}, // Inited wildcard rule, drop rule + nil, // Proper wildcard rule, drop rule }) if len(matcher.filters) != 3 { t.Fatalf("filter system size mismatch: have %d, want %d", len(matcher.filters), 3) diff --git a/core/bloombits/scheduler_test.go b/core/bloombits/scheduler_test.go index 8a159c237..70772e4ab 100644 --- a/core/bloombits/scheduler_test.go +++ b/core/bloombits/scheduler_test.go @@ -60,7 +60,7 @@ func testScheduler(t *testing.T, clients int, fetchers int, requests int) { req.section, // Requested data req.section, // Duplicated data (ensure it doesn't double close anything) }, [][]byte{ - []byte{}, + {}, new(big.Int).SetUint64(req.section).Bytes(), new(big.Int).SetUint64(req.section).Bytes(), }) diff --git a/core/genesis.go b/core/genesis.go index 26b1c9f63..df491ce0f 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -356,15 +356,15 @@ func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis { GasLimit: 6283185, Difficulty: big.NewInt(1), Alloc: map[common.Address]GenesisAccount{ - common.BytesToAddress([]byte{1}): GenesisAccount{Balance: big.NewInt(1)}, // ECRecover - common.BytesToAddress([]byte{2}): GenesisAccount{Balance: big.NewInt(1)}, // SHA256 - common.BytesToAddress([]byte{3}): GenesisAccount{Balance: big.NewInt(1)}, // RIPEMD - common.BytesToAddress([]byte{4}): GenesisAccount{Balance: big.NewInt(1)}, // Identity - common.BytesToAddress([]byte{5}): GenesisAccount{Balance: big.NewInt(1)}, // ModExp - common.BytesToAddress([]byte{6}): GenesisAccount{Balance: big.NewInt(1)}, // ECAdd - common.BytesToAddress([]byte{7}): GenesisAccount{Balance: big.NewInt(1)}, // ECScalarMul - common.BytesToAddress([]byte{8}): GenesisAccount{Balance: big.NewInt(1)}, // ECPairing - faucet: GenesisAccount{Balance: new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(9))}, + common.BytesToAddress([]byte{1}): {Balance: big.NewInt(1)}, // ECRecover + common.BytesToAddress([]byte{2}): {Balance: big.NewInt(1)}, // SHA256 + common.BytesToAddress([]byte{3}): {Balance: big.NewInt(1)}, // RIPEMD + common.BytesToAddress([]byte{4}): {Balance: big.NewInt(1)}, // Identity + common.BytesToAddress([]byte{5}): {Balance: big.NewInt(1)}, // ModExp + common.BytesToAddress([]byte{6}): {Balance: big.NewInt(1)}, // ECAdd + common.BytesToAddress([]byte{7}): {Balance: big.NewInt(1)}, // ECScalarMul + common.BytesToAddress([]byte{8}): {Balance: big.NewInt(1)}, // ECPairing + faucet: {Balance: new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(9))}, }, } } diff --git a/core/tx_pool.go b/core/tx_pool.go index 0f008ddc0..c3915575b 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -820,7 +820,7 @@ func (pool *TxPool) addTxsLocked(txs []*types.Transaction, local bool) []error { // Only reprocess the internal state if something was actually added if len(dirty) > 0 { addrs := make([]common.Address, 0, len(dirty)) - for addr, _ := range dirty { + for addr := range dirty { addrs = append(addrs, addr) } pool.promoteExecutables(addrs) @@ -907,7 +907,7 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) { // Gather all the accounts potentially needing updates if accounts == nil { accounts = make([]common.Address, 0, len(pool.queue)) - for addr, _ := range pool.queue { + for addr := range pool.queue { accounts = append(accounts, addr) } } diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go index 737ea4cd3..e9ecbb933 100644 --- a/core/tx_pool_test.go +++ b/core/tx_pool_test.go @@ -105,7 +105,7 @@ func validateTxPoolInternals(pool *TxPool) error { for addr, txs := range pool.pending { // Find the last transaction var last uint64 - for nonce, _ := range txs.txs.items { + for nonce := range txs.txs.items { if last < nonce { last = nonce } |