package utxobuild_test import ( "testing" "git.smesh.lol/nostrino/pkg/crypto/chainhash" "git.smesh.lol/btcd-lite/internal/utxobuild" ) // TestBuildNodeBodiesAtEverySpacing runs the builder over the node's bodies at // several spacings, so "the range is too big" and "the base grows into a state // the merge cannot handle" are told apart by which spacing first fails. func TestBuildNodeBodiesAtEverySpacing(t *testing.T) { src := nodeBodies(t) for _, spacing := range []uint32{1, 2, 3, 5, 10} { dir := t.TempDir() utxobuild.Debug(nil, nil) _, err := utxobuild.Build(utxobuild.Config{ Dir: dir, Interval: spacing, From: 0, To: 21, Blocks: src, }) if err != nil { t.Logf("spacing %d: %v", spacing, err) continue } t.Logf("spacing %d: built", spacing) } _ = chainhash.Hash{} }