Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/wallet/rpc/transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,7 @@ RPCHelpMan listtransactions()
{RPCResult::Type::OBJ, "", "", Cat(Cat<std::vector<RPCResult>>(
{
{RPCResult::Type::BOOL, "involvesWatchonly", /*optional=*/true, "Only returns true if imported addresses were involved in transaction"},
{RPCResult::Type::STR, "address", "The Dash address of the transaction. Not present for\n"
"move transactions (category = move)."},
{RPCResult::Type::STR, "address", /*optional=*/true, "The Dash address of the transaction (not returned if the output does not have an address, e.g. OP_RETURN null data)."},
{RPCResult::Type::STR, "category", "The transaction category.\n"
"\"send\" Transactions sent.\n"
"\"coinjoin\" Transactions sent using CoinJoin funds.\n"
Expand Down Expand Up @@ -572,7 +571,7 @@ RPCHelpMan listsinceblock()
{RPCResult::Type::OBJ, "", "", Cat(Cat<std::vector<RPCResult>>(
{
{RPCResult::Type::BOOL, "involvesWatchonly", /*optional=*/true, "Only returns true if imported addresses were involved in transaction"},
{RPCResult::Type::STR, "address", "The Dash address of the transaction."},
{RPCResult::Type::STR, "address", /*optional=*/true, "The Dash address of the transaction (not returned if the output does not have an address, e.g. OP_RETURN null data)."},
{RPCResult::Type::STR, "category", "The transaction category.\n"
"\"send\" Transactions sent.\n"
"\"coinjoin\" Transactions sent using CoinJoin funds.\n"
Expand Down
15 changes: 15 additions & 0 deletions test/functional/wallet_listsinceblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def run_test(self):
self.test_double_send()
self.double_spends_filtered()
self.test_targetconfirmations()
self.test_op_return()

def test_no_blockhash(self):
self.log.info("Test no blockhash")
Expand Down Expand Up @@ -399,5 +400,19 @@ def double_spends_filtered(self):
assert_equal(original_found, False)
assert_equal(double_found, False)

def test_op_return(self):
"""Test if OP_RETURN outputs will be displayed correctly."""
block_hash = self.nodes[2].getbestblockhash()

raw_tx = self.nodes[2].createrawtransaction([], [{'data': 'aa'}])
funded_tx = self.nodes[2].fundrawtransaction(raw_tx)
signed_tx = self.nodes[2].signrawtransactionwithwallet(funded_tx['hex'])
tx_id = self.nodes[2].sendrawtransaction(signed_tx['hex'])

op_ret_tx = [tx for tx in self.nodes[2].listsinceblock(blockhash=block_hash)["transactions"] if tx['txid'] == tx_id][0]

assert 'address' not in op_ret_tx


if __name__ == '__main__':
ListSinceBlockTest().main()
14 changes: 14 additions & 0 deletions test/functional/wallet_listtransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,19 @@ def run_test(self):
{"category": "receive", "amount": Decimal("0.1")},
{"txid": txid, "label": "watchonly"})

self.test_op_return()

def test_op_return(self):
"""Test if OP_RETURN outputs will be displayed correctly."""
raw_tx = self.nodes[0].createrawtransaction([], [{'data': 'aa'}])
funded_tx = self.nodes[0].fundrawtransaction(raw_tx)
signed_tx = self.nodes[0].signrawtransactionwithwallet(funded_tx['hex'])
tx_id = self.nodes[0].sendrawtransaction(signed_tx['hex'])

op_ret_tx = [tx for tx in self.nodes[0].listtransactions() if tx['txid'] == tx_id][0]

assert 'address' not in op_ret_tx


if __name__ == '__main__':
ListTransactionsTest().main()