Skip to content

Commit 142e0e2

Browse files
committed
itest: test invoice decoding with group key
1 parent 04381c6 commit 142e0e2

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

itest/litd_custom_channels_test.go

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4324,12 +4324,10 @@ func testCustomChannelsDecodeAssetInvoice(ctx context.Context,
43244324

43254325
// Now that we have our payment request, we'll call into the new decode
43264326
// asset pay req call.
4327-
decodeResp, err := aliceTap.DecodeAssetPayReq(
4328-
ctx, &tchrpc.AssetPayReq{
4329-
AssetId: assetID,
4330-
PayReqString: payReq,
4331-
},
4332-
)
4327+
decodeResp, err := aliceTap.DecodeAssetPayReq(ctx, &tchrpc.AssetPayReq{
4328+
AssetId: assetID,
4329+
PayReqString: payReq,
4330+
})
43334331
require.NoError(t.t, err)
43344332

43354333
// The decimal display information, genesis, and asset group information
@@ -4344,6 +4342,20 @@ func testCustomChannelsDecodeAssetInvoice(ctx context.Context,
43444342
// display 6 that's 100 billion asset units.
43454343
const expectedUnits = 100_000_000_000
43464344
require.Equal(t.t, int64(expectedUnits), int64(decodeResp.AssetAmount))
4345+
4346+
// We do the same call again, but this time using the group key for the
4347+
// decoding query.
4348+
decodeResp2, err := aliceTap.DecodeAssetPayReq(ctx, &tchrpc.AssetPayReq{
4349+
GroupKey: usdAsset.AssetGroup.TweakedGroupKey,
4350+
PayReqString: payReq,
4351+
})
4352+
require.NoError(t.t, err)
4353+
4354+
require.Equal(t.t, decodeResp.AssetAmount, decodeResp2.AssetAmount)
4355+
require.Equal(t.t, decodeResp.AssetGroup, decodeResp2.AssetGroup)
4356+
require.Equal(
4357+
t.t, decodeResp.DecimalDisplay, decodeResp2.DecimalDisplay,
4358+
)
43474359
}
43484360

43494361
// testCustomChannelsSelfPayment tests that circular self-payments can be made

0 commit comments

Comments
 (0)