From 03a7f9b01fc33417c8f5456ad1ebb409c3989d64 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 27 Oct 2017 16:26:35 -0600 Subject: [PATCH] gcs/builder: fix tests by rebuilding filter, making failure to match fatal --- gcs/builder/builder_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gcs/builder/builder_test.go b/gcs/builder/builder_test.go index 3325df3..29f847b 100644 --- a/gcs/builder/builder_test.go +++ b/gcs/builder/builder_test.go @@ -261,7 +261,7 @@ func BuilderTest(b *builder.GCSBuilder, hash *chainhash.Hash, p uint8, } pushedData, err := txscript.PushedData(addrBytes) if err != nil { - t.Fatalf("Couldn't extract pushed data from addrBytesess script: %s", + t.Fatalf("Couldn't extract pushed data from addrBytes script: %s", err.Error()) } match, err = f.MatchAny(key, pushedData) @@ -269,17 +269,21 @@ func BuilderTest(b *builder.GCSBuilder, hash *chainhash.Hash, p uint8, t.Fatalf("Filter match any failed: %s", err) } if !match { - t.Logf("Filter didn't match when it should have!") + t.Fatal("Filter didn't match when it should have!") } // Add a routine witness stack, build a filter, and test that it // matches. b.AddWitness(witness) + f, err = b.Build() + if err != nil { + t.Fatalf("Filter build failed: %s", err.Error()) + } match, err = f.MatchAny(key, witness) if err != nil { t.Fatalf("Filter match any failed: %s", err) } if !match { - t.Logf("Filter didn't match when it should have!") + t.Fatal("Filter didn't match when it should have!") } }