lint: silence depreciation warnings
This commit is contained in:
7 files changed
+26
-26
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
+13
-13
@@ -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 "+
|
||||
|
||||
Reference in new issue
Block a user