multi: make NewChanIDFromOutpoint accept value instead of pointer

This commit is contained in:
Keagan McClelland committed 2024-03-08 15:47:55 -08:00
1 parent fd1cd315ce
commit db39a905cb
27 files changed
+108 -106

No files matched your search

+4 -4
View File
@@ -140,7 +140,7 @@ func TestFetchClosedChannelForID(t *testing.T) {
state.FundingOutpoint.Index = i
// We calculate the ChannelID and use it to fetch the summary.
cid := lnwire.NewChanIDFromOutPoint(&state.FundingOutpoint)
cid := lnwire.NewChanIDFromOutPoint(state.FundingOutpoint)
fetchedSummary, err := cdb.FetchClosedChannelForID(cid)
if err != nil {
t.Fatalf("unable to fetch close summary: %v", err)
@@ -158,7 +158,7 @@ func TestFetchClosedChannelForID(t *testing.T) {
// As a final test we make sure that we get ErrClosedChannelNotFound
// for a ChannelID we didn't add to the DB.
state.FundingOutpoint.Index++
cid := lnwire.NewChanIDFromOutPoint(&state.FundingOutpoint)
cid := lnwire.NewChanIDFromOutPoint(state.FundingOutpoint)
_, err = cdb.FetchClosedChannelForID(cid)
if err != ErrClosedChannelNotFound {
t.Fatalf("expected ErrClosedChannelNotFound, instead got: %v", err)
@@ -240,7 +240,7 @@ func TestFetchChannel(t *testing.T) {
require.Equal(t, channelState, dbChannel)
// Next, attempt to fetch the channel by its channel ID.
chanID := lnwire.NewChanIDFromOutPoint(&channelState.FundingOutpoint)
chanID := lnwire.NewChanIDFromOutPoint(channelState.FundingOutpoint)
dbChannel, err = cdb.FetchChannelByID(nil, chanID)
require.NoError(t, err, "unable to fetch channel")
@@ -259,7 +259,7 @@ func TestFetchChannel(t *testing.T) {
_, err = cdb.FetchChannel(nil, channelState2.FundingOutpoint)
require.ErrorIs(t, err, ErrChannelNotFound)
chanID2 := lnwire.NewChanIDFromOutPoint(&channelState2.FundingOutpoint)
chanID2 := lnwire.NewChanIDFromOutPoint(channelState2.FundingOutpoint)
_, err = cdb.FetchChannelByID(nil, chanID2)
require.ErrorIs(t, err, ErrChannelNotFound)
}