Skip to content

Commit 672e373

Browse files
committed
itest: test invoice decoding with group key
1 parent ac3d9c3 commit 672e373

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

42094209
// Now that we have our payment request, we'll call into the new decode
42104210
// asset pay req call.
4211-
decodeResp, err := aliceTap.DecodeAssetPayReq(
4212-
ctx, &tchrpc.AssetPayReq{
4213-
AssetId: assetID,
4214-
PayReqString: payReq,
4215-
},
4216-
)
4211+
decodeResp, err := aliceTap.DecodeAssetPayReq(ctx, &tchrpc.AssetPayReq{
4212+
AssetId: assetID,
4213+
PayReqString: payReq,
4214+
})
42174215
require.NoError(t.t, err)
42184216

42194217
// The decimal display information, genesis, and asset group information
@@ -4228,4 +4226,18 @@ func testCustomChannelsDecodeAssetInvoice(ctx context.Context,
42284226
// display 6 that's 100 billion asset units.
42294227
const expectedUnits = 100_000_000_000
42304228
require.Equal(t.t, int64(expectedUnits), int64(decodeResp.AssetAmount))
4229+
4230+
// We do the same call again, but this time using the group key for the
4231+
// decoding query.
4232+
decodeResp2, err := aliceTap.DecodeAssetPayReq(ctx, &tchrpc.AssetPayReq{
4233+
GroupKey: usdAsset.AssetGroup.TweakedGroupKey,
4234+
PayReqString: payReq,
4235+
})
4236+
require.NoError(t.t, err)
4237+
4238+
require.Equal(t.t, decodeResp.AssetAmount, decodeResp2.AssetAmount)
4239+
require.Equal(t.t, decodeResp.AssetGroup, decodeResp2.AssetGroup)
4240+
require.Equal(
4241+
t.t, decodeResp.DecimalDisplay, decodeResp2.DecimalDisplay,
4242+
)
42314243
}

0 commit comments

Comments
 (0)