multi: rename LookupHtlc to LookupHtlcResolution for clarity

This commit is contained in:
yyforyongyu
2023-02-28 15:35:36 +08:00
parent 2bf84fbe41
commit c26917ee1f
11 changed files with 2952 additions and 2939 deletions

View File

@@ -512,7 +512,7 @@ var allTestCases = []*lntest.TestCase{
TestFunc: testBidirectionalAsyncPayments,
},
{
Name: "lookup htlc",
TestFunc: testLookupHTLC,
Name: "lookup htlc resolution",
TestFunc: testLookupHtlcResolution,
},
}

View File

@@ -9,9 +9,9 @@ import (
"google.golang.org/grpc/status"
)
// testLookupHTLC checks that `LookupHtlc` returns the correct HTLC
// information.
func testLookupHTLC(ht *lntest.HarnessTest) {
// testLookupHtlcResolution checks that `LookupHtlcResolution` returns the
// correct HTLC information.
func testLookupHtlcResolution(ht *lntest.HarnessTest) {
const chanAmt = btcutil.Amount(1000000)
alice := ht.Alice
@@ -54,18 +54,18 @@ func testLookupHTLC(ht *lntest.HarnessTest) {
channel := ht.AssertChannelExists(carol, cp)
// Lookup the HTLC and assert the htlc is settled offchain.
req := &lnrpc.LookupHtlcRequest{
req := &lnrpc.LookupHtlcResolutionRequest{
ChanId: channel.ChanId,
HtlcIndex: 0,
}
// Check that Alice will get an error from LookupHtlc.
err := alice.RPC.LookupHtlcAssertErr(req)
// Check that Alice will get an error from LookupHtlcResolution.
err := alice.RPC.LookupHtlcResolutionAssertErr(req)
gErr := status.Convert(err)
require.Equal(ht, codes.Unavailable, gErr.Code())
// Check that Carol can get the final htlc info.
finalHTLC := carol.RPC.LookupHtlc(req)
finalHTLC := carol.RPC.LookupHtlcResolution(req)
require.True(ht, finalHTLC.Settled, "htlc should be settled")
require.True(ht, finalHTLC.Offchain, "htlc should be Offchain")
}