aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/queue_test.go
diff options
context:
space:
mode:
authorDaniel A. Nagy <nagy.da@gmail.com>2015-05-08 23:55:53 +0800
committerDaniel A. Nagy <nagy.da@gmail.com>2015-05-08 23:55:53 +0800
commit62dd9833ec768e2026bccb1cf7a8ef4263b9286d (patch)
tree0a091d99afd7f8cf5e3a6d4522c30ceef8559a55 /eth/downloader/queue_test.go
parent3a01e3e39b9ce83ecb7444319407ee8bb00e3bf6 (diff)
parentc8fc4cebe63073fd77d5f553a4f0cec36a4ccb4b (diff)
downloaddexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar.gz
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar.bz2
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar.lz
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar.xz
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar.zst
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.zip
Merge branch 'develop' of github.com:ethereum/go-ethereum into develop
Diffstat (limited to 'eth/downloader/queue_test.go')
-rw-r--r--eth/downloader/queue_test.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/eth/downloader/queue_test.go b/eth/downloader/queue_test.go
index b163bd9c7..b1f3591f3 100644
--- a/eth/downloader/queue_test.go
+++ b/eth/downloader/queue_test.go
@@ -32,31 +32,30 @@ func createBlocksFromHashSet(hashes *set.Set) []*types.Block {
}
func TestChunking(t *testing.T) {
- queue := newqueue()
+ 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)
- hashSet := createHashSet(hashes)
- queue.put(hashSet)
+ queue.Insert(hashes)
- chunk1 := queue.get(peer1, 99)
+ chunk1 := queue.Reserve(peer1, 99)
if chunk1 == nil {
t.Errorf("chunk1 is nil")
t.FailNow()
}
- chunk2 := queue.get(peer2, 99)
+ chunk2 := queue.Reserve(peer2, 99)
if chunk2 == nil {
t.Errorf("chunk2 is nil")
t.FailNow()
}
- if chunk1.hashes.Size() != 99 {
- t.Error("expected chunk1 hashes to be 99, got", chunk1.hashes.Size())
+ if len(chunk1.Hashes) != 99 {
+ t.Error("expected chunk1 hashes to be 99, got", len(chunk1.Hashes))
}
- if chunk2.hashes.Size() != 1 {
- t.Error("expected chunk1 hashes to be 1, got", chunk2.hashes.Size())
+ if len(chunk2.Hashes) != 1 {
+ t.Error("expected chunk1 hashes to be 1, got", len(chunk2.Hashes))
}
}