multi: move many t.Fatalf calls to require.NoError
This commit is contained in:
1 parent
9e6f0ef46b
commit
9a10c80bcb
92 files changed
+1905
-5565
No files matched your search
+2
-3
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TestStore asserts that the store persists the presented data to disk and is
|
||||
@@ -125,9 +126,7 @@ func testStore(t *testing.T, createStore func() (SweeperStore, error)) {
|
||||
}
|
||||
|
||||
txns, err := store.ListSweeps()
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
require.NoError(t, err, "unexpected error")
|
||||
|
||||
// Create a map containing the sweeps we expect to be returned by list
|
||||
// sweeps.
|
||||
|
||||
@@ -1237,9 +1237,7 @@ func TestBumpFeeRBF(t *testing.T) {
|
||||
bumpResult, err := ctx.sweeper.UpdateParams(
|
||||
*input.OutPoint(), ParamsUpdate{Fee: highFeePref},
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to bump input's fee: %v", err)
|
||||
}
|
||||
require.NoError(t, err, "unable to bump input's fee")
|
||||
|
||||
// A higher fee rate transaction should be immediately broadcast.
|
||||
ctx.tick()
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lntest/mock"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TestDetermineFeePerKw tests that given a fee preference, the
|
||||
@@ -352,9 +353,7 @@ func TestCraftSweepAllTx(t *testing.T) {
|
||||
0, 10, nil, deliveryAddr, coinSelectLocker, utxoSource,
|
||||
utxoLocker, feeEstimator, signer, 0,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to make sweep tx: %v", err)
|
||||
}
|
||||
require.NoError(t, err, "unable to make sweep tx")
|
||||
|
||||
// At this point, all of the UTXOs that we made above should be locked
|
||||
// and none of them unlocked.
|
||||
|
||||
Reference in new issue
Block a user