test: Fix dynamically_smth_masternode helpers, extend feature_dip3_v19.py (#5402)

## Issue being fixed or feature implemented
fix a couple of issues in helpers, extend feature_dip3_v19.py to check
more after v19 fork

## What was done?
pls see individual PRs


## How Has This Been Tested?
run tests

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
This commit is contained in:
UdjinM6 2023-05-31 23:34:30 +03:00 committed by GitHub
parent 3bf7d2a38c
commit b741f3a4b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 7 deletions

View File

@ -101,8 +101,22 @@ class DIP3V19Test(DashTestFramework):
self.test_revoke_protx(revoke_protx, revoke_keyoperator) self.test_revoke_protx(revoke_protx, revoke_keyoperator)
self.mine_quorum(llmq_type_name='llmq_test', llmq_type=100) self.mine_quorum(llmq_type_name='llmq_test', llmq_type=100)
# revoking a MN results in disconnects, reconnect it back to let sync_blocks finish correctly
self.connect_nodes(hpmn_info_3.nodeIdx, 0)
return self.log.info("Checking that adding more regular MNs after v19 doesn't break DKGs and IS/CLs")
for i in range(6):
new_mn = self.dynamically_add_masternode(hpmn=False, rnd=(10 + i))
assert new_mn is not None
# mine more quorums and make sure everything still works
prev_quorum = None
for _ in range(5):
quorum = self.mine_quorum()
assert prev_quorum != quorum
self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash())
def test_revoke_protx(self, revoke_protx, revoke_keyoperator): def test_revoke_protx(self, revoke_protx, revoke_keyoperator):
funds_address = self.nodes[0].getnewaddress() funds_address = self.nodes[0].getnewaddress()

View File

@ -1120,7 +1120,7 @@ class DashTestFramework(BitcoinTestFramework):
created_mn_info = self.dynamically_prepare_masternode(mn_idx, node_p2p_port, hpmn, rnd) created_mn_info = self.dynamically_prepare_masternode(mn_idx, node_p2p_port, hpmn, rnd)
protx_success = True protx_success = True
except: except:
self.log.info("protx_hpmn rejected") self.log.info("dynamically_prepare_masternode failed")
assert_equal(protx_success, not should_be_rejected) assert_equal(protx_success, not should_be_rejected)
@ -1136,7 +1136,7 @@ class DashTestFramework(BitcoinTestFramework):
for mn_info in self.mninfo: for mn_info in self.mninfo:
if mn_info.proTxHash == created_mn_info.proTxHash: if mn_info.proTxHash == created_mn_info.proTxHash:
mn_info.nodeIx = mn_idx mn_info.nodeIdx = mn_idx
mn_info.node = self.nodes[mn_idx] mn_info.node = self.nodes[mn_idx]
self.connect_nodes(mn_idx, 0) self.connect_nodes(mn_idx, 0)
@ -1157,8 +1157,8 @@ class DashTestFramework(BitcoinTestFramework):
reward_address = self.nodes[0].getnewaddress() reward_address = self.nodes[0].getnewaddress()
platform_node_id = hash160(b'%d' % rnd).hex() if rnd is not None else hash160(b'%d' % node_p2p_port).hex() platform_node_id = hash160(b'%d' % rnd).hex() if rnd is not None else hash160(b'%d' % node_p2p_port).hex()
platform_p2p_port = '%d' % (node_p2p_port + 101) if hpmn else '' platform_p2p_port = '%d' % (node_p2p_port + 101)
platform_http_port = '%d' % (node_p2p_port + 102) if hpmn else '' platform_http_port = '%d' % (node_p2p_port + 102)
collateral_amount = 4000 if hpmn else 1000 collateral_amount = 4000 if hpmn else 1000
outputs = {collateral_address: collateral_amount, funds_address: 1} outputs = {collateral_address: collateral_amount, funds_address: 1}
@ -1179,8 +1179,12 @@ class DashTestFramework(BitcoinTestFramework):
ipAndPort = '127.0.0.1:%d' % node_p2p_port ipAndPort = '127.0.0.1:%d' % node_p2p_port
operatorReward = idx operatorReward = idx
register_rpc = 'register_hpmn' if hpmn else 'register' protx_result = None
protx_result = self.nodes[0].protx(register_rpc, collateral_txid, collateral_vout, ipAndPort, owner_address, bls['public'], voting_address, operatorReward, reward_address, platform_node_id, platform_p2p_port, platform_http_port, funds_address, True) if hpmn:
protx_result = self.nodes[0].protx("register_hpmn", collateral_txid, collateral_vout, ipAndPort, owner_address, bls['public'], voting_address, operatorReward, reward_address, platform_node_id, platform_p2p_port, platform_http_port, funds_address, True)
else:
protx_result = self.nodes[0].protx("register", collateral_txid, collateral_vout, ipAndPort, owner_address, bls['public'], voting_address, operatorReward, reward_address, funds_address, True)
self.wait_for_instantlock(protx_result, self.nodes[0]) self.wait_for_instantlock(protx_result, self.nodes[0])
tip = self.nodes[0].generate(1)[0] tip = self.nodes[0].generate(1)[0]
self.sync_all(self.nodes) self.sync_all(self.nodes)