mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-23 11:12:44 +02:00
rpc: Expose block height of wallet transactions
This commit is contained in:
@@ -40,14 +40,15 @@ class ListTransactionsTest(BitcoinTestFramework):
|
||||
{"txid": txid},
|
||||
{"category": "receive", "amount": Decimal("0.1"), "confirmations": 0})
|
||||
# mine a block, confirmations should change:
|
||||
self.nodes[0].generate(1)
|
||||
blockhash = self.nodes[0].generate(1)[0]
|
||||
blockheight = self.nodes[0].getblockheader(blockhash)['height']
|
||||
self.sync_all()
|
||||
assert_array_result(self.nodes[0].listtransactions(),
|
||||
{"txid": txid},
|
||||
{"category": "send", "amount": Decimal("-0.1"), "confirmations": 1})
|
||||
{"category": "send", "amount": Decimal("-0.1"), "confirmations": 1, "blockhash": blockhash, "blockheight": blockheight})
|
||||
assert_array_result(self.nodes[1].listtransactions(),
|
||||
{"txid": txid},
|
||||
{"category": "receive", "amount": Decimal("0.1"), "confirmations": 1})
|
||||
{"category": "receive", "amount": Decimal("0.1"), "confirmations": 1, "blockhash": blockhash, "blockheight": blockheight})
|
||||
|
||||
# send-to-self:
|
||||
txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 0.2)
|
||||
|
Reference in New Issue
Block a user