aboutsummaryrefslogtreecommitdiffstats
path: root/core/bloombits
diff options
context:
space:
mode:
authorferhat elmas <elmas.ferhat@gmail.com>2017-11-08 18:45:52 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-11-08 18:45:52 +0800
commit9619a610248e9630968ba1d9be8e214b645c9c55 (patch)
tree5844cfbee9a0ac5750dcc803cea461f75969f74e /core/bloombits
parentbfdc0fa3622d7c3b421d2f5a6dda5746be41bfde (diff)
downloaddexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar.gz
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar.bz2
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar.lz
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar.xz
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar.zst
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.zip
all: gofmt -w -s (#15419)
Diffstat (limited to 'core/bloombits')
-rw-r--r--core/bloombits/matcher_test.go16
-rw-r--r--core/bloombits/scheduler_test.go2
2 files changed, 9 insertions, 9 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(),
})