aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-12 17:19:27 +0800
committerobscuren <geffobscura@gmail.com>2015-01-12 17:19:27 +0800
commit35fe4313d57e1df6c3c8af0bc0b530bd7033e21b (patch)
treeed6b22ac3691315d0f208856bc8070bc1f5896a3 /core
parent7e6b72cb5c0172b8a6a15239a6628b64c8f8de23 (diff)
downloaddexon-35fe4313d57e1df6c3c8af0bc0b530bd7033e21b.tar.gz
dexon-35fe4313d57e1df6c3c8af0bc0b530bd7033e21b.tar.zst
dexon-35fe4313d57e1df6c3c8af0bc0b530bd7033e21b.zip
pre-pow
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)
+}