diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/feature_txindex_compatibility.py | 6 | ||||
-rwxr-xr-x | test/functional/mempool_compatibility.py | 5 | ||||
-rwxr-xr-x | test/functional/test_framework/test_node.py | 2 | ||||
-rwxr-xr-x | test/functional/test_runner.py | 8 | ||||
-rwxr-xr-x | test/functional/wallet_backwards_compatibility.py (renamed from test/functional/feature_backwards_compatibility.py) | 5 | ||||
-rwxr-xr-x | test/functional/wallet_fundrawtransaction.py (renamed from test/functional/rpc_fundrawtransaction.py) | 0 | ||||
-rwxr-xr-x | test/functional/wallet_listsinceblock.py | 15 |
7 files changed, 27 insertions, 14 deletions
diff --git a/test/functional/feature_txindex_compatibility.py b/test/functional/feature_txindex_compatibility.py index 20b023d82c..13dbdfce71 100755 --- a/test/functional/feature_txindex_compatibility.py +++ b/test/functional/feature_txindex_compatibility.py @@ -14,7 +14,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.wallet import MiniWallet -class MempoolCompatibilityTest(BitcoinTestFramework): +class TxindexCompatibilityTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 3 self.extra_args = [ @@ -33,7 +33,7 @@ class MempoolCompatibilityTest(BitcoinTestFramework): versions=[ 160300, # Last release with legacy txindex None, # For MiniWallet, without migration code - 200100, # Any release with migration code (0.17.x - 22.x) + 220000, # Last release with migration code (0.17.x - 22.x) ], ) self.start_nodes() @@ -89,4 +89,4 @@ class MempoolCompatibilityTest(BitcoinTestFramework): if __name__ == "__main__": - MempoolCompatibilityTest().main() + TxindexCompatibilityTest().main() diff --git a/test/functional/mempool_compatibility.py b/test/functional/mempool_compatibility.py index f789a19ef3..c9233d6133 100755 --- a/test/functional/mempool_compatibility.py +++ b/test/functional/mempool_compatibility.py @@ -7,7 +7,7 @@ NOTE: The test is designed to prevent cases when compatibility is broken accidentally. In case we need to break mempool compatibility we can continue to use the test by just bumping the version number. -The previous release v0.19.1 is required by this test, see test/README.md. +Previous releases are required by this test, see test/README.md. """ import os @@ -29,7 +29,7 @@ class MempoolCompatibilityTest(BitcoinTestFramework): def setup_network(self): self.add_nodes(self.num_nodes, versions=[ - 190100, # oldest version with getmempoolinfo.loaded (used to avoid intermittent issues) + 200100, # Last release with previous mempool format None, ]) self.start_nodes() @@ -38,6 +38,7 @@ class MempoolCompatibilityTest(BitcoinTestFramework): self.log.info("Test that mempool.dat is compatible between versions") old_node, new_node = self.nodes + assert "unbroadcastcount" not in old_node.getmempoolinfo() new_wallet = MiniWallet(new_node, mode=MiniWalletMode.RAW_P2PK) self.generate(new_wallet, 1, sync_fun=self.no_op) self.generate(new_node, COINBASE_MATURITY, sync_fun=self.no_op) diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index fc93940b63..2d3b105fa2 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -337,7 +337,7 @@ class TestNode(): return self.log.debug("Stopping node") try: - # Do not use wait argument when testing older nodes, e.g. in feature_backwards_compatibility.py + # Do not use wait argument when testing older nodes, e.g. in wallet_backwards_compatibility.py if self.version_is_at_least(180000): self.stop(wait=wait) else: diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index b9adb5dcb5..31b308546d 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -98,8 +98,8 @@ BASE_SCRIPTS = [ 'mining_getblocktemplate_longpoll.py', 'feature_maxuploadtarget.py', 'feature_block.py', - 'rpc_fundrawtransaction.py --legacy-wallet', - 'rpc_fundrawtransaction.py --descriptors', + 'wallet_fundrawtransaction.py --legacy-wallet', + 'wallet_fundrawtransaction.py --descriptors', 'p2p_compactblocks.py', 'p2p_compactblocks_blocksonly.py', 'feature_segwit.py --legacy-wallet', @@ -226,8 +226,8 @@ BASE_SCRIPTS = [ 'wallet_txn_doublespend.py --legacy-wallet', 'wallet_multisig_descriptor_psbt.py --descriptors', 'wallet_txn_doublespend.py --descriptors', - 'feature_backwards_compatibility.py --legacy-wallet', - 'feature_backwards_compatibility.py --descriptors', + 'wallet_backwards_compatibility.py --legacy-wallet', + 'wallet_backwards_compatibility.py --descriptors', 'wallet_txn_clone.py --mineblock', 'feature_notifications.py', 'rpc_getblockfilter.py', diff --git a/test/functional/feature_backwards_compatibility.py b/test/functional/wallet_backwards_compatibility.py index 5fe4a95f6f..c9cb3285fb 100755 --- a/test/functional/feature_backwards_compatibility.py +++ b/test/functional/wallet_backwards_compatibility.py @@ -7,10 +7,6 @@ Test various backwards compatibility scenarios. Requires previous releases binaries, see test/README.md. -v0.15.2 is not required by this test, but it is used in wallet_upgradewallet.py. -Due to a hardfork in regtest, it can't be used to sync nodes. - - Due to RPC changes introduced in various versions the below tests won't work for older versions without some patches or workarounds. @@ -274,6 +270,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework): assert_equal(info["desc"], descsum_create(descriptor)) # Now copy that same wallet back to 0.16 to make sure no automatic upgrade breaks it + node_master.unloadwallet("u1_v16") os.remove(os.path.join(node_v16_wallets_dir, "wallets/u1_v16")) shutil.copyfile( os.path.join(node_master_wallets_dir, "u1_v16"), diff --git a/test/functional/rpc_fundrawtransaction.py b/test/functional/wallet_fundrawtransaction.py index bf218bfee9..bf218bfee9 100755 --- a/test/functional/rpc_fundrawtransaction.py +++ b/test/functional/wallet_fundrawtransaction.py diff --git a/test/functional/wallet_listsinceblock.py b/test/functional/wallet_listsinceblock.py index ecdfb7d0e3..62e9c5ba97 100755 --- a/test/functional/wallet_listsinceblock.py +++ b/test/functional/wallet_listsinceblock.py @@ -49,6 +49,7 @@ class ListSinceBlockTest(BitcoinTestFramework): self.test_desc() self.test_send_to_self() self.test_op_return() + self.test_label() def test_no_blockhash(self): self.log.info("Test no blockhash") @@ -465,6 +466,20 @@ class ListSinceBlockTest(BitcoinTestFramework): assert 'address' not in op_ret_tx + def test_label(self): + self.log.info('Test passing "label" argument fetches incoming transactions having the specified label') + new_addr = self.nodes[1].getnewaddress(label="new_addr", address_type="bech32") + + self.nodes[2].sendtoaddress(address=new_addr, amount="0.001") + self.generate(self.nodes[2], 1) + + for label in ["new_addr", ""]: + new_addr_transactions = self.nodes[1].listsinceblock(label=label)["transactions"] + assert_equal(len(new_addr_transactions), 1) + assert_equal(new_addr_transactions[0]["label"], label) + if label == "new_addr": + assert_equal(new_addr_transactions[0]["address"], new_addr) + if __name__ == '__main__': ListSinceBlockTest().main() |