Skip to content

Commit

Permalink
multi: fix linter issues, run imports
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Nov 21, 2022
1 parent 58bb9e4 commit 71bb06f
Show file tree
Hide file tree
Showing 32 changed files with 45 additions and 78 deletions.
5 changes: 2 additions & 3 deletions accounting/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import (

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/routing/route"

"github.com/lightninglabs/faraday/fees"
"github.com/lightninglabs/faraday/fiat"
"github.com/lightninglabs/faraday/lndwrap"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/routing/route"
)

// decodePaymentRequest is a signature for decoding payment requests.
Expand Down
1 change: 0 additions & 1 deletion accounting/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"time"

"github.com/btcsuite/btcd/btcutil"

"github.com/lightninglabs/faraday/fiat"
"github.com/lightninglabs/faraday/utils"
)
Expand Down
4 changes: 1 addition & 3 deletions accounting/entries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import (
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/lightninglabs/faraday/fiat"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/routing/route"
"github.com/shopspring/decimal"
"github.com/stretchr/testify/require"

"github.com/lightninglabs/faraday/fiat"
)

var (
Expand Down Expand Up @@ -222,7 +221,6 @@ func TestChannelOpenEntry(t *testing.T) {
Credit: credit,
BTCPrice: mockBTCPrice,
}

}

feeAmt := satsToMsat(channelFeesSats)
Expand Down
1 change: 0 additions & 1 deletion accounting/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ func TestFilterOnChain(t *testing.T) {
expctedAmount := payment.Amount + payment.Fee

require.Equal(t, expctedAmount, filtered[0].Amount)

}

// TestFilterInvoices tests filtering out of invoices that are not settled.
Expand Down
3 changes: 1 addition & 2 deletions accounting/on_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/wire"
"github.com/lightninglabs/faraday/utils"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/routing/route"

"github.com/lightninglabs/faraday/utils"
)

// OnChainReport produces a report of our on chain activity for a period using
Expand Down
3 changes: 1 addition & 2 deletions accounting/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"fmt"
"time"

"github.com/lightninglabs/faraday/fiat"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/shopspring/decimal"

"github.com/lightninglabs/faraday/fiat"
)

// Report contains a set of entries.
Expand Down
3 changes: 1 addition & 2 deletions cmd/frcli/channel_insights.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package main
import (
"context"

"github.com/urfave/cli"

"github.com/lightninglabs/faraday/frdrpc"
"github.com/urfave/cli"
)

