mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 02:31:05 +02:00
Merge #14324: qa: Run more tests with wallet disabled
faa4043c66
qa: Run more tests with wallet disabled (MarcoFalke)
Pull request description:
Instead of skipping the whole test, only skip the wallet specific section of a test if the wallet is not compiled in. This is mostly an indentation change, so can be reviewed with `--ignore-all-space`.
Tree-SHA512: 5941a8b6b00dca5cf9438c5f6f010ba812115188a69e427d7ade4c1ab8cfe7a57c73daf52c66235dbb24b1cd9ab7c7a17c49bc23d931e041b605d79116a71f66
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
"""Test the ZMQ notification interface."""
|
||||
import struct
|
||||
|
||||
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.messages import CTransaction
|
||||
from test_framework.util import (
|
||||
@ -42,7 +43,6 @@ class ZMQTest (BitcoinTestFramework):
|
||||
def skip_test_if_missing_module(self):
|
||||
self.skip_if_no_py3_zmq()
|
||||
self.skip_if_no_bitcoind_zmq()
|
||||
self.skip_if_no_wallet()
|
||||
|
||||
def setup_nodes(self):
|
||||
import zmq
|
||||
@ -81,7 +81,7 @@ class ZMQTest (BitcoinTestFramework):
|
||||
def _zmq_test(self):
|
||||
num_blocks = 5
|
||||
self.log.info("Generate %(n)d blocks (and %(n)d coinbase txes)" % {"n": num_blocks})
|
||||
genhashes = self.nodes[0].generate(num_blocks)
|
||||
genhashes = self.nodes[0].generatetoaddress(num_blocks, ADDRESS_BCRT1_UNSPENDABLE)
|
||||
self.sync_all()
|
||||
|
||||
for x in range(num_blocks):
|
||||
@ -105,17 +105,19 @@ class ZMQTest (BitcoinTestFramework):
|
||||
block = self.rawblock.receive()
|
||||
assert_equal(genhashes[x], bytes_to_hex_str(hash256(block[:80])))
|
||||
|
||||
self.log.info("Wait for tx from second node")
|
||||
payment_txid = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1.0)
|
||||
self.sync_all()
|
||||
if self.is_wallet_compiled():
|
||||
self.log.info("Wait for tx from second node")
|
||||
payment_txid = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1.0)
|
||||
self.sync_all()
|
||||
|
||||
# Should receive the broadcasted txid.
|
||||
txid = self.hashtx.receive()
|
||||
assert_equal(payment_txid, bytes_to_hex_str(txid))
|
||||
# Should receive the broadcasted txid.
|
||||
txid = self.hashtx.receive()
|
||||
assert_equal(payment_txid, bytes_to_hex_str(txid))
|
||||
|
||||
# Should receive the broadcasted raw transaction.
|
||||
hex = self.rawtx.receive()
|
||||
assert_equal(payment_txid, bytes_to_hex_str(hash256(hex)))
|
||||
|
||||
# Should receive the broadcasted raw transaction.
|
||||
hex = self.rawtx.receive()
|
||||
assert_equal(payment_txid, bytes_to_hex_str(hash256(hex)))
|
||||
|
||||
self.log.info("Test the getzmqnotifications RPC")
|
||||
assert_equal(self.nodes[0].getzmqnotifications(), [
|
||||
|
Reference in New Issue
Block a user