mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
Merge pull request #6636 from tvolk131/migrate_assert_to_require
Migrate assert.NoError to require.NoError
This commit is contained in:
commit
341fde723b
5 changed files with 11 additions and 7 deletions
|
@ -10,7 +10,6 @@ import (
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/btcsuite/btcd/wire"
|
||||||
"github.com/lightninglabs/neutrino/cache"
|
"github.com/lightninglabs/neutrino/cache"
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -173,10 +172,10 @@ func TestBlockCacheMutexes(t *testing.T) {
|
||||||
go func(e int) {
|
go func(e int) {
|
||||||
if e%2 == 0 {
|
if e%2 == 0 {
|
||||||
_, err := bc.GetBlock(&blockhash1, getBlockImpl)
|
_, err := bc.GetBlock(&blockhash1, getBlockImpl)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
} else {
|
} else {
|
||||||
_, err := bc.GetBlock(&blockhash2, getBlockImpl)
|
_, err := bc.GetBlock(&blockhash2, getBlockImpl)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.Done()
|
wg.Done()
|
||||||
|
|
|
@ -87,7 +87,7 @@ func TestPaymentControlSwitchFail(t *testing.T) {
|
||||||
// Lookup the payment so we can get its old sequence number before it is
|
// Lookup the payment so we can get its old sequence number before it is
|
||||||
// overwritten.
|
// overwritten.
|
||||||
payment, err := pControl.FetchPayment(info.PaymentIdentifier)
|
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
|
// Sends the htlc again, which should succeed since the prior payment
|
||||||
// failed.
|
// failed.
|
||||||
|
|
|
@ -87,5 +87,5 @@ func TestTickSignal(t *testing.T) {
|
||||||
|
|
||||||
// Once the ticker is registered, set the time to make it fire.
|
// Once the ticker is registered, set the time to make it fire.
|
||||||
c.SetTime(testTime.Add(time.Second))
|
c.SetTime(testTime.Add(time.Second))
|
||||||
assert.NoError(t, <-err)
|
require.NoError(t, <-err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,12 @@
|
||||||
* [The HtlcSwitch now waits for a ChannelLink to stop before replacing it. This fixes a race
|
* [The HtlcSwitch now waits for a ChannelLink to stop before replacing it. This fixes a race
|
||||||
condition.](https://github.com/lightningnetwork/lnd/pull/6642)
|
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)
|
# Contributors (Alphabetical Order)
|
||||||
|
|
||||||
* Carsten Otto
|
* Carsten Otto
|
||||||
|
|
|
@ -19,7 +19,6 @@ import (
|
||||||
"github.com/lightningnetwork/lnd/lnwallet/chancloser"
|
"github.com/lightningnetwork/lnd/lnwallet/chancloser"
|
||||||
"github.com/lightningnetwork/lnd/lnwire"
|
"github.com/lightningnetwork/lnd/lnwire"
|
||||||
"github.com/lightningnetwork/lnd/pool"
|
"github.com/lightningnetwork/lnd/pool"
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1078,7 +1077,7 @@ func TestPeerCustomMessage(t *testing.T) {
|
||||||
)
|
)
|
||||||
var b bytes.Buffer
|
var b bytes.Buffer
|
||||||
_, err = lnwire.WriteMessage(&b, initReplyMsg, 0)
|
_, err = lnwire.WriteMessage(&b, initReplyMsg, 0)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
mockConn.readMessages <- b.Bytes()
|
mockConn.readMessages <- b.Bytes()
|
||||||
}()
|
}()
|
||||||
|
|
Loading…
Add table
Reference in a new issue