Skip to content

Commit 91d2d44

Browse files
committed
itest: test invoice decoding with group key
1 parent 23c31a5 commit 91d2d44

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
@@ -4320,12 +4320,10 @@ func testCustomChannelsDecodeAssetInvoice(ctx context.Context,
43204320

43214321
// Now that we have our payment request, we'll call into the new decode
43224322
// asset pay req call.
4323-
decodeResp, err := aliceTap.DecodeAssetPayReq(
4324-
ctx, &tchrpc.AssetPayReq{
4325-
AssetId: assetID,
4326-
PayReqString: payReq,
4327-
},
4328-
)
4323+
decodeResp, err := aliceTap.DecodeAssetPayReq(ctx, &tchrpc.AssetPayReq{
4324+
AssetId: assetID,
4325+
PayReqString: payReq,
4326+
})
43294327
require.NoError(t.t, err)
43304328

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

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

0 commit comments

Comments
 (0)