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:
Boris Nagaev committed 2025-08-30 14:13:44 -03:00
1 parent 66c7e72c0d
commit 2a599bedc0
4 files changed
+17 -17

No files matched your search

+14 -14
View File
@@ -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)
}
}