var channelInsightsCommand = cli.Command{
Expand Down
3 changes: 1 addition & 2 deletions cmd/frcli/close_recommendations.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
"fmt"
"time"

"github.com/urfave/cli"

"github.com/lightninglabs/faraday/frdrpc"
"github.com/urfave/cli"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions cmd/frcli/close_reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package main
import (
"context"

"github.com/urfave/cli"

"github.com/lightninglabs/faraday/frdrpc"
"github.com/urfave/cli"
)

var closeReportCommand = cli.Command{
Expand Down
5 changes: 2 additions & 3 deletions cmd/frcli/fiat_estimate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import (
"fmt"
"time"

"github.com/lightninglabs/faraday/fiat"
"github.com/lightninglabs/faraday/frdrpc"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/shopspring/decimal"
"github.com/urfave/cli"

"github.com/lightninglabs/faraday/fiat"
"github.com/lightninglabs/faraday/frdrpc"
)

var fiatBackendFlag = cli.StringFlag{
Expand Down
3 changes: 1 addition & 2 deletions cmd/frcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package main
import (
"os"

"github.com/urfave/cli"

"github.com/lightninglabs/faraday"
"github.com/urfave/cli"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions cmd/frcli/node_audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (
"strings"
"time"

"github.com/urfave/cli"

"github.com/lightninglabs/faraday/frdrpc"
"github.com/urfave/cli"
)

var onChainReportCommand = cli.Command{
Expand Down
3 changes: 1 addition & 2 deletions cmd/frcli/revenue_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package main
import (
"context"

"github.com/urfave/cli"

"github.com/lightninglabs/faraday/frdrpc"
"github.com/urfave/cli"
)

var revenueReportCommand = cli.Command{
Expand Down
10 changes: 4 additions & 6 deletions cmd/frcli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import (
"strings"
"time"

"github.com/lightninglabs/faraday/utils"

"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/lightninglabs/faraday"
"github.com/lightninglabs/faraday/fiat"
"github.com/lightninglabs/faraday/frdrpc"
"github.com/lightninglabs/faraday/utils"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/protobuf-hex-display/jsonpb"
"github.com/lightninglabs/protobuf-hex-display/proto"
Expand All @@ -28,10 +30,6 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"gopkg.in/macaroon.v2"

"github.com/lightninglabs/faraday"
"github.com/lightninglabs/faraday/fiat"
"github.com/lightninglabs/faraday/frdrpc"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ import (
"time"

"github.com/btcsuite/btcd/btcutil"
"github.com/lightninglabs/faraday/chain"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/cert"
"github.com/lightningnetwork/lnd/lncfg"
"github.com/lightningnetwork/lnd/lnrpc"
"google.golang.org/grpc/credentials"

"github.com/lightninglabs/faraday/chain"
)

const (
Expand Down
5 changes: 2 additions & 3 deletions faraday.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ import (
"strings"

"github.com/jessevdk/go-flags"
"github.com/lightninglabs/faraday/chain"
"github.com/lightninglabs/faraday/frdrpcserver"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/build"
"github.com/lightningnetwork/lnd/lnrpc/verrpc"
"github.com/lightningnetwork/lnd/signal"

"github.com/lightninglabs/faraday/chain"
"github.com/lightninglabs/faraday/frdrpcserver"
)

// MinLndVersion is the minimum lnd version required. Note that apis that are
Expand Down
3 changes: 1 addition & 2 deletions fiat/prices.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import (
"sort"
"time"

"github.com/lightninglabs/faraday/utils"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/shopspring/decimal"

"github.com/lightninglabs/faraday/utils"
)

var (
Expand Down
1 change: 0 additions & 1 deletion fiat/prices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,5 @@ func TestValidatePriceSourceConfig(t *testing.T) {
test.expectedErr, err)
}
})

}
}
3 changes: 1 addition & 2 deletions frdrpcserver/close_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/lightninglabs/lndclient"

"github.com/lightninglabs/faraday/fees"
"github.com/lightninglabs/faraday/frdrpc"
"github.com/lightninglabs/faraday/resolutions"
"github.com/lightninglabs/lndclient"
)

func parseCloseReportRequest(ctx context.Context, cfg *Config) *resolutions.Config {
Expand Down
5 changes: 2 additions & 3 deletions frdrpcserver/node_audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"sort"
"time"

"github.com/lightningnetwork/lnd/routing/route"
"github.com/shopspring/decimal"

"github.com/lightninglabs/faraday/accounting"
"github.com/lightninglabs/faraday/fees"
"github.com/lightninglabs/faraday/fiat"
"github.com/lightninglabs/faraday/frdrpc"
"github.com/lightningnetwork/lnd/routing/route"
"github.com/shopspring/decimal"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions frdrpcserver/revenue_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import (
"context"
"time"

"github.com/lightninglabs/lndclient"

"github.com/lightninglabs/faraday/frdrpc"
"github.com/lightninglabs/faraday/lndwrap"
"github.com/lightninglabs/faraday/revenue"
"github.com/lightninglabs/lndclient"
)

// parseRevenueRequest parses a request for a revenue report and wraps
Expand Down
15 changes: 6 additions & 9 deletions frdrpcserver/rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ import (
"sync/atomic"

proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/macaroons"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/protobuf/encoding/protojson"
"gopkg.in/macaroon-bakery.v2/bakery"

"github.com/lightninglabs/faraday/accounting"
"github.com/lightninglabs/faraday/chain"
"github.com/lightninglabs/faraday/fiat"
Expand All @@ -36,6 +29,12 @@ import (
"github.com/lightninglabs/faraday/recommend"
"github.com/lightninglabs/faraday/resolutions"
"github.com/lightninglabs/faraday/revenue"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/macaroons"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/protobuf/encoding/protojson"
"gopkg.in/macaroon-bakery.v2/bakery"
)

var (
Expand Down Expand Up @@ -234,7 +233,6 @@ func (s *RPCServer) Start() error {
if err != nil {
return fmt.Errorf("RPC RPCServer unable to listen on %v",
s.cfg.RPCListen)

}
shutdownFuncs["gRPC listener"] = s.rpcListener.Close
log.Infof("gRPC server listening on %s", s.rpcListener.Addr())
Expand All @@ -249,7 +247,6 @@ func (s *RPCServer) Start() error {
if err != nil {
return fmt.Errorf("REST server unable to listen on "+
"%v: %v", s.cfg.RESTListen, err)

}
restListener = tls.NewListener(
restListener, s.cfg.TLSServerConfig,
Expand Down
3 changes: 1 addition & 2 deletions insights/insights.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package insights
import (
"time"

"github.com/lightninglabs/faraday/revenue"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/lnwire"

"github.com/lightninglabs/faraday/revenue"
)

// ChannelInfo provides a set of performance metrics for a lightning channel.
Expand Down
4 changes: 1 addition & 3 deletions insights/insights_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import (
"testing"
"time"

"github.com/lightninglabs/faraday/revenue"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/lnwire"

"github.com/lightninglabs/faraday/revenue"
)

// TestGetChannels tests gathering of channel insights from a set of lnrpc
Expand Down Expand Up @@ -144,7 +143,6 @@ func TestGetChannels(t *testing.T) {
insight, insights[i])
}
}

})
}
}
7 changes: 3 additions & 4 deletions itest/nodereport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ import (

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/lightninglabs/faraday/accounting"
"github.com/lightninglabs/faraday/fees"
"github.com/lightninglabs/faraday/frdrpc"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/stretchr/testify/require"

"github.com/lightninglabs/faraday/accounting"
"github.com/lightninglabs/faraday/fees"
"github.com/lightninglabs/faraday/frdrpc"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions itest/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import (
"io/ioutil"

"github.com/btcsuite/btcd/rpcclient"
"github.com/lightninglabs/faraday/frdrpc"
"github.com/lightningnetwork/lnd/macaroons"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"gopkg.in/macaroon.v2"

"github.com/lightninglabs/faraday/frdrpc"
)

// getBitcoindClient returns an rpc client connection to the running bitcoind
Expand Down
Loading

0 comments on commit 71bb06f

Please sign in to comment.