multi: don't pass err.Error() to Fatalf
It resulted in interpreting the error message as a format string. Use Fatal(err) instead.
This commit is contained in:
4 files changed
+17
-17
No files matched your search
@@ -2070,7 +2070,7 @@ func assertBrarCleanup(t *testing.T, brar *BreachArbitrator,
|
||||
|
||||
}, 5*time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ func TestGossipSyncerApplyNoHistoricalGossipFilter(t *testing.T) {
|
||||
// filter.
|
||||
err := <-errChan
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -1087,11 +1087,11 @@ func TestSwitchForwardFailAfterFullAdd(t *testing.T) {
|
||||
// Now we will restart bob, leaving the forwarding decision for this
|
||||
// htlc is in the half-added state.
|
||||
if err := s.Stop(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := cdb.Close(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cdb2 := channeldb.OpenForTesting(t, tempPath)
|
||||
@@ -1139,7 +1139,7 @@ func TestSwitchForwardFailAfterFullAdd(t *testing.T) {
|
||||
|
||||
// Send the fail packet from the remote peer through the switch.
|
||||
if err := s2.ForwardPackets(nil, fail); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Pull packet from alice's link, as it should have gone through
|
||||
@@ -1273,11 +1273,11 @@ func TestSwitchForwardSettleAfterFullAdd(t *testing.T) {
|
||||
// Now we will restart bob, leaving the forwarding decision for this
|
||||
// htlc is in the half-added state.
|
||||
if err := s.Stop(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := cdb.Close(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cdb2 := channeldb.OpenForTesting(t, tempPath)
|
||||
@@ -1327,7 +1327,7 @@ func TestSwitchForwardSettleAfterFullAdd(t *testing.T) {
|
||||
|
||||
// Send the settle packet from the remote peer through the switch.
|
||||
if err := s2.ForwardPackets(nil, settle); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Pull packet from alice's link, as it should have gone through
|
||||
@@ -1454,11 +1454,11 @@ func TestSwitchForwardDropAfterFullAdd(t *testing.T) {
|
||||
// Now we will restart bob, leaving the forwarding decision for this
|
||||
// htlc is in the half-added state.
|
||||
if err := s.Stop(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := cdb.Close(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cdb2 := channeldb.OpenForTesting(t, tempPath)
|
||||
@@ -1601,11 +1601,11 @@ func TestSwitchForwardFailAfterHalfAdd(t *testing.T) {
|
||||
// Now we will restart bob, leaving the forwarding decision for this
|
||||
// htlc is in the half-added state.
|
||||
if err := s.Stop(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := cdb.Close(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cdb2 := channeldb.OpenForTesting(t, tempPath)
|
||||
@@ -1753,11 +1753,11 @@ func TestSwitchForwardCircuitPersistence(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := s.Stop(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := cdb.Close(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cdb2 := channeldb.OpenForTesting(t, tempPath)
|
||||
@@ -1847,7 +1847,7 @@ func TestSwitchForwardCircuitPersistence(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := cdb2.Close(); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cdb3 := channeldb.OpenForTesting(t, tempPath)
|
||||
@@ -3869,7 +3869,7 @@ func (c *interceptableSwitchTestContext) createTestPacket() *htlcPacket {
|
||||
|
||||
func (c *interceptableSwitchTestContext) finish() {
|
||||
if err := c.s.Stop(); err != nil {
|
||||
c.t.Fatalf(err.Error())
|
||||
c.t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -662,7 +662,7 @@ func TestCoinSelectSubtractFees(t *testing.T) {
|
||||
if err != nil {
|
||||
switch {
|
||||
case test.expectErr == "":
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err)
|
||||
|
||||
case test.expectErr != removeAmounts(err.Error()):
|
||||
t.Fatalf("expected error '%v', got '%v'",
|
||||
|
||||
Reference in new issue
Block a user