Skip to content

Commit 3bb753f

Browse files
committed
feat: activate mn_rr fork from block 1 on RegTest
1 parent 1a15402 commit 3bb753f

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

src/chainparams.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ class CRegTestParams : public CChainParams {
796796
consensus.DIP0024QuorumsHeight = 1; // Always have dip0024 quorums unless overridden
797797
consensus.V19Height = 1; // Always active unless overriden
798798
consensus.V20Height = consensus.DIP0003Height; // Active not earlier than dip0003. Functional tests (DashTestFramework) uses height 100 (same as coinbase maturity)
799-
consensus.MN_RRHeight = 900;
799+
consensus.MN_RRHeight = 1;
800800
consensus.MinBIP9WarningHeight = 0;
801801
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
802802
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day

src/test/util/setup_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ TestChainSetup::TestChainSetup(int num_blocks, const std::vector<const char*>& e
399399
/*TestChainBRRBeforeActivationSetup=*/
400400
{ 497, uint256S("0x0857a9b5db51835b1c828f019f4c664b5fe6c28ac44a6d868436930f832d31e5") },
401401
/*TestChainV19BeforeActivationSetup=*/
402-
{ 494, uint256S("72c5b8760d9070ca3b6402094dcea76cd25806bc20d1bf3777a7be712e17bbd2") },
402+
{ 494, uint256S("0x06ec12cb5419daf83e04455a24ff8f27fef76cfdbd3e8723ca4946fab91a2f11") },
403403
}
404404
};
405405

test/functional/rpc_masternode.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,24 @@ def run_test(self):
3232
assert_equal(len(payments), 1)
3333
payments_block = payments[0]
3434
payments_block_payees = payments_block["masternodes"][0]["payees"]
35+
36+
num_payees = 0
3537
payments_payee = ""
3638
for i in range(0, len(payments_block_payees)):
39+
if i == 0:
40+
assert_equal(payments_block_payees[i]['script'], '6a')
41+
continue
42+
3743
payments_payee += payments_block_payees[i]["address"]
3844
if i < len(payments_block_payees) - 1:
3945
payments_payee += ", "
46+
num_payees += 1
4047
assert_equal(payments_block["height"], height)
4148
assert_equal(payments_block["blockhash"], blockhash)
4249
assert_equal(winners_payee, payments_payee)
43-
if len(payments_block_payees) == 1:
50+
if num_payees == 1:
4451
checked_0_operator_reward = True
45-
if len(payments_block_payees) > 1:
52+
if num_payees > 1:
4653
checked_non_0_operator_reward = True
4754

4855
self.log.info("test various `payments` RPC options")
@@ -73,15 +80,15 @@ def run_test(self):
7380
while not checked_0_operator_reward or not checked_non_0_operator_reward:
7481
payments_masternode = self.nodes[0].masternode("payments")[0]["masternodes"][0]
7582
protx_info = self.nodes[0].protx("info", payments_masternode["proTxHash"])
76-
if len(payments_masternode["payees"]) == 1:
77-
assert_equal(protx_info["state"]["payoutAddress"], payments_masternode["payees"][0]["address"])
83+
if len(payments_masternode["payees"]) == 2:
84+
assert_equal(protx_info["state"]["payoutAddress"], payments_masternode["payees"][1]["address"])
7885
checked_0_operator_reward = True
7986
else:
80-
assert_equal(len(payments_masternode["payees"]), 2)
81-
option1 = protx_info["state"]["payoutAddress"] == payments_masternode["payees"][0]["address"] and \
87+
assert_equal(len(payments_masternode["payees"]), 3)
88+
option1 = protx_info["state"]["payoutAddress"] == payments_masternode["payees"][1]["address"] and \
89+
protx_info["state"]["operatorPayoutAddress"] == payments_masternode["payees"][2]["address"]
90+
option2 = protx_info["state"]["payoutAddress"] == payments_masternode["payees"][2]["address"] and \
8291
protx_info["state"]["operatorPayoutAddress"] == payments_masternode["payees"][1]["address"]
83-
option2 = protx_info["state"]["payoutAddress"] == payments_masternode["payees"][1]["address"] and \
84-
protx_info["state"]["operatorPayoutAddress"] == payments_masternode["payees"][0]["address"]
8592
assert option1 or option2
8693
checked_non_0_operator_reward = True
8794
self.generate(self.nodes[0], 1, sync_fun=self.no_op)

0 commit comments

Comments
 (0)