Skip to content

Commit

Permalink
Fix datadir path in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timemarkovqtum committed May 21, 2024
1 parent b1968ff commit 9e54d9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions test/functional/qtum_delegation_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,9 @@ def run_test(self):
self.staker_privkey = self.staker.dumpprivkey(self.staker_address)
self.staker_eckey = wif_to_ECKey(self.staker_privkey)

self.wallet_clean_path = os.path.join(self.nodes[5].datadir, 'regtest', 'wallets')
self.wallet_path = os.path.join(self.staker.datadir, 'regtest', 'wallets')
self.wallet_backup_path = os.path.join(self.staker.datadir, 'regtest', 'backup_wallets')
self.wallet_clean_path = self.nodes[5].datadir_path / "regtest" / "wallets"
self.wallet_path = self.staker.datadir_path / "regtest" / "wallets"
self.wallet_backup_path = self.staker.datadir_path / "regtest" / "backup_wallets"
shutil.copytree(self.wallet_clean_path, self.wallet_backup_path)

self.staker.generatetoaddress(1, self.staker_address)
Expand Down
8 changes: 4 additions & 4 deletions test/functional/qtum_header_spam.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def can_sync_after_offline_period_test(self):
self.sync_blocks()

def reorg_requires_more_chainwork_test(self):
old_size = get_dir_size(self.node.datadir+'/regtest/blocks/')
old_size = get_dir_size("{}/regtest/blocks/".format(self.node.datadir_path))
self.start_p2p_connection()

tip = self.node.getblock(self.node.getblockhash(self.node.getblockcount() - 20))
Expand Down Expand Up @@ -246,13 +246,13 @@ def reorg_requires_more_chainwork_test(self):
self.p2p_node.send_message(msg_block(block))
self.p2p_node.sync_with_ping()

new_size = get_dir_size(self.node.datadir+'/regtest/blocks/')
new_size = get_dir_size("{}/regtest/blocks/".format(self.node.datadir_path))
assert(new_size-old_size < 1000000)
self.close_p2p_connection()


def spam_same_stake_block_test(self):
old_size = get_dir_size(self.node.datadir+'/regtest/blocks/')
old_size = get_dir_size("{}/regtest/blocks/".format(self.node.datadir_path))
self.start_p2p_connection()

tip = self.node.getblock(self.node.getblockhash(self.node.getblockcount()-1))
Expand All @@ -276,7 +276,7 @@ def spam_same_stake_block_test(self):
self.p2p_node.send_message(msg_block(block))
time.sleep(10)

new_size = get_dir_size(self.node.datadir+'/regtest/blocks/')
new_size = get_dir_size("{}/regtest/blocks/".format(self.node.datadir_path))
assert(new_size-old_size < 1000000)
self.close_p2p_connection()

Expand Down

0 comments on commit 9e54d9f

Please sign in to comment.