itest: add test coverage for Taproot tweak key mutation

This commit is contained in:
Oliver Gugger 2022-11-10 13:10:53 +01:00
parent 082d68d0ca
commit b3f6fe315e
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
2 changed files with 20 additions and 3 deletions

View File

@ -1151,6 +1151,21 @@ func assertPsbtSpend(ctx context.Context, t *harnessTest,
finalTx, err := psbt.Extract(signedPacket)
require.NoError(t.t, err)
// Make sure we can also sign a second time. This makes sure any key
// tweaking that happened for the signing didn't affect any keys in the
// cache.
signResp2, err := alice.WalletKitClient.SignPsbt(
ctx, &walletrpc.SignPsbtRequest{
FundedPsbt: buf.Bytes(),
},
)
require.NoError(t.t, err)
signedPacket2, err := psbt.NewFromRawBytes(
bytes.NewReader(signResp2.SignedPsbt), false,
)
require.NoError(t.t, err)
verifySigned(signedPacket2)
buf.Reset()
err = finalTx.Serialize(&buf)
require.NoError(t.t, err)

View File

@ -103,7 +103,8 @@ func testRemoteSigner(net *lntest.NetworkHarness, t *harnessTest) {
runCPFP(net, tt, wo, carol)
},
}, {
name: "psbt",
name: "psbt",
randomSeed: true,
fn: func(tt *harnessTest, wo, carol *lntest.HarnessNode) {
runPsbtChanFunding(net, tt, carol, wo)
runSignPsbtSegWitV0P2WKH(tt, net, wo)
@ -124,8 +125,9 @@ func testRemoteSigner(net *lntest.NetworkHarness, t *harnessTest) {
runSignVerifyMessage(tt, net, wo)
},
}, {
name: "taproot",
sendCoins: true,
name: "taproot",
sendCoins: true,
randomSeed: true,
fn: func(tt *harnessTest, wo, carol *lntest.HarnessNode) {
ctxt, cancel := context.WithTimeout(
ctxb, 3*defaultTimeout,