Skip to content

Commit

Permalink
delete minor unreachable code caused by t.Fatal
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
  • Loading branch information
Abirdcfly committed Aug 11, 2022
1 parent 0f49e10 commit 14a1640
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 2 additions & 5 deletions btcec/btcec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ type baseMultTest struct {
x, y string
}

//TODO: add more test vectors
// TODO: add more test vectors
var s256BaseMultTests = []baseMultTest{
{
"AA5E28D6A97A2479A65527F7290311A3624D4CC0FA1578598EE3C2613BF99522",
Expand Down Expand Up @@ -556,7 +556,7 @@ var s256BaseMultTests = []baseMultTest{
},
}

//TODO: test different curves as well?
// TODO: test different curves as well?
func TestBaseMult(t *testing.T) {
s256 := S256()
for i, e := range s256BaseMultTests {
Expand Down Expand Up @@ -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
}
}
}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions mempool/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit 14a1640

Please sign in to comment.