Skip to content

Commit 296cfa3

Browse files
committed
test: add listtransactions/listsinceblock "trusted" coverage
1 parent d95913f commit 296cfa3

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

test/functional/wallet_listsinceblock.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ def run_test(self):
4444
def test_no_blockhash(self):
4545
self.log.info("Test no blockhash")
4646
txid = self.nodes[2].sendtoaddress(self.nodes[0].getnewaddress(), 1)
47+
self.sync_all()
48+
assert_array_result(self.nodes[0].listtransactions(), {"txid": txid}, {
49+
"category": "receive",
50+
"amount": 1,
51+
"confirmations": 0,
52+
"trusted": False,
53+
})
54+
4755
blockhash, = self.generate(self.nodes[2], 1)
4856
blockheight = self.nodes[2].getblockheader(blockhash)['height']
4957
self.sync_all()
@@ -56,6 +64,9 @@ def test_no_blockhash(self):
5664
"blockheight": blockheight,
5765
"confirmations": 1,
5866
})
67+
assert_equal(len(txs), 1)
68+
assert "trusted" not in txs[0]
69+
5970
assert_equal(
6071
self.nodes[0].listsinceblock(),
6172
{"lastblock": blockhash,

test/functional/wallet_listtransactions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ def run_test(self):
3131
self.sync_all()
3232
assert_array_result(self.nodes[0].listtransactions(),
3333
{"txid": txid},
34-
{"category": "send", "amount": Decimal("-0.1"), "confirmations": 0})
34+
{"category": "send", "amount": Decimal("-0.1"), "confirmations": 0, "trusted": True})
3535
assert_array_result(self.nodes[1].listtransactions(),
3636
{"txid": txid},
37-
{"category": "receive", "amount": Decimal("0.1"), "confirmations": 0})
37+
{"category": "receive", "amount": Decimal("0.1"), "confirmations": 0, "trusted": False})
3838
self.log.info("Test confirmations change after mining a block")
3939
blockhash = self.generate(self.nodes[0], 1)[0]
4040
blockheight = self.nodes[0].getblockheader(blockhash)['height']

0 commit comments

Comments
 (0)