aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/chain_manager_test.go18
1 files changed, 18 insertions, 0 deletions
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)
+}