mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-25 19:46:52 +02:00
multi: migrate assert.NoError to require.NoError
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
@@ -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()
|
||||||
}()
|
}()
|
||||||
|
Reference in New Issue
Block a user