Skip to content

Commit 68a38ef

Browse files
committed
fixup: for mnoperation.py with setupmasternode config
1 parent 12dac06 commit 68a38ef

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

divi/qa/rpc-tests/masternode.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(self, setup_data,address=None):
6060
if address is not None:
6161
self.address = address
6262

63-
def setup_masternode(mempoolSync,controlNode, hostNode,alias,tier,hostIP, utxo = None):
63+
def setup_masternode(mempoolSync,controlNode, hostNode,alias,tier,hostIP, utxo = None, rewardAddr=""):
6464
"""Calls fundmasternode with the given data and returns the
6565
MnConfigLine instance."""
6666
txdata = None
@@ -77,7 +77,7 @@ def setup_masternode(mempoolSync,controlNode, hostNode,alias,tier,hostIP, utxo =
7777
pubkey = controlNode.validateaddress(address)["pubkey"]
7878
if sync_required:
7979
mempoolSync()
80-
data = hostNode.setupmasternode(alias,txdata["txhash"],str(txdata["vout"]), pubkey, hostIP)
80+
data = hostNode.setupmasternode(alias,txdata["txhash"],str(txdata["vout"]), pubkey, hostIP, rewardAddr)
8181
return MnSetupData (data,address)
8282

8383
class MnTestFramework(BitcoinTestFramework):
@@ -101,12 +101,12 @@ def for_each_masternode(self, masternode_function):
101101

102102
return result
103103

104-
def setup_masternode(self,controlNodeIndex, hostNodeIndex,alias,tier,utxo=None):
104+
def setup_masternode(self,controlNodeIndex, hostNodeIndex,alias,tier,utxo=None, rewardAddr=""):
105105
def mempoolSync():
106106
sync_mempools (self.nodes)
107107
controlNode = self.nodes[controlNodeIndex]
108108
hostNode = self.nodes[hostNodeIndex]
109-
self.setup[hostNodeIndex] = setup_masternode(mempoolSync,controlNode,hostNode,alias, tier,"localhost:%d" % p2p_port (hostNodeIndex),utxo=utxo)
109+
self.setup[hostNodeIndex] = setup_masternode(mempoolSync,controlNode,hostNode,alias, tier,"localhost:%d" % p2p_port (hostNodeIndex),utxo=utxo, rewardAddr=rewardAddr)
110110
self.mn_control_node_indices[alias] = controlNodeIndex
111111
self.mn_host_node_indices[alias] = hostNodeIndex
112112

divi/qa/rpc-tests/mnoperation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ def fund_masternodes (self):
9090
self.mine_blocks (25)
9191
assert_equal (self.nodes[0].getbalance (), 6250)
9292

93+
self.rewardAddr = self.nodes[0].getnewaddress ("reward2")
9394
self.setup_masternode(0,1,"mn1","copper")
94-
self.setup_masternode(0,2,"mn2","silver")
95-
self.setup[1].cfg.rewardAddr = self.nodes[0].getnewaddress ("reward2")
95+
self.setup_masternode(0,2,"mn2","silver",rewardAddr=self.rewardAddr)
9696
self.mine_blocks (15)
9797
set_node_times (self.nodes, self.time)
9898
self.mine_blocks (1)
@@ -182,7 +182,7 @@ def payments_both_active (self):
182182
winners = self.verify_number_of_votes_exist_and_tally_winners(startHeight,endHeight, 2)
183183

184184
addr1 = self.nodes[1].getmasternodestatus ()["addr"]
185-
addr2 = self.setup[1].cfg.rewardAddr
185+
addr2 = self.rewardAddr
186186
assert_equal (len (winners), 2)
187187
assert_greater_than (winners[addr1], 0)
188188
assert_greater_than (winners[addr2], 0)

0 commit comments

Comments
 (0)