mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
multi: fix linter issues
This commit is contained in:
parent
f0bf9302cc
commit
a1271fee40
18 changed files with 10 additions and 21 deletions
|
|
@ -476,7 +476,6 @@ func setParams(ctx *cli.Context) error {
|
|||
// so that it does not need to be manually updated.
|
||||
case categoriesSet:
|
||||
params.FeePpm = 0
|
||||
|
||||
}
|
||||
// Update our parameters to our mutated values.
|
||||
_, err = client.SetLiquidityParams(
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ func loopOut(ctx *cli.Context) error {
|
|||
}
|
||||
|
||||
// Show a warning if a slow swap was requested.
|
||||
warning := ""
|
||||
var warning string
|
||||
if fast {
|
||||
warning = "Fast swap requested."
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ func listAuth(ctx *cli.Context) error {
|
|||
|
||||
tokens := make([]*printableToken, len(resp.Tokens))
|
||||
for i, t := range resp.Tokens {
|
||||
|
||||
mac := &macaroon.Macaroon{}
|
||||
err := mac.UnmarshalBinary(t.BaseMacaroon)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ func swapInfo(ctx *cli.Context) error {
|
|||
id = ctx.String("id")
|
||||
case ctx.NArg() > 0:
|
||||
id = args[0]
|
||||
args = args.Tail()
|
||||
args = args.Tail() // nolint:wastedassign
|
||||
default:
|
||||
// Show command help if no arguments and flags were provided.
|
||||
return cli.ShowCommandHelp(ctx, "swapinfo")
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ type LoopInSwapInfo struct { // nolint
|
|||
|
||||
// LoopOutSwapInfo contains essential information of a loop-out swap after the
|
||||
// swap is initiated.
|
||||
type LoopOutSwapInfo struct { // nolint:golint
|
||||
type LoopOutSwapInfo struct { // nolint:revive
|
||||
// SwapHash contains the sha256 hash of the swap preimage.
|
||||
SwapHash lntypes.Hash
|
||||
|
||||
|
|
|
|||
|
|
@ -262,7 +262,6 @@ func (p Parameters) String() string {
|
|||
ruleList = append(
|
||||
ruleList, fmt.Sprintf("Peer: %v: %v", peer, rule),
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
return fmt.Sprintf("rules: %v, failure backoff: %v, sweep "+
|
||||
|
|
|
|||
|
|
@ -1409,7 +1409,6 @@ func TestSizeRestrictions(t *testing.T) {
|
|||
Maximum: 6000,
|
||||
}, nil,
|
||||
).Once()
|
||||
|
||||
},
|
||||
suggestions: nil,
|
||||
expectedError: ErrMaxExceedsServer,
|
||||
|
|
@ -1582,7 +1581,6 @@ func TestFeePercentage(t *testing.T) {
|
|||
error) {
|
||||
|
||||
return testCase.quote, nil
|
||||
|
||||
}
|
||||
|
||||
lnd.Channels = []lndclient.ChannelInfo{
|
||||
|
|
|
|||
|
|
@ -152,7 +152,6 @@ func calculateSwapAmount(targetAmount, reserveAmount,
|
|||
// cannot take any further action.
|
||||
case reserveAmount <= reserveMinimum:
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
// Express our minimum reserve amount as a maximum target amount.
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ func NewListenerConfig(config *Config, rpcCfg RPCConfig) *ListenerCfg {
|
|||
if rpcCfg.LndConn != nil {
|
||||
svcCfg.Dialer = func(context.Context, string) (
|
||||
net.Conn, error) {
|
||||
|
||||
return rpcCfg.LndConn, nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -936,7 +936,6 @@ func rpcToRule(rule *clientrpc.LiquidityRule) (*liquidity.SwapRule, error) {
|
|||
default:
|
||||
return nil, fmt.Errorf("unknown rule: %T", rule)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// SuggestSwaps provides a list of suggested swaps based on lnd's current
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import (
|
|||
// "human-readable": Hex("102030"),
|
||||
// Hex("1111"): Hex("5783492373"),
|
||||
// },
|
||||
// }
|
||||
// } .
|
||||
func DumpDB(tx *bbolt.Tx) error { // nolint: unused
|
||||
return tx.ForEach(func(k []byte, bucket *bbolt.Bucket) error {
|
||||
key := toString(k)
|
||||
|
|
@ -95,9 +95,7 @@ func restoreDB(bucket *bbolt.Bucket, data map[string]interface{}) error {
|
|||
}
|
||||
continue
|
||||
}
|
||||
|
||||
switch value := v.(type) {
|
||||
|
||||
// Key contains value.
|
||||
case string:
|
||||
err := bucket.Put(key, []byte(value))
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ func TestLoopOutStore(t *testing.T) {
|
|||
t.Run("labelled swap", func(t *testing.T) {
|
||||
testLoopOutStore(t, &labelledSwap)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// testLoopOutStore tests the basic functionality of the current bbolt
|
||||
|
|
|
|||
|
|
@ -257,7 +257,6 @@ func testLoopInTimeout(t *testing.T,
|
|||
// Expect a signing request for the htlc tx output value.
|
||||
signReq := <-ctx.lnd.SignOutputRawChannel
|
||||
if signReq.SignDescriptors[0].Output.Value != htlcTx.TxOut[0].Value {
|
||||
|
||||
t.Fatal("invalid signing amount")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ func TestLoopOutPaymentParameters(t *testing.T) {
|
|||
if !reflect.DeepEqual(
|
||||
[]uint64(req.OutgoingChanSet), swapPayment.OutgoingChanIds,
|
||||
) {
|
||||
|
||||
t.Fatalf("Unexpected outgoing channel set")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -503,7 +503,7 @@ type HtlcScriptV2 struct {
|
|||
// OP_ELSE
|
||||
// OP_SIZE <20> OP_EQUALVERIFY OP_HASH160 <ripemd(swapHash)> OP_EQUALVERIFY 1
|
||||
// OP_CHECKSEQUENCEVERIFY
|
||||
// OP_ENDIF
|
||||
// OP_ENDIF .
|
||||
func newHTLCScriptV2(cltvExpiry int32, senderHtlcKey,
|
||||
receiverHtlcKey [33]byte, swapHash lntypes.Hash) (*HtlcScriptV2, error) {
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
// asserting the result matches the validity expectation. In the case where it
|
||||
// doesn't match the expectation, it executes the script step-by-step and
|
||||
// prints debug information to stdout.
|
||||
// This code is adopted from: lnd/input/script_utils_test.go
|
||||
// This code is adopted from: lnd/input/script_utils_test.go .
|
||||
func assertEngineExecution(t *testing.T, valid bool,
|
||||
newEngine func() (*txscript.Engine, error)) {
|
||||
|
||||
|
|
@ -200,7 +200,6 @@ func TestHtlcV2(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
return witness
|
||||
|
||||
}, true,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ func (s *PrefixLog) Errorf(format string, params ...interface{}) {
|
|||
fmt.Sprintf("%v %s", ShortHash(&s.Hash), format),
|
||||
params...,
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
// ShortHash returns a shortened version of the hash suitable for use in
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ func (h *mockLightningClient) ListTransactions(
|
|||
}
|
||||
|
||||
// GetNodeInfo retrieves info on the node, and if includeChannels is True,
|
||||
// will return other channels the node may have with other peers
|
||||
// will return other channels the node may have with other peers.
|
||||
func (h *mockLightningClient) GetNodeInfo(ctx context.Context,
|
||||
pubKeyBytes route.Vertex, includeChannels bool) (*lndclient.NodeInfo, error) {
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ func (h *mockLightningClient) GetNodeInfo(ctx context.Context,
|
|||
return nodeInfo, nil
|
||||
}
|
||||
|
||||
// GetChanInfo retrieves all the info the node has on the given channel
|
||||
// GetChanInfo retrieves all the info the node has on the given channel.
|
||||
func (h *mockLightningClient) GetChanInfo(ctx context.Context,
|
||||
channelID uint64) (*lndclient.ChannelEdge, error) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue