Skip to content

Commit 75648ce

Browse files
committed
test: add P2A ProduceSignature coverage
1 parent 7998ce6 commit 75648ce

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/test/script_tests.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,19 @@ BOOST_AUTO_TEST_CASE(sign_invalid_miniscript)
12771277
BOOST_CHECK(!SignSignature(keystore, CTransaction(prev), curr, 0, SIGHASH_ALL, sig_data));
12781278
}
12791279

1280+
/* P2A input should be considered signed. */
1281+
BOOST_AUTO_TEST_CASE(sign_paytoanchor)
1282+
{
1283+
FillableSigningProvider keystore;
1284+
SignatureData sig_data;
1285+
CMutableTransaction prev, curr;
1286+
prev.vout.emplace_back(0, GetScriptForDestination(PayToAnchor{}));
1287+
1288+
curr.vin.emplace_back(COutPoint{prev.GetHash(), 0});
1289+
1290+
BOOST_CHECK(SignSignature(keystore, CTransaction(prev), curr, 0, SIGHASH_ALL, sig_data));
1291+
}
1292+
12801293
BOOST_AUTO_TEST_CASE(script_standard_push)
12811294
{
12821295
ScriptError err;

0 commit comments

Comments
 (0)