routing: rename Fail to FailPayment

This commit renames the method `Fail` to be `FailPayment` to explicitly
address its purpose.
This commit is contained in:
yyforyongyu
2022-06-10 00:50:54 +08:00
parent 2fd4c1e318
commit d1611c999a
6 changed files with 27 additions and 22 deletions

View File

@@ -3896,7 +3896,7 @@ func TestSendMPPaymentFailed(t *testing.T) {
})
// Simple mocking the rest.
controlTower.On("Fail", identifier, failureReason).Return(nil)
controlTower.On("FailPayment", identifier, failureReason).Return(nil)
payer.On("SendHTLC",
mock.Anything, mock.Anything, mock.Anything,
).Return(nil)
@@ -4091,7 +4091,7 @@ func TestSendMPPaymentFailedWithShardsInFlight(t *testing.T) {
// Simple mocking the rest.
cntFail := 0
controlTower.On("Fail", identifier, failureReason).Return(nil)
controlTower.On("FailPayment", identifier, failureReason).Return(nil)
payer.On("SendHTLC",
mock.Anything, mock.Anything, mock.Anything,
).Return(nil).Run(func(args mock.Arguments) {
@@ -4412,7 +4412,7 @@ func TestSendToRouteSkipTempErrPermanentFailure(t *testing.T) {
).Return(testAttempt, nil)
// Expect the payment to be failed.
controlTower.On("Fail", payHash, mock.Anything).Return(nil)
controlTower.On("FailPayment", payHash, mock.Anything).Return(nil)
payer.On("SendHTLC",
mock.Anything, mock.Anything, mock.Anything,
@@ -4501,7 +4501,7 @@ func TestSendToRouteTempFailure(t *testing.T) {
).Return(testAttempt, nil)
// Expect the payment to be failed.
controlTower.On("Fail", payHash, mock.Anything).Return(nil)
controlTower.On("FailPayment", payHash, mock.Anything).Return(nil)
payer.On("SendHTLC",
mock.Anything, mock.Anything, mock.Anything,