Skip to content

Commit c92115d

Browse files
committed
Merge bitcoin/bitcoin#33119: rpc: Fix 'getdescriptoractivity' RPCHelpMan, add test to verify fix
3543bfd test: Fix 'getdescriptoractivity' RPCHelpMan, add test to verify 'spend_vin' is the correct field (Chris Stewart) Pull request description: Fixes bug in `getdescriptoractivity` RPC help manual. Here is the line that pushes `spend_vin` field, there is no `spend_vout` json field. https://github.com/bitcoin/bitcoin/blob/master/src/rpc/blockchain.cpp#L2757 ACKs for top commit: nervana21: tACK 3543bfd luke-jr: utACK 3543bfd jonatack: ACK 3543bfd Tree-SHA512: 2cd543569a87261d8d804d9afe36f8e8ead55839c01da9c4831aea3ced7d1251e6885621e628898105700aae4d76cbb8a682f518f33c1c52163e66f75ec87a61
2 parents 1dab8d0 + 3543bfd commit c92115d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2671,7 +2671,7 @@ static RPCHelpMan getdescriptoractivity()
26712671
{RPCResult::Type::STR_HEX, "blockhash", /*optional=*/true, "The blockhash this spend appears in (omitted if unconfirmed)"},
26722672
{RPCResult::Type::NUM, "height", /*optional=*/true, "Height of the spend (omitted if unconfirmed)"},
26732673
{RPCResult::Type::STR_HEX, "spend_txid", "The txid of the spending transaction"},
2674-
{RPCResult::Type::NUM, "spend_vout", "The vout of the spend"},
2674+
{RPCResult::Type::NUM, "spend_vin", "The input index of the spend"},
26752675
{RPCResult::Type::STR_HEX, "prevout_txid", "The txid of the prevout"},
26762676
{RPCResult::Type::NUM, "prevout_vout", "The vout of the prevout"},
26772677
{RPCResult::Type::OBJ, "prevout_spk", "", ScriptPubKeyDoc()},

test/functional/rpc_getdescriptoractivity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def test_receive_then_spend(self, node, wallet):
191191

192192
assert result['activity'][2]['type'] == 'spend'
193193
assert result['activity'][2]['spend_txid'] == sent2['txid']
194+
assert result['activity'][2]['spend_vin'] == 0
194195
assert result['activity'][2]['prevout_txid'] == sent1['txid']
195196
assert result['activity'][2]['blockhash'] == blockhash_2
196197

0 commit comments

Comments
 (0)