mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
multi: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -409,7 +409,6 @@ type nurseryTestContext struct {
|
||||
sweeper *mockSweeperFull
|
||||
timeoutChan chan chan time.Time
|
||||
t *testing.T
|
||||
dbCleanup func()
|
||||
}
|
||||
|
||||
func createNurseryTestContext(t *testing.T,
|
||||
@@ -419,7 +418,7 @@ func createNurseryTestContext(t *testing.T,
|
||||
// alternative, mocking nurseryStore, is not chosen because there is
|
||||
// still considerable logic in the store.
|
||||
|
||||
cdb, cleanup, err := channeldb.MakeTestDB()
|
||||
cdb, err := channeldb.MakeTestDB(t)
|
||||
require.NoError(t, err, "unable to open channeldb")
|
||||
|
||||
store, err := NewNurseryStore(&chainhash.Hash{}, cdb)
|
||||
@@ -480,7 +479,6 @@ func createNurseryTestContext(t *testing.T,
|
||||
sweeper: sweeper,
|
||||
timeoutChan: timeoutChan,
|
||||
t: t,
|
||||
dbCleanup: cleanup,
|
||||
}
|
||||
|
||||
ctx.receiveTx = func() wire.MsgTx {
|
||||
@@ -528,8 +526,6 @@ func (ctx *nurseryTestContext) notifyEpoch(height int32) {
|
||||
}
|
||||
|
||||
func (ctx *nurseryTestContext) finish() {
|
||||
defer ctx.dbCleanup()
|
||||
|
||||
// Add a final restart point in this state
|
||||
ctx.restart()
|
||||
|
||||
|
Reference in New Issue
Block a user