mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
test: add listtransactions/listsinceblock "trusted" coverage
This commit is contained in:
parent
d95913fc43
commit
296cfa312f
2 changed files with 13 additions and 2 deletions
|
@ -44,6 +44,14 @@ class ListSinceBlockTest(BitcoinTestFramework):
|
||||||
def test_no_blockhash(self):
|
def test_no_blockhash(self):
|
||||||
self.log.info("Test no blockhash")
|
self.log.info("Test no blockhash")
|
||||||
txid = self.nodes[2].sendtoaddress(self.nodes[0].getnewaddress(), 1)
|
txid = self.nodes[2].sendtoaddress(self.nodes[0].getnewaddress(), 1)
|
||||||
|
self.sync_all()
|
||||||
|
assert_array_result(self.nodes[0].listtransactions(), {"txid": txid}, {
|
||||||
|
"category": "receive",
|
||||||
|
"amount": 1,
|
||||||
|
"confirmations": 0,
|
||||||
|
"trusted": False,
|
||||||
|
})
|
||||||
|
|
||||||
blockhash, = self.generate(self.nodes[2], 1)
|
blockhash, = self.generate(self.nodes[2], 1)
|
||||||
blockheight = self.nodes[2].getblockheader(blockhash)['height']
|
blockheight = self.nodes[2].getblockheader(blockhash)['height']
|
||||||
self.sync_all()
|
self.sync_all()
|
||||||
|
@ -56,6 +64,9 @@ class ListSinceBlockTest(BitcoinTestFramework):
|
||||||
"blockheight": blockheight,
|
"blockheight": blockheight,
|
||||||
"confirmations": 1,
|
"confirmations": 1,
|
||||||
})
|
})
|
||||||
|
assert_equal(len(txs), 1)
|
||||||
|
assert "trusted" not in txs[0]
|
||||||
|
|
||||||
assert_equal(
|
assert_equal(
|
||||||
self.nodes[0].listsinceblock(),
|
self.nodes[0].listsinceblock(),
|
||||||
{"lastblock": blockhash,
|
{"lastblock": blockhash,
|
||||||
|
|
|
@ -31,10 +31,10 @@ class ListTransactionsTest(BitcoinTestFramework):
|
||||||
self.sync_all()
|
self.sync_all()
|
||||||
assert_array_result(self.nodes[0].listtransactions(),
|
assert_array_result(self.nodes[0].listtransactions(),
|
||||||
{"txid": txid},
|
{"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(),
|
assert_array_result(self.nodes[1].listtransactions(),
|
||||||
{"txid": txid},
|
{"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")
|
self.log.info("Test confirmations change after mining a block")
|
||||||
blockhash = self.generate(self.nodes[0], 1)[0]
|
blockhash = self.generate(self.nodes[0], 1)[0]
|
||||||
blockheight = self.nodes[0].getblockheader(blockhash)['height']
|
blockheight = self.nodes[0].getblockheader(blockhash)['height']
|
||||||
|
|
Loading…
Add table
Reference in a new issue