Skip to content

Commit 3cc3178

Browse files
committed
multi: update independent usages of lnd/fn to lnd/fn/v2
To reduce the size of the diff in the next commit, we update all usages of the lnd fn package where they are independent from lnd (meaning we don't use the results to interact with lnd). Anywhere we interact with lnd, we need to use the same version as lnd, so we'll need to do it in the next commit where we bump the lnd dependency.
1 parent 3cbf805 commit 3cc3178

File tree

13 files changed

+19
-15
lines changed

13 files changed

+19
-15
lines changed

cmd/commands/commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
tap "github.com/lightninglabs/taproot-assets"
1111
"github.com/lightninglabs/taproot-assets/taprpc"
12-
lfn "github.com/lightningnetwork/lnd/fn"
12+
lfn "github.com/lightningnetwork/lnd/fn/v2"
1313
"github.com/lightningnetwork/lnd/signal"
1414
"github.com/urfave/cli"
1515
"google.golang.org/protobuf/proto"

fn/func.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package fn
33
import (
44
"fmt"
55

6-
"github.com/lightningnetwork/lnd/fn"
6+
"github.com/lightningnetwork/lnd/fn/v2"
77
)
88

99
// Reducer represents a function that takes an accumulator and the value, then

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ require (
3232
github.com/lightningnetwork/lnd/cert v1.2.2
3333
github.com/lightningnetwork/lnd/clock v1.1.1
3434
github.com/lightningnetwork/lnd/fn v1.2.3
35+
github.com/lightningnetwork/lnd/fn/v2 v2.0.8
3536
github.com/lightningnetwork/lnd/tlv v1.2.6
3637
github.com/lightningnetwork/lnd/tor v1.1.2
3738
github.com/ory/dockertest/v3 v3.10.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsD
506506
github.com/lightningnetwork/lnd/clock v1.1.1/go.mod h1:mGnAhPyjYZQJmebS7aevElXKTFDuO+uNFFfMXK1W8xQ=
507507
github.com/lightningnetwork/lnd/fn v1.2.3 h1:Q1OrgNSgQynVheBNa16CsKVov1JI5N2AR6G07x9Mles=
508508
github.com/lightningnetwork/lnd/fn v1.2.3/go.mod h1:SyFohpVrARPKH3XVAJZlXdVe+IwMYc4OMAvrDY32kw0=
509+
github.com/lightningnetwork/lnd/fn/v2 v2.0.8 h1:r2SLz7gZYQPVc3IZhU82M66guz3Zk2oY+Rlj9QN5S3g=
510+
github.com/lightningnetwork/lnd/fn/v2 v2.0.8/go.mod h1:TOzwrhjB/Azw1V7aa8t21ufcQmdsQOQMDtxVOQWNl8s=
509511
github.com/lightningnetwork/lnd/healthcheck v1.2.5 h1:aTJy5xeBpcWgRtW/PGBDe+LMQEmNm/HQewlQx2jt7OA=
510512
github.com/lightningnetwork/lnd/healthcheck v1.2.5/go.mod h1:G7Tst2tVvWo7cx6mSBEToQC5L1XOGxzZTPB29g9Rv2I=
511513
github.com/lightningnetwork/lnd/kvdb v1.4.10 h1:vK89IVv1oVH9ubQWU+EmoCQFeVRaC8kfmOrqHbY5zoY=

internal/pedersen/commitment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"crypto/sha256"
55

66
"github.com/btcsuite/btcd/btcec/v2"
7-
"github.com/lightningnetwork/lnd/fn"
7+
"github.com/lightningnetwork/lnd/fn/v2"
88
"github.com/lightningnetwork/lnd/input"
99
)
1010

internal/pedersen/commitment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66

77
"github.com/btcsuite/btcd/btcec/v2"
8-
"github.com/lightningnetwork/lnd/fn"
8+
"github.com/lightningnetwork/lnd/fn/v2"
99
"github.com/stretchr/testify/require"
1010
"pgregory.net/rapid"
1111
)

itest/tapd_harness.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
tchrpc "github.com/lightninglabs/taproot-assets/taprpc/tapchannelrpc"
2828
"github.com/lightninglabs/taproot-assets/taprpc/tapdevrpc"
2929
"github.com/lightninglabs/taproot-assets/taprpc/universerpc"
30-
lfn "github.com/lightningnetwork/lnd/fn"
30+
lfn "github.com/lightningnetwork/lnd/fn/v2"
3131
"github.com/lightningnetwork/lnd/lnrpc"
3232
"github.com/lightningnetwork/lnd/lntest/node"
3333
"github.com/lightningnetwork/lnd/lntest/wait"

proof/proof_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import (
1313
"testing"
1414
"time"
1515

16-
lfn "github.com/lightningnetwork/lnd/fn"
17-
1816
"github.com/btcsuite/btcd/blockchain"
1917
"github.com/btcsuite/btcd/btcec/v2"
2018
"github.com/btcsuite/btcd/btcutil"
@@ -29,6 +27,7 @@ import (
2927
"github.com/lightninglabs/taproot-assets/fn"
3028
"github.com/lightninglabs/taproot-assets/internal/test"
3129
"github.com/lightningnetwork/lnd/build"
30+
lfn "github.com/lightningnetwork/lnd/fn/v2"
3231
"github.com/lightningnetwork/lnd/tlv"
3332
"github.com/stretchr/testify/require"
3433
"pgregory.net/rapid"

proof/verifier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/lightninglabs/taproot-assets/commitment"
1818
"github.com/lightninglabs/taproot-assets/fn"
1919
"github.com/lightninglabs/taproot-assets/vm"
20-
lfn "github.com/lightningnetwork/lnd/fn"
20+
lfn "github.com/lightningnetwork/lnd/fn/v2"
2121
"golang.org/x/exp/maps"
2222
"golang.org/x/sync/errgroup"
2323
)

rfq/manager.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/lightninglabs/taproot-assets/asset"
1414
"github.com/lightninglabs/taproot-assets/fn"
1515
"github.com/lightninglabs/taproot-assets/rfqmsg"
16-
lfn "github.com/lightningnetwork/lnd/fn"
16+
lfn "github.com/lightningnetwork/lnd/fn/v2"
1717
"github.com/lightningnetwork/lnd/lnutils"
1818
"github.com/lightningnetwork/lnd/lnwire"
1919
"github.com/lightningnetwork/lnd/routing/route"
@@ -554,9 +554,11 @@ func (m *Manager) addScidAlias(scidAlias uint64, assetSpecifier asset.Specifier,
554554
}
555555

556556
// Filter for channels with the given peer.
557-
peerChannels := lfn.Filter(func(c lndclient.ChannelInfo) bool {
558-
return c.PubKeyBytes == peer
559-
}, localChans)
557+
peerChannels := lfn.Filter(
558+
localChans, func(c lndclient.ChannelInfo) bool {
559+
return c.PubKeyBytes == peer
560+
},
561+
)
560562

561563
var baseSCID uint64
562564
for _, localChan := range peerChannels {

0 commit comments

Comments
 (0)