This commit is contained in:
Escanor Liones 2021-10-15 19:46:35 +01:00 committed by GitHub
commit 58fea92ec3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 14 deletions

View file

@ -131,21 +131,21 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
node_master.createwallet(wallet_name="w2", disable_private_keys=True) node_master.createwallet(wallet_name="w2", disable_private_keys=True)
wallet = node_master.get_wallet_rpc("w2") wallet = node_master.get_wallet_rpc("w2")
info = wallet.getwalletinfo() info = wallet.getwalletinfo()
assert info['private_keys_enabled'] == False assert info['private_keys_enabled'] is False
assert info['keypoolsize'] == 0 assert info['keypoolsize'] == 0
# w2_v19: wallet with private keys disabled, created with v0.19 # w2_v19: wallet with private keys disabled, created with v0.19
node_v19.rpc.createwallet(wallet_name="w2_v19", disable_private_keys=True) node_v19.rpc.createwallet(wallet_name="w2_v19", disable_private_keys=True)
wallet = node_v19.get_wallet_rpc("w2_v19") wallet = node_v19.get_wallet_rpc("w2_v19")
info = wallet.getwalletinfo() info = wallet.getwalletinfo()
assert info['private_keys_enabled'] == False assert info['private_keys_enabled'] is False
assert info['keypoolsize'] == 0 assert info['keypoolsize'] == 0
# w2_v18: wallet with private keys disabled, created with v0.18 # w2_v18: wallet with private keys disabled, created with v0.18
node_v18.rpc.createwallet(wallet_name="w2_v18", disable_private_keys=True) node_v18.rpc.createwallet(wallet_name="w2_v18", disable_private_keys=True)
wallet = node_v18.get_wallet_rpc("w2_v18") wallet = node_v18.get_wallet_rpc("w2_v18")
info = wallet.getwalletinfo() info = wallet.getwalletinfo()
assert info['private_keys_enabled'] == False assert info['private_keys_enabled'] is False
assert info['keypoolsize'] == 0 assert info['keypoolsize'] == 0
# w3: blank wallet, created on master: update this # w3: blank wallet, created on master: update this
@ -240,7 +240,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
node_v19.loadwallet("w2") node_v19.loadwallet("w2")
wallet = node_v19.get_wallet_rpc("w2") wallet = node_v19.get_wallet_rpc("w2")
info = wallet.getwalletinfo() info = wallet.getwalletinfo()
assert info['private_keys_enabled'] == False assert info['private_keys_enabled'] is False
assert info['keypoolsize'] == 0 assert info['keypoolsize'] == 0
node_v19.loadwallet("w3") node_v19.loadwallet("w3")
@ -271,7 +271,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
node_v18.loadwallet("w2") node_v18.loadwallet("w2")
wallet = node_v18.get_wallet_rpc("w2") wallet = node_v18.get_wallet_rpc("w2")
info = wallet.getwalletinfo() info = wallet.getwalletinfo()
assert info['private_keys_enabled'] == False assert info['private_keys_enabled'] is False
assert info['keypoolsize'] == 0 assert info['keypoolsize'] == 0
node_v18.loadwallet("w3") node_v18.loadwallet("w3")
@ -289,7 +289,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
node_v17.loadwallet("w2") node_v17.loadwallet("w2")
wallet = node_v17.get_wallet_rpc("w2") wallet = node_v17.get_wallet_rpc("w2")
info = wallet.getwalletinfo() info = wallet.getwalletinfo()
assert info['private_keys_enabled'] == False assert info['private_keys_enabled'] is False
assert info['keypoolsize'] == 0 assert info['keypoolsize'] == 0
else: else:
# Descriptor wallets appear to be corrupted wallets to old software # Descriptor wallets appear to be corrupted wallets to old software
@ -310,7 +310,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
node_v17.loadwallet("w2_v18") node_v17.loadwallet("w2_v18")
wallet = node_v17.get_wallet_rpc("w2_v18") wallet = node_v17.get_wallet_rpc("w2_v18")
info = wallet.getwalletinfo() info = wallet.getwalletinfo()
assert info['private_keys_enabled'] == False assert info['private_keys_enabled'] is False
assert info['keypoolsize'] == 0 assert info['keypoolsize'] == 0
# RPC loadwallet failure causes bitcoind to exit, in addition to the RPC # RPC loadwallet failure causes bitcoind to exit, in addition to the RPC

