sweep: remove redundant error from Broadcast

This commit is contained in:
yyforyongyu
2024-04-30 17:39:45 +08:00
committed by yyforyongyu
parent 77ff2c0585
commit 719ca5b229
5 changed files with 16 additions and 35 deletions

View File

@@ -978,8 +978,7 @@ func TestBroadcast(t *testing.T) {
}
// Send the req and expect no error.
resultChan, err := tp.Broadcast(req)
require.NoError(t, err)
resultChan := tp.Broadcast(req)
require.NotNil(t, resultChan)
// Validate the record was stored.
@@ -1029,8 +1028,7 @@ func TestBroadcastImmediate(t *testing.T) {
chainfee.SatPerKWeight(0), errDummy).Once()
// Send the req and expect no error.
resultChan, err := tp.Broadcast(req)
require.NoError(t, err)
resultChan := tp.Broadcast(req)
require.NotNil(t, resultChan)
// Validate the record was removed due to an error returned in initial
@@ -1541,8 +1539,7 @@ func TestHandleInitialBroadcastSuccess(t *testing.T) {
}
// Register the testing record use `Broadcast`.
resultChan, err := tp.Broadcast(req)
require.NoError(t, err)
resultChan := tp.Broadcast(req)
// Grab the monitor record from the map.
rid := tp.requestCounter.Load()
@@ -1613,8 +1610,7 @@ func TestHandleInitialBroadcastFail(t *testing.T) {
mock.Anything).Return(errDummy).Once()
// Register the testing record use `Broadcast`.
resultChan, err := tp.Broadcast(req)
require.NoError(t, err)
resultChan := tp.Broadcast(req)
// Grab the monitor record from the map.
rid := tp.requestCounter.Load()
@@ -1647,8 +1643,7 @@ func TestHandleInitialBroadcastFail(t *testing.T) {
mock.Anything, mock.Anything).Return(errDummy).Once()
// Register the testing record use `Broadcast`.
resultChan, err = tp.Broadcast(req)
require.NoError(t, err)
resultChan = tp.Broadcast(req)
// Grab the monitor record from the map.
rid = tp.requestCounter.Load()