multi: move many t.Fatalf calls to require.NoError

This commit is contained in:
Tommy Volk
2022-05-05 20:11:50 +00:00
parent 9e6f0ef46b
commit 9a10c80bcb
92 changed files with 1905 additions and 5565 deletions

View File

@@ -87,9 +87,7 @@ func TestSentPaymentSerialization(t *testing.T) {
}
newCreationInfo, err := deserializePaymentCreationInfo(&b)
if err != nil {
t.Fatalf("unable to deserialize creation info: %v", err)
}
require.NoError(t, err, "unable to deserialize creation info")
if !reflect.DeepEqual(c, newCreationInfo) {
t.Fatalf("Payments do not match after "+
@@ -104,9 +102,7 @@ func TestSentPaymentSerialization(t *testing.T) {
}
newWireInfo, err := deserializeHTLCAttemptInfo(&b)
if err != nil {
t.Fatalf("unable to deserialize info: %v", err)
}
require.NoError(t, err, "unable to deserialize info")
newWireInfo.AttemptID = s.AttemptID
// First we verify all the records match up porperly, as they aren't
@@ -673,9 +669,7 @@ func appendDuplicatePayment(t *testing.T, db *DB, paymentHash lntypes.Hash,
return nil
}, func() {})
if err != nil {
t.Fatalf("could not create payment: %v", err)
}
require.NoError(t, err, "could not create payment")
}
// putDuplicatePayment creates a duplicate payment in the duplicates bucket