aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/downloader_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-05-26 19:00:21 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-05-26 19:00:21 +0800
commiteafdc1f8e371fd698da33491a01799393249729a (patch)
treee834b1921a15767edf889d3bd2b9f9713c1101ed /eth/downloader/downloader_test.go
parentcc318ff8db20528cb567227c42c5d37dc892cc49 (diff)
downloadgo-tangerine-eafdc1f8e371fd698da33491a01799393249729a.tar
go-tangerine-eafdc1f8e371fd698da33491a01799393249729a.tar.gz
go-tangerine-eafdc1f8e371fd698da33491a01799393249729a.tar.bz2
go-tangerine-eafdc1f8e371fd698da33491a01799393249729a.tar.lz
go-tangerine-eafdc1f8e371fd698da33491a01799393249729a.tar.xz
go-tangerine-eafdc1f8e371fd698da33491a01799393249729a.tar.zst
go-tangerine-eafdc1f8e371fd698da33491a01799393249729a.zip
eth, eth/downloader: surface downloaded block origin, drop on error
Diffstat (limited to 'eth/downloader/downloader_test.go')
-rw-r--r--eth/downloader/downloader_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go
index 8b541d8b7..66be1ca18 100644
--- a/eth/downloader/downloader_test.go
+++ b/eth/downloader/downloader_test.go
@@ -88,10 +88,10 @@ func (dl *downloadTester) sync(peerId string, head common.Hash) error {
// syncTake is starts synchronising with a remote peer, but concurrently it also
// starts fetching blocks that the downloader retrieved. IT blocks until both go
// routines terminate.
-func (dl *downloadTester) syncTake(peerId string, head common.Hash) (types.Blocks, error) {
+func (dl *downloadTester) syncTake(peerId string, head common.Hash) ([]*Block, error) {
// Start a block collector to take blocks as they become available
done := make(chan struct{})
- took := []*types.Block{}
+ took := []*Block{}
go func() {
for running := true; running; {
select {
@@ -349,7 +349,7 @@ func TestNonExistingParentAttack(t *testing.T) {
if len(bs) != 1 {
t.Fatalf("retrieved block mismatch: have %v, want %v", len(bs), 1)
}
- if tester.hasBlock(bs[0].ParentHash()) {
+ if tester.hasBlock(bs[0].RawBlock.ParentHash()) {
t.Fatalf("tester knows about the unknown hash")
}
tester.downloader.Cancel()
@@ -364,7 +364,7 @@ func TestNonExistingParentAttack(t *testing.T) {
if len(bs) != 1 {
t.Fatalf("retrieved block mismatch: have %v, want %v", len(bs), 1)
}
- if !tester.hasBlock(bs[0].ParentHash()) {
+ if !tester.hasBlock(bs[0].RawBlock.ParentHash()) {
t.Fatalf("tester doesn't know about the origin hash")
}
}