diff --git a/test/functional/feature_asmap.py b/test/functional/feature_asmap.py index eec6b91127..b4486a7376 100755 --- a/test/functional/feature_asmap.py +++ b/test/functional/feature_asmap.py @@ -4,21 +4,21 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test asmap config argument for ASN-based IP bucketing. -Verify node behaviour and debug log when launching bitcoind in these cases: +Verify node behaviour and debug log when launching blackmored in these cases: -1. `bitcoind` with no -asmap arg, using /16 prefix for IP bucketing +1. `blackmored` with no -asmap arg, using /16 prefix for IP bucketing -2. `bitcoind -asmap=`, using the unit test skeleton asmap +2. `blackmored -asmap=`, using the unit test skeleton asmap -3. `bitcoind -asmap=`, using the unit test skeleton asmap +3. `blackmored -asmap=`, using the unit test skeleton asmap -4. `bitcoind -asmap/-asmap=` with no file specified, using the default asmap +4. `blackmored -asmap/-asmap=` with no file specified, using the default asmap -5. `bitcoind -asmap` restart with an addrman containing new and tried entries +5. `blackmored -asmap` restart with an addrman containing new and tried entries -6. `bitcoind -asmap` with no file specified and a missing default asmap file +6. `blackmored -asmap` with no file specified and a missing default asmap file -7. `bitcoind -asmap` with an empty (unparsable) default asmap file +7. `blackmored -asmap` with an empty (unparsable) default asmap file The tests are order-independent. @@ -47,13 +47,13 @@ def fill_addrman(self, node_id): self.nodes[node_id].addpeeraddress(address=f"101.{addr}.0.0", tried=tried, port=15714) def test_without_asmap_arg(self): - self.log.info('Test bitcoind with no -asmap arg passed') + self.log.info('Test blackmored with no -asmap arg passed') self.stop_node(0) with self.node.assert_debug_log(['Using /16 prefix for IP bucketing']): self.start_node(0) def test_asmap_with_absolute_path(self): - self.log.info('Test bitcoind -asmap=') + self.log.info('Test blackmored -asmap=') self.stop_node(0) filename = os.path.join(self.datadir, 'my-map-file.map') shutil.copyfile(self.asmap_raw, filename) @@ -62,7 +62,7 @@ def test_asmap_with_absolute_path(self): os.remove(filename) def test_asmap_with_relative_path(self): - self.log.info('Test bitcoind -asmap=') + self.log.info('Test blackmored -asmap=') self.stop_node(0) name = 'ASN_map' filename = os.path.join(self.datadir, name) @@ -74,14 +74,14 @@ def test_asmap_with_relative_path(self): def test_default_asmap(self): shutil.copyfile(self.asmap_raw, self.default_asmap) for arg in ['-asmap', '-asmap=']: - self.log.info(f'Test bitcoind {arg} (using default map file)') + self.log.info(f'Test blackmored {arg} (using default map file)') self.stop_node(0) with self.node.assert_debug_log(expected_messages(self.default_asmap)): self.start_node(0, [arg]) os.remove(self.default_asmap) def test_asmap_interaction_with_addrman_containing_entries(self): - self.log.info("Test bitcoind -asmap restart with addrman containing new and tried entries") + self.log.info("Test blackmored -asmap restart with addrman containing new and tried entries") self.stop_node(0) shutil.copyfile(self.asmap_raw, self.default_asmap) self.start_node(0, ["-asmap", "-checkaddrman=1"]) @@ -97,13 +97,13 @@ def test_asmap_interaction_with_addrman_containing_entries(self): os.remove(self.default_asmap) def test_default_asmap_with_missing_file(self): - self.log.info('Test bitcoind -asmap with missing default map file') + self.log.info('Test blackmored -asmap with missing default map file') self.stop_node(0) msg = f"Error: Could not find asmap file \"{self.default_asmap}\"" self.node.assert_start_raises_init_error(extra_args=['-asmap'], expected_msg=msg) def test_empty_asmap(self): - self.log.info('Test bitcoind -asmap with empty map file') + self.log.info('Test blackmored -asmap with empty map file') self.stop_node(0) with open(self.default_asmap, "w", encoding="utf-8") as f: f.write("") diff --git a/test/functional/feature_cltv.py b/test/functional/feature_cltv.py index c864931fbb..6e2041822d 100755 --- a/test/functional/feature_cltv.py +++ b/test/functional/feature_cltv.py @@ -84,7 +84,7 @@ class BIP65Test(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 self.extra_args = [[ - f'-whitelist=noban@127.0.0.1', + '-whitelist=noban@127.0.0.1', '-par=1', # Use only one script thread to get the exact reject reason for testing '-acceptnonstdtxn=1', # cltv_invalidate is nonstandard ]] diff --git a/test/functional/feature_dersig.py b/test/functional/feature_dersig.py index 06b73cb1ee..5187e0b7f2 100755 --- a/test/functional/feature_dersig.py +++ b/test/functional/feature_dersig.py @@ -48,7 +48,7 @@ class BIP66Test(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 self.extra_args = [[ - f'-whitelist=noban@127.0.0.1', + '-whitelist=noban@127.0.0.1', '-par=1', # Use only one script thread to get the exact log msg for testing ]] self.setup_clean_chain = True diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 5b44a9e934..24b892eab8 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -69,7 +69,7 @@ def set_test_params(self): def run_test(self): self.wallet = MiniWallet(self.nodes[0]) - self._test_prune_disk_space() + # self._test_prune_disk_space() self.mine_chain() self._test_max_future_block_time() self.restart_node( @@ -77,7 +77,7 @@ def run_test(self): extra_args=[ "-stopatheight=207", "-checkblocks=-1", # Check all blocks - "-prune=1", # Set pruning after rescan is complete + # "-prune=1", # Set pruning after rescan is complete ], ) @@ -101,12 +101,14 @@ def mine_chain(self): self.generate(self.wallet, 1) assert_equal(self.nodes[0].getblockchaininfo()['blocks'], HEIGHT) + ''' def _test_prune_disk_space(self): self.log.info("Test that a manually pruned node does not run into " "integer overflow on first start up") self.restart_node(0, extra_args=["-prune=1"]) self.log.info("Avoid warning when assumed chain size is enough") self.restart_node(0, extra_args=["-prune=123456789"]) + ''' def _test_max_future_block_time(self): self.stop_node(0) @@ -133,7 +135,7 @@ def _test_getblockchaininfo(self): 'headers', 'initialblockdownload', 'mediantime', - 'pruned', + # 'pruned', 'size_on_disk', 'time', 'verificationprogress', @@ -145,17 +147,17 @@ def _test_getblockchaininfo(self): assert_equal(res['mediantime'], TIME_RANGE_MTP) # result should have these additional pruning keys if manual pruning is enabled - assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning'] + keys)) + # assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning'] + keys)) # size_on_disk should be > 0 assert_greater_than(res['size_on_disk'], 0) # pruneheight should be greater or equal to 0 - assert_greater_than_or_equal(res['pruneheight'], 0) + # assert_greater_than_or_equal(res['pruneheight'], 0) # check other pruning fields given that prune=1 - assert res['pruned'] - assert not res['automatic_pruning'] + # assert res['pruned'] + # assert not res['automatic_pruning'] self.restart_node(0, ['-stopatheight=207']) res = self.nodes[0].getblockchaininfo() @@ -173,18 +175,18 @@ def _test_getblockchaininfo(self): ) self.start_node(0, extra_args=[ '-stopatheight=207', - '-prune=550', + # '-prune=550', ]) res = self.nodes[0].getblockchaininfo() # result should have these additional pruning keys if prune=550 - assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning', 'prune_target_size'] + keys)) + # assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning', 'prune_target_size'] + keys)) # check related fields - assert res['pruned'] - assert_equal(res['pruneheight'], 0) - assert res['automatic_pruning'] - assert_equal(res['prune_target_size'], 576716800) + # assert res['pruned'] + # assert_equal(res['pruneheight'], 0) + # assert res['automatic_pruning'] + # assert_equal(res['prune_target_size'], 576716800) assert_greater_than(res['size_on_disk'], 0) def check_signalling_deploymentinfo_result(self, gdi_result, height, blockhash, status_next): @@ -321,7 +323,7 @@ def _test_gettxoutsetinfo(self): node = self.nodes[0] res = node.gettxoutsetinfo() - assert_equal(res['total_amount'], Decimal('8725.00000000')) + assert_equal(res['total_amount'], Decimal('2000000.00000000')) assert_equal(res['transactions'], HEIGHT) assert_equal(res['height'], HEIGHT) assert_equal(res['txouts'], HEIGHT) diff --git a/test/functional/rpc_createmultisig.py b/test/functional/rpc_createmultisig.py index bec499107f..1a30ddb456 100755 --- a/test/functional/rpc_createmultisig.py +++ b/test/functional/rpc_createmultisig.py @@ -181,7 +181,7 @@ def do_multisig(self): mredeem = msig["redeemScript"] assert_equal(desc, msig['descriptor']) if self.output_type == 'bech32': - assert madd[0:4] == "bcrt" # actually a bech32 address + assert madd[0:4] == "blrt" # actually a bech32 address if self.is_bdb_compiled(): # compare against addmultisigaddress diff --git a/test/functional/rpc_dumptxoutset.py b/test/functional/rpc_dumptxoutset.py index 39a931be03..11420b50e0 100755 --- a/test/functional/rpc_dumptxoutset.py +++ b/test/functional/rpc_dumptxoutset.py @@ -31,8 +31,8 @@ def run_test(self): assert expected_path.is_file() - assert_equal(out['coins_written'], 100) - assert_equal(out['base_height'], 100) + assert_equal(out['coins_written'], 10) + assert_equal(out['base_height'], 10) assert_equal(out['path'], str(expected_path)) # Blockhash should be deterministic based on mocked time. assert_equal( diff --git a/test/functional/tool_wallet.py b/test/functional/tool_wallet.py index cd72a613c2..f8fa6c701b 100755 --- a/test/functional/tool_wallet.py +++ b/test/functional/tool_wallet.py @@ -2,7 +2,7 @@ # Copyright (c) 2018-2022 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -"""Test bitcoin-wallet.""" +"""Test blackmore-wallet.""" import hashlib import os @@ -32,7 +32,7 @@ def skip_test_if_missing_module(self): self.skip_if_no_wallet_tool() def bitcoin_wallet_process(self, *args): - binary = self.config["environment"]["BUILDDIR"] + '/src/bitcoin-wallet' + self.config["environment"]["EXEEXT"] + binary = self.config["environment"]["BUILDDIR"] + '/src/blackmore-wallet' + self.config["environment"]["EXEEXT"] default_args = ['-datadir={}'.format(self.nodes[0].datadir), '-chain=%s' % self.chain] if not self.options.descriptors and 'create' in args: default_args.append('-legacy') @@ -176,7 +176,7 @@ def do_tool_createfromdump(self, wallet_name, dumpfile, file_format=None): self.assert_tool_output(load_output, *args) assert os.path.isdir(os.path.join(self.nodes[0].datadir, "regtest/wallets", wallet_name)) - self.assert_tool_output("The dumpfile may contain private keys. To ensure the safety of your Bitcoin, do not share the dumpfile.\n", '-wallet={}'.format(wallet_name), '-dumpfile={}'.format(rt_dumppath), 'dump') + self.assert_tool_output("The dumpfile may contain private keys. To ensure the safety of your Blackcoin, do not share the dumpfile.\n", '-wallet={}'.format(wallet_name), '-dumpfile={}'.format(rt_dumppath), 'dump') rt_dump_data = self.read_dump(rt_dumppath) wallet_dat = os.path.join(self.nodes[0].datadir, "regtest/wallets/", wallet_name, "wallet.dat") @@ -188,11 +188,11 @@ def do_tool_createfromdump(self, wallet_name, dumpfile, file_format=None): def test_invalid_tool_commands_and_args(self): self.log.info('Testing that various invalid commands raise with specific error messages') self.assert_raises_tool_error("Error parsing command line arguments: Invalid command 'foo'", 'foo') - # `bitcoin-wallet help` raises an error. Use `bitcoin-wallet -help`. + # `blackmore-wallet help` raises an error. Use `blackmore-wallet -help`. self.assert_raises_tool_error("Error parsing command line arguments: Invalid command 'help'", 'help') self.assert_raises_tool_error('Error: Additional arguments provided (create). Methods do not take arguments. Please refer to `-help`.', 'info', 'create') self.assert_raises_tool_error('Error parsing command line arguments: Invalid parameter -foo', '-foo') - self.assert_raises_tool_error('No method provided. Run `bitcoin-wallet -help` for valid methods.') + self.assert_raises_tool_error('No method provided. Run `blackmore-wallet -help` for valid methods.') self.assert_raises_tool_error('Wallet name must be provided when creating a new wallet.', 'create') locked_dir = os.path.join(self.options.tmpdir, "node0", "regtest", "wallets") error = 'Error initializing wallet database environment "{}"!'.format(locked_dir) @@ -331,7 +331,7 @@ def test_dump_createfromdump(self): self.log.info('Checking basic dump') wallet_dump = os.path.join(self.nodes[0].datadir, "wallet.dump") - self.assert_tool_output('The dumpfile may contain private keys. To ensure the safety of your Bitcoin, do not share the dumpfile.\n', '-wallet=todump', '-dumpfile={}'.format(wallet_dump), 'dump') + self.assert_tool_output('The dumpfile may contain private keys. To ensure the safety of your Blackcoin, do not share the dumpfile.\n', '-wallet=todump', '-dumpfile={}'.format(wallet_dump), 'dump') dump_data = self.read_dump(wallet_dump) orig_dump = dump_data.copy() @@ -363,12 +363,12 @@ def test_dump_createfromdump(self): bad_ver_wallet_dump = os.path.join(self.nodes[0].datadir, "wallet-bad_ver1.dump") dump_data["BITCOIN_CORE_WALLET_DUMP"] = "0" self.write_dump(dump_data, bad_ver_wallet_dump) - self.assert_raises_tool_error('Error: Dumpfile version is not supported. This version of bitcoin-wallet only supports version 1 dumpfiles. Got dumpfile with version 0', '-wallet=badload', '-dumpfile={}'.format(bad_ver_wallet_dump), 'createfromdump') + self.assert_raises_tool_error('Error: Dumpfile version is not supported. This version of blackmore-wallet only supports version 1 dumpfiles. Got dumpfile with version 0', '-wallet=badload', '-dumpfile={}'.format(bad_ver_wallet_dump), 'createfromdump') assert not os.path.isdir(os.path.join(self.nodes[0].datadir, "regtest/wallets", "badload")) bad_ver_wallet_dump = os.path.join(self.nodes[0].datadir, "wallet-bad_ver2.dump") dump_data["BITCOIN_CORE_WALLET_DUMP"] = "2" self.write_dump(dump_data, bad_ver_wallet_dump) - self.assert_raises_tool_error('Error: Dumpfile version is not supported. This version of bitcoin-wallet only supports version 1 dumpfiles. Got dumpfile with version 2', '-wallet=badload', '-dumpfile={}'.format(bad_ver_wallet_dump), 'createfromdump') + self.assert_raises_tool_error('Error: Dumpfile version is not supported. This version of blackmore-wallet only supports version 1 dumpfiles. Got dumpfile with version 2', '-wallet=badload', '-dumpfile={}'.format(bad_ver_wallet_dump), 'createfromdump') assert not os.path.isdir(os.path.join(self.nodes[0].datadir, "regtest/wallets", "badload")) bad_magic_wallet_dump = os.path.join(self.nodes[0].datadir, "wallet-bad_magic.dump") del dump_data["BITCOIN_CORE_WALLET_DUMP"]