mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-26 16:31:17 +02:00
Merge bitcoin/bitcoin#23139: rpc: fix "trusted" field in TransactionDescriptionString(), add coverage
66f6efc70a
rpc: improve TransactionDescriptionString() "generated" help (Jon Atack)296cfa312f
test: add listtransactions/listsinceblock "trusted" coverage (Jon Atack)d95913fc43
rpc: fix "trusted" description in TransactionDescriptionString (Jon Atack) Pull request description: The RPC gettransaction, listtransactions, and listsinceblock helps returned by `TransactionDescriptionString()` inform the user that the `trusted` boolean field is only present if the transaction is trusted and safe to spend from. The field is in fact returned by `WalletTxToJSON()` when the transaction has 0 confirmations (or negative confirmations, if conflicted), and it can be true or false. This patch fixes the help, adds test coverage, and touches up the help for the neighboring `generate` field. ACKs for top commit: rajarshimaitra: tACK66f6efc70a
theStack: Tested ACK66f6efc70a
Tree-SHA512: 4c2127765b82780e07bbdbf519d27163d414d9f15598e01e02210f210e6009be344c84951d7274e747b1386991d4c3b082cd25aebe885fb8cf0b92d57178f68e
This commit is contained in:
@@ -31,10 +31,10 @@ class ListTransactionsTest(BitcoinTestFramework):
|
||||
self.sync_all()
|
||||
assert_array_result(self.nodes[0].listtransactions(),
|
||||
{"txid": txid},
|
||||
{"category": "send", "amount": Decimal("-0.1"), "confirmations": 0})
|
||||
{"category": "send", "amount": Decimal("-0.1"), "confirmations": 0, "trusted": True})
|
||||
assert_array_result(self.nodes[1].listtransactions(),
|
||||
{"txid": txid},
|
||||
{"category": "receive", "amount": Decimal("0.1"), "confirmations": 0})
|
||||
{"category": "receive", "amount": Decimal("0.1"), "confirmations": 0, "trusted": False})
|
||||
self.log.info("Test confirmations change after mining a block")
|
||||
blockhash = self.generate(self.nodes[0], 1)[0]
|
||||
blockheight = self.nodes[0].getblockheader(blockhash)['height']
|
||||
|
Reference in New Issue
Block a user