mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-09-13 04:50:11 +00:00

* [NOD-1223] Move all network stuff into a new network package. * [NOD-1223] Delete the unused package testutil. * [NOD-1223] Move infrastructure stuff into a new instrastructure package. * [NOD-1223] Move domain stuff into a new domain package.
27 lines
735 B
Go
27 lines
735 B
Go
package blockdag
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/dagconfig"
|
|
"github.com/kaspanet/kaspad/util/mstime"
|
|
"testing"
|
|
)
|
|
|
|
func TestAncestorErrors(t *testing.T) {
|
|
// Create a new database and DAG instance to run tests against.
|
|
params := dagconfig.SimnetParams
|
|
dag, teardownFunc, err := DAGSetup("TestAncestorErrors", true, Config{
|
|
DAGParams: ¶ms,
|
|
})
|
|
if err != nil {
|
|
t.Fatalf("TestAncestorErrors: Failed to setup DAG instance: %s", err)
|
|
}
|
|
defer teardownFunc()
|
|
|
|
node := newTestNode(dag, newBlockSet(), int32(0x10000000), 0, mstime.Now())
|
|
node.blueScore = 2
|
|
ancestor := node.SelectedAncestor(3)
|
|
if ancestor != nil {
|
|
t.Errorf("TestAncestorErrors: Ancestor() unexpectedly returned a node. Expected: <nil>")
|
|
}
|
|
}
|