Skip to content

Commit 9d9d26a

Browse files
committed
itest: test invoice decoding with group key
1 parent b27141b commit 9d9d26a

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

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

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

0 commit comments

Comments
 (0)