diff options
author | obscuren <geffobscura@gmail.com> | 2015-06-10 03:12:25 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-06-10 03:12:25 +0800 |
commit | bac9a94ddf20dc530966cbf6cd384aaf94aedc77 (patch) | |
tree | 0ced967e60315698cc5056a984d7678c417bc1ce /eth/downloader/queue_test.go | |
parent | 0e703d92ac9df61e2ededa8c895c70ded101a607 (diff) | |
parent | 14994fa21bf6f05554ff370d41005d06b68d20a5 (diff) | |
download | go-tangerine-bac9a94ddf20dc530966cbf6cd384aaf94aedc77.tar go-tangerine-bac9a94ddf20dc530966cbf6cd384aaf94aedc77.tar.gz go-tangerine-bac9a94ddf20dc530966cbf6cd384aaf94aedc77.tar.bz2 go-tangerine-bac9a94ddf20dc530966cbf6cd384aaf94aedc77.tar.lz go-tangerine-bac9a94ddf20dc530966cbf6cd384aaf94aedc77.tar.xz go-tangerine-bac9a94ddf20dc530966cbf6cd384aaf94aedc77.tar.zst go-tangerine-bac9a94ddf20dc530966cbf6cd384aaf94aedc77.zip |
Merge branch 'release/0.9.28'v0.9.28
Diffstat (limited to 'eth/downloader/queue_test.go')
-rw-r--r-- | eth/downloader/queue_test.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/eth/downloader/queue_test.go b/eth/downloader/queue_test.go index b1f3591f3..ee6141f71 100644 --- a/eth/downloader/queue_test.go +++ b/eth/downloader/queue_test.go @@ -1,8 +1,6 @@ package downloader import ( - "testing" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "gopkg.in/fatih/set.v0" @@ -30,32 +28,3 @@ func createBlocksFromHashSet(hashes *set.Set) []*types.Block { return blocks } - -func TestChunking(t *testing.T) { - queue := newQueue() - peer1 := newPeer("peer1", common.Hash{}, nil, nil) - peer2 := newPeer("peer2", common.Hash{}, nil, nil) - - // 99 + 1 (1 == known genesis hash) - hashes := createHashes(0, 99) - queue.Insert(hashes) - - chunk1 := queue.Reserve(peer1, 99) - if chunk1 == nil { - t.Errorf("chunk1 is nil") - t.FailNow() - } - chunk2 := queue.Reserve(peer2, 99) - if chunk2 == nil { - t.Errorf("chunk2 is nil") - t.FailNow() - } - - if len(chunk1.Hashes) != 99 { - t.Error("expected chunk1 hashes to be 99, got", len(chunk1.Hashes)) - } - - if len(chunk2.Hashes) != 1 { - t.Error("expected chunk1 hashes to be 1, got", len(chunk2.Hashes)) - } -} |