From 35fe4313d57e1df6c3c8af0bc0b530bd7033e21b Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 12 Jan 2015 10:19:27 +0100 Subject: pre-pow --- core/chain_manager_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'core') diff --git a/core/chain_manager_test.go b/core/chain_manager_test.go index 725352daf..f382516b7 100644 --- a/core/chain_manager_test.go +++ b/core/chain_manager_test.go @@ -128,3 +128,21 @@ func TestChainMultipleInsertions(t *testing.T) { t.Error("Invalid canonical chain") } } + +func TestGetAncestors(t *testing.T) { + db, _ := ethdb.NewMemDatabase() + var eventMux event.TypeMux + chainMan := NewChainManager(db, &eventMux) + chain, err := loadChain("valid1", t) + if err != nil { + fmt.Println(err) + t.FailNow() + } + + for _, block := range chain { + chainMan.write(block) + } + + ancestors := chainMan.GetAncestors(chain[len(chain)-1], 4) + fmt.Println(ancestors) +} -- cgit