Merge #18306: test: add logging to wallet_listsinceblock.py

d484279a46fe2cd5e133b6c18a1e00f802084772 test: add logging to wallet_listsinceblock.py (Jon Atack)

Pull request description:

  This is the first commit from #17535.

Top commit has no ACKs.

Tree-SHA512: bb4f527a41bca3ffbf69e910311ce7f85dcc7a2be41350b3c653a27f4044f392b7e528f330e9691f497212469f6b16ce263230bb7a919548dd4e3e21cc72142f
This commit is contained in:
MarcoFalke 2020-03-09 16:15:56 -04:00
commit ccb2c9e789
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

View File

@ -2,7 +2,7 @@
# Copyright (c) 2017-2019 The Bitcoin Core developers # Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying # Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listsincelast RPC.""" """Test the listsinceblock RPC."""
from test_framework.test_framework import BitcoinTestFramework from test_framework.test_framework import BitcoinTestFramework
from test_framework.messages import BIP125_SEQUENCE_NUMBER from test_framework.messages import BIP125_SEQUENCE_NUMBER
@ -38,6 +38,7 @@ class ListSinceBlockTest(BitcoinTestFramework):
self.double_spends_filtered() self.double_spends_filtered()
def test_no_blockhash(self): def test_no_blockhash(self):
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)
blockhash, = self.nodes[2].generate(1) blockhash, = self.nodes[2].generate(1)
blockheight = self.nodes[2].getblockheader(blockhash)['height'] blockheight = self.nodes[2].getblockheader(blockhash)['height']
@ -63,6 +64,7 @@ class ListSinceBlockTest(BitcoinTestFramework):
"transactions": txs}) "transactions": txs})
def test_invalid_blockhash(self): def test_invalid_blockhash(self):
self.log.info("Test invalid blockhash")
assert_raises_rpc_error(-5, "Block not found", self.nodes[0].listsinceblock, assert_raises_rpc_error(-5, "Block not found", self.nodes[0].listsinceblock,
"42759cde25462784395a337460bde75f58e73d3f08bd31fdc3507cbac856a2c4") "42759cde25462784395a337460bde75f58e73d3f08bd31fdc3507cbac856a2c4")
assert_raises_rpc_error(-5, "Block not found", self.nodes[0].listsinceblock, assert_raises_rpc_error(-5, "Block not found", self.nodes[0].listsinceblock,
@ -100,6 +102,7 @@ class ListSinceBlockTest(BitcoinTestFramework):
This test only checks that [tx0] is present. This test only checks that [tx0] is present.
''' '''
self.log.info("Test reorg")
# Split network into two # Split network into two
self.split_network() self.split_network()
@ -110,7 +113,7 @@ class ListSinceBlockTest(BitcoinTestFramework):
# generate on both sides # generate on both sides
lastblockhash = self.nodes[1].generate(6)[5] lastblockhash = self.nodes[1].generate(6)[5]
self.nodes[2].generate(7) self.nodes[2].generate(7)
self.log.info('lastblockhash=%s' % (lastblockhash)) self.log.debug('lastblockhash={}'.format(lastblockhash))
self.sync_all(self.nodes[:2]) self.sync_all(self.nodes[:2])
self.sync_all(self.nodes[2:]) self.sync_all(self.nodes[2:])
@ -155,6 +158,7 @@ class ListSinceBlockTest(BitcoinTestFramework):
until the fork point, and to include all transactions that relate to the until the fork point, and to include all transactions that relate to the
node wallet. node wallet.
''' '''
self.log.info("Test double spend")
self.sync_all() self.sync_all()
@ -234,6 +238,7 @@ class ListSinceBlockTest(BitcoinTestFramework):
3. It is listed with a confirmation count of 2 (bb3, bb4), not 3. It is listed with a confirmation count of 2 (bb3, bb4), not
3 (aa1, aa2, aa3). 3 (aa1, aa2, aa3).
''' '''
self.log.info("Test double send")
self.sync_all() self.sync_all()
@ -302,6 +307,7 @@ class ListSinceBlockTest(BitcoinTestFramework):
`listsinceblock` was returning conflicted transactions even if they `listsinceblock` was returning conflicted transactions even if they
occurred before the specified cutoff blockhash occurred before the specified cutoff blockhash
''' '''
self.log.info("Test spends filtered")
spending_node = self.nodes[2] spending_node = self.nodes[2]
dest_address = spending_node.getnewaddress() dest_address = spending_node.getnewaddress()