channeldb: final htlc resolution storage opt-in

This commit is contained in:
Joost Jager
2023-01-19 13:04:43 +01:00
parent b50d59ec2e
commit 7a785c74c4
10 changed files with 85 additions and 27 deletions

View File

@ -106,8 +106,9 @@ var (
// allocated to each side. Within the channel, Alice is the initiator. If
// tweaklessCommits is true, then the commits within the channels will use the
// new format, otherwise the legacy format.
func CreateTestChannels(t *testing.T, chanType channeldb.ChannelType) (
*LightningChannel, *LightningChannel, error) {
func CreateTestChannels(t *testing.T, chanType channeldb.ChannelType,
dbModifiers ...channeldb.OptionModifier) (*LightningChannel,
*LightningChannel, error) {
channelCapacity, err := btcutil.NewAmount(testChannelCapacity)
if err != nil {
@ -228,7 +229,7 @@ func CreateTestChannels(t *testing.T, chanType channeldb.ChannelType) (
return nil, nil, err
}
dbAlice, err := channeldb.Open(t.TempDir())
dbAlice, err := channeldb.Open(t.TempDir(), dbModifiers...)
if err != nil {
return nil, nil, err
}
@ -236,7 +237,7 @@ func CreateTestChannels(t *testing.T, chanType channeldb.ChannelType) (
require.NoError(t, dbAlice.Close())
})
dbBob, err := channeldb.Open(t.TempDir())
dbBob, err := channeldb.Open(t.TempDir(), dbModifiers...)
if err != nil {
return nil, nil, err
}