From ee68dc66a835bf2c9333f3d7b33791841f561c84 Mon Sep 17 00:00:00 2001 From: Abirdcfly Date: Tue, 8 Oct 2024 21:09:20 +0800 Subject: [PATCH] btcec+mempool: delete minor unreachable code caused by t.Fatal Signed-off-by: Abirdcfly --- btcec/btcec_test.go | 3 --- mempool/policy_test.go | 2 -- 2 files changed, 5 deletions(-) diff --git a/btcec/btcec_test.go b/btcec/btcec_test.go index f5d93952..b08155e2 100644 --- a/btcec/btcec_test.go +++ b/btcec/btcec_test.go @@ -651,14 +651,12 @@ func TestScalarMultRand(t *testing.T) { _, err := rand.Read(data) if err != nil { t.Fatalf("failed to read random data at %d", i) - break } x, y = s256.ScalarMult(x, y, data) exponent.Mul(exponent, new(big.Int).SetBytes(data)) xWant, yWant := s256.ScalarBaseMult(exponent.Bytes()) if x.Cmp(xWant) != 0 || y.Cmp(yWant) != 0 { t.Fatalf("%d: bad output for %X: got (%X, %X), want (%X, %X)", i, data, x, y, xWant, yWant) - break } } } @@ -814,7 +812,6 @@ func TestSplitKRand(t *testing.T) { _, err := rand.Read(bytesK) if err != nil { t.Fatalf("failed to read random data at %d", i) - break } k := new(big.Int).SetBytes(bytesK) k1, k2, k1Sign, k2Sign := splitK(bytesK) diff --git a/mempool/policy_test.go b/mempool/policy_test.go index 1b29d71f..29c0956a 100644 --- a/mempool/policy_test.go +++ b/mempool/policy_test.go @@ -190,7 +190,6 @@ func TestCheckPkScriptStandard(t *testing.T) { if err != nil { t.Fatalf("TestCheckPkScriptStandard test '%s' "+ "failed: %v", test.name, err) - continue } scriptClass := txscript.GetScriptClass(script) got := checkPkScriptStandard(script, scriptClass) @@ -272,7 +271,6 @@ func TestDust(t *testing.T) { if res != test.isDust { t.Fatalf("Dust test '%s' failed: want %v got %v", test.name, test.isDust, res) - continue } } }