mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 11:32:46 +01:00
test: remove redundant self.nodes
from self.sync_
{blocks
,all
}
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
This commit is contained in:
parent
3dcd87506e
commit
e913a45eaf
@ -73,7 +73,7 @@ class DIP3Test(BitcoinTestFramework):
|
||||
|
||||
# We have hundreds of blocks to sync here, give it more time
|
||||
self.log.info("syncing blocks for all nodes")
|
||||
self.sync_blocks(self.nodes, timeout=120)
|
||||
self.sync_blocks(timeout=120)
|
||||
|
||||
# DIP3 is fully enforced here
|
||||
|
||||
|
@ -87,7 +87,7 @@ class DIP3V19Test(DashTestFramework):
|
||||
evo_info_0 = self.dynamically_add_masternode(evo=True, rnd=7)
|
||||
assert evo_info_0 is not None
|
||||
self.generate(self.nodes[0], 8)
|
||||
self.sync_blocks(self.nodes)
|
||||
self.sync_blocks()
|
||||
|
||||
self.log.info("Checking that protxs with duplicate EvoNodes fields are rejected")
|
||||
evo_info_1 = self.dynamically_add_masternode(evo=True, rnd=7, should_be_rejected=True)
|
||||
@ -98,7 +98,7 @@ class DIP3V19Test(DashTestFramework):
|
||||
evo_info_3 = self.dynamically_add_masternode(evo=True, rnd=9)
|
||||
assert evo_info_3 is not None
|
||||
self.generate(self.nodes[0], 8)
|
||||
self.sync_blocks(self.nodes)
|
||||
self.sync_blocks()
|
||||
self.dynamically_evo_update_service(evo_info_0, 9, should_be_rejected=True)
|
||||
|
||||
revoke_protx = self.mninfo[-1].proTxHash
|
||||
@ -128,7 +128,7 @@ class DIP3V19Test(DashTestFramework):
|
||||
self.wait_for_instantlock(fund_txid, self.nodes[0])
|
||||
tip = self.generate(self.nodes[0], 1)[0]
|
||||
assert_equal(self.nodes[0].getrawtransaction(fund_txid, 1, tip)['confirmations'], 1)
|
||||
self.sync_all(self.nodes)
|
||||
self.sync_all()
|
||||
|
||||
protx_result = self.nodes[0].protx('revoke', revoke_protx, revoke_keyoperator, 1, funds_address)
|
||||
self.wait_for_instantlock(protx_result, self.nodes[0])
|
||||
@ -138,7 +138,7 @@ class DIP3V19Test(DashTestFramework):
|
||||
# and then reconnect the corresponding node back to let sync_blocks finish correctly.
|
||||
self.wait_until(lambda: self.nodes[node_idx].getconnectioncount() == 0)
|
||||
self.connect_nodes(node_idx, 0)
|
||||
self.sync_all(self.nodes)
|
||||
self.sync_all()
|
||||
self.log.info(f"Successfully revoked={revoke_protx}")
|
||||
for mn in self.mninfo:
|
||||
if mn.proTxHash == revoke_protx:
|
||||
|
@ -239,7 +239,7 @@ class LLMQChainLocksTest(DashTestFramework):
|
||||
self.log.info("Test that new node can mine without Chainlock info")
|
||||
tip_0 = self.nodes[0].getblock(self.nodes[0].getbestblockhash(), 2)
|
||||
self.generate(self.nodes[added_idx], 1)
|
||||
self.sync_blocks(self.nodes)
|
||||
self.sync_blocks()
|
||||
tip_1 = self.nodes[0].getblock(self.nodes[0].getbestblockhash(), 2)
|
||||
assert_equal(tip_1['cbTx']['bestCLSignature'], tip_0['cbTx']['bestCLSignature'])
|
||||
assert_equal(tip_1['cbTx']['bestCLHeightDiff'], tip_0['cbTx']['bestCLHeightDiff'] + 1)
|
||||
|
@ -90,7 +90,7 @@ class LLMQEvoNodesTest(DashTestFramework):
|
||||
evo_info = self.dynamically_add_masternode(evo=True)
|
||||
evo_protxhash_list.append(evo_info.proTxHash)
|
||||
self.generate(self.nodes[0], 8)
|
||||
self.sync_blocks(self.nodes)
|
||||
self.sync_blocks()
|
||||
|
||||
expectedUpdated.append(evo_info.proTxHash)
|
||||
b_i = self.nodes[0].getbestblockhash()
|
||||
@ -216,7 +216,7 @@ class LLMQEvoNodesTest(DashTestFramework):
|
||||
outputs = {collateral_address: collateral_amount, funds_address: 1}
|
||||
collateral_txid = self.nodes[0].sendmany("", outputs)
|
||||
self.generate(self.nodes[0], 8)
|
||||
self.sync_all(self.nodes)
|
||||
self.sync_all()
|
||||
|
||||
rawtx = self.nodes[0].getrawtransaction(collateral_txid, 1)
|
||||
collateral_vout = 0
|
||||
|
@ -216,7 +216,7 @@ class SendHeadersTest(BitcoinTestFramework):
|
||||
|
||||
# make sure all invalidated blocks are node0's
|
||||
self.generatetoaddress(self.nodes[0], length, self.nodes[0].get_deterministic_priv_key().address)
|
||||
self.sync_blocks(self.nodes, wait=0.1)
|
||||
self.sync_blocks(wait=0.1)
|
||||
for x in self.nodes[0].p2ps:
|
||||
x.wait_for_block_announcement(int(self.nodes[0].getbestblockhash(), 16))
|
||||
x.clear_block_announcements()
|
||||
@ -225,7 +225,7 @@ class SendHeadersTest(BitcoinTestFramework):
|
||||
hash_to_invalidate = self.nodes[1].getblockhash(tip_height - (length - 1))
|
||||
self.nodes[1].invalidateblock(hash_to_invalidate)
|
||||
all_hashes = self.generatetoaddress(self.nodes[1], length + 1, self.nodes[1].get_deterministic_priv_key().address) # Must be longer than the orig chain
|
||||
self.sync_blocks(self.nodes, wait=0.1)
|
||||
self.sync_blocks(wait=0.1)
|
||||
return [int(x, 16) for x in all_hashes]
|
||||
|
||||
def run_test(self):
|
||||
|
@ -150,7 +150,7 @@ class SendHeadersTest(BitcoinTestFramework):
|
||||
return the list of block hashes newly mined."""
|
||||
|
||||
self.generate(self.nodes[0], length) # make sure all invalidated blocks are node0's
|
||||
self.sync_blocks(self.nodes, wait=0.1)
|
||||
self.sync_blocks(wait=0.1)
|
||||
for p2p in self.nodes[0].p2ps:
|
||||
p2p.wait_for_block_announcement(int(self.nodes[0].getbestblockhash(), 16))
|
||||
p2p.clear_block_announcements()
|
||||
@ -159,7 +159,7 @@ class SendHeadersTest(BitcoinTestFramework):
|
||||
hash_to_invalidate = self.nodes[1].getblockhash(tip_height - (length - 1))
|
||||
self.nodes[1].invalidateblock(hash_to_invalidate)
|
||||
all_hashes = self.generate(self.nodes[1], length + 1) # Must be longer than the orig chain
|
||||
self.sync_blocks(self.nodes, wait=0.1)
|
||||
self.sync_blocks(wait=0.1)
|
||||
return [int(hash_value, 16) for hash_value in all_hashes]
|
||||
|
||||
def run_test(self):
|
||||
|
@ -1260,7 +1260,7 @@ class DashTestFramework(BitcoinTestFramework):
|
||||
self.connect_nodes(mn_idx, 0)
|
||||
|
||||
self.wait_for_sporks_same()
|
||||
self.sync_blocks(self.nodes)
|
||||
self.sync_blocks()
|
||||
force_finish_mnsync(self.nodes[mn_idx])
|
||||
|
||||
self.log.info("Successfully started and synced proTx:"+str(created_mn_info.proTxHash))
|
||||
@ -1283,7 +1283,7 @@ class DashTestFramework(BitcoinTestFramework):
|
||||
collateral_txid = self.nodes[0].sendmany("", outputs)
|
||||
self.wait_for_instantlock(collateral_txid, self.nodes[0])
|
||||
tip = self.generate(self.nodes[0], 1)[0]
|
||||
self.sync_all(self.nodes)
|
||||
self.sync_all()
|
||||
|
||||
rawtx = self.nodes[0].getrawtransaction(collateral_txid, 1, tip)
|
||||
assert_equal(rawtx['confirmations'], 1)
|
||||
@ -1305,7 +1305,7 @@ class DashTestFramework(BitcoinTestFramework):
|
||||
|
||||
self.wait_for_instantlock(protx_result, self.nodes[0])
|
||||
tip = self.generate(self.nodes[0], 1)[0]
|
||||
self.sync_all(self.nodes)
|
||||
self.sync_all()
|
||||
|
||||
assert_equal(self.nodes[0].getrawtransaction(protx_result, 1, tip)['confirmations'], 1)
|
||||
mn_info = MasternodeInfo(protx_result, owner_address, voting_address, reward_address, operatorReward, bls['public'], bls['secret'], collateral_address, collateral_txid, collateral_vout, ipAndPort, evo)
|
||||
@ -1329,7 +1329,7 @@ class DashTestFramework(BitcoinTestFramework):
|
||||
self.wait_for_instantlock(fund_txid, self.nodes[0])
|
||||
tip = self.generate(self.nodes[0], 1)[0]
|
||||
assert_equal(self.nodes[0].getrawtransaction(fund_txid, 1, tip)['confirmations'], 1)
|
||||
self.sync_all(self.nodes)
|
||||
self.sync_all()
|
||||
|
||||
protx_success = False
|
||||
try:
|
||||
@ -1337,7 +1337,7 @@ class DashTestFramework(BitcoinTestFramework):
|
||||
self.wait_for_instantlock(protx_result, self.nodes[0])
|
||||
tip = self.generate(self.nodes[0], 1)[0]
|
||||
assert_equal(self.nodes[0].getrawtransaction(protx_result, 1, tip)['confirmations'], 1)
|
||||
self.sync_all(self.nodes)
|
||||
self.sync_all()
|
||||
self.log.info("Updated EvoNode %s: platformNodeID=%s, platformP2PPort=%s, platformHTTPPort=%s" % (evo_info.proTxHash, platform_node_id, platform_p2p_port, platform_http_port))
|
||||
protx_success = True
|
||||
except:
|
||||
|
Loading…
Reference in New Issue
Block a user