lint: silence depreciation warnings

This commit is contained in:
Andras Banki-Horvath 2021-04-30 12:35:53 +02:00
parent 80bc46e614
commit dd14947154
No known key found for this signature in database
GPG Key ID: 80E5375C094198D8
7 changed files with 26 additions and 26 deletions

View File

@ -744,7 +744,7 @@ func checkPsbtFlags(req *lnrpc.OpenChannelRequest) error {
return fmt.Errorf("specifying minimum confirmations for PSBT " +
"funding is not supported")
}
if req.TargetConf != 0 || req.SatPerByte != 0 || req.SatPerVbyte != 0 {
if req.TargetConf != 0 || req.SatPerByte != 0 || req.SatPerVbyte != 0 { // nolint:staticcheck
return fmt.Errorf("setting fee estimation parameters not " +
"supported for PSBT funding")
}

View File

@ -108,7 +108,7 @@ func testSendPaymentAMP(net *lntest.NetworkHarness, t *harnessTest) {
// Assert that the invoice is settled for the total payment amount and
// has the correct payment address.
require.True(t.t, rpcInvoice.Settled)
require.True(t.t, rpcInvoice.Settled) // nolint:staticcheck
require.Equal(t.t, lnrpc.Invoice_SETTLED, rpcInvoice.State)
require.Equal(t.t, int64(paymentAmt), rpcInvoice.AmtPaidSat)
require.Equal(t.t, int64(paymentAmt*1000), rpcInvoice.AmtPaidMsat)
@ -294,7 +294,7 @@ func testSendToRouteAMP(net *lntest.NetworkHarness, t *harnessTest) {
// Assert that the invoice is settled for the total payment amount and
// has the correct payment address.
require.True(t.t, rpcInvoice.Settled)
require.True(t.t, rpcInvoice.Settled) // nolint:staticcheck
require.Equal(t.t, lnrpc.Invoice_SETTLED, rpcInvoice.State)
require.Equal(t.t, int64(paymentAmt), rpcInvoice.AmtPaidSat)
require.Equal(t.t, int64(paymentAmt*1000), rpcInvoice.AmtPaidMsat)

View File

@ -188,7 +188,7 @@ func basicChannelFundingTest(t *harnessTest, net *lntest.NetworkHarness,
lnwire.NewMSatFromSatoshis(remote),
)
// Deprecated fields.
newResp.Balance += int64(local)
newResp.Balance += int64(local) // nolint:staticcheck
assertChannelBalanceResp(t, node, newResp)
}

View File

@ -220,7 +220,7 @@ func assertOnChainInvoiceState(ctx context.Context, t *harnessTest,
})
require.NoError(t.t, err)
require.True(t.t, inv.Settled, "expected erroneously settled invoice")
require.True(t.t, inv.Settled, "expected erroneously settled invoice") // nolint:staticcheck
for _, htlc := range inv.Htlcs {
require.Equal(t.t, lnrpc.InvoiceHTLCState_SETTLED, htlc.State,
"expected htlcs to be erroneously settled")

View File

@ -86,7 +86,7 @@ func testSingleHopInvoice(net *lntest.NetworkHarness, t *harnessTest) {
if err != nil {
t.Fatalf("unable to lookup invoice: %v", err)
}
if !dbInvoice.Settled {
if !dbInvoice.Settled { // nolint:staticcheck
t.Fatalf("bob's invoice should be marked as settled: %v",
spew.Sdump(dbInvoice))
}

View File

@ -5642,7 +5642,7 @@ func testSingleHopSendToRouteCase(net *lntest.NetworkHarness, t *harnessTest,
}
sendToRouteStream := func() {
ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)
alicePayStream, err := carol.SendToRoute(ctxt)
alicePayStream, err := carol.SendToRoute(ctxt) // nolint:staticcheck
if err != nil {
t.Fatalf("unable to create payment stream for "+
"carol: %v", err)
@ -12672,20 +12672,20 @@ func testQueryRoutes(net *lntest.NetworkHarness, t *harnessTest) {
lnwire.MilliSatoshi(len(route.Hops)-1) * feePerHopMSat
expectedTotalAmtMSat := (paymentAmt * mSat) + expectedTotalFeesMSat
if route.TotalFees != route.TotalFeesMsat/mSat {
if route.TotalFees != route.TotalFeesMsat/mSat { // nolint:staticcheck
t.Fatalf("route %v: total fees %v (msat) does not "+
"round down to %v (sat)",
i, route.TotalFeesMsat, route.TotalFees)
i, route.TotalFeesMsat, route.TotalFees) // nolint:staticcheck
}
if route.TotalFeesMsat != int64(expectedTotalFeesMSat) {
t.Fatalf("route %v: total fees in msat expected %v got %v",
i, expectedTotalFeesMSat, route.TotalFeesMsat)
}
if route.TotalAmt != route.TotalAmtMsat/mSat {
if route.TotalAmt != route.TotalAmtMsat/mSat { // nolint:staticcheck
t.Fatalf("route %v: total amt %v (msat) does not "+
"round down to %v (sat)",
i, route.TotalAmtMsat, route.TotalAmt)
i, route.TotalAmtMsat, route.TotalAmt) // nolint:staticcheck
}
if route.TotalAmtMsat != int64(expectedTotalAmtMSat) {
t.Fatalf("route %v: total amt in msat expected %v got %v",
@ -12698,20 +12698,20 @@ func testQueryRoutes(net *lntest.NetworkHarness, t *harnessTest) {
for j, hop := range route.Hops[:len(route.Hops)-1] {
expectedAmtToForwardMSat -= feePerHopMSat
if hop.Fee != hop.FeeMsat/mSat {
if hop.Fee != hop.FeeMsat/mSat { // nolint:staticcheck
t.Fatalf("route %v hop %v: fee %v (msat) does not "+
"round down to %v (sat)",
i, j, hop.FeeMsat, hop.Fee)
i, j, hop.FeeMsat, hop.Fee) // nolint:staticcheck
}
if hop.FeeMsat != int64(feePerHopMSat) {
t.Fatalf("route %v hop %v: fee in msat expected %v got %v",
i, j, feePerHopMSat, hop.FeeMsat)
}
if hop.AmtToForward != hop.AmtToForwardMsat/mSat {
if hop.AmtToForward != hop.AmtToForwardMsat/mSat { // nolint:staticcheck
t.Fatalf("route %v hop %v: amt to forward %v (msat) does not "+
"round down to %v (sat)",
i, j, hop.AmtToForwardMsat, hop.AmtToForward)
i, j, hop.AmtToForwardMsat, hop.AmtToForward) // nolint:staticcheck
}
if hop.AmtToForwardMsat != int64(expectedAmtToForwardMSat) {
t.Fatalf("route %v hop %v: amt to forward in msat "+
@ -12723,15 +12723,15 @@ func testQueryRoutes(net *lntest.NetworkHarness, t *harnessTest) {
// payment amount.
hop := route.Hops[len(route.Hops)-1]
if hop.Fee != 0 || hop.FeeMsat != 0 {
if hop.Fee != 0 || hop.FeeMsat != 0 { // nolint:staticcheck
t.Fatalf("route %v hop %v: fee expected 0 got %v (sat) %v (msat)",
i, len(route.Hops)-1, hop.Fee, hop.FeeMsat)
i, len(route.Hops)-1, hop.Fee, hop.FeeMsat) // nolint:staticcheck
}
if hop.AmtToForward != hop.AmtToForwardMsat/mSat {
if hop.AmtToForward != hop.AmtToForwardMsat/mSat { // nolint:staticcheck
t.Fatalf("route %v hop %v: amt to forward %v (msat) does not "+
"round down to %v (sat)",
i, len(route.Hops)-1, hop.AmtToForwardMsat, hop.AmtToForward)
i, len(route.Hops)-1, hop.AmtToForwardMsat, hop.AmtToForward) // nolint:staticcheck
}
if hop.AmtToForwardMsat != paymentAmt*mSat {
t.Fatalf("route %v hop %v: amt to forward in msat "+

View File

@ -1122,7 +1122,7 @@ func (r *rpcServer) SendCoins(ctx context.Context,
// Calculate an appropriate fee rate for this transaction.
feePerKw, err := calculateFeeRate(
uint64(in.SatPerByte), in.SatPerVbyte,
uint64(in.SatPerByte), in.SatPerVbyte, // nolint:staticcheck
uint32(in.TargetConf), r.server.cc.FeeEstimator,
)
if err != nil {
@ -1330,7 +1330,7 @@ func (r *rpcServer) SendMany(ctx context.Context,
// Calculate an appropriate fee rate for this transaction.
feePerKw, err := calculateFeeRate(
uint64(in.SatPerByte), in.SatPerVbyte,
uint64(in.SatPerByte), in.SatPerVbyte, // nolint:staticcheck
uint32(in.TargetConf), r.server.cc.FeeEstimator,
)
if err != nil {
@ -1731,7 +1731,7 @@ func newPsbtAssembler(req *lnrpc.OpenChannelRequest, normalizedMinConfs int32,
"minimum confirmation is not supported for PSBT " +
"funding")
}
if req.SatPerByte != 0 || req.SatPerVbyte != 0 || req.TargetConf != 0 {
if req.SatPerByte != 0 || req.SatPerVbyte != 0 || req.TargetConf != 0 { // nolint:staticcheck
return nil, fmt.Errorf("specifying fee estimation parameters " +
"is not supported for PSBT funding")
}
@ -1862,7 +1862,7 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest,
// key object. For all sync call, byte slices are expected to be encoded
// as hex strings.
case isSync:
keyBytes, err := hex.DecodeString(in.NodePubkeyString)
keyBytes, err := hex.DecodeString(in.NodePubkeyString) // nolint:staticcheck
if err != nil {
return nil, err
}
@ -1884,7 +1884,7 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest,
// Calculate an appropriate fee rate for this transaction.
feeRate, err := calculateFeeRate(
uint64(in.SatPerByte), in.SatPerVbyte,
uint64(in.SatPerByte), in.SatPerVbyte, // nolint:staticcheck
uint32(in.TargetConf), r.server.cc.FeeEstimator,
)
if err != nil {
@ -2087,7 +2087,7 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
// If force closing a channel, the fee set in the commitment transaction
// is used.
if in.Force && (in.SatPerByte != 0 || in.SatPerVbyte != 0 ||
if in.Force && (in.SatPerByte != 0 || in.SatPerVbyte != 0 || // nolint:staticcheck
in.TargetConf != 0) {
return fmt.Errorf("force closing a channel uses a pre-defined fee")
@ -2222,7 +2222,7 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
// an appropriate fee rate for the cooperative closure
// transaction.
feeRate, err := calculateFeeRate(
uint64(in.SatPerByte), in.SatPerVbyte,
uint64(in.SatPerByte), in.SatPerVbyte, // nolint:staticcheck
uint32(in.TargetConf), r.server.cc.FeeEstimator,
)
if err != nil {