Merge pull request #6636 from tvolk131/migrate_assert_to_require

Migrate assert.NoError to require.NoError
This commit is contained in:
Oliver Gugger 2022-07-05 19:16:41 +02:00 committed by GitHub
commit 341fde723b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 7 deletions

View file

@ -10,7 +10,6 @@ import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/lightninglabs/neutrino/cache"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@ -173,10 +172,10 @@ func TestBlockCacheMutexes(t *testing.T) {
go func(e int) {
if e%2 == 0 {
_, err := bc.GetBlock(&blockhash1, getBlockImpl)
assert.NoError(t, err)
require.NoError(t, err)
} else {
_, err := bc.GetBlock(&blockhash2, getBlockImpl)
assert.NoError(t, err)
require.NoError(t, err)
}
wg.Done()

View file

@ -87,7 +87,7 @@ func TestPaymentControlSwitchFail(t *testing.T) {
// Lookup the payment so we can get its old sequence number before it is
// overwritten.
payment, err := pControl.FetchPayment(info.PaymentIdentifier)
assert.NoError(t, err)
require.NoError(t, err)
// Sends the htlc again, which should succeed since the prior payment
// failed.

View file

@ -87,5 +87,5 @@ func TestTickSignal(t *testing.T) {
// Once the ticker is registered, set the time to make it fire.
c.SetTime(testTime.Add(time.Second))
assert.NoError(t, <-err)
require.NoError(t, <-err)
}

View file

@ -56,6 +56,12 @@
* [The HtlcSwitch now waits for a ChannelLink to stop before replacing it. This fixes a race
condition.](https://github.com/lightningnetwork/lnd/pull/6642)
## Code Health
### Code cleanup, refactor, typo fixes
* [Migrate instances of assert.NoError to require.NoError](https://github.com/lightningnetwork/lnd/pull/6636).
# Contributors (Alphabetical Order)
* Carsten Otto

View file

@ -19,7 +19,6 @@ import (
"github.com/lightningnetwork/lnd/lnwallet/chancloser"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/pool"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@ -1078,7 +1077,7 @@ func TestPeerCustomMessage(t *testing.T) {
)
var b bytes.Buffer
_, err = lnwire.WriteMessage(&b, initReplyMsg, 0)
assert.NoError(t, err)
require.NoError(t, err)
mockConn.readMessages <- b.Bytes()
}()