View file

@ -129,9 +129,9 @@ class P2PLeakTest(BitcoinTestFramework):
self.nodes[0].disconnect_p2ps() self.nodes[0].disconnect_p2ps()
# Make sure no unexpected messages came in # Make sure no unexpected messages came in
assert no_version_disconnect_peer.unexpected_msg == False assert no_version_disconnect_peer.unexpected_msg is False
assert no_version_idle_peer.unexpected_msg == False assert no_version_idle_peer.unexpected_msg is False
assert no_verack_idle_peer.unexpected_msg == False assert no_verack_idle_peer.unexpected_msg is False
self.log.info('Check that the version message does not leak the local address of the node') self.log.info('Check that the version message does not leak the local address of the node')
p2p_version_store = self.nodes[0].add_p2p_connection(P2PVersionStore()) p2p_version_store = self.nodes[0].add_p2p_connection(P2PVersionStore())

View file

@ -120,7 +120,7 @@ class TxDownloadTest(BitcoinTestFramework):
# peer, plus # peer, plus
# * the first time it is re-requested from the outbound peer, plus # * the first time it is re-requested from the outbound peer, plus
# * 2 seconds to avoid races # * 2 seconds to avoid races
assert self.nodes[1].getpeerinfo()[0]['inbound'] == False assert self.nodes[1].getpeerinfo()[0]['inbound'] is False
timeout = 2 + INBOUND_PEER_TX_DELAY + GETDATA_TX_INTERVAL timeout = 2 + INBOUND_PEER_TX_DELAY + GETDATA_TX_INTERVAL
self.log.info("Tx should be received at node 1 after {} seconds".format(timeout)) self.log.info("Tx should be received at node 1 after {} seconds".format(timeout))
self.sync_mempools(timeout=timeout) self.sync_mempools(timeout=timeout)

View file

@ -22,9 +22,9 @@ class DisableWalletTest (BitcoinTestFramework):
# Make sure wallet is really disabled # Make sure wallet is really disabled
assert_raises_rpc_error(-32601, 'Method not found', self.nodes[0].getwalletinfo) assert_raises_rpc_error(-32601, 'Method not found', self.nodes[0].getwalletinfo)
x = self.nodes[0].validateaddress('A8tPcraiJcyw6k8tLrK36vc6DSAsXwu8f7') x = self.nodes[0].validateaddress('A8tPcraiJcyw6k8tLrK36vc6DSAsXwu8f7')
assert x['isvalid'] == False assert x['isvalid'] is False
x = self.nodes[0].validateaddress('nbKkSz78JGfsPqitXGcqgHhrDrgizjB3bW') x = self.nodes[0].validateaddress('nbKkSz78JGfsPqitXGcqgHhrDrgizjB3bW')
assert x['isvalid'] == True assert x['isvalid'] is True
# Checking mining to an address without a wallet. Generating to a valid address should succeed # Checking mining to an address without a wallet. Generating to a valid address should succeed
# but generating to an invalid address will fail. # but generating to an invalid address will fail.

View file

@ -37,7 +37,7 @@ class TxnMallTest(BitcoinTestFramework):
# blockchain sync later in the test when nodes are connected, due to # blockchain sync later in the test when nodes are connected, due to
# timing issues. # timing issues.
for n in self.nodes: for n in self.nodes:
assert n.getblockchaininfo()["initialblockdownload"] == False assert n.getblockchaininfo()["initialblockdownload"] is False
for i in range(4): for i in range(4):
assert_equal(self.nodes[i].getbalance(), starting_balance) assert_equal(self.nodes[i].getbalance(), starting_balance)