0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-10 10:52:31 -05:00

test: add logging to wallet_listsinceblock.py

This commit is contained in:
Jon Atack 2019-11-20 16:22:53 +01:00
parent 5518eeec27
commit d484279a46
No known key found for this signature in database
GPG key ID: 4F5721B3D0E3921D

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()