test: Fix 'getdescriptoractivity' RPCHelpMan, add test to verify 'spend_vin' is the correct field

Github-Pull: #33119
Rebased-From: 3543bfdfec345cf2c952143c31674ef02de2a64b
This commit is contained in:
Chris Stewart 2025-08-01 16:33:13 -05:00 committed by fanquake
parent 4e8abca445
commit 2b9738a083
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
2 changed files with 2 additions and 1 deletions

View File

@ -2625,7 +2625,7 @@ static RPCHelpMan getdescriptoractivity()
{RPCResult::Type::STR_HEX, "blockhash", /*optional=*/true, "The blockhash this spend appears in (omitted if unconfirmed)"},
{RPCResult::Type::NUM, "height", /*optional=*/true, "Height of the spend (omitted if unconfirmed)"},
{RPCResult::Type::STR_HEX, "spend_txid", "The txid of the spending transaction"},
{RPCResult::Type::NUM, "spend_vout", "The vout of the spend"},
{RPCResult::Type::NUM, "spend_vin", "The input index of the spend"},
{RPCResult::Type::STR_HEX, "prevout_txid", "The txid of the prevout"},
{RPCResult::Type::NUM, "prevout_vout", "The vout of the prevout"},
{RPCResult::Type::OBJ, "prevout_spk", "", ScriptPubKeyDoc()},

View File

@ -182,6 +182,7 @@ class GetBlocksActivityTest(BitcoinTestFramework):
assert result['activity'][2]['type'] == 'spend'
assert result['activity'][2]['spend_txid'] == sent2['txid']
assert result['activity'][2]['spend_vin'] == 0
assert result['activity'][2]['prevout_txid'] == sent1['txid']
assert result['activity'][2]['blockhash'] == blockhash_2